ckeditor.js 5.7 MB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412204132041420415204162041720418204192042020421204222042320424204252042620427204282042920430204312043220433204342043520436204372043820439204402044120442204432044420445204462044720448204492045020451204522045320454204552045620457204582045920460204612046220463204642046520466204672046820469204702047120472204732047420475204762047720478204792048020481204822048320484204852048620487204882048920490204912049220493204942049520496204972049820499205002050120502205032050420505205062050720508205092051020511205122051320514205152051620517205182051920520205212052220523205242052520526205272052820529205302053120532205332053420535205362053720538205392054020541205422054320544205452054620547205482054920550205512055220553205542055520556205572055820559205602056120562205632056420565205662056720568205692057020571205722057320574205752057620577205782057920580205812058220583205842058520586205872058820589205902059120592205932059420595205962059720598205992060020601206022060320604206052060620607206082060920610206112061220613206142061520616206172061820619206202062120622206232062420625206262062720628206292063020631206322063320634206352063620637206382063920640206412064220643206442064520646206472064820649206502065120652206532065420655206562065720658206592066020661206622066320664206652066620667206682066920670206712067220673206742067520676206772067820679206802068120682206832068420685206862068720688206892069020691206922069320694206952069620697206982069920700207012070220703207042070520706207072070820709207102071120712207132071420715207162071720718207192072020721207222072320724207252072620727207282072920730207312073220733207342073520736207372073820739207402074120742207432074420745207462074720748207492075020751207522075320754207552075620757207582075920760207612076220763207642076520766207672076820769207702077120772207732077420775207762077720778207792078020781207822078320784207852078620787207882078920790207912079220793207942079520796207972079820799208002080120802208032080420805208062080720808208092081020811208122081320814208152081620817208182081920820208212082220823208242082520826208272082820829208302083120832208332083420835208362083720838208392084020841208422084320844208452084620847208482084920850208512085220853208542085520856208572085820859208602086120862208632086420865208662086720868208692087020871208722087320874208752087620877208782087920880208812088220883208842088520886208872088820889208902089120892208932089420895208962089720898208992090020901209022090320904209052090620907209082090920910209112091220913209142091520916209172091820919209202092120922209232092420925209262092720928209292093020931209322093320934209352093620937209382093920940209412094220943209442094520946209472094820949209502095120952209532095420955209562095720958209592096020961209622096320964209652096620967209682096920970209712097220973209742097520976209772097820979209802098120982209832098420985209862098720988209892099020991209922099320994209952099620997209982099921000210012100221003210042100521006210072100821009210102101121012210132101421015210162101721018210192102021021210222102321024210252102621027210282102921030210312103221033210342103521036210372103821039210402104121042210432104421045210462104721048210492105021051210522105321054210552105621057210582105921060210612106221063210642106521066210672106821069210702107121072210732107421075210762107721078210792108021081210822108321084210852108621087210882108921090210912109221093210942109521096210972109821099211002110121102211032110421105211062110721108211092111021111211122111321114211152111621117211182111921120211212112221123211242112521126211272112821129211302113121132211332113421135211362113721138211392114021141211422114321144211452114621147211482114921150211512115221153211542115521156211572115821159211602116121162211632116421165211662116721168211692117021171211722117321174211752117621177211782117921180211812118221183211842118521186211872118821189211902119121192211932119421195211962119721198211992120021201212022120321204212052120621207212082120921210212112121221213212142121521216212172121821219212202122121222212232122421225212262122721228212292123021231212322123321234212352123621237212382123921240212412124221243212442124521246212472124821249212502125121252212532125421255212562125721258212592126021261212622126321264212652126621267212682126921270212712127221273212742127521276212772127821279212802128121282212832128421285212862128721288212892129021291212922129321294212952129621297212982129921300213012130221303213042130521306213072130821309213102131121312213132131421315213162131721318213192132021321213222132321324213252132621327213282132921330213312133221333213342133521336213372133821339213402134121342213432134421345213462134721348213492135021351213522135321354213552135621357213582135921360213612136221363213642136521366213672136821369213702137121372213732137421375213762137721378213792138021381213822138321384213852138621387213882138921390213912139221393213942139521396213972139821399214002140121402214032140421405214062140721408214092141021411214122141321414214152141621417214182141921420214212142221423214242142521426214272142821429214302143121432214332143421435214362143721438214392144021441214422144321444214452144621447214482144921450214512145221453214542145521456214572145821459214602146121462214632146421465214662146721468214692147021471214722147321474214752147621477214782147921480214812148221483214842148521486214872148821489214902149121492214932149421495214962149721498214992150021501215022150321504215052150621507215082150921510215112151221513215142151521516215172151821519215202152121522215232152421525215262152721528215292153021531215322153321534215352153621537215382153921540215412154221543215442154521546215472154821549215502155121552215532155421555215562155721558215592156021561215622156321564215652156621567215682156921570215712157221573215742157521576215772157821579215802158121582215832158421585215862158721588215892159021591215922159321594215952159621597215982159921600216012160221603216042160521606216072160821609216102161121612216132161421615216162161721618216192162021621216222162321624216252162621627216282162921630216312163221633216342163521636216372163821639216402164121642216432164421645216462164721648216492165021651216522165321654216552165621657216582165921660216612166221663216642166521666216672166821669216702167121672216732167421675216762167721678216792168021681216822168321684216852168621687216882168921690216912169221693216942169521696216972169821699217002170121702217032170421705217062170721708217092171021711217122171321714217152171621717217182171921720217212172221723217242172521726217272172821729217302173121732217332173421735217362173721738217392174021741217422174321744217452174621747217482174921750217512175221753217542175521756217572175821759217602176121762217632176421765217662176721768217692177021771217722177321774217752177621777217782177921780217812178221783217842178521786217872178821789217902179121792217932179421795217962179721798217992180021801218022180321804218052180621807218082180921810218112181221813218142181521816218172181821819218202182121822218232182421825218262182721828218292183021831218322183321834218352183621837218382183921840218412184221843218442184521846218472184821849218502185121852218532185421855218562185721858218592186021861218622186321864218652186621867218682186921870218712187221873218742187521876218772187821879218802188121882218832188421885218862188721888218892189021891218922189321894218952189621897218982189921900219012190221903219042190521906219072190821909219102191121912219132191421915219162191721918219192192021921219222192321924219252192621927219282192921930219312193221933219342193521936219372193821939219402194121942219432194421945219462194721948219492195021951219522195321954219552195621957219582195921960219612196221963219642196521966219672196821969219702197121972219732197421975219762197721978219792198021981219822198321984219852198621987219882198921990219912199221993219942199521996219972199821999220002200122002220032200422005220062200722008220092201022011220122201322014220152201622017220182201922020220212202222023220242202522026220272202822029220302203122032220332203422035220362203722038220392204022041220422204322044220452204622047220482204922050220512205222053220542205522056220572205822059220602206122062220632206422065220662206722068220692207022071220722207322074220752207622077220782207922080220812208222083220842208522086220872208822089220902209122092220932209422095220962209722098220992210022101221022210322104221052210622107221082210922110221112211222113221142211522116221172211822119221202212122122221232212422125221262212722128221292213022131221322213322134221352213622137221382213922140221412214222143221442214522146221472214822149221502215122152221532215422155221562215722158221592216022161221622216322164221652216622167221682216922170221712217222173221742217522176221772217822179221802218122182221832218422185221862218722188221892219022191221922219322194221952219622197221982219922200222012220222203222042220522206222072220822209222102221122212222132221422215222162221722218222192222022221222222222322224222252222622227222282222922230222312223222233222342223522236222372223822239222402224122242222432224422245222462224722248222492225022251222522225322254222552225622257222582225922260222612226222263222642226522266222672226822269222702227122272222732227422275222762227722278222792228022281222822228322284222852228622287222882228922290222912229222293222942229522296222972229822299223002230122302223032230422305223062230722308223092231022311223122231322314223152231622317223182231922320223212232222323223242232522326223272232822329223302233122332223332233422335223362233722338223392234022341223422234322344223452234622347223482234922350223512235222353223542235522356223572235822359223602236122362223632236422365223662236722368223692237022371223722237322374223752237622377223782237922380223812238222383223842238522386223872238822389223902239122392223932239422395223962239722398223992240022401224022240322404224052240622407224082240922410224112241222413224142241522416224172241822419224202242122422224232242422425224262242722428224292243022431224322243322434224352243622437224382243922440224412244222443224442244522446224472244822449224502245122452224532245422455224562245722458224592246022461224622246322464224652246622467224682246922470224712247222473224742247522476224772247822479224802248122482224832248422485224862248722488224892249022491224922249322494224952249622497224982249922500225012250222503225042250522506225072250822509225102251122512225132251422515225162251722518225192252022521225222252322524225252252622527225282252922530225312253222533225342253522536225372253822539225402254122542225432254422545225462254722548225492255022551225522255322554225552255622557225582255922560225612256222563225642256522566225672256822569225702257122572225732257422575225762257722578225792258022581225822258322584225852258622587225882258922590225912259222593225942259522596225972259822599226002260122602226032260422605226062260722608226092261022611226122261322614226152261622617226182261922620226212262222623226242262522626226272262822629226302263122632226332263422635226362263722638226392264022641226422264322644226452264622647226482264922650226512265222653226542265522656226572265822659226602266122662226632266422665226662266722668226692267022671226722267322674226752267622677226782267922680226812268222683226842268522686226872268822689226902269122692226932269422695226962269722698226992270022701227022270322704227052270622707227082270922710227112271222713227142271522716227172271822719227202272122722227232272422725227262272722728227292273022731227322273322734227352273622737227382273922740227412274222743227442274522746227472274822749227502275122752227532275422755227562275722758227592276022761227622276322764227652276622767227682276922770227712277222773227742277522776227772277822779227802278122782227832278422785227862278722788227892279022791227922279322794227952279622797227982279922800228012280222803228042280522806228072280822809228102281122812228132281422815228162281722818228192282022821228222282322824228252282622827228282282922830228312283222833228342283522836228372283822839228402284122842228432284422845228462284722848228492285022851228522285322854228552285622857228582285922860228612286222863228642286522866228672286822869228702287122872228732287422875228762287722878228792288022881228822288322884228852288622887228882288922890228912289222893228942289522896228972289822899229002290122902229032290422905229062290722908229092291022911229122291322914229152291622917229182291922920229212292222923229242292522926229272292822929229302293122932229332293422935229362293722938229392294022941229422294322944229452294622947229482294922950229512295222953229542295522956229572295822959229602296122962229632296422965229662296722968229692297022971229722297322974229752297622977229782297922980229812298222983229842298522986229872298822989229902299122992229932299422995229962299722998229992300023001230022300323004230052300623007230082300923010230112301223013230142301523016230172301823019230202302123022230232302423025230262302723028230292303023031230322303323034230352303623037230382303923040230412304223043230442304523046230472304823049230502305123052230532305423055230562305723058230592306023061230622306323064230652306623067230682306923070230712307223073230742307523076230772307823079230802308123082230832308423085230862308723088230892309023091230922309323094230952309623097230982309923100231012310223103231042310523106231072310823109231102311123112231132311423115231162311723118231192312023121231222312323124231252312623127231282312923130231312313223133231342313523136231372313823139231402314123142231432314423145231462314723148231492315023151231522315323154231552315623157231582315923160231612316223163231642316523166231672316823169231702317123172231732317423175231762317723178231792318023181231822318323184231852318623187231882318923190231912319223193231942319523196231972319823199232002320123202232032320423205232062320723208232092321023211232122321323214232152321623217232182321923220232212322223223232242322523226232272322823229232302323123232232332323423235232362323723238232392324023241232422324323244232452324623247232482324923250232512325223253232542325523256232572325823259232602326123262232632326423265232662326723268232692327023271232722327323274232752327623277232782327923280232812328223283232842328523286232872328823289232902329123292232932329423295232962329723298232992330023301233022330323304233052330623307233082330923310233112331223313233142331523316233172331823319233202332123322233232332423325233262332723328233292333023331233322333323334233352333623337233382333923340233412334223343233442334523346233472334823349233502335123352233532335423355233562335723358233592336023361233622336323364233652336623367233682336923370233712337223373233742337523376233772337823379233802338123382233832338423385233862338723388233892339023391233922339323394233952339623397233982339923400234012340223403234042340523406234072340823409234102341123412234132341423415234162341723418234192342023421234222342323424234252342623427234282342923430234312343223433234342343523436234372343823439234402344123442234432344423445234462344723448234492345023451234522345323454234552345623457234582345923460234612346223463234642346523466234672346823469234702347123472234732347423475234762347723478234792348023481234822348323484234852348623487234882348923490234912349223493234942349523496234972349823499235002350123502235032350423505235062350723508235092351023511235122351323514235152351623517235182351923520235212352223523235242352523526235272352823529235302353123532235332353423535235362353723538235392354023541235422354323544235452354623547235482354923550235512355223553235542355523556235572355823559235602356123562235632356423565235662356723568235692357023571235722357323574235752357623577235782357923580235812358223583235842358523586235872358823589235902359123592235932359423595235962359723598235992360023601236022360323604236052360623607236082360923610236112361223613236142361523616236172361823619236202362123622236232362423625236262362723628236292363023631236322363323634236352363623637236382363923640236412364223643236442364523646236472364823649236502365123652236532365423655236562365723658236592366023661236622366323664236652366623667236682366923670236712367223673236742367523676236772367823679236802368123682236832368423685236862368723688236892369023691236922369323694236952369623697236982369923700237012370223703237042370523706237072370823709237102371123712237132371423715237162371723718237192372023721237222372323724237252372623727237282372923730237312373223733237342373523736237372373823739237402374123742237432374423745237462374723748237492375023751237522375323754237552375623757237582375923760237612376223763237642376523766237672376823769237702377123772237732377423775237762377723778237792378023781237822378323784237852378623787237882378923790237912379223793237942379523796237972379823799238002380123802238032380423805238062380723808238092381023811238122381323814238152381623817238182381923820238212382223823238242382523826238272382823829238302383123832238332383423835238362383723838238392384023841238422384323844238452384623847238482384923850238512385223853238542385523856238572385823859238602386123862238632386423865238662386723868238692387023871238722387323874238752387623877238782387923880238812388223883238842388523886238872388823889238902389123892238932389423895238962389723898238992390023901239022390323904239052390623907239082390923910239112391223913239142391523916239172391823919239202392123922239232392423925239262392723928239292393023931239322393323934239352393623937239382393923940239412394223943239442394523946239472394823949239502395123952239532395423955239562395723958239592396023961239622396323964239652396623967239682396923970239712397223973239742397523976239772397823979239802398123982239832398423985239862398723988239892399023991239922399323994239952399623997239982399924000240012400224003240042400524006240072400824009240102401124012240132401424015240162401724018240192402024021240222402324024240252402624027240282402924030240312403224033240342403524036240372403824039240402404124042240432404424045240462404724048240492405024051240522405324054240552405624057240582405924060240612406224063240642406524066240672406824069240702407124072240732407424075240762407724078240792408024081240822408324084240852408624087240882408924090240912409224093240942409524096240972409824099241002410124102241032410424105241062410724108241092411024111241122411324114241152411624117241182411924120241212412224123241242412524126241272412824129241302413124132241332413424135241362413724138241392414024141241422414324144241452414624147241482414924150241512415224153241542415524156241572415824159241602416124162241632416424165241662416724168241692417024171241722417324174241752417624177241782417924180241812418224183241842418524186241872418824189241902419124192241932419424195241962419724198241992420024201242022420324204242052420624207242082420924210242112421224213242142421524216242172421824219242202422124222242232422424225242262422724228242292423024231242322423324234242352423624237242382423924240242412424224243242442424524246242472424824249242502425124252242532425424255242562425724258242592426024261242622426324264242652426624267242682426924270242712427224273242742427524276242772427824279242802428124282242832428424285242862428724288242892429024291242922429324294242952429624297242982429924300243012430224303243042430524306243072430824309243102431124312243132431424315243162431724318243192432024321243222432324324243252432624327243282432924330243312433224333243342433524336243372433824339243402434124342243432434424345243462434724348243492435024351243522435324354243552435624357243582435924360243612436224363243642436524366243672436824369243702437124372243732437424375243762437724378243792438024381243822438324384243852438624387243882438924390243912439224393243942439524396243972439824399244002440124402244032440424405244062440724408244092441024411244122441324414244152441624417244182441924420244212442224423244242442524426244272442824429244302443124432244332443424435244362443724438244392444024441244422444324444244452444624447244482444924450244512445224453244542445524456244572445824459244602446124462244632446424465244662446724468244692447024471244722447324474244752447624477244782447924480244812448224483244842448524486244872448824489244902449124492244932449424495244962449724498244992450024501245022450324504245052450624507245082450924510245112451224513245142451524516245172451824519245202452124522245232452424525245262452724528245292453024531245322453324534245352453624537245382453924540245412454224543245442454524546245472454824549245502455124552245532455424555245562455724558245592456024561245622456324564245652456624567245682456924570245712457224573245742457524576245772457824579245802458124582245832458424585245862458724588245892459024591245922459324594245952459624597245982459924600246012460224603246042460524606246072460824609246102461124612246132461424615246162461724618246192462024621246222462324624246252462624627246282462924630246312463224633246342463524636246372463824639246402464124642246432464424645246462464724648246492465024651246522465324654246552465624657246582465924660246612466224663246642466524666246672466824669246702467124672246732467424675246762467724678246792468024681246822468324684246852468624687246882468924690246912469224693246942469524696246972469824699247002470124702247032470424705247062470724708247092471024711247122471324714247152471624717247182471924720247212472224723247242472524726247272472824729247302473124732247332473424735247362473724738247392474024741247422474324744247452474624747247482474924750247512475224753247542475524756247572475824759247602476124762247632476424765247662476724768247692477024771247722477324774247752477624777247782477924780247812478224783247842478524786247872478824789247902479124792247932479424795247962479724798247992480024801248022480324804248052480624807248082480924810248112481224813248142481524816248172481824819248202482124822248232482424825248262482724828248292483024831248322483324834248352483624837248382483924840248412484224843248442484524846248472484824849248502485124852248532485424855248562485724858248592486024861248622486324864248652486624867248682486924870248712487224873248742487524876248772487824879248802488124882248832488424885248862488724888248892489024891248922489324894248952489624897248982489924900249012490224903249042490524906249072490824909249102491124912249132491424915249162491724918249192492024921249222492324924249252492624927249282492924930249312493224933249342493524936249372493824939249402494124942249432494424945249462494724948249492495024951249522495324954249552495624957249582495924960249612496224963249642496524966249672496824969249702497124972249732497424975249762497724978249792498024981249822498324984249852498624987249882498924990249912499224993249942499524996249972499824999250002500125002250032500425005250062500725008250092501025011250122501325014250152501625017250182501925020250212502225023250242502525026250272502825029250302503125032250332503425035250362503725038250392504025041250422504325044250452504625047250482504925050250512505225053250542505525056250572505825059250602506125062250632506425065250662506725068250692507025071250722507325074250752507625077250782507925080250812508225083250842508525086250872508825089250902509125092250932509425095250962509725098250992510025101251022510325104251052510625107251082510925110251112511225113251142511525116251172511825119251202512125122251232512425125251262512725128251292513025131251322513325134251352513625137251382513925140251412514225143251442514525146251472514825149251502515125152251532515425155251562515725158251592516025161251622516325164251652516625167251682516925170251712517225173251742517525176251772517825179251802518125182251832518425185251862518725188251892519025191251922519325194251952519625197251982519925200252012520225203252042520525206252072520825209252102521125212252132521425215252162521725218252192522025221252222522325224252252522625227252282522925230252312523225233252342523525236252372523825239252402524125242252432524425245252462524725248252492525025251252522525325254252552525625257252582525925260252612526225263252642526525266252672526825269252702527125272252732527425275252762527725278252792528025281252822528325284252852528625287252882528925290252912529225293252942529525296252972529825299253002530125302253032530425305253062530725308253092531025311253122531325314253152531625317253182531925320253212532225323253242532525326253272532825329253302533125332253332533425335253362533725338253392534025341253422534325344253452534625347253482534925350253512535225353253542535525356253572535825359253602536125362253632536425365253662536725368253692537025371253722537325374253752537625377253782537925380253812538225383253842538525386253872538825389253902539125392253932539425395253962539725398253992540025401254022540325404254052540625407254082540925410254112541225413254142541525416254172541825419254202542125422254232542425425254262542725428254292543025431254322543325434254352543625437254382543925440254412544225443254442544525446254472544825449254502545125452254532545425455254562545725458254592546025461254622546325464254652546625467254682546925470254712547225473254742547525476254772547825479254802548125482254832548425485254862548725488254892549025491254922549325494254952549625497254982549925500255012550225503255042550525506255072550825509255102551125512255132551425515255162551725518255192552025521255222552325524255252552625527255282552925530255312553225533255342553525536255372553825539255402554125542255432554425545255462554725548255492555025551255522555325554255552555625557255582555925560255612556225563255642556525566255672556825569255702557125572255732557425575255762557725578255792558025581255822558325584255852558625587255882558925590255912559225593255942559525596255972559825599256002560125602256032560425605256062560725608256092561025611256122561325614256152561625617256182561925620256212562225623256242562525626256272562825629256302563125632256332563425635256362563725638256392564025641256422564325644256452564625647256482564925650256512565225653256542565525656256572565825659256602566125662256632566425665256662566725668256692567025671256722567325674256752567625677256782567925680256812568225683256842568525686256872568825689256902569125692256932569425695256962569725698256992570025701257022570325704257052570625707257082570925710257112571225713257142571525716257172571825719257202572125722257232572425725257262572725728257292573025731257322573325734257352573625737257382573925740257412574225743257442574525746257472574825749257502575125752257532575425755257562575725758257592576025761257622576325764257652576625767257682576925770257712577225773257742577525776257772577825779257802578125782257832578425785257862578725788257892579025791257922579325794257952579625797257982579925800258012580225803258042580525806258072580825809258102581125812258132581425815258162581725818258192582025821258222582325824258252582625827258282582925830258312583225833258342583525836258372583825839258402584125842258432584425845258462584725848258492585025851258522585325854258552585625857258582585925860258612586225863258642586525866258672586825869258702587125872258732587425875258762587725878258792588025881258822588325884258852588625887258882588925890258912589225893258942589525896258972589825899259002590125902259032590425905259062590725908259092591025911259122591325914259152591625917259182591925920259212592225923259242592525926259272592825929259302593125932259332593425935259362593725938259392594025941259422594325944259452594625947259482594925950259512595225953259542595525956259572595825959259602596125962259632596425965259662596725968259692597025971259722597325974259752597625977259782597925980259812598225983259842598525986259872598825989259902599125992259932599425995259962599725998259992600026001260022600326004260052600626007260082600926010260112601226013260142601526016260172601826019260202602126022260232602426025260262602726028260292603026031260322603326034260352603626037260382603926040260412604226043260442604526046260472604826049260502605126052260532605426055260562605726058260592606026061260622606326064260652606626067260682606926070260712607226073260742607526076260772607826079260802608126082260832608426085260862608726088260892609026091260922609326094260952609626097260982609926100261012610226103261042610526106261072610826109261102611126112261132611426115261162611726118261192612026121261222612326124261252612626127261282612926130261312613226133261342613526136261372613826139261402614126142261432614426145261462614726148261492615026151261522615326154261552615626157261582615926160261612616226163261642616526166261672616826169261702617126172261732617426175261762617726178261792618026181261822618326184261852618626187261882618926190261912619226193261942619526196261972619826199262002620126202262032620426205262062620726208262092621026211262122621326214262152621626217262182621926220262212622226223262242622526226262272622826229262302623126232262332623426235262362623726238262392624026241262422624326244262452624626247262482624926250262512625226253262542625526256262572625826259262602626126262262632626426265262662626726268262692627026271262722627326274262752627626277262782627926280262812628226283262842628526286262872628826289262902629126292262932629426295262962629726298262992630026301263022630326304263052630626307263082630926310263112631226313263142631526316263172631826319263202632126322263232632426325263262632726328263292633026331263322633326334263352633626337263382633926340263412634226343263442634526346263472634826349263502635126352263532635426355263562635726358263592636026361263622636326364263652636626367263682636926370263712637226373263742637526376263772637826379263802638126382263832638426385263862638726388263892639026391263922639326394263952639626397263982639926400264012640226403264042640526406264072640826409264102641126412264132641426415264162641726418264192642026421264222642326424264252642626427264282642926430264312643226433264342643526436264372643826439264402644126442264432644426445264462644726448264492645026451264522645326454264552645626457264582645926460264612646226463264642646526466264672646826469264702647126472264732647426475264762647726478264792648026481264822648326484264852648626487264882648926490264912649226493264942649526496264972649826499265002650126502265032650426505265062650726508265092651026511265122651326514265152651626517265182651926520265212652226523265242652526526265272652826529265302653126532265332653426535265362653726538265392654026541265422654326544265452654626547265482654926550265512655226553265542655526556265572655826559265602656126562265632656426565265662656726568265692657026571265722657326574265752657626577265782657926580265812658226583265842658526586265872658826589265902659126592265932659426595265962659726598265992660026601266022660326604266052660626607266082660926610266112661226613266142661526616266172661826619266202662126622266232662426625266262662726628266292663026631266322663326634266352663626637266382663926640266412664226643266442664526646266472664826649266502665126652266532665426655266562665726658266592666026661266622666326664266652666626667266682666926670266712667226673266742667526676266772667826679266802668126682266832668426685266862668726688266892669026691266922669326694266952669626697266982669926700267012670226703267042670526706267072670826709267102671126712267132671426715267162671726718267192672026721267222672326724267252672626727267282672926730267312673226733267342673526736267372673826739267402674126742267432674426745267462674726748267492675026751267522675326754267552675626757267582675926760267612676226763267642676526766267672676826769267702677126772267732677426775267762677726778267792678026781267822678326784267852678626787267882678926790267912679226793267942679526796267972679826799268002680126802268032680426805268062680726808268092681026811268122681326814268152681626817268182681926820268212682226823268242682526826268272682826829268302683126832268332683426835268362683726838268392684026841268422684326844268452684626847268482684926850268512685226853268542685526856268572685826859268602686126862268632686426865268662686726868268692687026871268722687326874268752687626877268782687926880268812688226883268842688526886268872688826889268902689126892268932689426895268962689726898268992690026901269022690326904269052690626907269082690926910269112691226913269142691526916269172691826919269202692126922269232692426925269262692726928269292693026931269322693326934269352693626937269382693926940269412694226943269442694526946269472694826949269502695126952269532695426955269562695726958269592696026961269622696326964269652696626967269682696926970269712697226973269742697526976269772697826979269802698126982269832698426985269862698726988269892699026991269922699326994269952699626997269982699927000270012700227003270042700527006270072700827009270102701127012270132701427015270162701727018270192702027021270222702327024270252702627027270282702927030270312703227033270342703527036270372703827039270402704127042270432704427045270462704727048270492705027051270522705327054270552705627057270582705927060270612706227063270642706527066270672706827069270702707127072270732707427075270762707727078270792708027081270822708327084270852708627087270882708927090270912709227093270942709527096270972709827099271002710127102271032710427105271062710727108271092711027111271122711327114271152711627117271182711927120271212712227123271242712527126271272712827129271302713127132271332713427135271362713727138271392714027141271422714327144271452714627147271482714927150271512715227153271542715527156271572715827159271602716127162271632716427165271662716727168271692717027171271722717327174271752717627177271782717927180271812718227183271842718527186271872718827189271902719127192271932719427195271962719727198271992720027201272022720327204272052720627207272082720927210272112721227213272142721527216272172721827219272202722127222272232722427225272262722727228272292723027231272322723327234272352723627237272382723927240272412724227243272442724527246272472724827249272502725127252272532725427255272562725727258272592726027261272622726327264272652726627267272682726927270272712727227273272742727527276272772727827279272802728127282272832728427285272862728727288272892729027291272922729327294272952729627297272982729927300273012730227303273042730527306273072730827309273102731127312273132731427315273162731727318273192732027321273222732327324273252732627327273282732927330273312733227333273342733527336273372733827339273402734127342273432734427345273462734727348273492735027351273522735327354273552735627357273582735927360273612736227363273642736527366273672736827369273702737127372273732737427375273762737727378273792738027381273822738327384273852738627387273882738927390273912739227393273942739527396273972739827399274002740127402274032740427405274062740727408274092741027411274122741327414274152741627417274182741927420274212742227423274242742527426274272742827429274302743127432274332743427435274362743727438274392744027441274422744327444274452744627447274482744927450274512745227453274542745527456274572745827459274602746127462274632746427465274662746727468274692747027471274722747327474274752747627477274782747927480274812748227483274842748527486274872748827489274902749127492274932749427495274962749727498274992750027501275022750327504275052750627507275082750927510275112751227513275142751527516275172751827519275202752127522275232752427525275262752727528275292753027531275322753327534275352753627537275382753927540275412754227543275442754527546275472754827549275502755127552275532755427555275562755727558275592756027561275622756327564275652756627567275682756927570275712757227573275742757527576275772757827579275802758127582275832758427585275862758727588275892759027591275922759327594275952759627597275982759927600276012760227603276042760527606276072760827609276102761127612276132761427615276162761727618276192762027621276222762327624276252762627627276282762927630276312763227633276342763527636276372763827639276402764127642276432764427645276462764727648276492765027651276522765327654276552765627657276582765927660276612766227663276642766527666276672766827669276702767127672276732767427675276762767727678276792768027681276822768327684276852768627687276882768927690276912769227693276942769527696276972769827699277002770127702277032770427705277062770727708277092771027711277122771327714277152771627717277182771927720277212772227723277242772527726277272772827729277302773127732277332773427735277362773727738277392774027741277422774327744277452774627747277482774927750277512775227753277542775527756277572775827759277602776127762277632776427765277662776727768277692777027771277722777327774277752777627777277782777927780277812778227783277842778527786277872778827789277902779127792277932779427795277962779727798277992780027801278022780327804278052780627807278082780927810278112781227813278142781527816278172781827819278202782127822278232782427825278262782727828278292783027831278322783327834278352783627837278382783927840278412784227843278442784527846278472784827849278502785127852278532785427855278562785727858278592786027861278622786327864278652786627867278682786927870278712787227873278742787527876278772787827879278802788127882278832788427885278862788727888278892789027891278922789327894278952789627897278982789927900279012790227903279042790527906279072790827909279102791127912279132791427915279162791727918279192792027921279222792327924279252792627927279282792927930279312793227933279342793527936279372793827939279402794127942279432794427945279462794727948279492795027951279522795327954279552795627957279582795927960279612796227963279642796527966279672796827969279702797127972279732797427975279762797727978279792798027981279822798327984279852798627987279882798927990279912799227993279942799527996279972799827999280002800128002280032800428005280062800728008280092801028011280122801328014280152801628017280182801928020280212802228023280242802528026280272802828029280302803128032280332803428035280362803728038280392804028041280422804328044280452804628047280482804928050280512805228053280542805528056280572805828059280602806128062280632806428065280662806728068280692807028071280722807328074280752807628077280782807928080280812808228083280842808528086280872808828089280902809128092280932809428095280962809728098280992810028101281022810328104281052810628107281082810928110281112811228113281142811528116281172811828119281202812128122281232812428125281262812728128281292813028131281322813328134281352813628137281382813928140281412814228143281442814528146281472814828149281502815128152281532815428155281562815728158281592816028161281622816328164281652816628167281682816928170281712817228173281742817528176281772817828179281802818128182281832818428185281862818728188281892819028191281922819328194281952819628197281982819928200282012820228203282042820528206282072820828209282102821128212282132821428215282162821728218282192822028221282222822328224282252822628227282282822928230282312823228233282342823528236282372823828239282402824128242282432824428245282462824728248282492825028251282522825328254282552825628257282582825928260282612826228263282642826528266282672826828269282702827128272282732827428275282762827728278282792828028281282822828328284282852828628287282882828928290282912829228293282942829528296282972829828299283002830128302283032830428305283062830728308283092831028311283122831328314283152831628317283182831928320283212832228323283242832528326283272832828329283302833128332283332833428335283362833728338283392834028341283422834328344283452834628347283482834928350283512835228353283542835528356283572835828359283602836128362283632836428365283662836728368283692837028371283722837328374283752837628377283782837928380283812838228383283842838528386283872838828389283902839128392283932839428395283962839728398283992840028401284022840328404284052840628407284082840928410284112841228413284142841528416284172841828419284202842128422284232842428425284262842728428284292843028431284322843328434284352843628437284382843928440284412844228443284442844528446284472844828449284502845128452284532845428455284562845728458284592846028461284622846328464284652846628467284682846928470284712847228473284742847528476284772847828479284802848128482284832848428485284862848728488284892849028491284922849328494284952849628497284982849928500285012850228503285042850528506285072850828509285102851128512285132851428515285162851728518285192852028521285222852328524285252852628527285282852928530285312853228533285342853528536285372853828539285402854128542285432854428545285462854728548285492855028551285522855328554285552855628557285582855928560285612856228563285642856528566285672856828569285702857128572285732857428575285762857728578285792858028581285822858328584285852858628587285882858928590285912859228593285942859528596285972859828599286002860128602286032860428605286062860728608286092861028611286122861328614286152861628617286182861928620286212862228623286242862528626286272862828629286302863128632286332863428635286362863728638286392864028641286422864328644286452864628647286482864928650286512865228653286542865528656286572865828659286602866128662286632866428665286662866728668286692867028671286722867328674286752867628677286782867928680286812868228683286842868528686286872868828689286902869128692286932869428695286962869728698286992870028701287022870328704287052870628707287082870928710287112871228713287142871528716287172871828719287202872128722287232872428725287262872728728287292873028731287322873328734287352873628737287382873928740287412874228743287442874528746287472874828749287502875128752287532875428755287562875728758287592876028761287622876328764287652876628767287682876928770287712877228773287742877528776287772877828779287802878128782287832878428785287862878728788287892879028791287922879328794287952879628797287982879928800288012880228803288042880528806288072880828809288102881128812288132881428815288162881728818288192882028821288222882328824288252882628827288282882928830288312883228833288342883528836288372883828839288402884128842288432884428845288462884728848288492885028851288522885328854288552885628857288582885928860288612886228863288642886528866288672886828869288702887128872288732887428875288762887728878288792888028881288822888328884288852888628887288882888928890288912889228893288942889528896288972889828899289002890128902289032890428905289062890728908289092891028911289122891328914289152891628917289182891928920289212892228923289242892528926289272892828929289302893128932289332893428935289362893728938289392894028941289422894328944289452894628947289482894928950289512895228953289542895528956289572895828959289602896128962289632896428965289662896728968289692897028971289722897328974289752897628977289782897928980289812898228983289842898528986289872898828989289902899128992289932899428995289962899728998289992900029001290022900329004290052900629007290082900929010290112901229013290142901529016290172901829019290202902129022290232902429025290262902729028290292903029031290322903329034290352903629037290382903929040290412904229043290442904529046290472904829049290502905129052290532905429055290562905729058290592906029061290622906329064290652906629067290682906929070290712907229073290742907529076290772907829079290802908129082290832908429085290862908729088290892909029091290922909329094290952909629097290982909929100291012910229103291042910529106291072910829109291102911129112291132911429115291162911729118291192912029121291222912329124291252912629127291282912929130291312913229133291342913529136291372913829139291402914129142291432914429145291462914729148291492915029151291522915329154291552915629157291582915929160291612916229163291642916529166291672916829169291702917129172291732917429175291762917729178291792918029181291822918329184291852918629187291882918929190291912919229193291942919529196291972919829199292002920129202292032920429205292062920729208292092921029211292122921329214292152921629217292182921929220292212922229223292242922529226292272922829229292302923129232292332923429235292362923729238292392924029241292422924329244292452924629247292482924929250292512925229253292542925529256292572925829259292602926129262292632926429265292662926729268292692927029271292722927329274292752927629277292782927929280292812928229283292842928529286292872928829289292902929129292292932929429295292962929729298292992930029301293022930329304293052930629307293082930929310293112931229313293142931529316293172931829319293202932129322293232932429325293262932729328293292933029331293322933329334293352933629337293382933929340293412934229343293442934529346293472934829349293502935129352293532935429355293562935729358293592936029361293622936329364293652936629367293682936929370293712937229373293742937529376293772937829379293802938129382293832938429385293862938729388293892939029391293922939329394293952939629397293982939929400294012940229403294042940529406294072940829409294102941129412294132941429415294162941729418294192942029421294222942329424294252942629427294282942929430294312943229433294342943529436294372943829439294402944129442294432944429445294462944729448294492945029451294522945329454294552945629457294582945929460294612946229463294642946529466294672946829469294702947129472294732947429475294762947729478294792948029481294822948329484294852948629487294882948929490294912949229493294942949529496294972949829499295002950129502295032950429505295062950729508295092951029511295122951329514295152951629517295182951929520295212952229523295242952529526295272952829529295302953129532295332953429535295362953729538295392954029541295422954329544295452954629547295482954929550295512955229553295542955529556295572955829559295602956129562295632956429565295662956729568295692957029571295722957329574295752957629577295782957929580295812958229583295842958529586295872958829589295902959129592295932959429595295962959729598295992960029601296022960329604296052960629607296082960929610296112961229613296142961529616296172961829619296202962129622296232962429625296262962729628296292963029631296322963329634296352963629637296382963929640296412964229643296442964529646296472964829649296502965129652296532965429655296562965729658296592966029661296622966329664296652966629667296682966929670296712967229673296742967529676296772967829679296802968129682296832968429685296862968729688296892969029691296922969329694296952969629697296982969929700297012970229703297042970529706297072970829709297102971129712297132971429715297162971729718297192972029721297222972329724297252972629727297282972929730297312973229733297342973529736297372973829739297402974129742297432974429745297462974729748297492975029751297522975329754297552975629757297582975929760297612976229763297642976529766297672976829769297702977129772297732977429775297762977729778297792978029781297822978329784297852978629787297882978929790297912979229793297942979529796297972979829799298002980129802298032980429805298062980729808298092981029811298122981329814298152981629817298182981929820298212982229823298242982529826298272982829829298302983129832298332983429835298362983729838298392984029841298422984329844298452984629847298482984929850298512985229853298542985529856298572985829859298602986129862298632986429865298662986729868298692987029871298722987329874298752987629877298782987929880298812988229883298842988529886298872988829889298902989129892298932989429895298962989729898298992990029901299022990329904299052990629907299082990929910299112991229913299142991529916299172991829919299202992129922299232992429925299262992729928299292993029931299322993329934299352993629937299382993929940299412994229943299442994529946299472994829949299502995129952299532995429955299562995729958299592996029961299622996329964299652996629967299682996929970299712997229973299742997529976299772997829979299802998129982299832998429985299862998729988299892999029991299922999329994299952999629997299982999930000300013000230003300043000530006300073000830009300103001130012300133001430015300163001730018300193002030021300223002330024300253002630027300283002930030300313003230033300343003530036300373003830039300403004130042300433004430045300463004730048300493005030051300523005330054300553005630057300583005930060300613006230063300643006530066300673006830069300703007130072300733007430075300763007730078300793008030081300823008330084300853008630087300883008930090300913009230093300943009530096300973009830099301003010130102301033010430105301063010730108301093011030111301123011330114301153011630117301183011930120301213012230123301243012530126301273012830129301303013130132301333013430135301363013730138301393014030141301423014330144301453014630147301483014930150301513015230153301543015530156301573015830159301603016130162301633016430165301663016730168301693017030171301723017330174301753017630177301783017930180301813018230183301843018530186301873018830189301903019130192301933019430195301963019730198301993020030201302023020330204302053020630207302083020930210302113021230213302143021530216302173021830219302203022130222302233022430225302263022730228302293023030231302323023330234302353023630237302383023930240302413024230243302443024530246302473024830249302503025130252302533025430255302563025730258302593026030261302623026330264302653026630267302683026930270302713027230273302743027530276302773027830279302803028130282302833028430285302863028730288302893029030291302923029330294302953029630297302983029930300303013030230303303043030530306303073030830309303103031130312303133031430315303163031730318303193032030321303223032330324303253032630327303283032930330303313033230333303343033530336303373033830339303403034130342303433034430345303463034730348303493035030351303523035330354303553035630357303583035930360303613036230363303643036530366303673036830369303703037130372303733037430375303763037730378303793038030381303823038330384303853038630387303883038930390303913039230393303943039530396303973039830399304003040130402304033040430405304063040730408304093041030411304123041330414304153041630417304183041930420304213042230423304243042530426304273042830429304303043130432304333043430435304363043730438304393044030441304423044330444304453044630447304483044930450304513045230453304543045530456304573045830459304603046130462304633046430465304663046730468304693047030471304723047330474304753047630477304783047930480304813048230483304843048530486304873048830489304903049130492304933049430495304963049730498304993050030501305023050330504305053050630507305083050930510305113051230513305143051530516305173051830519305203052130522305233052430525305263052730528305293053030531305323053330534305353053630537305383053930540305413054230543305443054530546305473054830549305503055130552305533055430555305563055730558305593056030561305623056330564305653056630567305683056930570305713057230573305743057530576305773057830579305803058130582305833058430585305863058730588305893059030591305923059330594305953059630597305983059930600306013060230603306043060530606306073060830609306103061130612306133061430615306163061730618306193062030621306223062330624306253062630627306283062930630306313063230633306343063530636306373063830639306403064130642306433064430645306463064730648306493065030651306523065330654306553065630657306583065930660306613066230663306643066530666306673066830669306703067130672306733067430675306763067730678306793068030681306823068330684306853068630687306883068930690306913069230693306943069530696306973069830699307003070130702307033070430705307063070730708307093071030711307123071330714307153071630717307183071930720307213072230723307243072530726307273072830729307303073130732307333073430735307363073730738307393074030741307423074330744307453074630747307483074930750307513075230753307543075530756307573075830759307603076130762307633076430765307663076730768307693077030771307723077330774307753077630777307783077930780307813078230783307843078530786307873078830789307903079130792307933079430795307963079730798307993080030801308023080330804308053080630807308083080930810308113081230813308143081530816308173081830819308203082130822308233082430825308263082730828308293083030831308323083330834308353083630837308383083930840308413084230843308443084530846308473084830849308503085130852308533085430855308563085730858308593086030861308623086330864308653086630867308683086930870308713087230873308743087530876308773087830879308803088130882308833088430885308863088730888308893089030891308923089330894308953089630897308983089930900309013090230903309043090530906309073090830909309103091130912309133091430915309163091730918309193092030921309223092330924309253092630927309283092930930309313093230933309343093530936309373093830939309403094130942309433094430945309463094730948309493095030951309523095330954309553095630957309583095930960309613096230963309643096530966309673096830969309703097130972309733097430975309763097730978309793098030981309823098330984309853098630987309883098930990309913099230993309943099530996309973099830999310003100131002310033100431005310063100731008310093101031011310123101331014310153101631017310183101931020310213102231023310243102531026310273102831029310303103131032310333103431035310363103731038310393104031041310423104331044310453104631047310483104931050310513105231053310543105531056310573105831059310603106131062310633106431065310663106731068310693107031071310723107331074310753107631077310783107931080310813108231083310843108531086310873108831089310903109131092310933109431095310963109731098310993110031101311023110331104311053110631107311083110931110311113111231113311143111531116311173111831119311203112131122311233112431125311263112731128311293113031131311323113331134311353113631137311383113931140311413114231143311443114531146311473114831149311503115131152311533115431155311563115731158311593116031161311623116331164311653116631167311683116931170311713117231173311743117531176311773117831179311803118131182311833118431185311863118731188311893119031191311923119331194311953119631197311983119931200312013120231203312043120531206312073120831209312103121131212312133121431215312163121731218312193122031221312223122331224312253122631227312283122931230312313123231233312343123531236312373123831239312403124131242312433124431245312463124731248312493125031251312523125331254312553125631257312583125931260312613126231263312643126531266312673126831269312703127131272312733127431275312763127731278312793128031281312823128331284312853128631287312883128931290312913129231293312943129531296312973129831299313003130131302313033130431305313063130731308313093131031311313123131331314313153131631317313183131931320313213132231323313243132531326313273132831329313303133131332313333133431335313363133731338313393134031341313423134331344313453134631347313483134931350313513135231353313543135531356313573135831359313603136131362313633136431365313663136731368313693137031371313723137331374313753137631377313783137931380313813138231383313843138531386313873138831389313903139131392313933139431395313963139731398313993140031401314023140331404314053140631407314083140931410314113141231413314143141531416314173141831419314203142131422314233142431425314263142731428314293143031431314323143331434314353143631437314383143931440314413144231443314443144531446314473144831449314503145131452314533145431455314563145731458314593146031461314623146331464314653146631467314683146931470314713147231473314743147531476314773147831479314803148131482314833148431485314863148731488314893149031491314923149331494314953149631497314983149931500315013150231503315043150531506315073150831509315103151131512315133151431515315163151731518315193152031521315223152331524315253152631527315283152931530315313153231533315343153531536315373153831539315403154131542315433154431545315463154731548315493155031551315523155331554315553155631557315583155931560315613156231563315643156531566315673156831569315703157131572315733157431575315763157731578315793158031581315823158331584315853158631587315883158931590315913159231593315943159531596315973159831599316003160131602316033160431605316063160731608316093161031611316123161331614316153161631617316183161931620316213162231623316243162531626316273162831629316303163131632316333163431635316363163731638316393164031641316423164331644316453164631647316483164931650316513165231653316543165531656316573165831659316603166131662316633166431665316663166731668316693167031671316723167331674316753167631677316783167931680316813168231683316843168531686316873168831689316903169131692316933169431695316963169731698316993170031701317023170331704317053170631707317083170931710317113171231713317143171531716317173171831719317203172131722317233172431725317263172731728317293173031731317323173331734317353173631737317383173931740317413174231743317443174531746317473174831749317503175131752317533175431755317563175731758317593176031761317623176331764317653176631767317683176931770317713177231773317743177531776317773177831779317803178131782317833178431785317863178731788317893179031791317923179331794317953179631797317983179931800318013180231803318043180531806318073180831809318103181131812318133181431815318163181731818318193182031821318223182331824318253182631827318283182931830318313183231833318343183531836318373183831839318403184131842318433184431845318463184731848318493185031851318523185331854318553185631857318583185931860318613186231863318643186531866318673186831869318703187131872318733187431875318763187731878318793188031881318823188331884318853188631887318883188931890318913189231893318943189531896318973189831899319003190131902319033190431905319063190731908319093191031911319123191331914319153191631917319183191931920319213192231923319243192531926319273192831929319303193131932319333193431935319363193731938319393194031941319423194331944319453194631947319483194931950319513195231953319543195531956319573195831959319603196131962319633196431965319663196731968319693197031971319723197331974319753197631977319783197931980319813198231983319843198531986319873198831989319903199131992319933199431995319963199731998319993200032001320023200332004320053200632007320083200932010320113201232013320143201532016320173201832019320203202132022320233202432025320263202732028320293203032031320323203332034320353203632037320383203932040320413204232043320443204532046320473204832049320503205132052320533205432055320563205732058320593206032061320623206332064320653206632067320683206932070320713207232073320743207532076320773207832079320803208132082320833208432085320863208732088320893209032091320923209332094320953209632097320983209932100321013210232103321043210532106321073210832109321103211132112321133211432115321163211732118321193212032121321223212332124321253212632127321283212932130321313213232133321343213532136321373213832139321403214132142321433214432145321463214732148321493215032151321523215332154321553215632157321583215932160321613216232163321643216532166321673216832169321703217132172321733217432175321763217732178321793218032181321823218332184321853218632187321883218932190321913219232193321943219532196321973219832199322003220132202322033220432205322063220732208322093221032211322123221332214322153221632217322183221932220322213222232223322243222532226322273222832229322303223132232322333223432235322363223732238322393224032241322423224332244322453224632247322483224932250322513225232253322543225532256322573225832259322603226132262322633226432265322663226732268322693227032271322723227332274322753227632277322783227932280322813228232283322843228532286322873228832289322903229132292322933229432295322963229732298322993230032301323023230332304323053230632307323083230932310323113231232313323143231532316323173231832319323203232132322323233232432325323263232732328323293233032331323323233332334323353233632337323383233932340323413234232343323443234532346323473234832349323503235132352323533235432355323563235732358323593236032361323623236332364323653236632367323683236932370323713237232373323743237532376323773237832379323803238132382323833238432385323863238732388323893239032391323923239332394323953239632397323983239932400324013240232403324043240532406324073240832409324103241132412324133241432415324163241732418324193242032421324223242332424324253242632427324283242932430324313243232433324343243532436324373243832439324403244132442324433244432445324463244732448324493245032451324523245332454324553245632457324583245932460324613246232463324643246532466324673246832469324703247132472324733247432475324763247732478324793248032481324823248332484324853248632487324883248932490324913249232493324943249532496324973249832499325003250132502325033250432505325063250732508325093251032511325123251332514325153251632517325183251932520325213252232523325243252532526325273252832529325303253132532325333253432535325363253732538325393254032541325423254332544325453254632547325483254932550325513255232553325543255532556325573255832559325603256132562325633256432565325663256732568325693257032571325723257332574325753257632577325783257932580325813258232583325843258532586325873258832589325903259132592325933259432595325963259732598325993260032601326023260332604326053260632607326083260932610326113261232613326143261532616326173261832619326203262132622326233262432625326263262732628326293263032631326323263332634326353263632637326383263932640326413264232643326443264532646326473264832649326503265132652326533265432655326563265732658326593266032661326623266332664326653266632667326683266932670326713267232673326743267532676326773267832679326803268132682326833268432685326863268732688326893269032691326923269332694326953269632697326983269932700327013270232703327043270532706327073270832709327103271132712327133271432715327163271732718327193272032721327223272332724327253272632727327283272932730327313273232733327343273532736327373273832739327403274132742327433274432745327463274732748327493275032751327523275332754327553275632757327583275932760327613276232763327643276532766327673276832769327703277132772327733277432775327763277732778327793278032781327823278332784327853278632787327883278932790327913279232793327943279532796327973279832799328003280132802328033280432805328063280732808328093281032811328123281332814328153281632817328183281932820328213282232823328243282532826328273282832829328303283132832328333283432835328363283732838328393284032841328423284332844328453284632847328483284932850328513285232853328543285532856328573285832859328603286132862328633286432865328663286732868328693287032871328723287332874328753287632877328783287932880328813288232883328843288532886328873288832889328903289132892328933289432895328963289732898328993290032901329023290332904329053290632907329083290932910329113291232913329143291532916329173291832919329203292132922329233292432925329263292732928329293293032931329323293332934329353293632937329383293932940329413294232943329443294532946329473294832949329503295132952329533295432955329563295732958329593296032961329623296332964329653296632967329683296932970329713297232973329743297532976329773297832979329803298132982329833298432985329863298732988329893299032991329923299332994329953299632997329983299933000330013300233003330043300533006330073300833009330103301133012330133301433015330163301733018330193302033021330223302333024330253302633027330283302933030330313303233033330343303533036330373303833039330403304133042330433304433045330463304733048330493305033051330523305333054330553305633057330583305933060330613306233063330643306533066330673306833069330703307133072330733307433075330763307733078330793308033081330823308333084330853308633087330883308933090330913309233093330943309533096330973309833099331003310133102331033310433105331063310733108331093311033111331123311333114331153311633117331183311933120331213312233123331243312533126331273312833129331303313133132331333313433135331363313733138331393314033141331423314333144331453314633147331483314933150331513315233153331543315533156331573315833159331603316133162331633316433165331663316733168331693317033171331723317333174331753317633177331783317933180331813318233183331843318533186331873318833189331903319133192331933319433195331963319733198331993320033201332023320333204332053320633207332083320933210332113321233213332143321533216332173321833219332203322133222332233322433225332263322733228332293323033231332323323333234332353323633237332383323933240332413324233243332443324533246332473324833249332503325133252332533325433255332563325733258332593326033261332623326333264332653326633267332683326933270332713327233273332743327533276332773327833279332803328133282332833328433285332863328733288332893329033291332923329333294332953329633297332983329933300333013330233303333043330533306333073330833309333103331133312333133331433315333163331733318333193332033321333223332333324333253332633327333283332933330333313333233333333343333533336333373333833339333403334133342333433334433345333463334733348333493335033351333523335333354333553335633357333583335933360333613336233363333643336533366333673336833369333703337133372333733337433375333763337733378333793338033381333823338333384333853338633387333883338933390333913339233393333943339533396333973339833399334003340133402334033340433405334063340733408334093341033411334123341333414334153341633417334183341933420334213342233423334243342533426334273342833429334303343133432334333343433435334363343733438334393344033441334423344333444334453344633447334483344933450334513345233453334543345533456334573345833459334603346133462334633346433465334663346733468334693347033471334723347333474334753347633477334783347933480334813348233483334843348533486334873348833489334903349133492334933349433495334963349733498334993350033501335023350333504335053350633507335083350933510335113351233513335143351533516335173351833519335203352133522335233352433525335263352733528335293353033531335323353333534335353353633537335383353933540335413354233543335443354533546335473354833549335503355133552335533355433555335563355733558335593356033561335623356333564335653356633567335683356933570335713357233573335743357533576335773357833579335803358133582335833358433585335863358733588335893359033591335923359333594335953359633597335983359933600336013360233603336043360533606336073360833609336103361133612336133361433615336163361733618336193362033621336223362333624336253362633627336283362933630336313363233633336343363533636336373363833639336403364133642336433364433645336463364733648336493365033651336523365333654336553365633657336583365933660336613366233663336643366533666336673366833669336703367133672336733367433675336763367733678336793368033681336823368333684336853368633687336883368933690336913369233693336943369533696336973369833699337003370133702337033370433705337063370733708337093371033711337123371333714337153371633717337183371933720337213372233723337243372533726337273372833729337303373133732337333373433735337363373733738337393374033741337423374333744337453374633747337483374933750337513375233753337543375533756337573375833759337603376133762337633376433765337663376733768337693377033771337723377333774337753377633777337783377933780337813378233783337843378533786337873378833789337903379133792337933379433795337963379733798337993380033801338023380333804338053380633807338083380933810338113381233813338143381533816338173381833819338203382133822338233382433825338263382733828338293383033831338323383333834338353383633837338383383933840338413384233843338443384533846338473384833849338503385133852338533385433855338563385733858338593386033861338623386333864338653386633867338683386933870338713387233873338743387533876338773387833879338803388133882338833388433885338863388733888338893389033891338923389333894338953389633897338983389933900339013390233903339043390533906339073390833909339103391133912339133391433915339163391733918339193392033921339223392333924339253392633927339283392933930339313393233933339343393533936339373393833939339403394133942339433394433945339463394733948339493395033951339523395333954339553395633957339583395933960339613396233963339643396533966339673396833969339703397133972339733397433975339763397733978339793398033981339823398333984339853398633987339883398933990339913399233993339943399533996339973399833999340003400134002340033400434005340063400734008340093401034011340123401334014340153401634017340183401934020340213402234023340243402534026340273402834029340303403134032340333403434035340363403734038340393404034041340423404334044340453404634047340483404934050340513405234053340543405534056340573405834059340603406134062340633406434065340663406734068340693407034071340723407334074340753407634077340783407934080340813408234083340843408534086340873408834089340903409134092340933409434095340963409734098340993410034101341023410334104341053410634107341083410934110341113411234113341143411534116341173411834119341203412134122341233412434125341263412734128341293413034131341323413334134341353413634137341383413934140341413414234143341443414534146341473414834149341503415134152341533415434155341563415734158341593416034161341623416334164341653416634167341683416934170341713417234173341743417534176341773417834179341803418134182341833418434185341863418734188341893419034191341923419334194341953419634197341983419934200342013420234203342043420534206342073420834209342103421134212342133421434215342163421734218342193422034221342223422334224342253422634227342283422934230342313423234233342343423534236342373423834239342403424134242342433424434245342463424734248342493425034251342523425334254342553425634257342583425934260342613426234263342643426534266342673426834269342703427134272342733427434275342763427734278342793428034281342823428334284342853428634287342883428934290342913429234293342943429534296342973429834299343003430134302343033430434305343063430734308343093431034311343123431334314343153431634317343183431934320343213432234323343243432534326343273432834329343303433134332343333433434335343363433734338343393434034341343423434334344343453434634347343483434934350343513435234353343543435534356343573435834359343603436134362343633436434365343663436734368343693437034371343723437334374343753437634377343783437934380343813438234383343843438534386343873438834389343903439134392343933439434395343963439734398343993440034401344023440334404344053440634407344083440934410344113441234413344143441534416344173441834419344203442134422344233442434425344263442734428344293443034431344323443334434344353443634437344383443934440344413444234443344443444534446344473444834449344503445134452344533445434455344563445734458344593446034461344623446334464344653446634467344683446934470344713447234473344743447534476344773447834479344803448134482344833448434485344863448734488344893449034491344923449334494344953449634497344983449934500345013450234503345043450534506345073450834509345103451134512345133451434515345163451734518345193452034521345223452334524345253452634527345283452934530345313453234533345343453534536345373453834539345403454134542345433454434545345463454734548345493455034551345523455334554345553455634557345583455934560345613456234563345643456534566345673456834569345703457134572345733457434575345763457734578345793458034581345823458334584345853458634587345883458934590345913459234593345943459534596345973459834599346003460134602346033460434605346063460734608346093461034611346123461334614346153461634617346183461934620346213462234623346243462534626346273462834629346303463134632346333463434635346363463734638346393464034641346423464334644346453464634647346483464934650346513465234653346543465534656346573465834659346603466134662346633466434665346663466734668346693467034671346723467334674346753467634677346783467934680346813468234683346843468534686346873468834689346903469134692346933469434695346963469734698346993470034701347023470334704347053470634707347083470934710347113471234713347143471534716347173471834719347203472134722347233472434725347263472734728347293473034731347323473334734347353473634737347383473934740347413474234743347443474534746347473474834749347503475134752347533475434755347563475734758347593476034761347623476334764347653476634767347683476934770347713477234773347743477534776347773477834779347803478134782347833478434785347863478734788347893479034791347923479334794347953479634797347983479934800348013480234803348043480534806348073480834809348103481134812348133481434815348163481734818348193482034821348223482334824348253482634827348283482934830348313483234833348343483534836348373483834839348403484134842348433484434845348463484734848348493485034851348523485334854348553485634857348583485934860348613486234863348643486534866348673486834869348703487134872348733487434875348763487734878348793488034881348823488334884348853488634887348883488934890348913489234893348943489534896348973489834899349003490134902349033490434905349063490734908349093491034911349123491334914349153491634917349183491934920349213492234923349243492534926349273492834929349303493134932349333493434935349363493734938349393494034941349423494334944349453494634947349483494934950349513495234953349543495534956349573495834959349603496134962349633496434965349663496734968349693497034971349723497334974349753497634977349783497934980349813498234983349843498534986349873498834989349903499134992349933499434995349963499734998349993500035001350023500335004350053500635007350083500935010350113501235013350143501535016350173501835019350203502135022350233502435025350263502735028350293503035031350323503335034350353503635037350383503935040350413504235043350443504535046350473504835049350503505135052350533505435055350563505735058350593506035061350623506335064350653506635067350683506935070350713507235073350743507535076350773507835079350803508135082350833508435085350863508735088350893509035091350923509335094350953509635097350983509935100351013510235103351043510535106351073510835109351103511135112351133511435115351163511735118351193512035121351223512335124351253512635127351283512935130351313513235133351343513535136351373513835139351403514135142351433514435145351463514735148351493515035151351523515335154351553515635157351583515935160351613516235163351643516535166351673516835169351703517135172351733517435175351763517735178351793518035181351823518335184351853518635187351883518935190351913519235193351943519535196351973519835199352003520135202352033520435205352063520735208352093521035211352123521335214352153521635217352183521935220352213522235223352243522535226352273522835229352303523135232352333523435235352363523735238352393524035241352423524335244352453524635247352483524935250352513525235253352543525535256352573525835259352603526135262352633526435265352663526735268352693527035271352723527335274352753527635277352783527935280352813528235283352843528535286352873528835289352903529135292352933529435295352963529735298352993530035301353023530335304353053530635307353083530935310353113531235313353143531535316353173531835319353203532135322353233532435325353263532735328353293533035331353323533335334353353533635337353383533935340353413534235343353443534535346353473534835349353503535135352353533535435355353563535735358353593536035361353623536335364353653536635367353683536935370353713537235373353743537535376353773537835379353803538135382353833538435385353863538735388353893539035391353923539335394353953539635397353983539935400354013540235403354043540535406354073540835409354103541135412354133541435415354163541735418354193542035421354223542335424354253542635427354283542935430354313543235433354343543535436354373543835439354403544135442354433544435445354463544735448354493545035451354523545335454354553545635457354583545935460354613546235463354643546535466354673546835469354703547135472354733547435475354763547735478354793548035481354823548335484354853548635487354883548935490354913549235493354943549535496354973549835499355003550135502355033550435505355063550735508355093551035511355123551335514355153551635517355183551935520355213552235523355243552535526355273552835529355303553135532355333553435535355363553735538355393554035541355423554335544355453554635547355483554935550355513555235553355543555535556355573555835559355603556135562355633556435565355663556735568355693557035571355723557335574355753557635577355783557935580355813558235583355843558535586355873558835589355903559135592355933559435595355963559735598355993560035601356023560335604356053560635607356083560935610356113561235613356143561535616356173561835619356203562135622356233562435625356263562735628356293563035631356323563335634356353563635637356383563935640356413564235643356443564535646356473564835649356503565135652356533565435655356563565735658356593566035661356623566335664356653566635667356683566935670356713567235673356743567535676356773567835679356803568135682356833568435685356863568735688356893569035691356923569335694356953569635697356983569935700357013570235703357043570535706357073570835709357103571135712357133571435715357163571735718357193572035721357223572335724357253572635727357283572935730357313573235733357343573535736357373573835739357403574135742357433574435745357463574735748357493575035751357523575335754357553575635757357583575935760357613576235763357643576535766357673576835769357703577135772357733577435775357763577735778357793578035781357823578335784357853578635787357883578935790357913579235793357943579535796357973579835799358003580135802358033580435805358063580735808358093581035811358123581335814358153581635817358183581935820358213582235823358243582535826358273582835829358303583135832358333583435835358363583735838358393584035841358423584335844358453584635847358483584935850358513585235853358543585535856358573585835859358603586135862358633586435865358663586735868358693587035871358723587335874358753587635877358783587935880358813588235883358843588535886358873588835889358903589135892358933589435895358963589735898358993590035901359023590335904359053590635907359083590935910359113591235913359143591535916359173591835919359203592135922359233592435925359263592735928359293593035931359323593335934359353593635937359383593935940359413594235943359443594535946359473594835949359503595135952359533595435955359563595735958359593596035961359623596335964359653596635967359683596935970359713597235973359743597535976359773597835979359803598135982359833598435985359863598735988359893599035991359923599335994359953599635997359983599936000360013600236003360043600536006360073600836009360103601136012360133601436015360163601736018360193602036021360223602336024360253602636027360283602936030360313603236033360343603536036360373603836039360403604136042360433604436045360463604736048360493605036051360523605336054360553605636057360583605936060360613606236063360643606536066360673606836069360703607136072360733607436075360763607736078360793608036081360823608336084360853608636087360883608936090360913609236093360943609536096360973609836099361003610136102361033610436105361063610736108361093611036111361123611336114361153611636117361183611936120361213612236123361243612536126361273612836129361303613136132361333613436135361363613736138361393614036141361423614336144361453614636147361483614936150361513615236153361543615536156361573615836159361603616136162361633616436165361663616736168361693617036171361723617336174361753617636177361783617936180361813618236183361843618536186361873618836189361903619136192361933619436195361963619736198361993620036201362023620336204362053620636207362083620936210362113621236213362143621536216362173621836219362203622136222362233622436225362263622736228362293623036231362323623336234362353623636237362383623936240362413624236243362443624536246362473624836249362503625136252362533625436255362563625736258362593626036261362623626336264362653626636267362683626936270362713627236273362743627536276362773627836279362803628136282362833628436285362863628736288362893629036291362923629336294362953629636297362983629936300363013630236303363043630536306363073630836309363103631136312363133631436315363163631736318363193632036321363223632336324363253632636327363283632936330363313633236333363343633536336363373633836339363403634136342363433634436345363463634736348363493635036351363523635336354363553635636357363583635936360363613636236363363643636536366363673636836369363703637136372363733637436375363763637736378363793638036381363823638336384363853638636387363883638936390363913639236393363943639536396363973639836399364003640136402364033640436405364063640736408364093641036411364123641336414364153641636417364183641936420364213642236423364243642536426364273642836429364303643136432364333643436435364363643736438364393644036441364423644336444364453644636447364483644936450364513645236453364543645536456364573645836459364603646136462364633646436465364663646736468364693647036471364723647336474364753647636477364783647936480364813648236483364843648536486364873648836489364903649136492364933649436495364963649736498364993650036501365023650336504365053650636507365083650936510365113651236513365143651536516365173651836519365203652136522365233652436525365263652736528365293653036531365323653336534365353653636537365383653936540365413654236543365443654536546365473654836549365503655136552365533655436555365563655736558365593656036561365623656336564365653656636567365683656936570365713657236573365743657536576365773657836579365803658136582365833658436585365863658736588365893659036591365923659336594365953659636597365983659936600366013660236603366043660536606366073660836609366103661136612366133661436615366163661736618366193662036621366223662336624366253662636627366283662936630366313663236633366343663536636366373663836639366403664136642366433664436645366463664736648366493665036651366523665336654366553665636657366583665936660366613666236663366643666536666366673666836669366703667136672366733667436675366763667736678366793668036681366823668336684366853668636687366883668936690366913669236693366943669536696366973669836699367003670136702367033670436705367063670736708367093671036711367123671336714367153671636717367183671936720367213672236723367243672536726367273672836729367303673136732367333673436735367363673736738367393674036741367423674336744367453674636747367483674936750367513675236753367543675536756367573675836759367603676136762367633676436765367663676736768367693677036771367723677336774367753677636777367783677936780367813678236783367843678536786367873678836789367903679136792367933679436795367963679736798367993680036801368023680336804368053680636807368083680936810368113681236813368143681536816368173681836819368203682136822368233682436825368263682736828368293683036831368323683336834368353683636837368383683936840368413684236843368443684536846368473684836849368503685136852368533685436855368563685736858368593686036861368623686336864368653686636867368683686936870368713687236873368743687536876368773687836879368803688136882368833688436885368863688736888368893689036891368923689336894368953689636897368983689936900369013690236903369043690536906369073690836909369103691136912369133691436915369163691736918369193692036921369223692336924369253692636927369283692936930369313693236933369343693536936369373693836939369403694136942369433694436945369463694736948369493695036951369523695336954369553695636957369583695936960369613696236963369643696536966369673696836969369703697136972369733697436975369763697736978369793698036981369823698336984369853698636987369883698936990369913699236993369943699536996369973699836999370003700137002370033700437005370063700737008370093701037011370123701337014370153701637017370183701937020370213702237023370243702537026370273702837029370303703137032370333703437035370363703737038370393704037041370423704337044370453704637047370483704937050370513705237053370543705537056370573705837059370603706137062370633706437065370663706737068370693707037071370723707337074370753707637077370783707937080370813708237083370843708537086370873708837089370903709137092370933709437095370963709737098370993710037101371023710337104371053710637107371083710937110371113711237113371143711537116371173711837119371203712137122371233712437125371263712737128371293713037131371323713337134371353713637137371383713937140371413714237143371443714537146371473714837149371503715137152371533715437155371563715737158371593716037161371623716337164371653716637167371683716937170371713717237173371743717537176371773717837179371803718137182371833718437185371863718737188371893719037191371923719337194371953719637197371983719937200372013720237203372043720537206372073720837209372103721137212372133721437215372163721737218372193722037221372223722337224372253722637227372283722937230372313723237233372343723537236372373723837239372403724137242372433724437245372463724737248372493725037251372523725337254372553725637257372583725937260372613726237263372643726537266372673726837269372703727137272372733727437275372763727737278372793728037281372823728337284372853728637287372883728937290372913729237293372943729537296372973729837299373003730137302373033730437305373063730737308373093731037311373123731337314373153731637317373183731937320373213732237323373243732537326373273732837329373303733137332373333733437335373363733737338373393734037341373423734337344373453734637347373483734937350373513735237353373543735537356373573735837359373603736137362373633736437365373663736737368373693737037371373723737337374373753737637377373783737937380373813738237383373843738537386373873738837389373903739137392373933739437395373963739737398373993740037401374023740337404374053740637407374083740937410374113741237413374143741537416374173741837419374203742137422374233742437425374263742737428374293743037431374323743337434374353743637437374383743937440374413744237443374443744537446374473744837449374503745137452374533745437455374563745737458374593746037461374623746337464374653746637467374683746937470374713747237473374743747537476374773747837479374803748137482374833748437485374863748737488374893749037491374923749337494374953749637497374983749937500375013750237503375043750537506375073750837509375103751137512375133751437515375163751737518375193752037521375223752337524375253752637527375283752937530375313753237533375343753537536375373753837539375403754137542375433754437545375463754737548375493755037551375523755337554375553755637557375583755937560375613756237563375643756537566375673756837569375703757137572375733757437575375763757737578375793758037581375823758337584375853758637587375883758937590375913759237593375943759537596375973759837599376003760137602376033760437605376063760737608376093761037611376123761337614376153761637617376183761937620376213762237623376243762537626376273762837629376303763137632376333763437635376363763737638376393764037641376423764337644376453764637647376483764937650376513765237653376543765537656376573765837659376603766137662376633766437665376663766737668376693767037671376723767337674376753767637677376783767937680376813768237683376843768537686376873768837689376903769137692376933769437695376963769737698376993770037701377023770337704377053770637707377083770937710377113771237713377143771537716377173771837719377203772137722377233772437725377263772737728377293773037731377323773337734377353773637737377383773937740377413774237743377443774537746377473774837749377503775137752377533775437755377563775737758377593776037761377623776337764377653776637767377683776937770377713777237773377743777537776377773777837779377803778137782377833778437785377863778737788377893779037791377923779337794377953779637797377983779937800378013780237803378043780537806378073780837809378103781137812378133781437815378163781737818378193782037821378223782337824378253782637827378283782937830378313783237833378343783537836378373783837839378403784137842378433784437845378463784737848378493785037851378523785337854378553785637857378583785937860378613786237863378643786537866378673786837869378703787137872378733787437875378763787737878378793788037881378823788337884378853788637887378883788937890378913789237893378943789537896378973789837899379003790137902379033790437905379063790737908379093791037911379123791337914379153791637917379183791937920379213792237923379243792537926379273792837929379303793137932379333793437935379363793737938379393794037941379423794337944379453794637947379483794937950379513795237953379543795537956379573795837959379603796137962379633796437965379663796737968379693797037971379723797337974379753797637977379783797937980379813798237983379843798537986379873798837989379903799137992379933799437995379963799737998379993800038001380023800338004380053800638007380083800938010380113801238013380143801538016380173801838019380203802138022380233802438025380263802738028380293803038031380323803338034380353803638037380383803938040380413804238043380443804538046380473804838049380503805138052380533805438055380563805738058380593806038061380623806338064380653806638067380683806938070380713807238073380743807538076380773807838079380803808138082380833808438085380863808738088380893809038091380923809338094380953809638097380983809938100381013810238103381043810538106381073810838109381103811138112381133811438115381163811738118381193812038121381223812338124381253812638127381283812938130381313813238133381343813538136381373813838139381403814138142381433814438145381463814738148381493815038151381523815338154381553815638157381583815938160381613816238163381643816538166381673816838169381703817138172381733817438175381763817738178381793818038181381823818338184381853818638187381883818938190381913819238193381943819538196381973819838199382003820138202382033820438205382063820738208382093821038211382123821338214382153821638217382183821938220382213822238223382243822538226382273822838229382303823138232382333823438235382363823738238382393824038241382423824338244382453824638247382483824938250382513825238253382543825538256382573825838259382603826138262382633826438265382663826738268382693827038271382723827338274382753827638277382783827938280382813828238283382843828538286382873828838289382903829138292382933829438295382963829738298382993830038301383023830338304383053830638307383083830938310383113831238313383143831538316383173831838319383203832138322383233832438325383263832738328383293833038331383323833338334383353833638337383383833938340383413834238343383443834538346383473834838349383503835138352383533835438355383563835738358383593836038361383623836338364383653836638367383683836938370383713837238373383743837538376383773837838379383803838138382383833838438385383863838738388383893839038391383923839338394383953839638397383983839938400384013840238403384043840538406384073840838409384103841138412384133841438415384163841738418384193842038421384223842338424384253842638427384283842938430384313843238433384343843538436384373843838439384403844138442384433844438445384463844738448384493845038451384523845338454384553845638457384583845938460384613846238463384643846538466384673846838469384703847138472384733847438475384763847738478384793848038481384823848338484384853848638487384883848938490384913849238493384943849538496384973849838499385003850138502385033850438505385063850738508385093851038511385123851338514385153851638517385183851938520385213852238523385243852538526385273852838529385303853138532385333853438535385363853738538385393854038541385423854338544385453854638547385483854938550385513855238553385543855538556385573855838559385603856138562385633856438565385663856738568385693857038571385723857338574385753857638577385783857938580385813858238583385843858538586385873858838589385903859138592385933859438595385963859738598385993860038601386023860338604386053860638607386083860938610386113861238613386143861538616386173861838619386203862138622386233862438625386263862738628386293863038631386323863338634386353863638637386383863938640386413864238643386443864538646386473864838649386503865138652386533865438655386563865738658386593866038661386623866338664386653866638667386683866938670386713867238673386743867538676386773867838679386803868138682386833868438685386863868738688386893869038691386923869338694386953869638697386983869938700387013870238703387043870538706387073870838709387103871138712387133871438715387163871738718387193872038721387223872338724387253872638727387283872938730387313873238733387343873538736387373873838739387403874138742387433874438745387463874738748387493875038751387523875338754387553875638757387583875938760387613876238763387643876538766387673876838769387703877138772387733877438775387763877738778387793878038781387823878338784387853878638787387883878938790387913879238793387943879538796387973879838799388003880138802388033880438805388063880738808388093881038811388123881338814388153881638817388183881938820388213882238823388243882538826388273882838829388303883138832388333883438835388363883738838388393884038841388423884338844388453884638847388483884938850388513885238853388543885538856388573885838859388603886138862388633886438865388663886738868388693887038871388723887338874388753887638877388783887938880388813888238883388843888538886388873888838889388903889138892388933889438895388963889738898388993890038901389023890338904389053890638907389083890938910389113891238913389143891538916389173891838919389203892138922389233892438925389263892738928389293893038931389323893338934389353893638937389383893938940389413894238943389443894538946389473894838949389503895138952389533895438955389563895738958389593896038961389623896338964389653896638967389683896938970389713897238973389743897538976389773897838979389803898138982389833898438985389863898738988389893899038991389923899338994389953899638997389983899939000390013900239003390043900539006390073900839009390103901139012390133901439015390163901739018390193902039021390223902339024390253902639027390283902939030390313903239033390343903539036390373903839039390403904139042390433904439045390463904739048390493905039051390523905339054390553905639057390583905939060390613906239063390643906539066390673906839069390703907139072390733907439075390763907739078390793908039081390823908339084390853908639087390883908939090390913909239093390943909539096390973909839099391003910139102391033910439105391063910739108391093911039111391123911339114391153911639117391183911939120391213912239123391243912539126391273912839129391303913139132391333913439135391363913739138391393914039141391423914339144391453914639147391483914939150391513915239153391543915539156391573915839159391603916139162391633916439165391663916739168391693917039171391723917339174391753917639177391783917939180391813918239183391843918539186391873918839189391903919139192391933919439195391963919739198391993920039201392023920339204392053920639207392083920939210392113921239213392143921539216392173921839219392203922139222392233922439225392263922739228392293923039231392323923339234392353923639237392383923939240392413924239243392443924539246392473924839249392503925139252392533925439255392563925739258392593926039261392623926339264392653926639267392683926939270392713927239273392743927539276392773927839279392803928139282392833928439285392863928739288392893929039291392923929339294392953929639297392983929939300393013930239303393043930539306393073930839309393103931139312393133931439315393163931739318393193932039321393223932339324393253932639327393283932939330393313933239333393343933539336393373933839339393403934139342393433934439345393463934739348393493935039351393523935339354393553935639357393583935939360393613936239363393643936539366393673936839369393703937139372393733937439375393763937739378393793938039381393823938339384393853938639387393883938939390393913939239393393943939539396393973939839399394003940139402394033940439405394063940739408394093941039411394123941339414394153941639417394183941939420394213942239423394243942539426394273942839429394303943139432394333943439435394363943739438394393944039441394423944339444394453944639447394483944939450394513945239453394543945539456394573945839459394603946139462394633946439465394663946739468394693947039471394723947339474394753947639477394783947939480394813948239483394843948539486394873948839489394903949139492394933949439495394963949739498394993950039501395023950339504395053950639507395083950939510395113951239513395143951539516395173951839519395203952139522395233952439525395263952739528395293953039531395323953339534395353953639537395383953939540395413954239543395443954539546395473954839549395503955139552395533955439555395563955739558395593956039561395623956339564395653956639567395683956939570395713957239573395743957539576395773957839579395803958139582395833958439585395863958739588395893959039591395923959339594395953959639597395983959939600396013960239603396043960539606396073960839609396103961139612396133961439615396163961739618396193962039621396223962339624396253962639627396283962939630396313963239633396343963539636396373963839639396403964139642396433964439645396463964739648396493965039651396523965339654396553965639657396583965939660396613966239663396643966539666396673966839669396703967139672396733967439675396763967739678396793968039681396823968339684396853968639687396883968939690396913969239693396943969539696396973969839699397003970139702397033970439705397063970739708397093971039711397123971339714397153971639717397183971939720397213972239723397243972539726397273972839729397303973139732397333973439735397363973739738397393974039741397423974339744397453974639747397483974939750397513975239753397543975539756397573975839759397603976139762397633976439765397663976739768397693977039771397723977339774397753977639777397783977939780397813978239783397843978539786397873978839789397903979139792397933979439795397963979739798397993980039801398023980339804398053980639807398083980939810398113981239813398143981539816398173981839819398203982139822398233982439825398263982739828398293983039831398323983339834398353983639837398383983939840398413984239843398443984539846398473984839849398503985139852398533985439855398563985739858398593986039861398623986339864398653986639867398683986939870398713987239873398743987539876398773987839879398803988139882398833988439885398863988739888398893989039891398923989339894398953989639897398983989939900399013990239903399043990539906399073990839909399103991139912399133991439915399163991739918399193992039921399223992339924399253992639927399283992939930399313993239933399343993539936399373993839939399403994139942399433994439945399463994739948399493995039951399523995339954399553995639957399583995939960399613996239963399643996539966399673996839969399703997139972399733997439975399763997739978399793998039981399823998339984399853998639987399883998939990399913999239993399943999539996399973999839999400004000140002400034000440005400064000740008400094001040011400124001340014400154001640017400184001940020400214002240023400244002540026400274002840029400304003140032400334003440035400364003740038400394004040041400424004340044400454004640047400484004940050400514005240053400544005540056400574005840059400604006140062400634006440065400664006740068400694007040071400724007340074400754007640077400784007940080400814008240083400844008540086400874008840089400904009140092400934009440095400964009740098400994010040101401024010340104401054010640107401084010940110401114011240113401144011540116401174011840119401204012140122401234012440125401264012740128401294013040131401324013340134401354013640137401384013940140401414014240143401444014540146401474014840149401504015140152401534015440155401564015740158401594016040161401624016340164401654016640167401684016940170401714017240173401744017540176401774017840179401804018140182401834018440185401864018740188401894019040191401924019340194401954019640197401984019940200402014020240203402044020540206402074020840209402104021140212402134021440215402164021740218402194022040221402224022340224402254022640227402284022940230402314023240233402344023540236402374023840239402404024140242402434024440245402464024740248402494025040251402524025340254402554025640257402584025940260402614026240263402644026540266402674026840269402704027140272402734027440275402764027740278402794028040281402824028340284402854028640287402884028940290402914029240293402944029540296402974029840299403004030140302403034030440305403064030740308403094031040311403124031340314403154031640317403184031940320403214032240323403244032540326403274032840329403304033140332403334033440335403364033740338403394034040341403424034340344403454034640347403484034940350403514035240353403544035540356403574035840359403604036140362403634036440365403664036740368403694037040371403724037340374403754037640377403784037940380403814038240383403844038540386403874038840389403904039140392403934039440395403964039740398403994040040401404024040340404404054040640407404084040940410404114041240413404144041540416404174041840419404204042140422404234042440425404264042740428404294043040431404324043340434404354043640437404384043940440404414044240443404444044540446404474044840449404504045140452404534045440455404564045740458404594046040461404624046340464404654046640467404684046940470404714047240473404744047540476404774047840479404804048140482404834048440485404864048740488404894049040491404924049340494404954049640497404984049940500405014050240503405044050540506405074050840509405104051140512405134051440515405164051740518405194052040521405224052340524405254052640527405284052940530405314053240533405344053540536405374053840539405404054140542405434054440545405464054740548405494055040551405524055340554405554055640557405584055940560405614056240563405644056540566405674056840569405704057140572405734057440575405764057740578405794058040581405824058340584405854058640587405884058940590405914059240593405944059540596405974059840599406004060140602406034060440605406064060740608406094061040611406124061340614406154061640617406184061940620406214062240623406244062540626406274062840629406304063140632406334063440635406364063740638406394064040641406424064340644406454064640647406484064940650406514065240653406544065540656406574065840659406604066140662406634066440665406664066740668406694067040671406724067340674406754067640677406784067940680406814068240683406844068540686406874068840689406904069140692406934069440695406964069740698406994070040701407024070340704407054070640707407084070940710407114071240713407144071540716407174071840719407204072140722407234072440725407264072740728407294073040731407324073340734407354073640737407384073940740407414074240743407444074540746407474074840749407504075140752407534075440755407564075740758407594076040761407624076340764407654076640767407684076940770407714077240773407744077540776407774077840779407804078140782407834078440785407864078740788407894079040791407924079340794407954079640797407984079940800408014080240803408044080540806408074080840809408104081140812408134081440815408164081740818408194082040821408224082340824408254082640827408284082940830408314083240833408344083540836408374083840839408404084140842408434084440845408464084740848408494085040851408524085340854408554085640857408584085940860408614086240863408644086540866408674086840869408704087140872408734087440875408764087740878408794088040881408824088340884408854088640887408884088940890408914089240893408944089540896408974089840899409004090140902409034090440905409064090740908409094091040911409124091340914409154091640917409184091940920409214092240923409244092540926409274092840929409304093140932409334093440935409364093740938409394094040941409424094340944409454094640947409484094940950409514095240953409544095540956409574095840959409604096140962409634096440965409664096740968409694097040971409724097340974409754097640977409784097940980409814098240983409844098540986409874098840989409904099140992409934099440995409964099740998409994100041001410024100341004410054100641007410084100941010410114101241013410144101541016410174101841019410204102141022410234102441025410264102741028410294103041031410324103341034410354103641037410384103941040410414104241043410444104541046410474104841049410504105141052410534105441055410564105741058410594106041061410624106341064410654106641067410684106941070410714107241073410744107541076410774107841079410804108141082410834108441085410864108741088410894109041091410924109341094410954109641097410984109941100411014110241103411044110541106411074110841109411104111141112411134111441115411164111741118411194112041121411224112341124411254112641127411284112941130411314113241133411344113541136411374113841139411404114141142411434114441145411464114741148411494115041151411524115341154411554115641157411584115941160411614116241163411644116541166411674116841169411704117141172411734117441175411764117741178411794118041181411824118341184411854118641187411884118941190411914119241193411944119541196411974119841199412004120141202412034120441205412064120741208412094121041211412124121341214412154121641217412184121941220412214122241223412244122541226412274122841229412304123141232412334123441235412364123741238412394124041241412424124341244412454124641247412484124941250412514125241253412544125541256412574125841259412604126141262412634126441265412664126741268412694127041271412724127341274412754127641277412784127941280412814128241283412844128541286412874128841289412904129141292412934129441295412964129741298412994130041301413024130341304413054130641307413084130941310413114131241313413144131541316413174131841319413204132141322413234132441325413264132741328413294133041331413324133341334413354133641337413384133941340413414134241343413444134541346413474134841349413504135141352413534135441355413564135741358413594136041361413624136341364413654136641367413684136941370413714137241373413744137541376413774137841379413804138141382413834138441385413864138741388413894139041391413924139341394413954139641397413984139941400414014140241403414044140541406414074140841409414104141141412414134141441415414164141741418414194142041421414224142341424414254142641427414284142941430414314143241433414344143541436414374143841439414404144141442414434144441445414464144741448414494145041451414524145341454414554145641457414584145941460414614146241463414644146541466414674146841469414704147141472414734147441475414764147741478414794148041481414824148341484414854148641487414884148941490414914149241493414944149541496414974149841499415004150141502415034150441505415064150741508415094151041511415124151341514415154151641517415184151941520415214152241523415244152541526415274152841529415304153141532415334153441535415364153741538415394154041541415424154341544415454154641547415484154941550415514155241553415544155541556415574155841559415604156141562415634156441565415664156741568415694157041571415724157341574415754157641577415784157941580415814158241583415844158541586415874158841589415904159141592415934159441595415964159741598415994160041601416024160341604416054160641607416084160941610416114161241613416144161541616416174161841619416204162141622416234162441625416264162741628416294163041631416324163341634416354163641637416384163941640416414164241643416444164541646416474164841649416504165141652416534165441655416564165741658416594166041661416624166341664416654166641667416684166941670416714167241673416744167541676416774167841679416804168141682416834168441685416864168741688416894169041691416924169341694416954169641697416984169941700417014170241703417044170541706417074170841709417104171141712417134171441715417164171741718417194172041721417224172341724417254172641727417284172941730417314173241733417344173541736417374173841739417404174141742417434174441745417464174741748417494175041751417524175341754417554175641757417584175941760417614176241763417644176541766417674176841769417704177141772417734177441775417764177741778417794178041781417824178341784417854178641787417884178941790417914179241793417944179541796417974179841799418004180141802418034180441805418064180741808418094181041811418124181341814418154181641817418184181941820418214182241823418244182541826418274182841829418304183141832418334183441835418364183741838418394184041841418424184341844418454184641847418484184941850418514185241853418544185541856418574185841859418604186141862418634186441865418664186741868418694187041871418724187341874418754187641877418784187941880418814188241883418844188541886418874188841889418904189141892418934189441895418964189741898418994190041901419024190341904419054190641907419084190941910419114191241913419144191541916419174191841919419204192141922419234192441925419264192741928419294193041931419324193341934419354193641937419384193941940419414194241943419444194541946419474194841949419504195141952419534195441955419564195741958419594196041961419624196341964419654196641967419684196941970419714197241973419744197541976419774197841979419804198141982419834198441985419864198741988419894199041991419924199341994419954199641997419984199942000420014200242003420044200542006420074200842009420104201142012420134201442015420164201742018420194202042021420224202342024420254202642027420284202942030420314203242033420344203542036420374203842039420404204142042420434204442045420464204742048420494205042051420524205342054420554205642057420584205942060420614206242063420644206542066420674206842069420704207142072420734207442075420764207742078420794208042081420824208342084420854208642087420884208942090420914209242093420944209542096420974209842099421004210142102421034210442105421064210742108421094211042111421124211342114421154211642117421184211942120421214212242123421244212542126421274212842129421304213142132421334213442135421364213742138421394214042141421424214342144421454214642147421484214942150421514215242153421544215542156421574215842159421604216142162421634216442165421664216742168421694217042171421724217342174421754217642177421784217942180421814218242183421844218542186421874218842189421904219142192421934219442195421964219742198421994220042201422024220342204422054220642207422084220942210422114221242213422144221542216422174221842219422204222142222422234222442225422264222742228422294223042231422324223342234422354223642237422384223942240422414224242243422444224542246422474224842249422504225142252422534225442255422564225742258422594226042261422624226342264422654226642267422684226942270422714227242273422744227542276422774227842279422804228142282422834228442285422864228742288422894229042291422924229342294422954229642297422984229942300423014230242303423044230542306423074230842309423104231142312423134231442315423164231742318423194232042321423224232342324423254232642327423284232942330423314233242333423344233542336423374233842339423404234142342423434234442345423464234742348423494235042351423524235342354423554235642357423584235942360423614236242363423644236542366423674236842369423704237142372423734237442375423764237742378423794238042381423824238342384423854238642387423884238942390423914239242393423944239542396423974239842399424004240142402424034240442405424064240742408424094241042411424124241342414424154241642417424184241942420424214242242423424244242542426424274242842429424304243142432424334243442435424364243742438424394244042441424424244342444424454244642447424484244942450424514245242453424544245542456424574245842459424604246142462424634246442465424664246742468424694247042471424724247342474424754247642477424784247942480424814248242483424844248542486424874248842489424904249142492424934249442495424964249742498424994250042501425024250342504425054250642507425084250942510425114251242513425144251542516425174251842519425204252142522425234252442525425264252742528425294253042531425324253342534425354253642537425384253942540425414254242543425444254542546425474254842549425504255142552425534255442555425564255742558425594256042561425624256342564425654256642567425684256942570425714257242573425744257542576425774257842579425804258142582425834258442585425864258742588425894259042591425924259342594425954259642597425984259942600426014260242603426044260542606426074260842609426104261142612426134261442615426164261742618426194262042621426224262342624426254262642627426284262942630426314263242633426344263542636426374263842639426404264142642426434264442645426464264742648426494265042651426524265342654426554265642657426584265942660426614266242663426644266542666426674266842669426704267142672426734267442675426764267742678426794268042681426824268342684426854268642687426884268942690426914269242693426944269542696426974269842699427004270142702427034270442705427064270742708427094271042711427124271342714427154271642717427184271942720427214272242723427244272542726427274272842729427304273142732427334273442735427364273742738427394274042741427424274342744427454274642747427484274942750427514275242753427544275542756427574275842759427604276142762427634276442765427664276742768427694277042771427724277342774427754277642777427784277942780427814278242783427844278542786427874278842789427904279142792427934279442795427964279742798427994280042801428024280342804428054280642807428084280942810428114281242813428144281542816428174281842819428204282142822428234282442825428264282742828428294283042831428324283342834428354283642837428384283942840428414284242843428444284542846428474284842849428504285142852428534285442855428564285742858428594286042861428624286342864428654286642867428684286942870428714287242873428744287542876428774287842879428804288142882428834288442885428864288742888428894289042891428924289342894428954289642897428984289942900429014290242903429044290542906429074290842909429104291142912429134291442915429164291742918429194292042921429224292342924429254292642927429284292942930429314293242933429344293542936429374293842939429404294142942429434294442945429464294742948429494295042951429524295342954429554295642957429584295942960429614296242963429644296542966429674296842969429704297142972429734297442975429764297742978429794298042981429824298342984429854298642987429884298942990429914299242993429944299542996429974299842999430004300143002430034300443005430064300743008430094301043011430124301343014430154301643017430184301943020430214302243023430244302543026430274302843029430304303143032430334303443035430364303743038430394304043041430424304343044430454304643047430484304943050430514305243053430544305543056430574305843059430604306143062430634306443065430664306743068430694307043071430724307343074430754307643077430784307943080430814308243083430844308543086430874308843089430904309143092430934309443095430964309743098430994310043101431024310343104431054310643107431084310943110431114311243113431144311543116431174311843119431204312143122431234312443125431264312743128431294313043131431324313343134431354313643137431384313943140431414314243143431444314543146431474314843149431504315143152431534315443155431564315743158431594316043161431624316343164431654316643167431684316943170431714317243173431744317543176431774317843179431804318143182431834318443185431864318743188431894319043191431924319343194431954319643197431984319943200432014320243203432044320543206432074320843209432104321143212432134321443215432164321743218432194322043221432224322343224432254322643227432284322943230432314323243233432344323543236432374323843239432404324143242432434324443245432464324743248432494325043251432524325343254432554325643257432584325943260432614326243263432644326543266432674326843269432704327143272432734327443275432764327743278432794328043281432824328343284432854328643287432884328943290432914329243293432944329543296432974329843299433004330143302433034330443305433064330743308433094331043311433124331343314433154331643317433184331943320433214332243323433244332543326433274332843329433304333143332433334333443335433364333743338433394334043341433424334343344433454334643347433484334943350433514335243353433544335543356433574335843359433604336143362433634336443365433664336743368433694337043371433724337343374433754337643377433784337943380433814338243383433844338543386433874338843389433904339143392433934339443395433964339743398433994340043401434024340343404434054340643407434084340943410434114341243413434144341543416434174341843419434204342143422434234342443425434264342743428434294343043431434324343343434434354343643437434384343943440434414344243443434444344543446434474344843449434504345143452434534345443455434564345743458434594346043461434624346343464434654346643467434684346943470434714347243473434744347543476434774347843479434804348143482434834348443485434864348743488434894349043491434924349343494434954349643497434984349943500435014350243503435044350543506435074350843509435104351143512435134351443515435164351743518435194352043521435224352343524435254352643527435284352943530435314353243533435344353543536435374353843539435404354143542435434354443545435464354743548435494355043551435524355343554435554355643557435584355943560435614356243563435644356543566435674356843569435704357143572435734357443575435764357743578435794358043581435824358343584435854358643587435884358943590435914359243593435944359543596435974359843599436004360143602436034360443605436064360743608436094361043611436124361343614436154361643617436184361943620436214362243623436244362543626436274362843629436304363143632436334363443635436364363743638436394364043641436424364343644436454364643647436484364943650436514365243653436544365543656436574365843659436604366143662436634366443665436664366743668436694367043671436724367343674436754367643677436784367943680436814368243683436844368543686436874368843689436904369143692436934369443695436964369743698436994370043701437024370343704437054370643707437084370943710437114371243713437144371543716437174371843719437204372143722437234372443725437264372743728437294373043731437324373343734437354373643737437384373943740437414374243743437444374543746437474374843749437504375143752437534375443755437564375743758437594376043761437624376343764437654376643767437684376943770437714377243773437744377543776437774377843779437804378143782437834378443785437864378743788437894379043791437924379343794437954379643797437984379943800438014380243803438044380543806438074380843809438104381143812438134381443815438164381743818438194382043821438224382343824438254382643827438284382943830438314383243833438344383543836438374383843839438404384143842438434384443845438464384743848438494385043851438524385343854438554385643857438584385943860438614386243863438644386543866438674386843869438704387143872438734387443875438764387743878438794388043881438824388343884438854388643887438884388943890438914389243893438944389543896438974389843899439004390143902439034390443905439064390743908439094391043911439124391343914439154391643917439184391943920439214392243923439244392543926439274392843929439304393143932439334393443935439364393743938439394394043941439424394343944439454394643947439484394943950439514395243953439544395543956439574395843959439604396143962439634396443965439664396743968439694397043971439724397343974439754397643977439784397943980439814398243983439844398543986439874398843989439904399143992439934399443995439964399743998439994400044001440024400344004440054400644007440084400944010440114401244013440144401544016440174401844019440204402144022440234402444025440264402744028440294403044031440324403344034440354403644037440384403944040440414404244043440444404544046440474404844049440504405144052440534405444055440564405744058440594406044061440624406344064440654406644067440684406944070440714407244073440744407544076440774407844079440804408144082440834408444085440864408744088440894409044091440924409344094440954409644097440984409944100441014410244103441044410544106441074410844109441104411144112441134411444115441164411744118441194412044121441224412344124441254412644127441284412944130441314413244133441344413544136441374413844139441404414144142441434414444145441464414744148441494415044151441524415344154441554415644157441584415944160441614416244163441644416544166441674416844169441704417144172441734417444175441764417744178441794418044181441824418344184441854418644187441884418944190441914419244193441944419544196441974419844199442004420144202442034420444205442064420744208442094421044211442124421344214442154421644217442184421944220442214422244223442244422544226442274422844229442304423144232442334423444235442364423744238442394424044241442424424344244442454424644247442484424944250442514425244253442544425544256442574425844259442604426144262442634426444265442664426744268442694427044271442724427344274442754427644277442784427944280442814428244283442844428544286442874428844289442904429144292442934429444295442964429744298442994430044301443024430344304443054430644307443084430944310443114431244313443144431544316443174431844319443204432144322443234432444325443264432744328443294433044331443324433344334443354433644337443384433944340443414434244343443444434544346443474434844349443504435144352443534435444355443564435744358443594436044361443624436344364443654436644367443684436944370443714437244373443744437544376443774437844379443804438144382443834438444385443864438744388443894439044391443924439344394443954439644397443984439944400444014440244403444044440544406444074440844409444104441144412444134441444415444164441744418444194442044421444224442344424444254442644427444284442944430444314443244433444344443544436444374443844439444404444144442444434444444445444464444744448444494445044451444524445344454444554445644457444584445944460444614446244463444644446544466444674446844469444704447144472444734447444475444764447744478444794448044481444824448344484444854448644487444884448944490444914449244493444944449544496444974449844499445004450144502445034450444505445064450744508445094451044511445124451344514445154451644517445184451944520445214452244523445244452544526445274452844529445304453144532445334453444535445364453744538445394454044541445424454344544445454454644547445484454944550445514455244553445544455544556445574455844559445604456144562445634456444565445664456744568445694457044571445724457344574445754457644577445784457944580445814458244583445844458544586445874458844589445904459144592445934459444595445964459744598445994460044601446024460344604446054460644607446084460944610446114461244613446144461544616446174461844619446204462144622446234462444625446264462744628446294463044631446324463344634446354463644637446384463944640446414464244643446444464544646446474464844649446504465144652446534465444655446564465744658446594466044661446624466344664446654466644667446684466944670446714467244673446744467544676446774467844679446804468144682446834468444685446864468744688446894469044691446924469344694446954469644697446984469944700447014470244703447044470544706447074470844709447104471144712447134471444715447164471744718447194472044721447224472344724447254472644727447284472944730447314473244733447344473544736447374473844739447404474144742447434474444745447464474744748447494475044751447524475344754447554475644757447584475944760447614476244763447644476544766447674476844769447704477144772447734477444775447764477744778447794478044781447824478344784447854478644787447884478944790447914479244793447944479544796447974479844799448004480144802448034480444805448064480744808448094481044811448124481344814448154481644817448184481944820448214482244823448244482544826448274482844829448304483144832448334483444835448364483744838448394484044841448424484344844448454484644847448484484944850448514485244853448544485544856448574485844859448604486144862448634486444865448664486744868448694487044871448724487344874448754487644877448784487944880448814488244883448844488544886448874488844889448904489144892448934489444895448964489744898448994490044901449024490344904449054490644907449084490944910449114491244913449144491544916449174491844919449204492144922449234492444925449264492744928449294493044931449324493344934449354493644937449384493944940449414494244943449444494544946449474494844949449504495144952449534495444955449564495744958449594496044961449624496344964449654496644967449684496944970449714497244973449744497544976449774497844979449804498144982449834498444985449864498744988449894499044991449924499344994449954499644997449984499945000450014500245003450044500545006450074500845009450104501145012450134501445015450164501745018450194502045021450224502345024450254502645027450284502945030450314503245033450344503545036450374503845039450404504145042450434504445045450464504745048450494505045051450524505345054450554505645057450584505945060450614506245063450644506545066450674506845069450704507145072450734507445075450764507745078450794508045081450824508345084450854508645087450884508945090450914509245093450944509545096450974509845099451004510145102451034510445105451064510745108451094511045111451124511345114451154511645117451184511945120451214512245123451244512545126451274512845129451304513145132451334513445135451364513745138451394514045141451424514345144451454514645147451484514945150451514515245153451544515545156451574515845159451604516145162451634516445165451664516745168451694517045171451724517345174451754517645177451784517945180451814518245183451844518545186451874518845189451904519145192451934519445195451964519745198451994520045201452024520345204452054520645207452084520945210452114521245213452144521545216452174521845219452204522145222452234522445225452264522745228452294523045231452324523345234452354523645237452384523945240452414524245243452444524545246452474524845249452504525145252452534525445255452564525745258452594526045261452624526345264452654526645267452684526945270452714527245273452744527545276452774527845279452804528145282452834528445285452864528745288452894529045291452924529345294452954529645297452984529945300453014530245303453044530545306453074530845309453104531145312453134531445315453164531745318453194532045321453224532345324453254532645327453284532945330453314533245333453344533545336453374533845339453404534145342453434534445345453464534745348453494535045351453524535345354453554535645357453584535945360453614536245363453644536545366453674536845369453704537145372453734537445375453764537745378453794538045381453824538345384453854538645387453884538945390453914539245393453944539545396453974539845399454004540145402454034540445405454064540745408454094541045411454124541345414454154541645417454184541945420454214542245423454244542545426454274542845429454304543145432454334543445435454364543745438454394544045441454424544345444454454544645447454484544945450454514545245453454544545545456454574545845459454604546145462454634546445465454664546745468454694547045471454724547345474454754547645477454784547945480454814548245483454844548545486454874548845489454904549145492454934549445495454964549745498454994550045501455024550345504455054550645507455084550945510455114551245513455144551545516455174551845519455204552145522455234552445525455264552745528455294553045531455324553345534455354553645537455384553945540455414554245543455444554545546455474554845549455504555145552455534555445555455564555745558455594556045561455624556345564455654556645567455684556945570455714557245573455744557545576455774557845579455804558145582455834558445585455864558745588455894559045591455924559345594455954559645597455984559945600456014560245603456044560545606456074560845609456104561145612456134561445615456164561745618456194562045621456224562345624456254562645627456284562945630456314563245633456344563545636456374563845639456404564145642456434564445645456464564745648456494565045651456524565345654456554565645657456584565945660456614566245663456644566545666456674566845669456704567145672456734567445675456764567745678456794568045681456824568345684456854568645687456884568945690456914569245693456944569545696456974569845699457004570145702457034570445705457064570745708457094571045711457124571345714457154571645717457184571945720457214572245723457244572545726457274572845729457304573145732457334573445735457364573745738457394574045741457424574345744457454574645747457484574945750457514575245753457544575545756457574575845759457604576145762457634576445765457664576745768457694577045771457724577345774457754577645777457784577945780457814578245783457844578545786457874578845789457904579145792457934579445795457964579745798457994580045801458024580345804458054580645807458084580945810458114581245813458144581545816458174581845819458204582145822458234582445825458264582745828458294583045831458324583345834458354583645837458384583945840458414584245843458444584545846458474584845849458504585145852458534585445855458564585745858458594586045861458624586345864458654586645867458684586945870458714587245873458744587545876458774587845879458804588145882458834588445885458864588745888458894589045891458924589345894458954589645897458984589945900459014590245903459044590545906459074590845909459104591145912459134591445915459164591745918459194592045921459224592345924459254592645927459284592945930459314593245933459344593545936459374593845939459404594145942459434594445945459464594745948459494595045951459524595345954459554595645957459584595945960459614596245963459644596545966459674596845969459704597145972459734597445975459764597745978459794598045981459824598345984459854598645987459884598945990459914599245993459944599545996459974599845999460004600146002460034600446005460064600746008460094601046011460124601346014460154601646017460184601946020460214602246023460244602546026460274602846029460304603146032460334603446035460364603746038460394604046041460424604346044460454604646047460484604946050460514605246053460544605546056460574605846059460604606146062460634606446065460664606746068460694607046071460724607346074460754607646077460784607946080460814608246083460844608546086460874608846089460904609146092460934609446095460964609746098460994610046101461024610346104461054610646107461084610946110461114611246113461144611546116461174611846119461204612146122461234612446125461264612746128461294613046131461324613346134461354613646137461384613946140461414614246143461444614546146461474614846149461504615146152461534615446155461564615746158461594616046161461624616346164461654616646167461684616946170461714617246173461744617546176461774617846179461804618146182461834618446185461864618746188461894619046191461924619346194461954619646197461984619946200462014620246203462044620546206462074620846209462104621146212462134621446215462164621746218462194622046221462224622346224462254622646227462284622946230462314623246233462344623546236462374623846239462404624146242462434624446245462464624746248462494625046251462524625346254462554625646257462584625946260462614626246263462644626546266462674626846269462704627146272462734627446275462764627746278462794628046281462824628346284462854628646287462884628946290462914629246293462944629546296462974629846299463004630146302463034630446305463064630746308463094631046311463124631346314463154631646317463184631946320463214632246323463244632546326463274632846329463304633146332463334633446335463364633746338463394634046341463424634346344463454634646347463484634946350463514635246353463544635546356463574635846359463604636146362463634636446365463664636746368463694637046371463724637346374463754637646377463784637946380463814638246383463844638546386463874638846389463904639146392463934639446395463964639746398463994640046401464024640346404464054640646407464084640946410464114641246413464144641546416464174641846419464204642146422464234642446425464264642746428464294643046431464324643346434464354643646437464384643946440464414644246443464444644546446464474644846449464504645146452464534645446455464564645746458464594646046461464624646346464464654646646467464684646946470464714647246473464744647546476464774647846479464804648146482464834648446485464864648746488464894649046491464924649346494464954649646497464984649946500465014650246503465044650546506465074650846509465104651146512465134651446515465164651746518465194652046521465224652346524465254652646527465284652946530465314653246533465344653546536465374653846539465404654146542465434654446545465464654746548465494655046551465524655346554465554655646557465584655946560465614656246563465644656546566465674656846569465704657146572465734657446575465764657746578465794658046581465824658346584465854658646587465884658946590465914659246593465944659546596465974659846599466004660146602466034660446605466064660746608466094661046611466124661346614466154661646617466184661946620466214662246623466244662546626466274662846629466304663146632466334663446635466364663746638466394664046641466424664346644466454664646647466484664946650466514665246653466544665546656466574665846659466604666146662466634666446665466664666746668466694667046671466724667346674466754667646677466784667946680466814668246683466844668546686466874668846689466904669146692466934669446695466964669746698466994670046701467024670346704467054670646707467084670946710467114671246713467144671546716467174671846719467204672146722467234672446725467264672746728467294673046731467324673346734467354673646737467384673946740467414674246743467444674546746467474674846749467504675146752467534675446755467564675746758467594676046761467624676346764467654676646767467684676946770467714677246773467744677546776467774677846779467804678146782467834678446785467864678746788467894679046791467924679346794467954679646797467984679946800468014680246803468044680546806468074680846809468104681146812468134681446815468164681746818468194682046821468224682346824468254682646827468284682946830468314683246833468344683546836468374683846839468404684146842468434684446845468464684746848468494685046851468524685346854468554685646857468584685946860468614686246863468644686546866468674686846869468704687146872468734687446875468764687746878468794688046881468824688346884468854688646887468884688946890468914689246893468944689546896468974689846899469004690146902469034690446905469064690746908469094691046911469124691346914469154691646917469184691946920469214692246923469244692546926469274692846929469304693146932469334693446935469364693746938469394694046941469424694346944469454694646947469484694946950469514695246953469544695546956469574695846959469604696146962469634696446965469664696746968469694697046971469724697346974469754697646977469784697946980469814698246983469844698546986469874698846989469904699146992469934699446995469964699746998469994700047001470024700347004470054700647007470084700947010470114701247013470144701547016470174701847019470204702147022470234702447025470264702747028470294703047031470324703347034470354703647037470384703947040470414704247043470444704547046470474704847049470504705147052470534705447055470564705747058470594706047061470624706347064470654706647067470684706947070470714707247073470744707547076470774707847079470804708147082470834708447085470864708747088470894709047091470924709347094470954709647097470984709947100471014710247103471044710547106471074710847109471104711147112471134711447115471164711747118471194712047121471224712347124471254712647127471284712947130471314713247133471344713547136471374713847139471404714147142471434714447145471464714747148471494715047151471524715347154471554715647157471584715947160471614716247163471644716547166471674716847169471704717147172471734717447175471764717747178471794718047181471824718347184471854718647187471884718947190471914719247193471944719547196471974719847199472004720147202472034720447205472064720747208472094721047211472124721347214472154721647217472184721947220472214722247223472244722547226472274722847229472304723147232472334723447235472364723747238472394724047241472424724347244472454724647247472484724947250472514725247253472544725547256472574725847259472604726147262472634726447265472664726747268472694727047271472724727347274472754727647277472784727947280472814728247283472844728547286472874728847289472904729147292472934729447295472964729747298472994730047301473024730347304473054730647307473084730947310473114731247313473144731547316473174731847319473204732147322473234732447325473264732747328473294733047331473324733347334473354733647337473384733947340473414734247343473444734547346473474734847349473504735147352473534735447355473564735747358473594736047361473624736347364473654736647367473684736947370473714737247373473744737547376473774737847379473804738147382473834738447385473864738747388473894739047391473924739347394473954739647397473984739947400474014740247403474044740547406474074740847409474104741147412474134741447415474164741747418474194742047421474224742347424474254742647427474284742947430474314743247433474344743547436474374743847439474404744147442474434744447445474464744747448474494745047451474524745347454474554745647457474584745947460474614746247463474644746547466474674746847469474704747147472474734747447475474764747747478474794748047481474824748347484474854748647487474884748947490474914749247493474944749547496474974749847499475004750147502475034750447505475064750747508475094751047511475124751347514475154751647517475184751947520475214752247523475244752547526475274752847529475304753147532475334753447535475364753747538475394754047541475424754347544475454754647547475484754947550475514755247553475544755547556475574755847559475604756147562475634756447565475664756747568475694757047571475724757347574475754757647577475784757947580475814758247583475844758547586475874758847589475904759147592475934759447595475964759747598475994760047601476024760347604476054760647607476084760947610476114761247613476144761547616476174761847619476204762147622476234762447625476264762747628476294763047631476324763347634476354763647637476384763947640476414764247643476444764547646476474764847649476504765147652476534765447655476564765747658476594766047661476624766347664476654766647667476684766947670476714767247673476744767547676476774767847679476804768147682476834768447685476864768747688476894769047691476924769347694476954769647697476984769947700477014770247703477044770547706477074770847709477104771147712477134771447715477164771747718477194772047721477224772347724477254772647727477284772947730477314773247733477344773547736477374773847739477404774147742477434774447745477464774747748477494775047751477524775347754477554775647757477584775947760477614776247763477644776547766477674776847769477704777147772477734777447775477764777747778477794778047781477824778347784477854778647787477884778947790477914779247793477944779547796477974779847799478004780147802478034780447805478064780747808478094781047811478124781347814478154781647817478184781947820478214782247823478244782547826478274782847829478304783147832478334783447835478364783747838478394784047841478424784347844478454784647847478484784947850478514785247853478544785547856478574785847859478604786147862478634786447865478664786747868478694787047871478724787347874478754787647877478784787947880478814788247883478844788547886478874788847889478904789147892478934789447895478964789747898478994790047901479024790347904479054790647907479084790947910479114791247913479144791547916479174791847919479204792147922479234792447925479264792747928479294793047931479324793347934479354793647937479384793947940479414794247943479444794547946479474794847949479504795147952479534795447955479564795747958479594796047961479624796347964479654796647967479684796947970479714797247973479744797547976479774797847979479804798147982479834798447985479864798747988479894799047991479924799347994479954799647997479984799948000480014800248003480044800548006480074800848009480104801148012480134801448015480164801748018480194802048021480224802348024480254802648027480284802948030480314803248033480344803548036480374803848039480404804148042480434804448045480464804748048480494805048051480524805348054480554805648057480584805948060480614806248063480644806548066480674806848069480704807148072480734807448075480764807748078480794808048081480824808348084480854808648087480884808948090480914809248093480944809548096480974809848099481004810148102481034810448105481064810748108481094811048111481124811348114481154811648117481184811948120481214812248123481244812548126481274812848129481304813148132481334813448135481364813748138481394814048141481424814348144481454814648147481484814948150481514815248153481544815548156481574815848159481604816148162481634816448165481664816748168481694817048171481724817348174481754817648177481784817948180481814818248183481844818548186481874818848189481904819148192481934819448195481964819748198481994820048201482024820348204482054820648207482084820948210482114821248213482144821548216482174821848219482204822148222482234822448225482264822748228482294823048231482324823348234482354823648237482384823948240482414824248243482444824548246482474824848249482504825148252482534825448255482564825748258482594826048261482624826348264482654826648267482684826948270482714827248273482744827548276482774827848279482804828148282482834828448285482864828748288482894829048291482924829348294482954829648297482984829948300483014830248303483044830548306483074830848309483104831148312483134831448315483164831748318483194832048321483224832348324483254832648327483284832948330483314833248333483344833548336483374833848339483404834148342483434834448345483464834748348483494835048351483524835348354483554835648357483584835948360483614836248363483644836548366483674836848369483704837148372483734837448375483764837748378483794838048381483824838348384483854838648387483884838948390483914839248393483944839548396483974839848399484004840148402484034840448405484064840748408484094841048411484124841348414484154841648417484184841948420484214842248423484244842548426484274842848429484304843148432484334843448435484364843748438484394844048441484424844348444484454844648447484484844948450484514845248453484544845548456484574845848459484604846148462484634846448465484664846748468484694847048471484724847348474484754847648477484784847948480484814848248483484844848548486484874848848489484904849148492484934849448495484964849748498484994850048501485024850348504485054850648507485084850948510485114851248513485144851548516485174851848519485204852148522485234852448525485264852748528485294853048531485324853348534485354853648537485384853948540485414854248543485444854548546485474854848549485504855148552485534855448555485564855748558485594856048561485624856348564485654856648567485684856948570485714857248573485744857548576485774857848579485804858148582485834858448585485864858748588485894859048591485924859348594485954859648597485984859948600486014860248603486044860548606486074860848609486104861148612486134861448615486164861748618486194862048621486224862348624486254862648627486284862948630486314863248633486344863548636486374863848639486404864148642486434864448645486464864748648486494865048651486524865348654486554865648657486584865948660486614866248663486644866548666486674866848669486704867148672486734867448675486764867748678486794868048681486824868348684486854868648687486884868948690486914869248693486944869548696486974869848699487004870148702487034870448705487064870748708487094871048711487124871348714487154871648717487184871948720487214872248723487244872548726487274872848729487304873148732487334873448735487364873748738487394874048741487424874348744487454874648747487484874948750487514875248753487544875548756487574875848759487604876148762487634876448765487664876748768487694877048771487724877348774487754877648777487784877948780487814878248783487844878548786487874878848789487904879148792487934879448795487964879748798487994880048801488024880348804488054880648807488084880948810488114881248813488144881548816488174881848819488204882148822488234882448825488264882748828488294883048831488324883348834488354883648837488384883948840488414884248843488444884548846488474884848849488504885148852488534885448855488564885748858488594886048861488624886348864488654886648867488684886948870488714887248873488744887548876488774887848879488804888148882488834888448885488864888748888488894889048891488924889348894488954889648897488984889948900489014890248903489044890548906489074890848909489104891148912489134891448915489164891748918489194892048921489224892348924489254892648927489284892948930489314893248933489344893548936489374893848939489404894148942489434894448945489464894748948489494895048951489524895348954489554895648957489584895948960489614896248963489644896548966489674896848969489704897148972489734897448975489764897748978489794898048981489824898348984489854898648987489884898948990489914899248993489944899548996489974899848999490004900149002490034900449005490064900749008490094901049011490124901349014490154901649017490184901949020490214902249023490244902549026490274902849029490304903149032490334903449035490364903749038490394904049041490424904349044490454904649047490484904949050490514905249053490544905549056490574905849059490604906149062490634906449065490664906749068490694907049071490724907349074490754907649077490784907949080490814908249083490844908549086490874908849089490904909149092490934909449095490964909749098490994910049101491024910349104491054910649107491084910949110491114911249113491144911549116491174911849119491204912149122491234912449125491264912749128491294913049131491324913349134491354913649137491384913949140491414914249143491444914549146491474914849149491504915149152491534915449155491564915749158491594916049161491624916349164491654916649167491684916949170491714917249173491744917549176491774917849179491804918149182491834918449185491864918749188491894919049191491924919349194491954919649197491984919949200492014920249203492044920549206492074920849209492104921149212492134921449215492164921749218492194922049221492224922349224492254922649227492284922949230492314923249233492344923549236492374923849239492404924149242492434924449245492464924749248492494925049251492524925349254492554925649257492584925949260492614926249263492644926549266492674926849269492704927149272492734927449275492764927749278492794928049281492824928349284492854928649287492884928949290492914929249293492944929549296492974929849299493004930149302493034930449305493064930749308493094931049311493124931349314493154931649317493184931949320493214932249323493244932549326493274932849329493304933149332493334933449335493364933749338493394934049341493424934349344493454934649347493484934949350493514935249353493544935549356493574935849359493604936149362493634936449365493664936749368493694937049371493724937349374493754937649377493784937949380493814938249383493844938549386493874938849389493904939149392493934939449395493964939749398493994940049401494024940349404494054940649407494084940949410494114941249413494144941549416494174941849419494204942149422494234942449425494264942749428494294943049431494324943349434494354943649437494384943949440494414944249443494444944549446494474944849449494504945149452494534945449455494564945749458494594946049461494624946349464494654946649467494684946949470494714947249473494744947549476494774947849479494804948149482494834948449485494864948749488494894949049491494924949349494494954949649497494984949949500495014950249503495044950549506495074950849509495104951149512495134951449515495164951749518495194952049521495224952349524495254952649527495284952949530495314953249533495344953549536495374953849539495404954149542495434954449545495464954749548495494955049551495524955349554495554955649557495584955949560495614956249563495644956549566495674956849569495704957149572495734957449575495764957749578495794958049581495824958349584495854958649587495884958949590495914959249593495944959549596495974959849599496004960149602496034960449605496064960749608496094961049611496124961349614496154961649617496184961949620496214962249623496244962549626496274962849629496304963149632496334963449635496364963749638496394964049641496424964349644496454964649647496484964949650496514965249653496544965549656496574965849659496604966149662496634966449665496664966749668496694967049671496724967349674496754967649677496784967949680496814968249683496844968549686496874968849689496904969149692496934969449695496964969749698496994970049701497024970349704497054970649707497084970949710497114971249713497144971549716497174971849719497204972149722497234972449725497264972749728497294973049731497324973349734497354973649737497384973949740497414974249743497444974549746497474974849749497504975149752497534975449755497564975749758497594976049761497624976349764497654976649767497684976949770497714977249773497744977549776497774977849779497804978149782497834978449785497864978749788497894979049791497924979349794497954979649797497984979949800498014980249803498044980549806498074980849809498104981149812498134981449815498164981749818498194982049821498224982349824498254982649827498284982949830498314983249833498344983549836498374983849839498404984149842498434984449845498464984749848498494985049851498524985349854498554985649857498584985949860498614986249863498644986549866498674986849869498704987149872498734987449875498764987749878498794988049881498824988349884498854988649887498884988949890498914989249893498944989549896498974989849899499004990149902499034990449905499064990749908499094991049911499124991349914499154991649917499184991949920499214992249923499244992549926499274992849929499304993149932499334993449935499364993749938499394994049941499424994349944499454994649947499484994949950499514995249953499544995549956499574995849959499604996149962499634996449965499664996749968499694997049971499724997349974499754997649977499784997949980499814998249983499844998549986499874998849989499904999149992499934999449995499964999749998499995000050001500025000350004500055000650007500085000950010500115001250013500145001550016500175001850019500205002150022500235002450025500265002750028500295003050031500325003350034500355003650037500385003950040500415004250043500445004550046500475004850049500505005150052500535005450055500565005750058500595006050061500625006350064500655006650067500685006950070500715007250073500745007550076500775007850079500805008150082500835008450085500865008750088500895009050091500925009350094500955009650097500985009950100501015010250103501045010550106501075010850109501105011150112501135011450115501165011750118501195012050121501225012350124501255012650127501285012950130501315013250133501345013550136501375013850139501405014150142501435014450145501465014750148501495015050151501525015350154501555015650157501585015950160501615016250163501645016550166501675016850169501705017150172501735017450175501765017750178501795018050181501825018350184501855018650187501885018950190501915019250193501945019550196501975019850199502005020150202502035020450205502065020750208502095021050211502125021350214502155021650217502185021950220502215022250223502245022550226502275022850229502305023150232502335023450235502365023750238502395024050241502425024350244502455024650247502485024950250502515025250253502545025550256502575025850259502605026150262502635026450265502665026750268502695027050271502725027350274502755027650277502785027950280502815028250283502845028550286502875028850289502905029150292502935029450295502965029750298502995030050301503025030350304503055030650307503085030950310503115031250313503145031550316503175031850319503205032150322503235032450325503265032750328503295033050331503325033350334503355033650337503385033950340503415034250343503445034550346503475034850349503505035150352503535035450355503565035750358503595036050361503625036350364503655036650367503685036950370503715037250373503745037550376503775037850379503805038150382503835038450385503865038750388503895039050391503925039350394503955039650397503985039950400504015040250403504045040550406504075040850409504105041150412504135041450415504165041750418504195042050421504225042350424504255042650427504285042950430504315043250433504345043550436504375043850439504405044150442504435044450445504465044750448504495045050451504525045350454504555045650457504585045950460504615046250463504645046550466504675046850469504705047150472504735047450475504765047750478504795048050481504825048350484504855048650487504885048950490504915049250493504945049550496504975049850499505005050150502505035050450505505065050750508505095051050511505125051350514505155051650517505185051950520505215052250523505245052550526505275052850529505305053150532505335053450535505365053750538505395054050541505425054350544505455054650547505485054950550505515055250553505545055550556505575055850559505605056150562505635056450565505665056750568505695057050571505725057350574505755057650577505785057950580505815058250583505845058550586505875058850589505905059150592505935059450595505965059750598505995060050601506025060350604506055060650607506085060950610506115061250613506145061550616506175061850619506205062150622506235062450625506265062750628506295063050631506325063350634506355063650637506385063950640506415064250643506445064550646506475064850649506505065150652506535065450655506565065750658506595066050661506625066350664506655066650667506685066950670506715067250673506745067550676506775067850679506805068150682506835068450685506865068750688506895069050691506925069350694506955069650697506985069950700507015070250703507045070550706507075070850709507105071150712507135071450715507165071750718507195072050721507225072350724507255072650727507285072950730507315073250733507345073550736507375073850739507405074150742507435074450745507465074750748507495075050751507525075350754507555075650757507585075950760507615076250763507645076550766507675076850769507705077150772507735077450775507765077750778507795078050781507825078350784507855078650787507885078950790507915079250793507945079550796507975079850799508005080150802508035080450805508065080750808508095081050811508125081350814508155081650817508185081950820508215082250823508245082550826508275082850829508305083150832508335083450835508365083750838508395084050841508425084350844508455084650847508485084950850508515085250853508545085550856508575085850859508605086150862508635086450865508665086750868508695087050871508725087350874508755087650877508785087950880508815088250883508845088550886508875088850889508905089150892508935089450895508965089750898508995090050901509025090350904509055090650907509085090950910509115091250913509145091550916509175091850919509205092150922509235092450925509265092750928509295093050931509325093350934509355093650937509385093950940509415094250943509445094550946509475094850949509505095150952509535095450955509565095750958509595096050961509625096350964509655096650967509685096950970509715097250973509745097550976509775097850979509805098150982509835098450985509865098750988509895099050991509925099350994509955099650997509985099951000510015100251003510045100551006510075100851009510105101151012510135101451015510165101751018510195102051021510225102351024510255102651027510285102951030510315103251033510345103551036510375103851039510405104151042510435104451045510465104751048510495105051051510525105351054510555105651057510585105951060510615106251063510645106551066510675106851069510705107151072510735107451075510765107751078510795108051081510825108351084510855108651087510885108951090510915109251093510945109551096510975109851099511005110151102511035110451105511065110751108511095111051111511125111351114511155111651117511185111951120511215112251123511245112551126511275112851129511305113151132511335113451135511365113751138511395114051141511425114351144511455114651147511485114951150511515115251153511545115551156511575115851159511605116151162511635116451165511665116751168511695117051171511725117351174511755117651177511785117951180511815118251183511845118551186511875118851189511905119151192511935119451195511965119751198511995120051201512025120351204512055120651207512085120951210512115121251213512145121551216512175121851219512205122151222512235122451225512265122751228512295123051231512325123351234512355123651237512385123951240512415124251243512445124551246512475124851249512505125151252512535125451255512565125751258512595126051261512625126351264512655126651267512685126951270512715127251273512745127551276512775127851279512805128151282512835128451285512865128751288512895129051291512925129351294512955129651297512985129951300513015130251303513045130551306513075130851309513105131151312513135131451315513165131751318513195132051321513225132351324513255132651327513285132951330513315133251333513345133551336513375133851339513405134151342513435134451345513465134751348513495135051351513525135351354513555135651357513585135951360513615136251363513645136551366513675136851369513705137151372513735137451375513765137751378513795138051381513825138351384513855138651387513885138951390513915139251393513945139551396513975139851399514005140151402514035140451405514065140751408514095141051411514125141351414514155141651417514185141951420514215142251423514245142551426514275142851429514305143151432514335143451435514365143751438514395144051441514425144351444514455144651447514485144951450514515145251453514545145551456514575145851459514605146151462514635146451465514665146751468514695147051471514725147351474514755147651477514785147951480514815148251483514845148551486514875148851489514905149151492514935149451495514965149751498514995150051501515025150351504515055150651507515085150951510515115151251513515145151551516515175151851519515205152151522515235152451525515265152751528515295153051531515325153351534515355153651537515385153951540515415154251543515445154551546515475154851549515505155151552515535155451555515565155751558515595156051561515625156351564515655156651567515685156951570515715157251573515745157551576515775157851579515805158151582515835158451585515865158751588515895159051591515925159351594515955159651597515985159951600516015160251603516045160551606516075160851609516105161151612516135161451615516165161751618516195162051621516225162351624516255162651627516285162951630516315163251633516345163551636516375163851639516405164151642516435164451645516465164751648516495165051651516525165351654516555165651657516585165951660516615166251663516645166551666516675166851669516705167151672516735167451675516765167751678516795168051681516825168351684516855168651687516885168951690516915169251693516945169551696516975169851699517005170151702517035170451705517065170751708517095171051711517125171351714517155171651717517185171951720517215172251723517245172551726517275172851729517305173151732517335173451735517365173751738517395174051741517425174351744517455174651747517485174951750517515175251753517545175551756517575175851759517605176151762517635176451765517665176751768517695177051771517725177351774517755177651777517785177951780517815178251783517845178551786517875178851789517905179151792517935179451795517965179751798517995180051801518025180351804518055180651807518085180951810518115181251813518145181551816518175181851819518205182151822518235182451825518265182751828518295183051831518325183351834518355183651837518385183951840518415184251843518445184551846518475184851849518505185151852518535185451855518565185751858518595186051861518625186351864518655186651867518685186951870518715187251873518745187551876518775187851879518805188151882518835188451885518865188751888518895189051891518925189351894518955189651897518985189951900519015190251903519045190551906519075190851909519105191151912519135191451915519165191751918519195192051921519225192351924519255192651927519285192951930519315193251933519345193551936519375193851939519405194151942519435194451945519465194751948519495195051951519525195351954519555195651957519585195951960519615196251963519645196551966519675196851969519705197151972519735197451975519765197751978519795198051981519825198351984519855198651987519885198951990519915199251993519945199551996519975199851999520005200152002520035200452005520065200752008520095201052011520125201352014520155201652017520185201952020520215202252023520245202552026520275202852029520305203152032520335203452035520365203752038520395204052041520425204352044520455204652047520485204952050520515205252053520545205552056520575205852059520605206152062520635206452065520665206752068520695207052071520725207352074520755207652077520785207952080520815208252083520845208552086520875208852089520905209152092520935209452095520965209752098520995210052101521025210352104521055210652107521085210952110521115211252113521145211552116521175211852119521205212152122521235212452125521265212752128521295213052131521325213352134521355213652137521385213952140521415214252143521445214552146521475214852149521505215152152521535215452155521565215752158521595216052161521625216352164521655216652167521685216952170521715217252173521745217552176521775217852179521805218152182521835218452185521865218752188521895219052191521925219352194521955219652197521985219952200522015220252203522045220552206522075220852209522105221152212522135221452215522165221752218522195222052221522225222352224522255222652227522285222952230522315223252233522345223552236522375223852239522405224152242522435224452245522465224752248522495225052251522525225352254522555225652257522585225952260522615226252263522645226552266522675226852269522705227152272522735227452275522765227752278522795228052281522825228352284522855228652287522885228952290522915229252293522945229552296522975229852299523005230152302523035230452305523065230752308523095231052311523125231352314523155231652317523185231952320523215232252323523245232552326523275232852329523305233152332523335233452335523365233752338523395234052341523425234352344523455234652347523485234952350523515235252353523545235552356523575235852359523605236152362523635236452365523665236752368523695237052371523725237352374523755237652377523785237952380523815238252383523845238552386523875238852389523905239152392523935239452395523965239752398523995240052401524025240352404524055240652407524085240952410524115241252413524145241552416524175241852419524205242152422524235242452425524265242752428524295243052431524325243352434524355243652437524385243952440524415244252443524445244552446524475244852449524505245152452524535245452455524565245752458524595246052461524625246352464524655246652467524685246952470524715247252473524745247552476524775247852479524805248152482524835248452485524865248752488524895249052491524925249352494524955249652497524985249952500525015250252503525045250552506525075250852509525105251152512525135251452515525165251752518525195252052521525225252352524525255252652527525285252952530525315253252533525345253552536525375253852539525405254152542525435254452545525465254752548525495255052551525525255352554525555255652557525585255952560525615256252563525645256552566525675256852569525705257152572525735257452575525765257752578525795258052581525825258352584525855258652587525885258952590525915259252593525945259552596525975259852599526005260152602526035260452605526065260752608526095261052611526125261352614526155261652617526185261952620526215262252623526245262552626526275262852629526305263152632526335263452635526365263752638526395264052641526425264352644526455264652647526485264952650526515265252653526545265552656526575265852659526605266152662526635266452665526665266752668526695267052671526725267352674526755267652677526785267952680526815268252683526845268552686526875268852689526905269152692526935269452695526965269752698526995270052701527025270352704527055270652707527085270952710527115271252713527145271552716527175271852719527205272152722527235272452725527265272752728527295273052731527325273352734527355273652737527385273952740527415274252743527445274552746527475274852749527505275152752527535275452755527565275752758527595276052761527625276352764527655276652767527685276952770527715277252773527745277552776527775277852779527805278152782527835278452785527865278752788527895279052791527925279352794527955279652797527985279952800528015280252803528045280552806528075280852809528105281152812528135281452815528165281752818528195282052821528225282352824528255282652827528285282952830528315283252833528345283552836528375283852839528405284152842528435284452845528465284752848528495285052851528525285352854528555285652857528585285952860528615286252863528645286552866528675286852869528705287152872528735287452875528765287752878528795288052881528825288352884528855288652887528885288952890528915289252893528945289552896528975289852899529005290152902529035290452905529065290752908529095291052911529125291352914529155291652917529185291952920529215292252923529245292552926529275292852929529305293152932529335293452935529365293752938529395294052941529425294352944529455294652947529485294952950529515295252953529545295552956529575295852959529605296152962529635296452965529665296752968529695297052971529725297352974529755297652977529785297952980529815298252983529845298552986529875298852989529905299152992529935299452995529965299752998529995300053001530025300353004530055300653007530085300953010530115301253013530145301553016530175301853019530205302153022530235302453025530265302753028530295303053031530325303353034530355303653037530385303953040530415304253043530445304553046530475304853049530505305153052530535305453055530565305753058530595306053061530625306353064530655306653067530685306953070530715307253073530745307553076530775307853079530805308153082530835308453085530865308753088530895309053091530925309353094530955309653097530985309953100531015310253103531045310553106531075310853109531105311153112531135311453115531165311753118531195312053121531225312353124531255312653127531285312953130531315313253133531345313553136531375313853139531405314153142531435314453145531465314753148531495315053151531525315353154531555315653157531585315953160531615316253163531645316553166531675316853169531705317153172531735317453175531765317753178531795318053181531825318353184531855318653187531885318953190531915319253193531945319553196531975319853199532005320153202532035320453205532065320753208532095321053211532125321353214532155321653217532185321953220532215322253223532245322553226532275322853229532305323153232532335323453235532365323753238532395324053241532425324353244532455324653247532485324953250532515325253253532545325553256532575325853259532605326153262532635326453265532665326753268532695327053271532725327353274532755327653277532785327953280532815328253283532845328553286532875328853289532905329153292532935329453295532965329753298532995330053301533025330353304533055330653307533085330953310533115331253313533145331553316533175331853319533205332153322533235332453325533265332753328533295333053331533325333353334533355333653337533385333953340533415334253343533445334553346533475334853349533505335153352533535335453355533565335753358533595336053361533625336353364533655336653367533685336953370533715337253373533745337553376533775337853379533805338153382533835338453385533865338753388533895339053391533925339353394533955339653397533985339953400534015340253403534045340553406534075340853409534105341153412534135341453415534165341753418534195342053421534225342353424534255342653427534285342953430534315343253433534345343553436534375343853439534405344153442534435344453445534465344753448534495345053451534525345353454534555345653457534585345953460534615346253463534645346553466534675346853469534705347153472534735347453475534765347753478534795348053481534825348353484534855348653487534885348953490534915349253493534945349553496534975349853499535005350153502535035350453505535065350753508535095351053511535125351353514535155351653517535185351953520535215352253523535245352553526535275352853529535305353153532535335353453535535365353753538535395354053541535425354353544535455354653547535485354953550535515355253553535545355553556535575355853559535605356153562535635356453565535665356753568535695357053571535725357353574535755357653577535785357953580535815358253583535845358553586535875358853589535905359153592535935359453595535965359753598535995360053601536025360353604536055360653607536085360953610536115361253613536145361553616536175361853619536205362153622536235362453625536265362753628536295363053631536325363353634536355363653637536385363953640536415364253643536445364553646536475364853649536505365153652536535365453655536565365753658536595366053661536625366353664536655366653667536685366953670536715367253673536745367553676536775367853679536805368153682536835368453685536865368753688536895369053691536925369353694536955369653697536985369953700537015370253703537045370553706537075370853709537105371153712537135371453715537165371753718537195372053721537225372353724537255372653727537285372953730537315373253733537345373553736537375373853739537405374153742537435374453745537465374753748537495375053751537525375353754537555375653757537585375953760537615376253763537645376553766537675376853769537705377153772537735377453775537765377753778537795378053781537825378353784537855378653787537885378953790537915379253793537945379553796537975379853799538005380153802538035380453805538065380753808538095381053811538125381353814538155381653817538185381953820538215382253823538245382553826538275382853829538305383153832538335383453835538365383753838538395384053841538425384353844538455384653847538485384953850538515385253853538545385553856538575385853859538605386153862538635386453865538665386753868538695387053871538725387353874538755387653877538785387953880538815388253883538845388553886538875388853889538905389153892538935389453895538965389753898538995390053901539025390353904539055390653907539085390953910539115391253913539145391553916539175391853919539205392153922539235392453925539265392753928539295393053931539325393353934539355393653937539385393953940539415394253943539445394553946539475394853949539505395153952539535395453955539565395753958539595396053961539625396353964539655396653967539685396953970539715397253973539745397553976539775397853979539805398153982539835398453985539865398753988539895399053991539925399353994539955399653997539985399954000540015400254003540045400554006540075400854009540105401154012540135401454015540165401754018540195402054021540225402354024540255402654027540285402954030540315403254033540345403554036540375403854039540405404154042540435404454045540465404754048540495405054051540525405354054540555405654057540585405954060540615406254063540645406554066540675406854069540705407154072540735407454075540765407754078540795408054081540825408354084540855408654087540885408954090540915409254093540945409554096540975409854099541005410154102541035410454105541065410754108541095411054111541125411354114541155411654117541185411954120541215412254123541245412554126541275412854129541305413154132541335413454135541365413754138541395414054141541425414354144541455414654147541485414954150541515415254153541545415554156541575415854159541605416154162541635416454165541665416754168541695417054171541725417354174541755417654177541785417954180541815418254183541845418554186541875418854189541905419154192541935419454195541965419754198541995420054201542025420354204542055420654207542085420954210542115421254213542145421554216542175421854219542205422154222542235422454225542265422754228542295423054231542325423354234542355423654237542385423954240542415424254243542445424554246542475424854249542505425154252542535425454255542565425754258542595426054261542625426354264542655426654267542685426954270542715427254273542745427554276542775427854279542805428154282542835428454285542865428754288542895429054291542925429354294542955429654297542985429954300543015430254303543045430554306543075430854309543105431154312543135431454315543165431754318543195432054321543225432354324543255432654327543285432954330543315433254333543345433554336543375433854339543405434154342543435434454345543465434754348543495435054351543525435354354543555435654357543585435954360543615436254363543645436554366543675436854369543705437154372543735437454375543765437754378543795438054381543825438354384543855438654387543885438954390543915439254393543945439554396543975439854399544005440154402544035440454405544065440754408544095441054411544125441354414544155441654417544185441954420544215442254423544245442554426544275442854429544305443154432544335443454435544365443754438544395444054441544425444354444544455444654447544485444954450544515445254453544545445554456544575445854459544605446154462544635446454465544665446754468544695447054471544725447354474544755447654477544785447954480544815448254483544845448554486544875448854489544905449154492544935449454495544965449754498544995450054501545025450354504545055450654507545085450954510545115451254513545145451554516545175451854519545205452154522545235452454525545265452754528545295453054531545325453354534545355453654537545385453954540545415454254543545445454554546545475454854549545505455154552545535455454555545565455754558545595456054561545625456354564545655456654567545685456954570545715457254573545745457554576545775457854579545805458154582545835458454585545865458754588545895459054591545925459354594545955459654597545985459954600546015460254603546045460554606546075460854609546105461154612546135461454615546165461754618546195462054621546225462354624546255462654627546285462954630546315463254633546345463554636546375463854639546405464154642546435464454645546465464754648546495465054651546525465354654546555465654657546585465954660546615466254663546645466554666546675466854669546705467154672546735467454675546765467754678546795468054681546825468354684546855468654687546885468954690546915469254693546945469554696546975469854699547005470154702547035470454705547065470754708547095471054711547125471354714547155471654717547185471954720547215472254723547245472554726547275472854729547305473154732547335473454735547365473754738547395474054741547425474354744547455474654747547485474954750547515475254753547545475554756547575475854759547605476154762547635476454765547665476754768547695477054771547725477354774547755477654777547785477954780547815478254783547845478554786547875478854789547905479154792547935479454795547965479754798547995480054801548025480354804548055480654807548085480954810548115481254813548145481554816548175481854819548205482154822548235482454825548265482754828548295483054831548325483354834548355483654837548385483954840548415484254843548445484554846548475484854849548505485154852548535485454855548565485754858548595486054861548625486354864548655486654867548685486954870548715487254873548745487554876548775487854879548805488154882548835488454885548865488754888548895489054891548925489354894548955489654897548985489954900549015490254903549045490554906549075490854909549105491154912549135491454915549165491754918549195492054921549225492354924549255492654927549285492954930549315493254933549345493554936549375493854939549405494154942549435494454945549465494754948549495495054951549525495354954549555495654957549585495954960549615496254963549645496554966549675496854969549705497154972549735497454975549765497754978549795498054981549825498354984549855498654987549885498954990549915499254993549945499554996549975499854999550005500155002550035500455005550065500755008550095501055011550125501355014550155501655017550185501955020550215502255023550245502555026550275502855029550305503155032550335503455035550365503755038550395504055041550425504355044550455504655047550485504955050550515505255053550545505555056550575505855059550605506155062550635506455065550665506755068550695507055071550725507355074550755507655077550785507955080550815508255083550845508555086550875508855089550905509155092550935509455095550965509755098550995510055101551025510355104551055510655107551085510955110551115511255113551145511555116551175511855119551205512155122551235512455125551265512755128551295513055131551325513355134551355513655137551385513955140551415514255143551445514555146551475514855149551505515155152551535515455155551565515755158551595516055161551625516355164551655516655167551685516955170551715517255173551745517555176551775517855179551805518155182551835518455185551865518755188551895519055191551925519355194551955519655197551985519955200552015520255203552045520555206552075520855209552105521155212552135521455215552165521755218552195522055221552225522355224552255522655227552285522955230552315523255233552345523555236552375523855239552405524155242552435524455245552465524755248552495525055251552525525355254552555525655257552585525955260552615526255263552645526555266552675526855269552705527155272552735527455275552765527755278552795528055281552825528355284552855528655287552885528955290552915529255293552945529555296552975529855299553005530155302553035530455305553065530755308553095531055311553125531355314553155531655317553185531955320553215532255323553245532555326553275532855329553305533155332553335533455335553365533755338553395534055341553425534355344553455534655347553485534955350553515535255353553545535555356553575535855359553605536155362553635536455365553665536755368553695537055371553725537355374553755537655377553785537955380553815538255383553845538555386553875538855389553905539155392553935539455395553965539755398553995540055401554025540355404554055540655407554085540955410554115541255413554145541555416554175541855419554205542155422554235542455425554265542755428554295543055431554325543355434554355543655437554385543955440554415544255443554445544555446554475544855449554505545155452554535545455455554565545755458554595546055461554625546355464554655546655467554685546955470554715547255473554745547555476554775547855479554805548155482554835548455485554865548755488554895549055491554925549355494554955549655497554985549955500555015550255503555045550555506555075550855509555105551155512555135551455515555165551755518555195552055521555225552355524555255552655527555285552955530555315553255533555345553555536555375553855539555405554155542555435554455545555465554755548555495555055551555525555355554555555555655557555585555955560555615556255563555645556555566555675556855569555705557155572555735557455575555765557755578555795558055581555825558355584555855558655587555885558955590555915559255593555945559555596555975559855599556005560155602556035560455605556065560755608556095561055611556125561355614556155561655617556185561955620556215562255623556245562555626556275562855629556305563155632556335563455635556365563755638556395564055641556425564355644556455564655647556485564955650556515565255653556545565555656556575565855659556605566155662556635566455665556665566755668556695567055671556725567355674556755567655677556785567955680556815568255683556845568555686556875568855689556905569155692556935569455695556965569755698556995570055701557025570355704557055570655707557085570955710557115571255713557145571555716557175571855719557205572155722557235572455725557265572755728557295573055731557325573355734557355573655737557385573955740557415574255743557445574555746557475574855749557505575155752557535575455755557565575755758557595576055761557625576355764557655576655767557685576955770557715577255773557745577555776557775577855779557805578155782557835578455785557865578755788557895579055791557925579355794557955579655797557985579955800558015580255803558045580555806558075580855809558105581155812558135581455815558165581755818558195582055821558225582355824558255582655827558285582955830558315583255833558345583555836558375583855839558405584155842558435584455845558465584755848558495585055851558525585355854558555585655857558585585955860558615586255863558645586555866558675586855869558705587155872558735587455875558765587755878558795588055881558825588355884558855588655887558885588955890558915589255893558945589555896558975589855899559005590155902559035590455905559065590755908559095591055911559125591355914559155591655917559185591955920559215592255923559245592555926559275592855929559305593155932559335593455935559365593755938559395594055941559425594355944559455594655947559485594955950559515595255953559545595555956559575595855959559605596155962559635596455965559665596755968559695597055971559725597355974559755597655977559785597955980559815598255983559845598555986559875598855989559905599155992559935599455995559965599755998559995600056001560025600356004560055600656007560085600956010560115601256013560145601556016560175601856019560205602156022560235602456025560265602756028560295603056031560325603356034560355603656037560385603956040560415604256043560445604556046560475604856049560505605156052560535605456055560565605756058560595606056061560625606356064560655606656067560685606956070560715607256073560745607556076560775607856079560805608156082560835608456085560865608756088560895609056091560925609356094560955609656097560985609956100561015610256103561045610556106561075610856109561105611156112561135611456115561165611756118561195612056121561225612356124561255612656127561285612956130561315613256133561345613556136561375613856139561405614156142561435614456145561465614756148561495615056151561525615356154561555615656157561585615956160561615616256163561645616556166561675616856169561705617156172561735617456175561765617756178561795618056181561825618356184561855618656187561885618956190561915619256193561945619556196561975619856199562005620156202562035620456205562065620756208562095621056211562125621356214562155621656217562185621956220562215622256223562245622556226562275622856229562305623156232562335623456235562365623756238562395624056241562425624356244562455624656247562485624956250562515625256253562545625556256562575625856259562605626156262562635626456265562665626756268562695627056271562725627356274562755627656277562785627956280562815628256283562845628556286562875628856289562905629156292562935629456295562965629756298562995630056301563025630356304563055630656307563085630956310563115631256313563145631556316563175631856319563205632156322563235632456325563265632756328563295633056331563325633356334563355633656337563385633956340563415634256343563445634556346563475634856349563505635156352563535635456355563565635756358563595636056361563625636356364563655636656367563685636956370563715637256373563745637556376563775637856379563805638156382563835638456385563865638756388563895639056391563925639356394563955639656397563985639956400564015640256403564045640556406564075640856409564105641156412564135641456415564165641756418564195642056421564225642356424564255642656427564285642956430564315643256433564345643556436564375643856439564405644156442564435644456445564465644756448564495645056451564525645356454564555645656457564585645956460564615646256463564645646556466564675646856469564705647156472564735647456475564765647756478564795648056481564825648356484564855648656487564885648956490564915649256493564945649556496564975649856499565005650156502565035650456505565065650756508565095651056511565125651356514565155651656517565185651956520565215652256523565245652556526565275652856529565305653156532565335653456535565365653756538565395654056541565425654356544565455654656547565485654956550565515655256553565545655556556565575655856559565605656156562565635656456565565665656756568565695657056571565725657356574565755657656577565785657956580565815658256583565845658556586565875658856589565905659156592565935659456595565965659756598565995660056601566025660356604566055660656607566085660956610566115661256613566145661556616566175661856619566205662156622566235662456625566265662756628566295663056631566325663356634566355663656637566385663956640566415664256643566445664556646566475664856649566505665156652566535665456655566565665756658566595666056661566625666356664566655666656667566685666956670566715667256673566745667556676566775667856679566805668156682566835668456685566865668756688566895669056691566925669356694566955669656697566985669956700567015670256703567045670556706567075670856709567105671156712567135671456715567165671756718567195672056721567225672356724567255672656727567285672956730567315673256733567345673556736567375673856739567405674156742567435674456745567465674756748567495675056751567525675356754567555675656757567585675956760567615676256763567645676556766567675676856769567705677156772567735677456775567765677756778567795678056781567825678356784567855678656787567885678956790567915679256793567945679556796567975679856799568005680156802568035680456805568065680756808568095681056811568125681356814568155681656817568185681956820568215682256823568245682556826568275682856829568305683156832568335683456835568365683756838568395684056841568425684356844568455684656847568485684956850568515685256853568545685556856568575685856859568605686156862568635686456865568665686756868568695687056871568725687356874568755687656877568785687956880568815688256883568845688556886568875688856889568905689156892568935689456895568965689756898568995690056901569025690356904569055690656907569085690956910569115691256913569145691556916569175691856919569205692156922569235692456925569265692756928569295693056931569325693356934569355693656937569385693956940569415694256943569445694556946569475694856949569505695156952569535695456955569565695756958569595696056961569625696356964569655696656967569685696956970569715697256973569745697556976569775697856979569805698156982569835698456985569865698756988569895699056991569925699356994569955699656997569985699957000570015700257003570045700557006570075700857009570105701157012570135701457015570165701757018570195702057021570225702357024570255702657027570285702957030570315703257033570345703557036570375703857039570405704157042570435704457045570465704757048570495705057051570525705357054570555705657057570585705957060570615706257063570645706557066570675706857069570705707157072570735707457075570765707757078570795708057081570825708357084570855708657087570885708957090570915709257093570945709557096570975709857099571005710157102571035710457105571065710757108571095711057111571125711357114571155711657117571185711957120571215712257123571245712557126571275712857129571305713157132571335713457135571365713757138571395714057141571425714357144571455714657147571485714957150571515715257153571545715557156571575715857159571605716157162571635716457165571665716757168571695717057171571725717357174571755717657177571785717957180571815718257183571845718557186571875718857189571905719157192571935719457195571965719757198571995720057201572025720357204572055720657207572085720957210572115721257213572145721557216572175721857219572205722157222572235722457225572265722757228572295723057231572325723357234572355723657237572385723957240572415724257243572445724557246572475724857249572505725157252572535725457255572565725757258572595726057261572625726357264572655726657267572685726957270572715727257273572745727557276572775727857279572805728157282572835728457285572865728757288572895729057291572925729357294572955729657297572985729957300573015730257303573045730557306573075730857309573105731157312573135731457315573165731757318573195732057321573225732357324573255732657327573285732957330573315733257333573345733557336573375733857339573405734157342573435734457345573465734757348573495735057351573525735357354573555735657357573585735957360573615736257363573645736557366573675736857369573705737157372573735737457375573765737757378573795738057381573825738357384573855738657387573885738957390573915739257393573945739557396573975739857399574005740157402574035740457405574065740757408574095741057411574125741357414574155741657417574185741957420574215742257423574245742557426574275742857429574305743157432574335743457435574365743757438574395744057441574425744357444574455744657447574485744957450574515745257453574545745557456574575745857459574605746157462574635746457465574665746757468574695747057471574725747357474574755747657477574785747957480574815748257483574845748557486574875748857489574905749157492574935749457495574965749757498574995750057501575025750357504575055750657507575085750957510575115751257513575145751557516575175751857519575205752157522575235752457525575265752757528575295753057531575325753357534575355753657537575385753957540575415754257543575445754557546575475754857549575505755157552575535755457555575565755757558575595756057561575625756357564575655756657567575685756957570575715757257573575745757557576575775757857579575805758157582575835758457585575865758757588575895759057591575925759357594575955759657597575985759957600576015760257603576045760557606576075760857609576105761157612576135761457615576165761757618576195762057621576225762357624576255762657627576285762957630576315763257633576345763557636576375763857639576405764157642576435764457645576465764757648576495765057651576525765357654576555765657657576585765957660576615766257663576645766557666576675766857669576705767157672576735767457675576765767757678576795768057681576825768357684576855768657687576885768957690576915769257693576945769557696576975769857699577005770157702577035770457705577065770757708577095771057711577125771357714577155771657717577185771957720577215772257723577245772557726577275772857729577305773157732577335773457735577365773757738577395774057741577425774357744577455774657747577485774957750577515775257753577545775557756577575775857759577605776157762577635776457765577665776757768577695777057771577725777357774577755777657777577785777957780577815778257783577845778557786577875778857789577905779157792577935779457795577965779757798577995780057801578025780357804578055780657807578085780957810578115781257813578145781557816578175781857819578205782157822578235782457825578265782757828578295783057831578325783357834578355783657837578385783957840578415784257843578445784557846578475784857849578505785157852578535785457855578565785757858578595786057861578625786357864578655786657867578685786957870578715787257873578745787557876578775787857879578805788157882578835788457885578865788757888578895789057891578925789357894578955789657897578985789957900579015790257903579045790557906579075790857909579105791157912579135791457915579165791757918579195792057921579225792357924579255792657927579285792957930579315793257933579345793557936579375793857939579405794157942579435794457945579465794757948579495795057951579525795357954579555795657957579585795957960579615796257963579645796557966579675796857969579705797157972579735797457975579765797757978579795798057981579825798357984579855798657987579885798957990579915799257993579945799557996579975799857999580005800158002580035800458005580065800758008580095801058011580125801358014580155801658017580185801958020580215802258023580245802558026580275802858029580305803158032580335803458035580365803758038580395804058041580425804358044580455804658047580485804958050580515805258053580545805558056580575805858059580605806158062580635806458065580665806758068580695807058071580725807358074580755807658077580785807958080580815808258083580845808558086580875808858089580905809158092580935809458095580965809758098580995810058101581025810358104581055810658107581085810958110581115811258113581145811558116581175811858119581205812158122581235812458125581265812758128581295813058131581325813358134581355813658137581385813958140581415814258143581445814558146581475814858149581505815158152581535815458155581565815758158581595816058161581625816358164581655816658167581685816958170581715817258173581745817558176581775817858179581805818158182581835818458185581865818758188581895819058191581925819358194581955819658197581985819958200582015820258203582045820558206582075820858209582105821158212582135821458215582165821758218582195822058221582225822358224582255822658227582285822958230582315823258233582345823558236582375823858239582405824158242582435824458245582465824758248582495825058251582525825358254582555825658257582585825958260582615826258263582645826558266582675826858269582705827158272582735827458275582765827758278582795828058281582825828358284582855828658287582885828958290582915829258293582945829558296582975829858299583005830158302583035830458305583065830758308583095831058311583125831358314583155831658317583185831958320583215832258323583245832558326583275832858329583305833158332583335833458335583365833758338583395834058341583425834358344583455834658347583485834958350583515835258353583545835558356583575835858359583605836158362583635836458365583665836758368583695837058371583725837358374583755837658377583785837958380583815838258383583845838558386583875838858389583905839158392583935839458395583965839758398583995840058401584025840358404584055840658407584085840958410584115841258413584145841558416584175841858419584205842158422584235842458425584265842758428584295843058431584325843358434584355843658437584385843958440584415844258443584445844558446584475844858449584505845158452584535845458455584565845758458584595846058461584625846358464584655846658467584685846958470584715847258473584745847558476584775847858479584805848158482584835848458485584865848758488584895849058491584925849358494584955849658497584985849958500585015850258503585045850558506585075850858509585105851158512585135851458515585165851758518585195852058521585225852358524585255852658527585285852958530585315853258533585345853558536585375853858539585405854158542585435854458545585465854758548585495855058551585525855358554585555855658557585585855958560585615856258563585645856558566585675856858569585705857158572585735857458575585765857758578585795858058581585825858358584585855858658587585885858958590585915859258593585945859558596585975859858599586005860158602586035860458605586065860758608586095861058611586125861358614586155861658617586185861958620586215862258623586245862558626586275862858629586305863158632586335863458635586365863758638586395864058641586425864358644586455864658647586485864958650586515865258653586545865558656586575865858659586605866158662586635866458665586665866758668586695867058671586725867358674586755867658677586785867958680586815868258683586845868558686586875868858689586905869158692586935869458695586965869758698586995870058701587025870358704587055870658707587085870958710587115871258713587145871558716587175871858719587205872158722587235872458725587265872758728587295873058731587325873358734587355873658737587385873958740587415874258743587445874558746587475874858749587505875158752587535875458755587565875758758587595876058761587625876358764587655876658767587685876958770587715877258773587745877558776587775877858779587805878158782587835878458785587865878758788587895879058791587925879358794587955879658797587985879958800588015880258803588045880558806588075880858809588105881158812588135881458815588165881758818588195882058821588225882358824588255882658827588285882958830588315883258833588345883558836588375883858839588405884158842588435884458845588465884758848588495885058851588525885358854588555885658857588585885958860588615886258863588645886558866588675886858869588705887158872588735887458875588765887758878588795888058881588825888358884588855888658887588885888958890588915889258893588945889558896588975889858899589005890158902589035890458905589065890758908589095891058911589125891358914589155891658917589185891958920589215892258923589245892558926589275892858929589305893158932589335893458935589365893758938589395894058941589425894358944589455894658947589485894958950589515895258953589545895558956589575895858959589605896158962589635896458965589665896758968589695897058971589725897358974589755897658977589785897958980589815898258983589845898558986589875898858989589905899158992589935899458995589965899758998589995900059001590025900359004590055900659007590085900959010590115901259013590145901559016590175901859019590205902159022590235902459025590265902759028590295903059031590325903359034590355903659037590385903959040590415904259043590445904559046590475904859049590505905159052590535905459055590565905759058590595906059061590625906359064590655906659067590685906959070590715907259073590745907559076590775907859079590805908159082590835908459085590865908759088590895909059091590925909359094590955909659097590985909959100591015910259103591045910559106591075910859109591105911159112591135911459115591165911759118591195912059121591225912359124591255912659127591285912959130591315913259133591345913559136591375913859139591405914159142591435914459145591465914759148591495915059151591525915359154591555915659157591585915959160591615916259163591645916559166591675916859169591705917159172591735917459175591765917759178591795918059181591825918359184591855918659187591885918959190591915919259193591945919559196591975919859199592005920159202592035920459205592065920759208592095921059211592125921359214592155921659217592185921959220592215922259223592245922559226592275922859229592305923159232592335923459235592365923759238592395924059241592425924359244592455924659247592485924959250592515925259253592545925559256592575925859259592605926159262592635926459265592665926759268592695927059271592725927359274592755927659277592785927959280592815928259283592845928559286592875928859289592905929159292592935929459295592965929759298592995930059301593025930359304593055930659307593085930959310593115931259313593145931559316593175931859319593205932159322593235932459325593265932759328593295933059331593325933359334593355933659337593385933959340593415934259343593445934559346593475934859349593505935159352593535935459355593565935759358593595936059361593625936359364593655936659367593685936959370593715937259373593745937559376593775937859379593805938159382593835938459385593865938759388593895939059391593925939359394593955939659397593985939959400594015940259403594045940559406594075940859409594105941159412594135941459415594165941759418594195942059421594225942359424594255942659427594285942959430594315943259433594345943559436594375943859439594405944159442594435944459445594465944759448594495945059451594525945359454594555945659457594585945959460594615946259463594645946559466594675946859469594705947159472594735947459475594765947759478594795948059481594825948359484594855948659487594885948959490594915949259493594945949559496594975949859499595005950159502595035950459505595065950759508595095951059511595125951359514595155951659517595185951959520595215952259523595245952559526595275952859529595305953159532595335953459535595365953759538595395954059541595425954359544595455954659547595485954959550595515955259553595545955559556595575955859559595605956159562595635956459565595665956759568595695957059571595725957359574595755957659577595785957959580595815958259583595845958559586595875958859589595905959159592595935959459595595965959759598595995960059601596025960359604596055960659607596085960959610596115961259613596145961559616596175961859619596205962159622596235962459625596265962759628596295963059631596325963359634596355963659637596385963959640596415964259643596445964559646596475964859649596505965159652596535965459655596565965759658596595966059661596625966359664596655966659667596685966959670596715967259673596745967559676596775967859679596805968159682596835968459685596865968759688596895969059691596925969359694596955969659697596985969959700597015970259703597045970559706597075970859709597105971159712597135971459715597165971759718597195972059721597225972359724597255972659727597285972959730597315973259733597345973559736597375973859739597405974159742597435974459745597465974759748597495975059751597525975359754597555975659757597585975959760597615976259763597645976559766597675976859769597705977159772597735977459775597765977759778597795978059781597825978359784597855978659787597885978959790597915979259793597945979559796597975979859799598005980159802598035980459805598065980759808598095981059811598125981359814598155981659817598185981959820598215982259823598245982559826598275982859829598305983159832598335983459835598365983759838598395984059841598425984359844598455984659847598485984959850598515985259853598545985559856598575985859859598605986159862598635986459865598665986759868598695987059871598725987359874598755987659877598785987959880598815988259883598845988559886598875988859889598905989159892598935989459895598965989759898598995990059901599025990359904599055990659907599085990959910599115991259913599145991559916599175991859919599205992159922599235992459925599265992759928599295993059931599325993359934599355993659937599385993959940599415994259943599445994559946599475994859949599505995159952599535995459955599565995759958599595996059961599625996359964599655996659967599685996959970599715997259973599745997559976599775997859979599805998159982599835998459985599865998759988599895999059991599925999359994599955999659997599985999960000600016000260003600046000560006600076000860009600106001160012600136001460015600166001760018600196002060021600226002360024600256002660027600286002960030600316003260033600346003560036600376003860039600406004160042600436004460045600466004760048600496005060051600526005360054600556005660057600586005960060600616006260063600646006560066600676006860069600706007160072600736007460075600766007760078600796008060081600826008360084600856008660087600886008960090600916009260093600946009560096600976009860099601006010160102601036010460105601066010760108601096011060111601126011360114601156011660117601186011960120601216012260123601246012560126601276012860129601306013160132601336013460135601366013760138601396014060141601426014360144601456014660147601486014960150601516015260153601546015560156601576015860159601606016160162601636016460165601666016760168601696017060171601726017360174601756017660177601786017960180601816018260183601846018560186601876018860189601906019160192601936019460195601966019760198601996020060201602026020360204602056020660207602086020960210602116021260213602146021560216602176021860219602206022160222602236022460225602266022760228602296023060231602326023360234602356023660237602386023960240602416024260243602446024560246602476024860249602506025160252602536025460255602566025760258602596026060261602626026360264602656026660267602686026960270602716027260273602746027560276602776027860279602806028160282602836028460285602866028760288602896029060291602926029360294602956029660297602986029960300603016030260303603046030560306603076030860309603106031160312603136031460315603166031760318603196032060321603226032360324603256032660327603286032960330603316033260333603346033560336603376033860339603406034160342603436034460345603466034760348603496035060351603526035360354603556035660357603586035960360603616036260363603646036560366603676036860369603706037160372603736037460375603766037760378603796038060381603826038360384603856038660387603886038960390603916039260393603946039560396603976039860399604006040160402604036040460405604066040760408604096041060411604126041360414604156041660417604186041960420604216042260423604246042560426604276042860429604306043160432604336043460435604366043760438604396044060441604426044360444604456044660447604486044960450604516045260453604546045560456604576045860459604606046160462604636046460465604666046760468604696047060471604726047360474604756047660477604786047960480604816048260483604846048560486604876048860489604906049160492604936049460495604966049760498604996050060501605026050360504605056050660507605086050960510605116051260513605146051560516605176051860519605206052160522605236052460525605266052760528605296053060531605326053360534605356053660537605386053960540605416054260543605446054560546605476054860549605506055160552605536055460555605566055760558605596056060561605626056360564605656056660567605686056960570605716057260573605746057560576605776057860579605806058160582605836058460585605866058760588605896059060591605926059360594605956059660597605986059960600606016060260603606046060560606606076060860609606106061160612606136061460615606166061760618606196062060621606226062360624606256062660627606286062960630606316063260633606346063560636606376063860639606406064160642606436064460645606466064760648606496065060651606526065360654606556065660657606586065960660606616066260663606646066560666606676066860669606706067160672606736067460675606766067760678606796068060681606826068360684606856068660687606886068960690606916069260693606946069560696606976069860699607006070160702607036070460705607066070760708607096071060711607126071360714607156071660717607186071960720607216072260723607246072560726607276072860729607306073160732607336073460735607366073760738607396074060741607426074360744607456074660747607486074960750607516075260753607546075560756607576075860759607606076160762607636076460765607666076760768607696077060771607726077360774607756077660777607786077960780607816078260783607846078560786607876078860789607906079160792607936079460795607966079760798607996080060801608026080360804608056080660807608086080960810608116081260813608146081560816608176081860819608206082160822608236082460825608266082760828608296083060831608326083360834608356083660837608386083960840608416084260843608446084560846608476084860849608506085160852608536085460855608566085760858608596086060861608626086360864608656086660867608686086960870608716087260873608746087560876608776087860879608806088160882608836088460885608866088760888608896089060891608926089360894608956089660897608986089960900609016090260903609046090560906609076090860909609106091160912609136091460915609166091760918609196092060921609226092360924609256092660927609286092960930609316093260933609346093560936609376093860939609406094160942609436094460945609466094760948609496095060951609526095360954609556095660957609586095960960609616096260963609646096560966609676096860969609706097160972609736097460975609766097760978609796098060981609826098360984609856098660987609886098960990609916099260993609946099560996609976099860999610006100161002610036100461005610066100761008610096101061011610126101361014610156101661017610186101961020610216102261023610246102561026610276102861029610306103161032610336103461035610366103761038610396104061041610426104361044610456104661047610486104961050610516105261053610546105561056610576105861059610606106161062610636106461065610666106761068610696107061071610726107361074610756107661077610786107961080610816108261083610846108561086610876108861089610906109161092610936109461095610966109761098610996110061101611026110361104611056110661107611086110961110611116111261113611146111561116611176111861119611206112161122611236112461125611266112761128611296113061131611326113361134611356113661137611386113961140611416114261143611446114561146611476114861149611506115161152611536115461155611566115761158611596116061161611626116361164611656116661167611686116961170611716117261173611746117561176611776117861179611806118161182611836118461185611866118761188611896119061191611926119361194611956119661197611986119961200612016120261203612046120561206612076120861209612106121161212612136121461215612166121761218612196122061221612226122361224612256122661227612286122961230612316123261233612346123561236612376123861239612406124161242612436124461245612466124761248612496125061251612526125361254612556125661257612586125961260612616126261263612646126561266612676126861269612706127161272612736127461275612766127761278612796128061281612826128361284612856128661287612886128961290612916129261293612946129561296612976129861299613006130161302613036130461305613066130761308613096131061311613126131361314613156131661317613186131961320613216132261323613246132561326613276132861329613306133161332613336133461335613366133761338613396134061341613426134361344613456134661347613486134961350613516135261353613546135561356613576135861359613606136161362613636136461365613666136761368613696137061371613726137361374613756137661377613786137961380613816138261383613846138561386613876138861389613906139161392613936139461395613966139761398613996140061401614026140361404614056140661407614086140961410614116141261413614146141561416614176141861419614206142161422614236142461425614266142761428614296143061431614326143361434614356143661437614386143961440614416144261443614446144561446614476144861449614506145161452614536145461455614566145761458614596146061461614626146361464614656146661467614686146961470614716147261473614746147561476614776147861479614806148161482614836148461485614866148761488614896149061491614926149361494614956149661497614986149961500615016150261503615046150561506615076150861509615106151161512615136151461515615166151761518615196152061521615226152361524615256152661527615286152961530615316153261533615346153561536615376153861539615406154161542615436154461545615466154761548615496155061551615526155361554615556155661557615586155961560615616156261563615646156561566615676156861569615706157161572615736157461575615766157761578615796158061581615826158361584615856158661587615886158961590615916159261593615946159561596615976159861599616006160161602616036160461605616066160761608616096161061611616126161361614616156161661617616186161961620616216162261623616246162561626616276162861629616306163161632616336163461635616366163761638616396164061641616426164361644616456164661647616486164961650616516165261653616546165561656616576165861659616606166161662616636166461665616666166761668616696167061671616726167361674616756167661677616786167961680616816168261683616846168561686616876168861689616906169161692616936169461695616966169761698616996170061701617026170361704617056170661707617086170961710617116171261713617146171561716617176171861719617206172161722617236172461725617266172761728617296173061731617326173361734617356173661737617386173961740617416174261743617446174561746617476174861749617506175161752617536175461755617566175761758617596176061761617626176361764617656176661767617686176961770617716177261773617746177561776617776177861779617806178161782617836178461785617866178761788617896179061791617926179361794617956179661797617986179961800618016180261803618046180561806618076180861809618106181161812618136181461815618166181761818618196182061821618226182361824618256182661827618286182961830618316183261833618346183561836618376183861839618406184161842618436184461845618466184761848618496185061851618526185361854618556185661857618586185961860618616186261863618646186561866618676186861869618706187161872618736187461875618766187761878618796188061881618826188361884618856188661887618886188961890618916189261893618946189561896618976189861899619006190161902619036190461905619066190761908619096191061911619126191361914619156191661917619186191961920619216192261923619246192561926619276192861929619306193161932619336193461935619366193761938619396194061941619426194361944619456194661947619486194961950619516195261953619546195561956619576195861959619606196161962619636196461965619666196761968619696197061971619726197361974619756197661977619786197961980619816198261983619846198561986619876198861989619906199161992619936199461995619966199761998619996200062001620026200362004620056200662007620086200962010620116201262013620146201562016620176201862019620206202162022620236202462025620266202762028620296203062031620326203362034620356203662037620386203962040620416204262043620446204562046620476204862049620506205162052620536205462055620566205762058620596206062061620626206362064620656206662067620686206962070620716207262073620746207562076620776207862079620806208162082620836208462085620866208762088620896209062091620926209362094620956209662097620986209962100621016210262103621046210562106621076210862109621106211162112621136211462115621166211762118621196212062121621226212362124621256212662127621286212962130621316213262133621346213562136621376213862139621406214162142621436214462145621466214762148621496215062151621526215362154621556215662157621586215962160621616216262163621646216562166621676216862169621706217162172621736217462175621766217762178621796218062181621826218362184621856218662187621886218962190621916219262193621946219562196621976219862199622006220162202622036220462205622066220762208622096221062211622126221362214622156221662217622186221962220622216222262223622246222562226622276222862229622306223162232622336223462235622366223762238622396224062241622426224362244622456224662247622486224962250622516225262253622546225562256622576225862259622606226162262622636226462265622666226762268622696227062271622726227362274622756227662277622786227962280622816228262283622846228562286622876228862289622906229162292622936229462295622966229762298622996230062301623026230362304623056230662307623086230962310623116231262313623146231562316623176231862319623206232162322623236232462325623266232762328623296233062331623326233362334623356233662337623386233962340623416234262343623446234562346623476234862349623506235162352623536235462355623566235762358623596236062361623626236362364623656236662367623686236962370623716237262373623746237562376623776237862379623806238162382623836238462385623866238762388623896239062391623926239362394623956239662397623986239962400624016240262403624046240562406624076240862409624106241162412624136241462415624166241762418624196242062421624226242362424624256242662427624286242962430624316243262433624346243562436624376243862439624406244162442624436244462445624466244762448624496245062451624526245362454624556245662457624586245962460624616246262463624646246562466624676246862469624706247162472624736247462475624766247762478624796248062481624826248362484624856248662487624886248962490624916249262493624946249562496624976249862499625006250162502625036250462505625066250762508625096251062511625126251362514625156251662517625186251962520625216252262523625246252562526625276252862529625306253162532625336253462535625366253762538625396254062541625426254362544625456254662547625486254962550625516255262553625546255562556625576255862559625606256162562625636256462565625666256762568625696257062571625726257362574625756257662577625786257962580625816258262583625846258562586625876258862589625906259162592625936259462595625966259762598625996260062601626026260362604626056260662607626086260962610626116261262613626146261562616626176261862619626206262162622626236262462625626266262762628626296263062631626326263362634626356263662637626386263962640626416264262643626446264562646626476264862649626506265162652626536265462655626566265762658626596266062661626626266362664626656266662667626686266962670626716267262673626746267562676626776267862679626806268162682626836268462685626866268762688626896269062691626926269362694626956269662697626986269962700627016270262703627046270562706627076270862709627106271162712627136271462715627166271762718627196272062721627226272362724627256272662727627286272962730627316273262733627346273562736627376273862739627406274162742627436274462745627466274762748627496275062751627526275362754627556275662757627586275962760627616276262763627646276562766627676276862769627706277162772627736277462775627766277762778627796278062781627826278362784627856278662787627886278962790627916279262793627946279562796627976279862799628006280162802628036280462805628066280762808628096281062811628126281362814628156281662817628186281962820628216282262823628246282562826628276282862829628306283162832628336283462835628366283762838628396284062841628426284362844628456284662847628486284962850628516285262853628546285562856628576285862859628606286162862628636286462865628666286762868628696287062871628726287362874628756287662877628786287962880628816288262883628846288562886628876288862889628906289162892628936289462895628966289762898628996290062901629026290362904629056290662907629086290962910629116291262913629146291562916629176291862919629206292162922629236292462925629266292762928629296293062931629326293362934629356293662937629386293962940629416294262943629446294562946629476294862949629506295162952629536295462955629566295762958629596296062961629626296362964629656296662967629686296962970629716297262973629746297562976629776297862979629806298162982629836298462985629866298762988629896299062991629926299362994629956299662997629986299963000630016300263003630046300563006630076300863009630106301163012630136301463015630166301763018630196302063021630226302363024630256302663027630286302963030630316303263033630346303563036630376303863039630406304163042630436304463045630466304763048630496305063051630526305363054630556305663057630586305963060630616306263063630646306563066630676306863069630706307163072630736307463075630766307763078630796308063081630826308363084630856308663087630886308963090630916309263093630946309563096630976309863099631006310163102631036310463105631066310763108631096311063111631126311363114631156311663117631186311963120631216312263123631246312563126631276312863129631306313163132631336313463135631366313763138631396314063141631426314363144631456314663147631486314963150631516315263153631546315563156631576315863159631606316163162631636316463165631666316763168631696317063171631726317363174631756317663177631786317963180631816318263183631846318563186631876318863189631906319163192631936319463195631966319763198631996320063201632026320363204632056320663207632086320963210632116321263213632146321563216632176321863219632206322163222632236322463225632266322763228632296323063231632326323363234632356323663237632386323963240632416324263243632446324563246632476324863249632506325163252632536325463255632566325763258632596326063261632626326363264632656326663267632686326963270632716327263273632746327563276632776327863279632806328163282632836328463285632866328763288632896329063291632926329363294632956329663297632986329963300633016330263303633046330563306633076330863309633106331163312633136331463315633166331763318633196332063321633226332363324633256332663327633286332963330633316333263333633346333563336633376333863339633406334163342633436334463345633466334763348633496335063351633526335363354633556335663357633586335963360633616336263363633646336563366633676336863369633706337163372633736337463375633766337763378633796338063381633826338363384633856338663387633886338963390633916339263393633946339563396633976339863399634006340163402634036340463405634066340763408634096341063411634126341363414634156341663417634186341963420634216342263423634246342563426634276342863429634306343163432634336343463435634366343763438634396344063441634426344363444634456344663447634486344963450634516345263453634546345563456634576345863459634606346163462634636346463465634666346763468634696347063471634726347363474634756347663477634786347963480634816348263483634846348563486634876348863489634906349163492634936349463495634966349763498634996350063501635026350363504635056350663507635086350963510635116351263513635146351563516635176351863519635206352163522635236352463525635266352763528635296353063531635326353363534635356353663537635386353963540635416354263543635446354563546635476354863549635506355163552635536355463555635566355763558635596356063561635626356363564635656356663567635686356963570635716357263573635746357563576635776357863579635806358163582635836358463585635866358763588635896359063591635926359363594635956359663597635986359963600636016360263603636046360563606636076360863609636106361163612636136361463615636166361763618636196362063621636226362363624636256362663627636286362963630636316363263633636346363563636636376363863639636406364163642636436364463645636466364763648636496365063651636526365363654636556365663657636586365963660636616366263663636646366563666636676366863669636706367163672636736367463675636766367763678636796368063681636826368363684636856368663687636886368963690636916369263693636946369563696636976369863699637006370163702637036370463705637066370763708637096371063711637126371363714637156371663717637186371963720637216372263723637246372563726637276372863729637306373163732637336373463735637366373763738637396374063741637426374363744637456374663747637486374963750637516375263753637546375563756637576375863759637606376163762637636376463765637666376763768637696377063771637726377363774637756377663777637786377963780637816378263783637846378563786637876378863789637906379163792637936379463795637966379763798637996380063801638026380363804638056380663807638086380963810638116381263813638146381563816638176381863819638206382163822638236382463825638266382763828638296383063831638326383363834638356383663837638386383963840638416384263843638446384563846638476384863849638506385163852638536385463855638566385763858638596386063861638626386363864638656386663867638686386963870638716387263873638746387563876638776387863879638806388163882638836388463885638866388763888638896389063891638926389363894638956389663897638986389963900639016390263903639046390563906639076390863909639106391163912639136391463915639166391763918639196392063921639226392363924639256392663927639286392963930639316393263933639346393563936639376393863939639406394163942639436394463945639466394763948639496395063951639526395363954639556395663957639586395963960639616396263963639646396563966639676396863969639706397163972639736397463975639766397763978639796398063981639826398363984639856398663987639886398963990639916399263993639946399563996639976399863999640006400164002640036400464005640066400764008640096401064011640126401364014640156401664017640186401964020640216402264023640246402564026640276402864029640306403164032640336403464035640366403764038640396404064041640426404364044640456404664047640486404964050640516405264053640546405564056640576405864059640606406164062640636406464065640666406764068640696407064071640726407364074640756407664077640786407964080640816408264083640846408564086640876408864089640906409164092640936409464095640966409764098640996410064101641026410364104641056410664107641086410964110641116411264113641146411564116641176411864119641206412164122641236412464125641266412764128641296413064131641326413364134641356413664137641386413964140641416414264143641446414564146641476414864149641506415164152641536415464155641566415764158641596416064161641626416364164641656416664167641686416964170641716417264173641746417564176641776417864179641806418164182641836418464185641866418764188641896419064191641926419364194641956419664197641986419964200642016420264203642046420564206642076420864209642106421164212642136421464215642166421764218642196422064221642226422364224642256422664227642286422964230642316423264233642346423564236642376423864239642406424164242642436424464245642466424764248642496425064251642526425364254642556425664257642586425964260642616426264263642646426564266642676426864269642706427164272642736427464275642766427764278642796428064281642826428364284642856428664287642886428964290642916429264293642946429564296642976429864299643006430164302643036430464305643066430764308643096431064311643126431364314643156431664317643186431964320643216432264323643246432564326643276432864329643306433164332643336433464335643366433764338643396434064341643426434364344643456434664347643486434964350643516435264353643546435564356643576435864359643606436164362643636436464365643666436764368643696437064371643726437364374643756437664377643786437964380643816438264383643846438564386643876438864389643906439164392643936439464395643966439764398643996440064401644026440364404644056440664407644086440964410644116441264413644146441564416644176441864419644206442164422644236442464425644266442764428644296443064431644326443364434644356443664437644386443964440644416444264443644446444564446644476444864449644506445164452644536445464455644566445764458644596446064461644626446364464644656446664467644686446964470644716447264473644746447564476644776447864479644806448164482644836448464485644866448764488644896449064491644926449364494644956449664497644986449964500645016450264503645046450564506645076450864509645106451164512645136451464515645166451764518645196452064521645226452364524645256452664527645286452964530645316453264533645346453564536645376453864539645406454164542645436454464545645466454764548645496455064551645526455364554645556455664557645586455964560645616456264563645646456564566645676456864569645706457164572645736457464575645766457764578645796458064581645826458364584645856458664587645886458964590645916459264593645946459564596645976459864599646006460164602646036460464605646066460764608646096461064611646126461364614646156461664617646186461964620646216462264623646246462564626646276462864629646306463164632646336463464635646366463764638646396464064641646426464364644646456464664647646486464964650646516465264653646546465564656646576465864659646606466164662646636466464665646666466764668646696467064671646726467364674646756467664677646786467964680646816468264683646846468564686646876468864689646906469164692646936469464695646966469764698646996470064701647026470364704647056470664707647086470964710647116471264713647146471564716647176471864719647206472164722647236472464725647266472764728647296473064731647326473364734647356473664737647386473964740647416474264743647446474564746647476474864749647506475164752647536475464755647566475764758647596476064761647626476364764647656476664767647686476964770647716477264773647746477564776647776477864779647806478164782647836478464785647866478764788647896479064791647926479364794647956479664797647986479964800648016480264803648046480564806648076480864809648106481164812648136481464815648166481764818648196482064821648226482364824648256482664827648286482964830648316483264833648346483564836648376483864839648406484164842648436484464845648466484764848648496485064851648526485364854648556485664857648586485964860648616486264863648646486564866648676486864869648706487164872648736487464875648766487764878648796488064881648826488364884648856488664887648886488964890648916489264893648946489564896648976489864899649006490164902649036490464905649066490764908649096491064911649126491364914649156491664917649186491964920649216492264923649246492564926649276492864929649306493164932649336493464935649366493764938649396494064941649426494364944649456494664947649486494964950649516495264953649546495564956649576495864959649606496164962649636496464965649666496764968649696497064971649726497364974649756497664977649786497964980649816498264983649846498564986649876498864989649906499164992649936499464995649966499764998649996500065001650026500365004650056500665007650086500965010650116501265013650146501565016650176501865019650206502165022650236502465025650266502765028650296503065031650326503365034650356503665037650386503965040650416504265043650446504565046650476504865049650506505165052650536505465055650566505765058650596506065061650626506365064650656506665067650686506965070650716507265073650746507565076650776507865079650806508165082650836508465085650866508765088650896509065091650926509365094650956509665097650986509965100651016510265103651046510565106651076510865109651106511165112651136511465115651166511765118651196512065121651226512365124651256512665127651286512965130651316513265133651346513565136651376513865139651406514165142651436514465145651466514765148651496515065151651526515365154651556515665157651586515965160651616516265163651646516565166651676516865169651706517165172651736517465175651766517765178651796518065181651826518365184651856518665187651886518965190651916519265193651946519565196651976519865199652006520165202652036520465205652066520765208652096521065211652126521365214652156521665217652186521965220652216522265223652246522565226652276522865229652306523165232652336523465235652366523765238652396524065241652426524365244652456524665247652486524965250652516525265253652546525565256652576525865259652606526165262652636526465265652666526765268652696527065271652726527365274652756527665277652786527965280652816528265283652846528565286652876528865289652906529165292652936529465295652966529765298652996530065301653026530365304653056530665307653086530965310653116531265313653146531565316653176531865319653206532165322653236532465325653266532765328653296533065331653326533365334653356533665337653386533965340653416534265343653446534565346653476534865349653506535165352653536535465355653566535765358653596536065361653626536365364653656536665367653686536965370653716537265373653746537565376653776537865379653806538165382653836538465385653866538765388653896539065391653926539365394653956539665397653986539965400654016540265403654046540565406654076540865409654106541165412654136541465415654166541765418654196542065421654226542365424654256542665427654286542965430654316543265433654346543565436654376543865439654406544165442654436544465445654466544765448654496545065451654526545365454654556545665457654586545965460654616546265463654646546565466654676546865469654706547165472654736547465475654766547765478654796548065481654826548365484654856548665487654886548965490654916549265493654946549565496654976549865499655006550165502655036550465505655066550765508655096551065511655126551365514655156551665517655186551965520655216552265523655246552565526655276552865529655306553165532655336553465535655366553765538655396554065541655426554365544655456554665547655486554965550655516555265553655546555565556655576555865559655606556165562655636556465565655666556765568655696557065571655726557365574655756557665577655786557965580655816558265583655846558565586655876558865589655906559165592655936559465595655966559765598655996560065601656026560365604656056560665607656086560965610656116561265613656146561565616656176561865619656206562165622656236562465625656266562765628656296563065631656326563365634656356563665637656386563965640656416564265643656446564565646656476564865649656506565165652656536565465655656566565765658656596566065661656626566365664656656566665667656686566965670656716567265673656746567565676656776567865679656806568165682656836568465685656866568765688656896569065691656926569365694656956569665697656986569965700657016570265703657046570565706657076570865709657106571165712657136571465715657166571765718657196572065721657226572365724657256572665727657286572965730657316573265733657346573565736657376573865739657406574165742657436574465745657466574765748657496575065751657526575365754657556575665757657586575965760657616576265763657646576565766657676576865769657706577165772657736577465775657766577765778657796578065781657826578365784657856578665787657886578965790657916579265793657946579565796657976579865799658006580165802658036580465805658066580765808658096581065811658126581365814658156581665817658186581965820658216582265823658246582565826658276582865829658306583165832658336583465835658366583765838658396584065841658426584365844658456584665847658486584965850658516585265853658546585565856658576585865859658606586165862658636586465865658666586765868658696587065871658726587365874658756587665877658786587965880658816588265883658846588565886658876588865889658906589165892658936589465895658966589765898658996590065901659026590365904659056590665907659086590965910659116591265913659146591565916659176591865919659206592165922659236592465925659266592765928659296593065931659326593365934659356593665937659386593965940659416594265943659446594565946659476594865949659506595165952659536595465955659566595765958659596596065961659626596365964659656596665967659686596965970659716597265973659746597565976659776597865979659806598165982659836598465985659866598765988659896599065991659926599365994659956599665997659986599966000660016600266003660046600566006660076600866009660106601166012660136601466015660166601766018660196602066021660226602366024660256602666027660286602966030660316603266033660346603566036660376603866039660406604166042660436604466045660466604766048660496605066051660526605366054660556605666057660586605966060660616606266063660646606566066660676606866069660706607166072660736607466075660766607766078660796608066081660826608366084660856608666087660886608966090660916609266093660946609566096660976609866099661006610166102661036610466105661066610766108661096611066111661126611366114661156611666117661186611966120661216612266123661246612566126661276612866129661306613166132661336613466135661366613766138661396614066141661426614366144661456614666147661486614966150661516615266153661546615566156661576615866159661606616166162661636616466165661666616766168661696617066171661726617366174661756617666177661786617966180661816618266183661846618566186661876618866189661906619166192661936619466195661966619766198661996620066201662026620366204662056620666207662086620966210662116621266213662146621566216662176621866219662206622166222662236622466225662266622766228662296623066231662326623366234662356623666237662386623966240662416624266243662446624566246662476624866249662506625166252662536625466255662566625766258662596626066261662626626366264662656626666267662686626966270662716627266273662746627566276662776627866279662806628166282662836628466285662866628766288662896629066291662926629366294662956629666297662986629966300663016630266303663046630566306663076630866309663106631166312663136631466315663166631766318663196632066321663226632366324663256632666327663286632966330663316633266333663346633566336663376633866339663406634166342663436634466345663466634766348663496635066351663526635366354663556635666357663586635966360663616636266363663646636566366663676636866369663706637166372663736637466375663766637766378663796638066381663826638366384663856638666387663886638966390663916639266393663946639566396663976639866399664006640166402664036640466405664066640766408664096641066411664126641366414664156641666417664186641966420664216642266423664246642566426664276642866429664306643166432664336643466435664366643766438664396644066441664426644366444664456644666447664486644966450664516645266453664546645566456664576645866459664606646166462664636646466465664666646766468664696647066471664726647366474664756647666477664786647966480664816648266483664846648566486664876648866489664906649166492664936649466495664966649766498664996650066501665026650366504665056650666507665086650966510665116651266513665146651566516665176651866519665206652166522665236652466525665266652766528665296653066531665326653366534665356653666537665386653966540665416654266543665446654566546665476654866549665506655166552665536655466555665566655766558665596656066561665626656366564665656656666567665686656966570665716657266573665746657566576665776657866579665806658166582665836658466585665866658766588665896659066591665926659366594665956659666597665986659966600666016660266603666046660566606666076660866609666106661166612666136661466615666166661766618666196662066621666226662366624666256662666627666286662966630666316663266633666346663566636666376663866639666406664166642666436664466645666466664766648666496665066651666526665366654666556665666657666586665966660666616666266663666646666566666666676666866669666706667166672666736667466675666766667766678666796668066681666826668366684666856668666687666886668966690666916669266693666946669566696666976669866699667006670166702667036670466705667066670766708667096671066711667126671366714667156671666717667186671966720667216672266723667246672566726667276672866729667306673166732667336673466735667366673766738667396674066741667426674366744667456674666747667486674966750667516675266753667546675566756667576675866759667606676166762667636676466765667666676766768667696677066771667726677366774667756677666777667786677966780667816678266783667846678566786667876678866789667906679166792667936679466795667966679766798667996680066801668026680366804668056680666807668086680966810668116681266813668146681566816668176681866819668206682166822668236682466825668266682766828668296683066831668326683366834668356683666837668386683966840668416684266843668446684566846668476684866849668506685166852668536685466855668566685766858668596686066861668626686366864668656686666867668686686966870668716687266873668746687566876668776687866879668806688166882668836688466885668866688766888668896689066891668926689366894668956689666897668986689966900669016690266903669046690566906669076690866909669106691166912669136691466915669166691766918669196692066921669226692366924669256692666927669286692966930669316693266933669346693566936669376693866939669406694166942669436694466945669466694766948669496695066951669526695366954669556695666957669586695966960669616696266963669646696566966669676696866969669706697166972669736697466975669766697766978669796698066981669826698366984669856698666987669886698966990669916699266993669946699566996669976699866999670006700167002670036700467005670066700767008670096701067011670126701367014670156701667017670186701967020670216702267023670246702567026670276702867029670306703167032670336703467035670366703767038670396704067041670426704367044670456704667047670486704967050670516705267053670546705567056670576705867059670606706167062670636706467065670666706767068670696707067071670726707367074670756707667077670786707967080670816708267083670846708567086670876708867089670906709167092670936709467095670966709767098670996710067101671026710367104671056710667107671086710967110671116711267113671146711567116671176711867119671206712167122671236712467125671266712767128671296713067131671326713367134671356713667137671386713967140671416714267143671446714567146671476714867149671506715167152671536715467155671566715767158671596716067161671626716367164671656716667167671686716967170671716717267173671746717567176671776717867179671806718167182671836718467185671866718767188671896719067191671926719367194671956719667197671986719967200672016720267203672046720567206672076720867209672106721167212672136721467215672166721767218672196722067221672226722367224672256722667227672286722967230672316723267233672346723567236672376723867239672406724167242672436724467245672466724767248672496725067251672526725367254672556725667257672586725967260672616726267263672646726567266672676726867269672706727167272672736727467275672766727767278672796728067281672826728367284672856728667287672886728967290672916729267293672946729567296672976729867299673006730167302673036730467305673066730767308673096731067311673126731367314673156731667317673186731967320673216732267323673246732567326673276732867329673306733167332673336733467335673366733767338673396734067341673426734367344673456734667347673486734967350673516735267353673546735567356673576735867359673606736167362673636736467365673666736767368673696737067371673726737367374673756737667377673786737967380673816738267383673846738567386673876738867389673906739167392673936739467395673966739767398673996740067401674026740367404674056740667407674086740967410674116741267413674146741567416674176741867419674206742167422674236742467425674266742767428674296743067431674326743367434674356743667437674386743967440674416744267443674446744567446674476744867449674506745167452674536745467455674566745767458674596746067461674626746367464674656746667467674686746967470674716747267473674746747567476674776747867479674806748167482674836748467485674866748767488674896749067491674926749367494674956749667497674986749967500675016750267503675046750567506675076750867509675106751167512675136751467515675166751767518675196752067521675226752367524675256752667527675286752967530675316753267533675346753567536675376753867539675406754167542675436754467545675466754767548675496755067551675526755367554675556755667557675586755967560675616756267563675646756567566675676756867569675706757167572675736757467575675766757767578675796758067581675826758367584675856758667587675886758967590675916759267593675946759567596675976759867599676006760167602676036760467605676066760767608676096761067611676126761367614676156761667617676186761967620676216762267623676246762567626676276762867629676306763167632676336763467635676366763767638676396764067641676426764367644676456764667647676486764967650676516765267653676546765567656676576765867659676606766167662676636766467665676666766767668676696767067671676726767367674676756767667677676786767967680676816768267683676846768567686676876768867689676906769167692676936769467695676966769767698676996770067701677026770367704677056770667707677086770967710677116771267713677146771567716677176771867719677206772167722677236772467725677266772767728677296773067731677326773367734677356773667737677386773967740677416774267743677446774567746677476774867749677506775167752677536775467755677566775767758677596776067761677626776367764677656776667767677686776967770677716777267773677746777567776677776777867779677806778167782677836778467785677866778767788677896779067791677926779367794677956779667797677986779967800678016780267803678046780567806678076780867809678106781167812678136781467815678166781767818678196782067821678226782367824678256782667827678286782967830678316783267833678346783567836678376783867839678406784167842678436784467845678466784767848678496785067851678526785367854678556785667857678586785967860678616786267863678646786567866678676786867869678706787167872678736787467875678766787767878678796788067881678826788367884678856788667887678886788967890678916789267893678946789567896678976789867899679006790167902679036790467905679066790767908679096791067911679126791367914679156791667917679186791967920679216792267923679246792567926679276792867929679306793167932679336793467935679366793767938679396794067941679426794367944679456794667947679486794967950679516795267953679546795567956679576795867959679606796167962679636796467965679666796767968679696797067971679726797367974679756797667977679786797967980679816798267983679846798567986679876798867989679906799167992679936799467995679966799767998679996800068001680026800368004680056800668007680086800968010680116801268013680146801568016680176801868019680206802168022680236802468025680266802768028680296803068031680326803368034680356803668037680386803968040680416804268043680446804568046680476804868049680506805168052680536805468055680566805768058680596806068061680626806368064680656806668067680686806968070680716807268073680746807568076680776807868079680806808168082680836808468085680866808768088680896809068091680926809368094680956809668097680986809968100681016810268103681046810568106681076810868109681106811168112681136811468115681166811768118681196812068121681226812368124681256812668127681286812968130681316813268133681346813568136681376813868139681406814168142681436814468145681466814768148681496815068151681526815368154681556815668157681586815968160681616816268163681646816568166681676816868169681706817168172681736817468175681766817768178681796818068181681826818368184681856818668187681886818968190681916819268193681946819568196681976819868199682006820168202682036820468205682066820768208682096821068211682126821368214682156821668217682186821968220682216822268223682246822568226682276822868229682306823168232682336823468235682366823768238682396824068241682426824368244682456824668247682486824968250682516825268253682546825568256682576825868259682606826168262682636826468265682666826768268682696827068271682726827368274682756827668277682786827968280682816828268283682846828568286682876828868289682906829168292682936829468295682966829768298682996830068301683026830368304683056830668307683086830968310683116831268313683146831568316683176831868319683206832168322683236832468325683266832768328683296833068331683326833368334683356833668337683386833968340683416834268343683446834568346683476834868349683506835168352683536835468355683566835768358683596836068361683626836368364683656836668367683686836968370683716837268373683746837568376683776837868379683806838168382683836838468385683866838768388683896839068391683926839368394683956839668397683986839968400684016840268403684046840568406684076840868409684106841168412684136841468415684166841768418684196842068421684226842368424684256842668427684286842968430684316843268433684346843568436684376843868439684406844168442684436844468445684466844768448684496845068451684526845368454684556845668457684586845968460684616846268463684646846568466684676846868469684706847168472684736847468475684766847768478684796848068481684826848368484684856848668487684886848968490684916849268493684946849568496684976849868499685006850168502685036850468505685066850768508685096851068511685126851368514685156851668517685186851968520685216852268523685246852568526685276852868529685306853168532685336853468535685366853768538685396854068541685426854368544685456854668547685486854968550685516855268553685546855568556685576855868559685606856168562685636856468565685666856768568685696857068571685726857368574685756857668577685786857968580685816858268583685846858568586685876858868589685906859168592685936859468595685966859768598685996860068601686026860368604686056860668607686086860968610686116861268613686146861568616686176861868619686206862168622686236862468625686266862768628686296863068631686326863368634686356863668637686386863968640686416864268643686446864568646686476864868649686506865168652686536865468655686566865768658686596866068661686626866368664686656866668667686686866968670686716867268673686746867568676686776867868679686806868168682686836868468685686866868768688686896869068691686926869368694686956869668697686986869968700687016870268703687046870568706687076870868709687106871168712687136871468715687166871768718687196872068721687226872368724687256872668727687286872968730687316873268733687346873568736687376873868739687406874168742687436874468745687466874768748687496875068751687526875368754687556875668757687586875968760687616876268763687646876568766687676876868769687706877168772687736877468775687766877768778687796878068781687826878368784687856878668787687886878968790687916879268793687946879568796687976879868799688006880168802688036880468805688066880768808688096881068811688126881368814688156881668817688186881968820688216882268823688246882568826688276882868829688306883168832688336883468835688366883768838688396884068841688426884368844688456884668847688486884968850688516885268853688546885568856688576885868859688606886168862688636886468865688666886768868688696887068871688726887368874688756887668877688786887968880688816888268883688846888568886688876888868889688906889168892688936889468895688966889768898688996890068901689026890368904689056890668907689086890968910689116891268913689146891568916689176891868919689206892168922689236892468925689266892768928689296893068931689326893368934689356893668937689386893968940689416894268943689446894568946689476894868949689506895168952689536895468955689566895768958689596896068961689626896368964689656896668967689686896968970689716897268973689746897568976689776897868979689806898168982689836898468985689866898768988689896899068991689926899368994689956899668997689986899969000690016900269003690046900569006690076900869009690106901169012690136901469015690166901769018690196902069021690226902369024690256902669027690286902969030690316903269033690346903569036690376903869039690406904169042690436904469045690466904769048690496905069051690526905369054690556905669057690586905969060690616906269063690646906569066690676906869069690706907169072690736907469075690766907769078690796908069081690826908369084690856908669087690886908969090690916909269093690946909569096690976909869099691006910169102691036910469105691066910769108691096911069111691126911369114691156911669117691186911969120691216912269123691246912569126691276912869129691306913169132691336913469135691366913769138691396914069141691426914369144691456914669147691486914969150691516915269153691546915569156691576915869159691606916169162691636916469165691666916769168691696917069171691726917369174691756917669177691786917969180691816918269183691846918569186691876918869189691906919169192691936919469195691966919769198691996920069201692026920369204692056920669207692086920969210692116921269213692146921569216692176921869219692206922169222692236922469225692266922769228692296923069231692326923369234692356923669237692386923969240692416924269243692446924569246692476924869249692506925169252692536925469255692566925769258692596926069261692626926369264692656926669267692686926969270692716927269273692746927569276692776927869279692806928169282692836928469285692866928769288692896929069291692926929369294692956929669297692986929969300693016930269303693046930569306693076930869309693106931169312693136931469315693166931769318693196932069321693226932369324693256932669327693286932969330693316933269333693346933569336693376933869339693406934169342693436934469345693466934769348693496935069351693526935369354693556935669357693586935969360693616936269363693646936569366693676936869369693706937169372693736937469375693766937769378693796938069381693826938369384693856938669387693886938969390693916939269393693946939569396693976939869399694006940169402694036940469405694066940769408694096941069411694126941369414694156941669417694186941969420694216942269423694246942569426694276942869429694306943169432694336943469435694366943769438694396944069441694426944369444694456944669447694486944969450694516945269453694546945569456694576945869459694606946169462694636946469465694666946769468694696947069471694726947369474694756947669477694786947969480694816948269483694846948569486694876948869489694906949169492694936949469495694966949769498694996950069501695026950369504695056950669507695086950969510695116951269513695146951569516695176951869519695206952169522695236952469525695266952769528695296953069531695326953369534695356953669537695386953969540695416954269543695446954569546695476954869549695506955169552695536955469555695566955769558695596956069561695626956369564695656956669567695686956969570695716957269573695746957569576695776957869579695806958169582695836958469585695866958769588695896959069591695926959369594695956959669597695986959969600696016960269603696046960569606696076960869609696106961169612696136961469615696166961769618696196962069621696226962369624696256962669627696286962969630696316963269633696346963569636696376963869639696406964169642696436964469645696466964769648696496965069651696526965369654696556965669657696586965969660696616966269663696646966569666696676966869669696706967169672696736967469675696766967769678696796968069681696826968369684696856968669687696886968969690696916969269693696946969569696696976969869699697006970169702697036970469705697066970769708697096971069711697126971369714697156971669717697186971969720697216972269723697246972569726697276972869729697306973169732697336973469735697366973769738697396974069741697426974369744697456974669747697486974969750697516975269753697546975569756697576975869759697606976169762697636976469765697666976769768697696977069771697726977369774697756977669777697786977969780697816978269783697846978569786697876978869789697906979169792697936979469795697966979769798697996980069801698026980369804698056980669807698086980969810698116981269813698146981569816698176981869819698206982169822698236982469825698266982769828698296983069831698326983369834698356983669837698386983969840698416984269843698446984569846698476984869849698506985169852698536985469855698566985769858698596986069861698626986369864698656986669867698686986969870698716987269873698746987569876698776987869879698806988169882698836988469885698866988769888698896989069891698926989369894698956989669897698986989969900699016990269903699046990569906699076990869909699106991169912699136991469915699166991769918699196992069921699226992369924699256992669927699286992969930699316993269933699346993569936699376993869939699406994169942699436994469945699466994769948699496995069951699526995369954699556995669957699586995969960699616996269963699646996569966699676996869969699706997169972699736997469975699766997769978699796998069981699826998369984699856998669987699886998969990699916999269993699946999569996699976999869999700007000170002700037000470005700067000770008700097001070011700127001370014700157001670017700187001970020700217002270023700247002570026700277002870029700307003170032700337003470035700367003770038700397004070041700427004370044700457004670047700487004970050700517005270053700547005570056700577005870059700607006170062700637006470065700667006770068700697007070071700727007370074700757007670077700787007970080700817008270083700847008570086700877008870089700907009170092700937009470095700967009770098700997010070101701027010370104701057010670107701087010970110701117011270113701147011570116701177011870119701207012170122701237012470125701267012770128701297013070131701327013370134701357013670137701387013970140701417014270143701447014570146701477014870149701507015170152701537015470155701567015770158701597016070161701627016370164701657016670167701687016970170701717017270173701747017570176701777017870179701807018170182701837018470185701867018770188701897019070191701927019370194701957019670197701987019970200702017020270203702047020570206702077020870209702107021170212702137021470215702167021770218702197022070221702227022370224702257022670227702287022970230702317023270233702347023570236702377023870239702407024170242702437024470245702467024770248702497025070251702527025370254702557025670257702587025970260702617026270263702647026570266702677026870269702707027170272702737027470275702767027770278702797028070281702827028370284702857028670287702887028970290702917029270293702947029570296702977029870299703007030170302703037030470305703067030770308703097031070311703127031370314703157031670317703187031970320703217032270323703247032570326703277032870329703307033170332703337033470335703367033770338703397034070341703427034370344703457034670347703487034970350703517035270353703547035570356703577035870359703607036170362703637036470365703667036770368703697037070371703727037370374703757037670377703787037970380703817038270383703847038570386703877038870389703907039170392703937039470395703967039770398703997040070401704027040370404704057040670407704087040970410704117041270413704147041570416704177041870419704207042170422704237042470425704267042770428704297043070431704327043370434704357043670437704387043970440704417044270443704447044570446704477044870449704507045170452704537045470455704567045770458704597046070461704627046370464704657046670467704687046970470704717047270473704747047570476704777047870479704807048170482704837048470485704867048770488704897049070491704927049370494704957049670497704987049970500705017050270503705047050570506705077050870509705107051170512705137051470515705167051770518705197052070521705227052370524705257052670527705287052970530705317053270533705347053570536705377053870539705407054170542705437054470545705467054770548705497055070551705527055370554705557055670557705587055970560705617056270563705647056570566705677056870569705707057170572705737057470575705767057770578705797058070581705827058370584705857058670587705887058970590705917059270593705947059570596705977059870599706007060170602706037060470605706067060770608706097061070611706127061370614706157061670617706187061970620706217062270623706247062570626706277062870629706307063170632706337063470635706367063770638706397064070641706427064370644706457064670647706487064970650706517065270653706547065570656706577065870659706607066170662706637066470665706667066770668706697067070671706727067370674706757067670677706787067970680706817068270683706847068570686706877068870689706907069170692706937069470695706967069770698706997070070701707027070370704707057070670707707087070970710707117071270713707147071570716707177071870719707207072170722707237072470725707267072770728707297073070731707327073370734707357073670737707387073970740707417074270743707447074570746707477074870749707507075170752707537075470755707567075770758707597076070761707627076370764707657076670767707687076970770707717077270773707747077570776707777077870779707807078170782707837078470785707867078770788707897079070791707927079370794707957079670797707987079970800708017080270803708047080570806708077080870809708107081170812708137081470815708167081770818708197082070821708227082370824708257082670827708287082970830708317083270833708347083570836708377083870839708407084170842708437084470845708467084770848708497085070851708527085370854708557085670857708587085970860708617086270863708647086570866708677086870869708707087170872708737087470875708767087770878708797088070881708827088370884708857088670887708887088970890708917089270893708947089570896708977089870899709007090170902709037090470905709067090770908709097091070911709127091370914709157091670917709187091970920709217092270923709247092570926709277092870929709307093170932709337093470935709367093770938709397094070941709427094370944709457094670947709487094970950709517095270953709547095570956709577095870959709607096170962709637096470965709667096770968709697097070971709727097370974709757097670977709787097970980709817098270983709847098570986709877098870989709907099170992709937099470995709967099770998709997100071001710027100371004710057100671007710087100971010710117101271013710147101571016710177101871019710207102171022710237102471025710267102771028710297103071031710327103371034710357103671037710387103971040710417104271043710447104571046710477104871049710507105171052710537105471055710567105771058710597106071061710627106371064710657106671067710687106971070710717107271073710747107571076710777107871079710807108171082710837108471085710867108771088710897109071091710927109371094710957109671097710987109971100711017110271103711047110571106711077110871109711107111171112711137111471115711167111771118711197112071121711227112371124711257112671127711287112971130711317113271133711347113571136711377113871139711407114171142711437114471145711467114771148711497115071151711527115371154711557115671157711587115971160711617116271163711647116571166711677116871169711707117171172711737117471175711767117771178711797118071181711827118371184711857118671187711887118971190711917119271193711947119571196711977119871199712007120171202712037120471205712067120771208712097121071211712127121371214712157121671217712187121971220712217122271223712247122571226712277122871229712307123171232712337123471235712367123771238712397124071241712427124371244712457124671247712487124971250712517125271253712547125571256712577125871259712607126171262712637126471265712667126771268712697127071271712727127371274712757127671277712787127971280712817128271283712847128571286712877128871289712907129171292712937129471295712967129771298712997130071301713027130371304713057130671307713087130971310713117131271313713147131571316713177131871319713207132171322713237132471325713267132771328713297133071331713327133371334713357133671337713387133971340713417134271343713447134571346713477134871349713507135171352713537135471355713567135771358713597136071361713627136371364713657136671367713687136971370713717137271373713747137571376713777137871379713807138171382713837138471385713867138771388713897139071391713927139371394713957139671397713987139971400714017140271403714047140571406714077140871409714107141171412714137141471415714167141771418714197142071421714227142371424714257142671427714287142971430714317143271433714347143571436714377143871439714407144171442714437144471445714467144771448714497145071451714527145371454714557145671457714587145971460714617146271463714647146571466714677146871469714707147171472714737147471475714767147771478714797148071481714827148371484714857148671487714887148971490714917149271493714947149571496714977149871499715007150171502715037150471505715067150771508715097151071511715127151371514715157151671517715187151971520715217152271523715247152571526715277152871529715307153171532715337153471535715367153771538715397154071541715427154371544715457154671547715487154971550715517155271553715547155571556715577155871559715607156171562715637156471565715667156771568715697157071571715727157371574715757157671577715787157971580715817158271583715847158571586715877158871589715907159171592715937159471595715967159771598715997160071601716027160371604716057160671607716087160971610716117161271613716147161571616716177161871619716207162171622716237162471625716267162771628716297163071631716327163371634716357163671637716387163971640716417164271643716447164571646716477164871649716507165171652716537165471655716567165771658716597166071661716627166371664716657166671667716687166971670716717167271673716747167571676716777167871679716807168171682716837168471685716867168771688716897169071691716927169371694716957169671697716987169971700717017170271703717047170571706717077170871709717107171171712717137171471715717167171771718717197172071721717227172371724717257172671727717287172971730717317173271733717347173571736717377173871739717407174171742717437174471745717467174771748717497175071751717527175371754717557175671757717587175971760717617176271763717647176571766717677176871769717707177171772717737177471775717767177771778717797178071781717827178371784717857178671787717887178971790717917179271793717947179571796717977179871799718007180171802718037180471805718067180771808718097181071811718127181371814718157181671817718187181971820718217182271823718247182571826718277182871829718307183171832718337183471835718367183771838718397184071841718427184371844718457184671847718487184971850718517185271853718547185571856718577185871859718607186171862718637186471865718667186771868718697187071871718727187371874718757187671877718787187971880718817188271883718847188571886718877188871889718907189171892718937189471895718967189771898718997190071901719027190371904719057190671907719087190971910719117191271913719147191571916719177191871919719207192171922719237192471925719267192771928719297193071931719327193371934719357193671937719387193971940719417194271943719447194571946719477194871949719507195171952719537195471955719567195771958719597196071961719627196371964719657196671967719687196971970719717197271973719747197571976719777197871979719807198171982719837198471985719867198771988719897199071991719927199371994719957199671997719987199972000720017200272003720047200572006720077200872009720107201172012720137201472015720167201772018720197202072021720227202372024720257202672027720287202972030720317203272033720347203572036720377203872039720407204172042720437204472045720467204772048720497205072051720527205372054720557205672057720587205972060720617206272063720647206572066720677206872069720707207172072720737207472075720767207772078720797208072081720827208372084720857208672087720887208972090720917209272093720947209572096720977209872099721007210172102721037210472105721067210772108721097211072111721127211372114721157211672117721187211972120721217212272123721247212572126721277212872129721307213172132721337213472135721367213772138721397214072141721427214372144721457214672147721487214972150721517215272153721547215572156721577215872159721607216172162721637216472165721667216772168721697217072171721727217372174721757217672177721787217972180721817218272183721847218572186721877218872189721907219172192721937219472195721967219772198721997220072201722027220372204722057220672207722087220972210722117221272213722147221572216722177221872219722207222172222722237222472225722267222772228722297223072231722327223372234722357223672237722387223972240722417224272243722447224572246722477224872249722507225172252722537225472255722567225772258722597226072261722627226372264722657226672267722687226972270722717227272273722747227572276722777227872279722807228172282722837228472285722867228772288722897229072291722927229372294722957229672297722987229972300723017230272303723047230572306723077230872309723107231172312723137231472315723167231772318723197232072321723227232372324723257232672327723287232972330723317233272333723347233572336723377233872339723407234172342723437234472345723467234772348723497235072351723527235372354723557235672357723587235972360723617236272363723647236572366723677236872369723707237172372723737237472375723767237772378723797238072381723827238372384723857238672387723887238972390723917239272393723947239572396723977239872399724007240172402724037240472405724067240772408724097241072411724127241372414724157241672417724187241972420724217242272423724247242572426724277242872429724307243172432724337243472435724367243772438724397244072441724427244372444724457244672447724487244972450724517245272453724547245572456724577245872459724607246172462724637246472465724667246772468724697247072471724727247372474724757247672477724787247972480724817248272483724847248572486724877248872489724907249172492724937249472495724967249772498724997250072501725027250372504725057250672507725087250972510725117251272513725147251572516725177251872519725207252172522725237252472525725267252772528725297253072531725327253372534725357253672537725387253972540725417254272543725447254572546725477254872549725507255172552725537255472555725567255772558725597256072561725627256372564725657256672567725687256972570725717257272573725747257572576725777257872579725807258172582725837258472585725867258772588725897259072591725927259372594725957259672597725987259972600726017260272603726047260572606726077260872609726107261172612726137261472615726167261772618726197262072621726227262372624726257262672627726287262972630726317263272633726347263572636726377263872639726407264172642726437264472645726467264772648726497265072651726527265372654726557265672657726587265972660726617266272663726647266572666726677266872669726707267172672726737267472675726767267772678726797268072681726827268372684726857268672687726887268972690726917269272693726947269572696726977269872699727007270172702727037270472705727067270772708727097271072711727127271372714727157271672717727187271972720727217272272723727247272572726727277272872729727307273172732727337273472735727367273772738727397274072741727427274372744727457274672747727487274972750727517275272753727547275572756727577275872759727607276172762727637276472765727667276772768727697277072771727727277372774727757277672777727787277972780727817278272783727847278572786727877278872789727907279172792727937279472795727967279772798727997280072801728027280372804728057280672807728087280972810728117281272813728147281572816728177281872819728207282172822728237282472825728267282772828728297283072831728327283372834728357283672837728387283972840728417284272843728447284572846728477284872849728507285172852728537285472855728567285772858728597286072861728627286372864728657286672867728687286972870728717287272873728747287572876728777287872879728807288172882728837288472885728867288772888728897289072891728927289372894728957289672897728987289972900729017290272903729047290572906729077290872909729107291172912729137291472915729167291772918729197292072921729227292372924729257292672927729287292972930729317293272933729347293572936729377293872939729407294172942729437294472945729467294772948729497295072951729527295372954729557295672957729587295972960729617296272963729647296572966729677296872969729707297172972729737297472975729767297772978729797298072981729827298372984729857298672987729887298972990729917299272993729947299572996729977299872999730007300173002730037300473005730067300773008730097301073011730127301373014730157301673017730187301973020730217302273023730247302573026730277302873029730307303173032730337303473035730367303773038730397304073041730427304373044730457304673047730487304973050730517305273053730547305573056730577305873059730607306173062730637306473065730667306773068730697307073071730727307373074730757307673077730787307973080730817308273083730847308573086730877308873089730907309173092730937309473095730967309773098730997310073101731027310373104731057310673107731087310973110731117311273113731147311573116731177311873119731207312173122731237312473125731267312773128731297313073131731327313373134731357313673137731387313973140731417314273143731447314573146731477314873149731507315173152731537315473155731567315773158731597316073161731627316373164731657316673167731687316973170731717317273173731747317573176731777317873179731807318173182731837318473185731867318773188731897319073191731927319373194731957319673197731987319973200732017320273203732047320573206732077320873209732107321173212732137321473215732167321773218732197322073221732227322373224732257322673227732287322973230732317323273233732347323573236732377323873239732407324173242732437324473245732467324773248732497325073251732527325373254732557325673257732587325973260732617326273263732647326573266732677326873269732707327173272732737327473275732767327773278732797328073281732827328373284732857328673287732887328973290732917329273293732947329573296732977329873299733007330173302733037330473305733067330773308733097331073311733127331373314733157331673317733187331973320733217332273323733247332573326733277332873329733307333173332733337333473335733367333773338733397334073341733427334373344733457334673347733487334973350733517335273353733547335573356733577335873359733607336173362733637336473365733667336773368733697337073371733727337373374733757337673377733787337973380733817338273383733847338573386733877338873389733907339173392733937339473395733967339773398733997340073401734027340373404734057340673407734087340973410734117341273413734147341573416734177341873419734207342173422734237342473425734267342773428734297343073431734327343373434734357343673437734387343973440734417344273443734447344573446734477344873449734507345173452734537345473455734567345773458734597346073461734627346373464734657346673467734687346973470734717347273473734747347573476734777347873479734807348173482734837348473485734867348773488734897349073491734927349373494734957349673497734987349973500735017350273503735047350573506735077350873509735107351173512735137351473515735167351773518735197352073521735227352373524735257352673527735287352973530735317353273533735347353573536735377353873539735407354173542735437354473545735467354773548735497355073551735527355373554735557355673557735587355973560735617356273563735647356573566735677356873569735707357173572735737357473575735767357773578735797358073581735827358373584735857358673587735887358973590735917359273593735947359573596735977359873599736007360173602736037360473605736067360773608736097361073611736127361373614736157361673617736187361973620736217362273623736247362573626736277362873629736307363173632736337363473635736367363773638736397364073641736427364373644736457364673647736487364973650736517365273653736547365573656736577365873659736607366173662736637366473665736667366773668736697367073671736727367373674736757367673677736787367973680736817368273683736847368573686736877368873689736907369173692736937369473695736967369773698736997370073701737027370373704737057370673707737087370973710737117371273713737147371573716737177371873719737207372173722737237372473725737267372773728737297373073731737327373373734737357373673737737387373973740737417374273743737447374573746737477374873749737507375173752737537375473755737567375773758737597376073761737627376373764737657376673767737687376973770737717377273773737747377573776737777377873779737807378173782737837378473785737867378773788737897379073791737927379373794737957379673797737987379973800738017380273803738047380573806738077380873809738107381173812738137381473815738167381773818738197382073821738227382373824738257382673827738287382973830738317383273833738347383573836738377383873839738407384173842738437384473845738467384773848738497385073851738527385373854738557385673857738587385973860738617386273863738647386573866738677386873869738707387173872738737387473875738767387773878738797388073881738827388373884738857388673887738887388973890738917389273893738947389573896738977389873899739007390173902739037390473905739067390773908739097391073911739127391373914739157391673917739187391973920739217392273923739247392573926739277392873929739307393173932739337393473935739367393773938739397394073941739427394373944739457394673947739487394973950739517395273953739547395573956739577395873959739607396173962739637396473965739667396773968739697397073971739727397373974739757397673977739787397973980739817398273983739847398573986739877398873989739907399173992739937399473995739967399773998739997400074001740027400374004740057400674007740087400974010740117401274013740147401574016740177401874019740207402174022740237402474025740267402774028740297403074031740327403374034740357403674037740387403974040740417404274043740447404574046740477404874049740507405174052740537405474055740567405774058740597406074061740627406374064740657406674067740687406974070740717407274073740747407574076740777407874079740807408174082740837408474085740867408774088740897409074091740927409374094740957409674097740987409974100741017410274103741047410574106741077410874109741107411174112741137411474115741167411774118741197412074121741227412374124741257412674127741287412974130741317413274133741347413574136741377413874139741407414174142741437414474145741467414774148741497415074151741527415374154741557415674157741587415974160741617416274163741647416574166741677416874169741707417174172741737417474175741767417774178741797418074181741827418374184741857418674187741887418974190741917419274193741947419574196741977419874199742007420174202742037420474205742067420774208742097421074211742127421374214742157421674217742187421974220742217422274223742247422574226742277422874229742307423174232742337423474235742367423774238742397424074241742427424374244742457424674247742487424974250742517425274253742547425574256742577425874259742607426174262742637426474265742667426774268742697427074271742727427374274742757427674277742787427974280742817428274283742847428574286742877428874289742907429174292742937429474295742967429774298742997430074301743027430374304743057430674307743087430974310743117431274313743147431574316743177431874319743207432174322743237432474325743267432774328743297433074331743327433374334743357433674337743387433974340743417434274343743447434574346743477434874349743507435174352743537435474355743567435774358743597436074361743627436374364743657436674367743687436974370743717437274373743747437574376743777437874379743807438174382743837438474385743867438774388743897439074391743927439374394743957439674397743987439974400744017440274403744047440574406744077440874409744107441174412744137441474415744167441774418744197442074421744227442374424744257442674427744287442974430744317443274433744347443574436744377443874439744407444174442744437444474445744467444774448744497445074451744527445374454744557445674457744587445974460744617446274463744647446574466744677446874469744707447174472744737447474475744767447774478744797448074481744827448374484744857448674487744887448974490744917449274493744947449574496744977449874499745007450174502745037450474505745067450774508745097451074511745127451374514745157451674517745187451974520745217452274523745247452574526745277452874529745307453174532745337453474535745367453774538745397454074541745427454374544745457454674547745487454974550745517455274553745547455574556745577455874559745607456174562745637456474565745667456774568745697457074571745727457374574745757457674577745787457974580745817458274583745847458574586745877458874589745907459174592745937459474595745967459774598745997460074601746027460374604746057460674607746087460974610746117461274613746147461574616746177461874619746207462174622746237462474625746267462774628746297463074631746327463374634746357463674637746387463974640746417464274643746447464574646746477464874649746507465174652746537465474655746567465774658746597466074661746627466374664746657466674667746687466974670746717467274673746747467574676746777467874679746807468174682746837468474685746867468774688746897469074691746927469374694746957469674697746987469974700747017470274703747047470574706747077470874709747107471174712747137471474715747167471774718747197472074721747227472374724747257472674727747287472974730747317473274733747347473574736747377473874739747407474174742747437474474745747467474774748747497475074751747527475374754747557475674757747587475974760747617476274763747647476574766747677476874769747707477174772747737477474775747767477774778747797478074781747827478374784747857478674787747887478974790747917479274793747947479574796747977479874799748007480174802748037480474805748067480774808748097481074811748127481374814748157481674817748187481974820748217482274823748247482574826748277482874829748307483174832748337483474835748367483774838748397484074841748427484374844748457484674847748487484974850748517485274853748547485574856748577485874859748607486174862748637486474865748667486774868748697487074871748727487374874748757487674877748787487974880748817488274883748847488574886748877488874889748907489174892748937489474895748967489774898748997490074901749027490374904749057490674907749087490974910749117491274913749147491574916749177491874919749207492174922749237492474925749267492774928749297493074931749327493374934749357493674937749387493974940749417494274943749447494574946749477494874949749507495174952749537495474955749567495774958749597496074961749627496374964749657496674967749687496974970749717497274973749747497574976749777497874979749807498174982749837498474985749867498774988749897499074991749927499374994749957499674997749987499975000750017500275003750047500575006750077500875009750107501175012750137501475015750167501775018750197502075021750227502375024750257502675027750287502975030750317503275033750347503575036750377503875039750407504175042750437504475045750467504775048750497505075051750527505375054750557505675057750587505975060750617506275063750647506575066750677506875069750707507175072750737507475075750767507775078750797508075081750827508375084750857508675087750887508975090750917509275093750947509575096750977509875099751007510175102751037510475105751067510775108751097511075111751127511375114751157511675117751187511975120751217512275123751247512575126751277512875129751307513175132751337513475135751367513775138751397514075141751427514375144751457514675147751487514975150751517515275153751547515575156751577515875159751607516175162751637516475165751667516775168751697517075171751727517375174751757517675177751787517975180751817518275183751847518575186751877518875189751907519175192751937519475195751967519775198751997520075201752027520375204752057520675207752087520975210752117521275213752147521575216752177521875219752207522175222752237522475225752267522775228752297523075231752327523375234752357523675237752387523975240752417524275243752447524575246752477524875249752507525175252752537525475255752567525775258752597526075261752627526375264752657526675267752687526975270752717527275273752747527575276752777527875279752807528175282752837528475285752867528775288752897529075291752927529375294752957529675297752987529975300753017530275303753047530575306753077530875309753107531175312753137531475315753167531775318753197532075321753227532375324753257532675327753287532975330753317533275333753347533575336753377533875339753407534175342753437534475345753467534775348753497535075351753527535375354753557535675357753587535975360753617536275363753647536575366753677536875369753707537175372753737537475375753767537775378753797538075381753827538375384753857538675387753887538975390753917539275393753947539575396753977539875399754007540175402754037540475405754067540775408754097541075411754127541375414754157541675417754187541975420754217542275423754247542575426754277542875429754307543175432754337543475435754367543775438754397544075441754427544375444754457544675447754487544975450754517545275453754547545575456754577545875459754607546175462754637546475465754667546775468754697547075471754727547375474754757547675477754787547975480754817548275483754847548575486754877548875489754907549175492754937549475495754967549775498754997550075501755027550375504755057550675507755087550975510755117551275513755147551575516755177551875519755207552175522755237552475525755267552775528755297553075531755327553375534755357553675537755387553975540755417554275543755447554575546755477554875549755507555175552755537555475555755567555775558755597556075561755627556375564755657556675567755687556975570755717557275573755747557575576755777557875579755807558175582755837558475585755867558775588755897559075591755927559375594755957559675597755987559975600756017560275603756047560575606756077560875609756107561175612756137561475615756167561775618756197562075621756227562375624756257562675627756287562975630756317563275633756347563575636756377563875639756407564175642756437564475645756467564775648756497565075651756527565375654756557565675657756587565975660756617566275663756647566575666756677566875669756707567175672756737567475675756767567775678756797568075681756827568375684756857568675687756887568975690756917569275693756947569575696756977569875699757007570175702757037570475705757067570775708757097571075711757127571375714757157571675717757187571975720757217572275723757247572575726757277572875729757307573175732757337573475735757367573775738757397574075741757427574375744757457574675747757487574975750757517575275753757547575575756757577575875759757607576175762757637576475765757667576775768757697577075771757727577375774757757577675777757787577975780757817578275783757847578575786757877578875789757907579175792757937579475795757967579775798757997580075801758027580375804758057580675807758087580975810758117581275813758147581575816758177581875819758207582175822758237582475825758267582775828758297583075831758327583375834758357583675837758387583975840758417584275843758447584575846758477584875849758507585175852758537585475855758567585775858758597586075861758627586375864758657586675867758687586975870758717587275873758747587575876758777587875879758807588175882758837588475885758867588775888758897589075891758927589375894758957589675897758987589975900759017590275903759047590575906759077590875909759107591175912759137591475915759167591775918759197592075921759227592375924759257592675927759287592975930759317593275933759347593575936759377593875939759407594175942759437594475945759467594775948759497595075951759527595375954759557595675957759587595975960759617596275963759647596575966759677596875969759707597175972759737597475975759767597775978759797598075981759827598375984759857598675987759887598975990759917599275993759947599575996759977599875999760007600176002760037600476005760067600776008760097601076011760127601376014760157601676017760187601976020760217602276023760247602576026760277602876029760307603176032760337603476035760367603776038760397604076041760427604376044760457604676047760487604976050760517605276053760547605576056760577605876059760607606176062760637606476065760667606776068760697607076071760727607376074760757607676077760787607976080760817608276083760847608576086760877608876089760907609176092760937609476095760967609776098760997610076101761027610376104761057610676107761087610976110761117611276113761147611576116761177611876119761207612176122761237612476125761267612776128761297613076131761327613376134761357613676137761387613976140761417614276143761447614576146761477614876149761507615176152761537615476155761567615776158761597616076161761627616376164761657616676167761687616976170761717617276173761747617576176761777617876179761807618176182761837618476185761867618776188761897619076191761927619376194761957619676197761987619976200762017620276203762047620576206762077620876209762107621176212762137621476215762167621776218762197622076221762227622376224762257622676227762287622976230762317623276233762347623576236762377623876239762407624176242762437624476245762467624776248762497625076251762527625376254762557625676257762587625976260762617626276263762647626576266762677626876269762707627176272762737627476275762767627776278762797628076281762827628376284762857628676287762887628976290762917629276293762947629576296762977629876299763007630176302763037630476305763067630776308763097631076311763127631376314763157631676317763187631976320763217632276323763247632576326763277632876329763307633176332763337633476335763367633776338763397634076341763427634376344763457634676347763487634976350763517635276353763547635576356763577635876359763607636176362763637636476365763667636776368763697637076371763727637376374763757637676377763787637976380763817638276383763847638576386763877638876389763907639176392763937639476395763967639776398763997640076401764027640376404764057640676407764087640976410764117641276413764147641576416764177641876419764207642176422764237642476425764267642776428764297643076431764327643376434764357643676437764387643976440764417644276443764447644576446764477644876449764507645176452764537645476455764567645776458764597646076461764627646376464764657646676467764687646976470764717647276473764747647576476764777647876479764807648176482764837648476485764867648776488764897649076491764927649376494764957649676497764987649976500765017650276503765047650576506765077650876509765107651176512765137651476515765167651776518765197652076521765227652376524765257652676527765287652976530765317653276533765347653576536765377653876539765407654176542765437654476545765467654776548765497655076551765527655376554765557655676557765587655976560765617656276563765647656576566765677656876569765707657176572765737657476575765767657776578765797658076581765827658376584765857658676587765887658976590765917659276593765947659576596765977659876599766007660176602766037660476605766067660776608766097661076611766127661376614766157661676617766187661976620766217662276623766247662576626766277662876629766307663176632766337663476635766367663776638766397664076641766427664376644766457664676647766487664976650766517665276653766547665576656766577665876659766607666176662766637666476665766667666776668766697667076671766727667376674766757667676677766787667976680766817668276683766847668576686766877668876689766907669176692766937669476695766967669776698766997670076701767027670376704767057670676707767087670976710767117671276713767147671576716767177671876719767207672176722767237672476725767267672776728767297673076731767327673376734767357673676737767387673976740767417674276743767447674576746767477674876749767507675176752767537675476755767567675776758767597676076761767627676376764767657676676767767687676976770767717677276773767747677576776767777677876779767807678176782767837678476785767867678776788767897679076791767927679376794767957679676797767987679976800768017680276803768047680576806768077680876809768107681176812768137681476815768167681776818768197682076821768227682376824768257682676827768287682976830768317683276833768347683576836768377683876839768407684176842768437684476845768467684776848768497685076851768527685376854768557685676857768587685976860768617686276863768647686576866768677686876869768707687176872768737687476875768767687776878768797688076881768827688376884768857688676887768887688976890768917689276893768947689576896768977689876899769007690176902769037690476905769067690776908769097691076911769127691376914769157691676917769187691976920769217692276923769247692576926769277692876929769307693176932769337693476935769367693776938769397694076941769427694376944769457694676947769487694976950769517695276953769547695576956769577695876959769607696176962769637696476965769667696776968769697697076971769727697376974769757697676977769787697976980769817698276983769847698576986769877698876989769907699176992769937699476995769967699776998769997700077001770027700377004770057700677007770087700977010770117701277013770147701577016770177701877019770207702177022770237702477025770267702777028770297703077031770327703377034770357703677037770387703977040770417704277043770447704577046770477704877049770507705177052770537705477055770567705777058770597706077061770627706377064770657706677067770687706977070770717707277073770747707577076770777707877079770807708177082770837708477085770867708777088770897709077091770927709377094770957709677097770987709977100771017710277103771047710577106771077710877109771107711177112771137711477115771167711777118771197712077121771227712377124771257712677127771287712977130771317713277133771347713577136771377713877139771407714177142771437714477145771467714777148771497715077151771527715377154771557715677157771587715977160771617716277163771647716577166771677716877169771707717177172771737717477175771767717777178771797718077181771827718377184771857718677187771887718977190771917719277193771947719577196771977719877199772007720177202772037720477205772067720777208772097721077211772127721377214772157721677217772187721977220772217722277223772247722577226772277722877229772307723177232772337723477235772367723777238772397724077241772427724377244772457724677247772487724977250772517725277253772547725577256772577725877259772607726177262772637726477265772667726777268772697727077271772727727377274772757727677277772787727977280772817728277283772847728577286772877728877289772907729177292772937729477295772967729777298772997730077301773027730377304773057730677307773087730977310773117731277313773147731577316773177731877319773207732177322773237732477325773267732777328773297733077331773327733377334773357733677337773387733977340773417734277343773447734577346773477734877349773507735177352773537735477355773567735777358773597736077361773627736377364773657736677367773687736977370773717737277373773747737577376773777737877379773807738177382773837738477385773867738777388773897739077391773927739377394773957739677397773987739977400774017740277403774047740577406774077740877409774107741177412774137741477415774167741777418774197742077421774227742377424774257742677427774287742977430774317743277433774347743577436774377743877439774407744177442774437744477445774467744777448774497745077451774527745377454774557745677457774587745977460774617746277463774647746577466774677746877469774707747177472774737747477475774767747777478774797748077481774827748377484774857748677487774887748977490774917749277493774947749577496774977749877499775007750177502775037750477505775067750777508775097751077511775127751377514775157751677517775187751977520775217752277523775247752577526775277752877529775307753177532775337753477535775367753777538775397754077541775427754377544775457754677547775487754977550775517755277553775547755577556775577755877559775607756177562775637756477565775667756777568775697757077571775727757377574775757757677577775787757977580775817758277583775847758577586775877758877589775907759177592775937759477595775967759777598775997760077601776027760377604776057760677607776087760977610776117761277613776147761577616776177761877619776207762177622776237762477625776267762777628776297763077631776327763377634776357763677637776387763977640776417764277643776447764577646776477764877649776507765177652776537765477655776567765777658776597766077661776627766377664776657766677667776687766977670776717767277673776747767577676776777767877679776807768177682776837768477685776867768777688776897769077691776927769377694776957769677697776987769977700777017770277703777047770577706777077770877709777107771177712777137771477715777167771777718777197772077721777227772377724777257772677727777287772977730777317773277733777347773577736777377773877739777407774177742777437774477745777467774777748777497775077751777527775377754777557775677757777587775977760777617776277763777647776577766777677776877769777707777177772777737777477775777767777777778777797778077781777827778377784777857778677787777887778977790777917779277793777947779577796777977779877799778007780177802778037780477805778067780777808778097781077811778127781377814778157781677817778187781977820778217782277823778247782577826778277782877829778307783177832778337783477835778367783777838778397784077841778427784377844778457784677847778487784977850778517785277853778547785577856778577785877859778607786177862778637786477865778667786777868778697787077871778727787377874778757787677877778787787977880778817788277883778847788577886778877788877889778907789177892778937789477895778967789777898778997790077901779027790377904779057790677907779087790977910779117791277913779147791577916779177791877919779207792177922779237792477925779267792777928779297793077931779327793377934779357793677937779387793977940779417794277943779447794577946779477794877949779507795177952779537795477955779567795777958779597796077961779627796377964779657796677967779687796977970779717797277973779747797577976779777797877979779807798177982779837798477985779867798777988779897799077991779927799377994779957799677997779987799978000780017800278003780047800578006780077800878009780107801178012780137801478015780167801778018780197802078021780227802378024780257802678027780287802978030780317803278033780347803578036780377803878039780407804178042780437804478045780467804778048780497805078051780527805378054780557805678057780587805978060780617806278063780647806578066780677806878069780707807178072780737807478075780767807778078780797808078081780827808378084780857808678087780887808978090780917809278093780947809578096780977809878099781007810178102781037810478105781067810778108781097811078111781127811378114781157811678117781187811978120781217812278123781247812578126781277812878129781307813178132781337813478135781367813778138781397814078141781427814378144781457814678147781487814978150781517815278153781547815578156781577815878159781607816178162781637816478165781667816778168781697817078171781727817378174781757817678177781787817978180781817818278183781847818578186781877818878189781907819178192781937819478195781967819778198781997820078201782027820378204782057820678207782087820978210782117821278213782147821578216782177821878219782207822178222782237822478225782267822778228782297823078231782327823378234782357823678237782387823978240782417824278243782447824578246782477824878249782507825178252782537825478255782567825778258782597826078261782627826378264782657826678267782687826978270782717827278273782747827578276782777827878279782807828178282782837828478285782867828778288782897829078291782927829378294782957829678297782987829978300783017830278303783047830578306783077830878309783107831178312783137831478315783167831778318783197832078321783227832378324783257832678327783287832978330783317833278333783347833578336783377833878339783407834178342783437834478345783467834778348783497835078351783527835378354783557835678357783587835978360783617836278363783647836578366783677836878369783707837178372783737837478375783767837778378783797838078381783827838378384783857838678387783887838978390783917839278393783947839578396783977839878399784007840178402784037840478405784067840778408784097841078411784127841378414784157841678417784187841978420784217842278423784247842578426784277842878429784307843178432784337843478435784367843778438784397844078441784427844378444784457844678447784487844978450784517845278453784547845578456784577845878459784607846178462784637846478465784667846778468784697847078471784727847378474784757847678477784787847978480784817848278483784847848578486784877848878489784907849178492784937849478495784967849778498784997850078501785027850378504785057850678507785087850978510785117851278513785147851578516785177851878519785207852178522785237852478525785267852778528785297853078531785327853378534785357853678537785387853978540785417854278543785447854578546785477854878549785507855178552785537855478555785567855778558785597856078561785627856378564785657856678567785687856978570785717857278573785747857578576785777857878579785807858178582785837858478585785867858778588785897859078591785927859378594785957859678597785987859978600786017860278603786047860578606786077860878609786107861178612786137861478615786167861778618786197862078621786227862378624786257862678627786287862978630786317863278633786347863578636786377863878639786407864178642786437864478645786467864778648786497865078651786527865378654786557865678657786587865978660786617866278663786647866578666786677866878669786707867178672786737867478675786767867778678786797868078681786827868378684786857868678687786887868978690786917869278693786947869578696786977869878699787007870178702787037870478705787067870778708787097871078711787127871378714787157871678717787187871978720787217872278723787247872578726787277872878729787307873178732787337873478735787367873778738787397874078741787427874378744787457874678747787487874978750787517875278753787547875578756787577875878759787607876178762787637876478765787667876778768787697877078771787727877378774787757877678777787787877978780787817878278783787847878578786787877878878789787907879178792787937879478795787967879778798787997880078801788027880378804788057880678807788087880978810788117881278813788147881578816788177881878819788207882178822788237882478825788267882778828788297883078831788327883378834788357883678837788387883978840788417884278843788447884578846788477884878849788507885178852788537885478855788567885778858788597886078861788627886378864788657886678867788687886978870788717887278873788747887578876788777887878879788807888178882788837888478885788867888778888788897889078891788927889378894788957889678897788987889978900789017890278903789047890578906789077890878909789107891178912789137891478915789167891778918789197892078921789227892378924789257892678927789287892978930789317893278933789347893578936789377893878939789407894178942789437894478945789467894778948789497895078951789527895378954789557895678957789587895978960789617896278963789647896578966789677896878969789707897178972789737897478975789767897778978789797898078981789827898378984789857898678987789887898978990789917899278993789947899578996789977899878999790007900179002790037900479005790067900779008790097901079011790127901379014790157901679017790187901979020790217902279023790247902579026790277902879029790307903179032790337903479035790367903779038790397904079041790427904379044790457904679047790487904979050790517905279053790547905579056790577905879059790607906179062790637906479065790667906779068790697907079071790727907379074790757907679077790787907979080790817908279083790847908579086790877908879089790907909179092790937909479095790967909779098790997910079101791027910379104791057910679107791087910979110791117911279113791147911579116791177911879119791207912179122791237912479125791267912779128791297913079131791327913379134791357913679137791387913979140791417914279143791447914579146791477914879149791507915179152791537915479155791567915779158791597916079161791627916379164791657916679167791687916979170791717917279173791747917579176791777917879179791807918179182791837918479185791867918779188791897919079191791927919379194791957919679197791987919979200792017920279203792047920579206792077920879209792107921179212792137921479215792167921779218792197922079221792227922379224792257922679227792287922979230792317923279233792347923579236792377923879239792407924179242792437924479245792467924779248792497925079251792527925379254792557925679257792587925979260792617926279263792647926579266792677926879269792707927179272792737927479275792767927779278792797928079281792827928379284792857928679287792887928979290792917929279293792947929579296792977929879299793007930179302793037930479305793067930779308793097931079311793127931379314793157931679317793187931979320793217932279323793247932579326793277932879329793307933179332793337933479335793367933779338793397934079341793427934379344793457934679347793487934979350793517935279353793547935579356793577935879359793607936179362793637936479365793667936779368793697937079371793727937379374793757937679377793787937979380793817938279383793847938579386793877938879389793907939179392793937939479395793967939779398793997940079401794027940379404794057940679407794087940979410794117941279413794147941579416794177941879419794207942179422794237942479425794267942779428794297943079431794327943379434794357943679437794387943979440794417944279443794447944579446794477944879449794507945179452794537945479455794567945779458794597946079461794627946379464794657946679467794687946979470794717947279473794747947579476794777947879479794807948179482794837948479485794867948779488794897949079491794927949379494794957949679497794987949979500795017950279503795047950579506795077950879509795107951179512795137951479515795167951779518795197952079521795227952379524795257952679527795287952979530795317953279533795347953579536795377953879539795407954179542795437954479545795467954779548795497955079551795527955379554795557955679557795587955979560795617956279563795647956579566795677956879569795707957179572795737957479575795767957779578795797958079581795827958379584795857958679587795887958979590795917959279593795947959579596795977959879599796007960179602796037960479605796067960779608796097961079611796127961379614796157961679617796187961979620796217962279623796247962579626796277962879629796307963179632796337963479635796367963779638796397964079641796427964379644796457964679647796487964979650796517965279653796547965579656796577965879659796607966179662796637966479665796667966779668796697967079671796727967379674796757967679677796787967979680796817968279683796847968579686796877968879689796907969179692796937969479695796967969779698796997970079701797027970379704797057970679707797087970979710797117971279713797147971579716797177971879719797207972179722797237972479725797267972779728797297973079731797327973379734797357973679737797387973979740797417974279743797447974579746797477974879749797507975179752797537975479755797567975779758797597976079761797627976379764797657976679767797687976979770797717977279773797747977579776797777977879779797807978179782797837978479785797867978779788797897979079791797927979379794797957979679797797987979979800798017980279803798047980579806798077980879809798107981179812798137981479815798167981779818798197982079821798227982379824798257982679827798287982979830798317983279833798347983579836798377983879839798407984179842798437984479845798467984779848798497985079851798527985379854798557985679857798587985979860798617986279863798647986579866798677986879869798707987179872798737987479875798767987779878798797988079881798827988379884798857988679887798887988979890798917989279893798947989579896798977989879899799007990179902799037990479905799067990779908799097991079911799127991379914799157991679917799187991979920799217992279923799247992579926799277992879929799307993179932799337993479935799367993779938799397994079941799427994379944799457994679947799487994979950799517995279953799547995579956799577995879959799607996179962799637996479965799667996779968799697997079971799727997379974799757997679977799787997979980799817998279983799847998579986799877998879989799907999179992799937999479995799967999779998799998000080001800028000380004800058000680007800088000980010800118001280013800148001580016800178001880019800208002180022800238002480025800268002780028800298003080031800328003380034800358003680037800388003980040800418004280043800448004580046800478004880049800508005180052800538005480055800568005780058800598006080061800628006380064800658006680067800688006980070800718007280073800748007580076800778007880079800808008180082800838008480085800868008780088800898009080091800928009380094800958009680097800988009980100801018010280103801048010580106801078010880109801108011180112801138011480115801168011780118801198012080121801228012380124801258012680127801288012980130801318013280133801348013580136801378013880139801408014180142801438014480145801468014780148801498015080151801528015380154801558015680157801588015980160801618016280163801648016580166801678016880169801708017180172801738017480175801768017780178801798018080181801828018380184801858018680187801888018980190801918019280193801948019580196801978019880199802008020180202802038020480205802068020780208802098021080211802128021380214802158021680217802188021980220802218022280223802248022580226802278022880229802308023180232802338023480235802368023780238802398024080241802428024380244802458024680247802488024980250802518025280253802548025580256802578025880259802608026180262802638026480265802668026780268802698027080271802728027380274802758027680277802788027980280802818028280283802848028580286802878028880289802908029180292802938029480295802968029780298802998030080301803028030380304803058030680307803088030980310803118031280313803148031580316803178031880319803208032180322803238032480325803268032780328803298033080331803328033380334803358033680337803388033980340803418034280343803448034580346803478034880349803508035180352803538035480355803568035780358803598036080361803628036380364803658036680367803688036980370803718037280373803748037580376803778037880379803808038180382803838038480385803868038780388803898039080391803928039380394803958039680397803988039980400804018040280403804048040580406804078040880409804108041180412804138041480415804168041780418804198042080421804228042380424804258042680427804288042980430804318043280433804348043580436804378043880439804408044180442804438044480445804468044780448804498045080451804528045380454804558045680457804588045980460804618046280463804648046580466804678046880469804708047180472804738047480475804768047780478804798048080481804828048380484804858048680487804888048980490804918049280493804948049580496804978049880499805008050180502805038050480505805068050780508805098051080511805128051380514805158051680517805188051980520805218052280523805248052580526805278052880529805308053180532805338053480535805368053780538805398054080541805428054380544805458054680547805488054980550805518055280553805548055580556805578055880559805608056180562805638056480565805668056780568805698057080571805728057380574805758057680577805788057980580805818058280583805848058580586805878058880589805908059180592805938059480595805968059780598805998060080601806028060380604806058060680607806088060980610806118061280613806148061580616806178061880619806208062180622806238062480625806268062780628806298063080631806328063380634806358063680637806388063980640806418064280643806448064580646806478064880649806508065180652806538065480655806568065780658806598066080661806628066380664806658066680667806688066980670806718067280673806748067580676806778067880679806808068180682806838068480685806868068780688806898069080691806928069380694806958069680697806988069980700807018070280703807048070580706807078070880709807108071180712807138071480715807168071780718807198072080721807228072380724807258072680727807288072980730807318073280733807348073580736807378073880739807408074180742807438074480745807468074780748807498075080751807528075380754807558075680757807588075980760807618076280763807648076580766807678076880769807708077180772807738077480775807768077780778807798078080781807828078380784807858078680787807888078980790807918079280793807948079580796807978079880799808008080180802808038080480805808068080780808808098081080811808128081380814808158081680817808188081980820808218082280823808248082580826808278082880829808308083180832808338083480835808368083780838808398084080841808428084380844808458084680847808488084980850808518085280853808548085580856808578085880859808608086180862808638086480865808668086780868808698087080871808728087380874808758087680877808788087980880808818088280883808848088580886808878088880889808908089180892808938089480895808968089780898808998090080901809028090380904809058090680907809088090980910809118091280913809148091580916809178091880919809208092180922809238092480925809268092780928809298093080931809328093380934809358093680937809388093980940809418094280943809448094580946809478094880949809508095180952809538095480955809568095780958809598096080961809628096380964809658096680967809688096980970809718097280973809748097580976809778097880979809808098180982809838098480985809868098780988809898099080991809928099380994809958099680997809988099981000810018100281003810048100581006810078100881009810108101181012810138101481015810168101781018810198102081021810228102381024810258102681027810288102981030810318103281033810348103581036810378103881039810408104181042810438104481045810468104781048810498105081051810528105381054810558105681057810588105981060810618106281063810648106581066810678106881069810708107181072810738107481075810768107781078810798108081081810828108381084810858108681087810888108981090810918109281093810948109581096810978109881099811008110181102811038110481105811068110781108811098111081111811128111381114811158111681117811188111981120811218112281123811248112581126811278112881129811308113181132811338113481135811368113781138811398114081141811428114381144811458114681147811488114981150811518115281153811548115581156811578115881159811608116181162811638116481165811668116781168811698117081171811728117381174811758117681177811788117981180811818118281183811848118581186811878118881189811908119181192811938119481195811968119781198811998120081201812028120381204812058120681207812088120981210812118121281213812148121581216812178121881219812208122181222812238122481225812268122781228812298123081231812328123381234812358123681237812388123981240812418124281243812448124581246812478124881249812508125181252812538125481255812568125781258812598126081261812628126381264812658126681267812688126981270812718127281273812748127581276812778127881279812808128181282812838128481285812868128781288812898129081291812928129381294812958129681297812988129981300813018130281303813048130581306813078130881309813108131181312813138131481315813168131781318813198132081321813228132381324813258132681327813288132981330813318133281333813348133581336813378133881339813408134181342813438134481345813468134781348813498135081351813528135381354813558135681357813588135981360813618136281363813648136581366813678136881369813708137181372813738137481375813768137781378813798138081381813828138381384813858138681387813888138981390813918139281393813948139581396813978139881399814008140181402814038140481405814068140781408814098141081411814128141381414814158141681417814188141981420814218142281423814248142581426814278142881429814308143181432814338143481435814368143781438814398144081441814428144381444814458144681447814488144981450814518145281453814548145581456814578145881459814608146181462814638146481465814668146781468814698147081471814728147381474814758147681477814788147981480814818148281483814848148581486814878148881489814908149181492814938149481495814968149781498814998150081501815028150381504815058150681507815088150981510815118151281513815148151581516815178151881519815208152181522815238152481525815268152781528815298153081531815328153381534815358153681537815388153981540815418154281543815448154581546815478154881549815508155181552815538155481555815568155781558815598156081561815628156381564815658156681567815688156981570815718157281573815748157581576815778157881579815808158181582815838158481585815868158781588815898159081591815928159381594815958159681597815988159981600816018160281603816048160581606816078160881609816108161181612816138161481615816168161781618816198162081621816228162381624816258162681627816288162981630816318163281633816348163581636816378163881639816408164181642816438164481645816468164781648816498165081651816528165381654816558165681657816588165981660816618166281663816648166581666816678166881669816708167181672816738167481675816768167781678816798168081681816828168381684816858168681687816888168981690816918169281693816948169581696816978169881699817008170181702817038170481705817068170781708817098171081711817128171381714817158171681717817188171981720817218172281723817248172581726817278172881729817308173181732817338173481735817368173781738817398174081741817428174381744817458174681747817488174981750817518175281753817548175581756817578175881759817608176181762817638176481765817668176781768817698177081771817728177381774817758177681777817788177981780817818178281783817848178581786817878178881789817908179181792817938179481795817968179781798817998180081801818028180381804818058180681807818088180981810818118181281813818148181581816818178181881819818208182181822818238182481825818268182781828818298183081831818328183381834818358183681837818388183981840818418184281843818448184581846818478184881849818508185181852818538185481855818568185781858818598186081861818628186381864818658186681867818688186981870818718187281873818748187581876818778187881879818808188181882818838188481885818868188781888818898189081891818928189381894818958189681897818988189981900819018190281903819048190581906819078190881909819108191181912819138191481915819168191781918819198192081921819228192381924819258192681927819288192981930819318193281933819348193581936819378193881939819408194181942819438194481945819468194781948819498195081951819528195381954819558195681957819588195981960819618196281963819648196581966819678196881969819708197181972819738197481975819768197781978819798198081981819828198381984819858198681987819888198981990819918199281993819948199581996819978199881999820008200182002820038200482005820068200782008820098201082011820128201382014820158201682017820188201982020820218202282023820248202582026820278202882029820308203182032820338203482035820368203782038820398204082041820428204382044820458204682047820488204982050820518205282053820548205582056820578205882059820608206182062820638206482065820668206782068820698207082071820728207382074820758207682077820788207982080820818208282083820848208582086820878208882089820908209182092820938209482095820968209782098820998210082101821028210382104821058210682107821088210982110821118211282113821148211582116821178211882119821208212182122821238212482125821268212782128821298213082131821328213382134821358213682137821388213982140821418214282143821448214582146821478214882149821508215182152821538215482155821568215782158821598216082161821628216382164821658216682167821688216982170821718217282173821748217582176821778217882179821808218182182821838218482185821868218782188821898219082191821928219382194821958219682197821988219982200822018220282203822048220582206822078220882209822108221182212822138221482215822168221782218822198222082221822228222382224822258222682227822288222982230822318223282233822348223582236822378223882239822408224182242822438224482245822468224782248822498225082251822528225382254822558225682257822588225982260822618226282263822648226582266822678226882269822708227182272822738227482275822768227782278822798228082281822828228382284822858228682287822888228982290822918229282293822948229582296822978229882299823008230182302823038230482305823068230782308823098231082311823128231382314823158231682317823188231982320823218232282323823248232582326823278232882329823308233182332823338233482335823368233782338823398234082341823428234382344823458234682347823488234982350823518235282353823548235582356823578235882359823608236182362823638236482365823668236782368823698237082371823728237382374823758237682377823788237982380823818238282383823848238582386823878238882389823908239182392823938239482395823968239782398823998240082401824028240382404824058240682407824088240982410824118241282413824148241582416824178241882419824208242182422824238242482425824268242782428824298243082431824328243382434824358243682437824388243982440824418244282443824448244582446824478244882449824508245182452824538245482455824568245782458824598246082461824628246382464824658246682467824688246982470824718247282473824748247582476824778247882479824808248182482824838248482485824868248782488824898249082491824928249382494824958249682497824988249982500825018250282503825048250582506825078250882509825108251182512825138251482515825168251782518825198252082521825228252382524825258252682527825288252982530825318253282533825348253582536825378253882539825408254182542825438254482545825468254782548825498255082551825528255382554825558255682557825588255982560825618256282563825648256582566825678256882569825708257182572825738257482575825768257782578825798258082581825828258382584825858258682587825888258982590825918259282593825948259582596825978259882599826008260182602826038260482605826068260782608826098261082611826128261382614826158261682617826188261982620826218262282623826248262582626826278262882629826308263182632826338263482635826368263782638826398264082641826428264382644826458264682647826488264982650826518265282653826548265582656826578265882659826608266182662826638266482665826668266782668826698267082671826728267382674826758267682677826788267982680826818268282683826848268582686826878268882689826908269182692826938269482695826968269782698826998270082701827028270382704827058270682707827088270982710827118271282713827148271582716827178271882719827208272182722827238272482725827268272782728827298273082731827328273382734827358273682737827388273982740827418274282743827448274582746827478274882749827508275182752827538275482755827568275782758827598276082761827628276382764827658276682767827688276982770827718277282773827748277582776827778277882779827808278182782827838278482785827868278782788827898279082791827928279382794827958279682797827988279982800828018280282803828048280582806828078280882809828108281182812828138281482815828168281782818828198282082821828228282382824828258282682827828288282982830828318283282833828348283582836828378283882839828408284182842828438284482845828468284782848828498285082851828528285382854828558285682857828588285982860828618286282863828648286582866828678286882869828708287182872828738287482875828768287782878828798288082881828828288382884828858288682887828888288982890828918289282893828948289582896828978289882899829008290182902829038290482905829068290782908829098291082911829128291382914829158291682917829188291982920829218292282923829248292582926829278292882929829308293182932829338293482935829368293782938829398294082941829428294382944829458294682947829488294982950829518295282953829548295582956829578295882959829608296182962829638296482965829668296782968829698297082971829728297382974829758297682977829788297982980829818298282983829848298582986829878298882989829908299182992829938299482995829968299782998829998300083001830028300383004830058300683007830088300983010830118301283013830148301583016830178301883019830208302183022830238302483025830268302783028830298303083031830328303383034830358303683037830388303983040830418304283043830448304583046830478304883049830508305183052830538305483055830568305783058830598306083061830628306383064830658306683067830688306983070830718307283073830748307583076830778307883079830808308183082830838308483085830868308783088830898309083091830928309383094830958309683097830988309983100831018310283103831048310583106831078310883109831108311183112831138311483115831168311783118831198312083121831228312383124831258312683127831288312983130831318313283133831348313583136831378313883139831408314183142831438314483145831468314783148831498315083151831528315383154831558315683157831588315983160831618316283163831648316583166831678316883169831708317183172831738317483175831768317783178831798318083181831828318383184831858318683187831888318983190831918319283193831948319583196831978319883199832008320183202832038320483205832068320783208832098321083211832128321383214832158321683217832188321983220832218322283223832248322583226832278322883229832308323183232832338323483235832368323783238832398324083241832428324383244832458324683247832488324983250832518325283253832548325583256832578325883259832608326183262832638326483265832668326783268832698327083271832728327383274832758327683277832788327983280832818328283283832848328583286832878328883289832908329183292832938329483295832968329783298832998330083301833028330383304833058330683307833088330983310833118331283313833148331583316833178331883319833208332183322833238332483325833268332783328833298333083331833328333383334833358333683337833388333983340833418334283343833448334583346833478334883349833508335183352833538335483355833568335783358833598336083361833628336383364833658336683367833688336983370833718337283373833748337583376833778337883379833808338183382833838338483385833868338783388833898339083391833928339383394833958339683397833988339983400834018340283403834048340583406834078340883409834108341183412834138341483415834168341783418834198342083421834228342383424834258342683427834288342983430834318343283433834348343583436834378343883439834408344183442834438344483445834468344783448834498345083451834528345383454834558345683457834588345983460834618346283463834648346583466834678346883469834708347183472834738347483475834768347783478834798348083481834828348383484834858348683487834888348983490834918349283493834948349583496834978349883499835008350183502835038350483505835068350783508835098351083511835128351383514835158351683517835188351983520835218352283523835248352583526835278352883529835308353183532835338353483535835368353783538835398354083541835428354383544835458354683547835488354983550835518355283553835548355583556835578355883559835608356183562835638356483565835668356783568835698357083571835728357383574835758357683577835788357983580835818358283583835848358583586835878358883589835908359183592835938359483595835968359783598835998360083601836028360383604836058360683607836088360983610836118361283613836148361583616836178361883619836208362183622836238362483625836268362783628836298363083631836328363383634836358363683637836388363983640836418364283643836448364583646836478364883649836508365183652836538365483655836568365783658836598366083661836628366383664836658366683667836688366983670836718367283673836748367583676836778367883679836808368183682836838368483685836868368783688836898369083691836928369383694836958369683697836988369983700837018370283703837048370583706837078370883709837108371183712837138371483715837168371783718837198372083721837228372383724837258372683727837288372983730837318373283733837348373583736837378373883739837408374183742837438374483745837468374783748837498375083751837528375383754837558375683757837588375983760837618376283763837648376583766837678376883769837708377183772837738377483775837768377783778837798378083781837828378383784837858378683787837888378983790837918379283793837948379583796837978379883799838008380183802838038380483805838068380783808838098381083811838128381383814838158381683817838188381983820838218382283823838248382583826838278382883829838308383183832838338383483835838368383783838838398384083841838428384383844838458384683847838488384983850838518385283853838548385583856838578385883859838608386183862838638386483865838668386783868838698387083871838728387383874838758387683877838788387983880838818388283883838848388583886838878388883889838908389183892838938389483895838968389783898838998390083901839028390383904839058390683907839088390983910839118391283913839148391583916839178391883919839208392183922839238392483925839268392783928839298393083931839328393383934839358393683937839388393983940839418394283943839448394583946839478394883949839508395183952839538395483955839568395783958839598396083961839628396383964839658396683967839688396983970839718397283973839748397583976839778397883979839808398183982839838398483985839868398783988839898399083991839928399383994839958399683997839988399984000840018400284003840048400584006840078400884009840108401184012840138401484015840168401784018840198402084021840228402384024840258402684027840288402984030840318403284033840348403584036840378403884039840408404184042840438404484045840468404784048840498405084051840528405384054840558405684057840588405984060840618406284063840648406584066840678406884069840708407184072840738407484075840768407784078840798408084081840828408384084840858408684087840888408984090840918409284093840948409584096840978409884099841008410184102841038410484105841068410784108841098411084111841128411384114841158411684117841188411984120841218412284123841248412584126841278412884129841308413184132841338413484135841368413784138841398414084141841428414384144841458414684147841488414984150841518415284153841548415584156841578415884159841608416184162841638416484165841668416784168841698417084171841728417384174841758417684177841788417984180841818418284183841848418584186841878418884189841908419184192841938419484195841968419784198841998420084201842028420384204842058420684207842088420984210842118421284213842148421584216842178421884219842208422184222842238422484225842268422784228842298423084231842328423384234842358423684237842388423984240842418424284243842448424584246842478424884249842508425184252842538425484255842568425784258842598426084261842628426384264842658426684267842688426984270842718427284273842748427584276842778427884279842808428184282842838428484285842868428784288842898429084291842928429384294842958429684297842988429984300843018430284303843048430584306843078430884309843108431184312843138431484315843168431784318843198432084321843228432384324843258432684327843288432984330843318433284333843348433584336843378433884339843408434184342843438434484345843468434784348843498435084351843528435384354843558435684357843588435984360843618436284363843648436584366843678436884369843708437184372843738437484375843768437784378843798438084381843828438384384843858438684387843888438984390843918439284393843948439584396843978439884399844008440184402844038440484405844068440784408844098441084411844128441384414844158441684417844188441984420844218442284423844248442584426844278442884429844308443184432844338443484435844368443784438844398444084441844428444384444844458444684447844488444984450844518445284453844548445584456844578445884459844608446184462844638446484465844668446784468844698447084471844728447384474844758447684477844788447984480844818448284483844848448584486844878448884489844908449184492844938449484495844968449784498844998450084501845028450384504845058450684507845088450984510845118451284513845148451584516845178451884519845208452184522845238452484525845268452784528845298453084531845328453384534845358453684537845388453984540845418454284543845448454584546845478454884549845508455184552845538455484555845568455784558845598456084561845628456384564845658456684567845688456984570845718457284573845748457584576845778457884579845808458184582845838458484585845868458784588845898459084591845928459384594845958459684597845988459984600846018460284603846048460584606846078460884609846108461184612846138461484615846168461784618846198462084621846228462384624846258462684627846288462984630846318463284633846348463584636846378463884639846408464184642846438464484645846468464784648846498465084651846528465384654846558465684657846588465984660846618466284663846648466584666846678466884669846708467184672846738467484675846768467784678846798468084681846828468384684846858468684687846888468984690846918469284693846948469584696846978469884699847008470184702847038470484705847068470784708847098471084711847128471384714847158471684717847188471984720847218472284723847248472584726847278472884729847308473184732847338473484735847368473784738847398474084741847428474384744847458474684747847488474984750847518475284753847548475584756847578475884759847608476184762847638476484765847668476784768847698477084771847728477384774847758477684777847788477984780847818478284783847848478584786847878478884789847908479184792847938479484795847968479784798847998480084801848028480384804848058480684807848088480984810848118481284813848148481584816848178481884819848208482184822848238482484825848268482784828848298483084831848328483384834848358483684837848388483984840848418484284843848448484584846848478484884849848508485184852848538485484855848568485784858848598486084861848628486384864848658486684867848688486984870848718487284873848748487584876848778487884879848808488184882848838488484885848868488784888848898489084891848928489384894848958489684897848988489984900849018490284903849048490584906849078490884909849108491184912849138491484915849168491784918849198492084921849228492384924849258492684927849288492984930849318493284933849348493584936849378493884939849408494184942849438494484945849468494784948849498495084951849528495384954849558495684957849588495984960849618496284963849648496584966849678496884969849708497184972849738497484975849768497784978849798498084981849828498384984849858498684987849888498984990849918499284993849948499584996849978499884999850008500185002850038500485005850068500785008850098501085011850128501385014850158501685017850188501985020850218502285023850248502585026850278502885029850308503185032850338503485035850368503785038850398504085041850428504385044850458504685047850488504985050850518505285053850548505585056850578505885059850608506185062850638506485065850668506785068850698507085071850728507385074850758507685077850788507985080850818508285083850848508585086850878508885089850908509185092850938509485095850968509785098850998510085101851028510385104851058510685107851088510985110851118511285113851148511585116851178511885119851208512185122851238512485125851268512785128851298513085131851328513385134851358513685137851388513985140851418514285143851448514585146851478514885149851508515185152851538515485155851568515785158851598516085161851628516385164851658516685167851688516985170851718517285173851748517585176851778517885179851808518185182851838518485185851868518785188851898519085191851928519385194851958519685197851988519985200852018520285203852048520585206852078520885209852108521185212852138521485215852168521785218852198522085221852228522385224852258522685227852288522985230852318523285233852348523585236852378523885239852408524185242852438524485245852468524785248852498525085251852528525385254852558525685257852588525985260852618526285263852648526585266852678526885269852708527185272852738527485275852768527785278852798528085281852828528385284852858528685287852888528985290852918529285293852948529585296852978529885299853008530185302853038530485305853068530785308853098531085311853128531385314853158531685317853188531985320853218532285323853248532585326853278532885329853308533185332853338533485335853368533785338853398534085341853428534385344853458534685347853488534985350853518535285353853548535585356853578535885359853608536185362853638536485365853668536785368853698537085371853728537385374853758537685377853788537985380853818538285383853848538585386853878538885389853908539185392853938539485395853968539785398853998540085401854028540385404854058540685407854088540985410854118541285413854148541585416854178541885419854208542185422854238542485425854268542785428854298543085431854328543385434854358543685437854388543985440854418544285443854448544585446854478544885449854508545185452854538545485455854568545785458854598546085461854628546385464854658546685467854688546985470854718547285473854748547585476854778547885479854808548185482854838548485485854868548785488854898549085491854928549385494854958549685497854988549985500855018550285503855048550585506855078550885509855108551185512855138551485515855168551785518855198552085521855228552385524855258552685527855288552985530855318553285533855348553585536855378553885539855408554185542855438554485545855468554785548855498555085551855528555385554855558555685557855588555985560855618556285563855648556585566855678556885569855708557185572855738557485575855768557785578855798558085581855828558385584855858558685587855888558985590855918559285593855948559585596855978559885599856008560185602856038560485605856068560785608856098561085611856128561385614856158561685617856188561985620856218562285623856248562585626856278562885629856308563185632856338563485635856368563785638856398564085641856428564385644856458564685647856488564985650856518565285653856548565585656856578565885659856608566185662856638566485665856668566785668856698567085671856728567385674856758567685677856788567985680856818568285683856848568585686856878568885689856908569185692856938569485695856968569785698856998570085701857028570385704857058570685707857088570985710857118571285713857148571585716857178571885719857208572185722857238572485725857268572785728857298573085731857328573385734857358573685737857388573985740857418574285743857448574585746857478574885749857508575185752857538575485755857568575785758857598576085761857628576385764857658576685767857688576985770857718577285773857748577585776857778577885779857808578185782857838578485785857868578785788857898579085791857928579385794857958579685797857988579985800858018580285803858048580585806858078580885809858108581185812858138581485815858168581785818858198582085821858228582385824858258582685827858288582985830858318583285833858348583585836858378583885839858408584185842858438584485845858468584785848858498585085851858528585385854858558585685857858588585985860858618586285863858648586585866858678586885869858708587185872858738587485875858768587785878858798588085881858828588385884858858588685887858888588985890858918589285893858948589585896858978589885899859008590185902859038590485905859068590785908859098591085911859128591385914859158591685917859188591985920859218592285923859248592585926859278592885929859308593185932859338593485935859368593785938859398594085941859428594385944859458594685947859488594985950859518595285953859548595585956859578595885959859608596185962859638596485965859668596785968859698597085971859728597385974859758597685977859788597985980859818598285983859848598585986859878598885989859908599185992859938599485995859968599785998859998600086001860028600386004860058600686007860088600986010860118601286013860148601586016860178601886019860208602186022860238602486025860268602786028860298603086031860328603386034860358603686037860388603986040860418604286043860448604586046860478604886049860508605186052860538605486055860568605786058860598606086061860628606386064860658606686067860688606986070860718607286073860748607586076860778607886079860808608186082860838608486085860868608786088860898609086091860928609386094860958609686097860988609986100861018610286103861048610586106861078610886109861108611186112861138611486115861168611786118861198612086121861228612386124861258612686127861288612986130861318613286133861348613586136861378613886139861408614186142861438614486145861468614786148861498615086151861528615386154861558615686157861588615986160861618616286163861648616586166861678616886169861708617186172861738617486175861768617786178861798618086181861828618386184861858618686187861888618986190861918619286193861948619586196861978619886199862008620186202862038620486205862068620786208862098621086211862128621386214862158621686217862188621986220862218622286223862248622586226862278622886229862308623186232862338623486235862368623786238862398624086241862428624386244862458624686247862488624986250862518625286253862548625586256862578625886259862608626186262862638626486265862668626786268862698627086271862728627386274862758627686277862788627986280862818628286283862848628586286862878628886289862908629186292862938629486295862968629786298862998630086301863028630386304863058630686307863088630986310863118631286313863148631586316863178631886319863208632186322863238632486325863268632786328863298633086331863328633386334863358633686337863388633986340863418634286343863448634586346863478634886349863508635186352863538635486355863568635786358863598636086361863628636386364863658636686367863688636986370863718637286373863748637586376863778637886379863808638186382863838638486385863868638786388863898639086391863928639386394863958639686397863988639986400864018640286403864048640586406864078640886409864108641186412864138641486415864168641786418864198642086421864228642386424864258642686427864288642986430864318643286433864348643586436864378643886439864408644186442864438644486445864468644786448864498645086451864528645386454864558645686457864588645986460864618646286463864648646586466864678646886469864708647186472864738647486475864768647786478864798648086481864828648386484864858648686487864888648986490864918649286493864948649586496864978649886499865008650186502865038650486505865068650786508865098651086511865128651386514865158651686517865188651986520865218652286523865248652586526865278652886529865308653186532865338653486535865368653786538865398654086541865428654386544865458654686547865488654986550865518655286553865548655586556865578655886559865608656186562865638656486565865668656786568865698657086571865728657386574865758657686577865788657986580865818658286583865848658586586865878658886589865908659186592865938659486595865968659786598865998660086601866028660386604866058660686607866088660986610866118661286613866148661586616866178661886619866208662186622866238662486625866268662786628866298663086631866328663386634866358663686637866388663986640866418664286643866448664586646866478664886649866508665186652866538665486655866568665786658866598666086661866628666386664866658666686667866688666986670866718667286673866748667586676866778667886679866808668186682866838668486685866868668786688866898669086691866928669386694866958669686697866988669986700867018670286703867048670586706867078670886709867108671186712867138671486715867168671786718867198672086721867228672386724867258672686727867288672986730867318673286733867348673586736867378673886739867408674186742867438674486745867468674786748867498675086751867528675386754867558675686757867588675986760867618676286763867648676586766867678676886769867708677186772867738677486775867768677786778867798678086781867828678386784867858678686787867888678986790867918679286793867948679586796867978679886799868008680186802868038680486805868068680786808868098681086811868128681386814868158681686817868188681986820868218682286823868248682586826868278682886829868308683186832868338683486835868368683786838868398684086841868428684386844868458684686847868488684986850868518685286853868548685586856868578685886859868608686186862868638686486865868668686786868868698687086871868728687386874868758687686877868788687986880868818688286883868848688586886868878688886889868908689186892868938689486895868968689786898868998690086901869028690386904869058690686907869088690986910869118691286913869148691586916869178691886919869208692186922869238692486925869268692786928869298693086931869328693386934869358693686937869388693986940869418694286943869448694586946869478694886949869508695186952869538695486955869568695786958869598696086961869628696386964869658696686967869688696986970869718697286973869748697586976869778697886979869808698186982869838698486985869868698786988869898699086991869928699386994869958699686997869988699987000870018700287003870048700587006870078700887009870108701187012870138701487015870168701787018870198702087021870228702387024870258702687027870288702987030870318703287033870348703587036870378703887039870408704187042870438704487045870468704787048870498705087051870528705387054870558705687057870588705987060870618706287063870648706587066870678706887069870708707187072870738707487075870768707787078870798708087081870828708387084870858708687087870888708987090870918709287093870948709587096870978709887099871008710187102871038710487105871068710787108871098711087111871128711387114871158711687117871188711987120871218712287123871248712587126871278712887129871308713187132871338713487135871368713787138871398714087141871428714387144871458714687147871488714987150871518715287153871548715587156871578715887159871608716187162871638716487165871668716787168871698717087171871728717387174871758717687177871788717987180871818718287183871848718587186871878718887189871908719187192871938719487195871968719787198871998720087201872028720387204872058720687207872088720987210872118721287213872148721587216872178721887219872208722187222872238722487225872268722787228872298723087231872328723387234872358723687237872388723987240872418724287243872448724587246872478724887249872508725187252872538725487255872568725787258872598726087261872628726387264872658726687267872688726987270872718727287273872748727587276872778727887279872808728187282872838728487285872868728787288872898729087291872928729387294872958729687297872988729987300873018730287303873048730587306873078730887309873108731187312873138731487315873168731787318873198732087321873228732387324873258732687327873288732987330873318733287333873348733587336873378733887339873408734187342873438734487345873468734787348873498735087351873528735387354873558735687357873588735987360873618736287363873648736587366873678736887369873708737187372873738737487375873768737787378873798738087381873828738387384873858738687387873888738987390873918739287393873948739587396873978739887399874008740187402874038740487405874068740787408874098741087411874128741387414874158741687417874188741987420874218742287423874248742587426874278742887429874308743187432874338743487435874368743787438874398744087441874428744387444874458744687447874488744987450874518745287453874548745587456874578745887459874608746187462874638746487465874668746787468874698747087471874728747387474874758747687477874788747987480874818748287483874848748587486874878748887489874908749187492874938749487495874968749787498874998750087501875028750387504875058750687507875088750987510875118751287513875148751587516875178751887519875208752187522875238752487525875268752787528875298753087531875328753387534875358753687537875388753987540875418754287543875448754587546875478754887549875508755187552875538755487555875568755787558875598756087561875628756387564875658756687567875688756987570875718757287573875748757587576875778757887579875808758187582875838758487585875868758787588875898759087591875928759387594875958759687597875988759987600876018760287603876048760587606876078760887609876108761187612876138761487615876168761787618876198762087621876228762387624876258762687627876288762987630876318763287633876348763587636876378763887639876408764187642876438764487645876468764787648876498765087651876528765387654876558765687657876588765987660876618766287663876648766587666876678766887669876708767187672876738767487675876768767787678876798768087681876828768387684876858768687687876888768987690876918769287693876948769587696876978769887699877008770187702877038770487705877068770787708877098771087711877128771387714877158771687717877188771987720877218772287723877248772587726877278772887729877308773187732877338773487735877368773787738877398774087741877428774387744877458774687747877488774987750877518775287753877548775587756877578775887759877608776187762877638776487765877668776787768877698777087771877728777387774877758777687777877788777987780877818778287783877848778587786877878778887789877908779187792877938779487795877968779787798877998780087801878028780387804878058780687807878088780987810878118781287813878148781587816878178781887819878208782187822878238782487825878268782787828878298783087831878328783387834878358783687837878388783987840878418784287843878448784587846878478784887849878508785187852878538785487855878568785787858878598786087861878628786387864878658786687867878688786987870878718787287873878748787587876878778787887879878808788187882878838788487885878868788787888878898789087891878928789387894878958789687897878988789987900879018790287903879048790587906879078790887909879108791187912879138791487915879168791787918879198792087921879228792387924879258792687927879288792987930879318793287933879348793587936879378793887939879408794187942879438794487945879468794787948879498795087951879528795387954879558795687957879588795987960879618796287963879648796587966879678796887969879708797187972879738797487975879768797787978879798798087981879828798387984879858798687987879888798987990879918799287993879948799587996879978799887999880008800188002880038800488005880068800788008880098801088011880128801388014880158801688017880188801988020880218802288023880248802588026880278802888029880308803188032880338803488035880368803788038880398804088041880428804388044880458804688047880488804988050880518805288053880548805588056880578805888059880608806188062880638806488065880668806788068880698807088071880728807388074880758807688077880788807988080880818808288083880848808588086880878808888089880908809188092880938809488095880968809788098880998810088101881028810388104881058810688107881088810988110881118811288113881148811588116881178811888119881208812188122881238812488125881268812788128881298813088131881328813388134881358813688137881388813988140881418814288143881448814588146881478814888149881508815188152881538815488155881568815788158881598816088161881628816388164881658816688167881688816988170881718817288173881748817588176881778817888179881808818188182881838818488185881868818788188881898819088191881928819388194881958819688197881988819988200882018820288203882048820588206882078820888209882108821188212882138821488215882168821788218882198822088221882228822388224882258822688227882288822988230882318823288233882348823588236882378823888239882408824188242882438824488245882468824788248882498825088251882528825388254882558825688257882588825988260882618826288263882648826588266882678826888269882708827188272882738827488275882768827788278882798828088281882828828388284882858828688287882888828988290882918829288293882948829588296882978829888299883008830188302883038830488305883068830788308883098831088311883128831388314883158831688317883188831988320883218832288323883248832588326883278832888329883308833188332883338833488335883368833788338883398834088341883428834388344883458834688347883488834988350883518835288353883548835588356883578835888359883608836188362883638836488365883668836788368883698837088371883728837388374883758837688377883788837988380883818838288383883848838588386883878838888389883908839188392883938839488395883968839788398883998840088401884028840388404884058840688407884088840988410884118841288413884148841588416884178841888419884208842188422884238842488425884268842788428884298843088431884328843388434884358843688437884388843988440884418844288443884448844588446884478844888449884508845188452884538845488455884568845788458884598846088461884628846388464884658846688467884688846988470884718847288473884748847588476884778847888479884808848188482884838848488485884868848788488884898849088491884928849388494884958849688497884988849988500885018850288503885048850588506885078850888509885108851188512885138851488515885168851788518885198852088521885228852388524885258852688527885288852988530885318853288533885348853588536885378853888539885408854188542885438854488545885468854788548885498855088551885528855388554885558855688557885588855988560885618856288563885648856588566885678856888569885708857188572885738857488575885768857788578885798858088581885828858388584885858858688587885888858988590885918859288593885948859588596885978859888599886008860188602886038860488605886068860788608886098861088611886128861388614886158861688617886188861988620886218862288623886248862588626886278862888629886308863188632886338863488635886368863788638886398864088641886428864388644886458864688647886488864988650886518865288653886548865588656886578865888659886608866188662886638866488665886668866788668886698867088671886728867388674886758867688677886788867988680886818868288683886848868588686886878868888689886908869188692886938869488695886968869788698886998870088701887028870388704887058870688707887088870988710887118871288713887148871588716887178871888719887208872188722887238872488725887268872788728887298873088731887328873388734887358873688737887388873988740887418874288743887448874588746887478874888749887508875188752887538875488755887568875788758887598876088761887628876388764887658876688767887688876988770887718877288773887748877588776887778877888779887808878188782887838878488785887868878788788887898879088791887928879388794887958879688797887988879988800888018880288803888048880588806888078880888809888108881188812888138881488815888168881788818888198882088821888228882388824888258882688827888288882988830888318883288833888348883588836888378883888839888408884188842888438884488845888468884788848888498885088851888528885388854888558885688857888588885988860888618886288863888648886588866888678886888869888708887188872888738887488875888768887788878888798888088881888828888388884888858888688887888888888988890888918889288893888948889588896888978889888899889008890188902889038890488905889068890788908889098891088911889128891388914889158891688917889188891988920889218892288923889248892588926889278892888929889308893188932889338893488935889368893788938889398894088941889428894388944889458894688947889488894988950889518895288953889548895588956889578895888959889608896188962889638896488965889668896788968889698897088971889728897388974889758897688977889788897988980889818898288983889848898588986889878898888989889908899188992889938899488995889968899788998889998900089001890028900389004890058900689007890088900989010890118901289013890148901589016890178901889019890208902189022890238902489025890268902789028890298903089031890328903389034890358903689037890388903989040890418904289043890448904589046890478904889049890508905189052890538905489055890568905789058890598906089061890628906389064890658906689067890688906989070890718907289073890748907589076890778907889079890808908189082890838908489085890868908789088890898909089091890928909389094890958909689097890988909989100891018910289103891048910589106891078910889109891108911189112891138911489115891168911789118891198912089121891228912389124891258912689127891288912989130891318913289133891348913589136891378913889139891408914189142891438914489145891468914789148891498915089151891528915389154891558915689157891588915989160891618916289163891648916589166891678916889169891708917189172891738917489175891768917789178891798918089181891828918389184891858918689187891888918989190891918919289193891948919589196891978919889199892008920189202892038920489205892068920789208892098921089211892128921389214892158921689217892188921989220892218922289223892248922589226892278922889229892308923189232892338923489235892368923789238892398924089241892428924389244892458924689247892488924989250892518925289253892548925589256892578925889259892608926189262892638926489265892668926789268892698927089271892728927389274892758927689277892788927989280892818928289283892848928589286892878928889289892908929189292892938929489295892968929789298892998930089301893028930389304893058930689307893088930989310893118931289313893148931589316893178931889319893208932189322893238932489325893268932789328893298933089331893328933389334893358933689337893388933989340893418934289343893448934589346893478934889349893508935189352893538935489355893568935789358893598936089361893628936389364893658936689367893688936989370893718937289373893748937589376893778937889379893808938189382893838938489385893868938789388893898939089391893928939389394893958939689397893988939989400894018940289403894048940589406894078940889409894108941189412894138941489415894168941789418894198942089421894228942389424894258942689427894288942989430894318943289433894348943589436894378943889439894408944189442894438944489445894468944789448894498945089451894528945389454894558945689457894588945989460894618946289463894648946589466894678946889469894708947189472894738947489475894768947789478894798948089481894828948389484894858948689487894888948989490894918949289493894948949589496894978949889499895008950189502895038950489505895068950789508895098951089511895128951389514895158951689517895188951989520895218952289523895248952589526895278952889529895308953189532895338953489535895368953789538895398954089541895428954389544895458954689547895488954989550895518955289553895548955589556895578955889559895608956189562895638956489565895668956789568895698957089571895728957389574895758957689577895788957989580895818958289583895848958589586895878958889589895908959189592895938959489595895968959789598895998960089601896028960389604896058960689607896088960989610896118961289613896148961589616896178961889619896208962189622896238962489625896268962789628896298963089631896328963389634896358963689637896388963989640896418964289643896448964589646896478964889649896508965189652896538965489655896568965789658896598966089661896628966389664896658966689667896688966989670896718967289673896748967589676896778967889679896808968189682896838968489685896868968789688896898969089691896928969389694896958969689697896988969989700897018970289703897048970589706897078970889709897108971189712897138971489715897168971789718897198972089721897228972389724897258972689727897288972989730897318973289733897348973589736897378973889739897408974189742897438974489745897468974789748897498975089751897528975389754897558975689757897588975989760897618976289763897648976589766897678976889769897708977189772897738977489775897768977789778897798978089781897828978389784897858978689787897888978989790897918979289793897948979589796897978979889799898008980189802898038980489805898068980789808898098981089811898128981389814898158981689817898188981989820898218982289823898248982589826898278982889829898308983189832898338983489835898368983789838898398984089841898428984389844898458984689847898488984989850898518985289853898548985589856898578985889859898608986189862898638986489865898668986789868898698987089871898728987389874898758987689877898788987989880898818988289883898848988589886898878988889889898908989189892898938989489895898968989789898898998990089901899028990389904899058990689907899088990989910899118991289913899148991589916899178991889919899208992189922899238992489925899268992789928899298993089931899328993389934899358993689937899388993989940899418994289943899448994589946899478994889949899508995189952899538995489955899568995789958899598996089961899628996389964899658996689967899688996989970899718997289973899748997589976899778997889979899808998189982899838998489985899868998789988899898999089991899928999389994899958999689997899988999990000900019000290003900049000590006900079000890009900109001190012900139001490015900169001790018900199002090021900229002390024900259002690027900289002990030900319003290033900349003590036900379003890039900409004190042900439004490045900469004790048900499005090051900529005390054900559005690057900589005990060900619006290063900649006590066900679006890069900709007190072900739007490075900769007790078900799008090081900829008390084900859008690087900889008990090900919009290093900949009590096900979009890099901009010190102901039010490105901069010790108901099011090111901129011390114901159011690117901189011990120901219012290123901249012590126901279012890129901309013190132901339013490135901369013790138901399014090141901429014390144901459014690147901489014990150901519015290153901549015590156901579015890159901609016190162901639016490165901669016790168901699017090171901729017390174901759017690177901789017990180901819018290183901849018590186901879018890189901909019190192901939019490195901969019790198901999020090201902029020390204902059020690207902089020990210902119021290213902149021590216902179021890219902209022190222902239022490225902269022790228902299023090231902329023390234902359023690237902389023990240902419024290243902449024590246902479024890249902509025190252902539025490255902569025790258902599026090261902629026390264902659026690267902689026990270902719027290273902749027590276902779027890279902809028190282902839028490285902869028790288902899029090291902929029390294902959029690297902989029990300903019030290303903049030590306903079030890309903109031190312903139031490315903169031790318903199032090321903229032390324903259032690327903289032990330903319033290333903349033590336903379033890339903409034190342903439034490345903469034790348903499035090351903529035390354903559035690357903589035990360903619036290363903649036590366903679036890369903709037190372903739037490375903769037790378903799038090381903829038390384903859038690387903889038990390903919039290393903949039590396903979039890399904009040190402904039040490405904069040790408904099041090411904129041390414904159041690417904189041990420904219042290423904249042590426904279042890429904309043190432904339043490435904369043790438904399044090441904429044390444904459044690447904489044990450904519045290453904549045590456904579045890459904609046190462904639046490465904669046790468904699047090471904729047390474904759047690477904789047990480904819048290483904849048590486904879048890489904909049190492904939049490495904969049790498904999050090501905029050390504905059050690507905089050990510905119051290513905149051590516905179051890519905209052190522905239052490525905269052790528905299053090531905329053390534905359053690537905389053990540905419054290543905449054590546905479054890549905509055190552905539055490555905569055790558905599056090561905629056390564905659056690567905689056990570905719057290573905749057590576905779057890579905809058190582905839058490585905869058790588905899059090591905929059390594905959059690597905989059990600906019060290603906049060590606906079060890609906109061190612906139061490615906169061790618906199062090621906229062390624906259062690627906289062990630906319063290633906349063590636906379063890639906409064190642906439064490645906469064790648906499065090651906529065390654906559065690657906589065990660906619066290663906649066590666906679066890669906709067190672906739067490675906769067790678906799068090681906829068390684906859068690687906889068990690906919069290693906949069590696906979069890699907009070190702907039070490705907069070790708907099071090711907129071390714907159071690717907189071990720907219072290723907249072590726907279072890729907309073190732907339073490735907369073790738907399074090741907429074390744907459074690747907489074990750907519075290753907549075590756907579075890759907609076190762907639076490765907669076790768907699077090771907729077390774907759077690777907789077990780907819078290783907849078590786907879078890789907909079190792907939079490795907969079790798907999080090801908029080390804908059080690807908089080990810908119081290813908149081590816908179081890819908209082190822908239082490825908269082790828908299083090831908329083390834908359083690837908389083990840908419084290843908449084590846908479084890849908509085190852908539085490855908569085790858908599086090861908629086390864908659086690867908689086990870908719087290873908749087590876908779087890879908809088190882908839088490885908869088790888908899089090891908929089390894908959089690897908989089990900909019090290903909049090590906909079090890909909109091190912909139091490915909169091790918909199092090921909229092390924909259092690927909289092990930909319093290933909349093590936909379093890939909409094190942909439094490945909469094790948909499095090951909529095390954909559095690957909589095990960909619096290963909649096590966909679096890969909709097190972909739097490975909769097790978909799098090981909829098390984909859098690987909889098990990909919099290993909949099590996909979099890999910009100191002910039100491005910069100791008910099101091011910129101391014910159101691017910189101991020910219102291023910249102591026910279102891029910309103191032910339103491035910369103791038910399104091041910429104391044910459104691047910489104991050910519105291053910549105591056910579105891059910609106191062910639106491065910669106791068910699107091071910729107391074910759107691077910789107991080910819108291083910849108591086910879108891089910909109191092910939109491095910969109791098910999110091101911029110391104911059110691107911089110991110911119111291113911149111591116911179111891119911209112191122911239112491125911269112791128911299113091131911329113391134911359113691137911389113991140911419114291143911449114591146911479114891149911509115191152911539115491155911569115791158911599116091161911629116391164911659116691167911689116991170911719117291173911749117591176911779117891179911809118191182911839118491185911869118791188911899119091191911929119391194911959119691197911989119991200912019120291203912049120591206912079120891209912109121191212912139121491215912169121791218912199122091221912229122391224912259122691227912289122991230912319123291233912349123591236912379123891239912409124191242912439124491245912469124791248912499125091251912529125391254912559125691257912589125991260912619126291263912649126591266912679126891269912709127191272912739127491275912769127791278912799128091281912829128391284912859128691287912889128991290912919129291293912949129591296912979129891299913009130191302913039130491305913069130791308913099131091311913129131391314913159131691317913189131991320913219132291323913249132591326913279132891329913309133191332913339133491335913369133791338913399134091341913429134391344913459134691347913489134991350913519135291353913549135591356913579135891359913609136191362913639136491365913669136791368913699137091371913729137391374913759137691377913789137991380913819138291383913849138591386913879138891389913909139191392913939139491395913969139791398913999140091401914029140391404914059140691407914089140991410914119141291413914149141591416914179141891419914209142191422914239142491425914269142791428914299143091431914329143391434914359143691437914389143991440914419144291443914449144591446914479144891449914509145191452914539145491455914569145791458914599146091461914629146391464914659146691467914689146991470914719147291473914749147591476914779147891479914809148191482914839148491485914869148791488914899149091491914929149391494914959149691497914989149991500915019150291503915049150591506915079150891509915109151191512915139151491515915169151791518915199152091521915229152391524915259152691527915289152991530915319153291533915349153591536915379153891539915409154191542915439154491545915469154791548915499155091551915529155391554915559155691557915589155991560915619156291563915649156591566915679156891569915709157191572915739157491575915769157791578915799158091581915829158391584915859158691587915889158991590915919159291593915949159591596915979159891599916009160191602916039160491605916069160791608916099161091611916129161391614916159161691617916189161991620916219162291623916249162591626916279162891629916309163191632916339163491635916369163791638916399164091641916429164391644916459164691647916489164991650916519165291653916549165591656916579165891659916609166191662916639166491665916669166791668916699167091671916729167391674916759167691677916789167991680916819168291683916849168591686916879168891689916909169191692916939169491695916969169791698916999170091701917029170391704917059170691707917089170991710917119171291713917149171591716917179171891719917209172191722917239172491725917269172791728917299173091731917329173391734917359173691737917389173991740917419174291743917449174591746917479174891749917509175191752917539175491755917569175791758917599176091761917629176391764917659176691767917689176991770917719177291773917749177591776917779177891779917809178191782917839178491785917869178791788917899179091791917929179391794917959179691797917989179991800918019180291803918049180591806918079180891809918109181191812918139181491815918169181791818918199182091821918229182391824918259182691827918289182991830918319183291833918349183591836918379183891839918409184191842918439184491845918469184791848918499185091851918529185391854918559185691857918589185991860918619186291863918649186591866918679186891869918709187191872918739187491875918769187791878918799188091881918829188391884918859188691887918889188991890918919189291893918949189591896918979189891899919009190191902919039190491905919069190791908919099191091911919129191391914919159191691917919189191991920919219192291923919249192591926919279192891929919309193191932919339193491935919369193791938919399194091941919429194391944919459194691947919489194991950919519195291953919549195591956919579195891959919609196191962919639196491965919669196791968919699197091971919729197391974919759197691977919789197991980919819198291983919849198591986919879198891989919909199191992919939199491995919969199791998919999200092001920029200392004920059200692007920089200992010920119201292013920149201592016920179201892019920209202192022920239202492025920269202792028920299203092031920329203392034920359203692037920389203992040920419204292043920449204592046920479204892049920509205192052920539205492055920569205792058920599206092061920629206392064920659206692067920689206992070920719207292073920749207592076920779207892079920809208192082920839208492085920869208792088920899209092091920929209392094920959209692097920989209992100921019210292103921049210592106921079210892109921109211192112921139211492115921169211792118921199212092121921229212392124921259212692127921289212992130921319213292133921349213592136921379213892139921409214192142921439214492145921469214792148921499215092151921529215392154921559215692157921589215992160921619216292163921649216592166921679216892169921709217192172921739217492175921769217792178921799218092181921829218392184921859218692187921889218992190921919219292193921949219592196921979219892199922009220192202922039220492205922069220792208922099221092211922129221392214922159221692217922189221992220922219222292223922249222592226922279222892229922309223192232922339223492235922369223792238922399224092241922429224392244922459224692247922489224992250922519225292253922549225592256922579225892259922609226192262922639226492265922669226792268922699227092271922729227392274922759227692277922789227992280922819228292283922849228592286922879228892289922909229192292922939229492295922969229792298922999230092301923029230392304923059230692307923089230992310923119231292313923149231592316923179231892319923209232192322923239232492325923269232792328923299233092331923329233392334923359233692337923389233992340923419234292343923449234592346923479234892349923509235192352923539235492355923569235792358923599236092361923629236392364923659236692367923689236992370923719237292373923749237592376923779237892379923809238192382923839238492385923869238792388923899239092391923929239392394923959239692397923989239992400924019240292403924049240592406924079240892409924109241192412924139241492415924169241792418924199242092421924229242392424924259242692427924289242992430924319243292433924349243592436924379243892439924409244192442924439244492445924469244792448924499245092451924529245392454924559245692457924589245992460924619246292463924649246592466924679246892469924709247192472924739247492475924769247792478924799248092481924829248392484924859248692487924889248992490924919249292493924949249592496924979249892499925009250192502925039250492505925069250792508925099251092511925129251392514925159251692517925189251992520925219252292523925249252592526925279252892529925309253192532925339253492535925369253792538925399254092541925429254392544925459254692547925489254992550925519255292553925549255592556925579255892559925609256192562925639256492565925669256792568925699257092571925729257392574925759257692577925789257992580925819258292583925849258592586925879258892589925909259192592925939259492595925969259792598925999260092601926029260392604926059260692607926089260992610926119261292613926149261592616926179261892619926209262192622926239262492625926269262792628926299263092631926329263392634926359263692637926389263992640926419264292643926449264592646926479264892649926509265192652926539265492655926569265792658926599266092661926629266392664926659266692667926689266992670926719267292673926749267592676926779267892679926809268192682926839268492685926869268792688926899269092691926929269392694926959269692697926989269992700927019270292703927049270592706927079270892709927109271192712927139271492715927169271792718927199272092721927229272392724927259272692727927289272992730927319273292733927349273592736927379273892739927409274192742927439274492745927469274792748927499275092751927529275392754927559275692757927589275992760927619276292763927649276592766927679276892769927709277192772927739277492775927769277792778927799278092781927829278392784927859278692787927889278992790927919279292793927949279592796927979279892799928009280192802928039280492805928069280792808928099281092811928129281392814928159281692817928189281992820928219282292823928249282592826928279282892829928309283192832928339283492835928369283792838928399284092841928429284392844928459284692847928489284992850928519285292853928549285592856928579285892859928609286192862928639286492865928669286792868928699287092871928729287392874928759287692877928789287992880928819288292883928849288592886928879288892889928909289192892928939289492895928969289792898928999290092901929029290392904929059290692907929089290992910929119291292913929149291592916929179291892919929209292192922929239292492925929269292792928929299293092931929329293392934929359293692937929389293992940929419294292943929449294592946929479294892949929509295192952929539295492955929569295792958929599296092961929629296392964929659296692967929689296992970929719297292973929749297592976929779297892979929809298192982929839298492985929869298792988929899299092991929929299392994929959299692997929989299993000930019300293003930049300593006930079300893009930109301193012930139301493015930169301793018930199302093021930229302393024930259302693027930289302993030930319303293033930349303593036930379303893039930409304193042930439304493045930469304793048930499305093051930529305393054930559305693057930589305993060930619306293063930649306593066930679306893069930709307193072930739307493075930769307793078930799308093081930829308393084930859308693087930889308993090930919309293093930949309593096930979309893099931009310193102931039310493105931069310793108931099311093111931129311393114931159311693117931189311993120931219312293123931249312593126931279312893129931309313193132931339313493135931369313793138931399314093141931429314393144931459314693147931489314993150931519315293153931549315593156931579315893159931609316193162931639316493165931669316793168931699317093171931729317393174931759317693177931789317993180931819318293183931849318593186931879318893189931909319193192931939319493195931969319793198931999320093201932029320393204932059320693207932089320993210932119321293213932149321593216932179321893219932209322193222932239322493225932269322793228932299323093231932329323393234932359323693237932389323993240932419324293243932449324593246932479324893249932509325193252932539325493255932569325793258932599326093261932629326393264932659326693267932689326993270932719327293273932749327593276932779327893279932809328193282932839328493285932869328793288932899329093291932929329393294932959329693297932989329993300933019330293303933049330593306933079330893309933109331193312933139331493315933169331793318933199332093321933229332393324933259332693327933289332993330933319333293333933349333593336933379333893339933409334193342933439334493345933469334793348933499335093351933529335393354933559335693357933589335993360933619336293363933649336593366933679336893369933709337193372933739337493375933769337793378933799338093381933829338393384933859338693387933889338993390933919339293393933949339593396933979339893399934009340193402934039340493405934069340793408934099341093411934129341393414934159341693417934189341993420934219342293423934249342593426934279342893429934309343193432934339343493435934369343793438934399344093441934429344393444934459344693447934489344993450934519345293453934549345593456934579345893459934609346193462934639346493465934669346793468934699347093471934729347393474934759347693477934789347993480934819348293483934849348593486934879348893489934909349193492934939349493495934969349793498934999350093501935029350393504935059350693507935089350993510935119351293513935149351593516935179351893519935209352193522935239352493525935269352793528935299353093531935329353393534935359353693537935389353993540935419354293543935449354593546935479354893549935509355193552935539355493555935569355793558935599356093561935629356393564935659356693567935689356993570935719357293573935749357593576935779357893579935809358193582935839358493585935869358793588935899359093591935929359393594935959359693597935989359993600936019360293603936049360593606936079360893609936109361193612936139361493615936169361793618936199362093621936229362393624936259362693627936289362993630936319363293633936349363593636936379363893639936409364193642936439364493645936469364793648936499365093651936529365393654936559365693657936589365993660936619366293663936649366593666936679366893669936709367193672936739367493675936769367793678936799368093681936829368393684936859368693687936889368993690936919369293693936949369593696936979369893699937009370193702937039370493705937069370793708937099371093711937129371393714937159371693717937189371993720937219372293723937249372593726937279372893729937309373193732937339373493735937369373793738937399374093741937429374393744937459374693747937489374993750937519375293753937549375593756937579375893759937609376193762937639376493765937669376793768937699377093771937729377393774937759377693777937789377993780937819378293783937849378593786937879378893789937909379193792937939379493795937969379793798937999380093801938029380393804938059380693807938089380993810938119381293813938149381593816938179381893819938209382193822938239382493825938269382793828938299383093831938329383393834938359383693837938389383993840938419384293843938449384593846938479384893849938509385193852938539385493855938569385793858938599386093861938629386393864938659386693867938689386993870938719387293873938749387593876938779387893879938809388193882938839388493885938869388793888938899389093891938929389393894938959389693897938989389993900939019390293903939049390593906939079390893909939109391193912939139391493915939169391793918939199392093921939229392393924939259392693927939289392993930939319393293933939349393593936939379393893939939409394193942939439394493945939469394793948939499395093951939529395393954939559395693957939589395993960939619396293963939649396593966939679396893969939709397193972939739397493975939769397793978939799398093981939829398393984939859398693987939889398993990939919399293993939949399593996939979399893999940009400194002940039400494005940069400794008940099401094011940129401394014940159401694017940189401994020940219402294023940249402594026940279402894029940309403194032940339403494035940369403794038940399404094041940429404394044940459404694047940489404994050940519405294053940549405594056940579405894059940609406194062940639406494065940669406794068940699407094071940729407394074940759407694077940789407994080940819408294083940849408594086940879408894089940909409194092940939409494095940969409794098940999410094101941029410394104941059410694107941089410994110941119411294113941149411594116941179411894119941209412194122941239412494125941269412794128941299413094131941329413394134941359413694137941389413994140941419414294143941449414594146941479414894149941509415194152941539415494155941569415794158941599416094161941629416394164941659416694167941689416994170941719417294173941749417594176941779417894179941809418194182941839418494185941869418794188941899419094191941929419394194941959419694197941989419994200942019420294203942049420594206942079420894209942109421194212942139421494215942169421794218942199422094221942229422394224942259422694227942289422994230942319423294233942349423594236942379423894239942409424194242942439424494245942469424794248942499425094251942529425394254942559425694257942589425994260942619426294263942649426594266942679426894269942709427194272942739427494275942769427794278942799428094281942829428394284942859428694287942889428994290942919429294293942949429594296942979429894299943009430194302943039430494305943069430794308943099431094311943129431394314943159431694317943189431994320943219432294323943249432594326943279432894329943309433194332943339433494335943369433794338943399434094341943429434394344943459434694347943489434994350943519435294353943549435594356943579435894359943609436194362943639436494365943669436794368943699437094371943729437394374943759437694377943789437994380943819438294383943849438594386943879438894389943909439194392943939439494395943969439794398943999440094401944029440394404944059440694407944089440994410944119441294413944149441594416944179441894419944209442194422944239442494425944269442794428944299443094431944329443394434944359443694437944389443994440944419444294443944449444594446944479444894449944509445194452944539445494455944569445794458944599446094461944629446394464944659446694467944689446994470944719447294473944749447594476944779447894479944809448194482944839448494485944869448794488944899449094491944929449394494944959449694497944989449994500945019450294503945049450594506945079450894509945109451194512945139451494515945169451794518945199452094521945229452394524945259452694527945289452994530945319453294533945349453594536945379453894539945409454194542945439454494545945469454794548945499455094551945529455394554945559455694557945589455994560945619456294563945649456594566945679456894569945709457194572945739457494575945769457794578945799458094581945829458394584945859458694587945889458994590945919459294593945949459594596945979459894599946009460194602946039460494605946069460794608946099461094611946129461394614946159461694617946189461994620946219462294623946249462594626946279462894629946309463194632946339463494635946369463794638946399464094641946429464394644946459464694647946489464994650946519465294653946549465594656946579465894659946609466194662946639466494665946669466794668946699467094671946729467394674946759467694677946789467994680946819468294683946849468594686946879468894689946909469194692946939469494695946969469794698946999470094701947029470394704947059470694707947089470994710947119471294713947149471594716947179471894719947209472194722947239472494725947269472794728947299473094731947329473394734947359473694737947389473994740947419474294743947449474594746947479474894749947509475194752947539475494755947569475794758947599476094761947629476394764947659476694767947689476994770947719477294773947749477594776947779477894779947809478194782947839478494785947869478794788947899479094791947929479394794947959479694797947989479994800948019480294803948049480594806948079480894809948109481194812948139481494815948169481794818948199482094821948229482394824948259482694827948289482994830948319483294833948349483594836948379483894839948409484194842948439484494845948469484794848948499485094851948529485394854948559485694857948589485994860948619486294863948649486594866948679486894869948709487194872948739487494875948769487794878948799488094881948829488394884948859488694887948889488994890948919489294893948949489594896948979489894899949009490194902949039490494905949069490794908949099491094911949129491394914949159491694917949189491994920949219492294923949249492594926949279492894929949309493194932949339493494935949369493794938949399494094941949429494394944949459494694947949489494994950949519495294953949549495594956949579495894959949609496194962949639496494965949669496794968949699497094971949729497394974949759497694977949789497994980949819498294983949849498594986949879498894989949909499194992949939499494995949969499794998949999500095001950029500395004950059500695007950089500995010950119501295013950149501595016950179501895019950209502195022950239502495025950269502795028950299503095031950329503395034950359503695037950389503995040950419504295043950449504595046950479504895049950509505195052950539505495055950569505795058950599506095061950629506395064950659506695067950689506995070950719507295073950749507595076950779507895079950809508195082950839508495085950869508795088950899509095091950929509395094950959509695097950989509995100951019510295103951049510595106951079510895109951109511195112951139511495115951169511795118951199512095121951229512395124951259512695127951289512995130951319513295133951349513595136951379513895139951409514195142951439514495145951469514795148951499515095151951529515395154951559515695157951589515995160951619516295163951649516595166951679516895169951709517195172951739517495175951769517795178951799518095181951829518395184951859518695187951889518995190951919519295193951949519595196951979519895199952009520195202952039520495205952069520795208952099521095211952129521395214952159521695217952189521995220952219522295223952249522595226952279522895229952309523195232952339523495235952369523795238952399524095241952429524395244952459524695247952489524995250952519525295253952549525595256952579525895259952609526195262952639526495265952669526795268952699527095271952729527395274952759527695277952789527995280952819528295283952849528595286952879528895289952909529195292952939529495295952969529795298952999530095301953029530395304953059530695307953089530995310953119531295313953149531595316953179531895319953209532195322953239532495325953269532795328953299533095331953329533395334953359533695337953389533995340953419534295343953449534595346953479534895349953509535195352953539535495355953569535795358953599536095361953629536395364953659536695367953689536995370953719537295373953749537595376953779537895379953809538195382953839538495385953869538795388953899539095391953929539395394953959539695397953989539995400954019540295403954049540595406954079540895409954109541195412954139541495415954169541795418954199542095421954229542395424954259542695427954289542995430954319543295433954349543595436954379543895439954409544195442954439544495445954469544795448954499545095451954529545395454954559545695457954589545995460954619546295463954649546595466954679546895469954709547195472954739547495475954769547795478954799548095481954829548395484954859548695487954889548995490954919549295493954949549595496954979549895499955009550195502955039550495505955069550795508955099551095511955129551395514955159551695517955189551995520955219552295523955249552595526955279552895529955309553195532955339553495535955369553795538955399554095541955429554395544955459554695547955489554995550955519555295553955549555595556955579555895559955609556195562955639556495565955669556795568955699557095571955729557395574955759557695577955789557995580955819558295583955849558595586955879558895589955909559195592955939559495595955969559795598955999560095601956029560395604956059560695607956089560995610956119561295613956149561595616956179561895619956209562195622956239562495625956269562795628956299563095631956329563395634956359563695637956389563995640956419564295643956449564595646956479564895649956509565195652956539565495655956569565795658956599566095661956629566395664956659566695667956689566995670956719567295673956749567595676956779567895679956809568195682956839568495685956869568795688956899569095691956929569395694956959569695697956989569995700957019570295703957049570595706957079570895709957109571195712957139571495715957169571795718957199572095721957229572395724957259572695727957289572995730957319573295733957349573595736957379573895739957409574195742957439574495745957469574795748957499575095751957529575395754957559575695757957589575995760957619576295763957649576595766957679576895769957709577195772957739577495775957769577795778957799578095781957829578395784957859578695787957889578995790957919579295793957949579595796957979579895799958009580195802958039580495805958069580795808958099581095811958129581395814958159581695817958189581995820958219582295823958249582595826958279582895829958309583195832958339583495835958369583795838958399584095841958429584395844958459584695847958489584995850958519585295853958549585595856958579585895859958609586195862958639586495865958669586795868958699587095871958729587395874958759587695877958789587995880958819588295883958849588595886958879588895889958909589195892958939589495895958969589795898958999590095901959029590395904959059590695907959089590995910959119591295913959149591595916959179591895919959209592195922959239592495925959269592795928959299593095931959329593395934959359593695937959389593995940959419594295943959449594595946959479594895949959509595195952959539595495955959569595795958959599596095961959629596395964959659596695967959689596995970959719597295973959749597595976959779597895979959809598195982959839598495985959869598795988959899599095991959929599395994959959599695997959989599996000960019600296003960049600596006960079600896009960109601196012960139601496015960169601796018960199602096021960229602396024960259602696027960289602996030960319603296033960349603596036960379603896039960409604196042960439604496045960469604796048960499605096051960529605396054960559605696057960589605996060960619606296063960649606596066960679606896069960709607196072960739607496075960769607796078960799608096081960829608396084960859608696087960889608996090960919609296093960949609596096960979609896099961009610196102961039610496105961069610796108961099611096111961129611396114961159611696117961189611996120961219612296123961249612596126961279612896129961309613196132961339613496135961369613796138961399614096141961429614396144961459614696147961489614996150961519615296153961549615596156961579615896159961609616196162961639616496165961669616796168961699617096171961729617396174961759617696177961789617996180961819618296183961849618596186961879618896189961909619196192961939619496195961969619796198961999620096201962029620396204962059620696207962089620996210962119621296213962149621596216962179621896219962209622196222962239622496225962269622796228962299623096231962329623396234962359623696237962389623996240962419624296243962449624596246962479624896249962509625196252962539625496255962569625796258962599626096261962629626396264962659626696267962689626996270962719627296273962749627596276962779627896279962809628196282962839628496285962869628796288962899629096291962929629396294962959629696297962989629996300963019630296303963049630596306963079630896309963109631196312963139631496315963169631796318963199632096321963229632396324963259632696327963289632996330963319633296333963349633596336963379633896339963409634196342963439634496345963469634796348963499635096351963529635396354963559635696357963589635996360963619636296363963649636596366963679636896369963709637196372963739637496375963769637796378963799638096381963829638396384963859638696387963889638996390963919639296393963949639596396963979639896399964009640196402964039640496405964069640796408964099641096411964129641396414964159641696417964189641996420964219642296423964249642596426964279642896429964309643196432964339643496435964369643796438964399644096441964429644396444964459644696447964489644996450964519645296453964549645596456964579645896459964609646196462964639646496465964669646796468964699647096471964729647396474964759647696477964789647996480964819648296483964849648596486964879648896489964909649196492964939649496495964969649796498964999650096501965029650396504965059650696507965089650996510965119651296513965149651596516965179651896519965209652196522965239652496525965269652796528965299653096531965329653396534965359653696537965389653996540965419654296543965449654596546965479654896549965509655196552965539655496555965569655796558965599656096561965629656396564965659656696567965689656996570965719657296573965749657596576965779657896579965809658196582965839658496585965869658796588965899659096591965929659396594965959659696597965989659996600966019660296603966049660596606966079660896609966109661196612966139661496615966169661796618966199662096621966229662396624966259662696627966289662996630966319663296633966349663596636966379663896639966409664196642966439664496645966469664796648966499665096651966529665396654966559665696657966589665996660966619666296663966649666596666966679666896669966709667196672966739667496675966769667796678966799668096681966829668396684966859668696687966889668996690966919669296693966949669596696966979669896699967009670196702967039670496705967069670796708967099671096711967129671396714967159671696717967189671996720967219672296723967249672596726967279672896729967309673196732967339673496735967369673796738967399674096741967429674396744967459674696747967489674996750967519675296753967549675596756967579675896759967609676196762967639676496765967669676796768967699677096771967729677396774967759677696777967789677996780967819678296783967849678596786967879678896789967909679196792967939679496795967969679796798967999680096801968029680396804968059680696807968089680996810968119681296813968149681596816968179681896819968209682196822968239682496825968269682796828968299683096831968329683396834968359683696837968389683996840968419684296843968449684596846968479684896849968509685196852968539685496855968569685796858968599686096861968629686396864968659686696867968689686996870968719687296873968749687596876968779687896879968809688196882968839688496885968869688796888968899689096891968929689396894968959689696897968989689996900969019690296903969049690596906969079690896909969109691196912969139691496915969169691796918969199692096921969229692396924969259692696927969289692996930969319693296933969349693596936969379693896939969409694196942969439694496945969469694796948969499695096951969529695396954969559695696957969589695996960969619696296963969649696596966969679696896969969709697196972969739697496975969769697796978969799698096981969829698396984969859698696987969889698996990969919699296993969949699596996969979699896999970009700197002970039700497005970069700797008970099701097011970129701397014970159701697017970189701997020970219702297023970249702597026970279702897029970309703197032970339703497035970369703797038970399704097041970429704397044970459704697047970489704997050970519705297053970549705597056970579705897059970609706197062970639706497065970669706797068970699707097071970729707397074970759707697077970789707997080970819708297083970849708597086970879708897089970909709197092970939709497095970969709797098970999710097101971029710397104971059710697107971089710997110971119711297113971149711597116971179711897119971209712197122971239712497125971269712797128971299713097131971329713397134971359713697137971389713997140971419714297143971449714597146971479714897149971509715197152971539715497155971569715797158971599716097161971629716397164971659716697167971689716997170971719717297173971749717597176971779717897179971809718197182971839718497185971869718797188971899719097191971929719397194971959719697197971989719997200972019720297203972049720597206972079720897209972109721197212972139721497215972169721797218972199722097221972229722397224972259722697227972289722997230972319723297233972349723597236972379723897239972409724197242972439724497245972469724797248972499725097251972529725397254972559725697257972589725997260972619726297263972649726597266972679726897269972709727197272972739727497275972769727797278972799728097281972829728397284972859728697287972889728997290972919729297293972949729597296972979729897299973009730197302973039730497305973069730797308973099731097311973129731397314973159731697317973189731997320973219732297323973249732597326973279732897329973309733197332973339733497335973369733797338973399734097341973429734397344973459734697347973489734997350973519735297353973549735597356973579735897359973609736197362973639736497365973669736797368973699737097371973729737397374973759737697377973789737997380973819738297383973849738597386973879738897389973909739197392973939739497395973969739797398973999740097401974029740397404974059740697407974089740997410974119741297413974149741597416974179741897419974209742197422974239742497425974269742797428974299743097431974329743397434974359743697437974389743997440974419744297443974449744597446974479744897449974509745197452974539745497455974569745797458974599746097461974629746397464974659746697467974689746997470974719747297473974749747597476974779747897479974809748197482974839748497485974869748797488974899749097491974929749397494974959749697497974989749997500975019750297503975049750597506975079750897509975109751197512975139751497515975169751797518975199752097521975229752397524975259752697527975289752997530975319753297533975349753597536975379753897539975409754197542975439754497545975469754797548975499755097551975529755397554975559755697557975589755997560975619756297563975649756597566975679756897569975709757197572975739757497575975769757797578975799758097581975829758397584975859758697587975889758997590975919759297593975949759597596975979759897599976009760197602976039760497605976069760797608976099761097611976129761397614976159761697617976189761997620976219762297623976249762597626976279762897629976309763197632976339763497635976369763797638976399764097641976429764397644976459764697647976489764997650976519765297653976549765597656976579765897659976609766197662976639766497665976669766797668976699767097671976729767397674976759767697677976789767997680976819768297683976849768597686976879768897689976909769197692976939769497695976969769797698976999770097701977029770397704977059770697707977089770997710977119771297713977149771597716977179771897719977209772197722977239772497725977269772797728977299773097731977329773397734977359773697737977389773997740977419774297743977449774597746977479774897749977509775197752977539775497755977569775797758977599776097761977629776397764977659776697767977689776997770977719777297773977749777597776977779777897779977809778197782977839778497785977869778797788977899779097791977929779397794977959779697797977989779997800978019780297803978049780597806978079780897809978109781197812978139781497815978169781797818978199782097821978229782397824978259782697827978289782997830978319783297833978349783597836978379783897839978409784197842978439784497845978469784797848978499785097851978529785397854978559785697857978589785997860978619786297863978649786597866978679786897869978709787197872978739787497875978769787797878978799788097881978829788397884978859788697887978889788997890978919789297893978949789597896978979789897899979009790197902979039790497905979069790797908979099791097911979129791397914979159791697917979189791997920979219792297923979249792597926979279792897929979309793197932979339793497935979369793797938979399794097941979429794397944979459794697947979489794997950979519795297953979549795597956979579795897959979609796197962979639796497965979669796797968979699797097971979729797397974979759797697977979789797997980979819798297983979849798597986979879798897989979909799197992979939799497995979969799797998979999800098001980029800398004980059800698007980089800998010980119801298013980149801598016980179801898019980209802198022980239802498025980269802798028980299803098031980329803398034980359803698037980389803998040980419804298043980449804598046980479804898049980509805198052980539805498055980569805798058980599806098061980629806398064980659806698067980689806998070980719807298073980749807598076980779807898079980809808198082980839808498085980869808798088980899809098091980929809398094980959809698097980989809998100981019810298103981049810598106981079810898109981109811198112981139811498115981169811798118981199812098121981229812398124981259812698127981289812998130981319813298133981349813598136981379813898139981409814198142981439814498145981469814798148981499815098151981529815398154981559815698157981589815998160981619816298163981649816598166981679816898169981709817198172981739817498175981769817798178981799818098181981829818398184981859818698187981889818998190981919819298193981949819598196981979819898199982009820198202982039820498205982069820798208982099821098211982129821398214982159821698217982189821998220982219822298223982249822598226982279822898229982309823198232982339823498235982369823798238982399824098241982429824398244982459824698247982489824998250982519825298253982549825598256982579825898259982609826198262982639826498265982669826798268982699827098271982729827398274982759827698277982789827998280982819828298283982849828598286982879828898289982909829198292982939829498295982969829798298982999830098301983029830398304983059830698307983089830998310983119831298313983149831598316983179831898319983209832198322983239832498325983269832798328983299833098331983329833398334983359833698337983389833998340983419834298343983449834598346983479834898349983509835198352983539835498355983569835798358983599836098361983629836398364983659836698367983689836998370983719837298373983749837598376983779837898379983809838198382983839838498385983869838798388983899839098391983929839398394983959839698397983989839998400984019840298403984049840598406984079840898409984109841198412984139841498415984169841798418984199842098421984229842398424984259842698427984289842998430984319843298433984349843598436984379843898439984409844198442984439844498445984469844798448984499845098451984529845398454984559845698457984589845998460984619846298463984649846598466984679846898469984709847198472984739847498475984769847798478984799848098481984829848398484984859848698487984889848998490984919849298493984949849598496984979849898499985009850198502985039850498505985069850798508985099851098511985129851398514985159851698517985189851998520985219852298523985249852598526985279852898529985309853198532985339853498535985369853798538985399854098541985429854398544985459854698547985489854998550985519855298553985549855598556985579855898559985609856198562985639856498565985669856798568985699857098571985729857398574985759857698577985789857998580985819858298583985849858598586985879858898589985909859198592985939859498595985969859798598985999860098601986029860398604986059860698607986089860998610986119861298613986149861598616986179861898619986209862198622986239862498625986269862798628986299863098631986329863398634986359863698637986389863998640986419864298643986449864598646986479864898649986509865198652986539865498655986569865798658986599866098661986629866398664986659866698667986689866998670986719867298673986749867598676986779867898679986809868198682986839868498685986869868798688986899869098691986929869398694986959869698697986989869998700987019870298703987049870598706987079870898709987109871198712987139871498715987169871798718987199872098721987229872398724987259872698727987289872998730987319873298733987349873598736987379873898739987409874198742987439874498745987469874798748987499875098751987529875398754987559875698757987589875998760987619876298763987649876598766987679876898769987709877198772987739877498775987769877798778987799878098781987829878398784987859878698787987889878998790987919879298793987949879598796987979879898799988009880198802988039880498805988069880798808988099881098811988129881398814988159881698817988189881998820988219882298823988249882598826988279882898829988309883198832988339883498835988369883798838988399884098841988429884398844988459884698847988489884998850988519885298853988549885598856988579885898859988609886198862988639886498865988669886798868988699887098871988729887398874988759887698877988789887998880988819888298883988849888598886988879888898889988909889198892988939889498895988969889798898988999890098901989029890398904989059890698907989089890998910989119891298913989149891598916989179891898919989209892198922989239892498925989269892798928989299893098931989329893398934989359893698937989389893998940989419894298943989449894598946989479894898949989509895198952989539895498955989569895798958989599896098961989629896398964989659896698967989689896998970989719897298973989749897598976989779897898979989809898198982989839898498985989869898798988989899899098991989929899398994989959899698997989989899999000990019900299003990049900599006990079900899009990109901199012990139901499015990169901799018990199902099021990229902399024990259902699027990289902999030990319903299033990349903599036990379903899039990409904199042990439904499045990469904799048990499905099051990529905399054990559905699057990589905999060990619906299063990649906599066990679906899069990709907199072990739907499075990769907799078990799908099081990829908399084990859908699087990889908999090990919909299093990949909599096990979909899099991009910199102991039910499105991069910799108991099911099111991129911399114991159911699117991189911999120991219912299123991249912599126991279912899129991309913199132991339913499135991369913799138991399914099141991429914399144991459914699147991489914999150991519915299153991549915599156991579915899159991609916199162991639916499165991669916799168991699917099171991729917399174991759917699177991789917999180991819918299183991849918599186991879918899189991909919199192991939919499195991969919799198991999920099201992029920399204992059920699207992089920999210992119921299213992149921599216992179921899219992209922199222992239922499225992269922799228992299923099231992329923399234992359923699237992389923999240992419924299243992449924599246992479924899249992509925199252992539925499255992569925799258992599926099261992629926399264992659926699267992689926999270992719927299273992749927599276992779927899279992809928199282992839928499285992869928799288992899929099291992929929399294992959929699297992989929999300993019930299303993049930599306993079930899309993109931199312993139931499315993169931799318993199932099321993229932399324993259932699327993289932999330993319933299333993349933599336993379933899339993409934199342993439934499345993469934799348993499935099351993529935399354993559935699357993589935999360993619936299363993649936599366993679936899369993709937199372993739937499375993769937799378993799938099381993829938399384993859938699387993889938999390993919939299393993949939599396993979939899399994009940199402994039940499405994069940799408994099941099411994129941399414994159941699417994189941999420994219942299423994249942599426994279942899429994309943199432994339943499435994369943799438994399944099441994429944399444994459944699447994489944999450994519945299453994549945599456994579945899459994609946199462994639946499465994669946799468994699947099471994729947399474994759947699477994789947999480994819948299483994849948599486994879948899489994909949199492994939949499495994969949799498994999950099501995029950399504995059950699507995089950999510995119951299513995149951599516995179951899519995209952199522995239952499525995269952799528995299953099531995329953399534995359953699537995389953999540995419954299543995449954599546995479954899549995509955199552995539955499555995569955799558995599956099561995629956399564995659956699567995689956999570995719957299573995749957599576995779957899579995809958199582995839958499585995869958799588995899959099591995929959399594995959959699597995989959999600996019960299603996049960599606996079960899609996109961199612996139961499615996169961799618996199962099621996229962399624996259962699627996289962999630996319963299633996349963599636996379963899639996409964199642996439964499645996469964799648996499965099651996529965399654996559965699657996589965999660996619966299663996649966599666996679966899669996709967199672996739967499675996769967799678996799968099681996829968399684996859968699687996889968999690996919969299693996949969599696996979969899699997009970199702997039970499705997069970799708997099971099711997129971399714997159971699717997189971999720997219972299723997249972599726997279972899729997309973199732997339973499735997369973799738997399974099741997429974399744997459974699747997489974999750997519975299753997549975599756997579975899759997609976199762997639976499765997669976799768997699977099771997729977399774997759977699777997789977999780997819978299783997849978599786997879978899789997909979199792997939979499795997969979799798997999980099801998029980399804998059980699807998089980999810998119981299813998149981599816998179981899819998209982199822998239982499825998269982799828998299983099831998329983399834998359983699837998389983999840998419984299843998449984599846998479984899849998509985199852998539985499855998569985799858998599986099861998629986399864998659986699867998689986999870998719987299873998749987599876998779987899879998809988199882998839988499885998869988799888998899989099891998929989399894998959989699897998989989999900999019990299903999049990599906999079990899909999109991199912999139991499915999169991799918999199992099921999229992399924999259992699927999289992999930999319993299933999349993599936999379993899939999409994199942999439994499945999469994799948999499995099951999529995399954999559995699957999589995999960999619996299963999649996599966999679996899969999709997199972999739997499975999769997799978999799998099981999829998399984999859998699987999889998999990999919999299993999949999599996999979999899999100000100001100002100003100004100005100006100007100008100009100010100011100012100013100014100015100016100017100018100019100020100021100022100023100024100025100026100027100028100029100030100031100032100033100034100035100036100037100038100039100040100041100042100043100044100045100046100047100048100049100050100051100052100053100054100055100056100057100058100059100060100061100062100063100064100065100066100067100068100069100070100071100072100073100074100075100076100077100078100079100080100081100082100083100084100085100086100087100088100089100090100091100092100093100094100095100096100097100098100099100100100101100102100103100104100105100106100107100108100109100110100111100112100113100114100115100116100117100118100119100120100121100122100123100124100125100126100127100128100129100130100131100132100133100134100135100136100137100138100139100140100141100142100143100144100145100146100147100148100149100150100151100152100153100154100155100156100157100158100159100160100161100162100163100164100165100166100167100168100169100170100171100172100173100174100175100176100177100178100179100180100181100182100183100184100185100186100187100188100189100190100191100192100193100194100195100196100197100198100199100200100201100202100203100204100205100206100207100208100209100210100211100212100213100214100215100216100217100218100219100220100221100222100223100224100225100226100227100228100229100230100231100232100233100234100235100236100237100238100239100240100241100242100243100244100245100246100247100248100249100250100251100252100253100254100255100256100257100258100259100260100261100262100263100264100265100266100267100268100269100270100271100272100273100274100275100276100277100278100279100280100281100282100283100284100285100286100287100288100289100290100291100292100293100294100295100296100297100298100299100300100301100302100303100304100305100306100307100308100309100310100311100312100313100314100315100316100317100318100319100320100321100322100323100324100325100326100327100328100329100330100331100332100333100334100335100336100337100338100339100340100341100342100343100344100345100346100347100348100349100350100351100352100353100354100355100356100357100358100359100360100361100362100363100364100365100366100367100368100369100370100371100372100373100374100375100376100377100378100379100380100381100382100383100384100385100386100387100388100389100390100391100392100393100394100395100396100397100398100399100400100401100402100403100404100405100406100407100408100409100410100411100412100413100414100415100416100417100418100419100420100421100422100423100424100425100426100427100428100429100430100431100432100433100434100435100436100437100438100439100440100441100442100443100444100445100446100447100448100449100450100451100452100453100454100455100456100457100458100459100460100461100462100463100464100465100466100467100468100469100470100471100472100473100474100475100476100477100478100479100480100481100482100483100484100485100486100487100488100489100490100491100492100493100494100495100496100497100498100499100500100501100502100503100504100505100506100507100508100509100510100511100512100513100514100515100516100517100518100519100520100521100522100523100524100525100526100527100528100529100530100531100532100533100534100535100536100537100538100539100540100541100542100543100544100545100546100547100548100549100550100551100552100553100554100555100556100557100558100559100560100561100562100563100564100565100566100567100568100569100570100571100572100573100574100575100576100577100578100579100580100581100582100583100584100585100586100587100588100589100590100591100592100593100594100595100596100597100598100599100600100601100602100603100604100605100606100607100608100609100610100611100612100613100614100615100616100617100618100619100620100621100622100623100624100625100626100627100628100629100630100631100632100633100634100635100636100637100638100639100640100641100642100643100644100645100646100647100648100649100650100651100652100653100654100655100656100657100658100659100660100661100662100663100664100665100666100667100668100669100670100671100672100673100674100675100676100677100678100679100680100681100682100683100684100685100686100687100688100689100690100691100692100693100694100695100696100697100698100699100700100701100702100703100704100705100706100707100708100709100710100711100712100713100714100715100716100717100718100719100720100721100722100723100724100725100726100727100728100729100730100731100732100733100734100735100736100737100738100739100740100741100742100743100744100745100746100747100748100749100750100751100752100753100754100755100756100757100758100759100760100761100762100763100764100765100766100767100768100769100770100771100772100773100774100775100776100777100778100779100780100781100782100783100784100785100786100787100788100789100790100791100792100793100794100795100796100797100798100799100800100801100802100803100804100805100806100807100808100809100810100811100812100813100814100815100816100817100818100819100820100821100822100823100824100825100826100827100828100829100830100831100832100833100834100835100836100837100838100839100840100841100842100843100844100845100846100847100848100849100850100851100852100853100854100855100856100857100858100859100860100861100862100863100864100865100866100867100868100869100870100871100872100873100874100875100876100877100878100879100880100881100882100883100884100885100886100887100888100889100890100891100892100893100894100895100896100897100898100899100900100901100902100903100904100905100906100907100908100909100910100911100912100913100914100915100916100917100918100919100920100921100922100923100924100925100926100927100928100929100930100931100932100933100934100935100936100937100938100939100940100941100942100943100944100945100946100947100948100949100950100951100952100953100954100955100956100957100958100959100960100961100962100963100964100965100966100967100968100969100970100971100972100973100974100975100976100977100978100979100980100981100982100983100984100985100986100987100988100989100990100991100992100993100994100995100996100997100998100999101000101001101002101003101004101005101006101007101008101009101010101011101012101013101014101015101016101017101018101019101020101021101022101023101024101025101026101027101028101029101030101031101032101033101034101035101036101037101038101039101040101041101042101043101044101045101046101047101048101049101050101051101052101053101054101055101056101057101058101059101060101061101062101063101064101065101066101067101068101069101070101071101072101073101074101075101076101077101078101079101080101081101082101083101084101085101086101087101088101089101090101091101092101093101094101095101096101097101098101099101100101101101102101103101104101105101106101107101108101109101110101111101112101113101114101115101116101117101118101119101120101121101122101123101124101125101126101127101128101129101130101131101132101133101134101135101136101137101138101139101140101141101142101143101144101145101146101147101148101149101150101151101152101153101154101155101156101157101158101159101160101161101162101163101164101165101166101167101168101169101170101171101172101173101174101175101176101177101178101179101180101181101182101183101184101185101186101187101188101189101190101191101192101193101194101195101196101197101198101199101200101201101202101203101204101205101206101207101208101209101210101211101212101213101214101215101216101217101218101219101220101221101222101223101224101225101226101227101228101229101230101231101232101233101234101235101236101237101238101239101240101241101242101243101244101245101246101247101248101249101250101251101252101253101254101255101256101257101258101259101260101261101262101263101264101265101266101267101268101269101270101271101272101273101274101275101276101277101278101279101280101281101282101283101284101285101286101287101288101289101290101291101292101293101294101295101296101297101298101299101300101301101302101303101304101305101306101307101308101309101310101311101312101313101314101315101316101317101318101319101320101321101322101323101324101325101326101327101328101329101330101331101332101333101334101335101336101337101338101339101340101341101342101343101344101345101346101347101348101349101350101351101352101353101354101355101356101357101358101359101360101361101362101363101364101365101366101367101368101369101370101371101372101373101374101375101376101377101378101379101380101381101382101383101384101385101386101387101388101389101390101391101392101393101394101395101396101397101398101399101400101401101402101403101404101405101406101407101408101409101410101411101412101413101414101415101416101417101418101419101420101421101422101423101424101425101426101427101428101429101430101431101432101433101434101435101436101437101438101439101440101441101442101443101444101445101446101447101448101449101450101451101452101453101454101455101456101457101458101459101460101461101462101463101464101465101466101467101468101469101470101471101472101473101474101475101476101477101478101479101480101481101482101483101484101485101486101487101488101489101490101491101492101493101494101495101496101497101498101499101500101501101502101503101504101505101506101507101508101509101510101511101512101513101514101515101516101517101518101519101520101521101522101523101524101525101526101527101528101529101530101531101532101533101534101535101536101537101538101539101540101541101542101543101544101545101546101547101548101549101550101551101552101553101554101555101556101557101558101559101560101561101562101563101564101565101566101567101568101569101570101571101572101573101574101575101576101577101578101579101580101581101582101583101584101585101586101587101588101589101590101591101592101593101594101595101596101597101598101599101600101601101602101603101604101605101606101607101608101609101610101611101612101613101614101615101616101617101618101619101620101621101622101623101624101625101626101627101628101629101630101631101632101633101634101635101636101637101638101639101640101641101642101643101644101645101646101647101648101649101650101651101652101653101654101655101656101657101658101659101660101661101662101663101664101665101666101667101668101669101670101671101672101673101674101675101676101677101678101679101680101681101682101683101684101685101686101687101688101689101690101691101692101693101694101695101696101697101698101699101700101701101702101703101704101705101706101707101708101709101710101711101712101713101714101715101716101717101718101719101720101721101722101723101724101725101726101727101728101729101730101731101732101733101734101735101736101737101738101739101740101741101742101743101744101745101746101747101748101749101750101751101752101753101754101755101756101757101758101759101760101761101762101763101764101765101766101767101768101769101770101771101772101773101774101775101776101777101778101779101780101781101782101783101784101785101786101787101788101789101790101791101792101793101794101795101796101797101798101799101800101801101802101803101804101805101806101807101808101809101810101811101812101813101814101815101816101817101818101819101820101821101822101823101824101825101826101827101828101829101830101831101832101833101834101835101836101837101838101839101840101841101842101843101844101845101846101847101848101849101850101851101852101853101854101855101856101857101858101859101860101861101862101863101864101865101866101867101868101869101870101871101872101873101874101875101876101877101878101879101880101881101882101883101884101885101886101887101888101889101890101891101892101893101894101895101896101897101898101899101900101901101902101903101904101905101906101907101908101909101910101911101912101913101914101915101916101917101918101919101920101921101922101923101924101925101926101927101928101929101930101931101932101933101934101935101936101937101938101939101940101941101942101943101944101945101946101947101948101949101950101951101952101953101954101955101956101957101958101959101960101961101962101963101964101965101966101967101968101969101970101971101972101973101974101975101976101977101978101979101980101981101982101983101984101985101986101987101988101989101990101991101992101993101994101995101996101997101998101999102000102001102002102003102004102005102006102007102008102009102010102011102012102013102014102015102016102017102018102019102020102021102022102023102024102025102026102027102028102029102030102031102032102033102034102035102036102037102038102039102040102041102042102043102044102045102046102047102048102049102050102051102052102053102054102055102056102057102058102059102060102061102062102063102064102065102066102067102068102069102070102071102072102073102074102075102076102077102078102079102080102081102082102083102084102085102086102087102088102089102090102091102092102093102094102095102096102097102098102099102100102101102102102103102104102105102106102107102108102109102110102111102112102113102114102115102116102117102118102119102120102121102122102123102124102125102126102127102128102129102130102131102132102133102134102135102136102137102138102139102140102141102142102143102144102145102146102147102148102149102150102151102152102153102154102155102156102157102158102159102160102161102162102163102164102165102166102167102168102169102170102171102172102173102174102175102176102177102178102179102180102181102182102183102184102185102186102187102188102189102190102191102192102193102194102195102196102197102198102199102200102201102202102203102204102205102206102207102208102209102210102211102212102213102214102215102216102217102218102219102220102221102222102223102224102225102226102227102228102229102230102231102232102233102234102235102236102237102238102239102240102241102242102243102244102245102246102247102248102249102250102251102252102253102254102255102256102257102258102259102260102261102262102263102264102265102266102267102268102269102270102271102272102273102274102275102276102277102278102279102280102281102282102283102284102285102286102287102288102289102290102291102292102293102294102295102296102297102298102299102300102301102302102303102304102305102306102307102308102309102310102311102312102313102314102315102316102317102318102319102320102321102322102323102324102325102326102327102328102329102330102331102332102333102334102335102336102337102338102339102340102341102342102343102344102345102346102347102348102349102350102351102352102353102354102355102356102357102358102359102360102361102362102363102364102365102366102367102368102369102370102371102372102373102374102375102376102377102378102379102380102381102382102383102384102385102386102387102388102389102390102391102392102393102394102395102396102397102398102399102400102401102402102403102404102405102406102407102408102409102410102411102412102413102414102415102416102417102418102419102420102421102422102423102424102425102426102427102428102429102430102431102432102433102434102435102436102437102438102439102440102441102442102443102444102445102446102447102448102449102450102451102452102453102454102455102456102457102458102459102460102461102462102463102464102465102466102467102468102469102470102471102472102473102474102475102476102477102478102479102480102481102482102483102484102485102486102487102488102489102490102491102492102493102494102495102496102497102498102499102500102501102502102503102504102505102506102507102508102509102510102511102512102513102514102515102516102517102518102519102520102521102522102523102524102525102526102527102528102529102530102531102532102533102534102535102536102537102538102539102540102541102542102543102544102545102546102547102548102549102550102551102552102553102554102555102556102557102558102559102560102561102562102563102564102565102566102567102568102569102570102571102572102573102574102575102576102577102578102579102580102581102582102583102584102585102586102587102588102589102590102591102592102593102594102595102596102597102598102599102600102601102602102603102604102605102606102607102608102609102610102611102612102613102614102615102616102617102618102619102620102621102622102623102624102625102626102627102628102629102630102631102632102633102634102635102636102637102638102639102640102641102642102643102644102645102646102647102648102649102650102651102652102653102654102655102656102657102658102659102660102661102662102663102664102665102666102667102668102669102670102671102672102673102674102675102676102677102678102679102680102681102682102683102684102685102686102687102688102689102690102691102692102693102694102695102696102697102698102699102700102701102702102703102704102705102706102707102708102709102710102711102712102713102714102715102716102717102718102719102720102721102722102723102724102725102726102727102728102729102730102731102732102733102734102735102736102737102738102739102740102741102742102743102744102745102746102747102748102749102750102751102752102753102754102755102756102757102758102759102760102761102762102763102764102765102766102767102768102769102770102771102772102773102774102775102776102777102778102779102780102781102782102783102784102785102786102787102788102789102790102791102792102793102794102795102796102797102798102799102800102801102802102803102804102805102806102807102808102809102810102811102812102813102814102815102816102817102818102819102820102821102822102823102824102825102826102827102828102829102830102831102832102833102834102835102836102837102838102839102840102841102842102843102844102845102846102847102848102849102850102851102852102853102854102855102856102857102858102859102860102861102862102863102864102865102866102867102868102869102870102871102872102873102874102875102876102877102878102879102880102881102882102883102884102885102886102887102888102889102890102891102892102893102894102895102896102897102898102899102900102901102902102903102904102905102906102907102908102909102910102911102912102913102914102915102916102917102918102919102920102921102922102923102924102925102926102927102928102929102930102931102932102933102934102935102936102937102938102939102940102941102942102943102944102945102946102947102948102949102950102951102952102953102954102955102956102957102958102959102960102961102962102963102964102965102966102967102968102969102970102971102972102973102974102975102976102977102978102979102980102981102982102983102984102985102986102987102988102989102990102991102992102993102994102995102996102997102998102999103000103001103002103003103004103005103006103007103008103009103010103011103012103013103014103015103016103017103018103019103020103021103022103023103024103025103026103027103028103029103030103031103032103033103034103035103036103037103038103039103040103041103042103043103044103045103046103047103048103049103050103051103052103053103054103055103056103057103058103059103060103061103062103063103064103065103066103067103068103069103070103071103072103073103074103075103076103077103078103079103080103081103082103083103084103085103086103087103088103089103090103091103092103093103094103095103096103097103098103099103100103101103102103103103104103105103106103107103108103109103110103111103112103113103114103115103116103117103118103119103120103121103122103123103124103125103126103127103128103129103130103131103132103133103134103135103136103137103138103139103140103141103142103143103144103145103146103147103148103149103150103151103152103153103154103155103156103157103158103159103160103161103162103163103164103165103166103167103168103169103170103171103172103173103174103175103176103177103178103179103180103181103182103183103184103185103186103187103188103189103190103191103192103193103194103195103196103197103198103199103200103201103202103203103204103205103206103207103208103209103210103211103212103213103214103215103216103217103218103219103220103221103222103223103224103225103226103227103228103229103230103231103232103233103234103235103236103237103238103239103240103241103242103243103244103245103246103247103248103249103250103251103252103253103254103255103256103257103258103259103260103261103262103263103264103265103266103267103268103269103270103271103272103273103274103275103276103277103278103279103280103281103282103283103284103285103286103287103288103289103290103291103292103293103294103295103296103297103298103299103300103301103302103303103304103305103306103307103308103309103310103311103312103313103314103315103316103317103318103319103320103321103322103323103324103325103326103327103328103329103330103331103332103333103334103335103336103337103338103339103340103341103342103343103344103345103346103347103348103349103350103351103352103353103354103355103356103357103358103359103360103361103362103363103364103365103366103367103368103369103370103371103372103373103374103375103376103377103378103379103380103381103382103383103384103385103386103387103388103389103390103391103392103393103394103395103396103397103398103399103400103401103402103403103404103405103406103407103408103409103410103411103412103413103414103415103416103417103418103419103420103421103422103423103424103425103426103427103428103429103430103431103432103433103434103435103436103437103438103439103440103441103442103443103444103445103446103447103448103449103450103451103452103453103454103455103456103457103458103459103460103461103462103463103464103465103466103467103468103469103470103471103472103473103474103475103476103477103478103479103480103481103482103483103484103485103486103487103488103489103490103491103492103493103494103495103496103497103498103499103500103501103502103503103504103505103506103507103508103509103510103511103512103513103514103515103516103517103518103519103520103521103522103523103524103525103526103527103528103529103530103531103532103533103534103535103536103537103538103539103540103541103542103543103544103545103546103547103548103549103550103551103552103553103554103555103556103557103558103559103560103561103562103563103564103565103566103567103568103569103570103571103572103573103574103575103576103577103578103579103580103581103582103583103584103585103586103587103588103589103590103591103592103593103594103595103596103597103598103599103600103601103602103603103604103605103606103607103608103609103610103611103612103613103614103615103616103617103618103619103620103621103622103623103624103625103626103627103628103629103630103631103632103633103634103635103636103637103638103639103640103641103642103643103644103645103646103647103648103649103650103651103652103653103654103655103656103657103658103659103660103661103662103663103664103665103666103667103668103669103670103671103672103673103674103675103676103677103678103679103680103681103682103683103684103685103686103687103688103689103690103691103692103693103694103695103696103697103698103699103700103701103702103703103704103705103706103707103708103709103710103711103712103713103714103715103716103717103718103719103720103721103722103723103724103725103726103727103728103729103730103731103732103733103734103735103736103737103738103739103740103741103742103743103744103745103746103747103748103749103750103751103752103753103754103755103756103757103758103759103760103761103762103763103764103765103766103767103768103769103770103771103772103773103774103775103776103777103778103779103780103781103782103783103784103785103786103787103788103789103790103791103792103793103794103795103796103797103798103799103800103801103802103803103804103805103806103807103808103809103810103811103812103813103814103815103816103817103818103819103820103821103822103823103824103825103826103827103828103829103830103831103832103833103834103835103836103837103838103839103840103841103842103843103844103845103846103847103848103849103850103851103852103853103854103855103856103857103858103859103860103861103862103863103864103865103866103867103868103869103870103871103872103873103874103875103876103877103878103879103880103881103882103883103884103885103886103887103888103889103890103891103892103893103894103895103896103897103898103899103900103901103902103903103904103905103906103907103908103909103910103911103912103913103914103915103916103917103918103919103920103921103922103923103924103925103926103927103928103929103930103931103932103933103934103935103936103937103938103939103940103941103942103943103944103945103946103947103948103949103950103951103952103953103954103955103956103957103958103959103960103961103962103963103964103965103966103967103968103969103970103971103972103973103974103975103976103977103978103979103980103981103982103983103984103985103986103987103988103989103990103991103992103993103994103995103996103997103998103999104000104001104002104003104004104005104006104007104008104009104010104011104012104013104014104015104016104017104018104019104020104021104022104023104024104025104026104027104028104029104030104031104032104033104034104035104036104037104038104039104040104041104042104043104044104045104046104047104048104049104050104051104052104053104054104055104056104057104058104059104060104061104062104063104064104065104066104067104068104069104070104071104072104073104074104075104076104077104078104079104080104081104082104083104084104085104086104087104088104089104090104091104092104093104094104095104096104097104098104099104100104101104102104103104104104105104106104107104108104109104110104111104112104113104114104115104116104117104118104119104120104121104122104123104124104125104126104127104128104129104130104131104132104133104134104135104136104137104138104139104140104141104142104143104144104145104146104147104148104149104150104151104152104153104154104155104156104157104158104159104160104161104162104163104164104165104166104167104168104169104170104171104172104173104174104175104176104177104178104179104180104181104182104183104184104185104186104187104188104189104190104191104192104193104194104195104196104197104198104199104200104201104202104203104204104205104206104207104208104209104210104211104212104213104214104215104216104217104218104219104220104221104222104223104224104225104226104227104228104229104230104231104232104233104234104235104236104237104238104239104240104241104242104243104244104245104246104247104248104249104250104251104252104253104254104255104256104257104258104259104260104261104262104263104264104265104266104267104268104269104270104271104272104273104274104275104276104277104278104279104280104281104282104283104284104285104286104287104288104289104290104291104292104293104294104295104296104297104298104299104300104301104302104303104304104305104306104307104308104309104310104311104312104313104314104315104316104317104318104319104320104321104322104323104324104325104326104327104328104329104330104331104332104333104334104335104336104337104338104339104340104341104342104343104344104345104346104347104348104349104350104351104352104353104354104355104356104357104358104359104360104361104362104363104364104365104366104367104368104369104370104371104372104373104374104375104376104377104378104379104380104381104382104383104384104385104386104387104388104389104390104391104392104393104394104395104396104397104398104399104400104401104402104403104404104405104406104407104408104409104410104411104412104413104414104415104416104417104418104419104420104421104422104423104424104425104426104427104428104429104430104431104432104433104434104435104436104437104438104439104440104441104442104443104444104445104446104447104448104449104450104451104452104453104454104455104456104457104458104459104460104461104462104463104464104465104466104467104468104469104470104471104472104473104474104475104476104477104478104479104480104481104482104483104484104485104486104487104488104489104490104491104492104493104494104495104496104497104498104499104500104501104502104503104504104505104506104507104508104509104510104511104512104513104514104515104516104517104518104519104520104521104522104523104524104525104526104527104528104529104530104531104532104533104534104535104536104537104538104539104540104541104542104543104544104545104546104547104548104549104550104551104552104553104554104555104556104557104558104559104560104561104562104563104564104565104566104567104568104569104570104571104572104573104574104575104576104577104578104579104580104581104582104583104584104585104586104587104588104589104590104591104592104593104594104595104596104597104598104599104600104601104602104603104604104605104606104607104608104609104610104611104612104613104614104615104616104617104618104619104620104621104622104623104624104625104626104627104628104629104630104631104632104633104634104635104636104637104638104639104640104641104642104643104644104645104646104647104648104649104650104651104652104653104654104655104656104657104658104659104660104661104662104663104664104665104666104667104668104669104670104671104672104673104674104675104676104677104678104679104680104681104682104683104684104685104686104687104688104689104690104691104692104693104694104695104696104697104698104699104700104701104702104703104704104705104706104707104708104709104710104711104712104713104714104715104716104717104718104719104720104721104722104723104724104725104726104727104728104729104730104731104732104733104734104735104736104737104738104739104740104741104742104743104744104745104746104747104748104749104750104751104752104753104754104755104756104757104758104759104760104761104762104763104764104765104766104767104768104769104770104771104772104773104774104775104776104777104778104779104780104781104782104783104784104785104786104787104788104789104790104791104792104793104794104795104796104797104798104799104800104801104802104803104804104805104806104807104808104809104810104811104812104813104814104815104816104817104818104819104820104821104822104823104824104825104826104827104828104829104830104831104832104833104834104835104836104837104838104839104840104841104842104843104844104845104846104847104848104849104850104851104852104853104854104855104856104857104858104859104860104861104862104863104864104865104866104867104868104869104870104871104872104873104874104875104876104877104878104879104880104881104882104883104884104885104886104887104888104889104890104891104892104893104894104895104896104897104898104899104900104901104902104903104904104905104906104907104908104909104910104911104912104913104914104915104916104917104918104919104920104921104922104923104924104925104926104927104928104929104930104931104932104933104934104935104936104937104938104939104940104941104942104943104944104945104946104947104948104949104950104951104952104953104954104955104956104957104958104959104960104961104962104963104964104965104966104967104968104969104970104971104972104973104974104975104976104977104978104979104980104981104982104983104984104985104986104987104988104989104990104991104992104993104994104995104996104997104998104999105000105001105002105003105004105005105006105007105008105009105010105011105012105013105014105015105016105017105018105019105020105021105022105023105024105025105026105027105028105029105030105031105032105033105034105035105036105037105038105039105040105041105042105043105044105045105046105047105048105049105050105051105052105053105054105055105056105057105058105059105060105061105062105063105064105065105066105067105068105069105070105071105072105073105074105075105076105077105078105079105080105081105082105083105084105085105086105087105088105089105090105091105092105093105094105095105096105097105098105099105100105101105102105103105104105105105106105107105108105109105110105111105112105113105114105115105116105117105118105119105120105121105122105123105124105125105126105127105128105129105130105131105132105133105134105135105136105137105138105139105140105141105142105143105144105145105146105147105148105149105150105151105152105153105154105155105156105157105158105159105160105161105162105163105164105165105166105167105168105169105170105171105172105173105174105175105176105177105178105179105180105181105182105183105184105185105186105187105188105189105190105191105192105193105194105195105196105197105198105199105200105201105202105203105204105205105206105207105208105209105210105211105212105213105214105215105216105217105218105219105220105221105222105223105224105225105226105227105228105229105230105231105232105233105234105235105236105237105238105239105240105241105242105243105244105245105246105247105248105249105250105251105252105253105254105255105256105257105258105259105260105261105262105263105264105265105266105267105268105269105270105271105272105273105274105275105276105277105278105279105280105281105282105283105284105285105286105287105288105289105290105291105292105293105294105295105296105297105298105299105300105301105302105303105304105305105306105307105308105309105310105311105312105313105314105315105316105317105318105319105320105321105322105323105324105325105326105327105328105329105330105331105332105333105334105335105336105337105338105339105340105341105342105343105344105345105346105347105348105349105350105351105352105353105354105355105356105357105358105359105360105361105362105363105364105365105366105367105368105369105370105371105372105373105374105375105376105377105378105379105380105381105382105383105384105385105386105387105388105389105390105391105392105393105394105395105396105397105398105399105400105401105402105403105404105405105406105407105408105409105410105411105412105413105414105415105416105417105418105419105420105421105422105423105424105425105426105427105428105429105430105431105432105433105434105435105436105437105438105439105440105441105442105443105444105445105446105447105448105449105450105451105452105453105454105455105456105457105458105459105460105461105462105463105464105465105466105467105468105469105470105471105472105473105474105475105476105477105478105479105480105481105482105483105484105485105486105487105488105489105490105491105492105493105494105495105496105497105498105499105500105501105502105503105504105505105506105507105508105509105510105511105512105513105514105515105516105517105518105519105520105521105522105523105524105525105526105527105528105529105530105531105532105533105534105535105536105537105538105539105540105541105542105543105544105545105546105547105548105549105550105551105552105553105554105555105556105557105558105559105560105561105562105563105564105565105566105567105568105569105570105571105572105573105574105575105576105577105578105579105580105581105582105583105584105585105586105587105588105589105590105591105592105593105594105595105596105597105598105599105600105601105602105603105604105605105606105607105608105609105610105611105612105613105614105615105616105617105618105619105620105621105622105623105624105625105626105627105628105629105630105631105632105633105634105635105636105637105638105639105640105641105642105643105644105645105646105647105648105649105650105651105652105653105654105655105656105657105658105659105660105661105662105663105664105665105666105667105668105669105670105671105672105673105674105675105676105677105678105679105680105681105682105683105684105685105686105687105688105689105690105691105692105693105694105695105696105697105698105699105700105701105702105703105704105705105706105707105708105709105710105711105712105713105714105715105716105717105718105719105720105721105722105723105724105725105726105727105728105729105730105731105732105733105734105735105736105737105738105739105740105741105742105743105744105745105746105747105748105749105750105751105752105753105754105755105756105757105758105759105760105761105762105763105764105765105766105767105768105769105770105771105772105773105774105775105776105777105778105779105780105781105782105783105784105785105786105787105788105789105790105791105792105793105794105795105796105797105798105799105800105801105802105803105804105805105806105807105808105809105810105811105812105813105814105815105816105817105818105819105820105821105822105823105824105825105826105827105828105829105830105831105832105833105834105835105836105837105838105839105840105841105842105843105844105845105846105847105848105849105850105851105852105853105854105855105856105857105858105859105860105861105862105863105864105865105866105867105868105869105870105871105872105873105874105875105876105877105878105879105880105881105882105883105884105885105886105887105888105889105890105891105892105893105894105895105896105897105898105899105900105901105902105903105904105905105906105907105908105909105910105911105912105913105914105915105916105917105918105919105920105921105922105923105924105925105926105927105928105929105930105931105932105933105934105935105936105937105938105939105940105941105942105943105944105945105946105947105948105949105950105951105952105953105954105955105956105957105958105959105960105961105962105963105964105965105966105967105968105969105970105971105972105973105974105975105976105977105978105979105980105981105982105983105984105985105986105987105988105989105990105991105992105993105994105995105996105997105998105999106000106001106002106003106004106005106006106007106008106009106010106011106012106013106014106015106016106017106018106019106020106021106022106023106024106025106026106027106028106029106030106031106032106033106034106035106036106037106038106039106040106041106042106043106044106045106046106047106048106049106050106051106052106053106054106055106056106057106058106059106060106061106062106063106064106065106066106067106068106069106070106071106072106073106074106075106076106077106078106079106080106081106082106083106084106085106086106087106088106089106090106091106092106093106094106095106096106097106098106099106100106101106102106103106104106105106106106107106108106109106110106111106112106113106114106115106116106117106118106119106120106121106122106123106124106125106126106127106128106129106130106131106132106133106134106135106136106137106138106139106140106141106142106143106144106145106146106147106148106149106150106151106152106153106154106155106156106157106158106159106160106161106162106163106164106165106166106167106168106169106170106171106172106173106174106175106176106177106178106179106180106181106182106183106184106185106186106187106188106189106190106191106192106193106194106195106196106197106198106199106200106201106202106203106204106205106206106207106208106209106210106211106212106213106214106215106216106217106218106219106220106221106222106223106224106225106226106227106228106229106230106231106232106233106234106235106236106237106238106239106240106241106242106243106244106245106246106247106248106249106250106251106252106253106254106255106256106257106258106259106260106261106262106263106264106265106266106267106268106269106270106271106272106273106274106275106276106277106278106279106280106281106282106283106284106285106286106287106288106289106290106291106292106293106294106295106296106297106298106299106300106301106302106303106304106305106306106307106308106309106310106311106312106313106314106315106316106317106318106319106320106321106322106323106324106325106326106327106328106329106330106331106332106333106334106335106336106337106338106339106340106341106342106343106344106345106346106347106348106349106350106351106352106353106354106355106356106357106358106359106360106361106362106363106364106365106366106367106368106369106370106371106372106373106374106375106376106377106378106379106380106381106382106383106384106385106386106387106388106389106390106391106392106393106394106395106396106397106398106399106400106401106402106403106404106405106406106407106408106409106410106411106412106413106414106415106416106417106418106419106420106421106422106423106424106425106426106427106428106429106430106431106432106433106434106435106436106437106438106439106440106441106442106443106444106445106446106447106448106449106450106451106452106453106454106455106456106457106458106459106460106461106462106463106464106465106466106467106468106469106470106471106472106473106474106475106476106477106478106479106480106481106482106483106484106485106486106487106488106489106490106491106492106493106494106495106496106497106498106499106500106501106502106503106504106505106506106507106508106509106510106511106512106513106514106515106516106517106518106519106520106521106522106523106524106525106526106527106528106529106530106531106532106533106534106535106536106537106538106539106540106541106542106543106544106545106546106547106548106549106550106551106552106553106554106555106556106557106558106559106560106561106562106563106564106565106566106567106568106569106570106571106572106573106574106575106576106577106578106579106580106581106582106583106584106585106586106587106588106589106590106591106592106593106594106595106596106597106598106599106600106601106602106603106604106605106606106607106608106609106610106611106612106613106614106615106616106617106618106619106620106621106622106623106624106625106626106627106628106629106630106631106632106633106634106635106636106637106638106639106640106641106642106643106644106645106646106647106648106649106650106651106652106653106654106655106656106657106658106659106660106661106662106663106664106665106666106667106668106669106670106671106672106673106674106675106676106677106678106679106680106681106682106683106684106685106686106687106688106689106690106691106692106693106694106695106696106697106698106699106700106701106702106703106704106705106706106707106708106709106710106711106712106713106714106715106716106717106718106719106720106721106722106723106724106725106726106727106728106729106730106731106732106733106734106735106736106737106738106739106740106741106742106743106744106745106746106747106748106749106750106751106752106753106754106755106756106757106758106759106760106761106762106763106764106765106766106767106768106769106770106771106772106773106774106775106776106777106778106779106780106781106782106783106784106785106786106787106788106789106790106791106792106793106794106795106796106797106798106799106800106801106802106803106804106805106806106807106808106809106810106811106812106813106814106815106816106817106818106819106820106821106822106823106824106825106826106827106828106829106830106831106832106833106834106835106836106837106838106839106840106841106842106843106844106845106846106847106848106849106850106851106852106853106854106855106856106857106858106859106860106861106862106863106864106865106866106867106868106869106870106871106872106873106874106875106876106877106878106879106880106881106882106883106884106885106886106887106888106889106890106891106892106893106894106895106896106897106898106899106900106901106902106903106904106905106906106907106908106909106910106911106912106913106914106915106916106917106918106919106920106921106922106923106924106925106926106927106928106929106930106931106932106933106934106935106936106937106938106939106940106941106942106943106944106945106946106947106948106949106950106951106952106953106954106955106956106957106958106959106960106961106962106963106964106965106966106967106968106969106970106971106972106973106974106975106976106977106978106979106980106981106982106983106984106985106986106987106988106989106990106991106992106993106994106995106996106997106998106999107000107001107002107003107004107005107006107007107008107009107010107011107012107013107014107015107016107017107018107019107020107021107022107023107024107025107026107027107028107029107030107031107032107033107034107035107036107037107038107039107040107041107042107043107044107045107046107047107048107049107050107051107052107053107054107055107056107057107058107059107060107061107062107063107064107065107066107067107068107069107070107071107072107073107074107075107076107077107078107079107080107081107082107083107084107085107086107087107088107089107090107091107092107093107094107095107096107097107098107099107100107101107102107103107104107105107106107107107108107109107110107111107112107113107114107115107116107117107118107119107120107121107122107123107124107125107126107127107128107129107130107131107132107133107134107135107136107137107138107139107140107141107142107143107144107145107146107147107148107149107150107151107152107153107154107155107156107157107158107159107160107161107162107163107164107165107166107167107168107169107170107171107172107173107174107175107176107177107178107179107180107181107182107183107184107185107186107187107188107189107190107191107192107193107194107195107196107197107198107199107200107201107202107203107204107205107206107207107208107209107210107211107212107213107214107215107216107217107218107219107220107221107222107223107224107225107226107227107228107229107230107231107232107233107234107235107236107237107238107239107240107241107242107243107244107245107246107247107248107249107250107251107252107253107254107255107256107257107258107259107260107261107262107263107264107265107266107267107268107269107270107271107272107273107274107275107276107277107278107279107280107281107282107283107284107285107286107287107288107289107290107291107292107293107294107295107296107297107298107299107300107301107302107303107304107305107306107307107308107309107310107311107312107313107314107315107316107317107318107319107320107321107322107323107324107325107326107327107328107329107330107331107332107333107334107335107336107337107338107339107340107341107342107343107344107345107346107347107348107349107350107351107352107353107354107355107356107357107358107359107360107361107362107363107364107365107366107367107368107369107370107371107372107373107374107375107376107377107378107379107380107381107382107383107384107385107386107387107388107389107390107391107392107393107394107395107396107397107398107399107400107401107402107403107404107405107406107407107408107409107410107411107412107413107414107415107416107417107418107419107420107421107422107423107424107425107426107427107428107429107430107431107432107433107434107435107436107437107438107439107440107441107442107443107444107445107446107447107448107449107450107451107452107453107454107455107456107457107458107459107460107461107462107463107464107465107466107467107468107469107470107471107472107473107474107475107476107477107478107479107480107481107482107483107484107485107486107487107488107489107490107491107492107493107494107495107496107497107498107499107500107501107502107503107504107505107506107507107508107509107510107511107512107513107514107515107516107517107518107519107520107521107522107523107524107525107526107527107528107529107530107531107532107533107534107535107536107537107538107539107540107541107542107543107544107545107546107547107548107549107550107551107552107553107554107555107556107557107558107559107560107561107562107563107564107565107566107567107568107569107570107571107572107573107574107575107576107577107578107579107580107581107582107583107584107585107586107587107588107589107590107591107592107593107594107595107596107597107598107599107600107601107602107603107604107605107606107607107608107609107610107611107612107613107614107615107616107617107618107619107620107621107622107623107624107625107626107627107628107629107630107631107632107633107634107635107636107637107638107639107640107641107642107643107644107645107646107647107648107649107650107651107652107653107654107655107656107657107658107659107660107661107662107663107664107665107666107667107668107669107670107671107672107673107674107675107676107677107678107679107680107681107682107683107684107685107686107687107688107689107690107691107692107693107694107695107696107697107698107699107700107701107702107703107704107705107706107707107708107709107710107711107712107713107714107715107716107717107718107719107720107721107722107723107724107725107726107727107728107729107730107731107732107733107734107735107736107737107738107739107740107741107742107743107744107745107746107747107748107749107750107751107752107753107754107755107756107757107758107759107760107761107762107763107764107765107766107767107768107769107770107771107772107773107774107775107776107777107778107779107780107781107782107783107784107785107786107787107788107789107790107791107792107793107794107795107796107797107798107799107800107801107802107803107804107805107806107807107808107809107810107811107812107813107814107815107816107817107818107819107820107821107822107823107824107825107826107827107828107829107830107831107832107833107834107835107836107837107838107839107840107841107842107843107844107845107846107847107848107849107850107851107852107853107854107855107856107857107858107859107860107861107862107863107864107865107866107867107868107869107870107871107872107873107874107875107876107877107878107879107880107881107882107883107884107885107886107887107888107889107890107891107892107893107894107895107896107897107898107899107900107901107902107903107904107905107906107907107908107909107910107911107912107913107914107915107916107917107918107919107920107921107922107923107924107925107926107927107928107929107930107931107932107933107934107935107936107937107938107939107940107941107942107943107944107945107946107947107948107949107950107951107952107953107954107955107956107957107958107959107960107961107962107963107964107965107966107967107968107969107970107971107972107973107974107975107976107977107978107979107980107981107982107983107984107985107986107987107988107989107990107991107992107993107994107995107996107997107998107999108000108001108002108003108004108005108006108007108008108009108010108011108012108013108014108015108016108017108018108019108020108021108022108023108024108025108026108027108028108029108030108031108032108033108034108035108036108037108038108039108040108041108042108043108044108045108046108047108048108049108050108051108052108053108054108055108056108057108058108059108060108061108062108063108064108065108066108067108068108069108070108071108072108073108074108075108076108077108078108079108080108081108082108083108084108085108086108087108088108089108090108091108092108093108094108095108096108097108098108099108100108101108102108103108104108105108106108107108108108109108110108111108112108113108114108115108116108117108118108119108120108121108122108123108124108125108126108127108128108129108130108131108132108133108134108135108136108137108138108139108140108141108142108143108144108145108146108147108148108149108150108151108152108153108154108155108156108157108158108159108160108161108162108163108164108165108166108167108168108169108170108171108172108173108174108175108176108177108178108179108180108181108182108183108184108185108186108187108188108189108190108191108192108193108194108195108196108197108198108199108200108201108202108203108204108205108206108207108208108209108210108211108212108213108214108215108216108217108218108219108220108221108222108223108224108225108226108227108228108229108230108231108232108233108234108235108236108237108238108239108240108241108242108243108244108245108246108247108248108249108250108251108252108253108254108255108256108257108258108259108260108261108262108263108264108265108266108267108268108269108270108271108272108273108274108275108276108277108278108279108280108281108282108283108284108285108286108287108288108289108290108291108292108293108294108295108296108297108298108299108300108301108302108303108304108305108306108307108308108309108310108311108312108313108314108315108316108317108318108319108320108321108322108323108324108325108326108327108328108329108330108331108332108333108334108335108336108337108338108339108340108341108342108343108344108345108346108347108348108349108350108351108352108353108354108355108356108357108358108359108360108361108362108363108364108365108366108367108368108369108370108371108372108373108374108375108376108377108378108379108380108381108382108383108384108385108386108387108388108389108390108391108392108393108394108395108396108397108398108399108400108401108402108403108404108405108406108407108408108409108410108411108412108413108414108415108416108417108418108419108420108421108422108423108424108425108426108427108428108429108430108431108432108433108434108435108436108437108438108439108440108441108442108443108444108445108446108447108448108449108450108451108452108453108454108455108456108457108458108459108460108461108462108463108464108465108466108467108468108469108470108471108472108473108474108475108476108477108478108479108480108481108482108483108484108485108486108487108488108489108490108491108492108493108494108495108496108497108498108499108500108501108502108503108504108505108506108507108508108509108510108511108512108513108514108515108516108517108518108519108520108521108522108523108524108525108526108527108528108529108530108531108532108533108534108535108536108537108538108539108540108541108542108543108544108545108546108547108548108549108550108551108552108553108554108555108556108557108558108559108560108561108562108563108564108565108566108567108568108569108570108571108572108573108574108575108576108577108578108579108580108581108582108583108584108585108586108587108588108589108590108591108592108593108594108595108596108597108598108599108600108601108602108603108604108605108606108607108608108609108610108611108612108613108614108615108616108617108618108619108620108621108622108623108624108625108626108627108628108629108630108631108632108633108634108635108636108637108638108639108640108641108642108643108644108645108646108647108648108649108650108651108652108653108654108655108656108657108658108659108660108661108662108663108664108665108666108667108668108669108670108671108672108673108674108675108676108677108678108679108680108681108682108683108684108685108686108687108688108689108690108691108692108693108694108695108696108697108698108699108700108701108702108703108704108705108706108707108708108709108710108711108712108713108714108715108716108717108718108719108720108721108722108723108724108725108726108727108728108729108730108731108732108733108734108735108736108737108738108739108740108741108742108743108744108745108746108747108748108749108750108751108752108753108754108755108756108757108758108759108760108761108762108763108764108765108766108767108768108769108770108771108772108773108774108775108776108777108778108779108780108781108782108783108784108785108786108787108788108789108790108791108792108793108794108795108796108797108798108799108800108801108802108803108804108805108806108807108808108809108810108811108812108813108814108815108816108817108818108819108820108821108822108823108824108825108826108827108828108829108830108831108832108833108834108835108836108837108838108839108840108841108842108843108844108845108846108847108848108849108850108851108852108853108854108855108856108857108858108859108860108861108862108863108864108865108866108867108868108869108870108871108872108873108874108875108876108877108878108879108880108881108882108883108884108885108886108887108888108889108890108891108892108893108894108895108896108897108898108899108900108901108902108903108904108905108906108907108908108909108910108911108912108913108914108915108916108917108918108919108920108921108922108923108924108925108926108927108928108929108930108931108932108933108934108935108936108937108938108939108940108941108942108943108944108945108946108947108948108949108950108951108952108953108954108955108956108957108958108959108960108961108962108963108964108965108966108967108968108969108970108971108972108973108974108975108976108977108978108979108980108981108982108983108984108985108986108987108988108989108990108991108992108993108994108995108996108997108998108999109000109001109002109003109004109005109006109007109008109009109010109011109012109013109014109015109016109017109018109019109020109021109022109023109024109025109026109027109028109029109030109031109032109033109034109035109036109037109038109039109040109041109042109043109044109045109046109047109048109049109050109051109052109053109054109055109056109057109058109059109060109061109062109063109064109065109066109067109068109069109070109071109072109073109074109075109076109077109078109079109080109081109082109083109084109085109086109087109088109089109090109091109092109093109094109095109096109097109098109099109100109101109102109103109104109105109106109107109108109109109110109111109112109113109114109115109116109117109118109119109120109121109122109123109124109125109126109127109128109129109130109131109132109133109134109135109136109137109138109139109140109141109142109143109144109145109146109147109148109149109150109151109152109153109154109155109156109157109158109159109160109161109162109163109164109165109166109167109168109169109170109171109172109173109174109175109176109177109178109179109180109181109182109183109184109185109186109187109188109189109190109191109192109193109194109195109196109197109198109199109200109201109202109203109204109205109206109207109208109209109210109211109212109213109214109215109216109217109218109219109220109221109222109223109224109225109226109227109228109229109230109231109232109233109234109235109236109237109238109239109240109241109242109243109244109245109246109247109248109249109250109251109252109253109254109255109256109257109258109259109260109261109262109263109264109265109266109267109268109269109270109271109272109273109274109275109276109277109278109279109280109281109282109283109284109285109286109287109288109289109290109291109292109293109294109295109296109297109298109299109300109301109302109303109304109305109306109307109308109309109310109311109312109313109314109315109316109317109318109319109320109321109322109323109324109325109326109327109328109329109330109331109332109333109334109335109336109337109338109339109340109341109342109343109344109345109346109347109348109349109350109351109352109353109354109355109356109357109358109359109360109361109362109363109364109365109366109367109368109369109370109371109372109373109374109375109376109377109378109379109380109381109382109383109384109385109386109387109388109389109390109391109392109393109394109395109396109397109398109399109400109401109402109403109404109405109406109407109408109409109410109411109412109413109414109415109416109417109418109419109420109421109422109423109424109425109426109427109428109429109430109431109432109433109434109435109436109437109438109439109440109441109442109443109444109445109446109447109448109449109450109451109452109453109454109455109456109457109458109459109460109461109462109463109464109465109466109467109468109469109470109471109472109473109474109475109476109477109478109479109480109481109482109483109484109485109486109487109488109489109490109491109492109493109494109495109496109497109498109499109500109501109502109503109504109505109506109507109508109509109510109511109512109513109514109515109516109517109518109519109520109521109522109523109524109525109526109527109528109529109530109531109532109533109534109535109536109537109538109539109540109541109542109543109544109545109546109547109548109549109550109551109552109553109554109555109556109557109558109559109560109561109562109563109564109565109566109567109568109569109570109571109572109573109574109575109576109577109578109579109580109581109582109583109584109585109586109587109588109589109590109591109592109593109594109595109596109597109598109599109600109601109602109603109604109605109606109607109608109609109610109611109612109613109614109615109616109617109618109619109620109621109622109623109624109625109626109627109628109629109630109631109632109633109634109635109636109637109638109639109640109641109642109643109644109645109646109647109648109649109650109651109652109653109654109655109656109657109658109659109660109661109662109663109664109665109666109667109668109669109670109671109672109673109674109675109676109677109678109679109680109681109682109683109684109685109686109687109688109689109690109691109692109693109694109695109696109697109698109699109700109701109702109703109704109705109706109707109708109709109710109711109712109713109714109715109716109717109718109719109720109721109722109723109724109725109726109727109728109729109730109731109732109733109734109735109736109737109738109739109740109741109742109743109744109745109746109747109748109749109750109751109752109753109754109755109756109757109758109759109760109761109762109763109764109765109766109767109768109769109770109771109772109773109774109775109776109777109778109779109780109781109782109783109784109785109786109787109788109789109790109791109792109793109794109795109796109797109798109799109800109801109802109803109804109805109806109807109808109809109810109811109812109813109814109815109816109817109818109819109820109821109822109823109824109825109826109827109828109829109830109831109832109833109834109835109836109837109838109839109840109841109842109843109844109845109846109847109848109849109850109851109852109853109854109855109856109857109858109859109860109861109862109863109864109865109866109867109868109869109870109871109872109873109874109875109876109877109878109879109880109881109882109883109884109885109886109887109888109889109890109891109892109893109894109895109896109897109898109899109900109901109902109903109904109905109906109907109908109909109910109911109912109913109914109915109916109917109918109919109920109921109922109923109924109925109926109927109928109929109930109931109932109933109934109935109936109937109938109939109940109941109942109943109944109945109946109947109948109949109950109951109952109953109954109955109956109957109958109959109960109961109962109963109964109965109966109967109968109969109970109971109972109973109974109975109976109977109978109979109980109981109982109983109984109985109986109987109988109989109990109991109992109993109994109995109996109997109998109999110000110001110002110003110004110005110006110007110008110009110010110011110012110013110014110015110016110017110018110019110020110021110022110023110024110025110026110027110028110029110030110031110032110033110034110035110036110037110038110039110040110041110042110043110044110045110046110047110048110049110050110051110052110053110054110055110056110057110058110059110060110061110062110063110064110065110066110067110068110069110070110071110072110073110074110075110076110077110078110079110080110081110082110083110084110085110086110087110088110089110090110091110092110093110094110095110096110097110098110099110100110101110102110103110104110105110106110107110108110109110110110111110112110113110114110115110116110117110118110119110120110121110122110123110124110125110126110127110128110129110130110131110132110133110134110135110136110137110138110139110140110141110142110143110144110145110146110147110148110149110150110151110152110153110154110155110156110157110158110159110160110161110162110163110164110165110166110167110168110169110170110171110172110173110174110175110176110177110178110179110180110181110182110183110184110185110186110187110188110189110190110191110192110193110194110195110196110197110198110199110200110201110202110203110204110205110206110207110208110209110210110211110212110213110214110215110216110217110218110219110220110221110222110223110224110225110226110227110228110229110230110231110232110233110234110235110236110237110238110239110240110241110242110243110244110245110246110247110248110249110250110251110252110253110254110255110256110257110258110259110260110261110262110263110264110265110266110267110268110269110270110271110272110273110274110275110276110277110278110279110280110281110282110283110284110285110286110287110288110289110290110291110292110293110294110295110296110297110298110299110300110301110302110303110304110305110306110307110308110309110310110311110312110313110314110315110316110317110318110319110320110321110322110323110324110325110326110327110328110329110330110331110332110333110334110335110336110337110338110339110340110341110342110343110344110345110346110347110348110349110350110351110352110353110354110355110356110357110358110359110360110361110362110363110364110365110366110367110368110369110370110371110372110373110374110375110376110377110378110379110380110381110382110383110384110385110386110387110388110389110390110391110392110393110394110395110396110397110398110399110400110401110402110403110404110405110406110407110408110409110410110411110412110413110414110415110416110417110418110419110420110421110422110423110424110425110426110427110428110429110430110431110432110433110434110435110436110437110438110439110440110441110442110443110444110445110446110447110448110449110450110451110452110453110454110455110456110457110458110459110460110461110462110463110464110465110466110467110468110469110470110471110472110473110474110475110476110477110478110479110480110481110482110483110484110485110486110487110488110489110490110491110492110493110494110495110496110497110498110499110500110501110502110503110504110505110506110507110508110509110510110511110512110513110514110515110516110517110518110519110520110521110522110523110524110525110526110527110528110529110530110531110532110533110534110535110536110537110538110539110540110541110542110543110544110545110546110547110548110549110550110551110552110553110554110555110556110557110558110559110560110561110562110563110564110565110566110567110568110569110570110571110572110573110574110575110576110577110578110579110580110581110582110583110584110585110586110587110588110589110590110591110592110593110594110595110596110597110598110599110600110601110602110603110604110605110606110607110608110609110610110611110612110613110614110615110616110617110618110619110620110621110622110623110624110625110626110627110628110629110630110631110632110633110634110635110636110637110638110639110640110641110642110643110644110645110646110647110648110649110650110651110652110653110654110655110656110657110658110659110660110661110662110663110664110665110666110667110668110669110670110671110672110673110674110675110676110677110678110679110680110681110682110683110684110685110686110687110688110689110690110691110692110693110694110695110696110697110698110699110700110701110702110703110704110705110706110707110708110709110710110711110712110713110714110715110716110717110718110719110720110721110722110723110724110725110726110727110728110729110730110731110732110733110734110735110736110737110738110739110740110741110742110743110744110745110746110747110748110749110750110751110752110753110754110755110756110757110758110759110760110761110762110763110764110765110766110767110768110769110770110771110772110773110774110775110776110777110778110779110780110781110782110783110784110785110786110787110788110789110790110791110792110793110794110795110796110797110798110799110800110801110802110803110804110805110806110807110808110809110810110811110812110813110814110815110816110817110818110819110820110821110822110823110824110825110826110827110828110829110830110831110832110833110834110835110836110837110838110839110840110841110842110843110844110845110846110847110848110849110850110851110852110853110854110855110856110857110858110859110860110861110862110863110864110865110866110867110868110869110870110871110872110873110874110875110876110877110878110879110880110881110882110883110884110885110886110887110888110889110890110891110892110893110894110895110896110897110898110899110900110901110902110903110904110905110906110907110908110909110910110911110912110913110914110915110916110917110918110919110920110921110922110923110924110925110926110927110928110929110930110931110932110933110934110935110936110937110938110939110940110941110942110943110944110945110946110947110948110949110950110951110952110953110954110955110956110957110958110959110960110961110962110963110964110965110966110967110968110969110970110971110972110973110974110975110976110977110978110979110980110981110982110983110984110985110986110987110988110989110990110991110992110993110994110995110996110997110998110999111000111001111002111003111004111005111006111007111008111009111010111011111012111013111014111015111016111017111018111019111020111021111022111023111024111025111026111027111028111029111030111031111032111033111034111035111036111037111038111039111040111041111042111043111044111045111046111047111048111049111050111051111052111053111054111055111056111057111058111059111060111061111062111063111064111065111066111067111068111069111070111071111072111073111074111075111076111077111078111079111080111081111082111083111084111085111086111087111088111089111090111091111092111093111094111095111096111097111098111099111100111101111102111103111104111105111106111107111108111109111110111111111112111113111114111115111116111117111118111119111120111121111122111123111124111125111126111127111128111129111130111131111132111133111134111135111136111137111138111139111140111141111142111143111144111145111146111147111148111149111150111151111152111153111154111155111156111157111158111159111160111161111162111163111164111165111166111167111168111169111170111171111172111173111174111175111176111177111178111179111180111181111182111183111184111185111186111187111188111189111190111191111192111193111194111195111196111197111198111199111200111201111202111203111204111205111206111207111208111209111210111211111212111213111214111215111216111217111218111219111220111221111222111223111224111225111226111227111228111229111230111231111232111233111234111235111236111237111238111239111240111241111242111243111244111245111246111247111248111249111250111251111252111253111254111255111256111257111258111259111260111261111262111263111264111265111266111267111268111269111270111271111272111273111274111275111276111277111278111279111280111281111282111283111284111285111286111287111288111289111290111291111292111293111294111295111296111297111298111299111300111301111302111303111304111305111306111307111308111309111310111311111312111313111314111315111316111317111318111319111320111321111322111323111324111325111326111327111328111329111330111331111332111333111334111335111336111337111338111339111340111341111342111343111344111345111346111347111348111349111350111351111352111353111354111355111356111357111358111359111360111361111362111363111364111365111366111367111368111369111370111371111372111373111374111375111376111377111378111379111380111381111382111383111384111385111386111387111388111389111390111391111392111393111394111395111396111397111398111399111400111401111402111403111404111405111406111407111408111409111410111411111412111413111414111415111416111417111418111419111420111421111422111423111424111425111426111427111428111429111430111431111432111433111434111435111436111437111438111439111440111441111442111443111444111445111446111447111448111449111450111451111452111453111454111455111456111457111458111459111460111461111462111463111464111465111466111467111468111469111470111471111472111473111474111475111476111477111478111479111480111481111482111483111484111485111486111487111488111489111490111491111492111493111494111495111496111497111498111499111500111501111502111503111504111505111506111507111508111509111510111511111512111513111514111515111516111517111518111519111520111521111522111523111524111525111526111527111528111529111530111531111532111533111534111535111536111537111538111539111540111541111542111543111544111545111546111547111548111549111550111551111552111553111554111555111556111557111558111559111560111561111562111563111564111565111566111567111568111569111570111571111572111573111574111575111576111577111578111579111580111581111582111583111584111585111586111587111588111589111590111591111592111593111594111595111596111597111598111599111600111601111602111603111604111605111606111607111608111609111610111611111612111613111614111615111616111617111618111619111620111621111622111623111624111625111626111627111628111629111630111631111632111633111634111635111636111637111638111639111640111641111642111643111644111645111646111647111648111649111650111651111652111653111654111655111656111657111658111659111660111661111662111663111664111665111666111667111668111669111670111671111672111673111674111675111676111677111678111679111680111681111682111683111684111685111686111687111688111689111690111691111692111693111694111695111696111697111698111699111700111701111702111703111704111705111706111707111708111709111710111711111712111713111714111715111716111717111718111719111720111721111722111723111724111725111726111727111728111729111730111731111732111733111734111735111736111737111738111739111740111741111742111743111744111745111746111747111748111749111750111751111752111753111754111755111756111757111758111759111760111761111762111763111764111765111766111767111768111769111770111771111772111773111774111775111776111777111778111779111780111781111782111783111784111785111786111787111788111789111790111791111792111793111794111795111796111797111798111799111800111801111802111803111804111805111806111807111808111809111810111811111812111813111814111815111816111817111818111819111820111821111822111823111824111825111826111827111828111829111830111831111832111833111834111835111836111837111838111839111840111841111842111843111844111845111846111847111848111849111850111851111852111853111854111855111856111857111858111859111860111861111862111863111864111865111866111867111868111869111870111871111872111873111874111875111876111877111878111879111880111881111882111883111884111885111886111887111888111889111890111891111892111893111894111895111896111897111898111899111900111901111902111903111904111905111906111907111908111909111910111911111912111913111914111915111916111917111918111919111920111921111922111923111924111925111926111927111928111929111930111931111932111933111934111935111936111937111938111939111940111941111942111943111944111945111946111947111948111949111950111951111952111953111954111955111956111957111958111959111960111961111962111963111964111965111966111967111968111969111970111971111972111973111974111975111976111977111978111979111980111981111982111983111984111985111986111987111988111989111990111991111992111993111994111995111996111997111998111999112000112001112002112003112004112005112006112007112008112009112010112011112012112013112014112015112016112017112018112019112020112021112022112023112024112025112026112027112028112029112030112031112032112033112034112035112036112037112038112039112040112041112042112043112044112045112046112047112048112049112050112051112052112053112054112055112056112057112058112059112060112061112062112063112064112065112066112067112068112069112070112071112072112073112074112075112076112077112078112079112080112081112082112083112084112085112086112087112088112089112090112091112092112093112094112095112096112097112098112099112100112101112102112103112104112105112106112107112108112109112110112111112112112113112114112115112116112117112118112119112120112121112122112123112124112125112126112127112128112129112130112131112132112133112134112135112136112137112138112139112140112141112142112143112144112145112146112147112148112149112150112151112152112153112154112155112156112157112158112159112160112161112162112163112164112165112166112167112168112169112170112171112172112173112174112175112176112177112178112179112180112181112182112183112184112185112186112187112188112189112190112191112192112193112194112195112196112197112198112199112200112201112202112203112204112205112206112207112208112209112210112211112212112213112214112215112216112217112218112219112220112221112222112223112224112225112226112227112228112229112230112231112232112233112234112235112236112237112238112239112240112241112242112243112244112245112246112247112248112249112250112251112252112253112254112255112256112257112258112259112260112261112262112263112264112265112266112267112268112269112270112271112272112273112274112275112276112277112278112279112280112281112282112283112284112285112286112287112288112289112290112291112292112293112294112295112296112297112298112299112300112301112302112303112304112305112306112307112308112309112310112311112312112313112314112315112316112317112318112319112320112321112322112323112324112325112326112327112328112329112330112331112332112333112334112335112336112337112338112339112340112341112342112343112344112345112346112347112348112349112350112351112352112353112354112355112356112357112358112359112360112361112362112363112364112365112366112367112368112369112370112371112372112373112374112375112376112377112378112379112380112381112382112383112384112385112386112387112388112389112390112391112392112393112394112395112396112397112398112399112400112401112402112403112404112405112406112407112408112409112410112411112412112413112414112415112416112417112418112419112420112421112422112423112424112425112426112427112428112429112430112431112432112433112434112435112436112437112438112439112440112441112442112443112444112445112446112447112448112449112450112451112452112453112454112455112456112457112458112459112460112461112462112463112464112465112466112467112468112469112470112471112472112473112474112475112476112477112478112479112480112481112482112483112484112485112486112487112488112489112490112491112492112493112494112495112496112497112498112499112500112501112502112503112504112505112506112507112508112509112510112511112512112513112514112515112516112517112518112519112520112521112522112523112524112525112526112527112528112529112530112531112532112533112534112535112536112537112538112539112540112541112542112543112544112545112546112547112548112549112550112551112552112553112554112555112556112557112558112559112560112561112562112563112564112565112566112567112568112569112570112571112572112573112574112575112576112577112578112579112580112581112582112583112584112585112586112587112588112589112590112591112592112593112594112595112596112597112598112599112600112601112602112603112604112605112606112607112608112609112610112611112612112613112614112615112616112617112618112619112620112621112622112623112624112625112626112627112628112629112630112631112632112633112634112635112636112637112638112639112640112641112642112643112644112645112646112647112648112649112650112651112652112653112654112655112656112657112658112659112660112661112662112663112664112665112666112667112668112669112670112671112672112673112674112675112676112677112678112679112680112681112682112683112684112685112686112687112688112689112690112691112692112693112694112695112696112697112698112699112700112701112702112703112704112705112706112707112708112709112710112711112712112713112714112715112716112717112718112719112720112721112722112723112724112725112726112727112728112729112730112731112732112733112734112735112736112737112738112739112740112741112742112743112744112745112746112747112748112749112750112751112752112753112754112755112756112757112758112759112760112761112762112763112764112765112766112767112768112769112770112771112772112773112774112775112776112777112778112779112780112781112782112783112784112785112786112787112788112789112790112791112792112793112794112795112796112797112798112799112800112801112802112803112804112805112806112807112808112809112810112811112812112813112814112815112816112817112818112819112820112821112822112823112824112825112826112827112828112829112830112831112832112833112834112835112836112837112838112839112840112841112842112843112844112845112846112847112848112849112850112851112852112853112854112855112856112857112858112859112860112861112862112863112864112865112866112867112868112869112870112871112872112873112874112875112876112877112878112879112880112881112882112883112884112885112886112887112888112889112890112891112892112893112894112895112896112897112898112899112900112901112902112903112904112905112906112907112908112909112910112911112912112913112914112915112916112917112918112919112920112921112922112923112924112925112926112927112928112929112930112931112932112933112934112935112936112937112938112939112940112941112942112943112944112945112946112947112948112949112950112951112952112953112954112955112956112957112958112959112960112961112962112963112964112965112966112967112968112969112970112971112972112973112974112975112976112977112978112979112980112981112982112983112984112985112986112987112988112989112990112991112992112993112994112995112996112997112998112999113000113001113002113003113004113005113006113007113008113009113010113011113012113013113014113015113016113017113018113019113020113021113022113023113024113025113026113027113028113029113030113031113032113033113034113035113036113037113038113039113040113041113042113043113044113045113046113047113048113049113050113051113052113053113054113055113056113057113058113059113060113061113062113063113064113065113066113067113068113069113070113071113072113073113074113075113076113077113078113079113080113081113082113083113084113085113086113087113088113089113090113091113092113093113094113095113096113097113098113099113100113101113102113103113104113105113106113107113108113109113110113111113112113113113114113115113116113117113118113119113120113121113122113123113124113125113126113127113128113129113130113131113132113133113134113135113136113137113138113139113140113141113142113143113144113145113146113147113148113149113150113151113152113153113154113155113156113157113158113159113160113161113162113163113164113165113166113167113168113169113170113171113172113173113174113175113176113177113178113179113180113181113182113183113184113185113186113187113188113189113190113191113192113193113194113195113196113197113198113199113200113201113202113203113204113205113206113207113208113209113210113211113212113213113214113215113216113217113218113219113220113221113222113223113224113225113226113227113228113229113230113231113232113233113234113235113236113237113238113239113240113241113242113243113244113245113246113247113248113249113250113251113252113253113254113255113256113257113258113259113260113261113262113263113264113265113266113267113268113269113270113271113272113273113274113275113276113277113278113279113280113281113282113283113284113285113286113287113288113289113290113291113292113293113294113295113296113297113298113299113300113301113302113303113304113305113306113307113308113309113310113311113312113313113314113315113316113317113318113319113320113321113322113323113324113325113326113327113328113329113330113331113332113333113334113335113336113337113338113339113340113341113342113343113344113345113346113347113348113349113350113351113352113353113354113355113356113357113358113359113360113361113362113363113364113365113366113367113368113369113370113371113372113373113374113375113376113377113378113379113380113381113382113383113384113385113386113387113388113389113390113391113392113393113394113395113396113397113398113399113400113401113402113403113404113405113406113407113408113409113410113411113412113413113414113415113416113417113418113419113420113421113422113423113424113425113426113427113428113429113430113431113432113433113434113435113436113437113438113439113440113441113442113443113444113445113446113447113448113449113450113451113452113453113454113455113456113457113458113459113460113461113462113463113464113465113466113467113468113469113470113471113472113473113474113475113476113477113478113479113480113481113482113483113484113485113486113487113488113489113490113491113492113493113494113495113496113497113498113499113500113501113502113503113504113505113506113507113508113509113510113511113512113513113514113515113516113517113518113519113520113521113522113523113524113525113526113527113528113529113530113531113532113533113534113535113536113537113538113539113540113541113542113543113544113545113546113547113548113549113550113551113552113553113554113555113556113557113558113559113560113561113562113563113564113565113566113567113568113569113570113571113572113573113574113575113576113577113578113579113580113581113582113583113584113585113586113587113588113589113590113591113592113593113594113595113596113597113598113599113600113601113602113603113604113605113606113607113608113609113610113611113612113613113614113615113616113617113618113619113620113621113622113623113624113625113626113627113628113629113630113631113632113633113634113635113636113637113638113639113640113641113642113643113644113645113646113647113648113649113650113651113652113653113654113655113656113657113658113659113660113661113662113663113664113665113666113667113668113669113670113671113672113673113674113675113676113677113678113679113680113681113682113683113684113685113686113687113688113689113690113691113692113693113694113695113696113697113698113699113700113701113702113703113704113705113706113707113708113709113710113711113712113713113714113715113716113717113718113719113720113721113722113723113724113725113726113727113728113729113730113731113732113733113734113735113736113737113738113739113740113741113742113743113744113745113746113747113748113749113750113751113752113753113754113755113756113757113758113759113760113761113762113763113764113765113766113767113768113769113770113771113772113773113774113775113776113777113778113779113780113781113782113783113784113785113786113787113788113789113790113791113792113793113794113795113796113797113798113799113800113801113802113803113804113805113806113807113808113809113810113811113812113813113814113815113816113817113818113819113820113821113822113823113824113825113826113827113828113829113830113831113832113833113834113835113836113837113838113839113840113841113842113843113844113845113846113847113848113849113850113851113852113853113854113855113856113857113858113859113860113861113862113863113864113865113866113867113868113869113870113871113872113873113874113875113876113877113878113879113880113881113882113883113884113885113886113887113888113889113890113891113892113893113894113895113896113897113898113899113900113901113902113903113904113905113906113907113908113909113910113911113912113913113914113915113916113917113918113919113920113921113922113923113924113925113926113927113928113929113930113931113932113933113934113935113936113937113938113939113940113941113942113943113944113945113946113947113948113949113950113951113952113953113954113955113956113957113958113959113960113961113962113963113964113965113966113967113968113969113970113971113972113973113974113975113976113977113978113979113980113981113982113983113984113985113986113987113988113989113990113991113992113993113994113995113996113997113998113999114000114001114002114003114004114005114006114007114008114009114010114011114012114013114014114015114016114017114018114019114020114021114022114023114024114025114026114027114028114029114030114031114032114033114034114035114036114037114038114039114040114041114042114043114044114045114046114047114048114049114050114051114052114053114054114055114056114057114058114059114060114061114062114063114064114065114066114067114068114069114070114071114072114073114074114075114076114077114078114079114080114081114082114083114084114085114086114087114088114089114090114091114092114093114094114095114096114097114098114099114100114101114102114103114104114105114106114107114108114109114110114111114112114113114114114115114116114117114118114119114120114121114122114123114124114125114126114127114128114129114130114131114132114133114134114135114136114137114138114139114140114141114142114143114144114145114146114147114148114149114150114151114152114153114154114155114156114157114158114159114160114161114162114163114164114165114166114167114168114169114170114171114172114173114174114175114176114177114178114179114180114181114182114183114184114185114186114187114188114189114190114191114192114193114194114195114196114197114198114199114200114201114202114203114204114205114206114207114208114209114210114211114212114213114214114215114216114217114218114219114220114221114222114223114224114225114226114227114228114229114230114231114232114233114234114235114236114237114238114239114240114241114242114243114244114245114246114247114248114249114250114251114252114253114254114255114256114257114258114259114260114261114262114263114264114265114266114267114268114269114270114271114272114273114274114275114276114277114278114279114280114281114282114283114284114285114286114287114288114289114290114291114292114293114294114295114296114297114298114299114300114301114302114303114304114305114306114307114308114309114310114311114312114313114314114315114316114317114318114319114320114321114322114323114324114325114326114327114328114329114330114331114332114333114334114335114336114337114338114339114340114341114342114343114344114345114346114347114348114349114350114351114352114353114354114355114356114357114358114359114360114361114362114363114364114365114366114367114368114369114370114371114372114373114374114375114376114377114378114379114380114381114382114383114384114385114386114387114388114389114390114391114392114393114394114395114396114397114398114399114400114401114402114403114404114405114406114407114408114409114410114411114412114413114414114415114416114417114418114419114420114421114422114423114424114425114426114427114428114429114430114431114432114433114434114435114436114437114438114439114440114441114442114443114444114445114446114447114448114449114450114451114452114453114454114455114456114457114458114459114460114461114462114463114464114465114466114467114468114469114470114471114472114473114474114475114476114477114478114479114480114481114482114483114484114485114486114487114488114489114490114491114492114493114494114495114496114497114498114499114500114501114502114503114504114505114506114507114508114509114510114511114512114513114514114515114516114517114518114519114520114521114522114523114524114525114526114527114528114529114530114531114532114533114534114535114536114537114538114539114540114541114542114543114544114545114546114547114548114549114550114551114552114553114554114555114556114557114558114559114560114561114562114563114564114565114566114567114568114569114570114571114572114573114574114575114576114577114578114579114580114581114582114583114584114585114586114587114588114589114590114591114592114593114594114595114596114597114598114599114600114601114602114603114604114605114606114607114608114609114610114611114612114613114614114615114616114617114618114619114620114621114622114623114624114625114626114627114628114629114630114631114632114633114634114635114636114637114638114639114640114641114642114643114644114645114646114647114648114649114650114651114652114653114654114655114656114657114658114659114660114661114662114663114664114665114666114667114668114669114670114671114672114673114674114675114676114677114678114679114680114681114682114683114684114685114686114687114688114689114690114691114692114693114694114695114696114697114698114699114700114701114702114703114704114705114706114707114708114709114710114711114712114713114714114715114716114717114718114719114720114721114722114723114724114725114726114727114728114729114730114731114732114733114734114735114736114737114738114739114740114741114742114743114744114745114746114747114748114749114750114751114752114753114754114755114756114757114758114759114760114761114762114763114764114765114766114767114768114769114770114771114772114773114774114775114776114777114778114779114780114781114782114783114784114785114786114787114788114789114790114791114792114793114794114795114796114797114798114799114800114801114802114803114804114805114806114807114808114809114810114811114812114813114814114815114816114817114818114819114820114821114822114823114824114825114826114827114828114829114830114831114832114833114834114835114836114837114838114839114840114841114842114843114844114845114846114847114848114849114850114851114852114853114854114855114856114857114858114859114860114861114862114863114864114865114866114867114868114869114870114871114872114873114874114875114876114877114878114879114880114881114882114883114884114885114886114887114888114889114890114891114892114893114894114895114896114897114898114899114900114901114902114903114904114905114906114907114908114909114910114911114912114913114914114915114916114917114918114919114920114921114922114923114924114925114926114927114928114929114930114931114932114933114934114935114936114937114938114939114940114941114942114943114944114945114946114947114948114949114950114951114952114953114954114955114956114957114958114959114960114961114962114963114964114965114966114967114968114969114970114971114972114973114974114975114976114977114978114979114980114981114982114983114984114985114986114987114988114989114990114991114992114993114994114995114996114997114998114999115000115001115002115003115004115005115006115007115008115009115010115011115012115013115014115015115016115017115018115019115020115021115022115023115024115025115026115027115028115029115030115031115032115033115034115035115036115037115038115039115040115041115042115043115044115045115046115047115048115049115050115051115052115053115054115055115056115057115058115059115060115061115062115063115064115065115066115067115068115069115070115071115072115073115074115075115076115077115078115079115080115081115082115083115084115085115086115087115088115089115090115091115092115093115094115095115096115097115098115099115100115101115102115103115104115105115106115107115108115109115110115111115112115113115114115115115116115117115118115119115120115121115122115123115124115125115126115127115128115129115130115131115132115133115134115135115136115137115138115139115140115141115142115143115144115145115146115147115148115149115150115151115152115153115154115155115156115157115158115159115160115161115162115163115164115165115166115167115168115169115170115171115172115173115174115175115176115177115178115179115180115181115182115183115184115185115186115187115188115189115190115191115192115193115194115195115196115197115198115199115200115201115202115203115204115205115206115207115208115209115210115211115212115213115214115215115216115217115218115219115220115221115222115223115224115225115226115227115228115229115230115231115232115233115234115235115236115237115238115239115240115241115242115243115244115245115246115247115248115249115250115251115252115253115254115255115256115257115258115259115260115261115262115263115264115265115266115267115268115269115270115271115272115273115274115275115276115277115278115279115280115281115282115283115284115285115286115287115288115289115290115291115292115293115294115295115296115297115298115299115300115301115302115303115304115305115306115307115308115309115310115311115312115313115314115315115316115317115318115319115320115321115322115323115324115325115326115327115328115329115330115331115332115333115334115335115336115337115338115339115340115341115342115343115344115345115346115347115348115349115350115351115352115353115354115355115356115357115358115359115360115361115362115363115364115365115366115367115368115369115370115371115372115373115374115375115376115377115378115379115380115381115382115383115384115385115386115387115388115389115390115391115392115393115394115395115396115397115398115399115400115401115402115403115404115405115406115407115408115409115410115411115412115413115414115415115416115417115418115419115420115421115422115423115424115425115426115427115428115429115430115431115432115433115434115435115436115437115438115439115440115441115442115443115444115445115446115447115448115449115450115451115452115453115454115455115456115457115458115459115460115461115462115463115464115465115466115467115468115469115470115471115472115473115474115475115476115477115478115479115480115481115482115483115484115485115486115487115488115489115490115491115492115493115494115495115496115497115498115499115500115501115502115503115504115505115506115507115508115509115510115511115512115513115514115515115516115517115518115519115520115521115522115523115524115525115526115527115528115529115530115531115532115533115534115535115536115537115538115539115540115541115542115543115544115545115546115547115548115549115550115551115552115553115554115555115556115557115558115559115560115561115562115563115564115565115566115567115568115569115570115571115572115573115574115575115576115577115578115579115580115581115582115583115584115585115586115587115588115589115590115591115592115593115594115595115596115597115598115599115600115601115602115603115604115605115606115607115608115609115610115611115612115613115614115615115616115617115618115619115620115621115622115623115624115625115626115627115628115629115630115631115632115633115634115635115636115637115638115639115640115641115642115643115644115645115646115647115648115649115650115651115652115653115654115655115656115657115658115659115660115661115662115663115664115665115666115667115668115669115670115671115672115673115674115675115676115677115678115679115680115681115682115683115684115685115686115687115688115689115690115691115692115693115694115695115696115697115698115699115700115701115702115703115704115705115706115707115708115709115710115711115712115713115714115715115716115717115718115719115720115721115722115723115724115725115726115727115728115729115730115731115732115733115734115735115736115737115738115739115740115741115742115743115744115745115746115747115748115749115750115751115752115753115754115755115756115757115758115759115760115761115762115763115764115765115766115767115768115769115770115771115772115773115774115775115776115777115778115779115780115781115782115783115784115785115786115787115788115789115790115791115792115793115794115795115796115797115798115799115800115801115802115803115804115805115806115807115808115809115810115811115812115813115814115815115816115817115818115819115820115821115822115823115824115825115826115827115828115829115830115831115832115833115834115835115836115837115838115839115840115841115842115843115844115845115846115847115848115849115850115851115852115853115854115855115856115857115858115859115860115861115862115863115864115865115866115867115868115869115870115871115872115873115874115875115876115877115878115879115880115881115882115883115884115885115886115887115888115889115890115891115892115893115894115895115896115897115898115899115900115901115902115903115904115905115906115907115908115909115910115911115912115913115914115915115916115917115918115919115920115921115922115923115924115925115926115927115928115929115930115931115932115933115934115935115936115937115938115939115940115941115942115943115944115945115946115947115948115949115950115951115952115953115954115955115956115957115958115959115960115961115962115963115964115965115966115967115968115969115970115971115972115973115974115975115976115977115978115979115980115981115982115983115984115985115986115987115988115989115990115991115992115993115994115995115996115997115998115999116000116001116002116003116004116005116006116007116008116009116010116011116012116013116014116015116016116017116018116019116020116021116022116023116024116025116026116027116028116029116030116031116032116033116034116035116036116037116038116039116040116041116042116043116044116045116046116047116048116049116050116051116052116053116054116055116056116057116058116059116060116061116062116063116064116065116066116067116068116069116070116071116072116073116074116075116076116077116078116079116080116081116082116083116084116085116086116087116088116089116090116091116092116093116094116095116096116097116098116099116100116101116102116103116104116105116106116107116108116109116110116111116112116113116114116115116116116117116118116119116120116121116122116123116124116125116126116127116128116129116130116131116132116133116134116135116136116137116138116139116140116141116142116143116144116145116146116147116148116149116150116151116152116153116154116155116156116157116158116159116160116161116162116163116164116165116166116167116168116169116170116171116172116173116174116175116176116177116178116179116180116181116182116183116184116185116186116187116188116189116190116191116192116193116194116195116196116197116198116199116200116201116202116203116204116205116206116207116208116209116210116211116212116213116214116215116216116217116218116219116220116221116222116223116224116225116226116227116228116229116230116231116232116233116234116235116236116237116238116239116240116241116242116243116244116245116246116247116248116249116250116251116252116253116254116255116256116257116258116259116260116261116262116263116264116265116266116267116268116269116270116271116272116273116274116275116276116277116278116279116280116281116282116283116284116285116286116287116288116289116290116291116292116293116294116295116296116297116298116299116300116301116302116303116304116305116306116307116308116309116310116311116312116313116314116315116316116317116318116319116320116321116322116323116324116325116326116327116328116329116330116331116332116333116334116335116336116337116338116339116340116341116342116343116344116345116346116347116348116349116350116351116352116353116354116355116356116357116358116359116360116361116362116363116364116365116366116367116368116369116370116371116372116373116374116375116376116377116378116379116380116381116382116383116384116385116386116387116388116389116390116391116392116393116394116395116396116397116398116399116400116401116402116403116404116405116406116407116408116409116410116411116412116413116414116415116416116417116418116419116420116421116422116423116424116425116426116427116428116429116430116431116432116433116434116435116436116437116438116439116440116441116442116443116444116445116446116447116448116449116450116451116452116453116454116455116456116457116458116459116460116461116462116463116464116465116466116467116468116469116470116471116472116473116474116475116476116477116478116479116480116481116482116483116484116485116486116487116488116489116490116491116492116493116494116495116496116497116498116499116500116501116502116503116504116505116506116507116508116509116510116511116512116513116514116515116516116517116518116519116520116521116522116523116524116525116526116527116528116529116530116531116532116533116534116535116536116537116538116539116540116541116542116543116544116545116546116547116548116549116550116551116552116553116554116555116556116557116558116559116560116561116562116563116564116565116566116567116568116569116570116571116572116573116574116575116576116577116578116579116580116581116582116583116584116585116586116587116588116589116590116591116592116593116594116595116596116597116598116599116600116601116602116603116604116605116606116607116608116609116610116611116612116613116614116615116616116617116618116619116620116621116622116623116624116625116626116627116628116629116630116631116632116633116634116635116636116637116638116639116640116641116642116643116644116645116646116647116648116649116650116651116652116653116654116655116656116657116658116659116660116661116662116663116664116665116666116667116668116669116670116671116672116673116674116675116676116677116678116679116680116681116682116683116684116685116686116687116688116689116690116691116692116693116694116695116696116697116698116699116700116701116702116703116704116705116706116707116708116709116710116711116712116713116714116715116716116717116718116719116720116721116722116723116724116725116726116727116728116729116730116731116732116733116734116735116736116737116738116739116740116741116742116743116744116745116746116747116748116749116750116751116752116753116754116755116756116757116758116759116760116761116762116763116764116765116766116767116768116769116770116771116772116773116774116775116776116777116778116779116780116781116782116783116784116785116786116787116788116789116790116791116792116793116794116795116796116797116798116799116800116801116802116803116804116805116806116807116808116809116810116811116812116813116814116815116816116817116818116819116820116821116822116823116824116825116826116827116828116829116830116831116832116833116834116835116836116837116838116839116840116841116842116843116844116845116846116847116848116849116850116851116852116853116854116855116856116857116858116859116860116861116862116863116864116865116866116867116868116869116870116871116872116873116874116875116876116877116878116879116880116881116882116883116884116885116886116887116888116889116890116891116892116893116894116895116896116897116898116899116900116901116902116903116904116905116906116907116908116909116910116911116912116913116914116915116916116917116918116919116920116921116922116923116924116925116926116927116928116929116930116931116932116933116934116935116936116937116938116939116940116941116942116943116944116945116946116947116948116949116950116951116952116953116954116955116956116957116958116959116960116961116962116963116964116965116966116967116968116969116970116971116972116973116974116975116976116977116978116979116980116981116982116983116984116985116986116987116988116989116990116991116992116993116994116995116996116997116998116999117000117001117002117003117004117005117006117007117008117009117010117011117012117013117014117015117016117017117018117019117020117021117022117023117024117025117026117027117028117029117030117031117032117033117034117035117036117037117038117039117040117041117042117043117044117045117046117047117048117049117050117051117052117053117054117055117056117057117058117059117060117061117062117063117064117065117066117067117068117069117070117071117072117073117074117075117076117077117078117079117080117081117082117083117084117085117086117087117088117089117090117091117092117093117094117095117096117097117098117099117100117101117102117103117104117105117106117107117108117109117110117111117112117113117114117115117116117117117118117119117120117121117122117123117124117125117126117127117128117129117130117131117132117133117134117135117136117137117138117139117140117141117142117143117144117145117146117147117148117149117150117151117152117153117154117155117156117157117158117159117160117161117162117163117164117165117166117167117168117169117170117171117172117173117174117175117176117177117178117179117180117181117182117183117184117185117186117187117188117189117190117191117192117193117194117195117196117197117198117199117200117201117202117203117204117205117206117207117208117209117210117211117212117213117214117215117216117217117218117219117220117221117222117223117224117225117226117227117228117229117230117231117232117233117234117235117236117237117238117239117240117241117242117243117244117245117246117247117248117249117250117251117252117253117254117255117256117257117258117259117260117261117262117263117264117265117266117267117268117269117270117271117272117273117274117275117276117277117278117279117280117281117282117283117284117285117286117287117288117289117290117291117292117293117294117295117296117297117298117299117300117301117302117303117304117305117306117307117308117309117310117311117312117313117314117315117316117317117318117319117320117321117322117323117324117325117326117327117328117329117330117331117332117333117334117335117336117337117338117339117340117341117342117343117344117345117346117347117348117349117350117351117352117353117354117355117356117357117358117359117360117361117362117363117364117365117366117367117368117369117370117371117372117373117374117375117376117377117378117379117380117381117382117383117384117385117386117387117388117389117390117391117392117393117394117395117396117397117398117399117400117401117402117403117404117405117406117407117408117409117410117411117412117413117414117415117416117417117418117419117420117421117422117423117424117425117426117427117428117429117430117431117432117433117434117435117436117437117438117439117440117441117442117443117444117445117446117447117448117449117450117451117452117453117454117455117456117457117458117459117460117461117462117463117464117465117466117467117468117469117470117471117472117473117474117475117476117477117478117479117480117481117482117483117484117485117486117487117488117489117490117491117492117493117494117495117496117497117498117499117500117501117502117503117504117505117506117507117508117509117510117511117512117513117514117515117516117517117518117519117520117521117522117523117524117525117526117527117528117529117530117531117532117533117534117535117536117537117538117539117540117541117542117543117544117545117546117547117548117549117550117551117552117553117554117555117556117557117558117559117560117561117562117563117564117565117566117567117568117569117570117571117572117573117574117575117576117577117578117579117580117581117582117583117584117585117586117587117588117589117590117591117592117593117594117595117596117597117598117599117600117601117602117603117604117605117606117607117608117609117610117611117612117613117614117615117616117617117618117619117620117621117622117623117624117625117626117627117628117629117630117631117632117633117634117635117636117637117638117639117640117641117642117643117644117645117646117647117648117649117650117651117652117653117654117655117656117657117658117659117660117661117662117663117664117665117666117667117668117669117670117671117672117673117674117675117676117677117678117679117680117681117682117683117684117685117686117687117688117689117690117691117692117693117694117695117696117697117698117699117700117701117702117703117704117705117706117707117708117709117710117711117712117713117714117715117716117717117718117719117720117721117722117723117724117725117726117727117728117729117730117731117732117733117734117735117736117737117738117739117740117741117742117743117744117745117746117747117748117749117750117751117752117753117754117755117756117757117758117759117760117761117762117763117764117765117766117767117768117769117770117771117772117773117774117775117776117777117778117779117780117781117782117783117784117785117786117787117788117789117790117791117792117793117794117795117796117797117798117799117800117801117802117803117804117805117806117807117808117809117810117811117812117813117814117815117816117817117818117819117820117821117822117823117824117825117826117827117828117829117830117831117832117833117834117835117836117837117838117839117840117841117842117843117844117845117846117847117848117849117850117851117852117853117854117855117856117857117858117859117860117861117862117863117864117865117866117867117868117869117870117871117872117873117874117875117876117877117878117879117880117881117882117883117884117885117886117887117888117889117890117891117892117893117894117895117896117897117898117899117900117901117902117903117904117905117906117907117908117909117910117911117912117913117914117915117916117917117918117919117920117921117922117923117924117925117926117927117928117929117930117931117932117933117934117935117936117937117938117939117940117941117942117943117944117945117946117947117948117949117950117951117952117953117954117955117956117957117958117959117960117961117962117963117964117965117966117967117968117969117970117971117972117973117974117975117976117977117978117979117980117981117982117983117984117985117986117987117988117989117990117991117992117993117994117995117996117997117998117999118000118001118002118003118004118005118006118007118008118009118010118011118012118013118014118015118016118017118018118019118020118021118022118023118024118025118026118027118028118029118030118031118032118033118034118035118036118037118038118039118040118041118042118043118044118045118046118047118048118049118050118051118052118053118054118055118056118057118058118059118060118061118062118063118064118065118066118067118068118069118070118071118072118073118074118075118076118077118078118079118080118081118082118083118084118085118086118087118088118089118090118091118092118093118094118095118096118097118098118099118100118101118102118103118104118105118106118107118108118109118110118111118112118113118114118115118116118117118118118119118120118121118122118123118124118125118126118127118128118129118130118131118132118133118134118135118136118137118138118139118140118141118142118143118144118145118146118147118148118149118150118151118152118153118154118155118156118157118158118159118160118161118162118163118164118165118166118167118168118169118170118171118172118173118174118175118176118177118178118179118180118181118182118183118184118185118186118187118188118189118190118191118192118193118194118195118196118197118198118199118200118201118202118203118204118205118206118207118208118209118210118211118212118213118214118215118216118217118218118219118220118221118222118223118224118225118226118227118228118229118230118231118232118233118234118235118236118237118238118239118240118241118242118243118244118245118246118247118248118249118250118251118252118253118254118255118256118257118258118259118260118261118262118263118264118265118266118267118268118269118270118271118272118273118274118275118276118277118278118279118280118281118282118283118284118285118286118287118288118289118290118291118292118293118294118295118296118297118298118299118300118301118302118303118304118305118306118307118308118309118310118311118312118313118314118315118316118317118318118319118320118321118322118323118324118325118326118327118328118329118330118331118332118333118334118335118336118337118338118339118340118341118342118343118344118345118346118347118348118349118350118351118352118353118354118355118356118357118358118359118360118361118362118363118364118365118366118367118368118369118370118371118372118373118374118375118376118377118378118379118380118381118382118383118384118385118386118387118388118389118390118391118392118393118394118395118396118397118398118399118400118401118402118403118404118405118406118407118408118409118410118411118412118413118414118415118416118417118418118419118420118421118422118423118424118425118426118427118428118429118430118431118432118433118434118435118436118437118438118439118440118441118442118443118444118445118446118447118448118449118450118451118452118453118454118455118456118457118458118459118460118461118462118463118464118465118466118467118468118469118470118471118472118473118474118475118476118477118478118479118480118481118482118483118484118485118486118487118488118489118490118491118492118493118494118495118496118497118498118499118500118501118502118503118504118505118506118507118508118509118510118511118512118513118514118515118516118517118518118519118520118521118522118523118524118525118526118527118528118529118530118531118532118533118534118535118536118537118538118539118540118541118542118543118544118545118546118547118548118549118550118551118552118553118554118555118556118557118558118559118560118561118562118563118564118565118566118567118568118569118570118571118572118573118574118575118576118577118578118579118580118581118582118583118584118585118586118587118588118589118590118591118592118593118594118595118596118597118598118599118600118601118602118603118604118605118606118607118608118609118610118611118612118613118614118615118616118617118618118619118620118621118622118623118624118625118626118627118628118629118630118631118632118633118634118635118636118637118638118639118640118641118642118643118644118645118646118647118648118649118650118651118652118653118654118655118656118657118658118659118660118661118662118663118664118665118666118667118668118669118670118671118672118673118674118675118676118677118678118679118680118681118682118683118684118685118686118687118688118689118690118691118692118693118694118695118696118697118698118699118700118701118702118703118704118705118706118707118708118709118710118711118712118713118714118715118716118717118718118719118720118721118722118723118724118725118726118727118728118729118730118731118732118733118734118735118736118737118738118739118740118741118742118743118744118745118746118747118748118749118750118751118752118753118754118755118756118757118758118759118760118761118762118763118764118765118766118767118768118769118770118771118772118773118774118775118776118777118778118779118780118781118782118783118784118785118786118787118788118789118790118791118792118793118794118795118796118797118798118799118800118801118802118803118804118805118806118807118808118809118810118811118812118813118814118815118816118817118818118819118820118821118822118823118824118825118826118827118828118829118830118831118832118833118834118835118836118837118838118839118840118841118842118843118844118845118846118847118848118849118850118851118852118853118854118855118856118857118858118859118860118861118862118863118864118865118866118867118868118869118870118871118872118873118874118875118876118877118878118879118880118881118882118883118884118885118886118887118888118889118890118891118892118893118894118895118896118897118898118899118900118901118902118903118904118905118906118907118908118909118910118911118912118913118914118915118916118917118918118919118920118921118922118923118924118925118926118927118928118929118930118931118932118933118934118935118936118937118938118939118940118941118942118943118944118945118946118947118948118949118950118951118952118953118954118955118956118957118958118959118960118961118962118963118964118965118966118967118968118969118970118971118972118973118974118975118976118977118978118979118980118981118982118983118984118985118986118987118988118989118990118991118992118993118994118995118996118997118998118999119000119001119002119003119004119005119006119007119008119009119010119011119012119013119014119015119016119017119018119019119020119021119022119023119024119025119026119027119028119029119030119031119032119033119034119035119036119037119038119039119040119041119042119043119044119045119046119047119048119049119050119051119052119053119054119055119056119057119058119059119060119061119062119063119064119065119066119067119068119069119070119071119072119073119074119075119076119077119078119079119080119081119082119083119084119085119086119087119088119089119090119091119092119093119094119095119096119097119098119099119100119101119102119103119104119105119106119107119108119109119110119111119112119113119114119115119116119117119118119119119120119121119122119123119124119125119126119127119128119129119130119131119132119133119134119135119136119137119138119139119140119141119142119143119144119145119146119147119148119149119150119151119152119153119154119155119156119157119158119159119160119161119162119163119164119165119166119167119168119169119170119171119172119173119174119175119176119177119178119179119180119181119182119183119184119185119186119187119188119189119190119191119192119193119194119195119196119197119198119199119200119201119202119203119204119205119206119207119208119209119210119211119212119213119214119215119216119217119218119219119220119221119222119223119224119225119226119227119228119229119230119231119232119233119234119235119236119237119238119239119240119241119242119243119244119245119246119247119248119249119250119251119252119253119254119255119256119257119258119259119260119261119262119263119264119265119266119267119268119269119270119271119272119273119274119275119276119277119278119279119280119281119282119283119284119285119286119287119288119289119290119291119292119293119294119295119296119297119298119299119300119301119302119303119304119305119306119307119308119309119310119311119312119313119314119315119316119317119318119319119320119321119322119323119324119325119326119327119328119329119330119331119332119333119334119335119336119337119338119339119340119341119342119343119344119345119346119347119348119349119350119351119352119353119354119355119356119357119358119359119360119361119362119363119364119365119366119367119368119369119370119371119372119373119374119375119376119377119378119379119380119381119382119383119384119385119386119387119388119389119390119391119392119393119394119395119396119397119398119399119400119401119402119403119404119405119406119407119408119409119410119411119412119413119414119415119416119417119418119419119420119421119422119423119424119425119426119427119428119429119430119431119432119433119434119435119436119437119438119439119440119441119442119443119444119445119446119447119448119449119450119451119452119453119454119455119456119457119458119459119460119461119462119463119464119465119466119467119468119469119470119471119472119473119474119475119476119477119478119479119480119481119482119483119484119485119486119487119488119489119490119491119492119493119494119495119496119497119498119499119500119501119502119503119504119505119506119507119508119509119510119511119512119513119514119515119516119517119518119519119520119521119522119523119524119525119526119527119528119529119530119531119532119533119534119535119536119537119538119539119540119541119542119543119544119545119546119547119548119549119550119551119552119553119554119555119556119557119558119559119560119561119562119563119564119565119566119567119568119569119570119571119572119573119574119575119576119577119578119579119580119581119582119583119584119585119586119587119588119589119590119591119592119593119594119595119596119597119598119599119600119601119602119603119604119605119606119607119608119609119610119611119612119613119614119615119616119617119618119619119620119621119622119623119624119625119626119627119628119629119630119631119632119633119634119635119636119637119638119639119640119641119642119643119644119645119646119647119648119649119650119651119652119653119654119655119656119657119658119659119660119661119662119663119664119665119666119667119668119669119670119671119672119673119674119675119676119677119678119679119680119681119682119683119684119685119686119687119688119689119690119691119692119693119694119695119696119697119698119699119700119701119702119703119704119705119706119707119708119709119710119711119712119713119714119715119716119717119718119719119720119721119722119723119724119725119726119727119728119729119730119731119732119733119734119735119736119737119738119739119740119741119742119743119744119745119746119747119748119749119750119751119752119753119754119755119756119757119758119759119760119761119762119763119764119765119766119767119768119769119770119771119772119773119774119775119776119777119778119779119780119781119782119783119784119785119786119787119788119789119790119791119792119793119794119795119796119797119798119799119800119801119802119803119804119805119806119807119808119809119810119811119812119813119814119815119816119817119818119819119820119821119822119823119824119825119826119827119828119829119830119831119832119833119834119835119836119837119838119839119840119841119842119843119844119845119846119847119848119849119850119851119852119853119854119855119856119857119858119859119860119861119862119863119864119865119866119867119868119869119870119871119872119873119874119875119876119877119878119879119880119881119882119883119884119885119886119887119888119889119890119891119892119893119894119895119896119897119898119899119900119901119902119903119904119905119906119907119908119909119910119911119912119913119914119915119916119917119918119919119920119921119922119923119924119925119926119927119928119929119930119931119932119933119934119935119936119937119938119939119940119941119942119943119944119945119946119947119948119949119950119951119952119953119954119955119956119957119958119959119960119961119962119963119964119965119966119967119968119969119970119971119972119973119974119975119976119977119978119979119980119981119982119983119984119985119986119987119988119989119990119991119992119993119994119995119996119997119998119999120000120001120002120003120004120005120006120007120008120009120010120011120012120013120014120015120016120017120018120019120020120021120022120023120024120025120026120027120028120029120030120031120032120033120034120035120036120037120038120039120040120041120042120043120044120045120046120047120048120049120050120051120052120053120054120055120056120057120058120059120060120061120062120063120064120065120066120067120068120069120070120071120072120073120074120075120076120077120078120079120080120081120082120083120084120085120086120087120088120089120090120091120092120093120094120095120096120097120098120099120100120101120102120103120104120105120106120107120108120109120110120111120112120113120114120115120116120117120118120119120120120121120122120123120124120125120126120127120128120129120130120131120132120133120134120135120136120137120138120139120140120141120142120143120144120145120146120147120148120149120150120151120152120153120154120155120156120157120158120159120160120161120162120163120164120165120166120167120168120169120170120171120172120173120174120175120176120177120178120179120180120181120182120183120184120185120186120187120188120189120190120191120192120193120194120195120196120197120198120199120200120201120202120203120204120205120206120207120208120209120210120211120212120213120214120215120216120217120218120219120220120221120222120223120224120225120226120227120228120229120230120231120232120233120234120235120236120237120238120239120240120241120242120243120244120245120246120247120248120249120250120251120252120253120254120255120256120257120258120259120260120261120262120263120264120265120266120267120268120269120270120271120272120273120274120275120276120277120278120279120280120281120282120283120284120285120286120287120288120289120290120291120292120293120294120295120296120297120298120299120300120301120302120303120304120305120306120307120308120309120310120311120312120313120314120315120316120317120318120319120320120321120322120323120324120325120326120327120328120329120330120331120332120333120334120335120336120337120338120339120340120341120342120343120344120345120346120347120348120349120350120351120352120353120354120355120356120357120358120359120360120361120362120363120364120365120366120367120368120369120370120371120372120373120374120375120376120377120378120379120380120381120382120383120384120385120386120387120388120389120390120391120392120393120394120395120396120397120398120399120400120401120402120403120404120405120406120407120408120409120410120411120412120413120414120415120416120417120418120419120420120421120422120423120424120425120426120427120428120429120430120431120432120433120434120435120436120437120438120439120440120441120442120443120444120445120446120447120448120449120450120451120452120453120454120455120456120457120458120459120460120461120462120463120464120465120466120467120468120469120470120471120472120473120474120475120476120477120478120479120480120481120482120483120484120485120486120487120488120489120490120491120492120493120494120495120496120497120498120499120500120501120502120503120504120505120506120507120508120509120510120511120512120513120514120515120516120517120518120519120520120521120522120523120524120525120526120527120528120529120530120531120532120533120534120535120536120537120538120539120540120541120542120543120544120545120546120547120548120549120550120551120552120553120554120555120556120557120558120559120560120561120562120563120564120565120566120567120568120569120570120571120572120573120574120575120576120577120578120579120580120581120582120583120584120585120586120587120588120589120590120591120592120593120594120595120596120597120598120599120600120601120602120603120604120605120606120607120608120609120610120611120612120613120614120615120616120617120618120619120620120621120622120623120624120625120626120627120628120629120630120631120632120633120634120635120636120637120638120639120640120641120642120643120644120645120646120647120648120649120650120651120652120653120654120655120656120657120658120659120660120661120662120663120664120665120666120667120668120669120670120671120672120673120674120675120676120677120678120679120680120681120682120683120684120685120686120687120688120689120690120691120692120693120694120695120696120697120698120699120700120701120702120703120704120705120706120707120708120709120710120711120712120713120714120715120716120717120718120719120720120721120722120723120724120725120726120727120728120729120730120731120732120733120734120735120736120737120738120739120740120741120742120743120744120745120746120747120748120749120750120751120752120753120754120755120756120757120758120759120760120761120762120763120764120765120766120767120768120769120770120771120772120773120774120775120776120777120778120779120780120781120782120783120784120785120786120787120788120789120790120791120792120793120794120795120796120797120798120799120800120801120802120803120804120805120806120807120808120809120810120811120812120813120814120815120816120817120818120819120820120821120822120823120824120825120826120827120828120829120830120831120832120833120834120835120836120837120838120839120840120841120842120843120844120845120846120847120848120849120850120851120852120853120854120855120856120857120858120859120860120861120862120863120864120865120866120867120868120869120870120871120872120873120874120875120876120877120878120879120880120881120882120883120884120885120886120887120888120889120890120891120892120893120894120895120896120897120898120899120900120901120902120903120904120905120906120907120908120909120910120911120912120913120914120915120916120917120918120919120920120921120922120923120924120925120926120927120928120929120930120931120932120933120934120935120936120937120938120939120940120941120942120943120944120945120946120947120948120949120950120951120952120953120954120955120956120957120958120959120960120961120962120963120964120965120966120967120968120969120970120971120972120973120974120975120976120977120978120979120980120981120982120983120984120985120986120987120988120989120990120991120992120993120994120995120996120997120998120999121000121001121002121003121004121005121006121007121008121009121010121011121012121013121014121015121016121017121018121019121020121021121022121023121024121025121026121027121028121029121030121031121032121033121034121035121036121037121038121039121040121041121042121043121044121045121046121047121048121049121050121051121052121053121054121055121056121057121058121059121060121061121062121063121064121065121066121067121068121069121070121071121072121073121074121075121076121077121078121079121080121081121082121083121084121085121086121087121088121089121090121091121092121093121094121095121096121097121098121099121100121101121102121103121104121105121106121107121108121109121110121111121112121113121114121115121116121117121118121119121120121121121122121123121124121125121126121127121128121129121130121131121132121133121134121135121136121137121138121139121140121141121142121143121144121145121146121147121148121149121150121151121152121153121154121155121156121157121158121159121160121161121162121163121164121165121166121167121168121169121170121171121172121173121174121175121176121177121178121179121180121181121182121183121184121185121186121187121188121189121190121191121192121193121194121195121196121197121198121199121200121201121202121203121204121205121206121207121208121209121210121211121212121213121214121215121216121217121218121219121220121221121222121223121224121225121226121227121228121229121230121231121232121233121234121235121236121237121238121239121240121241121242121243121244121245121246121247121248121249121250121251121252121253121254121255121256121257121258121259121260121261121262121263121264121265121266121267121268121269121270121271121272121273121274121275121276121277121278121279121280121281121282121283121284121285121286121287121288121289121290121291121292121293121294121295121296121297121298121299121300121301121302121303121304121305121306121307121308121309121310121311121312121313121314121315121316121317121318121319121320121321121322121323121324121325121326121327121328121329121330121331121332121333121334121335121336121337121338121339121340121341121342121343121344121345121346121347121348121349121350121351121352121353121354121355121356121357121358121359121360121361121362121363121364121365121366121367121368121369121370121371121372121373121374121375121376121377121378121379121380121381121382121383121384121385121386121387121388121389121390121391121392121393121394121395121396121397121398121399121400121401121402121403121404121405121406121407121408121409121410121411121412121413121414121415121416121417121418121419121420121421121422121423121424121425121426121427121428121429121430121431121432121433121434121435121436121437121438121439121440121441121442121443121444121445121446121447121448121449121450121451121452121453121454121455121456121457121458121459121460121461121462121463121464121465121466121467121468121469121470121471121472121473121474121475121476121477121478121479121480121481121482121483121484121485121486121487121488121489121490121491121492121493121494121495121496121497121498121499121500121501121502121503121504121505121506121507121508121509121510121511121512121513121514121515121516121517121518121519121520121521121522121523121524121525121526121527121528121529121530121531121532121533121534121535121536121537121538121539121540121541121542121543121544121545121546121547121548121549121550121551121552121553121554121555121556121557121558121559121560121561121562121563121564121565121566121567121568121569121570121571121572121573121574121575121576121577121578121579121580121581121582121583121584121585121586121587121588121589121590121591121592121593121594121595121596121597121598121599121600121601121602121603121604121605121606121607121608121609121610121611121612121613121614121615121616121617121618121619121620121621121622121623121624121625121626121627121628121629121630121631121632121633121634121635121636121637121638121639121640121641121642121643121644121645121646121647121648121649121650121651121652121653121654121655121656121657121658121659121660121661121662121663121664121665121666121667121668121669121670121671121672121673121674121675121676121677121678121679121680121681121682121683121684121685121686121687121688121689121690121691121692121693121694121695121696121697121698121699121700121701121702121703121704121705121706121707121708121709121710121711121712121713121714121715121716121717121718121719121720121721121722121723121724121725121726121727121728121729121730121731121732121733121734121735121736121737121738121739121740121741121742121743121744121745121746121747121748121749121750121751121752121753121754121755121756121757121758121759121760121761121762121763121764121765121766121767121768121769121770121771121772121773121774121775121776121777121778121779121780121781121782121783121784121785121786121787121788121789121790121791121792121793121794121795121796121797121798121799121800121801121802121803121804121805121806121807121808121809121810121811121812121813121814121815121816121817121818121819121820121821121822121823121824121825121826121827121828121829121830121831121832121833121834121835121836121837121838121839121840121841121842121843121844121845121846121847121848121849121850121851121852121853121854121855121856121857121858121859121860121861121862121863121864121865121866121867121868121869121870121871121872121873121874121875121876121877121878121879121880121881121882121883121884121885121886121887121888121889121890121891121892121893121894121895121896121897121898121899121900121901121902121903121904121905121906121907121908121909121910121911121912121913121914121915121916121917121918121919121920121921121922121923121924121925121926121927121928121929121930121931121932121933121934121935121936121937121938121939121940121941121942121943121944121945121946121947121948121949121950121951121952121953121954121955121956121957121958121959121960121961121962121963121964121965121966121967121968121969121970121971121972121973121974121975121976121977121978121979121980121981121982121983121984121985121986121987121988121989121990121991121992121993121994121995121996121997121998121999122000122001122002122003122004122005122006122007122008122009122010122011122012122013122014122015122016122017122018122019122020122021122022122023122024122025122026122027122028122029122030122031122032122033122034122035122036122037122038122039122040122041122042122043122044122045122046122047122048122049122050122051122052122053122054122055122056122057122058122059122060122061122062122063122064122065122066122067122068122069122070122071122072122073122074122075122076122077122078122079122080122081122082122083122084122085122086122087122088122089122090122091122092122093122094122095122096122097122098122099122100122101122102122103122104122105122106122107122108122109122110122111122112122113122114122115122116122117122118122119122120122121122122122123122124122125122126122127122128122129122130122131122132122133122134122135122136122137122138122139122140122141122142122143122144122145122146122147122148122149122150122151122152122153122154122155122156122157122158122159122160122161122162122163122164122165122166122167122168122169122170122171122172122173122174122175122176122177122178122179122180122181122182122183122184122185122186122187122188122189122190122191122192122193122194122195122196122197122198122199122200122201122202122203122204122205122206122207122208122209122210122211122212122213122214122215122216122217122218122219122220122221122222122223122224122225122226122227122228122229122230122231122232122233122234122235122236122237122238122239122240122241122242122243122244122245122246122247122248122249122250122251122252122253122254122255122256122257122258122259122260122261122262122263122264122265122266122267122268122269122270122271122272122273122274122275122276122277122278122279122280122281122282122283122284122285122286122287122288122289122290122291122292122293122294122295122296122297122298122299122300122301122302122303122304122305122306122307122308122309122310122311122312122313122314122315122316122317122318122319122320122321122322122323122324122325122326122327122328122329122330122331122332122333122334122335122336122337122338122339122340122341122342122343122344122345122346122347122348122349122350122351122352122353122354122355122356122357122358122359122360122361122362122363122364122365122366122367122368122369122370122371122372122373122374122375122376122377122378122379122380122381122382122383122384122385122386122387122388122389122390122391122392122393122394122395122396122397122398122399122400122401122402122403122404122405122406122407122408122409122410122411122412122413122414122415122416122417122418122419122420122421122422122423122424122425122426122427122428122429122430122431122432122433122434122435122436122437122438122439122440122441122442122443122444122445122446122447122448122449122450122451122452122453122454122455122456122457122458122459122460122461122462122463122464122465122466122467122468122469122470122471122472122473122474122475122476122477122478122479122480122481122482122483122484122485122486122487122488122489122490122491122492122493122494122495122496122497122498122499122500122501122502122503122504122505122506122507122508122509122510122511122512122513122514122515122516122517122518122519122520122521122522122523122524122525122526122527122528122529122530122531122532122533122534122535122536122537122538122539122540122541122542122543122544122545122546122547122548122549122550122551122552122553122554122555122556122557122558122559122560122561122562122563122564122565122566122567122568122569122570122571122572122573122574122575122576122577122578122579122580122581122582122583122584122585122586122587122588122589122590122591122592122593122594122595122596122597122598122599122600122601122602122603122604122605122606122607122608122609122610122611122612122613122614122615122616122617122618122619122620122621122622122623122624122625122626122627122628122629122630122631122632122633122634122635122636122637122638122639122640122641122642122643122644122645122646122647122648122649122650122651122652122653122654122655122656122657122658122659122660122661122662122663122664122665122666122667122668122669122670122671122672122673122674122675122676122677122678122679122680122681122682122683122684122685122686122687122688122689122690122691122692122693122694122695122696122697122698122699122700122701122702122703122704122705122706122707122708122709122710122711122712122713122714122715122716122717122718122719122720122721122722122723122724122725122726122727122728122729122730122731122732122733122734122735122736122737122738122739122740122741122742122743122744122745122746122747122748122749122750122751122752122753122754122755122756122757122758122759122760122761122762122763122764122765122766122767122768122769122770122771122772122773122774122775122776122777122778122779122780122781122782122783122784122785122786122787122788122789122790122791122792122793122794122795122796122797122798122799122800122801122802122803122804122805122806122807122808122809122810122811122812122813122814122815122816122817122818122819122820122821122822122823122824122825122826122827122828122829122830122831122832122833122834122835122836122837122838122839122840122841122842122843122844122845122846122847122848122849122850122851122852122853122854122855122856122857122858122859122860122861122862122863122864122865122866122867122868122869122870122871122872122873122874122875122876122877122878122879122880122881122882122883122884122885122886122887122888122889122890122891122892122893122894122895122896122897122898122899122900122901122902122903122904122905122906122907122908122909122910122911122912122913122914122915122916122917122918122919122920122921122922122923122924122925122926122927122928122929122930122931122932122933122934122935122936122937122938122939122940122941122942122943122944122945122946122947122948122949122950122951122952122953122954122955122956122957122958122959122960122961122962122963122964122965122966122967122968122969122970122971122972122973122974122975122976122977122978122979122980122981122982122983122984122985122986122987122988122989122990122991122992122993122994122995122996122997122998122999123000123001123002123003123004123005123006123007123008123009123010123011123012123013123014123015123016123017123018123019123020123021123022123023123024123025123026123027123028123029123030123031123032123033123034123035123036123037123038123039123040123041123042123043123044123045123046123047123048123049123050123051123052123053123054123055123056123057123058123059123060123061123062123063123064123065123066123067123068123069123070123071123072123073123074123075123076123077123078123079123080123081123082123083123084123085123086123087123088123089123090123091123092123093123094123095123096123097123098123099123100123101123102123103123104123105123106123107123108123109123110123111123112123113123114123115123116123117123118123119123120123121123122123123123124123125123126123127123128123129123130123131123132123133123134123135123136123137123138123139123140123141123142123143123144123145123146123147123148123149123150123151123152123153123154123155123156123157123158123159123160123161123162123163123164123165123166123167123168123169123170123171123172123173123174123175123176123177123178123179123180123181123182123183123184123185123186123187123188123189123190123191123192123193123194123195123196123197123198123199123200123201123202123203123204123205123206123207123208123209123210123211123212123213123214123215123216123217123218123219123220123221123222123223123224123225123226123227123228123229123230123231123232123233123234123235123236123237123238123239123240123241123242123243123244123245123246123247123248123249123250123251123252123253123254123255123256123257123258123259123260123261123262123263123264123265123266123267123268123269123270123271123272123273123274123275123276123277123278123279123280123281123282123283123284123285123286123287123288123289123290123291123292123293123294123295123296123297123298123299123300123301123302123303123304123305123306123307123308123309123310123311123312123313123314123315123316123317123318123319123320123321123322123323123324123325123326123327123328123329123330123331123332123333123334123335123336123337123338123339123340123341123342123343123344123345123346123347123348123349123350123351123352123353123354123355123356123357123358123359123360123361123362123363123364123365123366123367123368123369123370123371123372123373123374123375123376123377123378123379123380123381123382123383123384123385123386123387123388123389123390123391123392123393123394123395123396123397123398123399123400123401123402123403123404123405123406123407123408123409123410123411123412123413123414123415123416123417123418123419123420123421123422123423123424123425123426123427123428123429123430123431123432123433123434123435123436123437123438123439123440123441123442123443123444123445123446123447123448123449123450123451123452123453123454123455123456123457123458123459123460123461123462123463123464123465123466123467123468123469123470123471123472123473123474123475123476123477123478123479123480123481123482123483123484123485123486123487123488123489123490123491123492123493123494123495123496123497123498123499123500123501123502123503123504123505123506123507123508123509123510123511123512123513123514123515123516123517123518123519123520123521123522123523123524123525123526123527123528123529123530123531123532123533123534123535123536123537123538123539123540123541123542123543123544123545123546123547123548123549123550123551123552123553123554123555123556123557123558123559123560123561123562123563123564123565123566123567123568123569123570123571123572123573123574123575123576123577123578123579123580123581123582123583123584123585123586123587123588123589123590123591123592123593123594123595123596123597123598123599123600123601123602123603123604123605123606123607123608123609123610123611123612123613123614123615123616123617123618123619123620123621123622123623123624123625123626123627123628123629123630123631123632123633123634123635123636123637123638123639123640123641123642123643123644123645123646123647123648123649123650123651123652123653123654123655123656123657123658123659123660123661123662123663123664123665123666123667123668123669123670123671123672123673123674123675123676123677123678123679123680123681123682123683123684123685123686123687123688123689123690123691123692123693123694123695123696123697123698123699123700123701123702123703123704123705123706123707123708123709123710123711123712123713123714123715123716123717123718123719123720123721123722123723123724123725123726123727123728123729123730123731123732123733123734123735123736123737123738123739123740123741123742123743123744123745123746123747123748123749123750123751123752123753123754123755123756123757123758123759123760123761123762123763123764123765123766123767123768123769123770123771123772123773123774123775123776123777123778123779123780123781123782123783123784123785123786123787123788123789123790123791123792123793123794123795123796123797123798123799123800123801123802123803123804123805123806123807123808123809123810123811123812123813123814123815123816123817123818123819123820123821123822123823123824123825123826123827123828123829123830123831123832123833123834123835123836123837123838123839123840123841123842123843123844123845123846123847123848123849123850123851123852123853123854123855123856123857123858123859123860123861123862123863123864123865123866123867123868123869123870123871123872123873123874123875123876123877123878123879123880123881123882123883123884123885123886123887123888123889123890123891123892123893123894123895123896123897123898123899123900123901123902123903123904123905123906123907123908123909123910123911123912123913123914123915123916123917123918123919123920123921123922123923123924123925123926123927123928123929123930123931123932123933123934123935123936123937123938123939123940123941123942123943123944123945123946123947123948123949123950123951123952123953123954123955123956123957123958123959123960123961123962123963123964123965123966123967123968123969123970123971123972123973123974123975123976123977123978123979123980123981123982123983123984123985123986123987123988123989123990123991123992123993123994123995123996123997123998123999124000124001124002124003124004124005124006124007124008124009124010124011124012124013124014124015124016124017124018124019124020124021124022124023124024124025124026124027124028124029124030124031124032124033124034124035124036124037124038124039124040124041124042124043124044124045124046124047124048124049124050124051124052124053124054124055124056124057124058124059124060124061124062124063124064124065124066124067124068124069124070124071124072124073124074124075124076124077124078124079124080124081124082124083124084124085124086124087124088124089124090124091124092124093124094124095124096124097124098124099124100124101124102124103124104124105124106124107124108124109124110124111124112124113124114124115124116124117124118124119124120124121124122124123124124124125124126124127124128124129124130124131124132124133124134124135124136124137124138124139124140124141124142124143124144124145124146124147124148124149124150124151124152124153124154124155124156124157124158124159124160124161124162124163124164124165124166124167124168124169124170124171124172124173124174124175124176124177124178124179124180124181124182124183124184124185124186124187124188124189124190124191124192124193124194124195124196124197124198124199124200124201124202124203124204124205124206124207124208124209124210124211124212124213124214124215124216124217124218124219124220124221124222124223124224124225124226124227124228124229124230124231124232124233124234124235124236124237124238124239124240124241124242124243124244124245124246124247124248124249124250124251124252124253124254124255124256124257124258124259124260124261124262124263124264124265124266124267124268124269124270124271124272124273124274124275124276124277124278124279124280124281124282124283124284124285124286124287124288124289124290124291124292124293124294124295124296124297124298124299124300124301124302124303124304124305124306124307124308124309124310124311124312124313124314124315124316124317124318124319124320124321124322124323124324124325124326124327124328124329124330124331124332124333124334124335124336124337124338124339124340124341124342124343124344124345124346124347124348124349124350124351124352124353124354124355124356124357124358124359124360124361124362124363124364124365124366124367124368124369124370124371124372124373124374124375124376124377124378124379124380124381124382124383124384124385124386124387124388124389124390124391124392124393124394124395124396124397124398124399124400124401124402124403124404124405124406124407124408124409124410124411124412124413124414124415124416124417124418124419124420124421124422124423124424124425124426124427124428124429124430124431124432124433124434124435124436124437124438124439124440124441124442124443124444124445124446124447124448124449124450124451124452124453124454124455124456124457124458124459124460124461124462124463124464124465124466124467124468124469124470124471124472124473124474124475124476124477124478124479124480124481124482124483124484124485124486124487124488124489124490124491124492124493124494124495124496124497124498124499124500124501124502124503124504124505124506124507124508124509124510124511124512124513124514124515124516124517124518124519124520124521124522124523124524124525124526124527124528124529124530124531124532124533124534124535124536124537124538124539124540124541124542124543124544124545124546124547124548124549124550124551124552124553124554124555124556124557124558124559124560124561124562124563124564124565124566124567124568124569124570124571124572124573124574124575124576124577124578124579124580124581124582124583124584124585124586124587124588124589124590124591124592124593124594124595124596124597124598124599124600124601124602124603124604124605124606124607124608124609124610124611124612124613124614124615124616124617124618124619124620124621124622124623124624124625124626124627124628124629124630124631124632124633124634124635124636124637124638124639124640124641124642124643124644124645124646124647124648124649124650124651124652124653124654124655124656124657124658124659124660124661124662124663124664124665124666124667124668124669124670124671124672124673124674124675124676124677124678124679124680124681124682124683124684124685124686124687124688124689124690124691124692124693124694124695124696124697124698124699124700124701124702124703124704124705124706124707124708124709124710124711124712124713124714124715124716124717124718124719124720124721124722124723124724124725124726124727124728124729124730124731124732124733124734124735124736124737124738124739124740124741124742124743124744124745124746124747124748124749124750124751124752124753124754124755124756124757124758124759124760124761124762124763124764124765124766124767124768124769124770124771124772124773124774124775124776124777124778124779124780124781124782124783124784124785124786124787124788124789124790124791124792124793124794124795124796124797124798124799124800124801124802124803124804124805124806124807124808124809124810124811124812124813124814124815124816124817124818124819124820124821124822124823124824124825124826124827124828124829124830124831124832124833124834124835124836124837124838124839124840124841124842124843124844124845124846124847124848124849124850124851124852124853124854124855124856124857124858124859124860124861124862124863124864124865124866124867124868124869124870124871124872124873124874124875124876124877124878124879124880124881124882124883124884124885124886124887124888124889124890124891124892124893124894124895124896124897124898124899124900124901124902124903124904124905124906124907124908124909124910124911124912124913124914124915124916124917124918124919124920124921124922124923124924124925124926124927124928124929124930124931124932124933124934124935124936124937124938124939124940124941124942124943124944124945124946124947124948124949124950124951124952124953124954124955124956124957124958124959124960124961124962124963124964124965124966124967124968124969124970124971124972124973124974124975124976124977124978124979124980124981124982124983124984124985124986124987124988124989124990124991124992124993124994124995124996124997124998124999125000125001125002125003125004125005125006125007125008125009125010125011125012125013125014125015125016125017125018125019125020125021125022125023125024125025125026125027125028125029125030125031125032125033125034125035125036125037125038125039125040125041125042125043125044125045125046125047125048125049125050125051125052125053125054125055125056125057125058125059125060125061125062125063125064125065125066125067125068125069125070125071125072125073125074125075125076125077125078125079125080125081125082125083125084125085125086125087125088125089125090125091125092125093125094125095125096125097125098125099125100125101125102125103125104125105125106125107125108125109125110125111125112125113125114125115125116125117125118125119125120125121125122125123125124125125125126125127125128125129125130125131125132125133125134125135125136125137125138125139125140125141125142125143125144125145125146125147125148125149125150125151125152125153125154125155125156125157125158125159125160125161125162125163125164125165125166125167125168125169125170125171125172125173125174125175125176125177125178125179125180125181125182125183125184125185125186125187125188125189125190125191125192125193125194125195125196125197125198125199125200125201125202125203125204125205125206125207125208125209125210125211125212125213125214125215125216125217125218125219125220125221125222125223125224125225125226125227125228125229125230125231125232125233125234125235125236125237125238125239125240125241125242125243125244125245125246125247125248125249125250125251125252125253125254125255125256125257125258125259125260125261125262125263125264125265125266125267125268125269125270125271125272125273125274125275125276125277125278125279125280125281125282125283125284125285125286125287125288125289125290125291125292125293125294125295125296125297125298125299125300125301125302125303125304125305125306125307125308125309125310125311125312125313125314125315125316125317125318125319125320125321125322125323125324125325125326125327125328125329125330125331125332125333125334125335125336125337125338125339125340125341125342125343125344125345125346125347125348125349125350125351125352125353125354125355125356125357125358125359125360125361125362125363125364125365125366125367125368125369125370125371125372125373125374125375125376125377125378125379125380125381125382125383125384125385125386125387125388125389125390125391125392125393125394125395125396125397125398125399125400125401125402125403125404125405125406125407125408125409125410125411125412125413125414125415125416125417125418125419125420125421125422125423125424125425125426125427125428125429125430125431125432125433125434125435125436125437125438125439125440125441125442125443125444125445125446125447125448125449125450125451125452125453125454125455125456125457125458125459125460125461125462125463125464125465125466125467125468125469125470125471125472125473125474125475125476125477125478125479125480125481125482125483125484125485125486125487125488125489125490125491125492125493125494125495125496125497125498125499125500125501125502125503125504125505125506125507125508125509125510125511125512125513125514125515125516125517125518125519125520125521125522125523125524125525125526125527125528125529125530125531125532125533125534125535125536125537125538125539125540125541125542125543125544125545125546125547125548125549125550125551125552125553125554125555125556125557125558125559125560125561125562125563125564125565125566125567125568125569125570125571125572125573125574125575125576125577125578125579125580125581125582125583125584125585125586125587125588125589125590125591125592125593125594125595125596125597125598125599125600125601125602125603125604125605125606125607125608125609125610125611125612125613125614125615125616125617125618125619125620125621125622125623125624125625125626125627125628125629125630125631125632125633125634125635125636125637125638125639125640125641125642125643125644125645125646125647125648125649125650125651125652125653125654125655125656125657125658125659125660125661125662125663125664125665125666125667125668125669125670125671125672125673125674125675125676125677125678125679125680125681125682125683125684125685125686125687125688125689125690125691125692125693125694125695125696125697125698125699125700125701125702125703125704125705125706125707125708125709125710125711125712125713125714125715125716125717125718125719125720125721125722125723125724125725125726125727125728125729125730125731125732125733125734125735125736125737125738125739125740125741125742125743125744125745125746125747125748125749125750125751125752125753125754125755125756125757125758125759125760125761125762125763125764125765125766125767125768125769125770125771125772125773125774125775125776125777125778125779125780125781125782125783125784125785125786125787125788125789125790125791125792125793125794125795125796125797125798125799125800125801125802125803125804125805125806125807125808125809125810125811125812125813125814125815125816125817125818125819125820125821125822125823125824125825125826125827125828125829125830125831125832125833125834125835125836125837125838125839125840125841125842125843125844125845125846125847125848125849125850125851125852125853125854125855125856125857125858125859125860125861125862125863125864125865125866125867125868125869125870125871125872125873125874125875125876125877125878125879125880125881125882125883125884125885125886125887125888125889125890125891125892125893125894125895125896125897125898125899125900125901125902125903125904125905125906125907125908125909125910125911125912125913125914125915125916125917125918125919125920125921125922125923125924125925125926125927125928125929125930125931125932125933125934125935125936125937125938125939125940125941125942125943125944125945125946125947125948125949125950125951125952125953125954125955125956125957125958125959125960125961125962125963125964125965125966125967125968125969125970125971125972125973125974125975125976125977125978125979125980125981125982125983125984125985125986125987125988125989125990125991125992125993125994125995125996125997125998125999126000126001126002126003126004126005126006126007126008126009126010126011126012126013126014126015126016126017126018126019126020126021126022126023126024126025126026126027126028126029126030126031126032126033126034126035126036126037126038126039126040126041126042126043126044126045126046126047126048126049126050126051126052126053126054126055126056126057126058126059126060126061126062126063126064126065126066126067126068126069126070126071126072126073126074126075126076126077126078126079126080126081126082126083126084126085126086126087126088126089126090126091126092126093126094126095126096126097126098126099126100126101126102126103126104126105126106126107126108126109126110126111126112126113126114126115126116126117126118126119126120126121126122126123126124126125126126126127126128126129126130126131126132126133126134126135126136126137126138126139126140126141126142126143126144126145126146126147126148126149126150126151126152126153126154126155126156126157126158126159126160126161126162126163126164126165126166126167126168126169126170126171126172126173126174126175126176126177126178126179126180126181126182126183126184126185126186126187126188126189126190126191126192126193126194126195126196126197126198126199126200126201126202126203126204126205126206126207126208126209126210126211126212126213126214126215126216126217126218126219126220126221126222126223126224126225126226126227126228126229126230126231126232126233126234126235126236126237126238126239126240126241126242126243126244126245126246126247126248126249126250126251126252126253126254126255126256126257126258126259126260126261126262126263126264126265126266126267126268126269126270126271126272126273126274126275126276126277126278126279126280126281126282126283126284126285126286126287126288126289126290126291126292126293126294126295126296126297126298126299126300126301126302126303126304126305126306126307126308126309126310126311126312126313126314126315126316126317126318126319126320126321126322126323126324126325126326126327126328126329126330126331126332126333126334126335126336126337126338126339126340126341126342126343126344126345126346126347126348126349126350126351126352126353126354126355126356126357126358126359126360126361126362126363126364126365126366126367126368126369126370126371126372126373126374126375126376126377126378126379126380126381126382126383126384126385126386126387126388126389126390126391126392126393126394126395126396126397126398126399126400126401126402126403126404126405126406126407126408126409126410126411126412126413126414126415126416126417126418126419126420126421126422126423126424126425126426126427126428126429126430126431126432126433126434126435126436126437126438126439126440126441126442126443126444126445126446126447126448126449126450126451126452126453126454126455126456126457126458126459126460126461126462126463126464126465126466126467126468126469126470126471126472126473126474126475126476126477126478126479126480126481126482126483126484126485126486126487126488126489126490126491126492126493126494126495126496126497126498126499126500126501126502126503126504126505126506126507126508126509126510126511126512126513126514126515126516126517126518126519126520126521126522126523126524126525126526126527126528126529126530126531126532126533126534126535126536126537126538126539126540126541126542126543126544126545126546126547126548126549126550126551126552126553126554126555126556126557126558126559126560126561126562126563126564126565126566126567126568126569126570126571126572126573126574126575126576126577126578126579126580126581126582126583126584126585126586126587126588126589126590126591126592126593126594126595126596126597126598126599126600126601126602126603126604126605126606126607126608126609126610126611126612126613126614126615126616126617126618126619126620126621126622126623126624126625126626126627126628126629126630126631126632126633126634126635126636126637126638126639126640126641126642126643126644126645126646126647126648126649126650126651126652126653126654126655126656126657126658126659126660126661126662126663126664126665126666126667126668126669126670126671126672126673126674126675126676126677126678126679126680126681126682126683126684126685126686126687126688126689126690126691126692126693126694126695126696126697126698126699126700126701126702126703126704126705126706126707126708126709126710126711126712126713126714126715126716126717126718126719126720126721126722126723126724126725126726126727126728126729126730126731126732126733126734126735126736126737126738126739126740126741126742126743126744126745126746126747126748126749126750126751126752126753126754126755126756126757126758126759126760126761126762126763126764126765126766126767126768126769126770126771126772126773126774126775126776126777126778126779126780126781126782126783126784126785126786126787126788126789126790126791126792126793126794126795126796126797126798126799126800126801126802126803126804126805126806126807126808126809126810126811126812126813126814126815126816126817126818126819126820126821126822126823126824126825126826126827126828126829126830126831126832126833126834126835126836126837126838126839126840126841126842126843126844126845126846126847126848126849126850126851126852126853126854126855126856126857126858126859126860126861126862126863126864126865126866126867126868126869126870126871126872126873126874126875126876126877126878126879126880126881126882126883126884126885126886126887126888126889126890126891126892126893126894126895126896126897126898126899126900126901126902126903126904126905126906126907126908126909126910126911126912126913126914126915126916126917126918126919126920126921126922126923126924126925126926126927126928126929126930126931126932126933126934126935126936126937126938126939126940126941126942126943126944126945126946126947126948126949126950126951126952126953126954126955126956126957126958126959126960126961126962126963126964126965126966126967126968126969126970126971126972126973126974126975126976126977126978126979126980126981126982126983126984126985126986126987126988126989126990126991126992126993126994126995126996126997126998126999127000127001127002127003127004127005127006127007127008127009127010127011127012127013127014127015127016127017127018127019127020127021127022127023127024127025127026127027127028127029127030127031127032127033127034127035127036127037127038127039127040127041127042127043127044127045127046127047127048127049127050127051127052127053127054127055127056127057127058127059127060127061127062127063127064127065127066127067127068127069127070127071127072127073127074127075127076127077127078127079127080127081127082127083127084127085127086127087127088127089127090127091127092127093127094127095127096127097127098127099127100127101127102127103127104127105127106127107127108127109127110127111127112127113127114127115127116127117127118127119127120127121127122127123127124127125127126127127127128127129127130127131127132127133127134127135127136127137127138127139127140127141127142127143127144127145127146127147127148127149127150127151127152127153127154127155127156127157127158127159127160127161127162127163127164127165127166127167127168127169127170127171127172127173127174127175127176127177127178127179127180127181127182127183127184127185127186127187127188127189127190127191127192127193127194127195127196127197127198127199127200127201127202127203127204127205127206127207127208127209127210127211127212127213127214127215127216127217127218127219127220127221127222127223127224127225127226127227127228127229127230127231127232127233127234127235127236127237127238127239127240127241127242127243127244127245127246127247127248127249127250127251127252127253127254127255127256127257127258127259127260127261127262127263127264127265127266127267127268127269127270127271127272127273127274127275127276127277127278127279127280127281127282127283127284127285127286127287127288127289127290127291127292127293127294127295127296127297127298127299127300127301127302127303127304127305127306127307127308127309127310127311127312127313127314127315127316127317127318127319127320127321127322127323127324127325127326127327127328127329127330127331127332127333127334127335127336127337127338127339127340127341127342127343127344127345127346127347127348127349127350127351127352127353127354127355127356127357127358127359127360127361127362127363127364127365127366127367127368127369127370127371127372127373127374127375127376127377127378127379127380127381127382127383127384127385127386127387127388127389127390127391127392127393127394127395127396127397127398127399127400127401127402127403127404127405127406127407127408127409127410127411127412127413127414127415127416127417127418127419127420127421127422127423127424127425127426127427127428127429127430127431127432127433127434127435127436127437127438127439127440127441127442127443127444127445127446127447127448127449127450127451127452127453127454127455127456127457127458127459127460127461127462127463127464127465127466127467127468127469127470127471127472127473127474127475127476127477127478127479127480127481127482127483127484127485127486127487127488127489127490127491127492127493127494127495127496127497127498127499127500127501127502127503127504127505127506127507127508127509127510127511127512127513127514127515127516127517127518127519127520127521127522127523127524127525127526127527127528127529127530127531127532127533127534127535127536127537127538127539127540127541127542127543127544127545127546127547127548127549127550127551127552127553127554127555127556127557127558127559127560127561127562127563127564127565127566127567127568127569127570127571127572127573127574127575127576127577127578127579127580127581127582127583127584127585127586127587127588127589127590127591127592127593127594127595127596127597127598127599127600127601127602127603127604127605127606127607127608127609127610127611127612127613127614127615127616127617127618127619127620127621127622127623127624127625127626127627127628127629127630127631127632127633127634127635127636127637127638127639127640127641127642127643127644127645127646127647127648127649127650127651127652127653127654127655127656127657127658127659127660127661127662127663127664127665127666127667127668127669127670127671127672127673127674127675127676127677127678127679127680127681127682127683127684127685127686127687127688127689127690127691127692127693127694127695127696127697127698127699127700127701127702127703127704127705127706127707127708127709127710127711127712127713127714127715127716127717127718127719127720127721127722127723127724127725127726127727127728127729127730127731127732127733127734127735127736127737127738127739127740127741127742127743127744127745127746127747127748127749127750127751127752127753127754127755127756127757127758127759127760127761127762127763127764127765127766127767127768127769127770127771127772127773127774127775127776127777127778127779127780127781127782127783127784127785127786127787127788127789127790127791127792127793127794127795127796127797127798127799127800127801127802127803127804127805127806127807127808127809127810127811127812127813127814127815127816127817127818127819127820127821127822127823127824127825127826127827127828127829127830127831127832127833127834127835127836127837127838127839127840127841127842127843127844127845127846127847127848127849127850127851127852127853127854127855127856127857127858127859127860127861127862127863127864127865127866127867127868127869127870127871127872127873127874127875127876127877127878127879127880127881127882127883127884127885127886127887127888127889127890127891127892127893127894127895127896127897127898127899127900127901127902127903127904127905127906127907127908127909127910127911127912127913127914127915127916127917127918127919127920127921127922127923127924127925127926127927127928127929127930127931127932127933127934127935127936127937127938127939127940127941127942127943127944127945127946127947127948127949127950127951127952127953127954127955127956127957127958127959127960127961127962127963127964127965127966127967127968127969127970127971127972127973127974127975127976127977127978127979127980127981127982127983127984127985127986127987127988127989127990127991127992127993127994127995127996127997127998127999128000128001128002128003128004128005128006128007128008128009128010128011128012128013128014128015128016128017128018128019128020128021128022128023128024128025128026128027128028128029128030128031128032128033128034128035128036128037128038128039128040128041128042128043128044128045128046128047128048128049128050128051128052128053128054128055128056128057128058128059128060128061128062128063128064128065128066128067128068128069128070128071128072128073128074128075128076128077128078128079128080128081128082128083128084128085128086128087128088128089128090128091128092128093128094128095128096128097128098128099128100128101128102128103128104128105128106128107128108128109128110128111128112128113128114128115128116128117128118128119128120128121128122128123128124128125128126128127128128128129128130128131128132128133128134128135128136128137128138128139128140128141128142128143128144128145128146128147128148128149128150128151128152128153128154128155128156128157128158128159128160128161128162128163128164128165128166128167128168128169128170128171128172128173128174128175128176128177128178128179128180128181128182128183128184128185128186128187128188128189128190128191128192128193128194128195128196128197128198128199128200128201128202128203128204128205128206128207128208128209128210128211128212128213128214128215128216128217128218128219128220128221128222128223128224128225128226128227128228128229128230128231128232128233128234128235128236128237128238128239128240128241128242128243128244128245128246128247128248128249128250128251128252128253128254128255128256128257128258128259128260128261128262128263128264128265128266128267128268128269128270128271128272128273128274128275128276128277128278128279128280128281128282128283128284128285128286128287128288128289128290128291128292128293128294128295128296128297128298128299128300128301128302128303128304128305128306128307128308128309128310128311128312128313128314128315128316128317128318128319128320128321128322128323128324128325128326128327128328128329128330128331128332128333128334128335128336128337128338128339128340128341128342128343128344128345128346128347128348128349128350128351128352128353128354128355128356128357128358128359128360128361128362128363128364128365128366128367128368128369128370128371128372128373128374128375128376128377128378128379128380128381128382128383128384128385128386128387128388128389128390128391128392128393128394128395128396128397128398128399128400128401128402128403128404128405128406128407128408128409128410128411128412128413128414128415128416128417128418128419128420128421128422128423128424128425128426128427128428128429128430128431128432128433128434128435128436128437128438128439128440128441128442128443128444128445128446128447128448128449128450128451128452128453128454128455128456128457128458128459128460128461128462128463128464128465128466128467128468128469128470128471128472128473128474128475128476128477128478128479128480128481128482128483128484128485128486128487128488128489128490128491128492128493128494128495128496128497128498128499128500128501128502128503128504128505128506128507128508128509128510128511128512128513128514128515128516128517128518128519128520128521128522128523128524128525128526128527128528128529128530128531128532128533128534128535128536128537128538128539128540128541128542128543128544128545128546128547128548128549128550128551128552128553128554128555128556128557128558128559128560128561128562128563128564128565128566128567128568128569128570128571128572128573128574128575128576128577128578128579128580128581128582128583128584128585128586128587128588128589128590128591128592128593128594128595128596128597128598128599128600128601128602128603128604128605128606128607128608128609128610128611128612128613128614128615128616128617128618128619128620128621128622128623128624128625128626128627128628128629128630128631128632128633128634128635128636128637128638128639128640128641128642128643128644128645128646128647128648128649128650128651128652128653128654128655128656128657128658128659128660128661128662128663128664128665128666128667128668128669128670128671128672128673128674128675128676128677128678128679128680128681128682128683128684128685128686128687128688128689128690128691128692128693128694128695128696128697128698128699128700128701128702128703128704128705128706128707128708128709128710128711128712128713128714128715128716128717128718128719128720128721128722128723128724128725128726128727128728128729128730128731128732128733128734128735128736128737128738128739128740128741128742128743128744128745128746128747128748128749128750128751128752128753128754128755128756128757128758128759128760128761128762128763128764128765128766128767128768128769128770128771128772128773128774128775128776128777128778128779128780128781128782128783128784128785128786128787128788128789128790128791128792128793128794128795128796128797128798128799128800128801128802128803128804128805128806128807128808128809128810128811128812128813128814128815128816128817128818128819128820128821128822128823128824128825128826128827128828128829128830128831128832128833128834128835128836128837128838128839128840128841128842128843128844128845128846128847128848128849128850128851128852128853128854128855128856128857128858128859128860128861128862128863128864128865128866128867128868128869128870128871128872128873128874128875128876128877128878128879128880128881128882128883128884128885128886128887128888128889128890128891128892128893128894128895128896128897128898128899128900128901128902128903128904128905128906128907128908128909128910128911128912128913128914128915128916128917128918128919128920128921128922128923128924128925128926128927128928128929128930128931128932128933128934128935128936128937128938128939128940128941128942128943128944128945128946128947128948128949128950128951128952128953128954128955128956128957128958128959128960128961128962128963128964128965128966128967128968128969128970128971128972128973128974128975128976128977128978128979128980128981128982128983128984128985128986128987128988128989128990128991128992128993128994128995128996128997128998128999129000129001129002129003129004129005129006129007129008129009129010129011129012129013129014129015129016129017129018129019129020129021129022129023129024129025129026129027129028129029129030129031129032129033129034129035129036129037129038129039129040129041129042129043129044129045129046129047129048129049129050129051129052129053129054129055129056129057129058129059129060129061129062129063129064129065129066129067129068129069129070129071129072129073129074129075129076129077129078129079129080129081129082129083129084129085129086129087129088129089129090129091129092129093129094129095129096129097129098129099129100129101129102129103129104129105129106129107129108129109129110129111129112129113129114129115129116129117129118129119129120129121129122129123129124129125129126129127129128129129129130129131129132129133129134129135129136129137129138129139129140129141129142129143129144129145129146129147129148129149129150129151129152129153129154129155129156129157129158129159129160129161129162129163129164129165129166129167129168129169129170129171129172129173129174129175129176129177129178129179129180129181129182129183129184129185129186129187129188129189129190129191129192129193129194129195129196129197129198129199129200129201129202129203129204129205129206129207129208129209129210129211129212129213129214129215129216129217129218129219129220129221129222129223129224129225129226129227129228129229129230129231129232129233129234129235129236129237129238129239129240129241129242129243129244129245129246129247129248129249129250129251129252129253129254129255129256129257129258129259129260129261129262129263129264129265129266129267129268129269129270129271129272129273129274129275129276129277129278129279129280129281129282129283129284129285129286129287129288129289129290129291129292129293129294129295129296129297129298129299129300129301129302129303129304129305129306129307129308129309129310129311129312129313129314129315129316129317129318129319129320129321129322129323129324129325129326129327129328129329129330129331129332129333129334129335129336129337129338129339129340129341129342129343129344129345129346129347129348129349129350129351129352129353129354129355129356129357129358129359129360129361129362129363129364129365129366129367129368129369129370129371129372129373129374129375129376129377129378129379129380129381129382129383129384129385129386129387129388129389129390129391129392129393129394129395129396129397129398129399129400129401129402129403129404129405129406129407129408129409129410129411129412129413129414129415129416129417129418129419129420129421129422129423129424129425129426129427129428129429129430129431129432129433129434129435129436129437129438129439129440129441129442129443129444129445129446129447129448129449129450129451129452129453129454129455129456129457129458129459129460129461129462129463129464129465129466129467129468129469129470129471129472129473129474129475129476129477129478129479129480129481129482129483129484129485129486129487129488129489129490129491129492129493129494129495129496129497129498129499129500129501129502129503129504129505129506129507129508129509129510129511129512129513129514129515129516129517129518129519129520129521129522129523129524129525129526129527129528129529129530129531129532129533129534129535129536129537129538129539129540129541129542129543129544129545129546129547129548129549129550129551129552129553129554129555129556129557129558129559129560129561129562129563129564129565129566129567129568129569129570129571129572129573129574129575129576129577129578129579129580129581129582129583129584129585129586129587129588129589129590129591129592129593129594129595129596129597129598129599129600129601129602129603129604129605129606129607129608129609129610129611129612129613129614129615129616129617129618129619129620129621129622129623129624129625129626129627129628129629129630129631129632129633129634129635129636129637129638129639129640129641129642129643129644129645129646129647129648129649129650129651129652129653129654129655129656129657129658129659129660129661129662129663129664129665129666129667129668129669129670129671129672129673129674129675129676129677129678129679129680129681129682129683129684129685129686129687129688129689129690129691129692129693129694129695129696129697129698129699129700129701129702129703129704129705129706129707129708129709129710129711129712129713129714129715129716129717129718129719129720129721129722129723129724129725129726129727129728129729129730129731129732129733129734129735129736129737129738129739129740129741129742129743129744129745129746129747129748129749129750129751129752129753129754129755129756129757129758129759129760129761129762129763129764129765129766129767129768129769129770129771129772129773129774129775129776129777129778129779129780129781129782129783129784129785129786129787129788129789129790129791129792129793129794129795129796129797129798129799129800129801129802129803129804129805129806129807129808129809129810129811129812129813129814129815129816129817129818129819129820129821129822129823129824129825129826129827129828129829129830129831129832129833129834129835129836129837129838129839129840129841129842129843129844129845129846129847129848129849129850129851129852129853129854129855129856129857129858129859129860129861129862129863129864129865129866129867129868129869129870129871129872129873129874129875129876129877129878129879129880129881129882129883129884129885129886129887129888129889129890129891129892129893129894129895129896129897129898129899129900129901129902129903129904129905129906129907129908129909129910129911129912129913129914129915129916129917129918129919129920129921129922129923129924129925129926129927129928129929129930129931129932129933129934129935129936129937129938129939129940129941129942129943129944129945129946129947129948129949129950129951129952129953129954129955129956129957129958129959129960129961129962129963129964129965129966129967129968129969129970129971129972129973129974129975129976129977129978129979129980129981129982129983129984129985129986129987129988129989129990129991129992129993129994129995129996129997129998129999130000130001130002130003130004130005130006130007130008130009130010130011130012130013130014130015130016130017130018130019130020130021130022130023130024130025130026130027130028130029130030130031130032130033130034130035130036130037130038130039130040130041130042130043130044130045130046130047130048130049130050130051130052130053130054130055130056130057130058130059130060130061130062130063130064130065130066130067130068130069130070130071130072130073130074130075130076130077130078130079130080130081130082130083130084130085130086130087130088130089130090130091130092130093130094130095130096130097130098130099130100130101130102130103130104130105130106130107130108130109130110130111130112130113130114130115130116130117130118130119130120130121130122130123130124130125130126130127130128130129130130130131130132130133130134130135130136130137130138130139130140130141130142130143130144130145130146130147130148130149130150130151130152130153130154130155130156130157130158130159130160130161130162130163130164130165130166130167130168130169130170130171130172130173130174130175130176130177130178130179130180130181130182130183130184130185130186130187130188130189130190130191130192130193130194130195130196130197130198130199130200130201130202130203130204130205130206130207130208130209130210130211130212130213130214130215130216130217130218130219130220130221130222130223130224130225130226130227130228130229130230130231130232130233130234130235130236130237130238130239130240130241130242130243130244130245130246130247130248130249130250130251130252130253130254130255130256130257130258130259130260130261130262130263130264130265130266130267130268130269130270130271130272130273130274130275130276130277130278130279130280130281130282130283130284130285130286130287130288130289130290130291130292130293130294130295130296130297130298130299130300130301130302130303130304130305130306130307130308130309130310130311130312130313130314130315130316130317130318130319130320130321130322130323130324130325130326130327130328130329130330130331130332130333130334130335130336130337130338130339130340130341130342130343130344130345130346130347130348130349130350130351130352130353130354130355130356130357130358130359130360130361130362130363130364130365130366130367130368130369130370130371130372130373130374130375130376130377130378130379130380130381130382130383130384130385130386130387130388130389130390130391130392130393130394130395130396130397130398130399130400130401130402130403130404130405130406130407130408130409130410130411130412130413130414130415130416130417130418130419130420130421130422130423130424130425130426130427130428130429130430130431130432130433130434130435130436130437130438130439130440130441130442130443130444130445130446130447130448130449130450130451130452130453130454130455130456130457130458130459130460130461130462130463130464130465130466130467130468130469130470130471130472130473130474130475130476130477130478130479130480130481130482130483130484130485130486130487130488130489130490130491130492130493130494130495130496130497130498130499130500130501130502130503130504130505130506130507130508130509130510130511130512130513130514130515130516130517130518130519130520130521130522130523130524130525130526130527130528130529130530130531130532130533130534130535130536130537130538130539130540130541130542130543130544130545130546130547130548130549130550130551130552130553130554130555130556130557130558130559130560130561130562130563130564130565130566130567130568130569130570130571130572130573130574130575130576130577130578130579130580130581130582130583130584130585130586130587130588130589130590130591130592130593130594130595130596130597130598130599130600130601130602130603130604130605130606130607130608130609130610130611130612130613130614130615130616130617130618130619130620130621130622130623130624130625130626130627130628130629130630130631130632130633130634130635130636130637130638130639130640130641130642130643130644130645130646130647130648130649130650130651130652130653130654130655130656130657130658130659130660130661130662130663130664130665130666130667130668130669130670130671130672130673130674130675130676130677130678130679130680130681130682130683130684130685130686130687130688130689130690130691130692130693130694130695130696130697130698130699130700130701130702130703130704130705130706130707130708130709130710130711130712130713130714130715130716130717130718130719130720130721130722130723130724130725130726130727130728130729130730130731130732130733130734130735130736130737130738130739130740130741130742130743130744130745130746130747130748130749130750130751130752130753130754130755130756130757130758130759130760130761130762130763130764130765130766130767130768130769130770130771130772130773130774130775130776130777130778130779130780130781130782130783130784130785130786130787130788130789130790130791130792130793130794130795130796130797130798130799130800130801130802130803130804130805130806130807130808130809130810130811130812130813130814130815130816130817130818130819130820130821130822130823130824130825130826130827130828130829130830130831130832130833130834130835130836130837130838130839130840130841130842130843130844130845130846130847130848130849130850130851130852130853130854130855130856130857130858130859130860130861130862130863130864130865130866130867130868130869130870130871130872130873130874130875130876130877130878130879130880130881130882130883130884130885130886130887130888130889130890130891130892130893130894130895130896130897130898130899130900130901130902130903130904130905130906130907130908130909130910130911130912130913130914130915130916130917130918130919130920130921130922130923130924130925130926130927130928130929130930130931130932130933130934130935130936130937130938130939130940130941130942130943130944130945130946130947130948130949130950130951130952130953130954130955130956130957130958130959130960130961130962130963130964130965130966130967130968130969130970130971130972130973130974130975130976130977130978130979130980130981130982130983130984130985130986130987130988130989130990130991130992130993130994130995130996130997130998130999131000131001131002131003131004131005131006131007131008131009131010131011131012131013131014131015131016131017131018131019131020131021131022131023131024131025131026131027131028131029131030131031131032131033131034131035131036131037131038131039131040131041131042131043131044131045131046131047131048131049131050131051131052131053131054131055131056131057131058131059131060131061131062131063131064131065131066131067131068131069131070131071131072131073131074131075131076131077131078131079131080131081131082131083131084131085131086131087131088131089131090131091131092131093131094131095131096131097131098131099131100131101131102131103131104131105131106131107131108131109131110131111131112131113131114131115131116131117131118131119131120131121131122131123131124131125131126131127131128131129131130131131131132131133131134131135131136131137131138131139131140131141131142131143131144131145131146131147131148131149131150131151131152131153131154131155131156131157131158131159131160131161131162131163131164131165131166131167131168131169131170131171131172131173131174131175131176131177131178131179131180131181131182131183131184131185131186131187131188131189131190131191131192131193131194131195131196131197131198131199131200131201131202131203131204131205131206131207131208131209131210131211131212131213131214131215131216131217131218131219131220131221131222131223131224131225131226131227131228131229131230131231131232131233131234131235131236131237131238131239131240131241131242131243131244131245131246131247131248131249131250131251131252131253131254131255131256131257131258131259131260131261131262131263131264131265131266131267131268131269131270131271131272131273131274131275131276131277131278131279131280131281131282131283131284131285131286131287131288131289131290131291131292131293131294131295131296131297131298131299131300131301131302131303131304131305131306131307131308131309131310131311131312131313131314131315131316131317131318131319131320131321131322131323131324131325131326131327131328131329131330131331131332131333131334131335131336131337131338131339131340131341131342131343131344131345131346131347131348131349131350131351131352131353131354131355131356131357131358131359131360131361131362131363131364131365131366131367131368131369131370131371131372131373131374131375131376131377131378131379131380131381131382131383131384131385131386131387131388131389131390131391131392131393131394131395131396131397131398131399131400131401131402131403131404131405131406131407131408131409131410131411131412131413131414131415131416131417131418131419131420131421131422131423131424131425131426131427131428131429131430131431131432131433131434131435131436131437131438131439131440131441131442131443131444131445131446131447131448131449131450131451131452131453131454131455131456131457131458131459131460131461131462131463131464131465131466131467131468131469131470131471131472131473131474131475131476131477131478131479131480131481131482131483131484131485131486131487131488131489131490131491131492131493131494131495131496131497131498131499131500131501131502131503131504131505131506131507131508131509131510131511131512131513131514131515131516131517131518131519131520131521131522131523131524131525131526131527131528131529131530131531131532131533131534131535131536131537131538131539131540131541131542131543131544131545131546131547131548131549131550131551131552131553131554131555131556131557131558131559131560131561131562131563131564131565131566131567131568131569131570131571131572131573131574131575131576131577131578131579131580131581131582131583131584131585131586131587131588131589131590131591131592131593131594131595131596131597131598131599131600131601131602131603131604131605131606131607131608131609131610131611131612131613131614131615131616131617131618131619131620131621131622131623131624131625131626131627131628131629131630131631131632131633131634131635131636131637131638131639131640131641131642131643131644131645131646131647131648131649131650131651131652131653131654131655131656131657131658131659131660131661131662131663131664131665131666131667131668131669131670131671131672131673131674131675131676131677131678131679131680131681131682131683131684131685131686131687131688131689131690131691131692131693131694131695131696131697131698131699131700131701131702131703131704131705131706131707131708131709131710131711131712131713131714131715131716131717131718131719131720131721131722131723131724131725131726131727131728131729131730131731131732131733131734131735131736131737131738131739131740131741131742131743131744131745131746131747131748131749131750131751131752131753131754131755131756131757131758131759131760131761131762131763131764131765131766131767131768131769131770131771131772131773131774131775131776131777131778131779131780131781131782131783131784131785131786131787131788131789131790131791131792131793131794131795131796131797131798131799131800131801131802131803131804131805131806131807131808131809131810131811131812131813131814131815131816131817131818131819131820131821131822131823131824131825131826131827131828131829131830131831131832131833131834131835131836131837131838131839131840131841131842131843131844131845131846131847131848131849131850131851131852131853131854131855131856131857131858131859131860131861131862131863131864131865131866131867131868131869131870131871131872131873131874131875131876131877131878131879131880131881131882131883131884131885131886131887131888131889131890131891131892131893131894131895131896131897131898131899131900131901131902131903131904131905131906131907131908131909131910131911131912131913131914131915131916131917131918131919131920131921131922131923131924131925131926131927131928131929131930131931131932131933131934131935131936131937131938131939131940131941131942131943131944131945131946131947131948131949131950131951131952131953131954131955131956131957131958131959131960131961131962131963131964131965131966131967131968131969131970131971131972131973131974131975131976131977131978131979131980131981131982131983131984131985131986131987131988131989131990131991131992131993131994131995131996131997131998131999132000132001132002132003132004132005132006132007132008132009132010132011132012132013132014132015132016132017132018132019132020132021132022132023132024132025132026132027132028132029132030132031132032132033132034132035132036132037132038132039132040132041132042132043132044132045132046132047132048132049132050132051132052132053132054132055132056132057132058132059132060132061132062132063132064132065132066132067132068132069132070132071132072132073132074132075132076132077132078132079132080132081132082132083132084132085132086132087132088132089132090132091132092132093132094132095132096132097132098132099132100132101132102132103132104132105132106132107132108132109132110132111132112132113132114132115132116132117132118132119132120132121132122132123132124132125132126132127132128132129132130132131132132132133132134132135132136132137132138132139132140132141132142132143132144132145132146132147132148132149132150132151132152132153132154132155132156132157132158132159132160132161132162132163132164132165132166132167132168132169132170132171132172132173132174132175132176132177132178132179132180132181132182132183132184132185132186132187132188132189132190132191132192132193132194132195132196132197132198132199132200132201132202132203132204132205132206132207132208132209132210132211132212132213132214132215132216132217132218132219132220132221132222132223132224132225132226132227132228132229132230132231132232132233132234132235132236132237132238132239132240132241132242132243132244132245132246132247132248132249132250132251132252132253132254132255132256132257132258132259132260132261132262132263132264132265132266132267132268132269132270132271132272132273132274132275132276132277132278132279132280132281132282132283132284132285132286132287132288132289132290132291132292132293132294132295132296132297132298132299132300132301132302132303132304132305132306132307132308132309132310132311132312132313132314132315132316132317132318132319132320132321132322132323132324132325132326132327132328132329132330132331132332132333132334132335132336132337132338132339132340132341132342132343132344132345132346132347132348132349132350132351132352132353132354132355132356132357132358132359132360132361132362132363132364132365132366132367132368132369132370132371132372132373132374132375132376132377132378132379132380132381132382132383132384132385132386132387132388132389132390132391132392132393132394132395132396132397132398132399132400132401132402132403132404132405132406132407132408132409132410132411132412132413132414132415132416132417132418132419132420132421132422132423132424132425132426132427132428132429132430132431132432132433132434132435132436132437132438132439132440132441132442132443132444132445132446132447132448132449132450132451132452132453132454132455132456132457132458132459132460132461132462132463132464132465132466132467132468132469132470132471132472132473132474132475132476132477132478132479132480132481132482132483132484132485132486132487132488132489132490132491132492132493132494132495132496132497132498132499132500132501132502132503132504132505132506132507132508132509132510132511132512132513132514132515132516132517132518132519132520132521132522132523132524132525132526132527132528132529132530132531132532132533132534132535132536132537132538132539132540132541132542132543132544132545132546132547132548132549132550132551132552132553132554132555132556132557132558132559132560132561132562132563132564132565132566132567132568132569132570132571132572132573132574132575132576132577132578132579132580132581132582132583132584132585132586132587132588132589132590132591132592132593132594132595132596132597132598132599132600132601132602132603132604132605132606132607132608132609132610132611132612132613132614132615132616132617132618132619132620132621132622132623132624132625132626132627132628132629132630132631132632132633132634132635132636132637132638132639132640132641132642132643132644132645132646132647132648132649132650132651132652132653132654132655132656132657132658132659132660132661132662132663132664132665132666132667132668132669132670132671132672132673132674132675132676132677132678132679132680132681132682132683132684132685132686132687132688132689132690132691132692132693132694132695132696132697132698132699132700132701132702132703132704132705132706132707132708132709132710132711132712132713132714132715132716132717132718132719132720132721132722132723132724132725132726132727132728132729132730132731132732132733132734132735132736132737132738132739132740132741132742132743132744132745132746132747132748132749132750132751132752132753132754132755132756132757132758132759132760132761132762132763132764132765132766132767132768132769132770132771132772132773132774132775132776132777132778132779132780132781132782132783132784132785132786132787132788132789132790132791132792132793132794132795132796132797132798132799132800132801132802132803132804132805132806132807132808132809132810132811132812132813132814132815132816132817132818132819132820132821132822132823132824132825132826132827132828132829132830132831132832132833132834132835132836132837132838132839132840132841132842132843132844132845132846132847132848132849132850132851132852132853132854132855132856132857132858132859132860132861132862132863132864132865132866132867132868132869132870132871132872132873132874132875132876132877132878132879132880132881132882132883132884132885132886132887132888132889132890132891132892132893132894132895132896132897132898132899132900132901132902132903132904132905132906132907132908132909132910132911132912132913132914132915132916132917132918132919132920132921132922132923132924132925132926132927132928132929132930132931132932132933132934132935132936132937132938132939132940132941132942132943132944132945132946132947132948132949132950132951132952132953132954132955132956132957132958132959132960132961132962132963132964132965132966132967132968132969132970132971132972132973132974132975132976132977132978132979132980132981132982132983132984132985132986132987132988132989132990132991132992132993132994132995132996132997132998132999133000133001133002133003133004133005133006133007133008133009133010133011133012133013133014133015133016133017133018133019133020133021133022133023133024133025133026133027133028133029133030133031133032133033133034133035133036133037133038133039133040133041133042133043133044133045133046133047133048133049133050133051133052133053133054133055133056133057133058133059133060133061133062133063133064133065133066133067133068133069133070133071133072133073133074133075133076133077133078133079133080133081133082133083133084133085133086133087133088133089133090133091133092133093133094133095133096133097133098133099133100133101133102133103133104133105133106133107133108133109133110133111133112133113133114133115133116133117133118133119133120133121133122133123133124133125133126133127133128133129133130133131133132133133133134133135133136133137133138133139133140133141133142133143133144133145133146133147133148133149133150133151133152133153133154133155133156133157133158133159133160133161133162133163133164133165133166133167133168133169133170133171133172133173133174133175133176133177133178133179133180133181133182133183133184133185133186133187133188133189133190133191133192133193133194133195133196133197133198133199133200133201133202133203133204133205133206133207133208133209133210133211133212133213133214133215133216133217133218133219133220133221133222133223133224133225133226133227133228133229133230133231133232133233133234133235133236133237133238133239133240133241133242133243133244133245133246133247133248133249133250133251133252133253133254133255133256133257133258133259133260133261133262133263133264133265133266133267133268133269133270133271133272133273133274133275133276133277133278133279133280133281133282133283133284133285133286133287133288133289133290133291133292133293133294133295133296133297133298133299133300133301133302133303133304133305133306133307133308133309133310133311133312133313133314133315133316133317133318133319133320133321133322133323133324133325133326133327133328133329133330133331133332133333133334133335133336133337133338133339133340133341133342133343133344133345133346133347133348133349133350133351133352133353133354133355133356133357133358133359133360133361133362133363133364133365133366133367133368133369133370133371133372133373133374133375133376133377133378133379133380133381133382133383133384133385133386133387133388133389133390133391133392133393133394133395133396133397133398133399133400133401133402133403133404133405133406133407133408133409133410133411133412133413133414133415133416133417133418133419133420133421133422133423133424133425133426133427133428133429133430133431133432133433133434133435133436133437133438133439133440133441133442133443133444133445133446133447133448133449133450133451133452133453133454133455133456133457133458133459133460133461133462133463133464133465133466133467133468133469133470133471133472133473133474133475133476133477133478133479133480133481133482133483133484133485133486133487133488133489133490133491133492133493133494133495133496133497133498133499133500133501133502133503133504133505133506133507133508133509133510133511133512133513133514133515133516133517133518133519133520133521133522133523133524133525133526133527133528133529133530133531133532133533133534133535133536133537133538133539133540133541133542133543133544133545133546133547133548133549133550133551133552133553133554133555133556133557133558133559133560133561133562133563133564133565133566133567133568133569133570133571133572133573133574133575133576133577133578133579133580133581133582133583133584133585133586133587133588133589133590133591133592133593133594133595133596133597133598133599133600133601133602133603133604133605133606133607133608133609133610133611133612133613133614133615133616133617133618133619133620133621133622133623133624133625133626133627133628133629133630133631133632133633133634133635133636133637133638133639133640133641133642133643133644133645133646133647133648133649133650133651133652133653133654133655133656133657133658133659133660133661133662133663133664133665133666133667133668133669133670133671133672133673133674133675133676133677133678133679133680133681133682133683133684133685133686133687133688133689133690133691133692133693133694133695133696133697133698133699133700133701133702133703133704133705133706133707133708133709133710133711133712133713133714133715133716133717133718133719133720133721133722133723133724133725133726133727133728133729133730133731133732133733133734133735133736133737133738133739133740133741133742133743133744133745133746133747133748133749133750133751133752133753133754133755133756133757133758133759133760133761133762133763133764133765133766133767133768133769133770133771133772133773133774133775133776133777133778133779133780133781133782133783133784133785133786133787133788133789133790133791133792133793133794133795133796133797133798133799133800133801133802133803133804133805133806133807133808133809133810133811133812133813133814133815133816133817133818133819133820133821133822133823133824133825133826133827133828133829133830133831133832133833133834133835133836133837133838133839133840133841133842133843133844133845133846133847133848133849133850133851133852133853133854133855133856133857133858133859133860133861133862133863133864133865133866133867133868133869133870133871133872133873133874133875133876133877133878133879133880133881133882133883133884133885133886133887133888133889133890133891133892133893133894133895133896133897133898133899133900133901133902133903133904133905133906133907133908133909133910133911133912133913133914133915133916133917133918133919133920133921133922133923133924133925133926133927133928133929133930133931133932133933133934133935133936133937133938133939133940133941133942133943133944133945133946133947133948133949133950133951133952133953133954133955133956133957133958133959133960133961133962133963133964133965133966133967133968133969133970133971133972133973133974133975133976133977133978133979133980133981133982133983133984133985133986133987133988133989133990133991133992133993133994133995133996133997133998133999134000134001134002134003134004134005134006134007134008134009134010134011134012134013134014134015134016134017134018134019134020134021134022134023134024134025134026134027134028134029134030134031134032134033134034134035134036134037134038134039134040134041134042134043134044134045134046134047134048134049134050134051134052134053134054134055134056134057134058134059134060134061134062134063134064134065134066134067134068134069134070134071134072134073134074134075134076134077134078134079134080134081134082134083134084134085134086134087134088134089134090134091134092134093134094134095134096134097134098134099134100134101134102134103134104134105134106134107134108134109134110134111134112134113134114134115134116134117134118134119134120134121134122134123134124134125134126134127134128134129134130134131134132134133134134134135134136134137134138134139134140134141134142134143134144134145134146134147134148134149134150134151134152134153134154134155134156134157134158134159134160134161134162134163134164134165134166134167134168134169134170134171134172134173134174134175134176134177134178134179134180134181134182134183134184134185134186134187134188134189134190134191134192134193134194134195134196134197134198134199134200134201134202134203134204134205134206134207134208134209134210134211134212134213134214134215134216134217134218134219134220134221134222134223134224134225134226134227134228134229134230134231134232134233134234134235134236134237134238134239134240134241134242134243134244134245134246134247134248134249134250134251134252134253134254134255134256134257134258134259134260134261134262134263134264134265134266134267134268134269134270134271134272134273134274134275134276134277134278134279134280134281134282134283134284134285134286134287134288134289134290134291134292134293134294134295134296134297134298134299134300134301134302134303134304134305134306134307134308134309134310134311134312134313134314134315134316134317134318134319134320134321134322134323134324134325134326134327134328134329134330134331134332134333134334134335134336134337134338134339134340134341134342134343134344134345134346134347134348134349134350134351134352134353134354134355134356134357134358134359134360134361134362134363134364134365134366134367134368134369134370134371134372134373134374134375134376134377134378134379134380134381134382134383134384134385134386134387134388134389134390134391134392134393134394134395134396134397134398134399134400134401134402134403134404134405134406134407134408134409134410134411134412134413134414134415134416134417134418134419134420134421134422134423134424134425134426134427134428134429134430134431134432134433134434134435134436134437134438134439134440134441134442134443134444134445134446134447134448134449134450134451134452134453134454134455134456134457134458134459134460134461134462134463134464134465134466134467134468134469134470134471134472134473134474134475134476134477134478134479134480134481134482134483134484134485134486134487134488134489134490134491134492134493134494134495134496134497134498134499134500134501134502134503134504134505134506134507134508134509134510134511134512134513134514134515134516134517134518134519134520134521134522134523134524134525134526134527134528134529134530134531134532134533134534134535134536134537134538134539134540134541134542134543134544134545134546134547134548134549134550134551134552134553134554134555134556134557134558134559134560134561134562134563134564134565134566134567134568134569134570134571134572134573134574134575134576134577134578134579134580134581134582134583134584134585134586134587134588134589134590134591134592134593134594134595134596134597134598134599134600134601134602134603134604134605134606134607134608134609134610134611134612134613134614134615134616134617134618134619134620134621134622134623134624134625134626134627134628134629134630134631134632134633134634134635134636134637134638134639134640134641134642134643134644134645134646134647134648134649134650134651134652134653134654134655134656134657134658134659134660134661134662134663134664134665134666134667134668134669134670134671134672134673134674134675134676134677134678134679134680134681134682134683134684134685134686134687134688134689134690134691134692134693134694134695134696134697134698134699134700134701134702134703134704134705134706134707134708134709134710134711134712134713134714134715134716134717134718134719134720134721134722134723134724134725134726134727134728134729134730134731134732134733134734134735134736134737134738134739134740134741134742134743134744134745134746134747134748134749134750134751134752134753134754134755134756134757134758134759134760134761134762134763134764134765134766134767134768134769134770134771134772134773134774134775134776134777134778134779134780134781134782134783134784134785134786134787134788134789134790134791134792134793134794134795134796134797134798134799134800134801134802134803134804134805134806134807134808134809134810134811134812134813134814134815134816134817134818134819134820134821134822134823134824134825134826134827134828134829134830134831134832134833134834134835134836134837134838134839134840134841134842134843134844134845134846134847134848134849134850134851134852134853134854134855134856134857134858134859134860134861134862134863134864134865134866134867134868134869134870134871134872134873134874134875134876134877134878134879134880134881134882134883134884134885134886134887134888134889134890134891134892134893134894134895134896134897134898134899134900134901134902134903134904134905134906134907134908134909134910134911134912134913134914134915134916134917134918134919134920134921134922134923134924134925134926134927134928134929134930134931134932134933134934134935134936134937134938134939134940134941134942134943134944134945134946134947134948134949134950134951134952134953134954134955134956134957134958134959134960134961134962134963134964134965134966134967134968134969134970134971134972134973134974134975134976134977134978134979134980134981134982134983134984134985134986134987134988134989134990134991134992134993134994134995134996134997134998134999135000135001135002135003135004135005135006135007135008135009135010135011135012135013135014135015135016135017135018135019135020135021135022135023135024135025135026135027135028135029135030135031135032135033135034135035135036135037135038135039135040135041135042135043135044135045135046135047135048135049135050135051135052135053135054135055135056135057135058135059135060135061135062135063135064135065135066135067135068135069135070135071135072135073135074135075135076135077135078135079135080135081135082135083135084135085135086135087135088135089135090135091135092135093135094135095135096135097135098135099135100135101135102135103135104135105135106135107135108135109135110135111135112135113135114135115135116135117135118135119135120135121135122135123135124135125135126135127135128135129135130135131135132135133135134135135135136135137135138135139135140135141135142135143135144135145135146135147135148135149135150135151135152135153135154135155135156135157135158135159135160135161135162135163135164135165135166135167135168135169135170135171135172135173135174135175135176135177135178135179135180135181135182135183135184135185135186135187135188135189135190135191135192135193135194135195135196135197135198135199135200135201135202135203135204135205135206135207135208135209135210135211135212135213135214135215135216135217135218135219135220135221135222135223135224135225135226135227135228135229135230135231135232135233135234135235135236135237135238135239135240135241135242135243135244135245135246135247135248135249135250135251135252135253135254135255135256135257135258135259135260135261135262135263135264135265135266135267135268135269135270135271135272135273135274135275135276135277135278135279135280135281135282135283135284135285135286135287135288135289135290135291135292135293135294135295135296135297135298135299135300135301135302135303135304135305135306135307135308135309135310135311135312135313135314135315135316135317135318135319135320135321135322135323135324135325135326135327135328135329135330135331135332135333135334135335135336135337135338135339135340135341135342135343135344135345135346135347135348135349135350135351135352135353135354135355135356135357135358135359135360135361135362135363135364135365135366135367135368135369135370135371135372135373135374135375135376135377135378135379135380135381135382135383135384135385135386135387135388135389135390135391135392135393135394135395135396135397135398135399135400135401135402135403135404135405135406135407135408135409135410135411135412135413135414135415135416135417135418135419135420135421135422135423135424135425135426135427135428135429135430135431135432135433135434135435135436135437135438135439135440135441135442135443135444135445135446135447135448135449135450135451135452135453135454135455135456135457135458135459135460135461135462135463135464135465135466135467135468135469135470135471135472135473135474135475135476135477135478135479135480135481135482135483135484135485135486135487135488135489135490135491135492135493135494135495135496135497135498135499135500135501135502135503135504135505135506135507135508135509135510135511135512135513135514135515135516135517135518135519135520135521135522135523135524135525135526135527135528135529135530135531135532135533135534135535135536135537135538135539135540135541135542135543135544135545135546135547135548135549135550135551135552135553135554135555135556135557135558135559135560135561135562135563135564135565135566135567135568135569135570135571135572135573135574135575135576135577135578135579135580135581135582135583135584135585135586135587135588135589135590135591135592135593135594135595135596135597135598135599135600135601135602135603135604135605135606135607135608135609135610135611135612135613135614135615135616135617135618135619135620135621135622135623135624135625135626135627135628135629135630135631135632135633135634135635135636135637135638135639135640135641135642135643135644135645135646135647135648135649135650135651135652135653135654135655135656135657135658135659135660135661135662135663135664135665135666135667135668135669135670135671135672135673135674135675135676135677135678135679135680135681135682135683135684135685135686135687135688135689135690135691135692135693135694135695135696135697135698135699135700135701135702135703135704135705135706135707135708135709135710135711135712135713135714135715135716135717135718135719135720135721135722135723135724135725135726135727135728135729135730135731135732135733135734135735135736135737135738135739135740135741135742135743135744135745135746135747135748135749135750135751135752135753135754135755135756135757135758135759135760135761135762135763135764135765135766135767135768135769135770135771135772135773135774135775135776135777135778135779135780135781135782135783135784135785135786135787135788135789135790135791135792135793135794135795135796135797135798135799135800135801135802135803135804135805135806135807135808135809135810135811135812135813135814135815135816135817135818135819135820135821135822135823135824135825135826135827135828135829135830135831135832135833135834135835135836135837135838135839135840135841135842135843135844135845135846135847135848135849135850135851135852135853135854135855135856135857135858135859135860135861135862135863135864135865135866135867135868135869135870135871135872135873135874135875135876135877135878135879135880135881135882135883135884135885135886135887135888135889135890135891135892135893135894135895135896135897135898135899135900135901135902135903135904135905135906135907135908135909135910135911135912135913135914135915135916135917135918135919135920135921135922135923135924135925135926135927135928135929135930135931135932135933135934135935135936135937135938135939135940135941135942135943135944135945135946135947135948135949135950135951135952135953135954135955135956135957135958135959135960135961135962135963135964135965135966135967135968135969135970135971135972135973135974135975135976135977135978135979135980135981135982135983135984135985135986135987135988135989135990135991135992135993135994135995135996135997135998135999136000136001136002136003136004136005136006136007136008136009136010136011136012136013136014136015136016136017136018136019136020136021136022136023136024136025136026136027136028136029136030136031136032136033136034136035136036136037136038136039136040136041136042136043136044136045136046136047136048136049136050136051136052136053136054136055136056136057136058136059136060136061136062136063136064136065136066136067136068136069136070136071136072136073136074136075136076136077136078136079136080136081136082136083136084136085136086136087136088136089136090136091136092136093136094136095136096136097136098136099136100136101136102136103136104136105136106136107136108136109136110136111136112136113136114136115136116136117136118136119136120136121136122136123136124136125136126136127136128136129136130136131136132136133136134136135136136136137136138136139136140136141136142136143136144136145136146136147136148136149136150136151136152136153136154136155136156136157136158136159136160136161136162136163136164136165136166136167136168136169136170136171136172136173136174136175136176136177136178136179136180136181136182136183136184136185136186136187136188136189136190136191136192136193136194136195136196136197136198136199136200136201136202136203136204136205136206136207136208136209136210136211136212136213136214136215136216136217136218136219136220136221136222136223136224136225136226136227136228136229136230136231136232136233136234136235136236136237136238136239136240136241136242136243136244136245136246136247136248136249136250136251136252136253136254136255136256136257136258136259136260136261136262136263136264136265136266136267136268136269136270136271136272136273136274136275136276136277136278136279136280136281136282136283136284136285136286136287136288136289136290136291136292136293136294136295136296136297136298136299136300136301136302136303136304136305136306136307136308136309136310136311136312136313136314136315136316136317136318136319136320136321136322136323136324136325136326136327136328136329136330136331136332136333136334136335136336136337136338136339136340136341136342136343136344136345136346136347136348136349136350136351136352136353136354136355136356136357136358136359136360136361136362136363136364136365136366136367136368136369136370136371136372136373136374136375136376136377136378136379136380136381136382136383136384136385136386136387136388136389136390136391136392136393136394136395136396136397136398136399136400136401136402136403136404136405136406136407136408136409136410136411136412136413136414136415136416136417136418136419136420136421136422136423136424136425136426136427136428136429136430136431136432136433136434136435136436136437136438136439136440136441136442136443136444136445136446136447136448136449136450136451136452136453136454136455136456136457136458136459136460136461136462136463136464136465136466136467136468136469136470136471136472136473136474136475136476136477136478136479136480136481136482136483136484136485136486136487136488136489136490136491136492136493136494136495136496136497136498136499136500136501136502136503136504136505136506136507136508136509136510136511136512136513136514136515136516136517136518136519136520136521136522136523136524136525136526136527136528136529136530136531136532136533136534136535136536136537136538136539136540136541136542136543136544136545136546136547136548136549136550136551136552136553136554136555136556136557136558136559136560136561136562136563136564136565136566136567136568136569136570136571136572136573136574136575136576136577136578136579136580136581136582136583136584136585136586136587136588136589136590136591136592136593136594136595136596136597136598136599136600136601136602136603136604136605136606136607136608136609136610136611136612136613136614136615136616136617136618136619136620136621136622136623136624136625136626136627136628136629136630136631136632136633136634136635136636136637136638136639136640136641136642136643136644136645136646136647136648136649136650136651136652136653136654136655136656136657136658136659136660136661136662136663136664136665136666136667136668136669136670136671136672136673136674136675136676136677136678136679136680136681136682136683136684136685136686136687136688136689136690136691136692136693136694136695136696136697136698136699136700136701136702136703136704136705136706136707136708136709136710136711136712136713136714136715136716136717136718136719136720136721136722136723136724136725136726136727136728136729136730136731136732136733136734136735136736136737136738136739136740136741136742136743136744136745136746136747136748136749136750136751136752136753136754136755136756136757136758136759136760136761136762136763136764136765136766136767136768136769136770136771136772136773136774136775136776136777136778136779136780136781136782136783136784136785136786136787136788136789136790136791136792136793136794136795136796136797136798136799136800136801136802136803136804136805136806136807136808136809136810136811136812136813136814136815136816136817136818136819136820136821136822136823136824136825136826136827136828136829136830136831136832136833136834136835136836136837136838136839136840136841136842136843136844136845136846136847136848136849136850136851136852136853136854136855136856136857136858136859136860136861136862136863136864136865136866136867136868136869136870136871136872136873136874136875136876136877136878136879136880136881136882136883136884136885136886136887136888136889136890136891136892136893136894136895136896136897136898136899136900136901136902136903136904136905136906136907136908136909136910136911136912136913136914136915136916136917136918136919136920136921136922136923136924136925136926136927136928136929136930136931136932136933136934136935136936136937136938136939136940136941136942136943136944136945136946136947136948136949136950136951136952136953136954136955136956136957136958136959136960136961136962136963136964136965136966136967136968136969136970136971136972136973136974136975136976136977136978136979136980136981136982136983136984136985136986136987136988136989136990136991136992136993136994136995136996136997136998136999137000137001137002137003137004137005137006137007137008137009137010137011137012137013137014137015137016137017137018137019137020137021137022137023137024137025137026137027137028137029137030137031137032137033137034137035137036137037137038137039137040137041137042137043137044137045137046137047137048137049137050137051137052137053137054137055137056137057137058137059137060137061137062137063137064137065137066137067137068137069137070137071137072137073137074137075137076137077137078137079137080137081137082137083137084137085137086137087137088137089137090137091137092137093137094137095137096137097137098137099137100137101137102137103137104137105137106137107137108137109137110137111137112137113137114137115137116137117137118137119137120137121137122137123137124137125137126137127137128137129137130137131137132137133137134137135137136137137137138137139137140137141137142137143137144137145137146137147137148137149137150137151137152137153137154137155137156137157137158137159137160137161137162137163137164137165137166137167137168137169137170137171137172137173137174137175137176137177137178137179137180137181137182137183137184137185137186137187137188137189137190137191137192137193137194137195137196137197137198137199137200137201137202137203137204137205137206137207137208137209137210137211137212137213137214137215137216137217137218137219137220137221137222137223137224137225137226137227137228137229137230137231137232137233137234137235137236137237137238137239137240137241137242137243137244137245137246137247137248137249137250137251137252137253137254137255137256137257137258137259137260137261137262137263137264137265137266137267137268137269137270137271137272137273137274137275137276137277137278137279137280137281137282137283137284137285137286137287137288137289137290137291137292137293137294137295137296137297137298137299137300137301137302137303137304137305137306137307137308137309137310137311137312137313137314137315137316137317137318137319137320137321137322137323137324137325137326137327137328137329137330137331137332137333137334137335137336137337137338137339137340137341137342137343137344137345137346137347137348137349137350137351137352137353137354137355137356137357137358137359137360137361137362137363137364137365137366137367137368137369137370137371137372137373137374137375137376137377137378137379137380137381137382137383137384137385137386137387137388137389137390137391137392137393137394137395137396137397137398137399137400137401137402137403137404137405137406137407137408137409137410137411137412137413137414137415137416137417137418137419137420137421137422137423137424137425137426137427137428137429137430137431137432137433137434137435137436137437137438137439137440137441137442137443137444137445137446137447137448137449137450137451137452137453137454137455137456137457137458137459137460137461137462137463137464137465137466137467137468137469137470137471137472137473137474137475137476137477137478137479137480137481137482137483137484137485137486137487137488137489137490137491137492137493137494137495137496137497137498137499137500137501137502137503137504137505137506137507137508137509137510137511137512137513137514137515137516137517137518137519137520137521137522137523137524137525137526137527137528137529137530137531137532137533137534137535137536137537137538137539137540137541137542137543137544137545137546137547137548137549137550137551137552137553137554137555137556137557137558137559137560137561137562137563137564137565137566137567137568137569137570137571137572137573137574137575137576137577137578137579137580137581137582137583137584137585137586137587137588137589137590137591137592137593137594137595137596137597137598137599137600137601137602137603137604137605137606137607137608137609137610137611137612137613137614137615137616137617137618137619137620137621137622137623137624137625137626137627137628137629137630137631137632137633137634137635137636137637137638137639137640137641137642137643137644137645137646137647137648137649137650137651137652137653137654137655137656137657137658137659137660137661137662137663137664137665137666137667137668137669137670137671137672137673137674137675137676137677137678137679137680137681137682137683137684137685137686137687137688137689137690137691137692137693137694137695137696137697137698137699137700137701137702137703137704137705137706137707137708137709137710137711137712137713137714137715137716137717137718137719137720137721137722137723137724137725137726137727137728137729137730137731137732137733137734137735137736137737137738137739137740137741137742137743137744137745137746137747137748137749137750137751137752137753137754137755137756137757137758137759137760137761137762137763137764137765137766137767137768137769137770137771137772137773137774137775137776137777137778137779137780137781137782137783137784137785137786137787137788137789137790137791137792137793137794137795137796137797137798137799137800137801137802137803137804137805137806137807137808137809137810137811137812137813137814137815137816137817137818137819137820137821137822137823137824137825137826137827137828137829137830137831137832137833137834137835137836137837137838137839137840137841137842137843137844137845137846137847137848137849137850137851137852137853137854137855137856137857137858137859137860137861137862137863137864137865137866137867137868137869137870137871137872137873137874137875137876137877137878137879137880137881137882137883137884137885137886137887137888137889137890137891137892137893137894137895137896137897137898137899137900137901137902137903137904137905137906137907137908137909137910137911137912137913137914137915137916137917137918137919137920137921137922137923137924137925137926137927137928137929137930137931137932137933137934137935137936137937137938137939137940137941137942137943137944137945137946137947137948137949137950137951137952137953137954137955137956137957137958137959137960137961137962137963137964137965137966137967137968137969137970137971137972137973137974137975137976137977137978137979137980137981137982137983137984137985137986137987137988137989137990137991137992137993137994137995137996137997137998137999138000138001138002138003138004138005138006138007138008138009138010138011138012138013138014138015138016138017138018138019138020138021138022138023138024138025138026138027138028138029138030138031138032138033138034138035138036138037138038138039138040138041138042138043138044138045138046138047138048138049138050138051138052138053138054138055138056138057138058138059138060138061138062138063138064138065138066138067138068138069138070138071138072138073138074138075138076138077138078138079138080138081138082138083138084138085138086138087138088138089138090138091138092138093138094138095138096138097138098138099138100138101138102138103138104138105138106138107138108138109138110138111138112138113138114138115138116138117138118138119138120138121138122138123138124138125138126138127138128138129138130138131138132138133138134138135138136138137138138138139138140138141138142138143138144138145138146138147138148138149138150138151138152138153138154138155138156138157138158138159138160138161138162138163138164138165138166138167138168138169138170138171138172138173138174138175138176138177138178138179138180138181138182138183138184138185138186138187138188138189138190138191138192138193138194138195138196138197138198138199138200138201138202138203138204138205138206138207138208138209138210138211138212138213138214138215138216138217138218138219138220138221138222138223138224138225138226138227138228138229138230138231138232138233138234138235138236138237138238138239138240138241138242138243138244138245138246138247138248138249138250138251138252138253138254138255138256138257138258138259138260138261138262138263138264138265138266138267138268138269138270138271138272138273138274138275138276138277138278138279138280138281138282138283138284138285138286138287138288138289138290138291138292138293138294138295138296138297138298138299138300138301138302138303138304138305138306138307138308138309138310138311138312138313138314138315138316138317138318138319138320138321138322138323138324138325138326138327138328138329138330138331138332138333138334138335138336138337138338138339138340138341138342138343138344138345138346138347138348138349138350138351138352138353138354138355138356138357138358138359138360138361138362138363138364138365138366138367138368138369138370138371138372138373138374138375138376138377138378138379138380138381138382138383138384138385138386138387138388138389138390138391138392138393138394138395138396138397138398138399138400138401138402138403138404138405138406138407138408138409138410138411138412138413138414138415138416138417138418138419138420138421138422138423138424138425138426138427138428138429138430138431138432138433138434138435138436138437138438138439138440138441138442138443138444138445138446138447138448138449138450138451138452138453138454138455138456138457138458138459138460138461138462138463138464138465138466138467138468138469138470138471138472138473138474138475138476138477138478138479138480138481138482138483138484138485138486138487138488138489138490138491138492138493138494138495138496138497138498138499138500138501138502138503138504138505138506138507138508138509138510138511138512138513138514138515138516138517138518138519138520138521138522138523138524138525138526138527138528138529138530138531138532138533138534138535138536138537138538138539138540138541138542138543138544138545138546138547138548138549138550138551138552138553138554138555138556138557138558138559138560138561138562138563138564138565138566138567138568138569138570138571138572138573138574138575138576138577138578138579138580138581138582138583138584138585138586138587138588138589138590138591138592138593138594138595138596138597138598138599138600138601138602138603138604138605138606138607138608138609138610138611138612138613138614138615138616138617138618138619138620138621138622138623138624138625138626138627138628138629138630138631138632138633138634138635138636138637138638138639138640138641138642138643138644138645138646138647138648138649138650138651138652138653138654138655138656138657138658138659138660138661138662138663138664138665138666138667138668138669138670138671138672138673138674138675138676138677138678138679138680138681138682138683138684138685138686138687138688138689138690138691138692138693138694138695138696138697138698138699138700138701138702138703138704138705138706138707138708138709138710138711138712138713138714138715138716138717138718138719138720138721138722138723138724138725138726138727138728138729138730138731138732138733138734138735138736138737138738138739138740138741138742138743138744138745138746138747138748138749138750138751138752138753138754138755138756138757138758138759138760138761138762138763138764138765138766138767138768138769138770138771138772138773138774138775138776138777138778138779138780138781138782138783138784138785138786138787138788138789138790138791138792138793138794138795138796138797138798138799138800138801138802138803138804138805138806138807138808138809138810138811138812138813138814138815138816138817138818138819138820138821138822138823138824138825138826138827138828138829138830138831138832138833138834138835138836138837138838138839138840138841138842138843138844138845138846138847138848138849138850138851138852138853138854138855138856138857138858138859138860138861138862138863138864138865138866138867138868138869138870138871138872138873138874138875138876138877138878138879138880138881138882138883138884138885138886138887138888138889138890138891138892138893138894138895138896138897138898138899138900138901138902138903138904138905138906138907138908138909138910138911138912138913138914138915138916138917138918138919138920138921138922138923138924138925138926138927138928138929138930138931138932138933138934138935138936138937138938138939138940138941138942138943138944138945138946138947138948138949138950138951138952138953138954138955138956138957138958138959138960138961138962138963138964138965138966138967138968138969138970138971138972138973138974138975138976138977138978138979138980138981138982138983138984138985138986138987138988138989138990138991138992138993138994138995138996138997138998138999139000139001139002139003139004139005139006139007139008139009139010139011139012139013139014139015139016139017139018139019139020139021139022139023139024139025139026139027139028139029139030139031139032139033139034139035139036139037139038139039139040139041139042139043139044139045139046139047139048139049139050139051139052139053139054139055139056139057139058139059139060139061139062139063139064139065139066139067139068139069139070139071139072139073139074139075139076139077139078139079139080139081139082139083139084139085139086139087139088139089139090139091139092139093139094139095139096139097139098139099139100139101139102139103139104139105139106139107139108139109139110139111139112139113139114139115139116139117139118139119139120139121139122139123139124139125139126139127139128139129139130139131139132139133139134139135139136139137139138139139139140139141139142139143139144139145139146139147139148139149139150139151139152139153139154139155139156139157139158139159139160139161139162139163139164139165139166139167139168139169139170139171139172139173139174139175139176139177139178139179139180139181139182139183139184139185139186139187139188139189139190139191139192139193139194139195139196139197139198139199139200139201139202139203139204139205139206139207139208139209139210139211139212139213139214139215139216139217139218139219139220139221139222139223139224139225139226139227139228139229139230139231139232139233139234139235139236139237139238139239139240139241139242139243139244139245139246139247139248139249139250139251139252139253139254139255139256139257139258139259139260139261139262139263139264139265139266139267139268139269139270139271139272139273139274139275139276139277139278139279139280139281139282139283139284139285139286139287139288139289139290139291139292139293139294139295139296139297139298139299139300139301139302139303139304139305139306139307139308139309139310139311139312139313139314139315139316139317139318139319139320139321139322139323139324139325139326139327139328139329139330139331139332139333139334139335139336139337139338139339139340139341139342139343139344139345139346139347139348139349139350139351139352139353139354139355139356139357139358139359139360139361139362139363139364139365139366139367139368139369139370139371139372139373139374139375139376139377139378139379139380139381139382139383139384139385139386139387139388139389139390139391139392139393139394139395139396139397139398139399139400139401139402139403139404139405139406139407139408139409139410139411139412139413139414139415139416139417139418139419139420139421139422139423139424139425139426139427139428139429139430139431139432139433139434139435139436139437139438139439139440139441139442139443139444139445139446139447139448139449139450139451139452139453139454139455139456139457139458139459139460139461139462139463139464139465139466139467139468139469139470139471139472139473139474139475139476139477139478139479139480139481139482139483139484139485139486139487139488139489139490139491139492139493139494139495139496139497139498139499139500139501139502139503139504139505139506139507139508139509139510139511139512139513139514139515139516139517139518139519139520139521139522139523139524139525139526139527139528139529139530139531139532139533139534139535139536139537139538139539139540139541139542139543139544139545139546139547139548139549139550139551139552139553139554139555139556139557139558139559139560139561139562139563139564139565139566139567139568139569139570139571139572139573139574139575139576139577139578139579139580139581139582139583139584139585139586139587139588139589139590139591139592139593139594139595139596139597139598139599139600139601139602139603139604139605139606139607139608139609139610139611139612139613139614139615139616139617139618139619139620139621139622139623139624139625139626139627139628139629139630139631139632139633139634139635139636139637139638139639139640139641139642139643139644139645139646139647139648139649139650139651139652139653139654139655139656139657139658139659139660139661139662139663139664139665139666139667139668139669139670139671139672139673139674139675139676139677139678139679139680139681139682139683139684139685139686139687139688139689139690139691139692139693139694139695139696139697139698139699139700139701139702139703139704139705139706139707139708139709139710139711139712139713139714139715139716139717139718139719139720139721139722139723139724139725139726139727139728139729139730139731139732139733139734139735139736139737139738139739139740139741139742139743139744139745139746139747139748139749139750139751139752139753139754139755139756139757139758139759139760139761139762139763139764139765139766139767139768139769139770139771139772139773139774139775139776139777139778139779139780139781139782139783139784139785139786139787139788139789139790139791139792139793139794139795139796139797139798139799139800139801139802139803139804139805139806139807139808139809139810139811139812139813139814139815139816139817139818139819139820139821139822139823139824139825139826139827139828139829139830139831139832139833139834139835139836139837139838139839139840139841139842139843139844139845139846139847139848139849139850139851139852139853139854139855139856139857139858139859139860139861139862139863139864139865139866139867139868139869139870139871139872139873139874139875139876139877139878139879139880139881139882139883139884139885139886139887139888139889139890139891139892139893139894139895139896139897139898139899139900139901139902139903139904139905139906139907139908139909139910139911139912139913139914139915139916139917139918139919139920139921139922139923139924139925139926139927139928139929139930139931139932139933139934139935139936139937139938139939139940139941139942139943139944139945139946139947139948139949139950139951139952139953139954139955139956139957139958139959139960139961139962139963139964139965139966139967139968139969139970139971139972139973139974139975139976139977139978139979139980139981139982139983139984139985139986139987139988139989139990139991139992139993139994139995139996139997139998139999140000140001140002140003140004140005140006140007140008140009140010140011140012140013140014140015140016140017140018140019140020140021140022140023140024140025140026140027140028140029140030140031140032140033140034140035140036140037140038140039140040140041140042140043140044140045140046140047140048140049140050140051140052140053140054140055140056140057140058140059140060140061140062140063140064140065140066140067140068140069140070140071140072140073140074140075140076140077140078140079140080140081140082140083140084140085140086140087140088140089140090140091140092140093140094140095140096140097140098140099140100140101140102140103140104140105140106140107140108140109140110140111140112140113140114140115140116140117140118140119140120140121140122140123140124140125140126140127140128140129140130140131140132140133140134140135140136140137140138140139140140140141140142140143140144140145140146140147140148140149140150140151140152140153140154140155140156140157140158140159140160140161140162140163140164140165140166140167140168140169140170140171140172140173140174140175140176140177140178140179140180140181140182140183140184140185140186140187140188140189140190140191140192140193140194140195140196140197140198140199140200140201140202140203140204140205140206140207140208140209140210140211140212140213140214140215140216140217140218140219140220140221140222140223140224140225140226140227140228140229140230140231140232140233140234140235140236140237140238140239140240140241140242140243140244140245140246140247140248140249140250140251140252140253140254140255140256140257140258140259140260140261140262140263140264140265140266140267140268140269140270140271140272140273140274140275140276140277140278140279140280140281140282140283140284140285140286140287140288140289140290140291140292140293140294140295140296140297140298140299140300140301140302140303140304140305140306140307140308140309140310140311140312140313140314140315140316140317140318140319140320140321140322140323140324140325140326140327140328140329140330140331140332140333140334140335140336140337140338140339140340140341140342140343140344140345140346140347140348140349140350140351140352140353140354140355140356140357140358140359140360140361140362140363140364140365140366140367140368140369140370140371140372140373140374140375140376140377140378140379140380140381140382140383140384140385140386140387140388140389140390140391140392140393140394140395140396140397140398140399140400140401140402140403140404140405140406140407140408140409140410140411140412140413140414140415140416140417140418140419140420140421140422140423140424140425140426140427140428140429140430140431140432140433140434140435140436140437140438140439140440140441140442140443140444140445140446140447140448140449140450140451140452140453140454140455140456140457140458140459140460140461140462140463140464140465140466140467140468140469140470140471140472140473140474140475140476140477140478140479140480140481140482140483140484140485140486140487140488140489140490140491140492140493140494140495140496140497140498140499140500140501140502140503140504140505140506140507140508140509140510140511140512140513140514140515140516140517140518140519140520140521140522140523140524140525140526140527140528140529140530140531140532140533140534140535140536140537140538140539140540140541140542140543140544140545140546140547140548140549140550140551140552140553140554140555140556140557140558140559140560140561140562140563140564140565140566140567140568140569140570140571140572140573140574140575140576140577140578140579140580140581140582140583140584140585140586140587140588140589140590140591140592140593140594140595140596140597140598140599140600140601140602140603140604140605140606140607140608140609140610140611140612140613140614140615140616140617140618140619140620140621140622140623140624140625140626140627140628140629140630140631140632140633140634140635140636140637140638140639140640140641140642140643140644140645140646140647140648140649140650140651140652140653140654140655140656140657140658140659140660140661140662140663140664140665140666140667140668140669140670140671140672140673140674140675140676140677140678140679140680140681140682140683140684140685140686140687140688140689140690140691140692140693140694140695140696140697140698140699140700140701140702140703140704140705140706140707140708140709140710140711140712140713140714140715140716140717140718140719140720140721140722140723140724140725140726140727140728140729140730140731140732140733140734140735140736140737140738140739140740140741140742140743140744140745140746140747140748140749140750140751140752140753140754140755140756140757140758140759140760140761140762140763140764140765140766140767140768140769140770140771140772140773140774140775140776140777140778140779140780140781140782140783140784140785140786140787140788140789140790140791140792140793140794140795140796140797140798140799140800140801140802140803140804140805140806140807140808140809140810140811140812140813140814140815140816140817140818140819140820140821140822140823140824140825140826140827140828140829140830140831140832140833140834140835140836140837140838140839140840140841140842140843140844140845140846140847140848140849140850140851140852140853140854140855140856140857140858140859140860140861140862140863140864140865140866140867140868140869140870140871140872140873140874140875140876140877140878140879140880140881140882140883140884140885140886140887140888140889140890140891140892140893140894140895140896140897140898140899140900140901140902140903140904140905140906140907140908140909140910140911140912140913140914140915140916140917140918140919140920140921140922140923140924140925140926140927140928140929140930140931140932140933140934140935140936140937140938140939140940140941140942140943140944140945140946140947140948140949140950140951140952140953140954140955140956140957140958140959140960140961140962140963140964140965140966140967140968140969140970140971140972140973140974140975140976140977140978140979140980140981140982140983140984140985140986140987140988140989140990140991140992140993140994140995140996140997140998140999141000141001141002141003141004141005141006141007141008141009141010141011141012141013141014141015141016141017141018141019141020141021141022141023141024141025141026141027141028141029141030141031141032141033141034141035141036141037141038141039141040141041141042141043141044141045141046141047141048141049141050141051141052141053141054141055141056141057141058141059141060141061141062141063141064141065141066141067141068141069141070141071141072141073141074141075141076141077141078141079141080141081141082141083141084141085141086141087141088141089141090141091141092141093141094141095141096141097141098141099141100141101141102141103141104141105141106141107141108141109141110141111141112141113141114141115141116141117141118141119141120141121141122141123141124141125141126141127141128141129141130141131141132141133141134141135141136141137141138141139141140141141141142141143141144141145141146141147141148141149141150141151141152141153141154141155141156141157141158141159141160141161141162141163141164141165141166141167141168141169141170141171141172141173141174141175141176141177141178141179141180141181141182141183141184141185141186141187141188141189141190141191141192141193141194141195141196141197141198141199141200141201141202141203141204141205141206141207141208141209141210141211141212141213141214141215141216141217141218141219141220141221141222141223141224141225141226141227141228141229141230141231141232141233141234141235141236141237141238141239141240141241141242141243141244141245141246141247141248141249141250141251141252141253141254141255141256141257141258141259141260141261141262141263141264141265141266141267141268141269141270141271141272141273141274141275141276141277141278141279141280141281141282141283141284141285141286141287141288141289141290141291141292141293141294141295141296141297141298141299141300141301141302141303141304141305141306141307141308141309141310141311141312141313141314141315141316141317141318141319141320141321141322141323141324141325141326141327141328141329141330141331141332141333141334141335141336141337141338141339141340141341141342141343141344141345141346141347141348141349141350141351141352141353141354141355141356141357141358141359141360141361141362141363141364141365141366141367141368141369141370141371141372141373141374141375141376141377141378141379141380141381141382141383141384141385141386141387141388141389141390141391141392141393141394141395141396141397141398141399141400141401141402141403141404141405141406141407141408141409141410141411141412141413141414141415141416141417141418141419141420141421141422141423141424141425141426141427141428141429141430141431141432141433141434141435141436141437141438141439141440141441141442141443141444141445141446141447141448141449141450141451141452141453141454141455141456141457141458141459141460141461141462141463141464141465141466141467141468141469141470141471141472141473141474141475141476141477141478141479141480141481141482141483141484141485141486141487141488141489141490141491141492141493141494141495141496141497141498141499141500141501141502141503141504141505141506141507141508141509141510141511141512141513141514141515141516141517141518141519141520141521141522141523141524141525141526141527141528141529141530141531141532141533141534141535141536141537141538141539141540141541141542141543141544141545141546141547141548141549141550141551141552141553141554141555141556141557141558141559141560141561141562141563141564141565141566141567141568141569141570141571141572141573141574141575141576141577141578141579141580141581141582141583141584141585141586141587141588141589141590141591141592141593141594141595141596141597141598141599141600141601141602141603141604141605141606141607141608141609141610141611141612141613141614141615141616141617141618141619141620141621141622141623141624141625141626141627141628141629141630141631141632141633141634141635141636141637141638141639141640141641141642141643141644141645141646141647141648141649141650141651141652141653141654141655141656141657141658141659141660141661141662141663141664141665141666141667141668141669141670141671141672141673141674141675141676141677141678141679141680141681141682141683141684141685141686141687141688141689141690141691141692141693141694141695141696141697141698141699141700141701141702141703141704141705141706141707141708141709141710141711141712141713141714141715141716141717141718141719141720141721141722141723141724141725141726141727141728141729141730141731141732141733141734141735141736141737141738141739141740141741141742141743141744141745141746141747141748141749141750141751141752141753141754141755141756141757141758141759141760141761141762141763141764141765141766141767141768141769141770141771141772141773141774141775141776141777141778141779141780141781141782141783141784141785141786141787141788141789141790141791141792141793141794141795141796141797141798141799141800141801141802141803141804141805141806141807141808141809141810141811141812141813141814141815141816141817141818141819141820141821141822141823141824141825141826141827141828141829141830141831141832141833141834141835141836141837141838141839141840141841141842141843141844141845141846141847141848141849141850141851141852141853141854141855141856141857141858141859141860141861141862141863141864141865141866141867141868141869141870141871141872141873141874141875141876141877141878141879141880141881141882141883141884141885141886141887141888141889141890141891141892141893141894141895141896141897141898141899141900141901141902141903141904141905141906141907141908141909141910141911141912141913141914141915141916141917141918141919141920141921141922141923141924141925141926141927141928141929141930141931141932141933141934141935141936141937141938141939141940141941141942141943141944141945141946141947141948141949141950141951141952141953141954141955141956141957141958141959141960141961141962141963141964141965141966141967141968141969141970141971141972141973141974141975141976141977141978141979141980141981141982141983141984141985141986141987141988141989141990141991141992141993141994141995141996141997141998141999142000142001142002142003142004142005142006142007142008142009142010142011142012142013142014142015142016142017142018142019142020142021142022142023142024142025142026142027142028142029142030142031142032142033142034142035142036142037142038142039142040142041142042142043142044142045142046142047142048142049142050142051142052142053142054142055142056142057142058142059142060142061142062142063142064142065142066142067142068142069142070142071142072142073142074142075142076142077142078142079142080142081142082142083142084142085142086142087142088142089142090142091142092142093142094142095142096142097142098142099142100142101142102142103142104142105142106142107142108142109142110142111142112142113142114142115142116142117142118142119142120142121142122142123142124142125142126142127142128142129142130142131142132142133142134142135142136142137142138142139142140142141142142142143142144142145142146142147142148142149142150142151142152142153142154142155142156142157142158142159142160142161142162142163142164142165142166142167142168142169142170142171142172142173142174142175142176142177142178142179142180142181142182142183142184142185142186142187142188142189142190142191142192142193142194142195142196142197142198142199142200142201142202142203142204142205142206142207142208142209142210142211142212142213142214142215142216142217142218142219142220142221142222142223142224142225142226142227142228142229142230142231142232142233142234142235142236142237142238142239142240142241142242142243142244142245142246142247142248142249142250142251142252142253142254142255142256142257142258142259142260142261142262142263142264142265142266142267142268142269142270142271142272142273142274142275142276142277142278142279142280142281142282142283142284142285142286142287142288142289142290142291142292142293142294142295142296142297142298142299142300142301142302142303142304142305142306142307142308142309142310142311142312142313142314142315142316142317142318142319142320142321142322142323142324142325142326142327142328142329142330142331142332142333142334142335142336142337142338142339142340142341142342142343142344142345142346142347142348142349142350142351142352142353142354142355142356142357142358142359142360142361142362142363142364142365142366142367142368142369142370142371142372142373142374142375142376142377142378142379142380142381142382142383142384142385142386142387142388142389142390142391142392142393142394142395142396142397142398142399142400142401142402142403142404142405142406142407142408142409142410142411142412142413142414142415142416142417142418142419142420142421142422142423142424142425142426142427142428142429142430142431142432142433142434142435142436142437142438142439142440142441142442142443142444142445142446142447142448142449142450142451142452142453142454142455142456142457142458142459142460142461142462142463142464142465142466142467142468142469142470142471142472142473142474142475142476142477142478142479142480142481142482142483142484142485142486142487142488142489142490142491142492142493142494142495142496142497142498142499142500142501142502142503142504142505142506142507142508142509142510142511142512142513142514142515142516142517142518142519142520142521142522142523142524142525142526142527142528142529142530142531142532142533142534142535142536142537142538142539142540142541142542142543142544142545142546142547142548142549142550142551142552142553142554142555142556142557142558142559142560142561142562142563142564142565142566142567142568142569142570142571142572142573142574142575142576142577142578142579142580142581142582142583142584142585142586142587142588142589142590142591142592142593142594142595142596142597142598142599142600142601142602142603142604142605142606142607142608142609142610142611142612142613142614142615142616142617142618142619142620142621142622142623142624142625142626142627142628142629142630142631142632142633142634142635142636142637142638142639142640142641142642142643142644142645142646142647142648142649142650142651142652142653142654142655142656142657142658142659142660142661142662142663142664142665142666142667142668142669142670142671142672142673142674142675142676142677142678142679142680142681142682142683142684142685142686142687142688142689142690142691142692142693142694142695142696142697142698142699142700142701142702142703142704142705142706142707142708142709142710142711142712142713142714142715142716142717142718142719142720142721142722142723142724142725142726142727142728142729142730142731142732142733142734142735142736142737142738142739142740142741142742142743142744142745142746142747142748142749142750142751142752142753142754142755142756142757142758142759142760142761142762142763142764142765142766142767142768142769142770142771142772142773142774142775142776142777142778142779142780142781142782142783142784142785142786142787142788142789142790142791142792142793142794142795142796142797142798142799142800142801142802142803142804142805142806142807142808142809142810142811142812142813142814142815142816142817142818142819142820142821142822142823142824142825142826142827142828142829142830142831142832142833142834142835142836142837142838142839142840142841142842142843142844142845142846142847142848142849142850142851142852142853142854142855142856142857142858142859142860142861142862142863142864142865142866142867142868142869142870142871142872142873142874142875142876142877142878142879142880142881142882142883142884142885142886142887142888142889142890142891142892142893142894142895142896142897142898142899142900142901142902142903142904142905142906142907142908142909142910142911142912142913142914142915142916142917142918142919142920142921142922142923142924142925142926142927142928142929142930142931142932142933142934142935142936142937142938142939142940142941142942142943142944142945142946142947142948142949142950142951142952142953142954142955142956142957142958142959142960142961142962142963142964142965142966142967142968142969142970142971142972142973142974142975142976142977142978142979142980142981142982142983142984142985142986142987142988142989142990142991142992142993142994142995142996142997142998142999143000143001143002143003143004143005143006143007143008143009143010143011143012143013143014143015143016143017143018143019143020143021143022143023143024143025143026143027143028143029143030143031143032143033143034143035143036143037143038143039143040143041143042143043143044143045143046143047143048143049143050143051143052143053143054143055143056143057143058143059143060143061143062143063143064143065143066143067143068143069143070143071143072143073143074143075143076143077143078143079143080143081143082143083143084143085143086143087143088143089143090143091143092143093143094143095143096143097143098143099143100143101143102143103143104143105143106143107143108143109143110143111143112143113143114143115143116143117143118143119143120143121143122143123143124143125143126143127143128143129143130143131143132143133143134143135143136143137143138143139143140143141143142143143143144143145143146143147143148143149143150143151143152143153143154143155143156143157143158143159143160143161143162143163143164143165143166143167143168143169143170143171143172143173143174143175143176143177143178143179143180143181143182143183143184143185143186143187143188143189143190143191143192143193143194143195143196143197143198143199143200143201143202143203143204143205143206143207143208143209143210143211143212143213143214143215143216143217143218143219143220143221143222143223143224143225143226143227143228143229143230143231143232143233143234143235143236143237143238143239143240143241143242143243143244143245143246143247143248143249143250143251143252143253143254143255143256143257143258143259143260143261143262143263143264143265143266143267143268143269143270143271143272143273143274143275143276143277143278143279143280143281143282143283143284143285143286143287143288143289143290143291143292143293143294143295143296143297143298143299143300143301143302143303143304143305143306143307143308143309143310143311143312143313143314143315143316143317143318143319143320143321143322143323143324143325143326143327143328143329143330143331143332143333143334143335143336143337143338143339143340143341143342143343143344143345143346143347143348143349143350143351143352143353143354143355143356143357143358143359143360143361143362143363143364143365143366143367143368143369143370143371143372143373143374143375143376143377143378143379143380143381143382143383143384143385143386143387143388143389143390143391143392143393143394143395143396143397143398143399143400143401143402143403143404143405143406143407143408143409143410143411143412143413143414143415143416143417143418143419143420143421143422143423143424143425143426143427143428143429143430143431143432143433143434143435143436143437143438143439143440143441143442143443143444143445143446143447143448143449143450143451143452143453143454143455143456143457143458143459143460143461143462143463143464143465143466143467143468143469143470143471143472143473143474143475143476143477143478143479143480143481143482143483143484143485143486143487143488143489143490143491143492143493143494143495143496143497143498143499143500143501143502143503143504143505143506143507143508143509143510143511143512143513143514143515143516143517143518143519143520143521143522143523143524143525143526143527143528143529143530143531143532143533143534143535143536143537143538143539143540143541143542143543143544143545143546143547143548143549143550143551143552143553143554143555143556143557143558143559143560143561143562143563143564143565143566143567143568143569143570143571143572143573143574143575143576143577143578143579143580143581143582143583143584143585143586143587143588143589143590143591143592143593143594143595143596143597143598143599143600143601143602143603143604143605143606143607143608143609143610143611143612143613143614143615143616143617143618143619143620143621143622143623143624143625143626143627143628143629143630143631143632143633143634143635143636143637143638143639143640143641143642143643143644143645143646143647143648143649143650143651143652143653143654143655143656143657143658143659143660143661143662143663143664143665143666143667143668143669143670143671143672143673143674143675143676143677143678143679143680143681143682143683143684143685143686143687143688143689143690143691143692143693143694143695143696143697143698143699143700143701143702143703143704143705143706143707143708143709143710143711143712143713143714143715143716143717143718143719143720143721143722143723143724143725143726143727143728143729143730143731143732143733143734143735143736143737143738143739143740143741143742143743143744143745143746143747143748143749143750143751143752143753143754143755143756143757143758143759143760143761143762143763143764143765143766143767143768143769143770143771143772143773143774143775143776143777143778143779143780143781143782143783143784143785143786143787143788143789143790143791143792143793143794143795143796143797143798143799143800143801143802143803143804143805143806143807143808143809143810143811143812143813143814143815143816143817143818143819143820143821143822143823143824143825143826143827143828143829143830143831143832143833143834143835143836143837143838143839143840143841143842143843143844143845143846143847143848143849143850143851143852143853143854143855143856143857143858143859143860143861143862143863143864143865143866143867143868143869143870143871143872143873143874143875143876143877143878143879143880143881143882143883143884143885143886143887143888143889143890143891143892143893143894143895143896143897143898143899143900143901143902143903143904143905143906143907143908143909143910143911143912143913143914143915143916143917143918143919143920143921143922143923143924143925143926143927143928143929143930143931143932143933143934143935143936143937143938143939143940143941143942143943143944143945143946143947143948143949143950143951143952143953143954143955143956143957143958143959143960143961143962143963143964143965143966143967143968143969143970143971143972143973143974143975143976143977143978143979143980143981143982143983143984143985143986143987143988143989143990143991143992143993143994143995143996143997143998143999144000144001144002144003144004144005144006144007144008144009144010144011144012144013144014144015144016144017144018144019144020144021144022144023144024144025144026144027144028144029144030144031144032144033144034144035144036144037144038144039144040144041144042144043144044144045144046144047144048144049144050144051144052144053144054144055144056144057144058144059144060144061144062144063144064144065144066144067144068144069144070144071144072144073144074144075144076144077144078144079144080144081144082144083144084144085144086144087144088144089144090144091144092144093144094144095144096144097144098144099144100144101144102144103144104144105144106144107144108144109144110144111144112144113144114144115144116144117144118144119144120144121144122144123144124144125144126144127144128144129144130144131144132144133144134144135144136144137144138144139144140144141144142144143144144144145144146144147144148144149144150144151144152144153144154144155144156144157144158144159144160144161144162144163144164144165144166144167144168144169144170144171144172144173144174144175144176144177144178144179144180144181144182144183144184144185144186144187144188144189144190144191144192144193144194144195144196144197144198144199144200144201144202144203144204144205144206144207144208144209144210144211144212144213144214144215144216144217144218144219144220144221144222144223144224144225144226144227144228144229144230144231144232144233144234144235144236144237144238144239144240144241144242144243144244144245144246144247144248144249144250144251144252144253144254144255144256144257144258144259144260144261144262144263144264144265144266144267144268144269144270144271144272144273144274144275144276144277144278144279144280144281144282144283144284144285144286144287144288144289144290144291144292144293144294144295144296144297144298144299144300144301144302144303144304144305144306144307144308144309144310144311144312144313144314144315144316144317144318144319144320144321144322144323144324144325144326144327144328144329144330144331144332144333144334144335144336144337144338144339144340144341144342144343144344144345144346144347144348144349144350144351144352144353144354144355144356144357144358144359144360144361144362144363144364144365144366144367144368144369144370144371144372144373144374144375144376144377144378144379144380144381144382144383144384144385144386144387144388144389144390144391144392144393144394144395144396144397144398144399144400144401144402144403144404144405144406144407144408144409144410144411144412144413144414144415144416144417144418144419144420144421144422144423144424144425144426144427144428144429144430144431144432144433144434144435144436144437144438144439144440144441144442144443144444144445144446144447144448144449144450144451144452144453144454144455144456144457144458144459144460144461144462144463144464144465144466144467144468144469144470144471144472144473144474144475144476144477144478144479144480144481144482144483144484144485144486144487144488144489144490144491144492144493144494144495144496144497144498144499144500144501144502144503144504144505144506144507144508144509144510144511144512144513144514144515144516144517144518144519144520144521144522144523144524144525144526144527144528144529144530144531144532144533144534144535144536144537144538144539144540144541144542144543144544144545144546144547144548144549144550144551144552144553144554144555144556144557144558144559144560144561144562144563144564144565144566144567144568144569144570144571144572144573144574144575144576144577144578144579144580144581144582144583144584144585144586144587144588144589144590144591144592144593144594144595144596144597144598144599144600144601144602144603144604144605144606144607144608144609144610144611144612144613144614144615144616144617144618144619144620144621144622144623144624144625144626144627144628144629144630144631144632144633144634144635144636144637144638144639144640144641144642144643144644144645144646144647144648144649144650144651144652144653144654144655144656144657144658144659144660144661144662144663144664144665144666144667144668144669144670144671144672144673144674144675144676144677144678144679144680144681144682144683144684144685144686144687144688144689144690144691144692144693144694144695144696144697144698144699144700144701144702144703144704144705144706144707144708144709144710144711144712144713144714144715144716144717144718144719144720144721144722144723144724144725144726144727144728144729144730144731144732144733144734144735144736144737144738144739144740144741144742144743144744144745144746144747144748144749144750144751144752144753144754144755144756144757144758144759144760144761144762144763144764144765144766144767144768144769144770144771144772144773144774144775144776144777144778144779144780144781144782144783144784144785144786144787144788144789144790144791144792144793144794144795144796144797144798144799144800144801144802144803144804144805144806144807144808144809144810144811144812144813144814144815144816144817144818144819144820144821144822144823144824144825144826144827144828144829144830144831144832144833144834144835144836144837144838144839144840144841144842144843144844144845144846144847144848144849144850144851144852144853144854144855144856144857144858144859144860144861144862144863144864144865144866144867144868144869144870144871144872144873144874144875144876144877144878144879144880144881144882144883144884144885144886144887144888144889144890144891144892144893144894144895144896144897144898144899144900144901144902144903144904144905144906144907144908144909144910144911144912144913144914144915144916144917144918144919144920144921144922144923144924144925144926144927144928144929144930144931144932144933144934144935144936144937144938144939144940144941144942144943144944144945144946144947144948144949144950144951144952144953144954144955144956144957144958144959144960144961144962144963144964144965144966144967144968144969144970144971144972144973144974144975144976144977144978144979144980144981144982144983144984144985144986144987144988144989144990144991144992144993144994144995144996144997144998144999145000145001145002145003145004145005145006145007145008145009145010145011145012145013145014145015145016145017145018145019145020145021145022145023145024145025145026145027145028145029145030145031145032145033145034145035145036145037145038145039145040145041145042145043145044145045145046145047145048145049145050145051145052145053145054145055145056145057145058145059145060145061145062145063145064145065145066145067145068145069145070145071145072145073145074145075145076145077145078145079145080145081145082145083145084145085145086145087145088145089145090145091145092145093145094145095145096145097145098145099145100145101145102145103145104145105145106145107145108145109145110145111145112145113145114145115145116145117145118145119145120145121145122145123145124145125145126145127145128145129145130145131145132145133145134145135145136145137145138145139145140145141145142145143145144145145145146145147145148145149145150145151145152145153145154145155145156145157145158145159145160145161145162145163145164145165145166145167145168145169145170145171145172145173145174145175145176145177145178145179145180145181145182145183145184145185145186145187145188145189145190145191145192145193145194145195145196145197145198145199145200145201145202145203145204145205145206145207145208145209145210145211145212145213145214145215145216145217145218145219145220145221145222145223145224145225145226145227145228145229145230145231145232145233145234145235145236145237145238145239145240145241145242145243145244145245145246145247145248145249145250145251145252145253145254145255145256145257145258145259145260145261145262145263145264145265145266145267145268145269145270145271145272145273145274145275145276145277145278145279145280145281145282145283145284145285145286145287145288145289145290145291145292145293145294145295145296145297145298145299145300145301145302145303145304145305145306145307145308145309145310145311145312145313145314145315145316145317145318145319145320145321145322145323145324145325145326145327145328145329145330145331145332145333145334145335145336145337145338145339145340145341145342145343145344145345145346145347145348145349145350145351145352145353145354145355145356145357145358145359145360145361145362145363145364145365145366145367145368145369145370145371145372145373145374145375145376145377145378145379145380145381145382145383145384145385145386145387145388145389145390145391145392145393145394145395145396145397145398145399145400145401145402145403145404145405145406145407145408145409145410145411145412145413145414145415145416145417145418145419145420145421145422145423145424145425145426145427145428145429145430145431145432145433145434145435145436145437145438145439145440145441145442145443145444145445145446145447145448145449145450145451145452145453145454145455145456145457145458145459145460145461145462145463145464145465145466145467145468145469145470145471145472145473145474145475145476145477145478145479145480145481145482145483145484145485145486145487145488145489145490145491145492145493145494145495145496145497145498145499145500145501145502145503145504145505145506145507145508145509145510145511145512145513145514145515145516145517145518145519145520145521145522145523145524145525145526145527145528145529145530145531145532145533145534145535145536145537145538145539145540145541145542145543145544145545145546145547145548145549145550145551145552145553145554145555145556145557145558145559145560145561145562145563145564145565145566145567145568145569145570145571145572145573145574145575145576145577145578145579145580145581145582145583145584145585145586145587145588145589145590145591145592145593145594145595145596145597145598145599145600145601145602145603145604145605145606145607145608145609145610145611145612145613145614145615145616145617145618145619145620145621145622145623145624145625145626145627145628145629145630145631145632145633145634145635145636145637145638145639145640145641145642145643145644145645145646145647145648145649145650145651145652145653145654145655145656145657145658145659145660145661145662145663145664145665145666145667145668145669145670145671145672145673145674145675145676145677145678145679145680145681145682145683145684145685145686145687145688145689145690145691145692145693145694145695145696145697145698145699145700145701145702145703145704145705145706145707145708145709145710145711145712145713145714145715145716145717145718145719145720145721145722145723145724145725145726145727145728145729145730145731145732145733145734145735145736145737145738145739145740145741145742145743145744145745145746145747145748145749145750145751145752145753145754145755145756145757145758145759145760145761145762145763145764145765145766145767145768145769145770145771145772145773145774145775145776145777145778145779145780145781145782145783145784145785145786145787145788145789145790145791145792145793145794145795145796145797145798145799145800145801145802145803145804145805145806145807145808145809145810145811145812145813145814145815145816145817145818145819145820145821145822145823145824145825145826145827145828145829145830145831145832145833145834145835145836145837145838145839145840145841145842145843145844145845145846145847145848145849145850145851145852145853145854145855145856145857145858145859145860145861145862145863145864145865145866145867145868145869145870145871145872145873145874145875145876145877145878145879145880145881145882145883145884145885145886145887145888145889145890145891145892145893145894145895145896145897145898145899145900145901145902145903145904145905145906145907145908145909145910145911145912145913145914145915145916145917145918145919145920145921145922145923145924145925145926145927145928145929145930145931145932145933145934145935145936145937145938145939145940145941145942145943145944145945145946145947145948145949145950145951145952145953145954145955145956145957145958145959145960145961145962145963145964145965145966145967145968145969145970145971145972145973145974145975145976145977145978145979145980145981145982145983145984145985145986145987145988145989145990145991145992145993145994145995145996145997145998145999146000146001146002146003146004146005146006146007146008146009146010146011146012146013146014146015146016146017146018146019146020146021146022146023146024146025146026146027146028146029146030146031146032146033146034146035146036146037146038146039146040146041146042146043146044146045146046146047146048146049146050146051146052146053146054146055146056146057146058146059146060146061146062146063146064146065146066146067146068146069146070146071146072146073146074146075146076146077146078146079146080146081146082146083146084146085146086146087146088146089146090146091146092146093146094146095146096146097146098146099146100146101146102146103146104146105146106146107146108146109146110146111146112146113146114146115146116146117146118146119146120146121146122146123146124146125146126146127146128146129146130146131146132146133146134146135146136146137146138146139146140146141146142146143146144146145146146146147146148146149146150146151146152146153146154146155146156146157146158146159146160146161146162146163146164146165146166146167146168146169146170146171146172146173146174146175146176146177146178146179146180146181146182146183146184146185146186146187146188146189146190146191146192146193146194146195146196146197146198146199146200146201146202146203146204146205146206146207146208146209146210146211146212146213146214146215146216146217146218146219146220146221146222146223146224146225146226146227146228146229146230146231146232146233146234146235146236146237146238146239146240146241146242146243146244146245146246146247146248146249146250146251146252146253146254146255146256146257146258146259146260146261146262146263146264146265146266146267146268146269146270146271146272146273146274146275146276146277146278146279146280146281146282146283146284146285146286146287146288146289146290146291146292146293146294146295146296146297146298146299146300146301146302146303146304146305146306146307146308146309146310146311146312146313146314146315146316146317146318146319146320146321146322146323146324146325146326146327146328146329146330146331146332146333146334146335146336146337146338146339146340146341146342146343146344146345146346146347146348146349146350146351146352146353146354146355146356146357146358146359146360146361146362146363146364146365146366146367146368146369146370146371146372146373146374146375146376146377146378146379146380146381146382146383146384146385146386146387146388146389146390146391146392146393146394146395146396146397146398146399146400146401146402146403146404146405146406146407146408146409146410146411146412146413146414146415146416146417146418146419146420146421146422146423146424146425146426146427146428146429146430146431146432146433146434146435146436146437146438146439146440146441146442146443146444146445146446146447146448146449146450146451146452146453146454146455146456146457146458146459146460146461146462146463146464146465146466146467146468146469146470146471146472146473146474146475146476146477146478146479146480146481146482146483146484146485146486146487146488146489146490146491146492146493146494146495146496146497146498146499146500146501146502146503146504146505146506146507146508146509146510146511146512146513146514146515146516146517146518146519146520146521146522146523146524146525146526146527146528146529146530146531146532146533146534146535146536146537146538146539146540146541146542146543146544146545146546146547146548146549146550146551146552146553146554146555146556146557146558146559146560146561146562146563146564146565146566146567146568146569146570146571146572146573146574146575146576146577146578146579146580146581146582146583146584146585146586146587146588146589146590146591146592146593146594146595146596146597146598146599146600146601146602146603146604146605146606146607146608146609146610146611146612146613146614146615146616146617146618146619146620146621146622146623146624146625146626146627146628146629146630146631146632146633146634146635146636146637146638146639146640146641146642146643146644146645146646146647146648146649146650146651146652146653146654146655146656146657146658146659146660146661146662146663146664146665146666146667146668146669146670146671146672146673146674146675146676146677146678146679146680146681146682146683146684146685146686146687146688146689146690146691146692146693146694146695146696146697146698146699146700146701146702146703146704146705146706146707146708146709146710146711146712146713146714146715146716146717146718146719146720146721146722146723146724146725146726146727146728146729146730146731146732146733146734146735146736146737146738146739146740146741146742146743146744146745146746146747146748146749146750146751146752146753146754146755146756146757146758146759146760146761146762146763146764146765146766146767146768146769146770146771146772146773146774146775146776146777146778146779146780146781146782146783146784146785146786146787146788146789146790146791146792146793146794146795146796146797146798146799146800146801146802146803146804146805146806146807146808146809146810146811146812146813146814146815146816146817146818146819146820146821146822146823146824146825146826146827146828146829146830146831146832146833146834146835146836146837146838146839146840146841146842146843146844146845146846146847146848146849146850146851146852146853146854146855146856146857146858146859146860146861146862146863146864146865146866146867146868146869146870146871146872146873146874146875146876146877146878146879146880146881146882146883146884146885146886146887146888146889146890146891146892146893146894146895146896146897146898146899146900146901146902146903146904146905146906146907146908146909146910146911146912146913146914146915146916146917146918146919146920146921146922146923146924146925146926146927146928146929146930146931146932146933146934146935146936146937146938146939146940146941146942146943146944146945146946146947146948146949146950146951146952146953146954146955146956146957146958146959146960146961146962146963146964146965146966146967146968146969146970146971146972146973146974146975146976146977146978146979146980146981146982146983146984146985146986146987146988146989146990146991146992146993146994146995146996146997146998146999147000147001147002147003147004147005147006147007147008147009147010147011147012147013147014147015147016147017147018147019147020147021147022147023147024147025147026147027147028147029147030147031147032147033147034147035147036147037147038147039147040147041147042147043147044147045147046147047147048147049147050147051147052147053147054147055147056147057147058147059147060147061147062147063147064147065147066147067147068147069147070147071147072147073147074147075147076147077147078147079147080147081147082147083147084147085147086147087147088147089147090147091147092147093147094147095147096147097147098147099147100147101147102147103147104147105147106147107147108147109147110147111147112147113147114147115147116147117147118147119147120147121147122147123147124147125147126147127147128147129147130147131147132147133147134147135147136147137147138147139147140147141147142147143147144147145147146147147147148147149147150147151147152147153147154147155147156147157147158147159147160147161147162147163147164147165147166147167147168147169147170147171147172147173147174147175147176147177147178147179147180147181147182147183147184147185147186147187147188147189147190147191147192147193147194147195147196147197147198147199147200147201147202147203147204147205147206147207147208147209147210147211147212147213147214147215147216147217147218147219147220147221147222147223147224147225147226147227147228147229147230147231147232147233147234147235147236147237147238147239147240147241147242147243147244147245147246147247147248147249147250147251147252147253147254147255147256147257147258147259147260147261147262147263147264147265147266147267147268147269147270147271147272147273147274147275147276147277147278147279147280147281147282147283147284147285147286147287147288147289147290147291147292147293147294147295147296147297147298147299147300147301147302147303147304147305147306147307147308147309147310147311147312147313147314147315147316147317147318147319147320147321147322147323147324147325147326147327147328147329147330147331147332147333147334147335147336147337147338147339147340147341147342147343147344147345147346147347147348147349147350147351147352147353147354147355147356147357147358147359147360147361147362147363147364147365147366147367147368147369147370147371147372147373147374147375147376147377147378147379147380147381147382147383147384147385147386147387147388147389147390147391147392147393147394147395147396147397147398147399147400147401147402147403147404147405147406147407147408147409147410147411147412147413147414147415147416147417147418147419147420147421147422147423147424147425147426147427147428147429147430147431147432147433147434147435147436147437147438147439147440147441147442147443147444147445147446147447147448147449147450147451147452147453147454147455147456147457147458147459147460147461147462147463147464147465147466147467147468147469147470147471147472147473147474147475147476147477147478147479147480147481147482147483147484147485147486147487147488147489147490147491147492147493147494147495147496147497147498147499147500147501147502147503147504147505147506147507147508147509147510147511147512147513147514147515147516147517147518147519147520147521147522147523147524147525147526147527147528147529147530147531147532147533147534147535147536147537147538147539147540147541147542147543147544147545147546147547147548147549147550147551147552147553147554147555147556147557147558147559147560147561147562147563147564147565147566147567147568147569147570147571147572147573147574147575147576147577147578147579147580147581147582147583147584147585147586147587147588147589147590147591147592147593147594147595147596147597147598147599147600147601147602147603147604147605147606147607147608147609147610147611147612147613147614147615147616147617147618147619147620147621147622147623147624147625147626147627147628147629147630147631147632147633147634147635147636147637147638147639147640147641147642147643147644147645147646147647147648147649147650147651147652147653147654147655147656147657147658147659147660147661147662147663147664147665147666147667147668147669147670147671147672147673147674147675147676147677147678147679147680147681147682147683147684147685147686147687147688147689147690147691147692147693147694147695147696147697147698147699147700147701147702147703147704147705147706147707147708147709147710147711147712147713147714147715147716147717147718147719147720147721147722147723147724147725147726147727147728147729147730147731147732147733147734147735147736147737147738147739147740147741147742147743147744147745147746147747147748147749147750147751147752147753147754147755147756147757147758147759147760147761147762147763147764147765147766147767147768147769147770147771147772147773147774147775147776147777147778147779147780147781147782147783147784147785147786147787147788147789147790147791147792147793147794147795147796147797147798147799147800147801147802147803147804147805147806147807147808147809147810147811147812147813147814147815147816147817147818147819147820147821147822147823147824147825147826147827147828147829147830147831147832147833147834147835147836147837147838147839147840147841147842147843147844147845147846147847147848147849147850147851147852147853147854147855147856147857147858147859147860147861147862147863147864147865147866147867147868147869147870147871147872147873147874147875147876147877147878147879147880147881147882147883147884147885147886147887147888147889147890147891147892147893147894147895147896147897147898147899147900147901147902147903147904147905147906147907147908147909147910147911147912147913147914147915147916147917147918147919147920147921147922147923147924147925147926147927147928147929147930147931147932147933147934147935147936147937147938147939147940147941147942147943147944147945147946147947147948147949147950147951147952147953147954147955147956147957147958147959147960147961147962147963147964147965147966147967147968147969147970147971147972147973147974147975147976147977147978147979147980147981147982147983147984147985147986147987147988147989147990147991147992147993147994147995147996147997147998147999148000148001148002148003148004148005148006148007148008148009148010148011148012148013148014148015148016148017148018148019148020148021148022148023148024148025148026148027148028148029148030148031148032148033148034148035148036148037148038148039148040148041148042148043148044148045148046148047148048148049148050148051148052148053148054148055148056148057148058148059148060148061148062148063148064148065148066148067148068148069148070148071148072148073148074148075148076148077148078148079148080148081148082148083148084148085148086148087148088148089148090148091148092148093148094148095148096148097148098148099148100148101148102148103148104148105148106148107148108148109148110148111148112148113148114148115148116148117148118148119148120148121148122148123148124148125148126148127148128148129148130148131148132148133148134148135148136148137148138148139148140148141148142148143148144148145148146148147148148148149148150148151148152148153148154148155148156148157148158148159148160148161148162148163148164148165148166148167148168148169148170148171148172148173148174148175148176148177148178148179148180148181148182148183148184148185148186148187148188148189148190148191148192148193148194148195148196148197148198148199148200148201148202148203148204148205148206148207148208148209148210148211148212148213148214148215148216148217148218148219148220148221148222148223148224148225148226148227148228148229148230148231148232148233148234148235148236148237148238148239148240148241148242148243148244148245148246148247148248148249148250148251148252148253148254148255148256148257148258148259148260148261148262148263148264148265148266148267148268148269148270148271148272148273148274148275148276148277148278148279148280148281148282148283148284148285148286148287148288148289148290148291148292148293148294148295148296148297148298148299148300148301148302148303148304148305148306148307148308148309148310148311148312148313148314148315148316148317148318148319148320148321148322148323148324148325148326148327148328148329148330148331148332148333148334148335148336148337148338148339148340148341148342148343148344148345148346148347148348148349148350148351148352148353148354148355148356148357148358148359148360148361148362148363148364148365148366148367148368148369148370148371148372148373148374148375148376148377148378148379148380148381148382148383148384148385148386148387148388148389148390148391148392148393148394148395148396148397148398148399148400148401148402148403148404148405148406148407148408148409148410148411148412148413148414148415148416148417148418148419148420148421148422148423148424148425148426148427148428148429148430148431148432148433148434148435148436148437148438148439148440148441148442148443148444148445148446148447148448148449148450148451148452148453148454148455148456148457148458148459148460148461148462148463148464148465148466148467148468148469148470148471148472148473148474148475148476148477148478148479148480148481148482148483148484148485148486148487148488148489148490148491148492148493148494148495148496148497148498148499148500148501148502148503148504148505148506148507148508148509148510148511148512148513148514148515148516148517148518148519148520148521148522148523148524148525148526148527148528148529148530148531148532148533148534148535148536148537148538148539148540148541148542148543148544148545148546148547148548148549148550148551148552148553148554148555148556148557148558148559148560148561148562148563148564148565148566148567148568148569148570148571148572148573148574148575148576148577148578148579148580148581148582148583148584148585148586148587148588148589148590148591148592148593148594148595148596148597148598148599148600148601148602148603148604148605148606148607148608148609148610148611148612148613148614148615148616148617148618148619148620148621148622148623148624148625148626148627148628148629148630148631148632148633148634148635148636148637148638148639148640148641148642148643148644148645148646148647148648148649148650148651148652148653148654148655148656148657148658148659148660148661148662148663148664148665148666148667148668148669148670148671148672148673148674148675148676148677148678148679148680148681148682148683148684148685148686148687148688148689148690148691148692148693148694148695148696148697148698148699148700148701148702148703148704148705148706148707148708148709148710148711148712148713148714148715148716148717148718148719148720148721148722148723148724148725148726148727148728148729148730148731148732148733148734148735148736148737148738148739148740148741148742148743148744148745148746148747148748148749148750148751148752148753148754148755148756148757148758148759148760148761148762148763148764148765148766148767148768148769148770148771148772148773148774148775148776148777148778148779148780148781148782148783148784148785148786148787148788148789148790148791148792148793148794148795148796148797148798148799148800148801148802148803148804148805148806148807148808148809148810148811148812148813148814148815148816148817148818148819148820148821148822148823148824148825148826148827148828148829148830148831148832148833148834148835148836148837148838148839148840148841148842148843148844148845148846148847148848148849148850148851148852148853148854148855148856148857148858148859148860148861148862148863148864148865148866148867148868148869148870148871148872148873148874148875148876148877148878148879148880148881148882148883148884148885148886148887148888148889148890148891148892148893148894148895148896148897148898148899148900148901148902148903148904148905148906148907148908148909148910148911148912148913148914148915148916148917148918148919148920148921148922148923148924148925148926148927148928148929148930148931148932148933148934148935148936148937148938148939148940148941148942148943148944148945148946148947148948148949148950148951148952148953148954148955148956148957148958148959148960148961148962148963148964148965148966148967148968148969148970148971148972148973148974148975148976148977148978148979148980148981148982148983148984148985148986148987148988148989148990148991148992148993148994148995148996148997148998148999149000149001149002149003149004149005149006149007149008149009149010149011149012149013149014149015149016149017149018149019149020149021149022149023149024149025149026149027149028149029149030149031149032149033149034149035149036149037149038149039149040149041149042149043149044149045149046149047149048149049149050149051149052149053149054149055149056149057149058149059149060149061149062149063149064149065149066149067149068149069149070149071149072149073149074149075149076149077149078149079149080149081149082149083149084149085149086149087149088149089149090149091149092149093149094149095149096149097149098149099149100149101149102149103149104149105149106149107149108149109149110149111149112149113149114149115149116149117149118149119149120149121149122149123149124149125149126149127149128149129149130149131149132149133149134149135149136149137149138149139149140149141149142149143149144149145149146149147149148149149149150149151149152149153149154149155149156149157149158149159149160149161149162149163149164149165149166149167149168149169149170149171149172149173149174149175149176149177149178149179149180149181149182149183149184149185149186149187149188149189149190149191149192149193149194149195149196149197149198149199149200149201149202149203149204149205149206149207149208149209149210149211149212149213149214149215149216149217149218149219149220149221149222149223149224149225149226149227149228149229149230149231149232149233149234149235149236149237149238149239149240149241149242149243149244149245149246149247149248149249149250149251149252149253149254149255149256149257149258149259149260149261149262149263149264149265149266149267149268149269149270149271149272149273149274149275149276149277149278149279149280149281149282149283149284149285149286149287149288149289149290149291149292149293149294149295149296149297149298149299149300149301149302149303149304149305149306149307149308149309149310149311149312149313149314149315149316149317149318149319149320149321149322149323149324149325149326149327149328149329149330149331149332149333149334149335149336149337149338149339149340149341149342149343149344149345149346149347149348149349149350149351149352149353149354149355149356149357149358149359149360149361149362149363149364149365149366149367149368149369149370149371149372149373149374149375149376149377149378149379149380149381149382149383149384149385149386149387149388149389149390149391149392149393149394149395149396149397149398149399149400149401149402149403149404149405149406149407149408149409149410149411149412149413149414149415149416149417149418149419149420149421149422149423149424149425149426149427149428149429149430149431149432149433149434149435149436149437149438149439149440149441149442149443149444149445149446149447149448149449149450149451149452149453149454149455149456149457149458149459149460149461149462149463149464149465149466149467149468149469149470149471149472149473149474149475149476149477149478149479149480149481149482149483149484149485149486149487149488149489149490149491149492149493149494149495149496149497149498149499149500149501149502149503149504149505149506149507149508149509149510149511149512149513149514149515149516149517149518149519149520149521149522149523149524149525149526149527149528149529149530149531149532149533149534149535149536149537149538149539149540149541149542149543149544149545149546149547149548149549149550149551149552149553149554149555149556149557149558149559149560149561149562149563149564149565149566149567149568149569149570149571149572149573149574149575149576149577149578149579149580149581149582149583149584149585149586149587149588149589149590149591149592149593149594149595149596149597149598149599149600149601149602149603149604149605149606149607149608149609149610149611149612149613149614149615149616149617149618149619149620149621149622149623149624149625149626149627149628149629149630149631149632149633149634149635149636149637149638149639149640149641149642149643149644149645149646149647149648149649149650149651149652149653149654149655149656149657149658149659149660149661149662149663149664149665149666149667149668149669149670149671149672149673149674149675149676149677149678149679149680149681149682149683149684149685149686149687149688149689149690149691149692149693149694149695149696149697149698149699149700149701149702149703149704149705149706149707149708149709149710149711149712149713149714149715149716149717149718149719149720149721149722149723149724149725149726149727149728149729149730149731149732149733149734149735149736149737149738149739149740149741149742149743149744149745149746149747149748149749149750149751149752149753149754149755149756149757149758149759149760149761149762149763149764149765149766149767149768149769149770149771149772149773149774149775149776149777149778149779149780149781149782149783149784149785149786149787149788149789149790149791149792149793149794149795149796149797149798149799149800149801149802149803149804149805149806149807149808149809149810149811149812149813149814149815149816149817149818149819149820149821149822149823149824149825149826149827149828149829149830149831149832149833149834149835149836149837149838149839149840149841149842149843149844149845149846149847149848149849149850149851149852149853149854149855149856149857149858149859149860149861149862149863149864149865149866149867149868149869149870149871149872149873149874149875149876149877149878149879149880149881149882149883149884149885
  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 block":"Edit block","Edit link":"Edit link","Edit source":"Edit source","Editor toolbar":"Editor toolbar","Empty snippet content":"Empty snippet content","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","HTML snippet":"HTML snippet","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 HTML":"Insert HTML","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","No preview available":"No preview available","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","Paste raw HTML here...":"Paste raw HTML here...",Previous:"Previous",Purple:"Purple",Red:"Red",Redo:"Redo","Remove color":"Remove color","Remove Format":"Remove Format","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","Save changes":"Save changes","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/ckeditor5-adapter-ckfinder/src/uploadadapter.js":
  104. /*!********************************************************************************!*\
  105. !*** ./node_modules/@ckeditor/ckeditor5-adapter-ckfinder/src/uploadadapter.js ***!
  106. \********************************************************************************/
  107. /*! exports provided: default */
  108. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  109. "use strict";
  110. __webpack_require__.r(__webpack_exports__);
  111. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return CKFinderUploadAdapter; });
  112. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  113. /* harmony import */ var ckeditor5_src_upload__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/upload */ "./node_modules/ckeditor5/src/upload.js");
  114. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils */ "./node_modules/@ckeditor/ckeditor5-adapter-ckfinder/src/utils.js");
  115. /**
  116. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  117. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  118. */
  119. /* globals XMLHttpRequest, FormData */
  120. /**
  121. * @module adapter-ckfinder/uploadadapter
  122. */
  123. /**
  124. * A plugin that enables file uploads in CKEditor 5 using the CKFinder server–side connector.
  125. *
  126. * See the {@glink features/image-upload/ckfinder "CKFinder file manager integration" guide} to learn how to configure
  127. * and use this feature as well as find out more about the full integration with the file manager
  128. * provided by the {@link module:ckfinder/ckfinder~CKFinder} plugin.
  129. *
  130. * Check out the {@glink features/image-upload/image-upload comprehensive "Image upload overview"} to learn about
  131. * other ways to upload images into CKEditor 5.
  132. *
  133. * @extends module:core/plugin~Plugin
  134. */
  135. class CKFinderUploadAdapter extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  136. /**
  137. * @inheritDoc
  138. */
  139. static get requires() {
  140. return [ ckeditor5_src_upload__WEBPACK_IMPORTED_MODULE_1__["FileRepository"] ];
  141. }
  142. /**
  143. * @inheritDoc
  144. */
  145. static get pluginName() {
  146. return 'CKFinderUploadAdapter';
  147. }
  148. /**
  149. * @inheritDoc
  150. */
  151. init() {
  152. const url = this.editor.config.get( 'ckfinder.uploadUrl' );
  153. if ( !url ) {
  154. return;
  155. }
  156. // Register CKFinderAdapter
  157. this.editor.plugins.get( ckeditor5_src_upload__WEBPACK_IMPORTED_MODULE_1__["FileRepository"] ).createUploadAdapter = loader => new UploadAdapter( loader, url, this.editor.t );
  158. }
  159. }
  160. /**
  161. * Upload adapter for CKFinder.
  162. *
  163. * @private
  164. * @implements module:upload/filerepository~UploadAdapter
  165. */
  166. class UploadAdapter {
  167. /**
  168. * Creates a new adapter instance.
  169. *
  170. * @param {module:upload/filerepository~FileLoader} loader
  171. * @param {String} url
  172. * @param {module:utils/locale~Locale#t} t
  173. */
  174. constructor( loader, url, t ) {
  175. /**
  176. * FileLoader instance to use during the upload.
  177. *
  178. * @member {module:upload/filerepository~FileLoader} #loader
  179. */
  180. this.loader = loader;
  181. /**
  182. * Upload URL.
  183. *
  184. * @member {String} #url
  185. */
  186. this.url = url;
  187. /**
  188. * Locale translation method.
  189. *
  190. * @member {module:utils/locale~Locale#t} #t
  191. */
  192. this.t = t;
  193. }
  194. /**
  195. * Starts the upload process.
  196. *
  197. * @see module:upload/filerepository~UploadAdapter#upload
  198. * @returns {Promise.<Object>}
  199. */
  200. upload() {
  201. return this.loader.file.then( file => {
  202. return new Promise( ( resolve, reject ) => {
  203. this._initRequest();
  204. this._initListeners( resolve, reject, file );
  205. this._sendRequest( file );
  206. } );
  207. } );
  208. }
  209. /**
  210. * Aborts the upload process.
  211. *
  212. * @see module:upload/filerepository~UploadAdapter#abort
  213. */
  214. abort() {
  215. if ( this.xhr ) {
  216. this.xhr.abort();
  217. }
  218. }
  219. /**
  220. * Initializes the XMLHttpRequest object.
  221. *
  222. * @private
  223. */
  224. _initRequest() {
  225. const xhr = this.xhr = new XMLHttpRequest();
  226. xhr.open( 'POST', this.url, true );
  227. xhr.responseType = 'json';
  228. }
  229. /**
  230. * Initializes XMLHttpRequest listeners.
  231. *
  232. * @private
  233. * @param {Function} resolve Callback function to be called when the request is successful.
  234. * @param {Function} reject Callback function to be called when the request cannot be completed.
  235. * @param {File} file File instance to be uploaded.
  236. */
  237. _initListeners( resolve, reject, file ) {
  238. const xhr = this.xhr;
  239. const loader = this.loader;
  240. const t = this.t;
  241. const genericError = t( 'Cannot upload file:' ) + ` ${ file.name }.`;
  242. xhr.addEventListener( 'error', () => reject( genericError ) );
  243. xhr.addEventListener( 'abort', () => reject() );
  244. xhr.addEventListener( 'load', () => {
  245. const response = xhr.response;
  246. if ( !response || !response.uploaded ) {
  247. return reject( response && response.error && response.error.message ? response.error.message : genericError );
  248. }
  249. resolve( {
  250. default: response.url
  251. } );
  252. } );
  253. // Upload progress when it's supported.
  254. /* istanbul ignore else */
  255. if ( xhr.upload ) {
  256. xhr.upload.addEventListener( 'progress', evt => {
  257. if ( evt.lengthComputable ) {
  258. loader.uploadTotal = evt.total;
  259. loader.uploaded = evt.loaded;
  260. }
  261. } );
  262. }
  263. }
  264. /**
  265. * Prepares the data and sends the request.
  266. *
  267. * @private
  268. * @param {File} file File instance to be uploaded.
  269. */
  270. _sendRequest( file ) {
  271. // Prepare form data.
  272. const data = new FormData();
  273. data.append( 'upload', file );
  274. data.append( 'ckCsrfToken', Object(_utils__WEBPACK_IMPORTED_MODULE_2__["getCsrfToken"])() );
  275. // Send request.
  276. this.xhr.send( data );
  277. }
  278. }
  279. /***/ }),
  280. /***/ "./node_modules/@ckeditor/ckeditor5-adapter-ckfinder/src/utils.js":
  281. /*!************************************************************************!*\
  282. !*** ./node_modules/@ckeditor/ckeditor5-adapter-ckfinder/src/utils.js ***!
  283. \************************************************************************/
  284. /*! exports provided: getCsrfToken, getCookie, setCookie */
  285. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  286. "use strict";
  287. __webpack_require__.r(__webpack_exports__);
  288. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getCsrfToken", function() { return getCsrfToken; });
  289. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getCookie", function() { return getCookie; });
  290. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setCookie", function() { return setCookie; });
  291. /**
  292. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  293. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  294. */
  295. /* globals window, document */
  296. /**
  297. * @module adapter-ckfinder/utils
  298. */
  299. const TOKEN_COOKIE_NAME = 'ckCsrfToken';
  300. const TOKEN_LENGTH = 40;
  301. const tokenCharset = 'abcdefghijklmnopqrstuvwxyz0123456789';
  302. /**
  303. * Returns the CSRF token value. The value is a hash stored in `document.cookie`
  304. * under the `ckCsrfToken` key. The CSRF token can be used to secure the communication
  305. * between the web browser and the CKFinder server.
  306. *
  307. * @returns {String}
  308. */
  309. function getCsrfToken() {
  310. let token = getCookie( TOKEN_COOKIE_NAME );
  311. if ( !token || token.length != TOKEN_LENGTH ) {
  312. token = generateToken( TOKEN_LENGTH );
  313. setCookie( TOKEN_COOKIE_NAME, token );
  314. }
  315. return token;
  316. }
  317. /**
  318. * Returns the value of the cookie with a given name or `null` if the cookie is not found.
  319. *
  320. * @param {String} name
  321. * @returns {String|null}
  322. */
  323. function getCookie( name ) {
  324. name = name.toLowerCase();
  325. const parts = document.cookie.split( ';' );
  326. for ( const part of parts ) {
  327. const pair = part.split( '=' );
  328. const key = decodeURIComponent( pair[ 0 ].trim().toLowerCase() );
  329. if ( key === name ) {
  330. return decodeURIComponent( pair[ 1 ] );
  331. }
  332. }
  333. return null;
  334. }
  335. /**
  336. * Sets the value of the cookie with a given name.
  337. *
  338. * @param {String} name
  339. * @param {String} value
  340. */
  341. function setCookie( name, value ) {
  342. document.cookie = encodeURIComponent( name ) + '=' + encodeURIComponent( value ) + ';path=/';
  343. }
  344. // Generates the CSRF token with the given length.
  345. //
  346. // @private
  347. // @param {Number} length
  348. // @returns {string}
  349. function generateToken( length ) {
  350. let result = '';
  351. const randValues = new Uint8Array( length );
  352. window.crypto.getRandomValues( randValues );
  353. for ( let j = 0; j < randValues.length; j++ ) {
  354. const character = tokenCharset.charAt( randValues[ j ] % tokenCharset.length );
  355. result += Math.random() > 0.5 ? character.toUpperCase() : character;
  356. }
  357. return result;
  358. }
  359. /***/ }),
  360. /***/ "./node_modules/@ckeditor/ckeditor5-alignment/src/alignment.js":
  361. /*!*********************************************************************!*\
  362. !*** ./node_modules/@ckeditor/ckeditor5-alignment/src/alignment.js ***!
  363. \*********************************************************************/
  364. /*! exports provided: default */
  365. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  366. "use strict";
  367. __webpack_require__.r(__webpack_exports__);
  368. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Alignment; });
  369. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  370. /* harmony import */ var _alignmentediting__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./alignmentediting */ "./node_modules/@ckeditor/ckeditor5-alignment/src/alignmentediting.js");
  371. /* harmony import */ var _alignmentui__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./alignmentui */ "./node_modules/@ckeditor/ckeditor5-alignment/src/alignmentui.js");
  372. /**
  373. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  374. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  375. */
  376. /**
  377. * @module alignment/alignment
  378. */
  379. /**
  380. * The text alignment plugin.
  381. *
  382. * For a detailed overview, check the {@glink features/text-alignment Text alignment feature documentation}
  383. * and the {@glink api/alignment package page}.
  384. *
  385. * This is a "glue" plugin which loads the {@link module:alignment/alignmentediting~AlignmentEditing} and
  386. * {@link module:alignment/alignmentui~AlignmentUI} plugins.
  387. *
  388. * @extends module:core/plugin~Plugin
  389. */
  390. class Alignment extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  391. /**
  392. * @inheritDoc
  393. */
  394. static get requires() {
  395. return [ _alignmentediting__WEBPACK_IMPORTED_MODULE_1__["default"], _alignmentui__WEBPACK_IMPORTED_MODULE_2__["default"] ];
  396. }
  397. /**
  398. * @inheritDoc
  399. */
  400. static get pluginName() {
  401. return 'Alignment';
  402. }
  403. }
  404. /**
  405. * The configuration of the {@link module:alignment/alignment~Alignment alignment feature}.
  406. *
  407. * Read more in {@link module:alignment/alignment~AlignmentConfig}.
  408. *
  409. * @member {module:alignment/alignment~AlignmentConfig} module:core/editor/editorconfig~EditorConfig#alignment
  410. */
  411. /**
  412. * The configuration of the {@link module:alignment/alignment~Alignment alignment feature}.
  413. *
  414. * ClassicEditor
  415. * .create( editorElement, {
  416. * alignment: {
  417. * options: [ 'left', 'right' ]
  418. * }
  419. * } )
  420. * .then( ... )
  421. * .catch( ... );
  422. *
  423. * See {@link module:core/editor/editorconfig~EditorConfig all editor configuration options}.
  424. *
  425. * @interface AlignmentConfig
  426. */
  427. /**
  428. * Available alignment options.
  429. *
  430. * The available options are: `'left'`, `'right'`, `'center'` and `'justify'`. Other values are ignored.
  431. *
  432. * **Note:** It is recommended to always use `'left'` or `'right'` as these are default values which the user should
  433. * normally be able to choose depending on the
  434. * {@glink features/ui-language#setting-the-language-of-the-content language of the editor content}.
  435. *
  436. * ClassicEditor
  437. * .create( editorElement, {
  438. * alignment: {
  439. * options: [ 'left', 'right' ]
  440. * }
  441. * } )
  442. * .then( ... )
  443. * .catch( ... );
  444. *
  445. * By default the alignment is set inline using the `text-align` CSS property. To further customize the alignment,
  446. * you can provide names of classes for each alignment option using the `className` property.
  447. *
  448. * **Note:** Once you define the `className` property for one option, you need to specify it for all other options.
  449. *
  450. * ClassicEditor
  451. * .create( editorElement, {
  452. * alignment: {
  453. * options: [
  454. * { name: 'left', className: 'my-align-left' },
  455. * { name: 'right', className: 'my-align-right' }
  456. * ]
  457. * }
  458. * } )
  459. * .then( ... )
  460. * .catch( ... );
  461. *
  462. * See the demo of {@glink features/text-alignment#configuring-alignment-options custom alignment options}.
  463. *
  464. * @member {Array.<String|module:alignment/alignmentediting~AlignmentFormat>} module:alignment/alignment~AlignmentConfig#options
  465. */
  466. /***/ }),
  467. /***/ "./node_modules/@ckeditor/ckeditor5-alignment/src/alignmentcommand.js":
  468. /*!****************************************************************************!*\
  469. !*** ./node_modules/@ckeditor/ckeditor5-alignment/src/alignmentcommand.js ***!
  470. \****************************************************************************/
  471. /*! exports provided: default */
  472. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  473. "use strict";
  474. __webpack_require__.r(__webpack_exports__);
  475. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return AlignmentCommand; });
  476. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  477. /* harmony import */ var ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/utils */ "./node_modules/ckeditor5/src/utils.js");
  478. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils */ "./node_modules/@ckeditor/ckeditor5-alignment/src/utils.js");
  479. /**
  480. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  481. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  482. */
  483. /**
  484. * @module alignment/alignmentcommand
  485. */
  486. const ALIGNMENT = 'alignment';
  487. /**
  488. * The alignment command plugin.
  489. *
  490. * @extends module:core/command~Command
  491. */
  492. class AlignmentCommand extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Command"] {
  493. /**
  494. * @inheritDoc
  495. */
  496. refresh() {
  497. const editor = this.editor;
  498. const locale = editor.locale;
  499. const firstBlock = Object(ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_1__["first"])( this.editor.model.document.selection.getSelectedBlocks() );
  500. // As first check whether to enable or disable the command as the value will always be false if the command cannot be enabled.
  501. this.isEnabled = !!firstBlock && this._canBeAligned( firstBlock );
  502. /**
  503. * A value of the current block's alignment.
  504. *
  505. * @observable
  506. * @readonly
  507. * @member {String} #value
  508. */
  509. if ( this.isEnabled && firstBlock.hasAttribute( 'alignment' ) ) {
  510. this.value = firstBlock.getAttribute( 'alignment' );
  511. } else {
  512. this.value = locale.contentLanguageDirection === 'rtl' ? 'right' : 'left';
  513. }
  514. }
  515. /**
  516. * Executes the command. Applies the alignment `value` to the selected blocks.
  517. * If no `value` is passed, the `value` is the default one or it is equal to the currently selected block's alignment attribute,
  518. * the command will remove the attribute from the selected blocks.
  519. *
  520. * @param {Object} [options] Options for the executed command.
  521. * @param {String} [options.value] The value to apply.
  522. * @fires execute
  523. */
  524. execute( options = {} ) {
  525. const editor = this.editor;
  526. const locale = editor.locale;
  527. const model = editor.model;
  528. const doc = model.document;
  529. const value = options.value;
  530. model.change( writer => {
  531. // Get only those blocks from selected that can have alignment set
  532. const blocks = Array.from( doc.selection.getSelectedBlocks() ).filter( block => this._canBeAligned( block ) );
  533. const currentAlignment = blocks[ 0 ].getAttribute( 'alignment' );
  534. // Remove alignment attribute if current alignment is:
  535. // - default (should not be stored in model as it will bloat model data)
  536. // - equal to currently set
  537. // - or no value is passed - denotes default alignment.
  538. const removeAlignment = Object(_utils__WEBPACK_IMPORTED_MODULE_2__["isDefault"])( value, locale ) || currentAlignment === value || !value;
  539. if ( removeAlignment ) {
  540. removeAlignmentFromSelection( blocks, writer );
  541. } else {
  542. setAlignmentOnSelection( blocks, writer, value );
  543. }
  544. } );
  545. }
  546. /**
  547. * Checks whether a block can have alignment set.
  548. *
  549. * @private
  550. * @param {module:engine/model/element~Element} block The block to be checked.
  551. * @returns {Boolean}
  552. */
  553. _canBeAligned( block ) {
  554. return this.editor.model.schema.checkAttribute( block, ALIGNMENT );
  555. }
  556. }
  557. // Removes the alignment attribute from blocks.
  558. // @private
  559. function removeAlignmentFromSelection( blocks, writer ) {
  560. for ( const block of blocks ) {
  561. writer.removeAttribute( ALIGNMENT, block );
  562. }
  563. }
  564. // Sets the alignment attribute on blocks.
  565. // @private
  566. function setAlignmentOnSelection( blocks, writer, alignment ) {
  567. for ( const block of blocks ) {
  568. writer.setAttribute( ALIGNMENT, alignment, block );
  569. }
  570. }
  571. /***/ }),
  572. /***/ "./node_modules/@ckeditor/ckeditor5-alignment/src/alignmentediting.js":
  573. /*!****************************************************************************!*\
  574. !*** ./node_modules/@ckeditor/ckeditor5-alignment/src/alignmentediting.js ***!
  575. \****************************************************************************/
  576. /*! exports provided: default */
  577. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  578. "use strict";
  579. __webpack_require__.r(__webpack_exports__);
  580. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return AlignmentEditing; });
  581. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  582. /* harmony import */ var _alignmentcommand__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./alignmentcommand */ "./node_modules/@ckeditor/ckeditor5-alignment/src/alignmentcommand.js");
  583. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils */ "./node_modules/@ckeditor/ckeditor5-alignment/src/utils.js");
  584. /**
  585. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  586. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  587. */
  588. /**
  589. * @module alignment/alignmentediting
  590. */
  591. /**
  592. * The alignment editing feature. It introduces the {@link module:alignment/alignmentcommand~AlignmentCommand command} and adds
  593. * the `alignment` attribute for block elements in the {@link module:engine/model/model~Model model}.
  594. * @extends module:core/plugin~Plugin
  595. */
  596. class AlignmentEditing extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  597. /**
  598. * @inheritDoc
  599. */
  600. static get pluginName() {
  601. return 'AlignmentEditing';
  602. }
  603. /**
  604. * @inheritDoc
  605. */
  606. constructor( editor ) {
  607. super( editor );
  608. editor.config.define( 'alignment', {
  609. options: [ ..._utils__WEBPACK_IMPORTED_MODULE_2__["supportedOptions"].map( option => ( { name: option } ) ) ]
  610. } );
  611. }
  612. /**
  613. * @inheritDoc
  614. */
  615. init() {
  616. const editor = this.editor;
  617. const locale = editor.locale;
  618. const schema = editor.model.schema;
  619. const options = Object(_utils__WEBPACK_IMPORTED_MODULE_2__["normalizeAlignmentOptions"])( editor.config.get( 'alignment.options' ) );
  620. // Filter out unsupported options and those that are redundant, e.g. `left` in LTR / `right` in RTL mode.
  621. const optionsToConvert = options.filter(
  622. option => Object(_utils__WEBPACK_IMPORTED_MODULE_2__["isSupported"])( option.name ) && !Object(_utils__WEBPACK_IMPORTED_MODULE_2__["isDefault"])( option.name, locale )
  623. );
  624. // Once there is at least one `className` defined, we switch to alignment with classes.
  625. const shouldUseClasses = optionsToConvert.some( option => !!option.className );
  626. // Allow alignment attribute on all blocks.
  627. schema.extend( '$block', { allowAttributes: 'alignment' } );
  628. editor.model.schema.setAttributeProperties( 'alignment', { isFormatting: true } );
  629. if ( shouldUseClasses ) {
  630. editor.conversion.attributeToAttribute( buildClassDefinition( optionsToConvert ) );
  631. } else {
  632. // Downcast inline styles.
  633. editor.conversion.for( 'downcast' ).attributeToAttribute( buildDowncastInlineDefinition( optionsToConvert ) );
  634. }
  635. const upcastInlineDefinitions = buildUpcastInlineDefinitions( optionsToConvert );
  636. // Always upcast from inline styles.
  637. for ( const definition of upcastInlineDefinitions ) {
  638. editor.conversion.for( 'upcast' ).attributeToAttribute( definition );
  639. }
  640. const upcastCompatibilityDefinitions = buildUpcastCompatibilityDefinitions( optionsToConvert );
  641. // Always upcast from deprecated `align` attribute.
  642. for ( const definition of upcastCompatibilityDefinitions ) {
  643. editor.conversion.for( 'upcast' ).attributeToAttribute( definition );
  644. }
  645. editor.commands.add( 'alignment', new _alignmentcommand__WEBPACK_IMPORTED_MODULE_1__["default"]( editor ) );
  646. }
  647. }
  648. // Prepare downcast conversion definition for inline alignment styling.
  649. // @private
  650. function buildDowncastInlineDefinition( options ) {
  651. const definition = {
  652. model: {
  653. key: 'alignment',
  654. values: options.map( option => option.name )
  655. },
  656. view: {}
  657. };
  658. for ( const { name } of options ) {
  659. definition.view[ name ] = {
  660. key: 'style',
  661. value: {
  662. 'text-align': name
  663. }
  664. };
  665. }
  666. return definition;
  667. }
  668. // Prepare upcast definitions for inline alignment styles.
  669. // @private
  670. function buildUpcastInlineDefinitions( options ) {
  671. const definitions = [];
  672. for ( const { name } of options ) {
  673. definitions.push( {
  674. view: {
  675. key: 'style',
  676. value: {
  677. 'text-align': name
  678. }
  679. },
  680. model: {
  681. key: 'alignment',
  682. value: name
  683. }
  684. } );
  685. }
  686. return definitions;
  687. }
  688. // Prepare upcast definitions for deprecated `align` attribute.
  689. // @private
  690. function buildUpcastCompatibilityDefinitions( options ) {
  691. const definitions = [];
  692. for ( const { name } of options ) {
  693. definitions.push( {
  694. view: {
  695. key: 'align',
  696. value: name
  697. },
  698. model: {
  699. key: 'alignment',
  700. value: name
  701. }
  702. } );
  703. }
  704. return definitions;
  705. }
  706. // Prepare conversion definitions for upcast and downcast alignment with classes.
  707. // @private
  708. function buildClassDefinition( options ) {
  709. const definition = {
  710. model: {
  711. key: 'alignment',
  712. values: options.map( option => option.name )
  713. },
  714. view: {}
  715. };
  716. for ( const option of options ) {
  717. definition.view[ option.name ] = {
  718. key: 'class',
  719. value: option.className
  720. };
  721. }
  722. return definition;
  723. }
  724. /**
  725. * The alignment configuration format descriptor.
  726. *
  727. * const alignmentFormat = {
  728. * name: 'right',
  729. * className: 'my-align-right-class'
  730. * }
  731. *
  732. * @typedef {Object} module:alignment/alignmentediting~AlignmentFormat
  733. *
  734. * @property {'left'|'right'|'center'|'justify'} name One of the alignment names options.
  735. *
  736. * @property {String} className The CSS class used to represent the style in the view.
  737. * Used to override default, inline styling for alignment.
  738. */
  739. /***/ }),
  740. /***/ "./node_modules/@ckeditor/ckeditor5-alignment/src/alignmentui.js":
  741. /*!***********************************************************************!*\
  742. !*** ./node_modules/@ckeditor/ckeditor5-alignment/src/alignmentui.js ***!
  743. \***********************************************************************/
  744. /*! exports provided: default */
  745. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  746. "use strict";
  747. __webpack_require__.r(__webpack_exports__);
  748. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return AlignmentUI; });
  749. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  750. /* harmony import */ var ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/ui */ "./node_modules/ckeditor5/src/ui.js");
  751. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils */ "./node_modules/@ckeditor/ckeditor5-alignment/src/utils.js");
  752. /**
  753. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  754. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  755. */
  756. /**
  757. * @module alignment/alignmentui
  758. */
  759. const iconsMap = new Map( [
  760. [ 'left', ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["icons"].alignLeft ],
  761. [ 'right', ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["icons"].alignRight ],
  762. [ 'center', ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["icons"].alignCenter ],
  763. [ 'justify', ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["icons"].alignJustify ]
  764. ] );
  765. /**
  766. * The default alignment UI plugin.
  767. *
  768. * It introduces the `'alignment:left'`, `'alignment:right'`, `'alignment:center'` and `'alignment:justify'` buttons
  769. * and the `'alignment'` dropdown.
  770. *
  771. * @extends module:core/plugin~Plugin
  772. */
  773. class AlignmentUI extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  774. /**
  775. * Returns the localized option titles provided by the plugin.
  776. *
  777. * The following localized titles corresponding with
  778. * {@link module:alignment/alignment~AlignmentConfig#options} are available:
  779. *
  780. * * `'left'`,
  781. * * `'right'`,
  782. * * `'center'`,
  783. * * `'justify'`.
  784. *
  785. * @readonly
  786. * @type {Object.<String,String>}
  787. */
  788. get localizedOptionTitles() {
  789. const t = this.editor.t;
  790. return {
  791. 'left': t( 'Align left' ),
  792. 'right': t( 'Align right' ),
  793. 'center': t( 'Align center' ),
  794. 'justify': t( 'Justify' )
  795. };
  796. }
  797. /**
  798. * @inheritDoc
  799. */
  800. static get pluginName() {
  801. return 'AlignmentUI';
  802. }
  803. /**
  804. * @inheritDoc
  805. */
  806. init() {
  807. const editor = this.editor;
  808. const componentFactory = editor.ui.componentFactory;
  809. const t = editor.t;
  810. const options = Object(_utils__WEBPACK_IMPORTED_MODULE_2__["normalizeAlignmentOptions"])( editor.config.get( 'alignment.options' ) );
  811. options
  812. .map( option => option.name )
  813. .filter( _utils__WEBPACK_IMPORTED_MODULE_2__["isSupported"] )
  814. .forEach( option => this._addButton( option ) );
  815. componentFactory.add( 'alignment', locale => {
  816. const dropdownView = Object(ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__["createDropdown"])( locale );
  817. // Add existing alignment buttons to dropdown's toolbar.
  818. const buttons = options.map( option => componentFactory.create( `alignment:${ option.name }` ) );
  819. Object(ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__["addToolbarToDropdown"])( dropdownView, buttons );
  820. // Configure dropdown properties an behavior.
  821. dropdownView.buttonView.set( {
  822. label: t( 'Text alignment' ),
  823. tooltip: true
  824. } );
  825. dropdownView.toolbarView.isVertical = true;
  826. dropdownView.toolbarView.ariaLabel = t( 'Text alignment toolbar' );
  827. dropdownView.extendTemplate( {
  828. attributes: {
  829. class: 'ck-alignment-dropdown'
  830. }
  831. } );
  832. // The default icon depends on the direction of the content.
  833. const defaultIcon = locale.contentLanguageDirection === 'rtl' ? iconsMap.get( 'right' ) : iconsMap.get( 'left' );
  834. // Change icon to reflect current selection's alignment.
  835. dropdownView.buttonView.bind( 'icon' ).toMany( buttons, 'isOn', ( ...areActive ) => {
  836. // Get the index of an active button.
  837. const index = areActive.findIndex( value => value );
  838. // If none of the commands is active, display either defaultIcon or the first button's icon.
  839. if ( index < 0 ) {
  840. return defaultIcon;
  841. }
  842. // Return active button's icon.
  843. return buttons[ index ].icon;
  844. } );
  845. // Enable button if any of the buttons is enabled.
  846. dropdownView.bind( 'isEnabled' ).toMany( buttons, 'isEnabled', ( ...areEnabled ) => areEnabled.some( isEnabled => isEnabled ) );
  847. return dropdownView;
  848. } );
  849. }
  850. /**
  851. * Helper method for initializing the button and linking it with an appropriate command.
  852. *
  853. * @private
  854. * @param {String} option The name of the alignment option for which the button is added.
  855. */
  856. _addButton( option ) {
  857. const editor = this.editor;
  858. editor.ui.componentFactory.add( `alignment:${ option }`, locale => {
  859. const command = editor.commands.get( 'alignment' );
  860. const buttonView = new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__["ButtonView"]( locale );
  861. buttonView.set( {
  862. label: this.localizedOptionTitles[ option ],
  863. icon: iconsMap.get( option ),
  864. tooltip: true,
  865. isToggleable: true
  866. } );
  867. // Bind button model to command.
  868. buttonView.bind( 'isEnabled' ).to( command );
  869. buttonView.bind( 'isOn' ).to( command, 'value', value => value === option );
  870. // Execute command.
  871. this.listenTo( buttonView, 'execute', () => {
  872. editor.execute( 'alignment', { value: option } );
  873. editor.editing.view.focus();
  874. } );
  875. return buttonView;
  876. } );
  877. }
  878. }
  879. /***/ }),
  880. /***/ "./node_modules/@ckeditor/ckeditor5-alignment/src/utils.js":
  881. /*!*****************************************************************!*\
  882. !*** ./node_modules/@ckeditor/ckeditor5-alignment/src/utils.js ***!
  883. \*****************************************************************/
  884. /*! exports provided: supportedOptions, isSupported, isDefault, normalizeAlignmentOptions */
  885. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  886. "use strict";
  887. __webpack_require__.r(__webpack_exports__);
  888. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "supportedOptions", function() { return supportedOptions; });
  889. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isSupported", function() { return isSupported; });
  890. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isDefault", function() { return isDefault; });
  891. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "normalizeAlignmentOptions", function() { return normalizeAlignmentOptions; });
  892. /* harmony import */ var ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/utils */ "./node_modules/ckeditor5/src/utils.js");
  893. /**
  894. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  895. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  896. */
  897. /**
  898. * @module alignment/utils
  899. */
  900. /**
  901. * The list of supported alignment options:
  902. *
  903. * * `'left'`,
  904. * * `'right'`,
  905. * * `'center'`,
  906. * * `'justify'`
  907. */
  908. const supportedOptions = [ 'left', 'right', 'center', 'justify' ];
  909. /**
  910. * Checks whether the passed option is supported by {@link module:alignment/alignmentediting~AlignmentEditing}.
  911. *
  912. * @param {String} option The option value to check.
  913. * @returns {Boolean}
  914. */
  915. function isSupported( option ) {
  916. return supportedOptions.includes( option );
  917. }
  918. /**
  919. * Checks whether alignment is the default one considering the direction
  920. * of the editor content.
  921. *
  922. * @param {String} alignment The name of the alignment to check.
  923. * @param {module:utils/locale~Locale} locale The {@link module:core/editor/editor~Editor#locale} instance.
  924. * @returns {Boolean}
  925. */
  926. function isDefault( alignment, locale ) {
  927. // Right now only LTR is supported so the 'left' value is always the default one.
  928. if ( locale.contentLanguageDirection == 'rtl' ) {
  929. return alignment === 'right';
  930. } else {
  931. return alignment === 'left';
  932. }
  933. }
  934. /**
  935. * Brings the configuration to the common form, an array of objects.
  936. *
  937. * @param {Array.<String|module:alignment/alignmentediting~AlignmentFormat>} configuredOptions Alignment plugin configuration.
  938. * @returns {Array.<module:alignment/alignmentediting~AlignmentFormat>} Normalized object holding the configuration.
  939. */
  940. function normalizeAlignmentOptions( configuredOptions ) {
  941. const normalizedOptions = configuredOptions
  942. .map( option => {
  943. let result;
  944. if ( typeof option == 'string' ) {
  945. result = { name: option };
  946. } else {
  947. result = option;
  948. }
  949. return result;
  950. } )
  951. // Remove all unknown options.
  952. .filter( option => {
  953. const isNameValid = !!supportedOptions.includes( option.name );
  954. if ( !isNameValid ) {
  955. /**
  956. * The `name` in one of the `alignment.options` is not recognized.
  957. * The available options are: `'left'`, `'right'`, `'center'` and `'justify'`.
  958. *
  959. * @error alignment-config-name-not-recognized
  960. * @param {Object} option Options with unknown value of the `name` property.
  961. */
  962. Object(ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_0__["logWarning"])( 'alignment-config-name-not-recognized', { option } );
  963. }
  964. return isNameValid;
  965. } );
  966. const classNameCount = normalizedOptions.filter( option => !!option.className ).length;
  967. // We either use classes for all styling options or for none.
  968. if ( classNameCount && classNameCount < normalizedOptions.length ) {
  969. /**
  970. * The `className` property has to be defined for all options once at least one option declares `className`.
  971. *
  972. * @error alignment-config-classnames-are-missing
  973. * @param {Array.<String|module:alignment/alignmentediting~AlignmentFormat>} configuredOptions Contents of `alignment.options`.
  974. */
  975. throw new ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_0__["CKEditorError"]( 'alignment-config-classnames-are-missing', { configuredOptions } );
  976. }
  977. // Validate resulting config.
  978. normalizedOptions.forEach( ( option, index, allOptions ) => {
  979. const succeedingOptions = allOptions.slice( index + 1 );
  980. const nameAlreadyExists = succeedingOptions.some( item => item.name == option.name );
  981. if ( nameAlreadyExists ) {
  982. /**
  983. * The same `name` in one of the `alignment.options` was already declared.
  984. * Each `name` representing one alignment option can be set exactly once.
  985. *
  986. * @error alignment-config-name-already-defined
  987. * @param {Object} option First option that declares given `name`.
  988. * @param {Array.<String|module:alignment/alignmentediting~AlignmentFormat>} configuredOptions Contents of `alignment.options`.
  989. */
  990. throw new ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_0__["CKEditorError"]( 'alignment-config-name-already-defined', { option, configuredOptions } );
  991. }
  992. // The `className` property is present. Check for duplicates then.
  993. if ( option.className ) {
  994. const classNameAlreadyExists = succeedingOptions.some( item => item.className == option.className );
  995. if ( classNameAlreadyExists ) {
  996. /**
  997. * The same `className` in one of the `alignment.options` was already declared.
  998. *
  999. * @error alignment-config-classname-already-defined
  1000. * @param {Object} option First option that declares given `className`.
  1001. * @param {Array.<String|module:alignment/alignmentediting~AlignmentFormat>} configuredOptions
  1002. * Contents of `alignment.options`.
  1003. */
  1004. throw new ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_0__["CKEditorError"]( 'alignment-config-classname-already-defined', { option, configuredOptions } );
  1005. }
  1006. }
  1007. } );
  1008. return normalizedOptions;
  1009. }
  1010. /***/ }),
  1011. /***/ "./node_modules/@ckeditor/ckeditor5-autoformat/src/autoformat.js":
  1012. /*!***********************************************************************!*\
  1013. !*** ./node_modules/@ckeditor/ckeditor5-autoformat/src/autoformat.js ***!
  1014. \***********************************************************************/
  1015. /*! exports provided: default */
  1016. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1017. "use strict";
  1018. __webpack_require__.r(__webpack_exports__);
  1019. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Autoformat; });
  1020. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  1021. /* harmony import */ var _blockautoformatediting__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./blockautoformatediting */ "./node_modules/@ckeditor/ckeditor5-autoformat/src/blockautoformatediting.js");
  1022. /* harmony import */ var _inlineautoformatediting__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./inlineautoformatediting */ "./node_modules/@ckeditor/ckeditor5-autoformat/src/inlineautoformatediting.js");
  1023. /**
  1024. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  1025. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  1026. */
  1027. /**
  1028. * @module autoformat/autoformat
  1029. */
  1030. /**
  1031. * Enables a set of predefined autoformatting actions.
  1032. *
  1033. * For a detailed overview, check the {@glink features/autoformat Autoformatting feature documentation}
  1034. * and the {@glink api/autoformat package page}.
  1035. *
  1036. * @extends module:core/plugin~Plugin
  1037. */
  1038. class Autoformat extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  1039. /**
  1040. * @inheritDoc
  1041. */
  1042. static get pluginName() {
  1043. return 'Autoformat';
  1044. }
  1045. /**
  1046. * @inheritDoc
  1047. */
  1048. afterInit() {
  1049. this._addListAutoformats();
  1050. this._addBasicStylesAutoformats();
  1051. this._addHeadingAutoformats();
  1052. this._addBlockQuoteAutoformats();
  1053. this._addCodeBlockAutoformats();
  1054. this._addHorizontalLineAutoformats();
  1055. }
  1056. /**
  1057. * Adds autoformatting related to the {@link module:list/list~List}.
  1058. *
  1059. * When typed:
  1060. * - `* ` or `- ` &ndash; A paragraph will be changed to a bulleted list.
  1061. * - `1. ` or `1) ` &ndash; A paragraph will be changed to a numbered list ("1" can be any digit or a list of digits).
  1062. * - `[] ` or `[ ] ` &ndash; A paragraph will be changed to a to-do list.
  1063. * - `[x] ` or `[ x ] ` &ndash; A paragraph will be changed to a checked to-do list.
  1064. *
  1065. * @private
  1066. */
  1067. _addListAutoformats() {
  1068. const commands = this.editor.commands;
  1069. if ( commands.get( 'bulletedList' ) ) {
  1070. Object(_blockautoformatediting__WEBPACK_IMPORTED_MODULE_1__["default"])( this.editor, this, /^[*-]\s$/, 'bulletedList' );
  1071. }
  1072. if ( commands.get( 'numberedList' ) ) {
  1073. Object(_blockautoformatediting__WEBPACK_IMPORTED_MODULE_1__["default"])( this.editor, this, /^1[.|)]\s$/, 'numberedList' );
  1074. }
  1075. if ( commands.get( 'todoList' ) ) {
  1076. Object(_blockautoformatediting__WEBPACK_IMPORTED_MODULE_1__["default"])( this.editor, this, /^\[\s?\]\s$/, 'todoList' );
  1077. }
  1078. if ( commands.get( 'checkTodoList' ) ) {
  1079. Object(_blockautoformatediting__WEBPACK_IMPORTED_MODULE_1__["default"])( this.editor, this, /^\[\s?x\s?\]\s$/, () => {
  1080. this.editor.execute( 'todoList' );
  1081. this.editor.execute( 'checkTodoList' );
  1082. } );
  1083. }
  1084. }
  1085. /**
  1086. * Adds autoformatting related to the {@link module:basic-styles/bold~Bold},
  1087. * {@link module:basic-styles/italic~Italic}, {@link module:basic-styles/code~Code}
  1088. * and {@link module:basic-styles/strikethrough~Strikethrough}
  1089. *
  1090. * When typed:
  1091. * - `**foobar**` &ndash; `**` characters are removed and `foobar` is set to bold,
  1092. * - `__foobar__` &ndash; `__` characters are removed and `foobar` is set to bold,
  1093. * - `*foobar*` &ndash; `*` characters are removed and `foobar` is set to italic,
  1094. * - `_foobar_` &ndash; `_` characters are removed and `foobar` is set to italic,
  1095. * - ``` `foobar` &ndash; ``` ` ``` characters are removed and `foobar` is set to code,
  1096. * - `~~foobar~~` &ndash; `~~` characters are removed and `foobar` is set to strikethrough.
  1097. *
  1098. * @private
  1099. */
  1100. _addBasicStylesAutoformats() {
  1101. const commands = this.editor.commands;
  1102. if ( commands.get( 'bold' ) ) {
  1103. const boldCallback = getCallbackFunctionForInlineAutoformat( this.editor, 'bold' );
  1104. Object(_inlineautoformatediting__WEBPACK_IMPORTED_MODULE_2__["default"])( this.editor, this, /(?:^|\s)(\*\*)([^*]+)(\*\*)$/g, boldCallback );
  1105. Object(_inlineautoformatediting__WEBPACK_IMPORTED_MODULE_2__["default"])( this.editor, this, /(?:^|\s)(__)([^_]+)(__)$/g, boldCallback );
  1106. }
  1107. if ( commands.get( 'italic' ) ) {
  1108. const italicCallback = getCallbackFunctionForInlineAutoformat( this.editor, 'italic' );
  1109. // The italic autoformatter cannot be triggered by the bold markers, so we need to check the
  1110. // text before the pattern (e.g. `(?:^|[^\*])`).
  1111. Object(_inlineautoformatediting__WEBPACK_IMPORTED_MODULE_2__["default"])( this.editor, this, /(?:^|\s)(\*)([^*_]+)(\*)$/g, italicCallback );
  1112. Object(_inlineautoformatediting__WEBPACK_IMPORTED_MODULE_2__["default"])( this.editor, this, /(?:^|\s)(_)([^_]+)(_)$/g, italicCallback );
  1113. }
  1114. if ( commands.get( 'code' ) ) {
  1115. const codeCallback = getCallbackFunctionForInlineAutoformat( this.editor, 'code' );
  1116. Object(_inlineautoformatediting__WEBPACK_IMPORTED_MODULE_2__["default"])( this.editor, this, /(`)([^`]+)(`)$/g, codeCallback );
  1117. }
  1118. if ( commands.get( 'strikethrough' ) ) {
  1119. const strikethroughCallback = getCallbackFunctionForInlineAutoformat( this.editor, 'strikethrough' );
  1120. Object(_inlineautoformatediting__WEBPACK_IMPORTED_MODULE_2__["default"])( this.editor, this, /(~~)([^~]+)(~~)$/g, strikethroughCallback );
  1121. }
  1122. }
  1123. /**
  1124. * Adds autoformatting related to {@link module:heading/heading~Heading}.
  1125. *
  1126. * It is using a number at the end of the command name to associate it with the proper trigger:
  1127. *
  1128. * * `heading` with value `heading1` will be executed when typing `#`,
  1129. * * `heading` with value `heading2` will be executed when typing `##`,
  1130. * * ... up to `heading6` and `######`.
  1131. *
  1132. * @private
  1133. */
  1134. _addHeadingAutoformats() {
  1135. const command = this.editor.commands.get( 'heading' );
  1136. if ( command ) {
  1137. command.modelElements
  1138. .filter( name => name.match( /^heading[1-6]$/ ) )
  1139. .forEach( modelName => {
  1140. const level = modelName[ 7 ];
  1141. const pattern = new RegExp( `^(#{${ level }})\\s$` );
  1142. Object(_blockautoformatediting__WEBPACK_IMPORTED_MODULE_1__["default"])( this.editor, this, pattern, () => {
  1143. // Should only be active if command is enabled and heading style associated with pattern is inactive.
  1144. if ( !command.isEnabled || command.value === modelName ) {
  1145. return false;
  1146. }
  1147. this.editor.execute( 'heading', { value: modelName } );
  1148. } );
  1149. } );
  1150. }
  1151. }
  1152. /**
  1153. * Adds autoformatting related to {@link module:block-quote/blockquote~BlockQuote}.
  1154. *
  1155. * When typed:
  1156. * * `> ` &ndash; A paragraph will be changed to a block quote.
  1157. *
  1158. * @private
  1159. */
  1160. _addBlockQuoteAutoformats() {
  1161. if ( this.editor.commands.get( 'blockQuote' ) ) {
  1162. Object(_blockautoformatediting__WEBPACK_IMPORTED_MODULE_1__["default"])( this.editor, this, /^>\s$/, 'blockQuote' );
  1163. }
  1164. }
  1165. /**
  1166. * Adds autoformatting related to {@link module:code-block/codeblock~CodeBlock}.
  1167. *
  1168. * When typed:
  1169. * - `` ``` `` &ndash; A paragraph will be changed to a code block.
  1170. *
  1171. * @private
  1172. */
  1173. _addCodeBlockAutoformats() {
  1174. if ( this.editor.commands.get( 'codeBlock' ) ) {
  1175. Object(_blockautoformatediting__WEBPACK_IMPORTED_MODULE_1__["default"])( this.editor, this, /^```$/, 'codeBlock' );
  1176. }
  1177. }
  1178. /**
  1179. * Adds autoformatting related to {@link module:horizontal-line/horizontalline~HorizontalLine}.
  1180. *
  1181. * When typed:
  1182. * - `` --- `` &ndash; Will be replaced with a horizontal line.
  1183. *
  1184. * @private
  1185. */
  1186. _addHorizontalLineAutoformats() {
  1187. if ( this.editor.commands.get( 'horizontalLine' ) ) {
  1188. Object(_blockautoformatediting__WEBPACK_IMPORTED_MODULE_1__["default"])( this.editor, this, /^---$/, 'horizontalLine' );
  1189. }
  1190. }
  1191. }
  1192. // Helper function for getting `inlineAutoformatEditing` callbacks that checks if command is enabled.
  1193. //
  1194. // @param {module:core/editor/editor~Editor} editor
  1195. // @param {String} attributeKey
  1196. // @returns {Function}
  1197. function getCallbackFunctionForInlineAutoformat( editor, attributeKey ) {
  1198. return ( writer, rangesToFormat ) => {
  1199. const command = editor.commands.get( attributeKey );
  1200. if ( !command.isEnabled ) {
  1201. return false;
  1202. }
  1203. const validRanges = editor.model.schema.getValidRanges( rangesToFormat, attributeKey );
  1204. for ( const range of validRanges ) {
  1205. writer.setAttribute( attributeKey, true, range );
  1206. }
  1207. // After applying attribute to the text, remove given attribute from the selection.
  1208. // This way user is able to type a text without attribute used by auto formatter.
  1209. writer.removeSelectionAttribute( attributeKey );
  1210. };
  1211. }
  1212. /***/ }),
  1213. /***/ "./node_modules/@ckeditor/ckeditor5-autoformat/src/blockautoformatediting.js":
  1214. /*!***********************************************************************************!*\
  1215. !*** ./node_modules/@ckeditor/ckeditor5-autoformat/src/blockautoformatediting.js ***!
  1216. \***********************************************************************************/
  1217. /*! exports provided: default */
  1218. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1219. "use strict";
  1220. __webpack_require__.r(__webpack_exports__);
  1221. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return blockAutoformatEditing; });
  1222. /* harmony import */ var ckeditor5_src_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/engine */ "./node_modules/ckeditor5/src/engine.js");
  1223. /* harmony import */ var ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/utils */ "./node_modules/ckeditor5/src/utils.js");
  1224. /**
  1225. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  1226. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  1227. */
  1228. /**
  1229. * The block autoformatting engine. It allows to format various block patterns. For example,
  1230. * it can be configured to turn a paragraph starting with `*` and followed by a space into a list item.
  1231. *
  1232. * The autoformatting operation is integrated with the undo manager,
  1233. * so the autoformatting step can be undone if the user's intention was not to format the text.
  1234. *
  1235. * See the {@link module:autoformat/blockautoformatediting~blockAutoformatEditing `blockAutoformatEditing`} documentation
  1236. * to learn how to create custom block autoformatters. You can also use
  1237. * the {@link module:autoformat/autoformat~Autoformat} feature which enables a set of default autoformatters
  1238. * (lists, headings, bold and italic).
  1239. *
  1240. * @module autoformat/blockautoformatediting
  1241. */
  1242. /**
  1243. * Creates a listener triggered on {@link module:engine/model/document~Document#event:change:data `change:data`} event in the document.
  1244. * Calls the callback when inserted text matches the regular expression or the command name
  1245. * if provided instead of the callback.
  1246. *
  1247. * Examples of usage:
  1248. *
  1249. * To convert a paragraph to heading 1 when `- ` is typed, using just the command name:
  1250. *
  1251. * blockAutoformatEditing( editor, plugin, /^\- $/, 'heading1' );
  1252. *
  1253. * To convert a paragraph to heading 1 when `- ` is typed, using just the callback:
  1254. *
  1255. * blockAutoformatEditing( editor, plugin, /^\- $/, ( context ) => {
  1256. * const { match } = context;
  1257. * const headingLevel = match[ 1 ].length;
  1258. *
  1259. * editor.execute( 'heading', {
  1260. * formatId: `heading${ headingLevel }`
  1261. * } );
  1262. * } );
  1263. *
  1264. * @param {module:core/editor/editor~Editor} editor The editor instance.
  1265. * @param {module:autoformat/autoformat~Autoformat} plugin The autoformat plugin instance.
  1266. * @param {RegExp} pattern The regular expression to execute on just inserted text. The regular expression is tested against the text
  1267. * from the beginning until the caret position.
  1268. * @param {Function|String} callbackOrCommand The callback to execute or the command to run when the text is matched.
  1269. * In case of providing the callback, it receives the following parameter:
  1270. * * {Object} match RegExp.exec() result of matching the pattern to inserted text.
  1271. */
  1272. function blockAutoformatEditing( editor, plugin, pattern, callbackOrCommand ) {
  1273. let callback;
  1274. let command = null;
  1275. if ( typeof callbackOrCommand == 'function' ) {
  1276. callback = callbackOrCommand;
  1277. } else {
  1278. // We assume that the actual command name was provided.
  1279. command = editor.commands.get( callbackOrCommand );
  1280. callback = () => {
  1281. editor.execute( callbackOrCommand );
  1282. };
  1283. }
  1284. editor.model.document.on( 'change:data', ( evt, batch ) => {
  1285. if ( command && !command.isEnabled || !plugin.isEnabled ) {
  1286. return;
  1287. }
  1288. const range = Object(ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_1__["first"])( editor.model.document.selection.getRanges() );
  1289. if ( !range.isCollapsed ) {
  1290. return;
  1291. }
  1292. if ( batch.type == 'transparent' ) {
  1293. return;
  1294. }
  1295. const changes = Array.from( editor.model.document.differ.getChanges() );
  1296. const entry = changes[ 0 ];
  1297. // Typing is represented by only a single change.
  1298. if ( changes.length != 1 || entry.type !== 'insert' || entry.name != '$text' || entry.length != 1 ) {
  1299. return;
  1300. }
  1301. const blockToFormat = entry.position.parent;
  1302. // Block formatting should be disabled in codeBlocks (#5800).
  1303. if ( blockToFormat.is( 'element', 'codeBlock' ) ) {
  1304. return;
  1305. }
  1306. // Only list commands and custom callbacks can be applied inside a list.
  1307. if ( blockToFormat.is( 'element', 'listItem' ) &&
  1308. typeof callbackOrCommand !== 'function' &&
  1309. ![ 'numberedList', 'bulletedList', 'todoList' ].includes( callbackOrCommand )
  1310. ) {
  1311. return;
  1312. }
  1313. // In case a command is bound, do not re-execute it over an existing block style which would result with a style removal.
  1314. // Instead just drop processing so that autoformat trigger text is not lost. E.g. writing "# " in a level 1 heading.
  1315. if ( command && command.value === true ) {
  1316. return;
  1317. }
  1318. const firstNode = blockToFormat.getChild( 0 );
  1319. const firstNodeRange = editor.model.createRangeOn( firstNode );
  1320. // Range is only expected to be within or at the very end of the first text node.
  1321. if ( !firstNodeRange.containsRange( range ) && !range.end.isEqual( firstNodeRange.end ) ) {
  1322. return;
  1323. }
  1324. const match = pattern.exec( firstNode.data.substr( 0, range.end.offset ) );
  1325. // ...and this text node's data match the pattern.
  1326. if ( !match ) {
  1327. return;
  1328. }
  1329. // Use enqueueChange to create new batch to separate typing batch from the auto-format changes.
  1330. editor.model.enqueueChange( writer => {
  1331. // Matched range.
  1332. const start = writer.createPositionAt( blockToFormat, 0 );
  1333. const end = writer.createPositionAt( blockToFormat, match[ 0 ].length );
  1334. const range = new ckeditor5_src_engine__WEBPACK_IMPORTED_MODULE_0__["LiveRange"]( start, end );
  1335. const wasChanged = callback( { match } );
  1336. // Remove matched text.
  1337. if ( wasChanged !== false ) {
  1338. writer.remove( range );
  1339. const selectionRange = editor.model.document.selection.getFirstRange();
  1340. const blockRange = writer.createRangeIn( blockToFormat );
  1341. // If the block is empty and the document selection has been moved when
  1342. // applying formatting (e.g. is now in newly created block).
  1343. if ( blockToFormat.isEmpty && !blockRange.isEqual( selectionRange ) && !blockRange.containsRange( selectionRange, true ) ) {
  1344. writer.remove( blockToFormat );
  1345. }
  1346. }
  1347. range.detach();
  1348. } );
  1349. } );
  1350. }
  1351. /***/ }),
  1352. /***/ "./node_modules/@ckeditor/ckeditor5-autoformat/src/inlineautoformatediting.js":
  1353. /*!************************************************************************************!*\
  1354. !*** ./node_modules/@ckeditor/ckeditor5-autoformat/src/inlineautoformatediting.js ***!
  1355. \************************************************************************************/
  1356. /*! exports provided: default */
  1357. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1358. "use strict";
  1359. __webpack_require__.r(__webpack_exports__);
  1360. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return inlineAutoformatEditing; });
  1361. /**
  1362. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  1363. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  1364. */
  1365. /**
  1366. * The inline autoformatting engine. It allows to format various inline patterns. For example,
  1367. * it can be configured to make "foo" bold when typed `**foo**` (the `**` markers will be removed).
  1368. *
  1369. * The autoformatting operation is integrated with the undo manager,
  1370. * so the autoformatting step can be undone if the user's intention was not to format the text.
  1371. *
  1372. * See the {@link module:autoformat/inlineautoformatediting~inlineAutoformatEditing `inlineAutoformatEditing`} documentation
  1373. * to learn how to create custom inline autoformatters. You can also use
  1374. * the {@link module:autoformat/autoformat~Autoformat} feature which enables a set of default autoformatters
  1375. * (lists, headings, bold and italic).
  1376. *
  1377. * @module autoformat/inlineautoformatediting
  1378. */
  1379. /**
  1380. * Enables autoformatting mechanism for a given {@link module:core/editor/editor~Editor}.
  1381. *
  1382. * It formats the matched text by applying the given model attribute or by running the provided formatting callback.
  1383. * On every {@link module:engine/model/document~Document#event:change:data data change} in the model document
  1384. * the autoformatting engine checks the text on the left of the selection
  1385. * and executes the provided action if the text matches given criteria (regular expression or callback).
  1386. *
  1387. * @param {module:core/editor/editor~Editor} editor The editor instance.
  1388. * @param {module:autoformat/autoformat~Autoformat} plugin The autoformat plugin instance.
  1389. * @param {Function|RegExp} testRegexpOrCallback The regular expression or callback to execute on text.
  1390. * Provided regular expression *must* have three capture groups. The first and the third capture group
  1391. * should match opening and closing delimiters. The second capture group should match the text to format.
  1392. *
  1393. * // Matches the `**bold text**` pattern.
  1394. * // There are three capturing groups:
  1395. * // - The first to match the starting `**` delimiter.
  1396. * // - The second to match the text to format.
  1397. * // - The third to match the ending `**` delimiter.
  1398. * inlineAutoformatEditing( editor, plugin, /(\*\*)([^\*]+?)(\*\*)$/g, formatCallback );
  1399. *
  1400. * When a function is provided instead of the regular expression, it will be executed with the text to match as a parameter.
  1401. * The function should return proper "ranges" to delete and format.
  1402. *
  1403. * {
  1404. * remove: [
  1405. * [ 0, 1 ], // Remove the first letter from the given text.
  1406. * [ 5, 6 ] // Remove the 6th letter from the given text.
  1407. * ],
  1408. * format: [
  1409. * [ 1, 5 ] // Format all letters from 2nd to 5th.
  1410. * ]
  1411. * }
  1412. *
  1413. * @param {Function} formatCallback A callback to apply actual formatting.
  1414. * It should return `false` if changes should not be applied (e.g. if a command is disabled).
  1415. *
  1416. * inlineAutoformatEditing( editor, plugin, /(\*\*)([^\*]+?)(\*\*)$/g, ( writer, rangesToFormat ) => {
  1417. * const command = editor.commands.get( 'bold' );
  1418. *
  1419. * if ( !command.isEnabled ) {
  1420. * return false;
  1421. * }
  1422. *
  1423. * const validRanges = editor.model.schema.getValidRanges( rangesToFormat, 'bold' );
  1424. *
  1425. * for ( let range of validRanges ) {
  1426. * writer.setAttribute( 'bold', true, range );
  1427. * }
  1428. * } );
  1429. */
  1430. function inlineAutoformatEditing( editor, plugin, testRegexpOrCallback, formatCallback ) {
  1431. let regExp;
  1432. let testCallback;
  1433. if ( testRegexpOrCallback instanceof RegExp ) {
  1434. regExp = testRegexpOrCallback;
  1435. } else {
  1436. testCallback = testRegexpOrCallback;
  1437. }
  1438. // A test callback run on changed text.
  1439. testCallback = testCallback || ( text => {
  1440. let result;
  1441. const remove = [];
  1442. const format = [];
  1443. while ( ( result = regExp.exec( text ) ) !== null ) {
  1444. // There should be full match and 3 capture groups.
  1445. if ( result && result.length < 4 ) {
  1446. break;
  1447. }
  1448. let {
  1449. index,
  1450. '1': leftDel,
  1451. '2': content,
  1452. '3': rightDel
  1453. } = result;
  1454. // Real matched string - there might be some non-capturing groups so we need to recalculate starting index.
  1455. const found = leftDel + content + rightDel;
  1456. index += result[ 0 ].length - found.length;
  1457. // Start and End offsets of delimiters to remove.
  1458. const delStart = [
  1459. index,
  1460. index + leftDel.length
  1461. ];
  1462. const delEnd = [
  1463. index + leftDel.length + content.length,
  1464. index + leftDel.length + content.length + rightDel.length
  1465. ];
  1466. remove.push( delStart );
  1467. remove.push( delEnd );
  1468. format.push( [ index + leftDel.length, index + leftDel.length + content.length ] );
  1469. }
  1470. return {
  1471. remove,
  1472. format
  1473. };
  1474. } );
  1475. editor.model.document.on( 'change:data', ( evt, batch ) => {
  1476. if ( batch.type == 'transparent' || !plugin.isEnabled ) {
  1477. return;
  1478. }
  1479. const model = editor.model;
  1480. const selection = model.document.selection;
  1481. // Do nothing if selection is not collapsed.
  1482. if ( !selection.isCollapsed ) {
  1483. return;
  1484. }
  1485. const changes = Array.from( model.document.differ.getChanges() );
  1486. const entry = changes[ 0 ];
  1487. // Typing is represented by only a single change.
  1488. if ( changes.length != 1 || entry.type !== 'insert' || entry.name != '$text' || entry.length != 1 ) {
  1489. return;
  1490. }
  1491. const focus = selection.focus;
  1492. const block = focus.parent;
  1493. const { text, range } = getTextAfterCode( model.createRange( model.createPositionAt( block, 0 ), focus ), model );
  1494. const testOutput = testCallback( text );
  1495. const rangesToFormat = testOutputToRanges( range.start, testOutput.format, model );
  1496. const rangesToRemove = testOutputToRanges( range.start, testOutput.remove, model );
  1497. if ( !( rangesToFormat.length && rangesToRemove.length ) ) {
  1498. return;
  1499. }
  1500. // Use enqueueChange to create new batch to separate typing batch from the auto-format changes.
  1501. model.enqueueChange( writer => {
  1502. // Apply format.
  1503. const hasChanged = formatCallback( writer, rangesToFormat );
  1504. // Strict check on `false` to have backward compatibility (when callbacks were returning `undefined`).
  1505. if ( hasChanged === false ) {
  1506. return;
  1507. }
  1508. // Remove delimiters - use reversed order to not mix the offsets while removing.
  1509. for ( const range of rangesToRemove.reverse() ) {
  1510. writer.remove( range );
  1511. }
  1512. } );
  1513. } );
  1514. }
  1515. // Converts output of the test function provided to the inlineAutoformatEditing and converts it to the model ranges
  1516. // inside provided block.
  1517. //
  1518. // @private
  1519. // @param {module:engine/model/position~Position} start
  1520. // @param {Array.<Array>} arrays
  1521. // @param {module:engine/model/model~Model} model
  1522. function testOutputToRanges( start, arrays, model ) {
  1523. return arrays
  1524. .filter( array => ( array[ 0 ] !== undefined && array[ 1 ] !== undefined ) )
  1525. .map( array => {
  1526. return model.createRange( start.getShiftedBy( array[ 0 ] ), start.getShiftedBy( array[ 1 ] ) );
  1527. } );
  1528. }
  1529. // Returns the last text line after the last code element from the given range.
  1530. // It is similar to {@link module:typing/utils/getlasttextline.getLastTextLine `getLastTextLine()`},
  1531. // but it ignores any text before the last `code`.
  1532. //
  1533. // @param {module:engine/model/range~Range} range
  1534. // @param {module:engine/model/model~Model} model
  1535. // @returns {module:typing/utils/getlasttextline~LastTextLineData}
  1536. function getTextAfterCode( range, model ) {
  1537. let start = range.start;
  1538. const text = Array.from( range.getItems() ).reduce( ( rangeText, node ) => {
  1539. // Trim text to a last occurrence of an inline element and update range start.
  1540. if ( !( node.is( '$text' ) || node.is( '$textProxy' ) ) || node.getAttribute( 'code' ) ) {
  1541. start = model.createPositionAfter( node );
  1542. return '';
  1543. }
  1544. return rangeText + node.data;
  1545. }, '' );
  1546. return { text, range: model.createRange( start, range.end ) };
  1547. }
  1548. /***/ }),
  1549. /***/ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/attributecommand.js":
  1550. /*!*******************************************************************************!*\
  1551. !*** ./node_modules/@ckeditor/ckeditor5-basic-styles/src/attributecommand.js ***!
  1552. \*******************************************************************************/
  1553. /*! exports provided: default */
  1554. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1555. "use strict";
  1556. __webpack_require__.r(__webpack_exports__);
  1557. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return AttributeCommand; });
  1558. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  1559. /**
  1560. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  1561. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  1562. */
  1563. /**
  1564. * @module basic-styles/attributecommand
  1565. */
  1566. /**
  1567. * An extension of the base {@link module:core/command~Command} class, which provides utilities for a command
  1568. * that toggles a single attribute on a text or an element.
  1569. *
  1570. * `AttributeCommand` uses {@link module:engine/model/document~Document#selection}
  1571. * to decide which nodes (if any) should be changed, and applies or removes the attribute from them.
  1572. *
  1573. * The command checks the {@link module:engine/model/model~Model#schema} to decide if it can be enabled
  1574. * for the current selection and to which nodes the attribute can be applied.
  1575. *
  1576. * @extends module:core/command~Command
  1577. */
  1578. class AttributeCommand extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Command"] {
  1579. /**
  1580. * @param {module:core/editor/editor~Editor} editor
  1581. * @param {String} attributeKey Attribute that will be set by the command.
  1582. */
  1583. constructor( editor, attributeKey ) {
  1584. super( editor );
  1585. /**
  1586. * The attribute that will be set by the command.
  1587. *
  1588. * @readonly
  1589. * @member {String}
  1590. */
  1591. this.attributeKey = attributeKey;
  1592. /**
  1593. * Flag indicating whether the command is active. The command is active when the
  1594. * {@link module:engine/model/selection~Selection#hasAttribute selection has the attribute} which means that:
  1595. *
  1596. * * If the selection is not empty &ndash; That the attribute is set on the first node in the selection that allows this attribute.
  1597. * * If the selection is empty &ndash; That the selection has the attribute itself (which means that newly typed
  1598. * text will have this attribute, too).
  1599. *
  1600. * @observable
  1601. * @readonly
  1602. * @member {Boolean} #value
  1603. */
  1604. }
  1605. /**
  1606. * Updates the command's {@link #value} and {@link #isEnabled} based on the current selection.
  1607. */
  1608. refresh() {
  1609. const model = this.editor.model;
  1610. const doc = model.document;
  1611. this.value = this._getValueFromFirstAllowedNode();
  1612. this.isEnabled = model.schema.checkAttributeInSelection( doc.selection, this.attributeKey );
  1613. }
  1614. /**
  1615. * Executes the command &mdash; applies the attribute to the selection or removes it from the selection.
  1616. *
  1617. * If the command is active (`value == true`), it will remove attributes. Otherwise, it will set attributes.
  1618. *
  1619. * The execution result differs, depending on the {@link module:engine/model/document~Document#selection}:
  1620. *
  1621. * * If the selection is on a range, the command applies the attribute to all nodes in that range
  1622. * (if they are allowed to have this attribute by the {@link module:engine/model/schema~Schema schema}).
  1623. * * If the selection is collapsed in a non-empty node, the command applies the attribute to the
  1624. * {@link module:engine/model/document~Document#selection} itself (note that typed characters copy attributes from the selection).
  1625. * * If the selection is collapsed in an empty node, the command applies the attribute to the parent node of the selection (note
  1626. * that the selection inherits all attributes from a node if it is in an empty node).
  1627. *
  1628. * @fires execute
  1629. * @param {Object} [options] Command options.
  1630. * @param {Boolean} [options.forceValue] If set, it will force the command behavior. If `true`, the command will apply the attribute,
  1631. * otherwise the command will remove the attribute.
  1632. * If not set, the command will look for its current value to decide what it should do.
  1633. */
  1634. execute( options = {} ) {
  1635. const model = this.editor.model;
  1636. const doc = model.document;
  1637. const selection = doc.selection;
  1638. const value = ( options.forceValue === undefined ) ? !this.value : options.forceValue;
  1639. model.change( writer => {
  1640. if ( selection.isCollapsed ) {
  1641. if ( value ) {
  1642. writer.setSelectionAttribute( this.attributeKey, true );
  1643. } else {
  1644. writer.removeSelectionAttribute( this.attributeKey );
  1645. }
  1646. } else {
  1647. const ranges = model.schema.getValidRanges( selection.getRanges(), this.attributeKey );
  1648. for ( const range of ranges ) {
  1649. if ( value ) {
  1650. writer.setAttribute( this.attributeKey, value, range );
  1651. } else {
  1652. writer.removeAttribute( this.attributeKey, range );
  1653. }
  1654. }
  1655. }
  1656. } );
  1657. }
  1658. /**
  1659. * Checks the attribute value of the first node in the selection that allows the attribute.
  1660. * For the collapsed selection returns the selection attribute.
  1661. *
  1662. * @private
  1663. * @returns {Boolean} The attribute value.
  1664. */
  1665. _getValueFromFirstAllowedNode() {
  1666. const model = this.editor.model;
  1667. const schema = model.schema;
  1668. const selection = model.document.selection;
  1669. if ( selection.isCollapsed ) {
  1670. return selection.hasAttribute( this.attributeKey );
  1671. }
  1672. for ( const range of selection.getRanges() ) {
  1673. for ( const item of range.getItems() ) {
  1674. if ( schema.checkAttribute( item, this.attributeKey ) ) {
  1675. return item.hasAttribute( this.attributeKey );
  1676. }
  1677. }
  1678. }
  1679. return false;
  1680. }
  1681. }
  1682. /***/ }),
  1683. /***/ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/bold.js":
  1684. /*!*******************************************************************!*\
  1685. !*** ./node_modules/@ckeditor/ckeditor5-basic-styles/src/bold.js ***!
  1686. \*******************************************************************/
  1687. /*! exports provided: default */
  1688. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1689. "use strict";
  1690. __webpack_require__.r(__webpack_exports__);
  1691. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Bold; });
  1692. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  1693. /* harmony import */ var _bold_boldediting__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./bold/boldediting */ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/bold/boldediting.js");
  1694. /* harmony import */ var _bold_boldui__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./bold/boldui */ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/bold/boldui.js");
  1695. /**
  1696. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  1697. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  1698. */
  1699. /**
  1700. * @module basic-styles/bold
  1701. */
  1702. /**
  1703. * The bold feature.
  1704. *
  1705. * For a detailed overview check the {@glink features/basic-styles Basic styles feature documentation}
  1706. * and the {@glink api/basic-styles package page}.
  1707. *
  1708. * This is a "glue" plugin which loads the {@link module:basic-styles/bold/boldediting~BoldEditing bold editing feature}
  1709. * and {@link module:basic-styles/bold/boldui~BoldUI bold UI feature}.
  1710. *
  1711. * @extends module:core/plugin~Plugin
  1712. */
  1713. class Bold extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  1714. /**
  1715. * @inheritDoc
  1716. */
  1717. static get requires() {
  1718. return [ _bold_boldediting__WEBPACK_IMPORTED_MODULE_1__["default"], _bold_boldui__WEBPACK_IMPORTED_MODULE_2__["default"] ];
  1719. }
  1720. /**
  1721. * @inheritDoc
  1722. */
  1723. static get pluginName() {
  1724. return 'Bold';
  1725. }
  1726. }
  1727. /***/ }),
  1728. /***/ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/bold/boldediting.js":
  1729. /*!*******************************************************************************!*\
  1730. !*** ./node_modules/@ckeditor/ckeditor5-basic-styles/src/bold/boldediting.js ***!
  1731. \*******************************************************************************/
  1732. /*! exports provided: default */
  1733. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1734. "use strict";
  1735. __webpack_require__.r(__webpack_exports__);
  1736. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return BoldEditing; });
  1737. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  1738. /* harmony import */ var _attributecommand__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../attributecommand */ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/attributecommand.js");
  1739. /**
  1740. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  1741. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  1742. */
  1743. /**
  1744. * @module basic-styles/bold/boldediting
  1745. */
  1746. const BOLD = 'bold';
  1747. /**
  1748. * The bold editing feature.
  1749. *
  1750. * It registers the `'bold'` command and introduces the `bold` attribute in the model which renders to the view
  1751. * as a `<strong>` element.
  1752. *
  1753. * @extends module:core/plugin~Plugin
  1754. */
  1755. class BoldEditing extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  1756. /**
  1757. * @inheritDoc
  1758. */
  1759. static get pluginName() {
  1760. return 'BoldEditing';
  1761. }
  1762. /**
  1763. * @inheritDoc
  1764. */
  1765. init() {
  1766. const editor = this.editor;
  1767. // Allow bold attribute on text nodes.
  1768. editor.model.schema.extend( '$text', { allowAttributes: BOLD } );
  1769. editor.model.schema.setAttributeProperties( BOLD, {
  1770. isFormatting: true,
  1771. copyOnEnter: true
  1772. } );
  1773. // Build converter from model to view for data and editing pipelines.
  1774. editor.conversion.attributeToElement( {
  1775. model: BOLD,
  1776. view: 'strong',
  1777. upcastAlso: [
  1778. 'b',
  1779. viewElement => {
  1780. const fontWeight = viewElement.getStyle( 'font-weight' );
  1781. if ( !fontWeight ) {
  1782. return null;
  1783. }
  1784. // Value of the `font-weight` attribute can be defined as a string or a number.
  1785. if ( fontWeight == 'bold' || Number( fontWeight ) >= 600 ) {
  1786. return {
  1787. name: true,
  1788. styles: [ 'font-weight' ]
  1789. };
  1790. }
  1791. }
  1792. ]
  1793. } );
  1794. // Create bold command.
  1795. editor.commands.add( BOLD, new _attributecommand__WEBPACK_IMPORTED_MODULE_1__["default"]( editor, BOLD ) );
  1796. // Set the Ctrl+B keystroke.
  1797. editor.keystrokes.set( 'CTRL+B', BOLD );
  1798. }
  1799. }
  1800. /***/ }),
  1801. /***/ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/bold/boldui.js":
  1802. /*!**************************************************************************!*\
  1803. !*** ./node_modules/@ckeditor/ckeditor5-basic-styles/src/bold/boldui.js ***!
  1804. \**************************************************************************/
  1805. /*! exports provided: default */
  1806. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1807. "use strict";
  1808. __webpack_require__.r(__webpack_exports__);
  1809. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return BoldUI; });
  1810. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  1811. /* harmony import */ var ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/ui */ "./node_modules/ckeditor5/src/ui.js");
  1812. /* 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");
  1813. /**
  1814. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  1815. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  1816. */
  1817. /**
  1818. * @module basic-styles/bold/boldui
  1819. */
  1820. const BOLD = 'bold';
  1821. /**
  1822. * The bold UI feature. It introduces the Bold button.
  1823. *
  1824. * @extends module:core/plugin~Plugin
  1825. */
  1826. class BoldUI extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  1827. /**
  1828. * @inheritDoc
  1829. */
  1830. static get pluginName() {
  1831. return 'BoldUI';
  1832. }
  1833. /**
  1834. * @inheritDoc
  1835. */
  1836. init() {
  1837. const editor = this.editor;
  1838. const t = editor.t;
  1839. // Add bold button to feature components.
  1840. editor.ui.componentFactory.add( BOLD, locale => {
  1841. const command = editor.commands.get( BOLD );
  1842. const view = new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__["ButtonView"]( locale );
  1843. view.set( {
  1844. label: t( 'Bold' ),
  1845. icon: _theme_icons_bold_svg__WEBPACK_IMPORTED_MODULE_2__["default"],
  1846. keystroke: 'CTRL+B',
  1847. tooltip: true,
  1848. isToggleable: true
  1849. } );
  1850. view.bind( 'isOn', 'isEnabled' ).to( command, 'value', 'isEnabled' );
  1851. // Execute command.
  1852. this.listenTo( view, 'execute', () => {
  1853. editor.execute( BOLD );
  1854. editor.editing.view.focus();
  1855. } );
  1856. return view;
  1857. } );
  1858. }
  1859. }
  1860. /***/ }),
  1861. /***/ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/italic.js":
  1862. /*!*********************************************************************!*\
  1863. !*** ./node_modules/@ckeditor/ckeditor5-basic-styles/src/italic.js ***!
  1864. \*********************************************************************/
  1865. /*! exports provided: default */
  1866. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1867. "use strict";
  1868. __webpack_require__.r(__webpack_exports__);
  1869. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Italic; });
  1870. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  1871. /* harmony import */ var _italic_italicediting__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./italic/italicediting */ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/italic/italicediting.js");
  1872. /* harmony import */ var _italic_italicui__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./italic/italicui */ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/italic/italicui.js");
  1873. /**
  1874. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  1875. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  1876. */
  1877. /**
  1878. * @module basic-styles/italic
  1879. */
  1880. /**
  1881. * The italic feature.
  1882. *
  1883. * For a detailed overview check the {@glink features/basic-styles Basic styles feature documentation}
  1884. * and the {@glink api/basic-styles package page}.
  1885. *
  1886. * This is a "glue" plugin which loads the {@link module:basic-styles/italic/italicediting~ItalicEditing} and
  1887. * {@link module:basic-styles/italic/italicui~ItalicUI} plugins.
  1888. *
  1889. * @extends module:core/plugin~Plugin
  1890. */
  1891. class Italic extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  1892. /**
  1893. * @inheritDoc
  1894. */
  1895. static get requires() {
  1896. return [ _italic_italicediting__WEBPACK_IMPORTED_MODULE_1__["default"], _italic_italicui__WEBPACK_IMPORTED_MODULE_2__["default"] ];
  1897. }
  1898. /**
  1899. * @inheritDoc
  1900. */
  1901. static get pluginName() {
  1902. return 'Italic';
  1903. }
  1904. }
  1905. /***/ }),
  1906. /***/ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/italic/italicediting.js":
  1907. /*!***********************************************************************************!*\
  1908. !*** ./node_modules/@ckeditor/ckeditor5-basic-styles/src/italic/italicediting.js ***!
  1909. \***********************************************************************************/
  1910. /*! exports provided: default */
  1911. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1912. "use strict";
  1913. __webpack_require__.r(__webpack_exports__);
  1914. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ItalicEditing; });
  1915. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  1916. /* harmony import */ var _attributecommand__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../attributecommand */ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/attributecommand.js");
  1917. /**
  1918. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  1919. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  1920. */
  1921. /**
  1922. * @module basic-styles/italic/italicediting
  1923. */
  1924. const ITALIC = 'italic';
  1925. /**
  1926. * The italic editing feature.
  1927. *
  1928. * It registers the `'italic'` command, the <kbd>Ctrl+I</kbd> keystroke and introduces the `italic` attribute in the model
  1929. * which renders to the view as an `<i>` element.
  1930. *
  1931. * @extends module:core/plugin~Plugin
  1932. */
  1933. class ItalicEditing extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  1934. /**
  1935. * @inheritDoc
  1936. */
  1937. static get pluginName() {
  1938. return 'ItalicEditing';
  1939. }
  1940. /**
  1941. * @inheritDoc
  1942. */
  1943. init() {
  1944. const editor = this.editor;
  1945. // Allow italic attribute on text nodes.
  1946. editor.model.schema.extend( '$text', { allowAttributes: ITALIC } );
  1947. editor.model.schema.setAttributeProperties( ITALIC, {
  1948. isFormatting: true,
  1949. copyOnEnter: true
  1950. } );
  1951. editor.conversion.attributeToElement( {
  1952. model: ITALIC,
  1953. view: 'i',
  1954. upcastAlso: [
  1955. 'em',
  1956. {
  1957. styles: {
  1958. 'font-style': 'italic'
  1959. }
  1960. }
  1961. ]
  1962. } );
  1963. // Create italic command.
  1964. editor.commands.add( ITALIC, new _attributecommand__WEBPACK_IMPORTED_MODULE_1__["default"]( editor, ITALIC ) );
  1965. // Set the Ctrl+I keystroke.
  1966. editor.keystrokes.set( 'CTRL+I', ITALIC );
  1967. }
  1968. }
  1969. /***/ }),
  1970. /***/ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/italic/italicui.js":
  1971. /*!******************************************************************************!*\
  1972. !*** ./node_modules/@ckeditor/ckeditor5-basic-styles/src/italic/italicui.js ***!
  1973. \******************************************************************************/
  1974. /*! exports provided: default */
  1975. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1976. "use strict";
  1977. __webpack_require__.r(__webpack_exports__);
  1978. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ItalicUI; });
  1979. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  1980. /* harmony import */ var ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/ui */ "./node_modules/ckeditor5/src/ui.js");
  1981. /* 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");
  1982. /**
  1983. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  1984. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  1985. */
  1986. /**
  1987. * @module basic-styles/italic/italicui
  1988. */
  1989. const ITALIC = 'italic';
  1990. /**
  1991. * The italic UI feature. It introduces the Italic button.
  1992. *
  1993. * @extends module:core/plugin~Plugin
  1994. */
  1995. class ItalicUI extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  1996. /**
  1997. * @inheritDoc
  1998. */
  1999. static get pluginName() {
  2000. return 'ItalicUI';
  2001. }
  2002. /**
  2003. * @inheritDoc
  2004. */
  2005. init() {
  2006. const editor = this.editor;
  2007. const t = editor.t;
  2008. // Add bold button to feature components.
  2009. editor.ui.componentFactory.add( ITALIC, locale => {
  2010. const command = editor.commands.get( ITALIC );
  2011. const view = new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__["ButtonView"]( locale );
  2012. view.set( {
  2013. label: t( 'Italic' ),
  2014. icon: _theme_icons_italic_svg__WEBPACK_IMPORTED_MODULE_2__["default"],
  2015. keystroke: 'CTRL+I',
  2016. tooltip: true,
  2017. isToggleable: true
  2018. } );
  2019. view.bind( 'isOn', 'isEnabled' ).to( command, 'value', 'isEnabled' );
  2020. // Execute command.
  2021. this.listenTo( view, 'execute', () => {
  2022. editor.execute( ITALIC );
  2023. editor.editing.view.focus();
  2024. } );
  2025. return view;
  2026. } );
  2027. }
  2028. }
  2029. /***/ }),
  2030. /***/ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/strikethrough.js":
  2031. /*!****************************************************************************!*\
  2032. !*** ./node_modules/@ckeditor/ckeditor5-basic-styles/src/strikethrough.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 Strikethrough; });
  2039. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  2040. /* harmony import */ var _strikethrough_strikethroughediting__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./strikethrough/strikethroughediting */ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/strikethrough/strikethroughediting.js");
  2041. /* harmony import */ var _strikethrough_strikethroughui__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./strikethrough/strikethroughui */ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/strikethrough/strikethroughui.js");
  2042. /**
  2043. * @license Copyright (c) 2003-2021, 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/strikethrough
  2048. */
  2049. /**
  2050. * The strikethrough 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/strikethrough/strikethroughediting~StrikethroughEditing} and
  2056. * {@link module:basic-styles/strikethrough/strikethroughui~StrikethroughUI} plugins.
  2057. *
  2058. * @extends module:core/plugin~Plugin
  2059. */
  2060. class Strikethrough extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  2061. /**
  2062. * @inheritDoc
  2063. */
  2064. static get requires() {
  2065. return [ _strikethrough_strikethroughediting__WEBPACK_IMPORTED_MODULE_1__["default"], _strikethrough_strikethroughui__WEBPACK_IMPORTED_MODULE_2__["default"] ];
  2066. }
  2067. /**
  2068. * @inheritDoc
  2069. */
  2070. static get pluginName() {
  2071. return 'Strikethrough';
  2072. }
  2073. }
  2074. /***/ }),
  2075. /***/ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/strikethrough/strikethroughediting.js":
  2076. /*!*************************************************************************************************!*\
  2077. !*** ./node_modules/@ckeditor/ckeditor5-basic-styles/src/strikethrough/strikethroughediting.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 StrikethroughEditing; });
  2084. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.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-2021, 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/strikethrough/strikethroughediting
  2092. */
  2093. const STRIKETHROUGH = 'strikethrough';
  2094. /**
  2095. * The strikethrough editing feature.
  2096. *
  2097. * It registers the `'strikethrough'` command, the <kbd>Ctrl+Shift+X</kbd> keystroke and introduces the
  2098. * `strikethroughsthrough` attribute in the model which renders to the view
  2099. * as a `<s>` element.
  2100. *
  2101. * @extends module:core/plugin~Plugin
  2102. */
  2103. class StrikethroughEditing extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  2104. /**
  2105. * @inheritDoc
  2106. */
  2107. static get pluginName() {
  2108. return 'StrikethroughEditing';
  2109. }
  2110. /**
  2111. * @inheritDoc
  2112. */
  2113. init() {
  2114. const editor = this.editor;
  2115. // Allow strikethrough attribute on text nodes.
  2116. editor.model.schema.extend( '$text', { allowAttributes: STRIKETHROUGH } );
  2117. editor.model.schema.setAttributeProperties( STRIKETHROUGH, {
  2118. isFormatting: true,
  2119. copyOnEnter: true
  2120. } );
  2121. editor.conversion.attributeToElement( {
  2122. model: STRIKETHROUGH,
  2123. view: 's',
  2124. upcastAlso: [
  2125. 'del',
  2126. 'strike',
  2127. {
  2128. styles: {
  2129. 'text-decoration': 'line-through'
  2130. }
  2131. }
  2132. ]
  2133. } );
  2134. // Create strikethrough command.
  2135. editor.commands.add( STRIKETHROUGH, new _attributecommand__WEBPACK_IMPORTED_MODULE_1__["default"]( editor, STRIKETHROUGH ) );
  2136. // Set the Ctrl+Shift+X keystroke.
  2137. editor.keystrokes.set( 'CTRL+SHIFT+X', 'strikethrough' );
  2138. }
  2139. }
  2140. /***/ }),
  2141. /***/ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/strikethrough/strikethroughui.js":
  2142. /*!********************************************************************************************!*\
  2143. !*** ./node_modules/@ckeditor/ckeditor5-basic-styles/src/strikethrough/strikethroughui.js ***!
  2144. \********************************************************************************************/
  2145. /*! exports provided: default */
  2146. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2147. "use strict";
  2148. __webpack_require__.r(__webpack_exports__);
  2149. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return StrikethroughUI; });
  2150. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  2151. /* harmony import */ var ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/ui */ "./node_modules/ckeditor5/src/ui.js");
  2152. /* 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");
  2153. /**
  2154. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  2155. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  2156. */
  2157. /**
  2158. * @module basic-styles/strikethrough/strikethroughui
  2159. */
  2160. const STRIKETHROUGH = 'strikethrough';
  2161. /**
  2162. * The strikethrough UI feature. It introduces the Strikethrough button.
  2163. *
  2164. * @extends module:core/plugin~Plugin
  2165. */
  2166. class StrikethroughUI extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  2167. /**
  2168. * @inheritDoc
  2169. */
  2170. static get pluginName() {
  2171. return 'StrikethroughUI';
  2172. }
  2173. /**
  2174. * @inheritDoc
  2175. */
  2176. init() {
  2177. const editor = this.editor;
  2178. const t = editor.t;
  2179. // Add strikethrough button to feature components.
  2180. editor.ui.componentFactory.add( STRIKETHROUGH, locale => {
  2181. const command = editor.commands.get( STRIKETHROUGH );
  2182. const view = new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__["ButtonView"]( locale );
  2183. view.set( {
  2184. label: t( 'Strikethrough' ),
  2185. icon: _theme_icons_strikethrough_svg__WEBPACK_IMPORTED_MODULE_2__["default"],
  2186. keystroke: 'CTRL+SHIFT+X',
  2187. tooltip: true,
  2188. isToggleable: true
  2189. } );
  2190. view.bind( 'isOn', 'isEnabled' ).to( command, 'value', 'isEnabled' );
  2191. // Execute command.
  2192. this.listenTo( view, 'execute', () => {
  2193. editor.execute( STRIKETHROUGH );
  2194. editor.editing.view.focus();
  2195. } );
  2196. return view;
  2197. } );
  2198. }
  2199. }
  2200. /***/ }),
  2201. /***/ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/subscript.js":
  2202. /*!************************************************************************!*\
  2203. !*** ./node_modules/@ckeditor/ckeditor5-basic-styles/src/subscript.js ***!
  2204. \************************************************************************/
  2205. /*! exports provided: default */
  2206. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2207. "use strict";
  2208. __webpack_require__.r(__webpack_exports__);
  2209. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Subscript; });
  2210. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  2211. /* harmony import */ var _subscript_subscriptediting__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./subscript/subscriptediting */ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/subscript/subscriptediting.js");
  2212. /* harmony import */ var _subscript_subscriptui__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./subscript/subscriptui */ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/subscript/subscriptui.js");
  2213. /**
  2214. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  2215. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  2216. */
  2217. /**
  2218. * @module basic-styles/subscript
  2219. */
  2220. /**
  2221. * The subscript feature.
  2222. *
  2223. * It loads the {@link module:basic-styles/subscript/subscriptediting~SubscriptEditing} and
  2224. * {@link module:basic-styles/subscript/subscriptui~SubscriptUI} plugins.
  2225. *
  2226. * @extends module:core/plugin~Plugin
  2227. */
  2228. class Subscript extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  2229. /**
  2230. * @inheritDoc
  2231. */
  2232. static get requires() {
  2233. return [ _subscript_subscriptediting__WEBPACK_IMPORTED_MODULE_1__["default"], _subscript_subscriptui__WEBPACK_IMPORTED_MODULE_2__["default"] ];
  2234. }
  2235. /**
  2236. * @inheritDoc
  2237. */
  2238. static get pluginName() {
  2239. return 'Subscript';
  2240. }
  2241. }
  2242. /***/ }),
  2243. /***/ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/subscript/subscriptediting.js":
  2244. /*!*****************************************************************************************!*\
  2245. !*** ./node_modules/@ckeditor/ckeditor5-basic-styles/src/subscript/subscriptediting.js ***!
  2246. \*****************************************************************************************/
  2247. /*! exports provided: default */
  2248. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2249. "use strict";
  2250. __webpack_require__.r(__webpack_exports__);
  2251. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return SubscriptEditing; });
  2252. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  2253. /* harmony import */ var _attributecommand__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../attributecommand */ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/attributecommand.js");
  2254. /**
  2255. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  2256. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  2257. */
  2258. /**
  2259. * @module basic-styles/subscript/subscriptediting
  2260. */
  2261. const SUBSCRIPT = 'subscript';
  2262. /**
  2263. * The subscript editing feature.
  2264. *
  2265. * It registers the `sub` command and introduces the `sub` attribute in the model which renders to the view
  2266. * as a `<sub>` element.
  2267. *
  2268. * @extends module:core/plugin~Plugin
  2269. */
  2270. class SubscriptEditing extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  2271. /**
  2272. * @inheritDoc
  2273. */
  2274. static get pluginName() {
  2275. return 'SubscriptEditing';
  2276. }
  2277. /**
  2278. * @inheritDoc
  2279. */
  2280. init() {
  2281. const editor = this.editor;
  2282. // Allow sub attribute on text nodes.
  2283. editor.model.schema.extend( '$text', { allowAttributes: SUBSCRIPT } );
  2284. editor.model.schema.setAttributeProperties( SUBSCRIPT, {
  2285. isFormatting: true,
  2286. copyOnEnter: true
  2287. } );
  2288. // Build converter from model to view for data and editing pipelines.
  2289. editor.conversion.attributeToElement( {
  2290. model: SUBSCRIPT,
  2291. view: 'sub',
  2292. upcastAlso: [
  2293. {
  2294. styles: {
  2295. 'vertical-align': 'sub'
  2296. }
  2297. }
  2298. ]
  2299. } );
  2300. // Create sub command.
  2301. editor.commands.add( SUBSCRIPT, new _attributecommand__WEBPACK_IMPORTED_MODULE_1__["default"]( editor, SUBSCRIPT ) );
  2302. }
  2303. }
  2304. /***/ }),
  2305. /***/ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/subscript/subscriptui.js":
  2306. /*!************************************************************************************!*\
  2307. !*** ./node_modules/@ckeditor/ckeditor5-basic-styles/src/subscript/subscriptui.js ***!
  2308. \************************************************************************************/
  2309. /*! exports provided: default */
  2310. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2311. "use strict";
  2312. __webpack_require__.r(__webpack_exports__);
  2313. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return SubscriptUI; });
  2314. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  2315. /* harmony import */ var ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/ui */ "./node_modules/ckeditor5/src/ui.js");
  2316. /* 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");
  2317. /**
  2318. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  2319. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  2320. */
  2321. /**
  2322. * @module basic-styles/subscript/subscriptui
  2323. */
  2324. const SUBSCRIPT = 'subscript';
  2325. /**
  2326. * The subscript UI feature. It introduces the Subscript button.
  2327. *
  2328. * @extends module:core/plugin~Plugin
  2329. */
  2330. class SubscriptUI extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  2331. /**
  2332. * @inheritDoc
  2333. */
  2334. static get pluginName() {
  2335. return 'SubscriptUI';
  2336. }
  2337. /**
  2338. * @inheritDoc
  2339. */
  2340. init() {
  2341. const editor = this.editor;
  2342. const t = editor.t;
  2343. // Add subscript button to feature components.
  2344. editor.ui.componentFactory.add( SUBSCRIPT, locale => {
  2345. const command = editor.commands.get( SUBSCRIPT );
  2346. const view = new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__["ButtonView"]( locale );
  2347. view.set( {
  2348. label: t( 'Subscript' ),
  2349. icon: _theme_icons_subscript_svg__WEBPACK_IMPORTED_MODULE_2__["default"],
  2350. tooltip: true,
  2351. isToggleable: true
  2352. } );
  2353. view.bind( 'isOn', 'isEnabled' ).to( command, 'value', 'isEnabled' );
  2354. // Execute command.
  2355. this.listenTo( view, 'execute', () => {
  2356. editor.execute( SUBSCRIPT );
  2357. editor.editing.view.focus();
  2358. } );
  2359. return view;
  2360. } );
  2361. }
  2362. }
  2363. /***/ }),
  2364. /***/ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/superscript.js":
  2365. /*!**************************************************************************!*\
  2366. !*** ./node_modules/@ckeditor/ckeditor5-basic-styles/src/superscript.js ***!
  2367. \**************************************************************************/
  2368. /*! exports provided: default */
  2369. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2370. "use strict";
  2371. __webpack_require__.r(__webpack_exports__);
  2372. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Superscript; });
  2373. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  2374. /* harmony import */ var _superscript_superscriptediting__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./superscript/superscriptediting */ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/superscript/superscriptediting.js");
  2375. /* harmony import */ var _superscript_superscriptui__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./superscript/superscriptui */ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/superscript/superscriptui.js");
  2376. /**
  2377. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  2378. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  2379. */
  2380. /**
  2381. * @module basic-styles/superscript
  2382. */
  2383. /**
  2384. * The superscript feature.
  2385. *
  2386. * It loads the {@link module:basic-styles/superscript/superscriptediting~SuperscriptEditing} and
  2387. * {@link module:basic-styles/superscript/superscriptui~SuperscriptUI} plugins.
  2388. *
  2389. * @extends module:core/plugin~Plugin
  2390. */
  2391. class Superscript extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  2392. /**
  2393. * @inheritDoc
  2394. */
  2395. static get requires() {
  2396. return [ _superscript_superscriptediting__WEBPACK_IMPORTED_MODULE_1__["default"], _superscript_superscriptui__WEBPACK_IMPORTED_MODULE_2__["default"] ];
  2397. }
  2398. /**
  2399. * @inheritDoc
  2400. */
  2401. static get pluginName() {
  2402. return 'Superscript';
  2403. }
  2404. }
  2405. /***/ }),
  2406. /***/ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/superscript/superscriptediting.js":
  2407. /*!*********************************************************************************************!*\
  2408. !*** ./node_modules/@ckeditor/ckeditor5-basic-styles/src/superscript/superscriptediting.js ***!
  2409. \*********************************************************************************************/
  2410. /*! exports provided: default */
  2411. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2412. "use strict";
  2413. __webpack_require__.r(__webpack_exports__);
  2414. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return SuperscriptEditing; });
  2415. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  2416. /* harmony import */ var _attributecommand__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../attributecommand */ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/attributecommand.js");
  2417. /**
  2418. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  2419. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  2420. */
  2421. /**
  2422. * @module basic-styles/superscript/superscriptediting
  2423. */
  2424. const SUPERSCRIPT = 'superscript';
  2425. /**
  2426. * The superscript editing feature.
  2427. *
  2428. * It registers the `super` command and introduces the `super` attribute in the model which renders to the view
  2429. * as a `<super>` element.
  2430. *
  2431. * @extends module:core/plugin~Plugin
  2432. */
  2433. class SuperscriptEditing extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  2434. /**
  2435. * @inheritDoc
  2436. */
  2437. static get pluginName() {
  2438. return 'SuperscriptEditing';
  2439. }
  2440. /**
  2441. * @inheritDoc
  2442. */
  2443. init() {
  2444. const editor = this.editor;
  2445. // Allow super attribute on text nodes.
  2446. editor.model.schema.extend( '$text', { allowAttributes: SUPERSCRIPT } );
  2447. editor.model.schema.setAttributeProperties( SUPERSCRIPT, {
  2448. isFormatting: true,
  2449. copyOnEnter: true
  2450. } );
  2451. // Build converter from model to view for data and editing pipelines.
  2452. editor.conversion.attributeToElement( {
  2453. model: SUPERSCRIPT,
  2454. view: 'sup',
  2455. upcastAlso: [
  2456. {
  2457. styles: {
  2458. 'vertical-align': 'super'
  2459. }
  2460. }
  2461. ]
  2462. } );
  2463. // Create super command.
  2464. editor.commands.add( SUPERSCRIPT, new _attributecommand__WEBPACK_IMPORTED_MODULE_1__["default"]( editor, SUPERSCRIPT ) );
  2465. }
  2466. }
  2467. /***/ }),
  2468. /***/ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/superscript/superscriptui.js":
  2469. /*!****************************************************************************************!*\
  2470. !*** ./node_modules/@ckeditor/ckeditor5-basic-styles/src/superscript/superscriptui.js ***!
  2471. \****************************************************************************************/
  2472. /*! exports provided: default */
  2473. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2474. "use strict";
  2475. __webpack_require__.r(__webpack_exports__);
  2476. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return SuperscriptUI; });
  2477. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  2478. /* harmony import */ var ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/ui */ "./node_modules/ckeditor5/src/ui.js");
  2479. /* 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");
  2480. /**
  2481. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  2482. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  2483. */
  2484. /**
  2485. * @module basic-styles/superscript/superscriptui
  2486. */
  2487. const SUPERSCRIPT = 'superscript';
  2488. /**
  2489. * The superscript UI feature. It introduces the Superscript button.
  2490. *
  2491. * @extends module:core/plugin~Plugin
  2492. */
  2493. class SuperscriptUI extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  2494. /**
  2495. * @inheritDoc
  2496. */
  2497. static get pluginName() {
  2498. return 'SuperscriptUI';
  2499. }
  2500. /**
  2501. * @inheritDoc
  2502. */
  2503. init() {
  2504. const editor = this.editor;
  2505. const t = editor.t;
  2506. // Add superscript button to feature components.
  2507. editor.ui.componentFactory.add( SUPERSCRIPT, locale => {
  2508. const command = editor.commands.get( SUPERSCRIPT );
  2509. const view = new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__["ButtonView"]( locale );
  2510. view.set( {
  2511. label: t( 'Superscript' ),
  2512. icon: _theme_icons_superscript_svg__WEBPACK_IMPORTED_MODULE_2__["default"],
  2513. tooltip: true,
  2514. isToggleable: true
  2515. } );
  2516. view.bind( 'isOn', 'isEnabled' ).to( command, 'value', 'isEnabled' );
  2517. // Execute command.
  2518. this.listenTo( view, 'execute', () => {
  2519. editor.execute( SUPERSCRIPT );
  2520. editor.editing.view.focus();
  2521. } );
  2522. return view;
  2523. } );
  2524. }
  2525. }
  2526. /***/ }),
  2527. /***/ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/underline.js":
  2528. /*!************************************************************************!*\
  2529. !*** ./node_modules/@ckeditor/ckeditor5-basic-styles/src/underline.js ***!
  2530. \************************************************************************/
  2531. /*! exports provided: default */
  2532. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2533. "use strict";
  2534. __webpack_require__.r(__webpack_exports__);
  2535. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Underline; });
  2536. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  2537. /* harmony import */ var _underline_underlineediting__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./underline/underlineediting */ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/underline/underlineediting.js");
  2538. /* harmony import */ var _underline_underlineui__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./underline/underlineui */ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/underline/underlineui.js");
  2539. /**
  2540. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  2541. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  2542. */
  2543. /**
  2544. * @module basic-styles/underline
  2545. */
  2546. /**
  2547. * The underline feature.
  2548. *
  2549. * For a detailed overview check the {@glink features/basic-styles Basic styles feature documentation}
  2550. * and the {@glink api/basic-styles package page}.
  2551. *
  2552. * This is a "glue" plugin which loads the {@link module:basic-styles/underline/underlineediting~UnderlineEditing} and
  2553. * {@link module:basic-styles/underline/underlineui~UnderlineUI} plugins.
  2554. *
  2555. * @extends module:core/plugin~Plugin
  2556. */
  2557. class Underline extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  2558. /**
  2559. * @inheritDoc
  2560. */
  2561. static get requires() {
  2562. return [ _underline_underlineediting__WEBPACK_IMPORTED_MODULE_1__["default"], _underline_underlineui__WEBPACK_IMPORTED_MODULE_2__["default"] ];
  2563. }
  2564. /**
  2565. * @inheritDoc
  2566. */
  2567. static get pluginName() {
  2568. return 'Underline';
  2569. }
  2570. }
  2571. /***/ }),
  2572. /***/ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/underline/underlineediting.js":
  2573. /*!*****************************************************************************************!*\
  2574. !*** ./node_modules/@ckeditor/ckeditor5-basic-styles/src/underline/underlineediting.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 UnderlineEditing; });
  2581. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.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-2021, 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/underline/underlineediting
  2589. */
  2590. const UNDERLINE = 'underline';
  2591. /**
  2592. * The underline editing feature.
  2593. *
  2594. * It registers the `'underline'` command, the <kbd>Ctrl+U</kbd> keystroke
  2595. * and introduces the `underline` attribute in the model which renders to the view as an `<u>` element.
  2596. *
  2597. * @extends module:core/plugin~Plugin
  2598. */
  2599. class UnderlineEditing extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  2600. /**
  2601. * @inheritDoc
  2602. */
  2603. static get pluginName() {
  2604. return 'UnderlineEditing';
  2605. }
  2606. /**
  2607. * @inheritDoc
  2608. */
  2609. init() {
  2610. const editor = this.editor;
  2611. // Allow strikethrough attribute on text nodes.
  2612. editor.model.schema.extend( '$text', { allowAttributes: UNDERLINE } );
  2613. editor.model.schema.setAttributeProperties( UNDERLINE, {
  2614. isFormatting: true,
  2615. copyOnEnter: true
  2616. } );
  2617. editor.conversion.attributeToElement( {
  2618. model: UNDERLINE,
  2619. view: 'u',
  2620. upcastAlso: {
  2621. styles: {
  2622. 'text-decoration': 'underline'
  2623. }
  2624. }
  2625. } );
  2626. // Create underline command.
  2627. editor.commands.add( UNDERLINE, new _attributecommand__WEBPACK_IMPORTED_MODULE_1__["default"]( editor, UNDERLINE ) );
  2628. // Set the Ctrl+U keystroke.
  2629. editor.keystrokes.set( 'CTRL+U', 'underline' );
  2630. }
  2631. }
  2632. /***/ }),
  2633. /***/ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/underline/underlineui.js":
  2634. /*!************************************************************************************!*\
  2635. !*** ./node_modules/@ckeditor/ckeditor5-basic-styles/src/underline/underlineui.js ***!
  2636. \************************************************************************************/
  2637. /*! exports provided: default */
  2638. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2639. "use strict";
  2640. __webpack_require__.r(__webpack_exports__);
  2641. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return UnderlineUI; });
  2642. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  2643. /* harmony import */ var ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/ui */ "./node_modules/ckeditor5/src/ui.js");
  2644. /* 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");
  2645. /**
  2646. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  2647. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  2648. */
  2649. /**
  2650. * @module basic-styles/underline/underlineui
  2651. */
  2652. const UNDERLINE = 'underline';
  2653. /**
  2654. * The underline UI feature. It introduces the Underline button.
  2655. *
  2656. * @extends module:core/plugin~Plugin
  2657. */
  2658. class UnderlineUI extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  2659. /**
  2660. * @inheritDoc
  2661. */
  2662. static get pluginName() {
  2663. return 'UnderlineUI';
  2664. }
  2665. /**
  2666. * @inheritDoc
  2667. */
  2668. init() {
  2669. const editor = this.editor;
  2670. const t = editor.t;
  2671. // Add bold button to feature components.
  2672. editor.ui.componentFactory.add( UNDERLINE, locale => {
  2673. const command = editor.commands.get( UNDERLINE );
  2674. const view = new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__["ButtonView"]( locale );
  2675. view.set( {
  2676. label: t( 'Underline' ),
  2677. icon: _theme_icons_underline_svg__WEBPACK_IMPORTED_MODULE_2__["default"],
  2678. keystroke: 'CTRL+U',
  2679. tooltip: true,
  2680. isToggleable: true
  2681. } );
  2682. view.bind( 'isOn', 'isEnabled' ).to( command, 'value', 'isEnabled' );
  2683. // Execute command.
  2684. this.listenTo( view, 'execute', () => {
  2685. editor.execute( UNDERLINE );
  2686. editor.editing.view.focus();
  2687. } );
  2688. return view;
  2689. } );
  2690. }
  2691. }
  2692. /***/ }),
  2693. /***/ "./node_modules/@ckeditor/ckeditor5-basic-styles/theme/icons/bold.svg":
  2694. /*!****************************************************************************!*\
  2695. !*** ./node_modules/@ckeditor/ckeditor5-basic-styles/theme/icons/bold.svg ***!
  2696. \****************************************************************************/
  2697. /*! exports provided: default */
  2698. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2699. "use strict";
  2700. __webpack_require__.r(__webpack_exports__);
  2701. /* 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>");
  2702. /***/ }),
  2703. /***/ "./node_modules/@ckeditor/ckeditor5-basic-styles/theme/icons/italic.svg":
  2704. /*!******************************************************************************!*\
  2705. !*** ./node_modules/@ckeditor/ckeditor5-basic-styles/theme/icons/italic.svg ***!
  2706. \******************************************************************************/
  2707. /*! exports provided: default */
  2708. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2709. "use strict";
  2710. __webpack_require__.r(__webpack_exports__);
  2711. /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"m9.586 14.633.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>");
  2712. /***/ }),
  2713. /***/ "./node_modules/@ckeditor/ckeditor5-basic-styles/theme/icons/strikethrough.svg":
  2714. /*!*************************************************************************************!*\
  2715. !*** ./node_modules/@ckeditor/ckeditor5-basic-styles/theme/icons/strikethrough.svg ***!
  2716. \*************************************************************************************/
  2717. /*! exports provided: default */
  2718. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2719. "use strict";
  2720. __webpack_require__.r(__webpack_exports__);
  2721. /* 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 9 6 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>");
  2722. /***/ }),
  2723. /***/ "./node_modules/@ckeditor/ckeditor5-basic-styles/theme/icons/subscript.svg":
  2724. /*!*********************************************************************************!*\
  2725. !*** ./node_modules/@ckeditor/ckeditor5-basic-styles/theme/icons/subscript.svg ***!
  2726. \*********************************************************************************/
  2727. /*! exports provided: default */
  2728. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2729. "use strict";
  2730. __webpack_require__.r(__webpack_exports__);
  2731. /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"m7.03 10.349 3.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>");
  2732. /***/ }),
  2733. /***/ "./node_modules/@ckeditor/ckeditor5-basic-styles/theme/icons/superscript.svg":
  2734. /*!***********************************************************************************!*\
  2735. !*** ./node_modules/@ckeditor/ckeditor5-basic-styles/theme/icons/superscript.svg ***!
  2736. \***********************************************************************************/
  2737. /*! exports provided: default */
  2738. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2739. "use strict";
  2740. __webpack_require__.r(__webpack_exports__);
  2741. /* 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>");
  2742. /***/ }),
  2743. /***/ "./node_modules/@ckeditor/ckeditor5-basic-styles/theme/icons/underline.svg":
  2744. /*!*********************************************************************************!*\
  2745. !*** ./node_modules/@ckeditor/ckeditor5-basic-styles/theme/icons/underline.svg ***!
  2746. \*********************************************************************************/
  2747. /*! exports provided: default */
  2748. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2749. "use strict";
  2750. __webpack_require__.r(__webpack_exports__);
  2751. /* 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>");
  2752. /***/ }),
  2753. /***/ "./node_modules/@ckeditor/ckeditor5-block-quote/src/blockquote.js":
  2754. /*!************************************************************************!*\
  2755. !*** ./node_modules/@ckeditor/ckeditor5-block-quote/src/blockquote.js ***!
  2756. \************************************************************************/
  2757. /*! exports provided: default */
  2758. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2759. "use strict";
  2760. __webpack_require__.r(__webpack_exports__);
  2761. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return BlockQuote; });
  2762. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  2763. /* harmony import */ var _blockquoteediting__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./blockquoteediting */ "./node_modules/@ckeditor/ckeditor5-block-quote/src/blockquoteediting.js");
  2764. /* harmony import */ var _blockquoteui__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./blockquoteui */ "./node_modules/@ckeditor/ckeditor5-block-quote/src/blockquoteui.js");
  2765. /**
  2766. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  2767. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  2768. */
  2769. /**
  2770. * @module block-quote/blockquote
  2771. */
  2772. /**
  2773. * The block quote plugin.
  2774. *
  2775. * For more information about this feature check the {@glink api/block-quote package page}.
  2776. *
  2777. * This is a "glue" plugin which loads the {@link module:block-quote/blockquoteediting~BlockQuoteEditing block quote editing feature}
  2778. * and {@link module:block-quote/blockquoteui~BlockQuoteUI block quote UI feature}.
  2779. *
  2780. * @extends module:core/plugin~Plugin
  2781. */
  2782. class BlockQuote extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  2783. /**
  2784. * @inheritDoc
  2785. */
  2786. static get requires() {
  2787. return [ _blockquoteediting__WEBPACK_IMPORTED_MODULE_1__["default"], _blockquoteui__WEBPACK_IMPORTED_MODULE_2__["default"] ];
  2788. }
  2789. /**
  2790. * @inheritDoc
  2791. */
  2792. static get pluginName() {
  2793. return 'BlockQuote';
  2794. }
  2795. }
  2796. /***/ }),
  2797. /***/ "./node_modules/@ckeditor/ckeditor5-block-quote/src/blockquotecommand.js":
  2798. /*!*******************************************************************************!*\
  2799. !*** ./node_modules/@ckeditor/ckeditor5-block-quote/src/blockquotecommand.js ***!
  2800. \*******************************************************************************/
  2801. /*! exports provided: default */
  2802. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2803. "use strict";
  2804. __webpack_require__.r(__webpack_exports__);
  2805. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return BlockQuoteCommand; });
  2806. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  2807. /* harmony import */ var ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/utils */ "./node_modules/ckeditor5/src/utils.js");
  2808. /**
  2809. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  2810. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  2811. */
  2812. /**
  2813. * @module block-quote/blockquotecommand
  2814. */
  2815. /**
  2816. * The block quote command plugin.
  2817. *
  2818. * @extends module:core/command~Command
  2819. */
  2820. class BlockQuoteCommand extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Command"] {
  2821. /**
  2822. * Whether the selection starts in a block quote.
  2823. *
  2824. * @observable
  2825. * @readonly
  2826. * @member {Boolean} #value
  2827. */
  2828. /**
  2829. * @inheritDoc
  2830. */
  2831. refresh() {
  2832. this.value = this._getValue();
  2833. this.isEnabled = this._checkEnabled();
  2834. }
  2835. /**
  2836. * Executes the command. When the command {@link #value is on}, all top-most block quotes within
  2837. * the selection will be removed. If it is off, all selected blocks will be wrapped with
  2838. * a block quote.
  2839. *
  2840. * @fires execute
  2841. * @param {Object} [options] Command options.
  2842. * @param {Boolean} [options.forceValue] If set, it will force the command behavior. If `true`, the command will apply a block quote,
  2843. * otherwise the command will remove the block quote. If not set, the command will act basing on its current value.
  2844. */
  2845. execute( options = {} ) {
  2846. const model = this.editor.model;
  2847. const schema = model.schema;
  2848. const selection = model.document.selection;
  2849. const blocks = Array.from( selection.getSelectedBlocks() );
  2850. const value = ( options.forceValue === undefined ) ? !this.value : options.forceValue;
  2851. model.change( writer => {
  2852. if ( !value ) {
  2853. this._removeQuote( writer, blocks.filter( findQuote ) );
  2854. } else {
  2855. const blocksToQuote = blocks.filter( block => {
  2856. // Already quoted blocks needs to be considered while quoting too
  2857. // in order to reuse their <bQ> elements.
  2858. return findQuote( block ) || checkCanBeQuoted( schema, block );
  2859. } );
  2860. this._applyQuote( writer, blocksToQuote );
  2861. }
  2862. } );
  2863. }
  2864. /**
  2865. * Checks the command's {@link #value}.
  2866. *
  2867. * @private
  2868. * @returns {Boolean} The current value.
  2869. */
  2870. _getValue() {
  2871. const selection = this.editor.model.document.selection;
  2872. const firstBlock = Object(ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_1__["first"])( selection.getSelectedBlocks() );
  2873. // In the current implementation, the block quote must be an immediate parent of a block element.
  2874. return !!( firstBlock && findQuote( firstBlock ) );
  2875. }
  2876. /**
  2877. * Checks whether the command can be enabled in the current context.
  2878. *
  2879. * @private
  2880. * @returns {Boolean} Whether the command should be enabled.
  2881. */
  2882. _checkEnabled() {
  2883. if ( this.value ) {
  2884. return true;
  2885. }
  2886. const selection = this.editor.model.document.selection;
  2887. const schema = this.editor.model.schema;
  2888. const firstBlock = Object(ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_1__["first"])( selection.getSelectedBlocks() );
  2889. if ( !firstBlock ) {
  2890. return false;
  2891. }
  2892. return checkCanBeQuoted( schema, firstBlock );
  2893. }
  2894. /**
  2895. * Removes the quote from given blocks.
  2896. *
  2897. * If blocks which are supposed to be "unquoted" are in the middle of a quote,
  2898. * start it or end it, then the quote will be split (if needed) and the blocks
  2899. * will be moved out of it, so other quoted blocks remained quoted.
  2900. *
  2901. * @private
  2902. * @param {module:engine/model/writer~Writer} writer
  2903. * @param {Array.<module:engine/model/element~Element>} blocks
  2904. */
  2905. _removeQuote( writer, blocks ) {
  2906. // Unquote all groups of block. Iterate in the reverse order to not break following ranges.
  2907. getRangesOfBlockGroups( writer, blocks ).reverse().forEach( groupRange => {
  2908. if ( groupRange.start.isAtStart && groupRange.end.isAtEnd ) {
  2909. writer.unwrap( groupRange.start.parent );
  2910. return;
  2911. }
  2912. // The group of blocks are at the beginning of an <bQ> so let's move them left (out of the <bQ>).
  2913. if ( groupRange.start.isAtStart ) {
  2914. const positionBefore = writer.createPositionBefore( groupRange.start.parent );
  2915. writer.move( groupRange, positionBefore );
  2916. return;
  2917. }
  2918. // The blocks are in the middle of an <bQ> so we need to split the <bQ> after the last block
  2919. // so we move the items there.
  2920. if ( !groupRange.end.isAtEnd ) {
  2921. writer.split( groupRange.end );
  2922. }
  2923. // Now we are sure that groupRange.end.isAtEnd is true, so let's move the blocks right.
  2924. const positionAfter = writer.createPositionAfter( groupRange.end.parent );
  2925. writer.move( groupRange, positionAfter );
  2926. } );
  2927. }
  2928. /**
  2929. * Applies the quote to given blocks.
  2930. *
  2931. * @private
  2932. * @param {module:engine/model/writer~Writer} writer
  2933. * @param {Array.<module:engine/model/element~Element>} blocks
  2934. */
  2935. _applyQuote( writer, blocks ) {
  2936. const quotesToMerge = [];
  2937. // Quote all groups of block. Iterate in the reverse order to not break following ranges.
  2938. getRangesOfBlockGroups( writer, blocks ).reverse().forEach( groupRange => {
  2939. let quote = findQuote( groupRange.start );
  2940. if ( !quote ) {
  2941. quote = writer.createElement( 'blockQuote' );
  2942. writer.wrap( groupRange, quote );
  2943. }
  2944. quotesToMerge.push( quote );
  2945. } );
  2946. // Merge subsequent <bQ> elements. Reverse the order again because this time we want to go through
  2947. // the <bQ> elements in the source order (due to how merge works – it moves the right element's content
  2948. // to the first element and removes the right one. Since we may need to merge a couple of subsequent `<bQ>` elements
  2949. // we want to keep the reference to the first (furthest left) one.
  2950. quotesToMerge.reverse().reduce( ( currentQuote, nextQuote ) => {
  2951. if ( currentQuote.nextSibling == nextQuote ) {
  2952. writer.merge( writer.createPositionAfter( currentQuote ) );
  2953. return currentQuote;
  2954. }
  2955. return nextQuote;
  2956. } );
  2957. }
  2958. }
  2959. function findQuote( elementOrPosition ) {
  2960. return elementOrPosition.parent.name == 'blockQuote' ? elementOrPosition.parent : null;
  2961. }
  2962. // Returns a minimal array of ranges containing groups of subsequent blocks.
  2963. //
  2964. // content: abcdefgh
  2965. // blocks: [ a, b, d, f, g, h ]
  2966. // output ranges: [ab]c[d]e[fgh]
  2967. //
  2968. // @param {Array.<module:engine/model/element~Element>} blocks
  2969. // @returns {Array.<module:engine/model/range~Range>}
  2970. function getRangesOfBlockGroups( writer, blocks ) {
  2971. let startPosition;
  2972. let i = 0;
  2973. const ranges = [];
  2974. while ( i < blocks.length ) {
  2975. const block = blocks[ i ];
  2976. const nextBlock = blocks[ i + 1 ];
  2977. if ( !startPosition ) {
  2978. startPosition = writer.createPositionBefore( block );
  2979. }
  2980. if ( !nextBlock || block.nextSibling != nextBlock ) {
  2981. ranges.push( writer.createRange( startPosition, writer.createPositionAfter( block ) ) );
  2982. startPosition = null;
  2983. }
  2984. i++;
  2985. }
  2986. return ranges;
  2987. }
  2988. // Checks whether <bQ> can wrap the block.
  2989. function checkCanBeQuoted( schema, block ) {
  2990. // TMP will be replaced with schema.checkWrap().
  2991. const isBQAllowed = schema.checkChild( block.parent, 'blockQuote' );
  2992. const isBlockAllowedInBQ = schema.checkChild( [ '$root', 'blockQuote' ], block );
  2993. return isBQAllowed && isBlockAllowedInBQ;
  2994. }
  2995. /***/ }),
  2996. /***/ "./node_modules/@ckeditor/ckeditor5-block-quote/src/blockquoteediting.js":
  2997. /*!*******************************************************************************!*\
  2998. !*** ./node_modules/@ckeditor/ckeditor5-block-quote/src/blockquoteediting.js ***!
  2999. \*******************************************************************************/
  3000. /*! exports provided: default */
  3001. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3002. "use strict";
  3003. __webpack_require__.r(__webpack_exports__);
  3004. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return BlockQuoteEditing; });
  3005. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  3006. /* harmony import */ var ckeditor5_src_enter__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/enter */ "./node_modules/ckeditor5/src/enter.js");
  3007. /* harmony import */ var ckeditor5_src_typing__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ckeditor5/src/typing */ "./node_modules/ckeditor5/src/typing.js");
  3008. /* harmony import */ var _blockquotecommand__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./blockquotecommand */ "./node_modules/@ckeditor/ckeditor5-block-quote/src/blockquotecommand.js");
  3009. /**
  3010. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  3011. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  3012. */
  3013. /**
  3014. * @module block-quote/blockquoteediting
  3015. */
  3016. /**
  3017. * The block quote editing.
  3018. *
  3019. * Introduces the `'blockQuote'` command and the `'blockQuote'` model element.
  3020. *
  3021. * @extends module:core/plugin~Plugin
  3022. */
  3023. class BlockQuoteEditing extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  3024. /**
  3025. * @inheritDoc
  3026. */
  3027. static get pluginName() {
  3028. return 'BlockQuoteEditing';
  3029. }
  3030. /**
  3031. * @inheritDoc
  3032. */
  3033. static get requires() {
  3034. return [ ckeditor5_src_enter__WEBPACK_IMPORTED_MODULE_1__["Enter"], ckeditor5_src_typing__WEBPACK_IMPORTED_MODULE_2__["Delete"] ];
  3035. }
  3036. /**
  3037. * @inheritDoc
  3038. */
  3039. init() {
  3040. const editor = this.editor;
  3041. const schema = editor.model.schema;
  3042. editor.commands.add( 'blockQuote', new _blockquotecommand__WEBPACK_IMPORTED_MODULE_3__["default"]( editor ) );
  3043. schema.register( 'blockQuote', {
  3044. allowWhere: '$block',
  3045. allowContentOf: '$root'
  3046. } );
  3047. editor.conversion.elementToElement( { model: 'blockQuote', view: 'blockquote' } );
  3048. // Postfixer which cleans incorrect model states connected with block quotes.
  3049. editor.model.document.registerPostFixer( writer => {
  3050. const changes = editor.model.document.differ.getChanges();
  3051. for ( const entry of changes ) {
  3052. if ( entry.type == 'insert' ) {
  3053. const element = entry.position.nodeAfter;
  3054. if ( !element ) {
  3055. // We are inside a text node.
  3056. continue;
  3057. }
  3058. if ( element.is( 'element', 'blockQuote' ) && element.isEmpty ) {
  3059. // Added an empty blockQuote - remove it.
  3060. writer.remove( element );
  3061. return true;
  3062. } else if ( element.is( 'element', 'blockQuote' ) && !schema.checkChild( entry.position, element ) ) {
  3063. // Added a blockQuote in incorrect place. Unwrap it so the content inside is not lost.
  3064. writer.unwrap( element );
  3065. return true;
  3066. } else if ( element.is( 'element' ) ) {
  3067. // Just added an element. Check that all children meet the scheme rules.
  3068. const range = writer.createRangeIn( element );
  3069. for ( const child of range.getItems() ) {
  3070. if (
  3071. child.is( 'element', 'blockQuote' ) &&
  3072. !schema.checkChild( writer.createPositionBefore( child ), child )
  3073. ) {
  3074. writer.unwrap( child );
  3075. return true;
  3076. }
  3077. }
  3078. }
  3079. } else if ( entry.type == 'remove' ) {
  3080. const parent = entry.position.parent;
  3081. if ( parent.is( 'element', 'blockQuote' ) && parent.isEmpty ) {
  3082. // Something got removed and now blockQuote is empty. Remove the blockQuote as well.
  3083. writer.remove( parent );
  3084. return true;
  3085. }
  3086. }
  3087. }
  3088. return false;
  3089. } );
  3090. const viewDocument = this.editor.editing.view.document;
  3091. const selection = editor.model.document.selection;
  3092. const blockQuoteCommand = editor.commands.get( 'blockQuote' );
  3093. // Overwrite default Enter key behavior.
  3094. // If Enter key is pressed with selection collapsed in empty block inside a quote, break the quote.
  3095. this.listenTo( viewDocument, 'enter', ( evt, data ) => {
  3096. if ( !selection.isCollapsed || !blockQuoteCommand.value ) {
  3097. return;
  3098. }
  3099. const positionParent = selection.getLastPosition().parent;
  3100. if ( positionParent.isEmpty ) {
  3101. editor.execute( 'blockQuote' );
  3102. editor.editing.view.scrollToTheSelection();
  3103. data.preventDefault();
  3104. evt.stop();
  3105. }
  3106. }, { context: 'blockquote' } );
  3107. // Overwrite default Backspace key behavior.
  3108. // If Backspace key is pressed with selection collapsed in first empty block inside a quote, break the quote.
  3109. this.listenTo( viewDocument, 'delete', ( evt, data ) => {
  3110. if ( data.direction != 'backward' || !selection.isCollapsed || !blockQuoteCommand.value ) {
  3111. return;
  3112. }
  3113. const positionParent = selection.getLastPosition().parent;
  3114. if ( positionParent.isEmpty && !positionParent.previousSibling ) {
  3115. editor.execute( 'blockQuote' );
  3116. editor.editing.view.scrollToTheSelection();
  3117. data.preventDefault();
  3118. evt.stop();
  3119. }
  3120. }, { context: 'blockquote' } );
  3121. }
  3122. }
  3123. /***/ }),
  3124. /***/ "./node_modules/@ckeditor/ckeditor5-block-quote/src/blockquoteui.js":
  3125. /*!**************************************************************************!*\
  3126. !*** ./node_modules/@ckeditor/ckeditor5-block-quote/src/blockquoteui.js ***!
  3127. \**************************************************************************/
  3128. /*! exports provided: default */
  3129. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3130. "use strict";
  3131. __webpack_require__.r(__webpack_exports__);
  3132. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return BlockQuoteUI; });
  3133. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  3134. /* harmony import */ var ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/ui */ "./node_modules/ckeditor5/src/ui.js");
  3135. /* harmony import */ var _theme_blockquote_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../theme/blockquote.css */ "./node_modules/@ckeditor/ckeditor5-block-quote/theme/blockquote.css");
  3136. /* harmony import */ var _theme_blockquote_css__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_theme_blockquote_css__WEBPACK_IMPORTED_MODULE_2__);
  3137. /**
  3138. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  3139. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  3140. */
  3141. /**
  3142. * @module block-quote/blockquoteui
  3143. */
  3144. /**
  3145. * The block quote UI plugin.
  3146. *
  3147. * It introduces the `'blockQuote'` button.
  3148. *
  3149. * @extends module:core/plugin~Plugin
  3150. */
  3151. class BlockQuoteUI extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  3152. /**
  3153. * @inheritDoc
  3154. */
  3155. static get pluginName() {
  3156. return 'BlockQuoteUI';
  3157. }
  3158. /**
  3159. * @inheritDoc
  3160. */
  3161. init() {
  3162. const editor = this.editor;
  3163. const t = editor.t;
  3164. editor.ui.componentFactory.add( 'blockQuote', locale => {
  3165. const command = editor.commands.get( 'blockQuote' );
  3166. const buttonView = new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__["ButtonView"]( locale );
  3167. buttonView.set( {
  3168. label: t( 'Block quote' ),
  3169. icon: ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["icons"].quote,
  3170. tooltip: true,
  3171. isToggleable: true
  3172. } );
  3173. // Bind button model to command.
  3174. buttonView.bind( 'isOn', 'isEnabled' ).to( command, 'value', 'isEnabled' );
  3175. // Execute command.
  3176. this.listenTo( buttonView, 'execute', () => {
  3177. editor.execute( 'blockQuote' );
  3178. editor.editing.view.focus();
  3179. } );
  3180. return buttonView;
  3181. } );
  3182. }
  3183. }
  3184. /***/ }),
  3185. /***/ "./node_modules/@ckeditor/ckeditor5-block-quote/theme/blockquote.css":
  3186. /*!***************************************************************************!*\
  3187. !*** ./node_modules/@ckeditor/ckeditor5-block-quote/theme/blockquote.css ***!
  3188. \***************************************************************************/
  3189. /*! no static exports found */
  3190. /***/ (function(module, exports, __webpack_require__) {
  3191. var api = __webpack_require__(/*! ../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  3192. 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");
  3193. content = content.__esModule ? content.default : content;
  3194. if (typeof content === 'string') {
  3195. content = [[module.i, content, '']];
  3196. }
  3197. var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
  3198. options.insert = "head";
  3199. options.singleton = true;
  3200. var update = api(content, options);
  3201. module.exports = content.locals || {};
  3202. /***/ }),
  3203. /***/ "./node_modules/@ckeditor/ckeditor5-ckfinder/src/ckfinder.js":
  3204. /*!*******************************************************************!*\
  3205. !*** ./node_modules/@ckeditor/ckeditor5-ckfinder/src/ckfinder.js ***!
  3206. \*******************************************************************/
  3207. /*! exports provided: default */
  3208. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3209. "use strict";
  3210. __webpack_require__.r(__webpack_exports__);
  3211. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return CKFinder; });
  3212. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  3213. /* harmony import */ var _ckfinderui__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ckfinderui */ "./node_modules/@ckeditor/ckeditor5-ckfinder/src/ckfinderui.js");
  3214. /* harmony import */ var _ckfinderediting__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./ckfinderediting */ "./node_modules/@ckeditor/ckeditor5-ckfinder/src/ckfinderediting.js");
  3215. /**
  3216. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  3217. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  3218. */
  3219. /**
  3220. * @module ckfinder/ckfinder
  3221. */
  3222. /**
  3223. * The CKFinder feature, a bridge between the CKEditor 5 WYSIWYG editor and the
  3224. * [CKFinder](https://ckeditor.com/ckfinder) file manager and uploader.
  3225. *
  3226. * This is a "glue" plugin which enables:
  3227. *
  3228. * * {@link module:ckfinder/ckfinderediting~CKFinderEditing},
  3229. * * {@link module:ckfinder/ckfinderui~CKFinderUI},
  3230. * * {@link module:adapter-ckfinder/uploadadapter~CKFinderUploadAdapter}.
  3231. *
  3232. * See the {@glink features/image-upload/ckfinder "CKFinder integration" guide} to learn how to configure
  3233. * and use this feature.
  3234. *
  3235. * Check out the {@glink features/image-upload/image-upload comprehensive "Image upload" guide} to learn about
  3236. * other ways to upload images into CKEditor 5.
  3237. *
  3238. * @extends module:core/plugin~Plugin
  3239. */
  3240. class CKFinder extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  3241. /**
  3242. * @inheritDoc
  3243. */
  3244. static get pluginName() {
  3245. return 'CKFinder';
  3246. }
  3247. /**
  3248. * @inheritDoc
  3249. */
  3250. static get requires() {
  3251. return [ 'Image', 'Link', 'CKFinderUploadAdapter', _ckfinderediting__WEBPACK_IMPORTED_MODULE_2__["default"], _ckfinderui__WEBPACK_IMPORTED_MODULE_1__["default"] ];
  3252. }
  3253. }
  3254. /**
  3255. * The configuration of the {@link module:ckfinder/ckfinder~CKFinder CKFinder feature}.
  3256. *
  3257. * Read more in {@link module:ckfinder/ckfinder~CKFinderConfig}.
  3258. *
  3259. * @member {module:ckfinder/ckfinder~CKFinderConfig} module:core/editor/editorconfig~EditorConfig#ckfinder
  3260. */
  3261. /**
  3262. * The configuration of the {@link module:ckfinder/ckfinder~CKFinder CKFinder feature}
  3263. * and its {@link module:adapter-ckfinder/uploadadapter~CKFinderUploadAdapter upload adapter}.
  3264. *
  3265. * ClassicEditor
  3266. * .create( editorElement, {
  3267. * ckfinder: {
  3268. * options: {
  3269. * resourceType: 'Images'
  3270. * }
  3271. * }
  3272. * } )
  3273. * .then( ... )
  3274. * .catch( ... );
  3275. *
  3276. * See {@link module:core/editor/editorconfig~EditorConfig all editor options}.
  3277. *
  3278. * @interface CKFinderConfig
  3279. */
  3280. /**
  3281. * The configuration options passed to the CKFinder file manager instance.
  3282. *
  3283. * Check the file manager [documentation](https://ckeditor.com/docs/ckfinder/ckfinder3/#!/api/CKFinder.Config-cfg-language)
  3284. * for the complete list of options.
  3285. *
  3286. * @member {Object} module:ckfinder/ckfinder~CKFinderConfig#options
  3287. */
  3288. /**
  3289. * The type of the CKFinder opener method.
  3290. *
  3291. * Supported types are:
  3292. *
  3293. * * `'modal'` &ndash; Opens CKFinder in a modal,
  3294. * * `'popup'` &ndash; Opens CKFinder in a new "pop-up" window.
  3295. *
  3296. * Defaults to `'modal'`.
  3297. *
  3298. * @member {String} module:ckfinder/ckfinder~CKFinderConfig#openerMethod
  3299. */
  3300. /**
  3301. * The path (URL) to the connector which handles the file upload in CKFinder file manager.
  3302. * When specified, it enables the automatic upload of resources such as images inserted into the content.
  3303. *
  3304. * For instance, to use CKFinder's
  3305. * [quick upload](https://ckeditor.com/docs/ckfinder/ckfinder3-php/commands.html#command_quick_upload)
  3306. * command, your can use the following (or similar) path:
  3307. *
  3308. * ClassicEditor
  3309. * .create( editorElement, {
  3310. * ckfinder: {
  3311. * uploadUrl: '/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Files&responseType=json'
  3312. * }
  3313. * } )
  3314. * .then( ... )
  3315. * .catch( ... );
  3316. *
  3317. * Used by the {@link module:adapter-ckfinder/uploadadapter~CKFinderUploadAdapter upload adapter}.
  3318. *
  3319. * @member {String} module:ckfinder/ckfinder~CKFinderConfig#uploadUrl
  3320. */
  3321. /***/ }),
  3322. /***/ "./node_modules/@ckeditor/ckeditor5-ckfinder/src/ckfindercommand.js":
  3323. /*!**************************************************************************!*\
  3324. !*** ./node_modules/@ckeditor/ckeditor5-ckfinder/src/ckfindercommand.js ***!
  3325. \**************************************************************************/
  3326. /*! exports provided: default */
  3327. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3328. "use strict";
  3329. __webpack_require__.r(__webpack_exports__);
  3330. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return CKFinderCommand; });
  3331. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  3332. /* harmony import */ var ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/utils */ "./node_modules/ckeditor5/src/utils.js");
  3333. /**
  3334. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  3335. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  3336. */
  3337. /* global window */
  3338. /**
  3339. * @module ckfinder/ckfindercommand
  3340. */
  3341. /**
  3342. * The CKFinder command. It is used by the {@link module:ckfinder/ckfinderediting~CKFinderEditing CKFinder editing feature}
  3343. * to open the CKFinder file manager to insert an image or a link to a file into the editor content.
  3344. *
  3345. * editor.execute( 'ckfinder' );
  3346. *
  3347. * **Note:** This command uses other features to perform tasks:
  3348. * - To insert images the {@link module:image/image/insertimagecommand~InsertImageCommand 'insertImage'} command
  3349. * from the {@link module:image/image~Image Image feature}.
  3350. * - To insert links to files the {@link module:link/linkcommand~LinkCommand 'link'} command
  3351. * from the {@link module:link/link~Link Link feature}.
  3352. *
  3353. * @extends module:core/command~Command
  3354. */
  3355. class CKFinderCommand extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Command"] {
  3356. /**
  3357. * @inheritDoc
  3358. */
  3359. constructor( editor ) {
  3360. super( editor );
  3361. // Remove default document listener to lower its priority.
  3362. this.stopListening( this.editor.model.document, 'change' );
  3363. // Lower this command listener priority to be sure that refresh() will be called after link & image refresh.
  3364. this.listenTo( this.editor.model.document, 'change', () => this.refresh(), { priority: 'low' } );
  3365. }
  3366. /**
  3367. * @inheritDoc
  3368. */
  3369. refresh() {
  3370. const imageCommand = this.editor.commands.get( 'insertImage' );
  3371. const linkCommand = this.editor.commands.get( 'link' );
  3372. // The CKFinder command is enabled when one of image or link command is enabled.
  3373. this.isEnabled = imageCommand.isEnabled || linkCommand.isEnabled;
  3374. }
  3375. /**
  3376. * @inheritDoc
  3377. */
  3378. execute() {
  3379. const editor = this.editor;
  3380. const openerMethod = this.editor.config.get( 'ckfinder.openerMethod' ) || 'modal';
  3381. if ( openerMethod != 'popup' && openerMethod != 'modal' ) {
  3382. /**
  3383. * The `ckfinder.openerMethod` must be one of: "popup" or "modal".
  3384. *
  3385. * @error ckfinder-unknown-openermethod
  3386. */
  3387. throw new ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_1__["CKEditorError"]( 'ckfinder-unknown-openermethod', editor );
  3388. }
  3389. const options = this.editor.config.get( 'ckfinder.options' ) || {};
  3390. options.chooseFiles = true;
  3391. // Cache the user-defined onInit method
  3392. const originalOnInit = options.onInit;
  3393. // Pass the lang code to the CKFinder if not defined by user.
  3394. if ( !options.language ) {
  3395. options.language = editor.locale.uiLanguage;
  3396. }
  3397. // The onInit method allows to extend CKFinder's behavior. It is used to attach event listeners to file choosing related events.
  3398. options.onInit = finder => {
  3399. // Call original options.onInit if it was defined by user.
  3400. if ( originalOnInit ) {
  3401. originalOnInit( finder );
  3402. }
  3403. finder.on( 'files:choose', evt => {
  3404. const files = evt.data.files.toArray();
  3405. // Insert links
  3406. const links = files.filter( file => !file.isImage() );
  3407. const images = files.filter( file => file.isImage() );
  3408. for ( const linkFile of links ) {
  3409. editor.execute( 'link', linkFile.getUrl() );
  3410. }
  3411. const imagesUrls = [];
  3412. for ( const image of images ) {
  3413. const url = image.getUrl();
  3414. imagesUrls.push( url ? url : finder.request( 'file:getProxyUrl', { file: image } ) );
  3415. }
  3416. if ( imagesUrls.length ) {
  3417. insertImages( editor, imagesUrls );
  3418. }
  3419. } );
  3420. finder.on( 'file:choose:resizedImage', evt => {
  3421. const resizedUrl = evt.data.resizedUrl;
  3422. if ( !resizedUrl ) {
  3423. const notification = editor.plugins.get( 'Notification' );
  3424. const t = editor.locale.t;
  3425. notification.showWarning( t( 'Could not obtain resized image URL.' ), {
  3426. title: t( 'Selecting resized image failed' ),
  3427. namespace: 'ckfinder'
  3428. } );
  3429. return;
  3430. }
  3431. insertImages( editor, [ resizedUrl ] );
  3432. } );
  3433. };
  3434. window.CKFinder[ openerMethod ]( options );
  3435. }
  3436. }
  3437. function insertImages( editor, urls ) {
  3438. const imageCommand = editor.commands.get( 'insertImage' );
  3439. // Check if inserting an image is actually possible - it might be possible to only insert a link.
  3440. if ( !imageCommand.isEnabled ) {
  3441. const notification = editor.plugins.get( 'Notification' );
  3442. const t = editor.locale.t;
  3443. notification.showWarning( t( 'Could not insert image at the current position.' ), {
  3444. title: t( 'Inserting image failed' ),
  3445. namespace: 'ckfinder'
  3446. } );
  3447. return;
  3448. }
  3449. editor.execute( 'insertImage', { source: urls } );
  3450. }
  3451. /***/ }),
  3452. /***/ "./node_modules/@ckeditor/ckeditor5-ckfinder/src/ckfinderediting.js":
  3453. /*!**************************************************************************!*\
  3454. !*** ./node_modules/@ckeditor/ckeditor5-ckfinder/src/ckfinderediting.js ***!
  3455. \**************************************************************************/
  3456. /*! exports provided: default */
  3457. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3458. "use strict";
  3459. __webpack_require__.r(__webpack_exports__);
  3460. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return CKFinderEditing; });
  3461. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  3462. /* harmony import */ var ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/ui */ "./node_modules/ckeditor5/src/ui.js");
  3463. /* harmony import */ var _ckfindercommand__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./ckfindercommand */ "./node_modules/@ckeditor/ckeditor5-ckfinder/src/ckfindercommand.js");
  3464. /**
  3465. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  3466. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  3467. */
  3468. /**
  3469. * @module ckfinder/ckfinderediting
  3470. */
  3471. /**
  3472. * The CKFinder editing feature. It introduces the {@link module:ckfinder/ckfindercommand~CKFinderCommand CKFinder command}.
  3473. *
  3474. * @extends module:core/plugin~Plugin
  3475. */
  3476. class CKFinderEditing extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  3477. /**
  3478. * @inheritDoc
  3479. */
  3480. static get pluginName() {
  3481. return 'CKFinderEditing';
  3482. }
  3483. /**
  3484. * @inheritDoc
  3485. */
  3486. static get requires() {
  3487. return [ ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__["Notification"], 'ImageEditing', 'LinkEditing' ];
  3488. }
  3489. /**
  3490. * @inheritDoc
  3491. */
  3492. init() {
  3493. const editor = this.editor;
  3494. editor.commands.add( 'ckfinder', new _ckfindercommand__WEBPACK_IMPORTED_MODULE_2__["default"]( editor ) );
  3495. }
  3496. }
  3497. /***/ }),
  3498. /***/ "./node_modules/@ckeditor/ckeditor5-ckfinder/src/ckfinderui.js":
  3499. /*!*********************************************************************!*\
  3500. !*** ./node_modules/@ckeditor/ckeditor5-ckfinder/src/ckfinderui.js ***!
  3501. \*********************************************************************/
  3502. /*! exports provided: default */
  3503. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3504. "use strict";
  3505. __webpack_require__.r(__webpack_exports__);
  3506. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return CKFinderUI; });
  3507. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  3508. /* harmony import */ var ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/ui */ "./node_modules/ckeditor5/src/ui.js");
  3509. /* 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");
  3510. /**
  3511. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  3512. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  3513. */
  3514. /**
  3515. * @module ckfinder/ckfinderui
  3516. */
  3517. /**
  3518. * The CKFinder UI plugin. It introduces the `'ckfinder'` toolbar button.
  3519. *
  3520. * @extends module:core/plugin~Plugin
  3521. */
  3522. class CKFinderUI extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  3523. /**
  3524. * @inheritDoc
  3525. */
  3526. static get pluginName() {
  3527. return 'CKFinderUI';
  3528. }
  3529. /**
  3530. * @inheritDoc
  3531. */
  3532. init() {
  3533. const editor = this.editor;
  3534. const componentFactory = editor.ui.componentFactory;
  3535. const t = editor.t;
  3536. componentFactory.add( 'ckfinder', locale => {
  3537. const command = editor.commands.get( 'ckfinder' );
  3538. const button = new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__["ButtonView"]( locale );
  3539. button.set( {
  3540. label: t( 'Insert image or file' ),
  3541. icon: _theme_icons_browse_files_svg__WEBPACK_IMPORTED_MODULE_2__["default"],
  3542. tooltip: true
  3543. } );
  3544. button.bind( 'isEnabled' ).to( command );
  3545. button.on( 'execute', () => {
  3546. editor.execute( 'ckfinder' );
  3547. editor.editing.view.focus();
  3548. } );
  3549. return button;
  3550. } );
  3551. }
  3552. }
  3553. /***/ }),
  3554. /***/ "./node_modules/@ckeditor/ckeditor5-ckfinder/theme/icons/browse-files.svg":
  3555. /*!********************************************************************************!*\
  3556. !*** ./node_modules/@ckeditor/ckeditor5-ckfinder/theme/icons/browse-files.svg ***!
  3557. \********************************************************************************/
  3558. /*! exports provided: default */
  3559. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3560. "use strict";
  3561. __webpack_require__.r(__webpack_exports__);
  3562. /* 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>");
  3563. /***/ }),
  3564. /***/ "./node_modules/@ckeditor/ckeditor5-clipboard/src/clipboard.js":
  3565. /*!*********************************************************************!*\
  3566. !*** ./node_modules/@ckeditor/ckeditor5-clipboard/src/clipboard.js ***!
  3567. \*********************************************************************/
  3568. /*! exports provided: default */
  3569. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3570. "use strict";
  3571. __webpack_require__.r(__webpack_exports__);
  3572. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Clipboard; });
  3573. /* 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");
  3574. /* harmony import */ var _clipboardpipeline__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./clipboardpipeline */ "./node_modules/@ckeditor/ckeditor5-clipboard/src/clipboardpipeline.js");
  3575. /* harmony import */ var _dragdrop__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./dragdrop */ "./node_modules/@ckeditor/ckeditor5-clipboard/src/dragdrop.js");
  3576. /* harmony import */ var _pasteplaintext__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./pasteplaintext */ "./node_modules/@ckeditor/ckeditor5-clipboard/src/pasteplaintext.js");
  3577. /**
  3578. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  3579. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  3580. */
  3581. /**
  3582. * @module clipboard/clipboard
  3583. */
  3584. /**
  3585. * The clipboard feature.
  3586. *
  3587. * Read more about the clipboard integration in the {@glink framework/guides/deep-dive/clipboard clipboard deep dive guide}.
  3588. *
  3589. * This is a "glue" plugin which loads the following plugins:
  3590. * * {@link module:clipboard/clipboardpipeline~ClipboardPipeline}
  3591. * * {@link module:clipboard/dragdrop~DragDrop}
  3592. * * {@link module:clipboard/pasteplaintext~PastePlainText}
  3593. *
  3594. * @extends module:core/plugin~Plugin
  3595. */
  3596. class Clipboard extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
  3597. /**
  3598. * @inheritDoc
  3599. */
  3600. static get pluginName() {
  3601. return 'Clipboard';
  3602. }
  3603. /**
  3604. * @inheritDoc
  3605. */
  3606. static get requires() {
  3607. return [ _clipboardpipeline__WEBPACK_IMPORTED_MODULE_1__["default"], _dragdrop__WEBPACK_IMPORTED_MODULE_2__["default"], _pasteplaintext__WEBPACK_IMPORTED_MODULE_3__["default"] ];
  3608. }
  3609. }
  3610. /***/ }),
  3611. /***/ "./node_modules/@ckeditor/ckeditor5-clipboard/src/clipboardobserver.js":
  3612. /*!*****************************************************************************!*\
  3613. !*** ./node_modules/@ckeditor/ckeditor5-clipboard/src/clipboardobserver.js ***!
  3614. \*****************************************************************************/
  3615. /*! exports provided: default */
  3616. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3617. "use strict";
  3618. __webpack_require__.r(__webpack_exports__);
  3619. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ClipboardObserver; });
  3620. /* 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");
  3621. /* 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");
  3622. /* harmony import */ var _datatransfer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./datatransfer */ "./node_modules/@ckeditor/ckeditor5-clipboard/src/datatransfer.js");
  3623. /**
  3624. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  3625. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  3626. */
  3627. /**
  3628. * @module clipboard/clipboardobserver
  3629. */
  3630. /**
  3631. * Clipboard events observer.
  3632. *
  3633. * Fires the following events:
  3634. *
  3635. * * {@link module:engine/view/document~Document#event:clipboardInput},
  3636. * * {@link module:engine/view/document~Document#event:paste},
  3637. * * {@link module:engine/view/document~Document#event:copy},
  3638. * * {@link module:engine/view/document~Document#event:cut},
  3639. * * {@link module:engine/view/document~Document#event:drop},
  3640. * * {@link module:engine/view/document~Document#event:dragover},
  3641. * * {@link module:engine/view/document~Document#event:dragging},
  3642. * * {@link module:engine/view/document~Document#event:dragstart},
  3643. * * {@link module:engine/view/document~Document#event:dragend},
  3644. * * {@link module:engine/view/document~Document#event:dragenter},
  3645. * * {@link module:engine/view/document~Document#event:dragleave}.
  3646. *
  3647. * **Note**: This observer is not available by default (ckeditor5-engine does not add it on its own).
  3648. * To make it available, it needs to be added to {@link module:engine/view/document~Document} by using
  3649. * the {@link module:engine/view/view~View#addObserver `View#addObserver()`} method. Alternatively, you can load the
  3650. * {@link module:clipboard/clipboard~Clipboard} plugin which adds this observer automatically (because it uses it).
  3651. *
  3652. * @extends module:engine/view/observer/domeventobserver~DomEventObserver
  3653. */
  3654. class ClipboardObserver extends _ckeditor_ckeditor5_engine_src_view_observer_domeventobserver__WEBPACK_IMPORTED_MODULE_0__["default"] {
  3655. constructor( view ) {
  3656. super( view );
  3657. const viewDocument = this.document;
  3658. this.domEventType = [ 'paste', 'copy', 'cut', 'drop', 'dragover', 'dragstart', 'dragend', 'dragenter', 'dragleave' ];
  3659. this.listenTo( viewDocument, 'paste', handleInput( 'clipboardInput' ), { priority: 'low' } );
  3660. this.listenTo( viewDocument, 'drop', handleInput( 'clipboardInput' ), { priority: 'low' } );
  3661. this.listenTo( viewDocument, 'dragover', handleInput( 'dragging' ), { priority: 'low' } );
  3662. function handleInput( type ) {
  3663. return ( evt, data ) => {
  3664. data.preventDefault();
  3665. const targetRanges = data.dropRange ? [ data.dropRange ] : null;
  3666. const eventInfo = new _ckeditor_ckeditor5_utils_src_eventinfo__WEBPACK_IMPORTED_MODULE_1__["default"]( viewDocument, type );
  3667. viewDocument.fire( eventInfo, {
  3668. dataTransfer: data.dataTransfer,
  3669. method: evt.name,
  3670. targetRanges,
  3671. target: data.target
  3672. } );
  3673. // If CKEditor handled the input, do not bubble the original event any further.
  3674. // This helps external integrations recognize that fact and act accordingly.
  3675. // https://github.com/ckeditor/ckeditor5-upload/issues/92
  3676. if ( eventInfo.stop.called ) {
  3677. data.stopPropagation();
  3678. }
  3679. };
  3680. }
  3681. }
  3682. onDomEvent( domEvent ) {
  3683. const evtData = {
  3684. dataTransfer: new _datatransfer__WEBPACK_IMPORTED_MODULE_2__["default"]( domEvent.clipboardData ? domEvent.clipboardData : domEvent.dataTransfer )
  3685. };
  3686. if ( domEvent.type == 'drop' || domEvent.type == 'dragover' ) {
  3687. evtData.dropRange = getDropViewRange( this.view, domEvent );
  3688. }
  3689. this.fire( domEvent.type, domEvent, evtData );
  3690. }
  3691. }
  3692. function getDropViewRange( view, domEvent ) {
  3693. const domDoc = domEvent.target.ownerDocument;
  3694. const x = domEvent.clientX;
  3695. const y = domEvent.clientY;
  3696. let domRange;
  3697. // Webkit & Blink.
  3698. if ( domDoc.caretRangeFromPoint && domDoc.caretRangeFromPoint( x, y ) ) {
  3699. domRange = domDoc.caretRangeFromPoint( x, y );
  3700. }
  3701. // FF.
  3702. else if ( domEvent.rangeParent ) {
  3703. domRange = domDoc.createRange();
  3704. domRange.setStart( domEvent.rangeParent, domEvent.rangeOffset );
  3705. domRange.collapse( true );
  3706. }
  3707. if ( domRange ) {
  3708. return view.domConverter.domRangeToView( domRange );
  3709. }
  3710. return null;
  3711. }
  3712. /**
  3713. * Fired as a continuation of the {@link #event:paste} and {@link #event:drop} events.
  3714. *
  3715. * It is a part of the {@glink framework/guides/deep-dive/clipboard#input-pipeline clipboard input pipeline}.
  3716. *
  3717. * This event carries a `dataTransfer` object which comes from the clipboard and whose content should be processed
  3718. * and inserted into the editor.
  3719. *
  3720. * **Note**: This event is not available by default. To make it available, {@link module:clipboard/clipboardobserver~ClipboardObserver}
  3721. * needs to be added to the {@link module:engine/view/document~Document} by using the {@link module:engine/view/view~View#addObserver}
  3722. * method. This is usually done by the {@link module:clipboard/clipboard~Clipboard} plugin, but if for some reason it is not loaded,
  3723. * the observer must be added manually.
  3724. *
  3725. * @see module:clipboard/clipboardobserver~ClipboardObserver
  3726. * @see module:clipboard/clipboard~Clipboard
  3727. * @event module:engine/view/document~Document#event:clipboardInput
  3728. * @param {Object} data The event data.
  3729. * @param {module:clipboard/datatransfer~DataTransfer} data.dataTransfer The data transfer instance.
  3730. * @param {'paste'|'drop'} method Whether the event was triggered by a paste or drop operation.
  3731. * @param {module:engine/view/element~Element} target The tree view element representing the target.
  3732. * @param {Array.<module:engine/view/range~Range>} data.targetRanges Ranges which are the target of the operation
  3733. * (usually – into which the content should be inserted).
  3734. * If the clipboard input was triggered by a paste operation, this property is not set. If by a drop operation,
  3735. * then it is the drop position (which can be different than the selection at the moment of drop).
  3736. */
  3737. /**
  3738. * Fired when the user drags the content over one of the editing roots of the editor.
  3739. *
  3740. * Introduced by {@link module:clipboard/clipboardobserver~ClipboardObserver}.
  3741. *
  3742. * **Note**: This event is not available by default. To make it available, {@link module:clipboard/clipboardobserver~ClipboardObserver}
  3743. * needs to be added to the {@link module:engine/view/document~Document} by using the {@link module:engine/view/view~View#addObserver}
  3744. * method. This is usually done by the {@link module:clipboard/clipboard~Clipboard} plugin, but if for some reason it is not loaded,
  3745. * the observer must be added manually.
  3746. *
  3747. * @see module:engine/view/document~Document#event:clipboardInput
  3748. * @event module:engine/view/document~Document#event:dragover
  3749. * @param {module:clipboard/clipboardobserver~ClipboardEventData} data The event data.
  3750. */
  3751. /**
  3752. * Fired when the user dropped the content into one of the editing roots of the editor.
  3753. *
  3754. * Introduced by {@link module:clipboard/clipboardobserver~ClipboardObserver}.
  3755. *
  3756. * **Note**: This event is not available by default. To make it available, {@link module:clipboard/clipboardobserver~ClipboardObserver}
  3757. * needs to be added to the {@link module:engine/view/document~Document} by using the {@link module:engine/view/view~View#addObserver}
  3758. * method. This is usually done by the {@link module:clipboard/clipboard~Clipboard} plugin, but if for some reason it is not loaded,
  3759. * the observer must be added manually.
  3760. *
  3761. * @see module:engine/view/document~Document#event:clipboardInput
  3762. * @event module:engine/view/document~Document#event:drop
  3763. * @param {module:clipboard/clipboardobserver~ClipboardEventData} data The event data.
  3764. * @param {module:engine/view/range~Range} dropRange The position into which the content is dropped.
  3765. */
  3766. /**
  3767. * Fired when the user pasted the content into one of the editing roots of the editor.
  3768. *
  3769. * Introduced by {@link module:clipboard/clipboardobserver~ClipboardObserver}.
  3770. *
  3771. * **Note**: This event is not available by default. To make it available, {@link module:clipboard/clipboardobserver~ClipboardObserver}
  3772. * needs to be added to the {@link module:engine/view/document~Document} by using the {@link module:engine/view/view~View#addObserver}
  3773. * method. This is usually done by the {@link module:clipboard/clipboard~Clipboard} plugin, but if for some reason it is not loaded,
  3774. * the observer must be added manually.
  3775. *
  3776. * @see module:engine/view/document~Document#event:clipboardInput
  3777. * @event module:engine/view/document~Document#event:paste
  3778. * @param {module:clipboard/clipboardobserver~ClipboardEventData} data The event data.
  3779. */
  3780. /**
  3781. * Fired when the user copied the content from one of the editing roots of the editor.
  3782. *
  3783. * Introduced by {@link module:clipboard/clipboardobserver~ClipboardObserver}.
  3784. *
  3785. * **Note**: This event is not available by default. To make it available, {@link module:clipboard/clipboardobserver~ClipboardObserver}
  3786. * needs to be added to the {@link module:engine/view/document~Document} by using the {@link module:engine/view/view~View#addObserver}
  3787. * method. This is usually done by the {@link module:clipboard/clipboard~Clipboard} plugin, but if for some reason it is not loaded,
  3788. * the observer must be added manually.
  3789. *
  3790. * @see module:clipboard/clipboardobserver~ClipboardObserver
  3791. * @event module:engine/view/document~Document#event:copy
  3792. * @param {module:clipboard/clipboardobserver~ClipboardEventData} data The event data.
  3793. */
  3794. /**
  3795. * Fired when the user cut the content from one of the editing roots of the editor.
  3796. *
  3797. * Introduced by {@link module:clipboard/clipboardobserver~ClipboardObserver}.
  3798. *
  3799. * **Note**: This event is not available by default. To make it available, {@link module:clipboard/clipboardobserver~ClipboardObserver}
  3800. * needs to be added to the {@link module:engine/view/document~Document} by using the {@link module:engine/view/view~View#addObserver}
  3801. * method. This is usually done by the {@link module:clipboard/clipboard~Clipboard} plugin, but if for some reason it is not loaded,
  3802. * the observer must be added manually.
  3803. *
  3804. * @see module:clipboard/clipboardobserver~ClipboardObserver
  3805. * @event module:engine/view/document~Document#event:cut
  3806. * @param {module:clipboard/clipboardobserver~ClipboardEventData} data The event data.
  3807. */
  3808. /**
  3809. * The value of the {@link module:engine/view/document~Document#event:paste},
  3810. * {@link module:engine/view/document~Document#event:copy} and {@link module:engine/view/document~Document#event:cut} events.
  3811. *
  3812. * In order to access the clipboard data, use the `dataTransfer` property.
  3813. *
  3814. * @class module:clipboard/clipboardobserver~ClipboardEventData
  3815. * @extends module:engine/view/observer/domeventdata~DomEventData
  3816. */
  3817. /**
  3818. * The data transfer instance.
  3819. *
  3820. * @readonly
  3821. * @member {module:clipboard/datatransfer~DataTransfer} module:clipboard/clipboardobserver~ClipboardEventData#dataTransfer
  3822. */
  3823. /**
  3824. * Fired as a continuation of the {@link #event:dragover} event.
  3825. *
  3826. * It is a part of the {@glink framework/guides/deep-dive/clipboard#input-pipeline clipboard input pipeline}.
  3827. *
  3828. * This event carries a `dataTransfer` object which comes from the clipboard and whose content should be processed
  3829. * and inserted into the editor.
  3830. *
  3831. * **Note**: This event is not available by default. To make it available, {@link module:clipboard/clipboardobserver~ClipboardObserver}
  3832. * needs to be added to the {@link module:engine/view/document~Document} by using the {@link module:engine/view/view~View#addObserver}
  3833. * method. This is usually done by the {@link module:clipboard/clipboard~Clipboard} plugin, but if for some reason it is not loaded,
  3834. * the observer must be added manually.
  3835. *
  3836. * @see module:clipboard/clipboardobserver~ClipboardObserver
  3837. * @see module:clipboard/clipboard~Clipboard
  3838. * @event module:engine/view/document~Document#event:dragging
  3839. * @param {Object} data The event data.
  3840. * @param {module:clipboard/datatransfer~DataTransfer} data.dataTransfer The data transfer instance.
  3841. * @param {module:engine/view/element~Element} target The tree view element representing the target.
  3842. * @param {Array.<module:engine/view/range~Range>} data.targetRanges Ranges which are the target of the operation
  3843. * (usually – into which the content should be inserted).
  3844. * It is the drop position (which can be different than the selection at the moment of drop).
  3845. */
  3846. /**
  3847. * Fired when the user starts dragging the content in one of the editing roots of the editor.
  3848. *
  3849. * Introduced by {@link module:clipboard/clipboardobserver~ClipboardObserver}.
  3850. *
  3851. * **Note**: This event is not available by default. To make it available, {@link module:clipboard/clipboardobserver~ClipboardObserver}
  3852. * needs to be added to the {@link module:engine/view/document~Document} by using the {@link module:engine/view/view~View#addObserver}
  3853. * method. This is usually done by the {@link module:clipboard/clipboard~Clipboard} plugin, but if for some reason it is not loaded,
  3854. * the observer must be added manually.
  3855. *
  3856. * @see module:engine/view/document~Document#event:clipboardInput
  3857. * @event module:engine/view/document~Document#event:dragstart
  3858. * @param {module:clipboard/clipboardobserver~ClipboardEventData} data The event data.
  3859. */
  3860. /**
  3861. * Fired when the user ended dragging the content.
  3862. *
  3863. * Introduced by {@link module:clipboard/clipboardobserver~ClipboardObserver}.
  3864. *
  3865. * **Note**: This event is not available by default. To make it available, {@link module:clipboard/clipboardobserver~ClipboardObserver}
  3866. * needs to be added to the {@link module:engine/view/document~Document} by using the {@link module:engine/view/view~View#addObserver}
  3867. * method. This is usually done by the {@link module:clipboard/clipboard~Clipboard} plugin, but if for some reason it is not loaded,
  3868. * the observer must be added manually.
  3869. *
  3870. * @see module:engine/view/document~Document#event:clipboardInput
  3871. * @event module:engine/view/document~Document#event:dragend
  3872. * @param {module:clipboard/clipboardobserver~ClipboardEventData} data The event data.
  3873. */
  3874. /**
  3875. * Fired when the user drags the content into one of the editing roots of the editor.
  3876. *
  3877. * Introduced by {@link module:clipboard/clipboardobserver~ClipboardObserver}.
  3878. *
  3879. * **Note**: This event is not available by default. To make it available, {@link module:clipboard/clipboardobserver~ClipboardObserver}
  3880. * needs to be added to the {@link module:engine/view/document~Document} by using the {@link module:engine/view/view~View#addObserver}
  3881. * method. This is usually done by the {@link module:clipboard/clipboard~Clipboard} plugin, but if for some reason it is not loaded,
  3882. * the observer must be added manually.
  3883. *
  3884. * @see module:engine/view/document~Document#event:clipboardInput
  3885. * @event module:engine/view/document~Document#event:dragenter
  3886. * @param {module:clipboard/clipboardobserver~ClipboardEventData} data The event data.
  3887. */
  3888. /**
  3889. * Fired when the user drags the content out of one of the editing roots of the editor.
  3890. *
  3891. * Introduced by {@link module:clipboard/clipboardobserver~ClipboardObserver}.
  3892. *
  3893. * **Note**: This event is not available by default. To make it available, {@link module:clipboard/clipboardobserver~ClipboardObserver}
  3894. * needs to be added to the {@link module:engine/view/document~Document} by using the {@link module:engine/view/view~View#addObserver}
  3895. * method. This is usually done by the {@link module:clipboard/clipboard~Clipboard} plugin, but if for some reason it is not loaded,
  3896. * the observer must be added manually.
  3897. *
  3898. * @see module:engine/view/document~Document#event:clipboardInput
  3899. * @event module:engine/view/document~Document#event:dragleave
  3900. * @param {module:clipboard/clipboardobserver~ClipboardEventData} data The event data.
  3901. */
  3902. /***/ }),
  3903. /***/ "./node_modules/@ckeditor/ckeditor5-clipboard/src/clipboardpipeline.js":
  3904. /*!*****************************************************************************!*\
  3905. !*** ./node_modules/@ckeditor/ckeditor5-clipboard/src/clipboardpipeline.js ***!
  3906. \*****************************************************************************/
  3907. /*! exports provided: default */
  3908. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3909. "use strict";
  3910. __webpack_require__.r(__webpack_exports__);
  3911. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ClipboardPipeline; });
  3912. /* 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");
  3913. /* 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");
  3914. /* harmony import */ var _clipboardobserver__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./clipboardobserver */ "./node_modules/@ckeditor/ckeditor5-clipboard/src/clipboardobserver.js");
  3915. /* harmony import */ var _utils_plaintexttohtml__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils/plaintexttohtml */ "./node_modules/@ckeditor/ckeditor5-clipboard/src/utils/plaintexttohtml.js");
  3916. /* harmony import */ var _utils_normalizeclipboarddata__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./utils/normalizeclipboarddata */ "./node_modules/@ckeditor/ckeditor5-clipboard/src/utils/normalizeclipboarddata.js");
  3917. /* harmony import */ var _utils_viewtoplaintext_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./utils/viewtoplaintext.js */ "./node_modules/@ckeditor/ckeditor5-clipboard/src/utils/viewtoplaintext.js");
  3918. /**
  3919. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  3920. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  3921. */
  3922. /**
  3923. * @module clipboard/clipboardpipeline
  3924. */
  3925. // Input pipeline events overview:
  3926. //
  3927. // ┌──────────────────────┐ ┌──────────────────────┐
  3928. // │ view.Document │ │ view.Document │
  3929. // │ paste │ │ drop │
  3930. // └───────────┬──────────┘ └───────────┬──────────┘
  3931. // │ │
  3932. // └────────────────┌────────────────┘
  3933. // │
  3934. // ┌─────────V────────┐
  3935. // │ view.Document │ Retrieves text/html or text/plain from data.dataTransfer
  3936. // │ clipboardInput │ and processes it to view.DocumentFragment.
  3937. // └─────────┬────────┘
  3938. // │
  3939. // ┌───────────V───────────┐
  3940. // │ ClipboardPipeline │ Converts view.DocumentFragment to model.DocumentFragment.
  3941. // │ inputTransformation │
  3942. // └───────────┬───────────┘
  3943. // │
  3944. // ┌──────────V──────────┐
  3945. // │ ClipboardPipeline │ Calls model.insertContent().
  3946. // │ contentInsertion │
  3947. // └─────────────────────┘
  3948. //
  3949. //
  3950. // Output pipeline events overview:
  3951. //
  3952. // ┌──────────────────────┐ ┌──────────────────────┐
  3953. // │ view.Document │ │ view.Document │ Retrieves the selected model.DocumentFragment
  3954. // │ copy │ │ cut │ and converts it to view.DocumentFragment.
  3955. // └───────────┬──────────┘ └───────────┬──────────┘
  3956. // │ │
  3957. // └────────────────┌────────────────┘
  3958. // │
  3959. // ┌─────────V────────┐
  3960. // │ view.Document │ Processes view.DocumentFragment to text/html and text/plain
  3961. // │ clipboardOutput │ and stores the results in data.dataTransfer.
  3962. // └──────────────────┘
  3963. //
  3964. /**
  3965. * The clipboard pipeline feature. It is responsible for intercepting the `paste` and `drop` events and
  3966. * passing the pasted content through a series of events in order to insert it into the editor's content.
  3967. * It also handles the `cut` and `copy` events to fill the native clipboard with the serialized editor's data.
  3968. *
  3969. * # Input pipeline
  3970. *
  3971. * The behavior of the default handlers (all at a `low` priority):
  3972. *
  3973. * ## Event: `paste` or `drop`
  3974. *
  3975. * 1. Translates the event data.
  3976. * 2. Fires the {@link module:engine/view/document~Document#event:clipboardInput `view.Document#clipboardInput`} event.
  3977. *
  3978. * ## Event: `view.Document#clipboardInput`
  3979. *
  3980. * 1. If the `data.content` event field is already set (by some listener on a higher priority), it takes this content and fires the event
  3981. * from the last point.
  3982. * 2. Otherwise, it retrieves `text/html` or `text/plain` from `data.dataTransfer`.
  3983. * 3. Normalizes the raw data by applying simple filters on string data.
  3984. * 4. Processes the raw data to {@link module:engine/view/documentfragment~DocumentFragment `view.DocumentFragment`} with the
  3985. * {@link module:engine/controller/datacontroller~DataController#htmlProcessor `DataController#htmlProcessor`}.
  3986. * 5. Fires the {@link module:clipboard/clipboardpipeline~ClipboardPipeline#event:inputTransformation
  3987. * `ClipboardPipeline#inputTransformation`} event with the view document fragment in the `data.content` event field.
  3988. *
  3989. * ## Event: `ClipboardPipeline#inputTransformation`
  3990. *
  3991. * 1. Converts {@link module:engine/view/documentfragment~DocumentFragment `view.DocumentFragment`} from the `data.content` field to
  3992. * {@link module:engine/model/documentfragment~DocumentFragment `model.DocumentFragment`}.
  3993. * 2. Fires the {@link module:clipboard/clipboardpipeline~ClipboardPipeline#event:contentInsertion `ClipboardPipeline#contentInsertion`}
  3994. * event with the model document fragment in the `data.content` event field.
  3995. * **Note**: The `ClipboardPipeline#contentInsertion` event is fired within a model change block to allow other handlers
  3996. * to run in the same block without post-fixers called in between (i.e., the selection post-fixer).
  3997. *
  3998. * ## Event: `ClipboardPipeline#contentInsertion`
  3999. *
  4000. * 1. Calls {@link module:engine/model/model~Model#insertContent `model.insertContent()`} to insert `data.content`
  4001. * at the current selection position.
  4002. *
  4003. * # Output pipeline
  4004. *
  4005. * The behavior of the default handlers (all at a `low` priority):
  4006. *
  4007. * ## Event: `copy`, `cut` or `dragstart`
  4008. *
  4009. * 1. Retrieves the selected {@link module:engine/model/documentfragment~DocumentFragment `model.DocumentFragment`} by calling
  4010. * {@link module:engine/model/model~Model#getSelectedContent `model#getSelectedContent()`}.
  4011. * 2. Converts the model document fragment to {@link module:engine/view/documentfragment~DocumentFragment `view.DocumentFragment`}.
  4012. * 3. Fires the {@link module:engine/view/document~Document#event:clipboardOutput `view.Document#clipboardOutput`} event
  4013. * with the view document fragment in the `data.content` event field.
  4014. *
  4015. * ## Event: `view.Document#clipboardOutput`
  4016. *
  4017. * 1. Processes `data.content` to HTML and plain text with the
  4018. * {@link module:engine/controller/datacontroller~DataController#htmlProcessor `DataController#htmlProcessor`}.
  4019. * 2. Updates the `data.dataTransfer` data for `text/html` and `text/plain` with the processed data.
  4020. * 3. For the `cut` method, calls {@link module:engine/model/model~Model#deleteContent `model.deleteContent()`}
  4021. * on the current selection.
  4022. *
  4023. * Read more about the clipboard integration in the {@glink framework/guides/deep-dive/clipboard clipboard deep dive guide}.
  4024. *
  4025. * @extends module:core/plugin~Plugin
  4026. */
  4027. class ClipboardPipeline extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
  4028. /**
  4029. * @inheritDoc
  4030. */
  4031. static get pluginName() {
  4032. return 'ClipboardPipeline';
  4033. }
  4034. /**
  4035. * @inheritDoc
  4036. */
  4037. init() {
  4038. const editor = this.editor;
  4039. const view = editor.editing.view;
  4040. view.addObserver( _clipboardobserver__WEBPACK_IMPORTED_MODULE_2__["default"] );
  4041. this._setupPasteDrop();
  4042. this._setupCopyCut();
  4043. }
  4044. /**
  4045. * The clipboard paste pipeline.
  4046. *
  4047. * @private
  4048. */
  4049. _setupPasteDrop() {
  4050. const editor = this.editor;
  4051. const model = editor.model;
  4052. const view = editor.editing.view;
  4053. const viewDocument = view.document;
  4054. // Pasting and dropping is disabled when editor is in the read-only mode.
  4055. // See: https://github.com/ckeditor/ckeditor5-clipboard/issues/26.
  4056. this.listenTo( viewDocument, 'clipboardInput', evt => {
  4057. if ( editor.isReadOnly ) {
  4058. evt.stop();
  4059. }
  4060. }, { priority: 'highest' } );
  4061. this.listenTo( viewDocument, 'clipboardInput', ( evt, data ) => {
  4062. const dataTransfer = data.dataTransfer;
  4063. let content = data.content || '';
  4064. // Some feature could already inject content in the higher priority event handler (i.e., codeBlock).
  4065. if ( !content ) {
  4066. if ( dataTransfer.getData( 'text/html' ) ) {
  4067. content = Object(_utils_normalizeclipboarddata__WEBPACK_IMPORTED_MODULE_4__["default"])( dataTransfer.getData( 'text/html' ) );
  4068. } else if ( dataTransfer.getData( 'text/plain' ) ) {
  4069. content = Object(_utils_plaintexttohtml__WEBPACK_IMPORTED_MODULE_3__["default"])( dataTransfer.getData( 'text/plain' ) );
  4070. }
  4071. content = this.editor.data.htmlProcessor.toView( content );
  4072. }
  4073. const eventInfo = new _ckeditor_ckeditor5_utils_src_eventinfo__WEBPACK_IMPORTED_MODULE_1__["default"]( this, 'inputTransformation' );
  4074. this.fire( eventInfo, {
  4075. content,
  4076. dataTransfer,
  4077. targetRanges: data.targetRanges,
  4078. method: data.method
  4079. } );
  4080. // If CKEditor handled the input, do not bubble the original event any further.
  4081. // This helps external integrations recognize this fact and act accordingly.
  4082. // https://github.com/ckeditor/ckeditor5-upload/issues/92
  4083. if ( eventInfo.stop.called ) {
  4084. evt.stop();
  4085. }
  4086. view.scrollToTheSelection();
  4087. }, { priority: 'low' } );
  4088. this.listenTo( this, 'inputTransformation', ( evt, data ) => {
  4089. if ( data.content.isEmpty ) {
  4090. return;
  4091. }
  4092. const dataController = this.editor.data;
  4093. // Convert the pasted content into a model document fragment.
  4094. // The conversion is contextual, but in this case an "all allowed" context is needed
  4095. // and for that we use the $clipboardHolder item.
  4096. const modelFragment = dataController.toModel( data.content, '$clipboardHolder' );
  4097. if ( modelFragment.childCount == 0 ) {
  4098. return;
  4099. }
  4100. evt.stop();
  4101. // Fire content insertion event in a single change block to allow other handlers to run in the same block
  4102. // without post-fixers called in between (i.e., the selection post-fixer).
  4103. model.change( () => {
  4104. this.fire( 'contentInsertion', {
  4105. content: modelFragment,
  4106. method: data.method,
  4107. dataTransfer: data.dataTransfer,
  4108. targetRanges: data.targetRanges
  4109. } );
  4110. } );
  4111. }, { priority: 'low' } );
  4112. this.listenTo( this, 'contentInsertion', ( evt, data ) => {
  4113. data.resultRange = model.insertContent( data.content );
  4114. }, { priority: 'low' } );
  4115. }
  4116. /**
  4117. * The clipboard copy/cut pipeline.
  4118. *
  4119. * @private
  4120. */
  4121. _setupCopyCut() {
  4122. const editor = this.editor;
  4123. const modelDocument = editor.model.document;
  4124. const view = editor.editing.view;
  4125. const viewDocument = view.document;
  4126. function onCopyCut( evt, data ) {
  4127. const dataTransfer = data.dataTransfer;
  4128. data.preventDefault();
  4129. const content = editor.data.toView( editor.model.getSelectedContent( modelDocument.selection ) );
  4130. viewDocument.fire( 'clipboardOutput', { dataTransfer, content, method: evt.name } );
  4131. }
  4132. this.listenTo( viewDocument, 'copy', onCopyCut, { priority: 'low' } );
  4133. this.listenTo( viewDocument, 'cut', ( evt, data ) => {
  4134. // Cutting is disabled when editor is in the read-only mode.
  4135. // See: https://github.com/ckeditor/ckeditor5-clipboard/issues/26.
  4136. if ( editor.isReadOnly ) {
  4137. data.preventDefault();
  4138. } else {
  4139. onCopyCut( evt, data );
  4140. }
  4141. }, { priority: 'low' } );
  4142. this.listenTo( viewDocument, 'clipboardOutput', ( evt, data ) => {
  4143. if ( !data.content.isEmpty ) {
  4144. data.dataTransfer.setData( 'text/html', this.editor.data.htmlProcessor.toData( data.content ) );
  4145. data.dataTransfer.setData( 'text/plain', Object(_utils_viewtoplaintext_js__WEBPACK_IMPORTED_MODULE_5__["default"])( data.content ) );
  4146. }
  4147. if ( data.method == 'cut' ) {
  4148. editor.model.deleteContent( modelDocument.selection );
  4149. }
  4150. }, { priority: 'low' } );
  4151. }
  4152. }
  4153. /**
  4154. * Fired with the `content`, `dataTransfer`, `method`, and `targetRanges` properties:
  4155. *
  4156. * * The `content` which comes from the clipboard (it was pasted or dropped) should be processed in order to be inserted into the editor.
  4157. * * The `dataTransfer` object is available in case the transformation functions need access to the raw clipboard data.
  4158. * * The `method` indicates the original DOM event (for example `'drop'` or `'paste'`).
  4159. * * The `targetRanges` property is an array of view ranges (it is available only for `'drop'`).
  4160. *
  4161. * It is a part of the {@glink framework/guides/deep-dive/clipboard#input-pipeline clipboard input pipeline}.
  4162. *
  4163. * **Note**: You should not stop this event if you want to change the input data. You should modify the `content` property instead.
  4164. *
  4165. * @see module:clipboard/clipboardobserver~ClipboardObserver
  4166. * @see module:clipboard/clipboardpipeline~ClipboardPipeline
  4167. * @event module:clipboard/clipboardpipeline~ClipboardPipeline#event:inputTransformation
  4168. * @param {Object} data The event data.
  4169. * @param {module:engine/view/documentfragment~DocumentFragment} data.content The event data. The content to be inserted into the editor.
  4170. * It can be modified by event listeners. Read more about the clipboard pipelines in
  4171. * the {@glink framework/guides/deep-dive/clipboard clipboard deep dive guide}.
  4172. * @param {module:clipboard/datatransfer~DataTransfer} data.dataTransfer The data transfer instance.
  4173. * @param {'paste'|'drop'} data.method Whether the event was triggered by a paste or drop operation.
  4174. * @param {Array.<module:engine/view/range~Range>} data.targetRanges The target drop ranges.
  4175. */
  4176. /**
  4177. * Fired with the `content`, `dataTransfer`, `method`, and `targetRanges` properties:
  4178. *
  4179. * * The `content` which comes from the clipboard (was pasted or dropped) should be processed in order to be inserted into the editor.
  4180. * * The `dataTransfer` object is available in case the transformation functions need access to the raw clipboard data.
  4181. * * The `method` indicates the original DOM event (for example `'drop'` or `'paste'`).
  4182. * * The `targetRanges` property is an array of view ranges (it is available only for `'drop'`).
  4183. *
  4184. * Event handlers can modify the content according to the final insertion position.
  4185. *
  4186. * It is a part of the {@glink framework/guides/deep-dive/clipboard#input-pipeline clipboard input pipeline}.
  4187. *
  4188. * **Note**: You should not stop this event if you want to change the input data. You should modify the `content` property instead.
  4189. *
  4190. * @see module:clipboard/clipboardobserver~ClipboardObserver
  4191. * @see module:clipboard/clipboardpipeline~ClipboardPipeline
  4192. * @see module:clipboard/clipboardpipeline~ClipboardPipeline#event:inputTransformation
  4193. * @event module:clipboard/clipboardpipeline~ClipboardPipeline#event:contentInsertion
  4194. * @param {Object} data The event data.
  4195. * @param {module:engine/model/documentfragment~DocumentFragment} data.content The event data. The content to be inserted into the editor.
  4196. * Read more about the clipboard pipelines in the {@glink framework/guides/deep-dive/clipboard clipboard deep dive guide}.
  4197. * @param {module:clipboard/datatransfer~DataTransfer} data.dataTransfer The data transfer instance.
  4198. * @param {'paste'|'drop'} data.method Whether the event was triggered by a paste or drop operation.
  4199. * @param {Array.<module:engine/view/range~Range>} data.targetRanges The target drop ranges.
  4200. * @param {module:engine/model/range~Range} data.resultRange The result of the `model.insertContent()` call
  4201. * (inserted by the event handler at a low priority).
  4202. */
  4203. /**
  4204. * Fired on {@link module:engine/view/document~Document#event:copy} and {@link module:engine/view/document~Document#event:cut}
  4205. * with a copy of the selected content. The content can be processed before it ends up in the clipboard.
  4206. *
  4207. * It is a part of the {@glink framework/guides/deep-dive/clipboard#output-pipeline clipboard output pipeline}.
  4208. *
  4209. * @see module:clipboard/clipboardobserver~ClipboardObserver
  4210. * @see module:clipboard/clipboardpipeline~ClipboardPipeline
  4211. * @event module:engine/view/document~Document#event:clipboardOutput
  4212. * @param {module:clipboard/clipboardpipeline~ClipboardOutputEventData} data The event data.
  4213. */
  4214. /**
  4215. * The value of the {@link module:engine/view/document~Document#event:clipboardOutput} event.
  4216. *
  4217. * @class module:clipboard/clipboardpipeline~ClipboardOutputEventData
  4218. */
  4219. /**
  4220. * The data transfer instance.
  4221. *
  4222. * @readonly
  4223. * @member {module:clipboard/datatransfer~DataTransfer} module:clipboard/clipboardpipeline~ClipboardOutputEventData#dataTransfer
  4224. */
  4225. /**
  4226. * Content to be put into the clipboard. It can be modified by the event listeners.
  4227. * Read more about the clipboard pipelines in the {@glink framework/guides/deep-dive/clipboard clipboard deep dive guide}.
  4228. *
  4229. * @member {module:engine/view/documentfragment~DocumentFragment} module:clipboard/clipboardpipeline~ClipboardOutputEventData#content
  4230. */
  4231. /**
  4232. * Whether the event was triggered by a copy or cut operation.
  4233. *
  4234. * @member {'copy'|'cut'} module:clipboard/clipboardpipeline~ClipboardOutputEventData#method
  4235. */
  4236. /***/ }),
  4237. /***/ "./node_modules/@ckeditor/ckeditor5-clipboard/src/datatransfer.js":
  4238. /*!************************************************************************!*\
  4239. !*** ./node_modules/@ckeditor/ckeditor5-clipboard/src/datatransfer.js ***!
  4240. \************************************************************************/
  4241. /*! exports provided: default */
  4242. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  4243. "use strict";
  4244. __webpack_require__.r(__webpack_exports__);
  4245. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return DataTransfer; });
  4246. /**
  4247. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  4248. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  4249. */
  4250. /**
  4251. * @module clipboard/datatransfer
  4252. */
  4253. /**
  4254. * A facade over the native [`DataTransfer`](https://developer.mozilla.org/en-US/docs/Web/API/DataTransfer) object.
  4255. */
  4256. class DataTransfer {
  4257. constructor( nativeDataTransfer ) {
  4258. /**
  4259. * The array of files created from the native `DataTransfer#files` or `DataTransfer#items`.
  4260. *
  4261. * @readonly
  4262. * @member {Array.<File>} #files
  4263. */
  4264. this.files = getFiles( nativeDataTransfer );
  4265. /**
  4266. * The native DataTransfer object.
  4267. *
  4268. * @private
  4269. * @member {DataTransfer} #_native
  4270. */
  4271. this._native = nativeDataTransfer;
  4272. }
  4273. /**
  4274. * Returns an array of available native content types.
  4275. *
  4276. * @returns {Array.<String>}
  4277. */
  4278. get types() {
  4279. return this._native.types;
  4280. }
  4281. /**
  4282. * Gets the data from the data transfer by its MIME type.
  4283. *
  4284. * dataTransfer.getData( 'text/plain' );
  4285. *
  4286. * @param {String} type The MIME type. E.g. `text/html` or `text/plain`.
  4287. * @returns {String}
  4288. */
  4289. getData( type ) {
  4290. return this._native.getData( type );
  4291. }
  4292. /**
  4293. * Sets the data in the data transfer.
  4294. *
  4295. * @param {String} type The MIME type. E.g. `text/html` or `text/plain`.
  4296. * @param {String} data
  4297. */
  4298. setData( type, data ) {
  4299. this._native.setData( type, data );
  4300. }
  4301. /**
  4302. * The effect that is allowed for a drag operation.
  4303. *
  4304. * @param {String} value
  4305. */
  4306. set effectAllowed( value ) {
  4307. this._native.effectAllowed = value;
  4308. }
  4309. get effectAllowed() {
  4310. return this._native.effectAllowed;
  4311. }
  4312. /**
  4313. * The actual drop effect.
  4314. *
  4315. * @param {String} value
  4316. */
  4317. set dropEffect( value ) {
  4318. this._native.dropEffect = value;
  4319. }
  4320. get dropEffect() {
  4321. return this._native.dropEffect;
  4322. }
  4323. /**
  4324. * Whether the dragging operation was canceled.
  4325. *
  4326. * @returns {Boolean}
  4327. */
  4328. get isCanceled() {
  4329. return this._native.dropEffect == 'none' || !!this._native.mozUserCancelled;
  4330. }
  4331. }
  4332. function getFiles( nativeDataTransfer ) {
  4333. // DataTransfer.files and items are array-like and might not have an iterable interface.
  4334. const files = nativeDataTransfer.files ? Array.from( nativeDataTransfer.files ) : [];
  4335. const items = nativeDataTransfer.items ? Array.from( nativeDataTransfer.items ) : [];
  4336. if ( files.length ) {
  4337. return files;
  4338. }
  4339. // Chrome has empty DataTransfer.files, but allows getting files through the items interface.
  4340. return items
  4341. .filter( item => item.kind === 'file' )
  4342. .map( item => item.getAsFile() );
  4343. }
  4344. /***/ }),
  4345. /***/ "./node_modules/@ckeditor/ckeditor5-clipboard/src/dragdrop.js":
  4346. /*!********************************************************************!*\
  4347. !*** ./node_modules/@ckeditor/ckeditor5-clipboard/src/dragdrop.js ***!
  4348. \********************************************************************/
  4349. /*! exports provided: default */
  4350. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  4351. "use strict";
  4352. __webpack_require__.r(__webpack_exports__);
  4353. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return DragDrop; });
  4354. /* 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");
  4355. /* harmony import */ var _ckeditor_ckeditor5_engine_src_model_liverange__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-engine/src/model/liverange */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/liverange.js");
  4356. /* harmony import */ var _ckeditor_ckeditor5_engine_src_view_observer_mouseobserver__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-engine/src/view/observer/mouseobserver */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/mouseobserver.js");
  4357. /* harmony import */ var _ckeditor_ckeditor5_widget_src_widget__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-widget/src/widget */ "./node_modules/@ckeditor/ckeditor5-widget/src/widget.js");
  4358. /* harmony import */ var _ckeditor_ckeditor5_utils_src_uid__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/uid */ "./node_modules/@ckeditor/ckeditor5-utils/src/uid.js");
  4359. /* 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");
  4360. /* harmony import */ var _ckeditor_ckeditor5_widget_src_utils__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @ckeditor/ckeditor5-widget/src/utils */ "./node_modules/@ckeditor/ckeditor5-widget/src/utils.js");
  4361. /* harmony import */ var _clipboardpipeline__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./clipboardpipeline */ "./node_modules/@ckeditor/ckeditor5-clipboard/src/clipboardpipeline.js");
  4362. /* harmony import */ var _clipboardobserver__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./clipboardobserver */ "./node_modules/@ckeditor/ckeditor5-clipboard/src/clipboardobserver.js");
  4363. /* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! lodash-es */ "./node_modules/lodash-es/lodash.js");
  4364. /* harmony import */ var _theme_clipboard_css__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../theme/clipboard.css */ "./node_modules/@ckeditor/ckeditor5-clipboard/theme/clipboard.css");
  4365. /* harmony import */ var _theme_clipboard_css__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_theme_clipboard_css__WEBPACK_IMPORTED_MODULE_10__);
  4366. /**
  4367. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  4368. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  4369. */
  4370. /**
  4371. * @module clipboard/dragdrop
  4372. */
  4373. /* globals setTimeout, clearTimeout */
  4374. // Drag and drop events overview:
  4375. //
  4376. // ┌──────────────────┐
  4377. // │ mousedown │ Sets the draggable attribute.
  4378. // └─────────┬────────┘
  4379. // │
  4380. // └─────────────────────┐
  4381. // │ │
  4382. // │ ┌─────────V────────┐
  4383. // │ │ mouseup │ Dragging did not start, removes the draggable attribute.
  4384. // │ └──────────────────┘
  4385. // │
  4386. // ┌─────────V────────┐ Retrieves the selected model.DocumentFragment
  4387. // │ dragstart │ and converts it to view.DocumentFragment.
  4388. // └─────────┬────────┘
  4389. // │
  4390. // ┌─────────V────────┐ Processes view.DocumentFragment to text/html and text/plain
  4391. // │ clipboardOutput │ and stores the results in data.dataTransfer.
  4392. // └─────────┬────────┘
  4393. // │
  4394. // │ DOM dragover
  4395. // ┌────────────┐
  4396. // │ │
  4397. // ┌─────────V────────┐ │
  4398. // │ dragging │ │ Updates the drop target marker.
  4399. // └─────────┬────────┘ │
  4400. // │ │
  4401. // ┌─────────────└────────────┘
  4402. // │ │ │
  4403. // │ ┌─────────V────────┐ │
  4404. // │ │ dragleave │ │ Removes the drop target marker.
  4405. // │ └─────────┬────────┘ │
  4406. // │ │ │
  4407. // ┌───│─────────────┘ │
  4408. // │ │ │ │
  4409. // │ │ ┌─────────V────────┐ │
  4410. // │ │ │ dragenter │ │ Focuses the editor view.
  4411. // │ │ └─────────┬────────┘ │
  4412. // │ │ │ │
  4413. // │ │ └────────────┘
  4414. // │ │
  4415. // │ └─────────────┐
  4416. // │ │ │
  4417. // │ │ ┌─────────V────────┐
  4418. // └───┐ │ drop │ (The default handler of the clipboard pipeline).
  4419. // │ └─────────┬────────┘
  4420. // │ │
  4421. // │ ┌─────────V────────┐ Resolves the final data.targetRanges.
  4422. // │ │ clipboardInput │ Aborts if dropping on dragged content.
  4423. // │ └─────────┬────────┘
  4424. // │ │
  4425. // │ ┌─────────V────────┐
  4426. // │ │ clipboardInput │ (The default handler of the clipboard pipeline).
  4427. // │ └─────────┬────────┘
  4428. // │ │
  4429. // │ ┌───────────V───────────┐
  4430. // │ │ inputTransformation │ (The default handler of the clipboard pipeline).
  4431. // │ └───────────┬───────────┘
  4432. // │ │
  4433. // │ ┌──────────V──────────┐
  4434. // │ │ contentInsertion │ Updates the document selection to drop range.
  4435. // │ └──────────┬──────────┘
  4436. // │ │
  4437. // │ ┌──────────V──────────┐
  4438. // │ │ contentInsertion │ (The default handler of the clipboard pipeline).
  4439. // │ └──────────┬──────────┘
  4440. // │ │
  4441. // │ ┌──────────V──────────┐
  4442. // │ │ contentInsertion │ Removes the content from the original range if the insertion was successful.
  4443. // │ └──────────┬──────────┘
  4444. // │ │
  4445. // └─────────────┐
  4446. // │
  4447. // ┌─────────V────────┐
  4448. // │ dragend │ Removes the drop marker and cleans the state.
  4449. // └──────────────────┘
  4450. //
  4451. /**
  4452. * The drag and drop feature. It works on top of the {@link module:clipboard/clipboardpipeline~ClipboardPipeline}.
  4453. *
  4454. * Read more about the clipboard integration in the {@glink framework/guides/deep-dive/clipboard clipboard deep dive guide}.
  4455. *
  4456. * @extends module:core/plugin~Plugin
  4457. */
  4458. class DragDrop extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
  4459. /**
  4460. * @inheritDoc
  4461. */
  4462. static get pluginName() {
  4463. return 'DragDrop';
  4464. }
  4465. /**
  4466. * @inheritDoc
  4467. */
  4468. static get requires() {
  4469. return [ _clipboardpipeline__WEBPACK_IMPORTED_MODULE_7__["default"], _ckeditor_ckeditor5_widget_src_widget__WEBPACK_IMPORTED_MODULE_3__["default"] ];
  4470. }
  4471. /**
  4472. * @inheritDoc
  4473. */
  4474. init() {
  4475. const editor = this.editor;
  4476. const view = editor.editing.view;
  4477. /**
  4478. * The live range over the original content that is being dragged.
  4479. *
  4480. * @private
  4481. * @type {module:engine/model/liverange~LiveRange}
  4482. */
  4483. this._draggedRange = null;
  4484. /**
  4485. * The UID of current dragging that is used to verify if the drop started in the same editor as the drag start.
  4486. *
  4487. * **Note**: This is a workaround for broken 'dragend' events (they are not fired if the source text node got removed).
  4488. *
  4489. * @private
  4490. * @type {String}
  4491. */
  4492. this._draggingUid = '';
  4493. /**
  4494. * The reference to the model element that currently has a `draggable` attribute set (it is set while dragging).
  4495. *
  4496. * @private
  4497. * @type {module:engine/model/element~Element}
  4498. */
  4499. this._draggableElement = null;
  4500. /**
  4501. * A throttled callback updating the drop marker.
  4502. *
  4503. * @private
  4504. * @type {Function}
  4505. */
  4506. this._updateDropMarkerThrottled = Object(lodash_es__WEBPACK_IMPORTED_MODULE_9__["throttle"])( targetRange => this._updateDropMarker( targetRange ), 40 );
  4507. /**
  4508. * A delayed callback removing the drop marker.
  4509. *
  4510. * @private
  4511. * @type {Function}
  4512. */
  4513. this._removeDropMarkerDelayed = delay( () => this._removeDropMarker(), 40 );
  4514. /**
  4515. * A delayed callback removing draggable attributes.
  4516. *
  4517. * @private
  4518. * @type {Function}
  4519. */
  4520. this._clearDraggableAttributesDelayed = delay( () => this._clearDraggableAttributes(), 40 );
  4521. view.addObserver( _clipboardobserver__WEBPACK_IMPORTED_MODULE_8__["default"] );
  4522. view.addObserver( _ckeditor_ckeditor5_engine_src_view_observer_mouseobserver__WEBPACK_IMPORTED_MODULE_2__["default"] );
  4523. this._setupDragging();
  4524. this._setupContentInsertionIntegration();
  4525. this._setupClipboardInputIntegration();
  4526. this._setupDropMarker();
  4527. this._setupDraggableAttributeHandling();
  4528. this.listenTo( editor, 'change:isReadOnly', ( evt, name, isReadOnly ) => {
  4529. if ( isReadOnly ) {
  4530. this.forceDisabled( 'readOnlyMode' );
  4531. } else {
  4532. this.clearForceDisabled( 'readOnlyMode' );
  4533. }
  4534. } );
  4535. this.on( 'change:isEnabled', ( evt, name, isEnabled ) => {
  4536. if ( !isEnabled ) {
  4537. this._finalizeDragging( false );
  4538. }
  4539. } );
  4540. if ( _ckeditor_ckeditor5_utils_src_env__WEBPACK_IMPORTED_MODULE_5__["default"].isAndroid ) {
  4541. this.forceDisabled( 'noAndroidSupport' );
  4542. }
  4543. }
  4544. /**
  4545. * @inheritDoc
  4546. */
  4547. destroy() {
  4548. if ( this._draggedRange ) {
  4549. this._draggedRange.detach();
  4550. this._draggedRange = null;
  4551. }
  4552. this._updateDropMarkerThrottled.cancel();
  4553. this._removeDropMarkerDelayed.cancel();
  4554. this._clearDraggableAttributesDelayed.cancel();
  4555. return super.destroy();
  4556. }
  4557. /**
  4558. * Drag and drop events handling.
  4559. *
  4560. * @private
  4561. */
  4562. _setupDragging() {
  4563. const editor = this.editor;
  4564. const model = editor.model;
  4565. const modelDocument = model.document;
  4566. const view = editor.editing.view;
  4567. const viewDocument = view.document;
  4568. // The handler for the drag start; it is responsible for setting data transfer object.
  4569. this.listenTo( viewDocument, 'dragstart', ( evt, data ) => {
  4570. const selection = modelDocument.selection;
  4571. // Don't drag the editable element itself.
  4572. if ( data.target && data.target.is( 'editableElement' ) ) {
  4573. data.preventDefault();
  4574. return;
  4575. }
  4576. // TODO we could clone this node somewhere and style it to match editing view but without handles,
  4577. // selection outline, WTA buttons, etc.
  4578. // data.dataTransfer._native.setDragImage( data.domTarget, 0, 0 );
  4579. // Check if this is dragstart over the widget (but not a nested editable).
  4580. const draggableWidget = data.target ? findDraggableWidget( data.target ) : null;
  4581. if ( draggableWidget ) {
  4582. const modelElement = editor.editing.mapper.toModelElement( draggableWidget );
  4583. this._draggedRange = _ckeditor_ckeditor5_engine_src_model_liverange__WEBPACK_IMPORTED_MODULE_1__["default"].fromRange( model.createRangeOn( modelElement ) );
  4584. }
  4585. // If this was not a widget we should check if we need to drag some text content.
  4586. else if ( !viewDocument.selection.isCollapsed ) {
  4587. const selectedElement = viewDocument.selection.getSelectedElement();
  4588. if ( !selectedElement || !Object(_ckeditor_ckeditor5_widget_src_utils__WEBPACK_IMPORTED_MODULE_6__["isWidget"])( selectedElement ) ) {
  4589. this._draggedRange = _ckeditor_ckeditor5_engine_src_model_liverange__WEBPACK_IMPORTED_MODULE_1__["default"].fromRange( selection.getFirstRange() );
  4590. }
  4591. }
  4592. if ( !this._draggedRange ) {
  4593. data.preventDefault();
  4594. return;
  4595. }
  4596. this._draggingUid = Object(_ckeditor_ckeditor5_utils_src_uid__WEBPACK_IMPORTED_MODULE_4__["default"])();
  4597. data.dataTransfer.effectAllowed = this.isEnabled ? 'copyMove' : 'copy';
  4598. data.dataTransfer.setData( 'application/ckeditor5-dragging-uid', this._draggingUid );
  4599. const draggedSelection = model.createSelection( this._draggedRange.toRange() );
  4600. const content = editor.data.toView( model.getSelectedContent( draggedSelection ) );
  4601. viewDocument.fire( 'clipboardOutput', { dataTransfer: data.dataTransfer, content, method: evt.name } );
  4602. if ( !this.isEnabled ) {
  4603. this._draggedRange.detach();
  4604. this._draggedRange = null;
  4605. this._draggingUid = '';
  4606. }
  4607. }, { priority: 'low' } );
  4608. // The handler for finalizing drag and drop. It should always be triggered after dragging completes
  4609. // even if it was completed in a different application.
  4610. // Note: This is not fired if source text node got removed while downcasting a marker.
  4611. this.listenTo( viewDocument, 'dragend', ( evt, data ) => {
  4612. this._finalizeDragging( !data.dataTransfer.isCanceled && data.dataTransfer.dropEffect == 'move' );
  4613. }, { priority: 'low' } );
  4614. // Dragging over the editable.
  4615. this.listenTo( viewDocument, 'dragenter', () => {
  4616. if ( !this.isEnabled ) {
  4617. return;
  4618. }
  4619. view.focus();
  4620. } );
  4621. // Dragging out of the editable.
  4622. this.listenTo( viewDocument, 'dragleave', () => {
  4623. // We do not know if the mouse left the editor or just some element in it, so let us wait a few milliseconds
  4624. // to check if 'dragover' is not fired.
  4625. this._removeDropMarkerDelayed();
  4626. } );
  4627. // Handler for moving dragged content over the target area.
  4628. this.listenTo( viewDocument, 'dragging', ( evt, data ) => {
  4629. if ( !this.isEnabled ) {
  4630. data.dataTransfer.dropEffect = 'none';
  4631. return;
  4632. }
  4633. this._removeDropMarkerDelayed.cancel();
  4634. const targetRange = findDropTargetRange( editor, data.targetRanges, data.target );
  4635. // If this is content being dragged from another editor, moving out of current editor instance
  4636. // is not possible until 'dragend' event case will be fixed.
  4637. if ( !this._draggedRange ) {
  4638. data.dataTransfer.dropEffect = 'copy';
  4639. }
  4640. // In Firefox it is already set and effect allowed remains the same as originally set.
  4641. if ( !_ckeditor_ckeditor5_utils_src_env__WEBPACK_IMPORTED_MODULE_5__["default"].isGecko ) {
  4642. if ( data.dataTransfer.effectAllowed == 'copy' ) {
  4643. data.dataTransfer.dropEffect = 'copy';
  4644. } else if ( [ 'all', 'copyMove' ].includes( data.dataTransfer.effectAllowed ) ) {
  4645. data.dataTransfer.dropEffect = 'move';
  4646. }
  4647. }
  4648. /* istanbul ignore else */
  4649. if ( targetRange ) {
  4650. this._updateDropMarkerThrottled( targetRange );
  4651. }
  4652. }, { priority: 'low' } );
  4653. }
  4654. /**
  4655. * Integration with the `clipboardInput` event.
  4656. *
  4657. * @private
  4658. */
  4659. _setupClipboardInputIntegration() {
  4660. const editor = this.editor;
  4661. const view = editor.editing.view;
  4662. const viewDocument = view.document;
  4663. // Update the event target ranges and abort dropping if dropping over itself.
  4664. this.listenTo( viewDocument, 'clipboardInput', ( evt, data ) => {
  4665. if ( data.method != 'drop' ) {
  4666. return;
  4667. }
  4668. const targetRange = findDropTargetRange( editor, data.targetRanges, data.target );
  4669. // The dragging markers must be removed after searching for the target range because sometimes
  4670. // the target lands on the marker itself.
  4671. this._removeDropMarker();
  4672. /* istanbul ignore if */
  4673. if ( !targetRange ) {
  4674. this._finalizeDragging( false );
  4675. evt.stop();
  4676. return;
  4677. }
  4678. // Since we cannot rely on the drag end event, we must check if the local drag range is from the current drag and drop
  4679. // or it is from some previous not cleared one.
  4680. if ( this._draggedRange && this._draggingUid != data.dataTransfer.getData( 'application/ckeditor5-dragging-uid' ) ) {
  4681. this._draggedRange.detach();
  4682. this._draggedRange = null;
  4683. this._draggingUid = '';
  4684. }
  4685. // Do not do anything if some content was dragged within the same document to the same position.
  4686. const isMove = getFinalDropEffect( data.dataTransfer ) == 'move';
  4687. if ( isMove && this._draggedRange && this._draggedRange.containsRange( targetRange, true ) ) {
  4688. this._finalizeDragging( false );
  4689. evt.stop();
  4690. return;
  4691. }
  4692. // Override the target ranges with the one adjusted to the best one for a drop.
  4693. data.targetRanges = [ editor.editing.mapper.toViewRange( targetRange ) ];
  4694. }, { priority: 'high' } );
  4695. }
  4696. /**
  4697. * Integration with the `contentInsertion` event of the clipboard pipeline.
  4698. *
  4699. * @private
  4700. */
  4701. _setupContentInsertionIntegration() {
  4702. const clipboardPipeline = this.editor.plugins.get( _clipboardpipeline__WEBPACK_IMPORTED_MODULE_7__["default"] );
  4703. clipboardPipeline.on( 'contentInsertion', ( evt, data ) => {
  4704. if ( !this.isEnabled || data.method !== 'drop' ) {
  4705. return;
  4706. }
  4707. // Update the selection to the target range in the same change block to avoid selection post-fixing
  4708. // and to be able to clone text attributes for plain text dropping.
  4709. const ranges = data.targetRanges.map( viewRange => this.editor.editing.mapper.toModelRange( viewRange ) );
  4710. this.editor.model.change( writer => writer.setSelection( ranges ) );
  4711. }, { priority: 'high' } );
  4712. clipboardPipeline.on( 'contentInsertion', ( evt, data ) => {
  4713. if ( !this.isEnabled || data.method !== 'drop' ) {
  4714. return;
  4715. }
  4716. // Remove dragged range content, remove markers, clean after dragging.
  4717. const isMove = getFinalDropEffect( data.dataTransfer ) == 'move';
  4718. // Whether any content was inserted (insertion might fail if the schema is disallowing some elements
  4719. // (for example an image caption allows only the content of a block but not blocks themselves.
  4720. // Some integrations might not return valid range (i.e., table pasting).
  4721. const isSuccess = !data.resultRange || !data.resultRange.isCollapsed;
  4722. this._finalizeDragging( isSuccess && isMove );
  4723. }, { priority: 'lowest' } );
  4724. }
  4725. /**
  4726. * Adds listeners that add the `draggable` attribute to the elements while the mouse button is down so the dragging could start.
  4727. *
  4728. * @private
  4729. */
  4730. _setupDraggableAttributeHandling() {
  4731. const editor = this.editor;
  4732. const view = editor.editing.view;
  4733. const viewDocument = view.document;
  4734. // Add the 'draggable' attribute to the widget while pressing the selection handle.
  4735. // This is required for widgets to be draggable. In Chrome it will enable dragging text nodes.
  4736. this.listenTo( viewDocument, 'mousedown', ( evt, data ) => {
  4737. // The lack of data can be caused by editor tests firing fake mouse events. This should not occur
  4738. // in real-life scenarios but this greatly simplifies editor tests that would otherwise fail a lot.
  4739. if ( _ckeditor_ckeditor5_utils_src_env__WEBPACK_IMPORTED_MODULE_5__["default"].isAndroid || !data ) {
  4740. return;
  4741. }
  4742. this._clearDraggableAttributesDelayed.cancel();
  4743. // Check if this is a mousedown over the widget (but not a nested editable).
  4744. let draggableElement = findDraggableWidget( data.target );
  4745. // Note: There is a limitation that if more than a widget is selected (a widget and some text)
  4746. // and dragging starts on the widget, then only the widget is dragged.
  4747. // If this was not a widget then we should check if we need to drag some text content.
  4748. // In Chrome set a 'draggable' attribute on closest editable to allow immediate dragging of the selected text range.
  4749. // In Firefox this is not needed. In Safari it makes the whole editable draggable (not just textual content).
  4750. // Disabled in read-only mode because draggable="true" + contenteditable="false" results
  4751. // in not firing selectionchange event ever, which makes the selection stuck in read-only mode.
  4752. if ( _ckeditor_ckeditor5_utils_src_env__WEBPACK_IMPORTED_MODULE_5__["default"].isBlink && !editor.isReadOnly && !draggableElement && !viewDocument.selection.isCollapsed ) {
  4753. const selectedElement = viewDocument.selection.getSelectedElement();
  4754. if ( !selectedElement || !Object(_ckeditor_ckeditor5_widget_src_utils__WEBPACK_IMPORTED_MODULE_6__["isWidget"])( selectedElement ) ) {
  4755. draggableElement = viewDocument.selection.editableElement;
  4756. }
  4757. }
  4758. if ( draggableElement ) {
  4759. view.change( writer => {
  4760. writer.setAttribute( 'draggable', 'true', draggableElement );
  4761. } );
  4762. // Keep the reference to the model element in case the view element gets removed while dragging.
  4763. this._draggableElement = editor.editing.mapper.toModelElement( draggableElement );
  4764. }
  4765. } );
  4766. // Remove the draggable attribute in case no dragging started (only mousedown + mouseup).
  4767. this.listenTo( viewDocument, 'mouseup', () => {
  4768. if ( !_ckeditor_ckeditor5_utils_src_env__WEBPACK_IMPORTED_MODULE_5__["default"].isAndroid ) {
  4769. this._clearDraggableAttributesDelayed();
  4770. }
  4771. } );
  4772. }
  4773. /**
  4774. * Removes the `draggable` attribute from the element that was used for dragging.
  4775. *
  4776. * @private
  4777. */
  4778. _clearDraggableAttributes() {
  4779. const editing = this.editor.editing;
  4780. editing.view.change( writer => {
  4781. // Remove 'draggable' attribute.
  4782. if ( this._draggableElement && this._draggableElement.root.rootName != '$graveyard' ) {
  4783. writer.removeAttribute( 'draggable', editing.mapper.toViewElement( this._draggableElement ) );
  4784. }
  4785. this._draggableElement = null;
  4786. } );
  4787. }
  4788. /**
  4789. * Creates downcast conversion for the drop target marker.
  4790. *
  4791. * @private
  4792. */
  4793. _setupDropMarker() {
  4794. const editor = this.editor;
  4795. // Drop marker conversion for hovering over widgets.
  4796. editor.conversion.for( 'editingDowncast' ).markerToHighlight( {
  4797. model: 'drop-target',
  4798. view: {
  4799. classes: [ 'ck-clipboard-drop-target-range' ]
  4800. }
  4801. } );
  4802. // Drop marker conversion for in text drop target.
  4803. editor.conversion.for( 'editingDowncast' ).markerToElement( {
  4804. model: 'drop-target',
  4805. view: ( data, { writer } ) => {
  4806. const inText = editor.model.schema.checkChild( data.markerRange.start, '$text' );
  4807. if ( !inText ) {
  4808. return;
  4809. }
  4810. return writer.createUIElement( 'span', { class: 'ck ck-clipboard-drop-target-position' }, function( domDocument ) {
  4811. const domElement = this.toDomElement( domDocument );
  4812. // Using word joiner to make this marker as high as text and also making text not break on marker.
  4813. domElement.innerHTML = '&NoBreak;<span></span>&NoBreak;';
  4814. return domElement;
  4815. } );
  4816. }
  4817. } );
  4818. }
  4819. /**
  4820. * Updates the drop target marker to the provided range.
  4821. *
  4822. * @private
  4823. * @param {module:engine/model/range~Range} targetRange The range to set the marker to.
  4824. */
  4825. _updateDropMarker( targetRange ) {
  4826. const editor = this.editor;
  4827. const markers = editor.model.markers;
  4828. editor.model.change( writer => {
  4829. if ( markers.has( 'drop-target' ) ) {
  4830. if ( !markers.get( 'drop-target' ).getRange().isEqual( targetRange ) ) {
  4831. writer.updateMarker( 'drop-target', { range: targetRange } );
  4832. }
  4833. } else {
  4834. writer.addMarker( 'drop-target', {
  4835. range: targetRange,
  4836. usingOperation: false,
  4837. affectsData: false
  4838. } );
  4839. }
  4840. } );
  4841. }
  4842. /**
  4843. * Removes the drop target marker.
  4844. *
  4845. * @private
  4846. */
  4847. _removeDropMarker() {
  4848. const model = this.editor.model;
  4849. this._removeDropMarkerDelayed.cancel();
  4850. this._updateDropMarkerThrottled.cancel();
  4851. if ( model.markers.has( 'drop-target' ) ) {
  4852. model.change( writer => {
  4853. writer.removeMarker( 'drop-target' );
  4854. } );
  4855. }
  4856. }
  4857. /**
  4858. * Deletes the dragged content from its original range and clears the dragging state.
  4859. *
  4860. * @private
  4861. * @param {Boolean} moved Whether the move succeeded.
  4862. */
  4863. _finalizeDragging( moved ) {
  4864. const editor = this.editor;
  4865. const model = editor.model;
  4866. this._removeDropMarker();
  4867. this._clearDraggableAttributes();
  4868. this._draggingUid = '';
  4869. if ( !this._draggedRange ) {
  4870. return;
  4871. }
  4872. // Delete moved content.
  4873. if ( moved && this.isEnabled ) {
  4874. model.deleteContent( model.createSelection( this._draggedRange ), { doNotAutoparagraph: true } );
  4875. }
  4876. this._draggedRange.detach();
  4877. this._draggedRange = null;
  4878. }
  4879. }
  4880. // Returns fixed selection range for given position and target element.
  4881. //
  4882. // @param {module:core/editor/editor~Editor} editor
  4883. // @param {Array.<module:engine/view/range~Range>} targetViewRanges
  4884. // @param {module:engine/view/element~Element} targetViewElement
  4885. // @returns {module:engine/model/range~Range|null}
  4886. function findDropTargetRange( editor, targetViewRanges, targetViewElement ) {
  4887. const model = editor.model;
  4888. const mapper = editor.editing.mapper;
  4889. let range = null;
  4890. const targetViewPosition = targetViewRanges ? targetViewRanges[ 0 ].start : null;
  4891. // A UIElement is not a valid drop element, use parent (this could be a drop marker or any other UIElement).
  4892. if ( targetViewElement.is( 'uiElement' ) ) {
  4893. targetViewElement = targetViewElement.parent;
  4894. }
  4895. // Quick win if the target is a widget (but not a nested editable).
  4896. range = findDropTargetRangeOnWidget( editor, targetViewElement );
  4897. if ( range ) {
  4898. return range;
  4899. }
  4900. // The easiest part is over, now we need to move to the model space.
  4901. // Find target model element and position.
  4902. const targetModelElement = getClosestMappedModelElement( editor, targetViewElement );
  4903. const targetModelPosition = targetViewPosition ? mapper.toModelPosition( targetViewPosition ) : null;
  4904. // There is no target position while hovering over an empty table cell.
  4905. // In Safari, target position can be empty while hovering over a widget (e.g., a page-break).
  4906. // Find the drop position inside the element.
  4907. if ( !targetModelPosition ) {
  4908. return findDropTargetRangeInElement( editor, targetModelElement );
  4909. }
  4910. // Check if target position is between blocks and adjust drop position to the next object.
  4911. // This is because while hovering over a root element next to a widget the target position can jump in crazy places.
  4912. range = findDropTargetRangeBetweenBlocks( editor, targetModelPosition, targetModelElement );
  4913. if ( range ) {
  4914. return range;
  4915. }
  4916. // Try fixing selection position.
  4917. // In Firefox, the target position lands before widgets but in other browsers it tends to land after a widget.
  4918. range = model.schema.getNearestSelectionRange( targetModelPosition, _ckeditor_ckeditor5_utils_src_env__WEBPACK_IMPORTED_MODULE_5__["default"].isGecko ? 'forward' : 'backward' );
  4919. if ( range ) {
  4920. return range;
  4921. }
  4922. // There is no valid selection position inside the current limit element so find a closest object ancestor.
  4923. // This happens if the model position lands directly in the <table> element itself (view target element was a `<td>`
  4924. // so a nested editable, but view target position was directly in the `<figure>` element).
  4925. return findDropTargetRangeOnAncestorObject( editor, targetModelPosition.parent );
  4926. }
  4927. // Returns fixed selection range for a given position and a target element if it is over the widget but not over its nested editable.
  4928. //
  4929. // @param {module:core/editor/editor~Editor} editor
  4930. // @param {module:engine/view/element~Element} targetViewElement
  4931. // @returns {module:engine/model/range~Range|null}
  4932. function findDropTargetRangeOnWidget( editor, targetViewElement ) {
  4933. const model = editor.model;
  4934. const mapper = editor.editing.mapper;
  4935. // Quick win if the target is a widget.
  4936. if ( Object(_ckeditor_ckeditor5_widget_src_utils__WEBPACK_IMPORTED_MODULE_6__["isWidget"])( targetViewElement ) ) {
  4937. return model.createRangeOn( mapper.toModelElement( targetViewElement ) );
  4938. }
  4939. // Check if we are deeper over a widget (but not over a nested editable).
  4940. if ( !targetViewElement.is( 'editableElement' ) ) {
  4941. // Find a closest ancestor that is either a widget or an editable element...
  4942. const ancestor = targetViewElement.findAncestor( node => Object(_ckeditor_ckeditor5_widget_src_utils__WEBPACK_IMPORTED_MODULE_6__["isWidget"])( node ) || node.is( 'editableElement' ) );
  4943. // ...and if the widget was closer then it is a drop target.
  4944. if ( Object(_ckeditor_ckeditor5_widget_src_utils__WEBPACK_IMPORTED_MODULE_6__["isWidget"])( ancestor ) ) {
  4945. return model.createRangeOn( mapper.toModelElement( ancestor ) );
  4946. }
  4947. }
  4948. return null;
  4949. }
  4950. // Returns fixed selection range inside a model element.
  4951. //
  4952. // @param {module:core/editor/editor~Editor} editor
  4953. // @param {module:engine/model/element~Element} targetModelElement
  4954. // @returns {module:engine/model/range~Range}
  4955. function findDropTargetRangeInElement( editor, targetModelElement ) {
  4956. const model = editor.model;
  4957. const schema = model.schema;
  4958. const positionAtElementStart = model.createPositionAt( targetModelElement, 0 );
  4959. return schema.getNearestSelectionRange( positionAtElementStart, 'forward' );
  4960. }
  4961. // Returns fixed selection range for a given position and a target element if the drop is between blocks.
  4962. //
  4963. // @param {module:core/editor/editor~Editor} editor
  4964. // @param {module:engine/model/position~Position} targetModelPosition
  4965. // @param {module:engine/model/element~Element} targetModelElement
  4966. // @returns {module:engine/model/range~Range|null}
  4967. function findDropTargetRangeBetweenBlocks( editor, targetModelPosition, targetModelElement ) {
  4968. const model = editor.model;
  4969. // Check if target is between blocks.
  4970. if ( !model.schema.checkChild( targetModelElement, '$block' ) ) {
  4971. return null;
  4972. }
  4973. // Find position between blocks.
  4974. const positionAtElementStart = model.createPositionAt( targetModelElement, 0 );
  4975. // Get the common part of the path (inside the target element and the target position).
  4976. const commonPath = targetModelPosition.path.slice( 0, positionAtElementStart.path.length );
  4977. // Position between the blocks.
  4978. const betweenBlocksPosition = model.createPositionFromPath( targetModelPosition.root, commonPath );
  4979. const nodeAfter = betweenBlocksPosition.nodeAfter;
  4980. // Adjust drop position to the next object.
  4981. // This is because while hovering over a root element next to a widget the target position can jump in crazy places.
  4982. if ( nodeAfter && model.schema.isObject( nodeAfter ) ) {
  4983. return model.createRangeOn( nodeAfter );
  4984. }
  4985. return null;
  4986. }
  4987. // Returns a selection range on the ancestor object.
  4988. //
  4989. // @param {module:core/editor/editor~Editor} editor
  4990. // @param {module:engine/model/element~Element} element
  4991. // @returns {module:engine/model/range~Range}
  4992. function findDropTargetRangeOnAncestorObject( editor, element ) {
  4993. const model = editor.model;
  4994. while ( element ) {
  4995. if ( model.schema.isObject( element ) ) {
  4996. return model.createRangeOn( element );
  4997. }
  4998. element = element.parent;
  4999. }
  5000. }
  5001. // Returns the closest model element for the specified view element.
  5002. //
  5003. // @param {module:core/editor/editor~Editor} editor
  5004. // @param {module:engine/view/element~Element} element
  5005. // @returns {module:engine/model/element~Element}
  5006. function getClosestMappedModelElement( editor, element ) {
  5007. const mapper = editor.editing.mapper;
  5008. const view = editor.editing.view;
  5009. const targetModelElement = mapper.toModelElement( element );
  5010. if ( targetModelElement ) {
  5011. return targetModelElement;
  5012. }
  5013. // Find mapped ancestor if the target is inside not mapped element (for example inline code element).
  5014. const viewPosition = view.createPositionBefore( element );
  5015. const viewElement = mapper.findMappedViewAncestor( viewPosition );
  5016. return mapper.toModelElement( viewElement );
  5017. }
  5018. // Returns the drop effect that should be a result of dragging the content.
  5019. // This function is handling a quirk when checking the effect in the 'drop' DOM event.
  5020. function getFinalDropEffect( dataTransfer ) {
  5021. if ( _ckeditor_ckeditor5_utils_src_env__WEBPACK_IMPORTED_MODULE_5__["default"].isGecko ) {
  5022. return dataTransfer.dropEffect;
  5023. }
  5024. return [ 'all', 'copyMove' ].includes( dataTransfer.effectAllowed ) ? 'move' : 'copy';
  5025. }
  5026. // Returns a function wrapper that will trigger a function after a specified wait time.
  5027. // The timeout can be canceled by calling the cancel function on the returned wrapped function.
  5028. //
  5029. // @param {Function} func The function to wrap.
  5030. // @param {Number} wait The timeout in ms.
  5031. // @returns {Function}
  5032. function delay( func, wait ) {
  5033. let timer;
  5034. function delayed( ...args ) {
  5035. delayed.cancel();
  5036. timer = setTimeout( () => func( ...args ), wait );
  5037. }
  5038. delayed.cancel = () => {
  5039. clearTimeout( timer );
  5040. };
  5041. return delayed;
  5042. }
  5043. // Returns a widget element that should be dragged.
  5044. //
  5045. // @param {module:engine/view/element~Element} target
  5046. // @returns {module:engine/view/element~Element}
  5047. function findDraggableWidget( target ) {
  5048. // This is directly an editable so not a widget for sure.
  5049. if ( target.is( 'editableElement' ) ) {
  5050. return null;
  5051. }
  5052. // TODO: Let's have a isWidgetSelectionHandleDomElement() helper in ckeditor5-widget utils.
  5053. if ( target.hasClass( 'ck-widget__selection-handle' ) ) {
  5054. return target.findAncestor( _ckeditor_ckeditor5_widget_src_utils__WEBPACK_IMPORTED_MODULE_6__["isWidget"] );
  5055. }
  5056. // Direct hit on a widget.
  5057. if ( Object(_ckeditor_ckeditor5_widget_src_utils__WEBPACK_IMPORTED_MODULE_6__["isWidget"])( target ) ) {
  5058. return target;
  5059. }
  5060. // Find closest ancestor that is either a widget or an editable element...
  5061. const ancestor = target.findAncestor( node => Object(_ckeditor_ckeditor5_widget_src_utils__WEBPACK_IMPORTED_MODULE_6__["isWidget"])( node ) || node.is( 'editableElement' ) );
  5062. // ...and if closer was the widget then enable dragging it.
  5063. if ( Object(_ckeditor_ckeditor5_widget_src_utils__WEBPACK_IMPORTED_MODULE_6__["isWidget"])( ancestor ) ) {
  5064. return ancestor;
  5065. }
  5066. return null;
  5067. }
  5068. /***/ }),
  5069. /***/ "./node_modules/@ckeditor/ckeditor5-clipboard/src/index.js":
  5070. /*!*****************************************************************!*\
  5071. !*** ./node_modules/@ckeditor/ckeditor5-clipboard/src/index.js ***!
  5072. \*****************************************************************/
  5073. /*! exports provided: Clipboard, ClipboardPipeline, DragDrop, PastePlainText */
  5074. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  5075. "use strict";
  5076. __webpack_require__.r(__webpack_exports__);
  5077. /* harmony import */ var _clipboard__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./clipboard */ "./node_modules/@ckeditor/ckeditor5-clipboard/src/clipboard.js");
  5078. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Clipboard", function() { return _clipboard__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  5079. /* harmony import */ var _clipboardpipeline__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./clipboardpipeline */ "./node_modules/@ckeditor/ckeditor5-clipboard/src/clipboardpipeline.js");
  5080. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ClipboardPipeline", function() { return _clipboardpipeline__WEBPACK_IMPORTED_MODULE_1__["default"]; });
  5081. /* harmony import */ var _dragdrop__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./dragdrop */ "./node_modules/@ckeditor/ckeditor5-clipboard/src/dragdrop.js");
  5082. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DragDrop", function() { return _dragdrop__WEBPACK_IMPORTED_MODULE_2__["default"]; });
  5083. /* harmony import */ var _pasteplaintext__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./pasteplaintext */ "./node_modules/@ckeditor/ckeditor5-clipboard/src/pasteplaintext.js");
  5084. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PastePlainText", function() { return _pasteplaintext__WEBPACK_IMPORTED_MODULE_3__["default"]; });
  5085. /**
  5086. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  5087. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  5088. */
  5089. /**
  5090. * @module clipboard
  5091. */
  5092. /***/ }),
  5093. /***/ "./node_modules/@ckeditor/ckeditor5-clipboard/src/pasteplaintext.js":
  5094. /*!**************************************************************************!*\
  5095. !*** ./node_modules/@ckeditor/ckeditor5-clipboard/src/pasteplaintext.js ***!
  5096. \**************************************************************************/
  5097. /*! exports provided: default */
  5098. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  5099. "use strict";
  5100. __webpack_require__.r(__webpack_exports__);
  5101. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return PastePlainText; });
  5102. /* 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");
  5103. /* harmony import */ var _clipboardobserver__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./clipboardobserver */ "./node_modules/@ckeditor/ckeditor5-clipboard/src/clipboardobserver.js");
  5104. /* harmony import */ var _clipboardpipeline__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./clipboardpipeline */ "./node_modules/@ckeditor/ckeditor5-clipboard/src/clipboardpipeline.js");
  5105. /**
  5106. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  5107. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  5108. */
  5109. /**
  5110. * @module clipboard/pasteplaintext
  5111. */
  5112. /**
  5113. * The plugin detects the user's intention to paste plain text.
  5114. *
  5115. * For example, it detects the <kbd>Ctrl/Cmd</kbd> + <kbd>Shift</kbd> + <kbd>V</kbd> keystroke.
  5116. *
  5117. * @extends module:core/plugin~Plugin
  5118. */
  5119. class PastePlainText extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
  5120. /**
  5121. * @inheritDoc
  5122. */
  5123. static get pluginName() {
  5124. return 'PastePlainText';
  5125. }
  5126. /**
  5127. * @inheritDoc
  5128. */
  5129. static get requires() {
  5130. return [ _clipboardpipeline__WEBPACK_IMPORTED_MODULE_2__["default"] ];
  5131. }
  5132. /**
  5133. * @inheritDoc
  5134. */
  5135. init() {
  5136. const editor = this.editor;
  5137. const model = editor.model;
  5138. const view = editor.editing.view;
  5139. const viewDocument = view.document;
  5140. const selection = model.document.selection;
  5141. let shiftPressed = false;
  5142. view.addObserver( _clipboardobserver__WEBPACK_IMPORTED_MODULE_1__["default"] );
  5143. this.listenTo( viewDocument, 'keydown', ( evt, data ) => {
  5144. shiftPressed = data.shiftKey;
  5145. } );
  5146. editor.plugins.get( _clipboardpipeline__WEBPACK_IMPORTED_MODULE_2__["default"] ).on( 'contentInsertion', ( evt, data ) => {
  5147. // Plain text can be determined based on the event flag (#7799) or auto-detection (#1006). If detected,
  5148. // preserve selection attributes on pasted items.
  5149. if ( !shiftPressed && !isPlainTextFragment( data.content, model.schema ) ) {
  5150. return;
  5151. }
  5152. model.change( writer => {
  5153. // Formatting attributes should be preserved.
  5154. const textAttributes = Array.from( selection.getAttributes() )
  5155. .filter( ( [ key ] ) => model.schema.getAttributeProperties( key ).isFormatting );
  5156. if ( !selection.isCollapsed ) {
  5157. model.deleteContent( selection, { doNotAutoparagraph: true } );
  5158. }
  5159. // Also preserve other attributes if they survived the content deletion (because they were not fully selected).
  5160. // For example linkHref is not a formatting attribute but it should be preserved if pasted text was in the middle
  5161. // of a link.
  5162. textAttributes.push( ...selection.getAttributes() );
  5163. const range = writer.createRangeIn( data.content );
  5164. for ( const item of range.getItems() ) {
  5165. if ( item.is( '$textProxy' ) ) {
  5166. writer.setAttributes( textAttributes, item );
  5167. }
  5168. }
  5169. } );
  5170. } );
  5171. }
  5172. }
  5173. // Returns true if specified `documentFragment` represents a plain text.
  5174. //
  5175. // @param {module:engine/view/documentfragment~DocumentFragment} documentFragment
  5176. // @param {module:engine/model/schema~Schema} schema
  5177. // @returns {Boolean}
  5178. function isPlainTextFragment( documentFragment, schema ) {
  5179. if ( documentFragment.childCount > 1 ) {
  5180. return false;
  5181. }
  5182. const child = documentFragment.getChild( 0 );
  5183. if ( schema.isObject( child ) ) {
  5184. return false;
  5185. }
  5186. return [ ...child.getAttributeKeys() ].length == 0;
  5187. }
  5188. /***/ }),
  5189. /***/ "./node_modules/@ckeditor/ckeditor5-clipboard/src/utils/normalizeclipboarddata.js":
  5190. /*!****************************************************************************************!*\
  5191. !*** ./node_modules/@ckeditor/ckeditor5-clipboard/src/utils/normalizeclipboarddata.js ***!
  5192. \****************************************************************************************/
  5193. /*! exports provided: default */
  5194. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  5195. "use strict";
  5196. __webpack_require__.r(__webpack_exports__);
  5197. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return normalizeClipboardData; });
  5198. /**
  5199. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  5200. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  5201. */
  5202. /**
  5203. * @module clipboard/utils/normalizeclipboarddata
  5204. */
  5205. /**
  5206. * Removes some popular browser quirks out of the clipboard data (HTML).
  5207. *
  5208. * @param {String} data The HTML data to normalize.
  5209. * @returns {String} Normalized HTML.
  5210. */
  5211. function normalizeClipboardData( data ) {
  5212. return data
  5213. .replace( /<span(?: class="Apple-converted-space"|)>(\s+)<\/span>/g, ( fullMatch, spaces ) => {
  5214. // Handle the most popular and problematic case when even a single space becomes an nbsp;.
  5215. // Decode those to normal spaces. Read more in https://github.com/ckeditor/ckeditor5-clipboard/issues/2.
  5216. if ( spaces.length == 1 ) {
  5217. return ' ';
  5218. }
  5219. return spaces;
  5220. } );
  5221. }
  5222. /***/ }),
  5223. /***/ "./node_modules/@ckeditor/ckeditor5-clipboard/src/utils/plaintexttohtml.js":
  5224. /*!*********************************************************************************!*\
  5225. !*** ./node_modules/@ckeditor/ckeditor5-clipboard/src/utils/plaintexttohtml.js ***!
  5226. \*********************************************************************************/
  5227. /*! exports provided: default */
  5228. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  5229. "use strict";
  5230. __webpack_require__.r(__webpack_exports__);
  5231. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return plainTextToHtml; });
  5232. /**
  5233. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  5234. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  5235. */
  5236. /**
  5237. * @module clipboard/utils/plaintexttohtml
  5238. */
  5239. /**
  5240. * Converts plain text to its HTML-ized version.
  5241. *
  5242. * @param {String} text The plain text to convert.
  5243. * @returns {String} HTML generated from the plain text.
  5244. */
  5245. function plainTextToHtml( text ) {
  5246. text = text
  5247. // Encode <>.
  5248. .replace( /</g, '&lt;' )
  5249. .replace( />/g, '&gt;' )
  5250. // Creates a paragraph for each double line break.
  5251. .replace( /\r?\n\r?\n/g, '</p><p>' )
  5252. // Creates a line break for each single line break.
  5253. .replace( /\r?\n/g, '<br>' )
  5254. // Preserve trailing spaces (only the first and last one – the rest is handled below).
  5255. .replace( /^\s/, '&nbsp;' )
  5256. .replace( /\s$/, '&nbsp;' )
  5257. // Preserve other subsequent spaces now.
  5258. .replace( /\s\s/g, ' &nbsp;' );
  5259. if ( text.includes( '</p><p>' ) || text.includes( '<br>' ) ) {
  5260. // If we created paragraphs above, add the trailing ones.
  5261. text = `<p>${ text }</p>`;
  5262. }
  5263. // TODO:
  5264. // * What about '\nfoo' vs ' foo'?
  5265. return text;
  5266. }
  5267. /***/ }),
  5268. /***/ "./node_modules/@ckeditor/ckeditor5-clipboard/src/utils/viewtoplaintext.js":
  5269. /*!*********************************************************************************!*\
  5270. !*** ./node_modules/@ckeditor/ckeditor5-clipboard/src/utils/viewtoplaintext.js ***!
  5271. \*********************************************************************************/
  5272. /*! exports provided: default */
  5273. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  5274. "use strict";
  5275. __webpack_require__.r(__webpack_exports__);
  5276. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return viewToPlainText; });
  5277. /**
  5278. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  5279. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  5280. */
  5281. /**
  5282. * @module clipboard/utils/viewtoplaintext
  5283. */
  5284. // Elements which should not have empty-line padding.
  5285. // Most `view.ContainerElement` want to be separate by new-line, but some are creating one structure
  5286. // together (like `<li>`) so it is better to separate them by only one "\n".
  5287. const smallPaddingElements = [ 'figcaption', 'li' ];
  5288. /**
  5289. * Converts {@link module:engine/view/item~Item view item} and all of its children to plain text.
  5290. *
  5291. * @param {module:engine/view/item~Item} viewItem View item to convert.
  5292. * @returns {String} Plain text representation of `viewItem`.
  5293. */
  5294. function viewToPlainText( viewItem ) {
  5295. let text = '';
  5296. if ( viewItem.is( '$text' ) || viewItem.is( '$textProxy' ) ) {
  5297. // If item is `Text` or `TextProxy` simple take its text data.
  5298. text = viewItem.data;
  5299. } else if ( viewItem.is( 'element', 'img' ) && viewItem.hasAttribute( 'alt' ) ) {
  5300. // Special case for images - use alt attribute if it is provided.
  5301. text = viewItem.getAttribute( 'alt' );
  5302. } else if ( viewItem.is( 'element', 'br' ) ) {
  5303. // A soft break should be converted into a single line break (#8045).
  5304. text = '\n';
  5305. } else {
  5306. // Other elements are document fragments, attribute elements or container elements.
  5307. // They don't have their own text value, so convert their children.
  5308. let prev = null;
  5309. for ( const child of viewItem.getChildren() ) {
  5310. const childText = viewToPlainText( child );
  5311. // Separate container element children with one or more new-line characters.
  5312. if ( prev && ( prev.is( 'containerElement' ) || child.is( 'containerElement' ) ) ) {
  5313. if ( smallPaddingElements.includes( prev.name ) || smallPaddingElements.includes( child.name ) ) {
  5314. text += '\n';
  5315. } else {
  5316. text += '\n\n';
  5317. }
  5318. }
  5319. text += childText;
  5320. prev = child;
  5321. }
  5322. }
  5323. return text;
  5324. }
  5325. /***/ }),
  5326. /***/ "./node_modules/@ckeditor/ckeditor5-clipboard/theme/clipboard.css":
  5327. /*!************************************************************************!*\
  5328. !*** ./node_modules/@ckeditor/ckeditor5-clipboard/theme/clipboard.css ***!
  5329. \************************************************************************/
  5330. /*! no static exports found */
  5331. /***/ (function(module, exports, __webpack_require__) {
  5332. var api = __webpack_require__(/*! ../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  5333. var content = __webpack_require__(/*! !../../../postcss-loader/src??ref--5-1!./clipboard.css */ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-clipboard/theme/clipboard.css");
  5334. content = content.__esModule ? content.default : content;
  5335. if (typeof content === 'string') {
  5336. content = [[module.i, content, '']];
  5337. }
  5338. var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
  5339. options.insert = "head";
  5340. options.singleton = true;
  5341. var update = api(content, options);
  5342. module.exports = content.locals || {};
  5343. /***/ }),
  5344. /***/ "./node_modules/@ckeditor/ckeditor5-core/src/command.js":
  5345. /*!**************************************************************!*\
  5346. !*** ./node_modules/@ckeditor/ckeditor5-core/src/command.js ***!
  5347. \**************************************************************/
  5348. /*! exports provided: default */
  5349. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  5350. "use strict";
  5351. __webpack_require__.r(__webpack_exports__);
  5352. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Command; });
  5353. /* 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");
  5354. /* 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");
  5355. /**
  5356. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  5357. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  5358. */
  5359. /**
  5360. * @module core/command
  5361. */
  5362. /**
  5363. * The base class for CKEditor commands.
  5364. *
  5365. * Commands are the main way to manipulate editor contents and state. They are mostly used by UI elements (or by other
  5366. * commands) to make changes in the model. Commands are available in every part of code that has access to
  5367. * the {@link module:core/editor/editor~Editor editor} instance.
  5368. *
  5369. * Instances of registered commands can be retrieved from {@link module:core/editor/editor~Editor#commands `editor.commands`}.
  5370. * The easiest way to execute a command is through {@link module:core/editor/editor~Editor#execute `editor.execute()`}.
  5371. *
  5372. * By default commands are disabled when the editor is in {@link module:core/editor/editor~Editor#isReadOnly read-only} mode.
  5373. *
  5374. * @mixes module:utils/observablemixin~ObservableMixin
  5375. */
  5376. class Command {
  5377. /**
  5378. * Creates a new `Command` instance.
  5379. *
  5380. * @param {module:core/editor/editor~Editor} editor Editor on which this command will be used.
  5381. */
  5382. constructor( editor ) {
  5383. /**
  5384. * The editor on which this command will be used.
  5385. *
  5386. * @readonly
  5387. * @member {module:core/editor/editor~Editor}
  5388. */
  5389. this.editor = editor;
  5390. /**
  5391. * The value of the command. A concrete command class should define what it represents for it.
  5392. *
  5393. * For example, the `'bold'` command's value indicates whether the selection starts in a bolded text.
  5394. * And the value of the `'link'` command may be an object with links details.
  5395. *
  5396. * It is possible for a command to have no value (e.g. for stateless actions such as `'uploadImage'`).
  5397. *
  5398. * A concrete command class should control this value by overriding the {@link #refresh `refresh()`} method.
  5399. *
  5400. * @observable
  5401. * @readonly
  5402. * @member #value
  5403. */
  5404. this.set( 'value', undefined );
  5405. /**
  5406. * Flag indicating whether a command is enabled or disabled.
  5407. * A disabled command will do nothing when executed.
  5408. *
  5409. * A concrete command class should control this value by overriding the {@link #refresh `refresh()`} method.
  5410. *
  5411. * It is possible to disable a command from "outside". For instance, in your integration you may want to disable
  5412. * a certain set of commands for the time being. To do that, you can use the fact that `isEnabled` is observable
  5413. * and it fires the `set:isEnabled` event every time anyone tries to modify its value:
  5414. *
  5415. * function disableCommand( cmd ) {
  5416. * cmd.on( 'set:isEnabled', forceDisable, { priority: 'highest' } );
  5417. *
  5418. * cmd.isEnabled = false;
  5419. *
  5420. * // Make it possible to enable the command again.
  5421. * return () => {
  5422. * cmd.off( 'set:isEnabled', forceDisable );
  5423. * cmd.refresh();
  5424. * };
  5425. *
  5426. * function forceDisable( evt ) {
  5427. * evt.return = false;
  5428. * evt.stop();
  5429. * }
  5430. * }
  5431. *
  5432. * // Usage:
  5433. *
  5434. * // Disabling the command.
  5435. * const enableBold = disableCommand( editor.commands.get( 'bold' ) );
  5436. *
  5437. * // Enabling the command again.
  5438. * enableBold();
  5439. *
  5440. * @observable
  5441. * @readonly
  5442. * @member {Boolean} #isEnabled
  5443. */
  5444. this.set( 'isEnabled', false );
  5445. /**
  5446. * Holds identifiers for {@link #forceDisabled} mechanism.
  5447. *
  5448. * @type {Set.<String>}
  5449. * @private
  5450. */
  5451. this._disableStack = new Set();
  5452. this.decorate( 'execute' );
  5453. // By default every command is refreshed when changes are applied to the model.
  5454. this.listenTo( this.editor.model.document, 'change', () => {
  5455. this.refresh();
  5456. } );
  5457. this.on( 'execute', evt => {
  5458. if ( !this.isEnabled ) {
  5459. evt.stop();
  5460. }
  5461. }, { priority: 'high' } );
  5462. // By default commands are disabled when the editor is in read-only mode.
  5463. this.listenTo( editor, 'change:isReadOnly', ( evt, name, value ) => {
  5464. if ( value ) {
  5465. this.forceDisabled( 'readOnlyMode' );
  5466. } else {
  5467. this.clearForceDisabled( 'readOnlyMode' );
  5468. }
  5469. } );
  5470. }
  5471. /**
  5472. * Refreshes the command. The command should update its {@link #isEnabled} and {@link #value} properties
  5473. * in this method.
  5474. *
  5475. * This method is automatically called when
  5476. * {@link module:engine/model/document~Document#event:change any changes are applied to the document}.
  5477. */
  5478. refresh() {
  5479. this.isEnabled = true;
  5480. }
  5481. /**
  5482. * Disables the command.
  5483. *
  5484. * Command may be disabled by multiple features or algorithms (at once). When disabling a command, unique id should be passed
  5485. * (e.g. feature name). The same identifier should be used when {@link #clearForceDisabled enabling back} the command.
  5486. * The command becomes enabled only after all features {@link #clearForceDisabled enabled it back}.
  5487. *
  5488. * Disabling and enabling a command:
  5489. *
  5490. * command.isEnabled; // -> true
  5491. * command.forceDisabled( 'MyFeature' );
  5492. * command.isEnabled; // -> false
  5493. * command.clearForceDisabled( 'MyFeature' );
  5494. * command.isEnabled; // -> true
  5495. *
  5496. * Command disabled by multiple features:
  5497. *
  5498. * command.forceDisabled( 'MyFeature' );
  5499. * command.forceDisabled( 'OtherFeature' );
  5500. * command.clearForceDisabled( 'MyFeature' );
  5501. * command.isEnabled; // -> false
  5502. * command.clearForceDisabled( 'OtherFeature' );
  5503. * command.isEnabled; // -> true
  5504. *
  5505. * Multiple disabling with the same identifier is redundant:
  5506. *
  5507. * command.forceDisabled( 'MyFeature' );
  5508. * command.forceDisabled( 'MyFeature' );
  5509. * command.clearForceDisabled( 'MyFeature' );
  5510. * command.isEnabled; // -> true
  5511. *
  5512. * **Note:** some commands or algorithms may have more complex logic when it comes to enabling or disabling certain commands,
  5513. * so the command might be still disabled after {@link #clearForceDisabled} was used.
  5514. *
  5515. * @param {String} id Unique identifier for disabling. Use the same id when {@link #clearForceDisabled enabling back} the command.
  5516. */
  5517. forceDisabled( id ) {
  5518. this._disableStack.add( id );
  5519. if ( this._disableStack.size == 1 ) {
  5520. this.on( 'set:isEnabled', forceDisable, { priority: 'highest' } );
  5521. this.isEnabled = false;
  5522. }
  5523. }
  5524. /**
  5525. * Clears forced disable previously set through {@link #forceDisabled}. See {@link #forceDisabled}.
  5526. *
  5527. * @param {String} id Unique identifier, equal to the one passed in {@link #forceDisabled} call.
  5528. */
  5529. clearForceDisabled( id ) {
  5530. this._disableStack.delete( id );
  5531. if ( this._disableStack.size == 0 ) {
  5532. this.off( 'set:isEnabled', forceDisable );
  5533. this.refresh();
  5534. }
  5535. }
  5536. /**
  5537. * Executes the command.
  5538. *
  5539. * A command may accept parameters. They will be passed from {@link module:core/editor/editor~Editor#execute `editor.execute()`}
  5540. * to the command.
  5541. *
  5542. * The `execute()` method will automatically abort when the command is disabled ({@link #isEnabled} is `false`).
  5543. * This behavior is implemented by a high priority listener to the {@link #event:execute} event.
  5544. *
  5545. * In order to see how to disable a command from "outside" see the {@link #isEnabled} documentation.
  5546. *
  5547. * This method may return a value, which would be forwarded all the way down to the
  5548. * {@link module:core/editor/editor~Editor#execute `editor.execute()`}.
  5549. *
  5550. * @fires execute
  5551. */
  5552. execute() {}
  5553. /**
  5554. * Destroys the command.
  5555. */
  5556. destroy() {
  5557. this.stopListening();
  5558. }
  5559. /**
  5560. * Event fired by the {@link #execute} method. The command action is a listener to this event so it's
  5561. * possible to change/cancel the behavior of the command by listening to this event.
  5562. *
  5563. * See {@link module:utils/observablemixin~ObservableMixin#decorate} for more information and samples.
  5564. *
  5565. * **Note:** This event is fired even if command is disabled. However, it is automatically blocked
  5566. * by a high priority listener in order to prevent command execution.
  5567. *
  5568. * @event execute
  5569. */
  5570. }
  5571. Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_1__["default"])( Command, _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_0__["default"] );
  5572. // Helper function that forces command to be disabled.
  5573. function forceDisable( evt ) {
  5574. evt.return = false;
  5575. evt.stop();
  5576. }
  5577. /***/ }),
  5578. /***/ "./node_modules/@ckeditor/ckeditor5-core/src/commandcollection.js":
  5579. /*!************************************************************************!*\
  5580. !*** ./node_modules/@ckeditor/ckeditor5-core/src/commandcollection.js ***!
  5581. \************************************************************************/
  5582. /*! exports provided: default */
  5583. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  5584. "use strict";
  5585. __webpack_require__.r(__webpack_exports__);
  5586. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return CommandCollection; });
  5587. /* 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");
  5588. /**
  5589. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  5590. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  5591. */
  5592. /**
  5593. * @module core/commandcollection
  5594. */
  5595. /**
  5596. * Collection of commands. Its instance is available in {@link module:core/editor/editor~Editor#commands `editor.commands`}.
  5597. */
  5598. class CommandCollection {
  5599. /**
  5600. * Creates collection instance.
  5601. */
  5602. constructor() {
  5603. /**
  5604. * Command map.
  5605. *
  5606. * @private
  5607. * @member {Map}
  5608. */
  5609. this._commands = new Map();
  5610. }
  5611. /**
  5612. * Registers a new command.
  5613. *
  5614. * @param {String} commandName The name of the command.
  5615. * @param {module:core/command~Command} command
  5616. */
  5617. add( commandName, command ) {
  5618. this._commands.set( commandName, command );
  5619. }
  5620. /**
  5621. * Retrieves a command from the collection.
  5622. *
  5623. * @param {String} commandName The name of the command.
  5624. * @returns {module:core/command~Command}
  5625. */
  5626. get( commandName ) {
  5627. return this._commands.get( commandName );
  5628. }
  5629. /**
  5630. * Executes a command.
  5631. *
  5632. * @param {String} commandName The name of the command.
  5633. * @param {*} [...commandParams] Command parameters.
  5634. * @returns {*} The value returned by the {@link module:core/command~Command#execute `command.execute()`}.
  5635. */
  5636. execute( commandName, ...args ) {
  5637. const command = this.get( commandName );
  5638. if ( !command ) {
  5639. /**
  5640. * Command does not exist.
  5641. *
  5642. * @error commandcollection-command-not-found
  5643. * @param {String} commandName Name of the command.
  5644. */
  5645. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"]( 'commandcollection-command-not-found', this, { commandName } );
  5646. }
  5647. return command.execute( ...args );
  5648. }
  5649. /**
  5650. * Returns iterator of command names.
  5651. *
  5652. * @returns {Iterable.<String>}
  5653. */
  5654. * names() {
  5655. yield* this._commands.keys();
  5656. }
  5657. /**
  5658. * Returns iterator of command instances.
  5659. *
  5660. * @returns {Iterable.<module:core/command~Command>}
  5661. */
  5662. * commands() {
  5663. yield* this._commands.values();
  5664. }
  5665. /**
  5666. * Iterable interface.
  5667. *
  5668. * Returns `[ commandName, commandInstance ]` pairs.
  5669. *
  5670. * @returns {Iterable.<Array>}
  5671. */
  5672. [ Symbol.iterator ]() {
  5673. return this._commands[ Symbol.iterator ]();
  5674. }
  5675. /**
  5676. * Destroys all collection commands.
  5677. */
  5678. destroy() {
  5679. for ( const command of this.commands() ) {
  5680. command.destroy();
  5681. }
  5682. }
  5683. }
  5684. /***/ }),
  5685. /***/ "./node_modules/@ckeditor/ckeditor5-core/src/context.js":
  5686. /*!**************************************************************!*\
  5687. !*** ./node_modules/@ckeditor/ckeditor5-core/src/context.js ***!
  5688. \**************************************************************/
  5689. /*! exports provided: default */
  5690. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  5691. "use strict";
  5692. __webpack_require__.r(__webpack_exports__);
  5693. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Context; });
  5694. /* 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");
  5695. /* 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");
  5696. /* harmony import */ var _plugincollection__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./plugincollection */ "./node_modules/@ckeditor/ckeditor5-core/src/plugincollection.js");
  5697. /* 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");
  5698. /* 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");
  5699. /**
  5700. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  5701. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  5702. */
  5703. /**
  5704. * @module core/context
  5705. */
  5706. /**
  5707. * Provides a common, higher-level environment for solutions that use multiple {@link module:core/editor/editor~Editor editors}
  5708. * or plugins that work outside the editor. Use it instead of {@link module:core/editor/editor~Editor.create `Editor.create()`}
  5709. * in advanced application integrations.
  5710. *
  5711. * All configuration options passed to a context will be used as default options for editor instances initialized in that context.
  5712. *
  5713. * {@link module:core/contextplugin~ContextPlugin Context plugins} passed to a context instance will be shared among all
  5714. * editor instances initialized in this context. These will be the same plugin instances for all the editors.
  5715. *
  5716. * **Note:** The context can only be initialized with {@link module:core/contextplugin~ContextPlugin context plugins}
  5717. * (e.g. [comments](https://ckeditor.com/collaboration/comments/)). Regular {@link module:core/plugin~Plugin plugins} require an
  5718. * editor instance to work and cannot be added to a context.
  5719. *
  5720. * **Note:** You can add a context plugin to an editor instance, though.
  5721. *
  5722. * If you are using multiple editor instances on one page and use any context plugins, create a context to share the configuration and
  5723. * plugins among these editors. Some plugins will use the information about all existing editors to better integrate between them.
  5724. *
  5725. * If you are using plugins that do not require an editor to work (e.g. [comments](https://ckeditor.com/collaboration/comments/)),
  5726. * enable and configure them using the context.
  5727. *
  5728. * If you are using only a single editor on each page, use {@link module:core/editor/editor~Editor.create `Editor.create()`} instead.
  5729. * In such case, a context instance will be created by the editor instance in a transparent way.
  5730. *
  5731. * See {@link module:core/context~Context.create `Context.create()`} for usage examples.
  5732. */
  5733. class Context {
  5734. /**
  5735. * Creates a context instance with a given configuration.
  5736. *
  5737. * Usually not to be used directly. See the static {@link module:core/context~Context.create `create()`} method.
  5738. *
  5739. * @param {Object} [config={}] The context configuration.
  5740. */
  5741. constructor( config ) {
  5742. /**
  5743. * Stores all the configurations specific to this context instance.
  5744. *
  5745. * @readonly
  5746. * @type {module:utils/config~Config}
  5747. */
  5748. this.config = new _ckeditor_ckeditor5_utils_src_config__WEBPACK_IMPORTED_MODULE_0__["default"]( config, this.constructor.defaultConfig );
  5749. const availablePlugins = this.constructor.builtinPlugins;
  5750. this.config.define( 'plugins', availablePlugins );
  5751. /**
  5752. * The plugins loaded and in use by this context instance.
  5753. *
  5754. * @readonly
  5755. * @type {module:core/plugincollection~PluginCollection}
  5756. */
  5757. this.plugins = new _plugincollection__WEBPACK_IMPORTED_MODULE_2__["default"]( this, availablePlugins );
  5758. const languageConfig = this.config.get( 'language' ) || {};
  5759. /**
  5760. * @readonly
  5761. * @type {module:utils/locale~Locale}
  5762. */
  5763. this.locale = new _ckeditor_ckeditor5_utils_src_locale__WEBPACK_IMPORTED_MODULE_3__["default"]( {
  5764. uiLanguage: typeof languageConfig === 'string' ? languageConfig : languageConfig.ui,
  5765. contentLanguage: this.config.get( 'language.content' )
  5766. } );
  5767. /**
  5768. * Shorthand for {@link module:utils/locale~Locale#t}.
  5769. *
  5770. * @see module:utils/locale~Locale#t
  5771. * @method #t
  5772. */
  5773. this.t = this.locale.t;
  5774. /**
  5775. * A list of editors that this context instance is injected to.
  5776. *
  5777. * @readonly
  5778. * @type {module:utils/collection~Collection}
  5779. */
  5780. this.editors = new _ckeditor_ckeditor5_utils_src_collection__WEBPACK_IMPORTED_MODULE_1__["default"]();
  5781. /**
  5782. * Reference to the editor which created the context.
  5783. * Null when the context was created outside of the editor.
  5784. *
  5785. * It is used to destroy the context when removing the editor that has created the context.
  5786. *
  5787. * @private
  5788. * @type {module:core/editor/editor~Editor|null}
  5789. */
  5790. this._contextOwner = null;
  5791. }
  5792. /**
  5793. * Loads and initializes plugins specified in the configuration.
  5794. *
  5795. * @returns {Promise.<module:core/plugin~LoadedPlugins>} A promise which resolves
  5796. * once the initialization is completed, providing an array of loaded plugins.
  5797. */
  5798. initPlugins() {
  5799. const plugins = this.config.get( 'plugins' ) || [];
  5800. const substitutePlugins = this.config.get( 'substitutePlugins' ) || [];
  5801. // Plugins for substitution should be checked as well.
  5802. for ( const Plugin of plugins.concat( substitutePlugins ) ) {
  5803. if ( typeof Plugin != 'function' ) {
  5804. /**
  5805. * Only a constructor function is allowed as a {@link module:core/contextplugin~ContextPlugin context plugin}.
  5806. *
  5807. * @error context-initplugins-constructor-only
  5808. */
  5809. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_4__["default"](
  5810. 'context-initplugins-constructor-only',
  5811. null,
  5812. { Plugin }
  5813. );
  5814. }
  5815. if ( Plugin.isContextPlugin !== true ) {
  5816. /**
  5817. * Only a plugin marked as a {@link module:core/contextplugin~ContextPlugin.isContextPlugin context plugin}
  5818. * is allowed to be used with a context.
  5819. *
  5820. * @error context-initplugins-invalid-plugin
  5821. */
  5822. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_4__["default"](
  5823. 'context-initplugins-invalid-plugin',
  5824. null,
  5825. { Plugin }
  5826. );
  5827. }
  5828. }
  5829. return this.plugins.init( plugins, [], substitutePlugins );
  5830. }
  5831. /**
  5832. * Destroys the context instance and all editors used with the context,
  5833. * releasing all resources used by the context.
  5834. *
  5835. * @returns {Promise} A promise that resolves once the context instance is fully destroyed.
  5836. */
  5837. destroy() {
  5838. return Promise.all( Array.from( this.editors, editor => editor.destroy() ) )
  5839. .then( () => this.plugins.destroy() );
  5840. }
  5841. /**
  5842. * Adds a reference to the editor which is used with this context.
  5843. *
  5844. * When the given editor has created the context, the reference to this editor will be stored
  5845. * as a {@link ~Context#_contextOwner}.
  5846. *
  5847. * This method should only be used by the editor.
  5848. *
  5849. * @protected
  5850. * @param {module:core/editor/editor~Editor} editor
  5851. * @param {Boolean} isContextOwner Stores the given editor as a context owner.
  5852. */
  5853. _addEditor( editor, isContextOwner ) {
  5854. if ( this._contextOwner ) {
  5855. /**
  5856. * Cannot add multiple editors to the context which is created by the editor.
  5857. *
  5858. * @error context-addeditor-private-context
  5859. */
  5860. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_4__["default"]( 'context-addeditor-private-context' );
  5861. }
  5862. this.editors.add( editor );
  5863. if ( isContextOwner ) {
  5864. this._contextOwner = editor;
  5865. }
  5866. }
  5867. /**
  5868. * Removes a reference to the editor which was used with this context.
  5869. * When the context was created by the given editor, the context will be destroyed.
  5870. *
  5871. * This method should only be used by the editor.
  5872. *
  5873. * @protected
  5874. * @param {module:core/editor/editor~Editor} editor
  5875. * @return {Promise} A promise that resolves once the editor is removed from the context or when the context was destroyed.
  5876. */
  5877. _removeEditor( editor ) {
  5878. if ( this.editors.has( editor ) ) {
  5879. this.editors.remove( editor );
  5880. }
  5881. if ( this._contextOwner === editor ) {
  5882. return this.destroy();
  5883. }
  5884. return Promise.resolve();
  5885. }
  5886. /**
  5887. * Returns the context configuration which will be copied to the editors created using this context.
  5888. *
  5889. * The configuration returned by this method has the plugins configuration removed &mdash; plugins are shared with all editors
  5890. * through another mechanism.
  5891. *
  5892. * This method should only be used by the editor.
  5893. *
  5894. * @protected
  5895. * @returns {Object} Configuration as a plain object.
  5896. */
  5897. _getEditorConfig() {
  5898. const result = {};
  5899. for ( const name of this.config.names() ) {
  5900. if ( ![ 'plugins', 'removePlugins', 'extraPlugins' ].includes( name ) ) {
  5901. result[ name ] = this.config.get( name );
  5902. }
  5903. }
  5904. return result;
  5905. }
  5906. /**
  5907. * Creates and initializes a new context instance.
  5908. *
  5909. * const commonConfig = { ... }; // Configuration for all the plugins and editors.
  5910. * const editorPlugins = [ ... ]; // Regular plugins here.
  5911. *
  5912. * Context
  5913. * .create( {
  5914. * // Only context plugins here.
  5915. * plugins: [ ... ],
  5916. *
  5917. * // Configure the language for all the editors (it cannot be overwritten).
  5918. * language: { ... },
  5919. *
  5920. * // Configuration for context plugins.
  5921. * comments: { ... },
  5922. * ...
  5923. *
  5924. * // Default configuration for editor plugins.
  5925. * toolbar: { ... },
  5926. * image: { ... },
  5927. * ...
  5928. * } )
  5929. * .then( context => {
  5930. * const promises = [];
  5931. *
  5932. * promises.push( ClassicEditor.create(
  5933. * document.getElementById( 'editor1' ),
  5934. * {
  5935. * editorPlugins,
  5936. * context
  5937. * }
  5938. * ) );
  5939. *
  5940. * promises.push( ClassicEditor.create(
  5941. * document.getElementById( 'editor2' ),
  5942. * {
  5943. * editorPlugins,
  5944. * context,
  5945. * toolbar: { ... } // You can overwrite the configuration of the context.
  5946. * }
  5947. * ) );
  5948. *
  5949. * return Promise.all( promises );
  5950. * } );
  5951. *
  5952. * @param {Object} [config] The context configuration.
  5953. * @returns {Promise} A promise resolved once the context is ready. The promise resolves with the created context instance.
  5954. */
  5955. static create( config ) {
  5956. return new Promise( resolve => {
  5957. const context = new this( config );
  5958. resolve( context.initPlugins().then( () => context ) );
  5959. } );
  5960. }
  5961. }
  5962. /**
  5963. * An array of plugins built into the `Context` class.
  5964. *
  5965. * It is used in CKEditor 5 builds featuring `Context` to provide a list of context plugins which are later automatically initialized
  5966. * during the context initialization.
  5967. *
  5968. * They will be automatically initialized by `Context` unless `config.plugins` is passed.
  5969. *
  5970. * // Build some context plugins into the Context class first.
  5971. * Context.builtinPlugins = [ FooPlugin, BarPlugin ];
  5972. *
  5973. * // Normally, you need to define config.plugins, but since Context.builtinPlugins was
  5974. * // defined, now you can call create() without any configuration.
  5975. * Context
  5976. * .create()
  5977. * .then( context => {
  5978. * context.plugins.get( FooPlugin ); // -> An instance of the Foo plugin.
  5979. * context.plugins.get( BarPlugin ); // -> An instance of the Bar plugin.
  5980. * } );
  5981. *
  5982. * See also {@link module:core/context~Context.defaultConfig `Context.defaultConfig`}
  5983. * and {@link module:core/editor/editor~Editor.builtinPlugins `Editor.builtinPlugins`}.
  5984. *
  5985. * @static
  5986. * @member {Array.<Function>} module:core/context~Context.builtinPlugins
  5987. */
  5988. /**
  5989. * The default configuration which is built into the `Context` class.
  5990. *
  5991. * It is used in CKEditor 5 builds featuring `Context` to provide the default configuration options which are later used during the
  5992. * context initialization.
  5993. *
  5994. * Context.defaultConfig = {
  5995. * foo: 1,
  5996. * bar: 2
  5997. * };
  5998. *
  5999. * Context
  6000. * .create()
  6001. * .then( context => {
  6002. * context.config.get( 'foo' ); // -> 1
  6003. * context.config.get( 'bar' ); // -> 2
  6004. * } );
  6005. *
  6006. * // The default options can be overridden by the configuration passed to create().
  6007. * Context
  6008. * .create( { bar: 3 } )
  6009. * .then( context => {
  6010. * context.config.get( 'foo' ); // -> 1
  6011. * context.config.get( 'bar' ); // -> 3
  6012. * } );
  6013. *
  6014. * See also {@link module:core/context~Context.builtinPlugins `Context.builtinPlugins`}
  6015. * and {@link module:core/editor/editor~Editor.defaultConfig `Editor.defaultConfig`}.
  6016. *
  6017. * @static
  6018. * @member {Object} module:core/context~Context.defaultConfig
  6019. */
  6020. /***/ }),
  6021. /***/ "./node_modules/@ckeditor/ckeditor5-core/src/contextplugin.js":
  6022. /*!********************************************************************!*\
  6023. !*** ./node_modules/@ckeditor/ckeditor5-core/src/contextplugin.js ***!
  6024. \********************************************************************/
  6025. /*! exports provided: default */
  6026. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  6027. "use strict";
  6028. __webpack_require__.r(__webpack_exports__);
  6029. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ContextPlugin; });
  6030. /* 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");
  6031. /* 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");
  6032. /**
  6033. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  6034. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  6035. */
  6036. /**
  6037. * @module core/contextplugin
  6038. */
  6039. /**
  6040. * The base class for {@link module:core/context~Context} plugin classes.
  6041. *
  6042. * A context plugin can either be initialized for an {@link module:core/editor/editor~Editor editor} or for
  6043. * a {@link module:core/context~Context context}. In other words, it can either
  6044. * work within one editor instance or with one or more editor instances that use a single context.
  6045. * It is the context plugin's role to implement handling for both modes.
  6046. *
  6047. * There are a few rules for interaction between the editor plugins and context plugins:
  6048. *
  6049. * * A context plugin can require another context plugin.
  6050. * * An {@link module:core/plugin~Plugin editor plugin} can require a context plugin.
  6051. * * A context plugin MUST NOT require an {@link module:core/plugin~Plugin editor plugin}.
  6052. *
  6053. * @implements module:core/plugin~PluginInterface
  6054. * @mixes module:utils/observablemixin~ObservableMixin
  6055. */
  6056. class ContextPlugin {
  6057. /**
  6058. * Creates a new plugin instance.
  6059. *
  6060. * @param {module:core/context~Context|module:core/editor/editor~Editor} context
  6061. */
  6062. constructor( context ) {
  6063. /**
  6064. * The context instance.
  6065. *
  6066. * @readonly
  6067. * @type {module:core/context~Context|module:core/editor/editor~Editor}
  6068. */
  6069. this.context = context;
  6070. }
  6071. /**
  6072. * @inheritDoc
  6073. */
  6074. destroy() {
  6075. this.stopListening();
  6076. }
  6077. /**
  6078. * @inheritDoc
  6079. */
  6080. static get isContextPlugin() {
  6081. return true;
  6082. }
  6083. }
  6084. Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_1__["default"])( ContextPlugin, _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_0__["default"] );
  6085. /***/ }),
  6086. /***/ "./node_modules/@ckeditor/ckeditor5-core/src/editingkeystrokehandler.js":
  6087. /*!******************************************************************************!*\
  6088. !*** ./node_modules/@ckeditor/ckeditor5-core/src/editingkeystrokehandler.js ***!
  6089. \******************************************************************************/
  6090. /*! exports provided: default */
  6091. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  6092. "use strict";
  6093. __webpack_require__.r(__webpack_exports__);
  6094. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return EditingKeystrokeHandler; });
  6095. /* 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");
  6096. /**
  6097. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  6098. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  6099. */
  6100. /**
  6101. * @module core/editingkeystrokehandler
  6102. */
  6103. /**
  6104. * A keystroke handler for editor editing. Its instance is available
  6105. * in {@link module:core/editor/editor~Editor#keystrokes} so plugins
  6106. * can register their keystrokes.
  6107. *
  6108. * E.g. an undo plugin would do this:
  6109. *
  6110. * editor.keystrokes.set( 'Ctrl+Z', 'undo' );
  6111. * editor.keystrokes.set( 'Ctrl+Shift+Z', 'redo' );
  6112. * editor.keystrokes.set( 'Ctrl+Y', 'redo' );
  6113. *
  6114. * @extends module:utils/keystrokehandler~KeystrokeHandler
  6115. */
  6116. class EditingKeystrokeHandler extends _ckeditor_ckeditor5_utils_src_keystrokehandler__WEBPACK_IMPORTED_MODULE_0__["default"] {
  6117. /**
  6118. * Creates an instance of the keystroke handler.
  6119. *
  6120. * @param {module:core/editor/editor~Editor} editor
  6121. */
  6122. constructor( editor ) {
  6123. super();
  6124. /**
  6125. * The editor instance.
  6126. *
  6127. * @readonly
  6128. * @member {module:core/editor/editor~Editor}
  6129. */
  6130. this.editor = editor;
  6131. }
  6132. /**
  6133. * Registers a handler for the specified keystroke.
  6134. *
  6135. * The handler can be specified as a command name or a callback.
  6136. *
  6137. * @param {String|Array.<String|Number>} keystroke Keystroke defined in a format accepted by
  6138. * the {@link module:utils/keyboard~parseKeystroke} function.
  6139. * @param {Function|String} callback If a string is passed, then the keystroke will
  6140. * {@link module:core/editor/editor~Editor#execute execute a command}.
  6141. * If a function, then it will be called with the
  6142. * {@link module:engine/view/observer/keyobserver~KeyEventData key event data} object and
  6143. * a `cancel()` helper to both `preventDefault()` and `stopPropagation()` of the event.
  6144. * @param {Object} [options={}] Additional options.
  6145. * @param {module:utils/priorities~PriorityString|Number} [options.priority='normal'] The priority of the keystroke
  6146. * callback. The higher the priority value the sooner the callback will be executed. Keystrokes having the same priority
  6147. * are called in the order they were added.
  6148. */
  6149. set( keystroke, callback, options = {} ) {
  6150. if ( typeof callback == 'string' ) {
  6151. const commandName = callback;
  6152. callback = ( evtData, cancel ) => {
  6153. this.editor.execute( commandName );
  6154. cancel();
  6155. };
  6156. }
  6157. super.set( keystroke, callback, options );
  6158. }
  6159. }
  6160. /***/ }),
  6161. /***/ "./node_modules/@ckeditor/ckeditor5-core/src/editor/editor.js":
  6162. /*!********************************************************************!*\
  6163. !*** ./node_modules/@ckeditor/ckeditor5-core/src/editor/editor.js ***!
  6164. \********************************************************************/
  6165. /*! exports provided: default */
  6166. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  6167. "use strict";
  6168. __webpack_require__.r(__webpack_exports__);
  6169. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Editor; });
  6170. /* harmony import */ var _context__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../context */ "./node_modules/@ckeditor/ckeditor5-core/src/context.js");
  6171. /* 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");
  6172. /* 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");
  6173. /* harmony import */ var _plugincollection__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../plugincollection */ "./node_modules/@ckeditor/ckeditor5-core/src/plugincollection.js");
  6174. /* harmony import */ var _commandcollection__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../commandcollection */ "./node_modules/@ckeditor/ckeditor5-core/src/commandcollection.js");
  6175. /* 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");
  6176. /* 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");
  6177. /* 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");
  6178. /* harmony import */ var _editingkeystrokehandler__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../editingkeystrokehandler */ "./node_modules/@ckeditor/ckeditor5-core/src/editingkeystrokehandler.js");
  6179. /* 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");
  6180. /* 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");
  6181. /* 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");
  6182. /* 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");
  6183. /**
  6184. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  6185. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  6186. */
  6187. /**
  6188. * @module core/editor/editor
  6189. */
  6190. /**
  6191. * The class representing a basic, generic editor.
  6192. *
  6193. * Check out the list of its subclasses to learn about specific editor implementations.
  6194. *
  6195. * All editor implementations (like {@link module:editor-classic/classiceditor~ClassicEditor} or
  6196. * {@link module:editor-inline/inlineeditor~InlineEditor}) should extend this class. They can add their
  6197. * own methods and properties.
  6198. *
  6199. * When you are implementing a plugin, this editor represents the API
  6200. * which your plugin can expect to get when using its {@link module:core/plugin~Plugin#editor} property.
  6201. *
  6202. * This API should be sufficient in order to implement the "editing" part of your feature
  6203. * (schema definition, conversion, commands, keystrokes, etc.).
  6204. * It does not define the editor UI, which is available only if
  6205. * the specific editor implements also the {@link module:core/editor/editorwithui~EditorWithUI} interface
  6206. * (as most editor implementations do).
  6207. *
  6208. * @abstract
  6209. * @mixes module:utils/observablemixin~ObservableMixin
  6210. */
  6211. class Editor {
  6212. /**
  6213. * Creates a new instance of the editor class.
  6214. *
  6215. * Usually, not to be used directly. See the static {@link module:core/editor/editor~Editor.create `create()`} method.
  6216. *
  6217. * @param {Object} [config={}] The editor configuration.
  6218. */
  6219. constructor( config = {} ) {
  6220. /**
  6221. * The editor context.
  6222. * When it is not provided through the configuration, the editor creates it.
  6223. *
  6224. * @protected
  6225. * @type {module:core/context~Context}
  6226. */
  6227. this._context = config.context || new _context__WEBPACK_IMPORTED_MODULE_0__["default"]( { language: config.language } );
  6228. this._context._addEditor( this, !config.context );
  6229. // Clone the plugins to make sure that the plugin array will not be shared
  6230. // between editors and make the watchdog feature work correctly.
  6231. const availablePlugins = Array.from( this.constructor.builtinPlugins || [] );
  6232. /**
  6233. * Stores all configurations specific to this editor instance.
  6234. *
  6235. * editor.config.get( 'image.toolbar' );
  6236. * // -> [ 'imageStyle:full', 'imageStyle:side', '|', 'imageTextAlternative' ]
  6237. *
  6238. * @readonly
  6239. * @member {module:utils/config~Config}
  6240. */
  6241. this.config = new _ckeditor_ckeditor5_utils_src_config__WEBPACK_IMPORTED_MODULE_1__["default"]( config, this.constructor.defaultConfig );
  6242. this.config.define( 'plugins', availablePlugins );
  6243. this.config.define( this._context._getEditorConfig() );
  6244. /**
  6245. * The plugins loaded and in use by this editor instance.
  6246. *
  6247. * editor.plugins.get( 'ClipboardPipeline' ); // -> An instance of the clipboard pipeline plugin.
  6248. *
  6249. * @readonly
  6250. * @member {module:core/plugincollection~PluginCollection}
  6251. */
  6252. this.plugins = new _plugincollection__WEBPACK_IMPORTED_MODULE_3__["default"]( this, availablePlugins, this._context.plugins );
  6253. /**
  6254. * The locale instance.
  6255. *
  6256. * @readonly
  6257. * @type {module:utils/locale~Locale}
  6258. */
  6259. this.locale = this._context.locale;
  6260. /**
  6261. * Shorthand for {@link module:utils/locale~Locale#t}.
  6262. *
  6263. * @see module:utils/locale~Locale#t
  6264. * @method #t
  6265. */
  6266. this.t = this.locale.t;
  6267. /**
  6268. * Commands registered to the editor.
  6269. *
  6270. * Use the shorthand {@link #execute `editor.execute()`} method to execute commands:
  6271. *
  6272. * // Execute the bold command:
  6273. * editor.execute( 'bold' );
  6274. *
  6275. * // Check the state of the bold command:
  6276. * editor.commands.get( 'bold' ).value;
  6277. *
  6278. * @readonly
  6279. * @member {module:core/commandcollection~CommandCollection}
  6280. */
  6281. this.commands = new _commandcollection__WEBPACK_IMPORTED_MODULE_4__["default"]();
  6282. /**
  6283. * Indicates the editor life-cycle state.
  6284. *
  6285. * The editor is in one of the following states:
  6286. *
  6287. * * `initializing` &ndash; During the editor initialization (before
  6288. * {@link module:core/editor/editor~Editor.create `Editor.create()`}) finished its job.
  6289. * * `ready` &ndash; After the promise returned by the {@link module:core/editor/editor~Editor.create `Editor.create()`}
  6290. * method is resolved.
  6291. * * `destroyed` &ndash; Once the {@link #destroy `editor.destroy()`} method was called.
  6292. *
  6293. * @observable
  6294. * @member {'initializing'|'ready'|'destroyed'} #state
  6295. */
  6296. this.set( 'state', 'initializing' );
  6297. this.once( 'ready', () => ( this.state = 'ready' ), { priority: 'high' } );
  6298. this.once( 'destroy', () => ( this.state = 'destroyed' ), { priority: 'high' } );
  6299. /**
  6300. * Defines whether this editor is in read-only mode.
  6301. *
  6302. * In read-only mode the editor {@link #commands commands} are disabled so it is not possible
  6303. * to modify the document by using them. Also, the editable element(s) become non-editable.
  6304. *
  6305. * In order to make the editor read-only, you can set this value directly:
  6306. *
  6307. * editor.isReadOnly = true;
  6308. *
  6309. * @observable
  6310. * @member {Boolean} #isReadOnly
  6311. */
  6312. this.set( 'isReadOnly', false );
  6313. /**
  6314. * The editor's model.
  6315. *
  6316. * The central point of the editor's abstract data model.
  6317. *
  6318. * @readonly
  6319. * @member {module:engine/model/model~Model}
  6320. */
  6321. this.model = new _ckeditor_ckeditor5_engine_src_model_model__WEBPACK_IMPORTED_MODULE_7__["default"]();
  6322. const stylesProcessor = new _ckeditor_ckeditor5_engine_src_view_stylesmap__WEBPACK_IMPORTED_MODULE_12__["StylesProcessor"]();
  6323. /**
  6324. * The {@link module:engine/controller/datacontroller~DataController data controller}.
  6325. * Used e.g. for setting and retrieving the editor data.
  6326. *
  6327. * @readonly
  6328. * @member {module:engine/controller/datacontroller~DataController}
  6329. */
  6330. this.data = new _ckeditor_ckeditor5_engine_src_controller_datacontroller__WEBPACK_IMPORTED_MODULE_5__["default"]( this.model, stylesProcessor );
  6331. /**
  6332. * The {@link module:engine/controller/editingcontroller~EditingController editing controller}.
  6333. * Controls user input and rendering the content for editing.
  6334. *
  6335. * @readonly
  6336. * @member {module:engine/controller/editingcontroller~EditingController}
  6337. */
  6338. this.editing = new _ckeditor_ckeditor5_engine_src_controller_editingcontroller__WEBPACK_IMPORTED_MODULE_2__["default"]( this.model, stylesProcessor );
  6339. this.editing.view.document.bind( 'isReadOnly' ).to( this );
  6340. /**
  6341. * Conversion manager through which you can register model-to-view and view-to-model converters.
  6342. *
  6343. * See the {@link module:engine/conversion/conversion~Conversion} documentation to learn how to add converters.
  6344. *
  6345. * @readonly
  6346. * @member {module:engine/conversion/conversion~Conversion}
  6347. */
  6348. this.conversion = new _ckeditor_ckeditor5_engine_src_conversion_conversion__WEBPACK_IMPORTED_MODULE_6__["default"]( [ this.editing.downcastDispatcher, this.data.downcastDispatcher ], this.data.upcastDispatcher );
  6349. this.conversion.addAlias( 'dataDowncast', this.data.downcastDispatcher );
  6350. this.conversion.addAlias( 'editingDowncast', this.editing.downcastDispatcher );
  6351. /**
  6352. * An instance of the {@link module:core/editingkeystrokehandler~EditingKeystrokeHandler}.
  6353. *
  6354. * It allows setting simple keystrokes:
  6355. *
  6356. * // Execute the bold command on Ctrl+E:
  6357. * editor.keystrokes.set( 'Ctrl+E', 'bold' );
  6358. *
  6359. * // Execute your own callback:
  6360. * editor.keystrokes.set( 'Ctrl+E', ( data, cancel ) => {
  6361. * console.log( data.keyCode );
  6362. *
  6363. * // Prevent the default (native) action and stop the underlying keydown event
  6364. * // so no other editor feature will interfere.
  6365. * cancel();
  6366. * } );
  6367. *
  6368. * Note: Certain typing-oriented keystrokes (like <kbd>Backspace</kbd> or <kbd>Enter</kbd>) are handled
  6369. * by a low-level mechanism and trying to listen to them via the keystroke handler will not work reliably.
  6370. * To handle these specific keystrokes, see the events fired by the
  6371. * {@link module:engine/view/document~Document editing view document} (`editor.editing.view.document`).
  6372. *
  6373. * @readonly
  6374. * @member {module:core/editingkeystrokehandler~EditingKeystrokeHandler}
  6375. */
  6376. this.keystrokes = new _editingkeystrokehandler__WEBPACK_IMPORTED_MODULE_8__["default"]( this );
  6377. this.keystrokes.listenTo( this.editing.view.document );
  6378. }
  6379. /**
  6380. * Loads and initializes plugins specified in the configuration.
  6381. *
  6382. * @returns {Promise.<module:core/plugin~LoadedPlugins>} A promise which resolves
  6383. * once the initialization is completed, providing an array of loaded plugins.
  6384. */
  6385. initPlugins() {
  6386. const config = this.config;
  6387. const plugins = config.get( 'plugins' );
  6388. const removePlugins = config.get( 'removePlugins' ) || [];
  6389. const extraPlugins = config.get( 'extraPlugins' ) || [];
  6390. const substitutePlugins = config.get( 'substitutePlugins' ) || [];
  6391. return this.plugins.init( plugins.concat( extraPlugins ), removePlugins, substitutePlugins );
  6392. }
  6393. /**
  6394. * Destroys the editor instance, releasing all resources used by it.
  6395. *
  6396. * **Note** The editor cannot be destroyed during the initialization phase so if it is called
  6397. * while the editor {@link #state is being initialized}, it will wait for the editor initialization before destroying it.
  6398. *
  6399. * @fires destroy
  6400. * @returns {Promise} A promise that resolves once the editor instance is fully destroyed.
  6401. */
  6402. destroy() {
  6403. let readyPromise = Promise.resolve();
  6404. if ( this.state == 'initializing' ) {
  6405. readyPromise = new Promise( resolve => this.once( 'ready', resolve ) );
  6406. }
  6407. return readyPromise
  6408. .then( () => {
  6409. this.fire( 'destroy' );
  6410. this.stopListening();
  6411. this.commands.destroy();
  6412. } )
  6413. .then( () => this.plugins.destroy() )
  6414. .then( () => {
  6415. this.model.destroy();
  6416. this.data.destroy();
  6417. this.editing.destroy();
  6418. this.keystrokes.destroy();
  6419. } )
  6420. // Remove the editor from the context.
  6421. // When the context was created by this editor, the context will be destroyed.
  6422. .then( () => this._context._removeEditor( this ) );
  6423. }
  6424. /**
  6425. * Executes the specified command with given parameters.
  6426. *
  6427. * Shorthand for:
  6428. *
  6429. * editor.commands.get( commandName ).execute( ... );
  6430. *
  6431. * @param {String} commandName The name of the command to execute.
  6432. * @param {*} [...commandParams] Command parameters.
  6433. * @returns {*} The value returned by the {@link module:core/commandcollection~CommandCollection#execute `commands.execute()`}.
  6434. */
  6435. execute( ...args ) {
  6436. try {
  6437. return this.commands.execute( ...args );
  6438. } catch ( err ) {
  6439. // @if CK_DEBUG // throw err;
  6440. /* istanbul ignore next */
  6441. _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_11__["default"].rethrowUnexpectedError( err, this );
  6442. }
  6443. }
  6444. /**
  6445. * Focuses the editor.
  6446. *
  6447. * **Note** To explicitly focus the editing area of the editor, use the
  6448. * {@link module:engine/view/view~View#focus `editor.editing.view.focus()`} method of the editing view.
  6449. *
  6450. * Check out the {@glink framework/guides/deep-dive/ui/focus-tracking#focus-in-the-editor-ui Focus in the editor UI} section
  6451. * of the {@glink framework/guides/deep-dive/ui/focus-tracking Deep dive into focus tracking} guide to learn more.
  6452. */
  6453. focus() {
  6454. this.editing.view.focus();
  6455. }
  6456. /**
  6457. * Creates and initializes a new editor instance.
  6458. *
  6459. * This is an abstract method. Every editor type needs to implement its own initialization logic.
  6460. *
  6461. * See the `create()` methods of the existing editor types to learn how to use them:
  6462. *
  6463. * * {@link module:editor-classic/classiceditor~ClassicEditor.create `ClassicEditor.create()`}
  6464. * * {@link module:editor-balloon/ballooneditor~BalloonEditor.create `BalloonEditor.create()`}
  6465. * * {@link module:editor-decoupled/decouplededitor~DecoupledEditor.create `DecoupledEditor.create()`}
  6466. * * {@link module:editor-inline/inlineeditor~InlineEditor.create `InlineEditor.create()`}
  6467. *
  6468. * @abstract
  6469. * @method module:core/editor/editor~Editor.create
  6470. */
  6471. }
  6472. Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_10__["default"])( Editor, _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_9__["default"] );
  6473. /**
  6474. * Fired when the {@link module:engine/controller/datacontroller~DataController#event:ready data} and all additional
  6475. * editor components are ready.
  6476. *
  6477. * Note: This event is most useful for plugin developers. When integrating the editor with your website or
  6478. * application, you do not have to listen to `editor#ready` because when the promise returned by the static
  6479. * {@link module:core/editor/editor~Editor.create `Editor.create()`} event is resolved, the editor is already ready.
  6480. * In fact, since the first moment when the editor instance is available to you is inside `then()`'s callback,
  6481. * you cannot even add a listener to the `editor#ready` event.
  6482. *
  6483. * See also the {@link #state `editor.state`} property.
  6484. *
  6485. * @event ready
  6486. */
  6487. /**
  6488. * Fired when this editor instance is destroyed. The editor at this point is not usable and this event should be used to
  6489. * perform the clean-up in any plugin.
  6490. *
  6491. *
  6492. * See also the {@link #state `editor.state`} property.
  6493. *
  6494. * @event destroy
  6495. */
  6496. /**
  6497. * This error is thrown when trying to pass a `<textarea>` element to a `create()` function of an editor class.
  6498. *
  6499. * The only editor type which can be initialized on `<textarea>` elements is {@glink builds/guides/overview#classic-editor classic editor}.
  6500. * 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
  6501. * editable element and therefore `<textarea>` is not appropriate for them. Use a `<div>` or another text container instead:
  6502. *
  6503. * <div id="editor">
  6504. * <p>Initial content.</p>
  6505. * </div>
  6506. *
  6507. * @error editor-wrong-element
  6508. */
  6509. /**
  6510. * An array of plugins built into this editor class.
  6511. *
  6512. * It is used in CKEditor 5 builds to provide a list of plugins which are later automatically initialized
  6513. * during the editor initialization.
  6514. *
  6515. * They will be automatically initialized by the editor, unless listed in `config.removePlugins` and
  6516. * unless `config.plugins` is passed.
  6517. *
  6518. * // Build some plugins into the editor class first.
  6519. * ClassicEditor.builtinPlugins = [ FooPlugin, BarPlugin ];
  6520. *
  6521. * // Normally, you need to define config.plugins, but since ClassicEditor.builtinPlugins was
  6522. * // defined, now you can call create() without any configuration.
  6523. * ClassicEditor
  6524. * .create( sourceElement )
  6525. * .then( editor => {
  6526. * editor.plugins.get( FooPlugin ); // -> An instance of the Foo plugin.
  6527. * editor.plugins.get( BarPlugin ); // -> An instance of the Bar plugin.
  6528. * } );
  6529. *
  6530. * ClassicEditor
  6531. * .create( sourceElement, {
  6532. * // Do not initialize these plugins (note: it is defined by a string):
  6533. * removePlugins: [ 'Foo' ]
  6534. * } )
  6535. * .then( editor => {
  6536. * editor.plugins.get( FooPlugin ); // -> Undefined.
  6537. * editor.config.get( BarPlugin ); // -> An instance of the Bar plugin.
  6538. * } );
  6539. *
  6540. * ClassicEditor
  6541. * .create( sourceElement, {
  6542. * // Load only this plugin. It can also be defined by a string if
  6543. * // this plugin was built into the editor class.
  6544. * plugins: [ FooPlugin ]
  6545. * } )
  6546. * .then( editor => {
  6547. * editor.plugins.get( FooPlugin ); // -> An instance of the Foo plugin.
  6548. * editor.config.get( BarPlugin ); // -> Undefined.
  6549. * } );
  6550. *
  6551. * See also {@link module:core/editor/editor~Editor.defaultConfig}.
  6552. *
  6553. * @static
  6554. * @member {Array.<Function>} module:core/editor/editor~Editor.builtinPlugins
  6555. */
  6556. /**
  6557. * The default configuration which is built into the editor class.
  6558. *
  6559. * It is used in CKEditor 5 builds to provide the default configuration options which are later used during the editor initialization.
  6560. *
  6561. * ClassicEditor.defaultConfig = {
  6562. * foo: 1,
  6563. * bar: 2
  6564. * };
  6565. *
  6566. * ClassicEditor
  6567. * .create( sourceElement )
  6568. * .then( editor => {
  6569. * editor.config.get( 'foo' ); // -> 1
  6570. * editor.config.get( 'bar' ); // -> 2
  6571. * } );
  6572. *
  6573. * // The default options can be overridden by the configuration passed to create().
  6574. * ClassicEditor
  6575. * .create( sourceElement, { bar: 3 } )
  6576. * .then( editor => {
  6577. * editor.config.get( 'foo' ); // -> 1
  6578. * editor.config.get( 'bar' ); // -> 3
  6579. * } );
  6580. *
  6581. * See also {@link module:core/editor/editor~Editor.builtinPlugins}.
  6582. *
  6583. * @static
  6584. * @member {Object} module:core/editor/editor~Editor.defaultConfig
  6585. */
  6586. /***/ }),
  6587. /***/ "./node_modules/@ckeditor/ckeditor5-core/src/editor/editorui.js":
  6588. /*!**********************************************************************!*\
  6589. !*** ./node_modules/@ckeditor/ckeditor5-core/src/editor/editorui.js ***!
  6590. \**********************************************************************/
  6591. /*! exports provided: default */
  6592. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  6593. "use strict";
  6594. __webpack_require__.r(__webpack_exports__);
  6595. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return EditorUI; });
  6596. /* 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");
  6597. /* 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");
  6598. /* 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");
  6599. /* 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");
  6600. /**
  6601. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  6602. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  6603. */
  6604. /**
  6605. * @module core/editor/editorui
  6606. */
  6607. /* globals console */
  6608. /**
  6609. * A class providing the minimal interface that is required to successfully bootstrap any editor UI.
  6610. *
  6611. * @mixes module:utils/emittermixin~EmitterMixin
  6612. */
  6613. class EditorUI {
  6614. /**
  6615. * Creates an instance of the editor UI class.
  6616. *
  6617. * @param {module:core/editor/editor~Editor} editor The editor instance.
  6618. */
  6619. constructor( editor ) {
  6620. /**
  6621. * The editor that the UI belongs to.
  6622. *
  6623. * @readonly
  6624. * @member {module:core/editor/editor~Editor} #editor
  6625. */
  6626. this.editor = editor;
  6627. /**
  6628. * An instance of the {@link module:ui/componentfactory~ComponentFactory}, a registry used by plugins
  6629. * to register factories of specific UI components.
  6630. *
  6631. * @readonly
  6632. * @member {module:ui/componentfactory~ComponentFactory} #componentFactory
  6633. */
  6634. this.componentFactory = new _ckeditor_ckeditor5_ui_src_componentfactory__WEBPACK_IMPORTED_MODULE_0__["default"]( editor );
  6635. /**
  6636. * Stores the information about the editor UI focus and propagates it so various plugins and components
  6637. * are unified as a focus group.
  6638. *
  6639. * @readonly
  6640. * @member {module:utils/focustracker~FocusTracker} #focusTracker
  6641. */
  6642. this.focusTracker = new _ckeditor_ckeditor5_utils_src_focustracker__WEBPACK_IMPORTED_MODULE_1__["default"]();
  6643. /**
  6644. * Stores all editable elements used by the editor instance.
  6645. *
  6646. * @private
  6647. * @member {Map.<String,HTMLElement>}
  6648. */
  6649. this._editableElementsMap = new Map();
  6650. // Informs UI components that should be refreshed after layout change.
  6651. this.listenTo( editor.editing.view.document, 'layoutChanged', () => this.update() );
  6652. }
  6653. /**
  6654. * The main (outermost) DOM element of the editor UI.
  6655. *
  6656. * For example, in {@link module:editor-classic/classiceditor~ClassicEditor} it is a `<div>` which
  6657. * wraps the editable element and the toolbar. In {@link module:editor-inline/inlineeditor~InlineEditor}
  6658. * it is the editable element itself (as there is no other wrapper). However, in
  6659. * {@link module:editor-decoupled/decouplededitor~DecoupledEditor} it is set to `null` because this editor does not
  6660. * come with a single "main" HTML element (its editable element and toolbar are separate).
  6661. *
  6662. * This property can be understood as a shorthand for retrieving the element that a specific editor integration
  6663. * considers to be its main DOM element.
  6664. *
  6665. * @readonly
  6666. * @member {HTMLElement|null} #element
  6667. */
  6668. get element() {
  6669. return null;
  6670. }
  6671. /**
  6672. * Fires the {@link module:core/editor/editorui~EditorUI#event:update `update`} event.
  6673. *
  6674. * This method should be called when the editor UI (e.g. positions of its balloons) needs to be updated due to
  6675. * some environmental change which CKEditor 5 is not aware of (e.g. resize of a container in which it is used).
  6676. */
  6677. update() {
  6678. this.fire( 'update' );
  6679. }
  6680. /**
  6681. * Destroys the UI.
  6682. */
  6683. destroy() {
  6684. this.stopListening();
  6685. this.focusTracker.destroy();
  6686. // Clean–up the references to the CKEditor instance stored in the native editable DOM elements.
  6687. for ( const domElement of this._editableElementsMap.values() ) {
  6688. domElement.ckeditorInstance = null;
  6689. }
  6690. this._editableElementsMap = new Map();
  6691. }
  6692. /**
  6693. * Store the native DOM editable element used by the editor under
  6694. * a unique name.
  6695. *
  6696. * @param {String} rootName The unique name of the editable element.
  6697. * @param {HTMLElement} domElement The native DOM editable element.
  6698. */
  6699. setEditableElement( rootName, domElement ) {
  6700. this._editableElementsMap.set( rootName, domElement );
  6701. // Put a reference to the CKEditor instance in the editable native DOM element.
  6702. // It helps 3rd–party software (browser extensions, other libraries) access and recognize
  6703. // CKEditor 5 instances (editing roots) and use their API (there is no global editor
  6704. // instance registry).
  6705. if ( !domElement.ckeditorInstance ) {
  6706. domElement.ckeditorInstance = this.editor;
  6707. }
  6708. }
  6709. /**
  6710. * Returns the editable editor element with the given name or null if editable does not exist.
  6711. *
  6712. * @param {String} [rootName=main] The editable name.
  6713. * @returns {HTMLElement|undefined}
  6714. */
  6715. getEditableElement( rootName = 'main' ) {
  6716. return this._editableElementsMap.get( rootName );
  6717. }
  6718. /**
  6719. * Returns array of names of all editor editable elements.
  6720. *
  6721. * @returns {Iterable.<String>}
  6722. */
  6723. getEditableElementsNames() {
  6724. return this._editableElementsMap.keys();
  6725. }
  6726. /**
  6727. * Stores all editable elements used by the editor instance.
  6728. *
  6729. * @protected
  6730. * @deprecated
  6731. * @member {Map.<String,HTMLElement>}
  6732. */
  6733. get _editableElements() {
  6734. /**
  6735. * The {@link module:core/editor/editorui~EditorUI#_editableElements `EditorUI#_editableElements`} property has been
  6736. * deprecated and will be removed in the near future. Please use {@link #setEditableElement `setEditableElement()`} and
  6737. * {@link #getEditableElement `getEditableElement()`} methods instead.
  6738. *
  6739. * @error editor-ui-deprecated-editable-elements
  6740. * @param {module:core/editor/editorui~EditorUI} editorUI Editor UI instance the deprecated property belongs to.
  6741. */
  6742. console.warn(
  6743. 'editor-ui-deprecated-editable-elements: ' +
  6744. 'The EditorUI#_editableElements property has been deprecated and will be removed in the near future.',
  6745. { editorUI: this } );
  6746. return this._editableElementsMap;
  6747. }
  6748. /**
  6749. * Fired when the editor UI is ready.
  6750. *
  6751. * Fired before {@link module:engine/controller/datacontroller~DataController#event:ready}.
  6752. *
  6753. * @event ready
  6754. */
  6755. /**
  6756. * Fired whenever the UI (all related components) should be refreshed.
  6757. *
  6758. * **Note:**: The event is fired after each {@link module:engine/view/document~Document#event:layoutChanged}.
  6759. * It can also be fired manually via the {@link module:core/editor/editorui~EditorUI#update} method.
  6760. *
  6761. * @event update
  6762. */
  6763. }
  6764. Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_3__["default"])( EditorUI, _ckeditor_ckeditor5_utils_src_emittermixin__WEBPACK_IMPORTED_MODULE_2__["default"] );
  6765. /***/ }),
  6766. /***/ "./node_modules/@ckeditor/ckeditor5-core/src/editor/utils/attachtoform.js":
  6767. /*!********************************************************************************!*\
  6768. !*** ./node_modules/@ckeditor/ckeditor5-core/src/editor/utils/attachtoform.js ***!
  6769. \********************************************************************************/
  6770. /*! exports provided: default */
  6771. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  6772. "use strict";
  6773. __webpack_require__.r(__webpack_exports__);
  6774. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return attachToForm; });
  6775. /* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash-es */ "./node_modules/lodash-es/lodash.js");
  6776. /* 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");
  6777. /**
  6778. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  6779. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  6780. */
  6781. /**
  6782. * @module core/editor/utils/attachtoform
  6783. */
  6784. /**
  6785. * Checks if the editor is initialized on a `<textarea>` element that belongs to a form. If yes, it updates the editor's element
  6786. * content before submitting the form.
  6787. *
  6788. * This helper requires the {@link module:core/editor/utils/elementapimixin~ElementApi ElementApi interface}.
  6789. *
  6790. * @param {module:core/editor/editor~Editor} editor Editor instance.
  6791. */
  6792. function attachToForm( editor ) {
  6793. if ( !Object(lodash_es__WEBPACK_IMPORTED_MODULE_0__["isFunction"])( editor.updateSourceElement ) ) {
  6794. /**
  6795. * The editor passed to `attachToForm()` must implement the
  6796. * {@link module:core/editor/utils/elementapimixin~ElementApi} interface.
  6797. *
  6798. * @error attachtoform-missing-elementapi-interface
  6799. */
  6800. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_1__["default"](
  6801. 'attachtoform-missing-elementapi-interface',
  6802. editor
  6803. );
  6804. }
  6805. const sourceElement = editor.sourceElement;
  6806. // Only when replacing a textarea which is inside of a form element.
  6807. if ( sourceElement && sourceElement.tagName.toLowerCase() === 'textarea' && sourceElement.form ) {
  6808. let originalSubmit;
  6809. const form = sourceElement.form;
  6810. const onSubmit = () => editor.updateSourceElement();
  6811. // Replace the original form#submit() to call a custom submit function first.
  6812. // Check if #submit is a function because the form might have an input named "submit".
  6813. if ( Object(lodash_es__WEBPACK_IMPORTED_MODULE_0__["isFunction"])( form.submit ) ) {
  6814. originalSubmit = form.submit;
  6815. form.submit = () => {
  6816. onSubmit();
  6817. originalSubmit.apply( form );
  6818. };
  6819. }
  6820. // Update the replaced textarea with data before each form#submit event.
  6821. form.addEventListener( 'submit', onSubmit );
  6822. // Remove the submit listener and revert the original submit method on
  6823. // editor#destroy.
  6824. editor.on( 'destroy', () => {
  6825. form.removeEventListener( 'submit', onSubmit );
  6826. if ( originalSubmit ) {
  6827. form.submit = originalSubmit;
  6828. }
  6829. } );
  6830. }
  6831. }
  6832. /***/ }),
  6833. /***/ "./node_modules/@ckeditor/ckeditor5-core/src/editor/utils/dataapimixin.js":
  6834. /*!********************************************************************************!*\
  6835. !*** ./node_modules/@ckeditor/ckeditor5-core/src/editor/utils/dataapimixin.js ***!
  6836. \********************************************************************************/
  6837. /*! exports provided: default */
  6838. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  6839. "use strict";
  6840. __webpack_require__.r(__webpack_exports__);
  6841. /**
  6842. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  6843. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  6844. */
  6845. /**
  6846. * @module core/editor/utils/dataapimixin
  6847. */
  6848. /**
  6849. * Implementation of the {@link module:core/editor/utils/dataapimixin~DataApi}.
  6850. *
  6851. * @mixin DataApiMixin
  6852. * @implements module:core/editor/utils/dataapimixin~DataApi
  6853. */
  6854. const DataApiMixin = {
  6855. /**
  6856. * @inheritDoc
  6857. */
  6858. setData( data ) {
  6859. this.data.set( data );
  6860. },
  6861. /**
  6862. * @inheritDoc
  6863. */
  6864. getData( options ) {
  6865. return this.data.get( options );
  6866. }
  6867. };
  6868. /* harmony default export */ __webpack_exports__["default"] = (DataApiMixin);
  6869. /**
  6870. * Interface defining editor methods for setting and getting data to and from the editor's main root element
  6871. * using the {@link module:core/editor/editor~Editor#data data pipeline}.
  6872. *
  6873. * This interface is not a part of the {@link module:core/editor/editor~Editor} class because one may want to implement
  6874. * an editor with multiple root elements, in which case the methods for setting and getting data will need to be implemented
  6875. * differently.
  6876. *
  6877. * @interface DataApi
  6878. */
  6879. /**
  6880. * Sets the data in the editor.
  6881. *
  6882. * editor.setData( '<p>This is editor!</p>' );
  6883. *
  6884. * By default the editor accepts HTML. This can be controlled by injecting a different data processor.
  6885. * See the {@glink features/markdown Markdown output} guide for more details.
  6886. *
  6887. * Note: Not only is the format of the data configurable, but the type of the `setData()`'s parameter does not
  6888. * have to be a string either. You can e.g. accept an object or a DOM `DocumentFragment` if you consider this
  6889. * the right format for you.
  6890. *
  6891. * @method #setData
  6892. * @param {String} data Input data.
  6893. */
  6894. /**
  6895. * Gets the data from the editor.
  6896. *
  6897. * editor.getData(); // -> '<p>This is editor!</p>'
  6898. *
  6899. * By default the editor outputs HTML. This can be controlled by injecting a different data processor.
  6900. * See the {@glink features/markdown Markdown output} guide for more details.
  6901. *
  6902. * Note: Not only is the format of the data configurable, but the type of the `getData()`'s return value does not
  6903. * have to be a string either. You can e.g. return an object or a DOM `DocumentFragment` if you consider this
  6904. * the right format for you.
  6905. *
  6906. * @method #getData
  6907. * @param {Object} [options] Additional configuration for the retrieved data.
  6908. * Editor features may introduce more configuration options that can be set through this parameter.
  6909. * @param {String} [options.rootName='main'] Root name.
  6910. * @param {String} [options.trim='empty'] Whether returned data should be trimmed. This option is set to `'empty'` by default,
  6911. * which means that whenever editor content is considered empty, an empty string is returned. To turn off trimming
  6912. * use `'none'`. In such cases exact content will be returned (for example `'<p>&nbsp;</p>'` for an empty editor).
  6913. * @returns {String} Output data.
  6914. */
  6915. /***/ }),
  6916. /***/ "./node_modules/@ckeditor/ckeditor5-core/src/editor/utils/elementapimixin.js":
  6917. /*!***********************************************************************************!*\
  6918. !*** ./node_modules/@ckeditor/ckeditor5-core/src/editor/utils/elementapimixin.js ***!
  6919. \***********************************************************************************/
  6920. /*! exports provided: default */
  6921. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  6922. "use strict";
  6923. __webpack_require__.r(__webpack_exports__);
  6924. /* 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");
  6925. /* 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");
  6926. /**
  6927. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  6928. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  6929. */
  6930. /**
  6931. * @module core/editor/utils/elementapimixin
  6932. */
  6933. /**
  6934. * Implementation of the {@link module:core/editor/utils/elementapimixin~ElementApi}.
  6935. *
  6936. * @mixin ElementApiMixin
  6937. * @implements module:core/editor/utils/elementapimixin~ElementApi
  6938. */
  6939. const ElementApiMixin = {
  6940. /**
  6941. * @inheritDoc
  6942. */
  6943. updateSourceElement() {
  6944. if ( !this.sourceElement ) {
  6945. /**
  6946. * Cannot update the source element of a detached editor.
  6947. *
  6948. * The {@link ~ElementApi#updateSourceElement `updateSourceElement()`} method cannot be called if you did not
  6949. * pass an element to `Editor.create()`.
  6950. *
  6951. * @error editor-missing-sourceelement
  6952. */
  6953. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"](
  6954. 'editor-missing-sourceelement',
  6955. this
  6956. );
  6957. }
  6958. Object(_ckeditor_ckeditor5_utils_src_dom_setdatainelement__WEBPACK_IMPORTED_MODULE_1__["default"])( this.sourceElement, this.data.get() );
  6959. }
  6960. };
  6961. /* harmony default export */ __webpack_exports__["default"] = (ElementApiMixin);
  6962. /**
  6963. * Interface describing an editor that replaced a DOM element (was "initialized on an element").
  6964. *
  6965. * Such an editor should provide a method to
  6966. * {@link module:core/editor/utils/elementapimixin~ElementApi#updateSourceElement update the replaced element with the current data}.
  6967. *
  6968. * @interface ElementApi
  6969. */
  6970. /**
  6971. * The element on which the editor has been initialized.
  6972. *
  6973. * @readonly
  6974. * @member {HTMLElement} #sourceElement
  6975. */
  6976. /**
  6977. * Updates the {@link #sourceElement editor source element}'s content with the data.
  6978. *
  6979. * @method #updateSourceElement
  6980. */
  6981. /***/ }),
  6982. /***/ "./node_modules/@ckeditor/ckeditor5-core/src/editor/utils/securesourceelement.js":
  6983. /*!***************************************************************************************!*\
  6984. !*** ./node_modules/@ckeditor/ckeditor5-core/src/editor/utils/securesourceelement.js ***!
  6985. \***************************************************************************************/
  6986. /*! exports provided: default */
  6987. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  6988. "use strict";
  6989. __webpack_require__.r(__webpack_exports__);
  6990. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return secureSourceElement; });
  6991. /* 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");
  6992. /**
  6993. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  6994. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  6995. */
  6996. /**
  6997. * @module core/editor/utils/securesourceelement
  6998. */
  6999. /**
  7000. * Marks the source element on which the editor was initialized. This prevents other editor instances from using this element.
  7001. *
  7002. * Running multiple editor instances on the same source element causes various issues and it is
  7003. * crucial this helper is called as soon as the source element is known to prevent collisions.
  7004. *
  7005. * @param {module:core/editor/editor~Editor} editor Editor instance.
  7006. */
  7007. function secureSourceElement( editor ) {
  7008. const sourceElement = editor.sourceElement;
  7009. // If the editor was initialized without specifying an element, we don't need to secure anything.
  7010. if ( !sourceElement ) {
  7011. return;
  7012. }
  7013. if ( sourceElement.ckeditorInstance ) {
  7014. /**
  7015. * A DOM element used to create the editor (e.g.
  7016. * {@link module:editor-inline/inlineeditor~InlineEditor.create `InlineEditor.create()`})
  7017. * has already been used to create another editor instance. Make sure each editor is
  7018. * created with an unique DOM element.
  7019. *
  7020. * @error editor-source-element-already-used
  7021. * @param {HTMLElement} element DOM element that caused the collision.
  7022. */
  7023. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"](
  7024. 'editor-source-element-already-used',
  7025. editor
  7026. );
  7027. }
  7028. sourceElement.ckeditorInstance = editor;
  7029. editor.once( 'destroy', () => {
  7030. delete sourceElement.ckeditorInstance;
  7031. } );
  7032. }
  7033. /***/ }),
  7034. /***/ "./node_modules/@ckeditor/ckeditor5-core/src/index.js":
  7035. /*!************************************************************!*\
  7036. !*** ./node_modules/@ckeditor/ckeditor5-core/src/index.js ***!
  7037. \************************************************************/
  7038. /*! exports provided: Plugin, Command, MultiCommand, Context, ContextPlugin, Editor, EditorUI, attachToForm, DataApiMixin, ElementApiMixin, secureSourceElement, PendingActions, icons */
  7039. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7040. "use strict";
  7041. __webpack_require__.r(__webpack_exports__);
  7042. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "icons", function() { return icons; });
  7043. /* harmony import */ var _plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
  7044. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Plugin", function() { return _plugin__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  7045. /* harmony import */ var _command__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./command */ "./node_modules/@ckeditor/ckeditor5-core/src/command.js");
  7046. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Command", function() { return _command__WEBPACK_IMPORTED_MODULE_1__["default"]; });
  7047. /* harmony import */ var _multicommand__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./multicommand */ "./node_modules/@ckeditor/ckeditor5-core/src/multicommand.js");
  7048. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MultiCommand", function() { return _multicommand__WEBPACK_IMPORTED_MODULE_2__["default"]; });
  7049. /* harmony import */ var _context__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./context */ "./node_modules/@ckeditor/ckeditor5-core/src/context.js");
  7050. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Context", function() { return _context__WEBPACK_IMPORTED_MODULE_3__["default"]; });
  7051. /* harmony import */ var _contextplugin__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./contextplugin */ "./node_modules/@ckeditor/ckeditor5-core/src/contextplugin.js");
  7052. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ContextPlugin", function() { return _contextplugin__WEBPACK_IMPORTED_MODULE_4__["default"]; });
  7053. /* harmony import */ var _editor_editor__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./editor/editor */ "./node_modules/@ckeditor/ckeditor5-core/src/editor/editor.js");
  7054. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Editor", function() { return _editor_editor__WEBPACK_IMPORTED_MODULE_5__["default"]; });
  7055. /* harmony import */ var _editor_editorui__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./editor/editorui */ "./node_modules/@ckeditor/ckeditor5-core/src/editor/editorui.js");
  7056. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "EditorUI", function() { return _editor_editorui__WEBPACK_IMPORTED_MODULE_6__["default"]; });
  7057. /* harmony import */ var _editor_utils_attachtoform__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./editor/utils/attachtoform */ "./node_modules/@ckeditor/ckeditor5-core/src/editor/utils/attachtoform.js");
  7058. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "attachToForm", function() { return _editor_utils_attachtoform__WEBPACK_IMPORTED_MODULE_7__["default"]; });
  7059. /* harmony import */ var _editor_utils_dataapimixin__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./editor/utils/dataapimixin */ "./node_modules/@ckeditor/ckeditor5-core/src/editor/utils/dataapimixin.js");
  7060. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DataApiMixin", function() { return _editor_utils_dataapimixin__WEBPACK_IMPORTED_MODULE_8__["default"]; });
  7061. /* harmony import */ var _editor_utils_elementapimixin__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./editor/utils/elementapimixin */ "./node_modules/@ckeditor/ckeditor5-core/src/editor/utils/elementapimixin.js");
  7062. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ElementApiMixin", function() { return _editor_utils_elementapimixin__WEBPACK_IMPORTED_MODULE_9__["default"]; });
  7063. /* harmony import */ var _editor_utils_securesourceelement__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./editor/utils/securesourceelement */ "./node_modules/@ckeditor/ckeditor5-core/src/editor/utils/securesourceelement.js");
  7064. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "secureSourceElement", function() { return _editor_utils_securesourceelement__WEBPACK_IMPORTED_MODULE_10__["default"]; });
  7065. /* harmony import */ var _pendingactions__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./pendingactions */ "./node_modules/@ckeditor/ckeditor5-core/src/pendingactions.js");
  7066. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PendingActions", function() { return _pendingactions__WEBPACK_IMPORTED_MODULE_11__["default"]; });
  7067. /* harmony import */ var _theme_icons_cancel_svg__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./../theme/icons/cancel.svg */ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/cancel.svg");
  7068. /* harmony import */ var _theme_icons_caption_svg__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./../theme/icons/caption.svg */ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/caption.svg");
  7069. /* harmony import */ var _theme_icons_check_svg__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./../theme/icons/check.svg */ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/check.svg");
  7070. /* harmony import */ var _theme_icons_eraser_svg__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./../theme/icons/eraser.svg */ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/eraser.svg");
  7071. /* harmony import */ var _theme_icons_low_vision_svg__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./../theme/icons/low-vision.svg */ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/low-vision.svg");
  7072. /* harmony import */ var _theme_icons_image_svg__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./../theme/icons/image.svg */ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/image.svg");
  7073. /* harmony import */ var _theme_icons_align_bottom_svg__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./../theme/icons/align-bottom.svg */ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/align-bottom.svg");
  7074. /* harmony import */ var _theme_icons_align_middle_svg__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./../theme/icons/align-middle.svg */ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/align-middle.svg");
  7075. /* harmony import */ var _theme_icons_align_top_svg__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./../theme/icons/align-top.svg */ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/align-top.svg");
  7076. /* harmony import */ var _theme_icons_align_left_svg__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./../theme/icons/align-left.svg */ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/align-left.svg");
  7077. /* harmony import */ var _theme_icons_align_center_svg__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./../theme/icons/align-center.svg */ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/align-center.svg");
  7078. /* harmony import */ var _theme_icons_align_right_svg__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./../theme/icons/align-right.svg */ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/align-right.svg");
  7079. /* harmony import */ var _theme_icons_align_justify_svg__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./../theme/icons/align-justify.svg */ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/align-justify.svg");
  7080. /* harmony import */ var _theme_icons_object_left_svg__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./../theme/icons/object-left.svg */ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/object-left.svg");
  7081. /* harmony import */ var _theme_icons_object_center_svg__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./../theme/icons/object-center.svg */ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/object-center.svg");
  7082. /* harmony import */ var _theme_icons_object_right_svg__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./../theme/icons/object-right.svg */ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/object-right.svg");
  7083. /* harmony import */ var _theme_icons_object_full_width_svg__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./../theme/icons/object-full-width.svg */ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/object-full-width.svg");
  7084. /* harmony import */ var _theme_icons_object_size_full_svg__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./../theme/icons/object-size-full.svg */ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/object-size-full.svg");
  7085. /* harmony import */ var _theme_icons_object_size_large_svg__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./../theme/icons/object-size-large.svg */ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/object-size-large.svg");
  7086. /* harmony import */ var _theme_icons_object_size_small_svg__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ./../theme/icons/object-size-small.svg */ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/object-size-small.svg");
  7087. /* harmony import */ var _theme_icons_object_size_medium_svg__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ./../theme/icons/object-size-medium.svg */ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/object-size-medium.svg");
  7088. /* harmony import */ var _theme_icons_pencil_svg__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ./../theme/icons/pencil.svg */ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/pencil.svg");
  7089. /* harmony import */ var _theme_icons_pilcrow_svg__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ./../theme/icons/pilcrow.svg */ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/pilcrow.svg");
  7090. /* harmony import */ var _theme_icons_quote_svg__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ./../theme/icons/quote.svg */ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/quote.svg");
  7091. /* harmony import */ var _theme_icons_three_vertical_dots_svg__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! ./../theme/icons/three-vertical-dots.svg */ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/three-vertical-dots.svg");
  7092. /**
  7093. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  7094. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  7095. */
  7096. /**
  7097. * @module core
  7098. */
  7099. const icons = {
  7100. cancel: _theme_icons_cancel_svg__WEBPACK_IMPORTED_MODULE_12__["default"],
  7101. caption: _theme_icons_caption_svg__WEBPACK_IMPORTED_MODULE_13__["default"],
  7102. check: _theme_icons_check_svg__WEBPACK_IMPORTED_MODULE_14__["default"],
  7103. eraser: _theme_icons_eraser_svg__WEBPACK_IMPORTED_MODULE_15__["default"],
  7104. lowVision: _theme_icons_low_vision_svg__WEBPACK_IMPORTED_MODULE_16__["default"],
  7105. image: _theme_icons_image_svg__WEBPACK_IMPORTED_MODULE_17__["default"],
  7106. alignBottom: _theme_icons_align_bottom_svg__WEBPACK_IMPORTED_MODULE_18__["default"],
  7107. alignMiddle: _theme_icons_align_middle_svg__WEBPACK_IMPORTED_MODULE_19__["default"],
  7108. alignTop: _theme_icons_align_top_svg__WEBPACK_IMPORTED_MODULE_20__["default"],
  7109. alignLeft: _theme_icons_align_left_svg__WEBPACK_IMPORTED_MODULE_21__["default"],
  7110. alignCenter: _theme_icons_align_center_svg__WEBPACK_IMPORTED_MODULE_22__["default"],
  7111. alignRight: _theme_icons_align_right_svg__WEBPACK_IMPORTED_MODULE_23__["default"],
  7112. alignJustify: _theme_icons_align_justify_svg__WEBPACK_IMPORTED_MODULE_24__["default"],
  7113. objectLeft: _theme_icons_object_left_svg__WEBPACK_IMPORTED_MODULE_25__["default"],
  7114. objectCenter: _theme_icons_object_center_svg__WEBPACK_IMPORTED_MODULE_26__["default"],
  7115. objectRight: _theme_icons_object_right_svg__WEBPACK_IMPORTED_MODULE_27__["default"],
  7116. objectFullWidth: _theme_icons_object_full_width_svg__WEBPACK_IMPORTED_MODULE_28__["default"],
  7117. objectSizeFull: _theme_icons_object_size_full_svg__WEBPACK_IMPORTED_MODULE_29__["default"],
  7118. objectSizeLarge: _theme_icons_object_size_large_svg__WEBPACK_IMPORTED_MODULE_30__["default"],
  7119. objectSizeSmall: _theme_icons_object_size_small_svg__WEBPACK_IMPORTED_MODULE_31__["default"],
  7120. objectSizeMedium: _theme_icons_object_size_medium_svg__WEBPACK_IMPORTED_MODULE_32__["default"],
  7121. pencil: _theme_icons_pencil_svg__WEBPACK_IMPORTED_MODULE_33__["default"],
  7122. pilcrow: _theme_icons_pilcrow_svg__WEBPACK_IMPORTED_MODULE_34__["default"],
  7123. quote: _theme_icons_quote_svg__WEBPACK_IMPORTED_MODULE_35__["default"],
  7124. threeVerticalDots: _theme_icons_three_vertical_dots_svg__WEBPACK_IMPORTED_MODULE_36__["default"]
  7125. };
  7126. /***/ }),
  7127. /***/ "./node_modules/@ckeditor/ckeditor5-core/src/multicommand.js":
  7128. /*!*******************************************************************!*\
  7129. !*** ./node_modules/@ckeditor/ckeditor5-core/src/multicommand.js ***!
  7130. \*******************************************************************/
  7131. /*! exports provided: default */
  7132. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7133. "use strict";
  7134. __webpack_require__.r(__webpack_exports__);
  7135. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return MultiCommand; });
  7136. /* harmony import */ var _command__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./command */ "./node_modules/@ckeditor/ckeditor5-core/src/command.js");
  7137. /**
  7138. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  7139. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  7140. */
  7141. /**
  7142. * @module core/multicommand
  7143. */
  7144. /**
  7145. * A CKEditor command that aggregates other commands.
  7146. *
  7147. * This command is used to proxy multiple commands. The multi-command is enabled when
  7148. * at least one of its registered child commands is enabled.
  7149. * When executing a multi-command the first command that is enabled will be executed.
  7150. *
  7151. * const multiCommand = new MultiCommand( editor );
  7152. *
  7153. * const commandFoo = new Command( editor );
  7154. * const commandBar = new Command( editor );
  7155. *
  7156. * // Register child commands.
  7157. * multiCommand.registerChildCommand( commandFoo );
  7158. * multiCommand.registerChildCommand( commandBar );
  7159. *
  7160. * // Enable one of the commands.
  7161. * commandBar.isEnabled = true;
  7162. *
  7163. * multiCommand.execute(); // Will execute commandBar.
  7164. *
  7165. * @extends module:core/command~Command
  7166. */
  7167. class MultiCommand extends _command__WEBPACK_IMPORTED_MODULE_0__["default"] {
  7168. /**
  7169. * @inheritDoc
  7170. */
  7171. constructor( editor ) {
  7172. super( editor );
  7173. /**
  7174. * Registered child commands.
  7175. *
  7176. * @type {Array.<module:core/command~Command>}
  7177. * @private
  7178. */
  7179. this._childCommands = [];
  7180. }
  7181. /**
  7182. * @inheritDoc
  7183. */
  7184. refresh() {
  7185. // Override base command refresh(): the command's state is changed when one of child commands changes states.
  7186. }
  7187. /**
  7188. * Executes the first of it registered child commands.
  7189. *
  7190. * @returns {*} The value returned by the {@link module:core/command~Command#execute `command.execute()`}.
  7191. */
  7192. execute( ...args ) {
  7193. const command = this._getFirstEnabledCommand();
  7194. return command != null && command.execute( args );
  7195. }
  7196. /**
  7197. * Registers a child command.
  7198. *
  7199. * @param {module:core/command~Command} command
  7200. */
  7201. registerChildCommand( command ) {
  7202. this._childCommands.push( command );
  7203. // Change multi command enabled state when one of registered commands changes state.
  7204. command.on( 'change:isEnabled', () => this._checkEnabled() );
  7205. this._checkEnabled();
  7206. }
  7207. /**
  7208. * Checks if any of child commands is enabled.
  7209. *
  7210. * @private
  7211. */
  7212. _checkEnabled() {
  7213. this.isEnabled = !!this._getFirstEnabledCommand();
  7214. }
  7215. /**
  7216. * Returns a first enabled command or undefined if none of them is enabled.
  7217. *
  7218. * @returns {module:core/command~Command|undefined}
  7219. * @private
  7220. */
  7221. _getFirstEnabledCommand() {
  7222. return this._childCommands.find( command => command.isEnabled );
  7223. }
  7224. }
  7225. /***/ }),
  7226. /***/ "./node_modules/@ckeditor/ckeditor5-core/src/pendingactions.js":
  7227. /*!*********************************************************************!*\
  7228. !*** ./node_modules/@ckeditor/ckeditor5-core/src/pendingactions.js ***!
  7229. \*********************************************************************/
  7230. /*! exports provided: default */
  7231. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7232. "use strict";
  7233. __webpack_require__.r(__webpack_exports__);
  7234. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return PendingActions; });
  7235. /* harmony import */ var _contextplugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./contextplugin */ "./node_modules/@ckeditor/ckeditor5-core/src/contextplugin.js");
  7236. /* 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");
  7237. /* 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");
  7238. /* 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");
  7239. /**
  7240. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  7241. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  7242. */
  7243. /**
  7244. * @module core/pendingactions
  7245. */
  7246. /**
  7247. * The list of pending editor actions.
  7248. *
  7249. * This plugin should be used to synchronise plugins that execute long-lasting actions
  7250. * (e.g. file upload) with the editor integration. It gives the developer who integrates the editor
  7251. * an easy way to check if there are any actions pending whenever such information is needed.
  7252. * All plugins that register a pending action also provide a message about the action that is ongoing
  7253. * which can be displayed to the user. This lets them decide if they want to interrupt the action or wait.
  7254. *
  7255. * Adding and updating a pending action:
  7256. *
  7257. * const pendingActions = editor.plugins.get( 'PendingActions' );
  7258. * const action = pendingActions.add( 'Upload in progress: 0%.' );
  7259. *
  7260. * // You can update the message:
  7261. * action.message = 'Upload in progress: 10%.';
  7262. *
  7263. * Removing a pending action:
  7264. *
  7265. * const pendingActions = editor.plugins.get( 'PendingActions' );
  7266. * const action = pendingActions.add( 'Unsaved changes.' );
  7267. *
  7268. * pendingActions.remove( action );
  7269. *
  7270. * Getting pending actions:
  7271. *
  7272. * const pendingActions = editor.plugins.get( 'PendingActions' );
  7273. *
  7274. * const action1 = pendingActions.add( 'Action 1' );
  7275. * const action2 = pendingActions.add( 'Action 2' );
  7276. *
  7277. * pendingActions.first; // Returns action1
  7278. * Array.from( pendingActions ); // Returns [ action1, action2 ]
  7279. *
  7280. * This plugin is used by features like {@link module:upload/filerepository~FileRepository} to register their ongoing actions
  7281. * and by features like {@link module:autosave/autosave~Autosave} to detect whether there are any ongoing actions.
  7282. * Read more about saving the data in the {@glink builds/guides/integration/saving-data Saving and getting data} guide.
  7283. *
  7284. * @extends module:core/contextplugin~ContextPlugin
  7285. */
  7286. class PendingActions extends _contextplugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
  7287. /**
  7288. * @inheritDoc
  7289. */
  7290. static get pluginName() {
  7291. return 'PendingActions';
  7292. }
  7293. /**
  7294. * @inheritDoc
  7295. */
  7296. init() {
  7297. /**
  7298. * Defines whether there is any registered pending action.
  7299. *
  7300. * @readonly
  7301. * @observable
  7302. * @member {Boolean} #hasAny
  7303. */
  7304. this.set( 'hasAny', false );
  7305. /**
  7306. * A list of pending actions.
  7307. *
  7308. * @private
  7309. * @type {module:utils/collection~Collection}
  7310. */
  7311. this._actions = new _ckeditor_ckeditor5_utils_src_collection__WEBPACK_IMPORTED_MODULE_2__["default"]( { idProperty: '_id' } );
  7312. this._actions.delegate( 'add', 'remove' ).to( this );
  7313. }
  7314. /**
  7315. * Adds an action to the list of pending actions.
  7316. *
  7317. * This method returns an action object with an observable message property.
  7318. * The action object can be later used in the {@link #remove} method. It also allows you to change the message.
  7319. *
  7320. * @param {String} message The action message.
  7321. * @returns {Object} An observable object that represents a pending action.
  7322. */
  7323. add( message ) {
  7324. if ( typeof message !== 'string' ) {
  7325. /**
  7326. * The message must be a string.
  7327. *
  7328. * @error pendingactions-add-invalid-message
  7329. */
  7330. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_3__["default"]( 'pendingactions-add-invalid-message', this );
  7331. }
  7332. const action = Object.create( _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_1__["default"] );
  7333. action.set( 'message', message );
  7334. this._actions.add( action );
  7335. this.hasAny = true;
  7336. return action;
  7337. }
  7338. /**
  7339. * Removes an action from the list of pending actions.
  7340. *
  7341. * @param {Object} action An action object.
  7342. */
  7343. remove( action ) {
  7344. this._actions.remove( action );
  7345. this.hasAny = !!this._actions.length;
  7346. }
  7347. /**
  7348. * Returns the first action from the list or null when list is empty
  7349. *
  7350. * returns {Object|null} The pending action object.
  7351. */
  7352. get first() {
  7353. return this._actions.get( 0 );
  7354. }
  7355. /**
  7356. * Iterable interface.
  7357. *
  7358. * @returns {Iterable.<*>}
  7359. */
  7360. [ Symbol.iterator ]() {
  7361. return this._actions[ Symbol.iterator ]();
  7362. }
  7363. /**
  7364. * Fired when an action is added to the list.
  7365. *
  7366. * @event add
  7367. * @param {Object} action The added action.
  7368. */
  7369. /**
  7370. * Fired when an action is removed from the list.
  7371. *
  7372. * @event remove
  7373. * @param {Object} action The removed action.
  7374. */
  7375. }
  7376. /***/ }),
  7377. /***/ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js":
  7378. /*!*************************************************************!*\
  7379. !*** ./node_modules/@ckeditor/ckeditor5-core/src/plugin.js ***!
  7380. \*************************************************************/
  7381. /*! exports provided: default */
  7382. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7383. "use strict";
  7384. __webpack_require__.r(__webpack_exports__);
  7385. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Plugin; });
  7386. /* 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");
  7387. /* 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");
  7388. /**
  7389. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  7390. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  7391. */
  7392. /**
  7393. * @module core/plugin
  7394. */
  7395. /**
  7396. * The base class for CKEditor plugin classes.
  7397. *
  7398. * @implements module:core/plugin~PluginInterface
  7399. * @mixes module:utils/observablemixin~ObservableMixin
  7400. */
  7401. class Plugin {
  7402. /**
  7403. * @inheritDoc
  7404. */
  7405. constructor( editor ) {
  7406. /**
  7407. * The editor instance.
  7408. *
  7409. * Note that most editors implement the {@link module:core/editor/editorwithui~EditorWithUI} interface in addition
  7410. * to the base {@link module:core/editor/editor~Editor} interface. However, editors with an external UI
  7411. * (i.e. Bootstrap-based) or a headless editor may not implement the {@link module:core/editor/editorwithui~EditorWithUI}
  7412. * interface.
  7413. *
  7414. * Because of above, to make plugins more universal, it is recommended to split features into:
  7415. * - The "editing" part that only uses the {@link module:core/editor/editor~Editor} interface.
  7416. * - The "UI" part that uses both the {@link module:core/editor/editor~Editor} interface and
  7417. * the {@link module:core/editor/editorwithui~EditorWithUI} interface.
  7418. *
  7419. * @readonly
  7420. * @member {module:core/editor/editor~Editor} #editor
  7421. */
  7422. this.editor = editor;
  7423. /**
  7424. * Flag indicating whether a plugin is enabled or disabled.
  7425. * A disabled plugin will not transform text.
  7426. *
  7427. * Plugin can be simply disabled like that:
  7428. *
  7429. * // Disable the plugin so that no toolbars are visible.
  7430. * editor.plugins.get( 'TextTransformation' ).isEnabled = false;
  7431. *
  7432. * You can also use {@link #forceDisabled} method.
  7433. *
  7434. * @observable
  7435. * @readonly
  7436. * @member {Boolean} #isEnabled
  7437. */
  7438. this.set( 'isEnabled', true );
  7439. /**
  7440. * Holds identifiers for {@link #forceDisabled} mechanism.
  7441. *
  7442. * @type {Set.<String>}
  7443. * @private
  7444. */
  7445. this._disableStack = new Set();
  7446. }
  7447. /**
  7448. * Disables the plugin.
  7449. *
  7450. * Plugin may be disabled by multiple features or algorithms (at once). When disabling a plugin, unique id should be passed
  7451. * (e.g. feature name). The same identifier should be used when {@link #clearForceDisabled enabling back} the plugin.
  7452. * The plugin becomes enabled only after all features {@link #clearForceDisabled enabled it back}.
  7453. *
  7454. * Disabling and enabling a plugin:
  7455. *
  7456. * plugin.isEnabled; // -> true
  7457. * plugin.forceDisabled( 'MyFeature' );
  7458. * plugin.isEnabled; // -> false
  7459. * plugin.clearForceDisabled( 'MyFeature' );
  7460. * plugin.isEnabled; // -> true
  7461. *
  7462. * Plugin disabled by multiple features:
  7463. *
  7464. * plugin.forceDisabled( 'MyFeature' );
  7465. * plugin.forceDisabled( 'OtherFeature' );
  7466. * plugin.clearForceDisabled( 'MyFeature' );
  7467. * plugin.isEnabled; // -> false
  7468. * plugin.clearForceDisabled( 'OtherFeature' );
  7469. * plugin.isEnabled; // -> true
  7470. *
  7471. * Multiple disabling with the same identifier is redundant:
  7472. *
  7473. * plugin.forceDisabled( 'MyFeature' );
  7474. * plugin.forceDisabled( 'MyFeature' );
  7475. * plugin.clearForceDisabled( 'MyFeature' );
  7476. * plugin.isEnabled; // -> true
  7477. *
  7478. * **Note:** some plugins or algorithms may have more complex logic when it comes to enabling or disabling certain plugins,
  7479. * so the plugin might be still disabled after {@link #clearForceDisabled} was used.
  7480. *
  7481. * @param {String} id Unique identifier for disabling. Use the same id when {@link #clearForceDisabled enabling back} the plugin.
  7482. */
  7483. forceDisabled( id ) {
  7484. this._disableStack.add( id );
  7485. if ( this._disableStack.size == 1 ) {
  7486. this.on( 'set:isEnabled', forceDisable, { priority: 'highest' } );
  7487. this.isEnabled = false;
  7488. }
  7489. }
  7490. /**
  7491. * Clears forced disable previously set through {@link #forceDisabled}. See {@link #forceDisabled}.
  7492. *
  7493. * @param {String} id Unique identifier, equal to the one passed in {@link #forceDisabled} call.
  7494. */
  7495. clearForceDisabled( id ) {
  7496. this._disableStack.delete( id );
  7497. if ( this._disableStack.size == 0 ) {
  7498. this.off( 'set:isEnabled', forceDisable );
  7499. this.isEnabled = true;
  7500. }
  7501. }
  7502. /**
  7503. * @inheritDoc
  7504. */
  7505. destroy() {
  7506. this.stopListening();
  7507. }
  7508. /**
  7509. * @inheritDoc
  7510. */
  7511. static get isContextPlugin() {
  7512. return false;
  7513. }
  7514. }
  7515. Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_1__["default"])( Plugin, _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_0__["default"] );
  7516. /**
  7517. * The base interface for CKEditor plugins.
  7518. *
  7519. * In its minimal form a plugin can be a simple function that accepts {@link module:core/editor/editor~Editor the editor}
  7520. * as a parameter:
  7521. *
  7522. * // A simple plugin that enables a data processor.
  7523. * function MyPlugin( editor ) {
  7524. * editor.data.processor = new MyDataProcessor();
  7525. * }
  7526. *
  7527. * In most cases however, you will want to inherit from the {@link module:core/plugin~Plugin} class which implements the
  7528. * {@link module:utils/observablemixin~ObservableMixin} and is, therefore, more convenient:
  7529. *
  7530. * class MyPlugin extends Plugin {
  7531. * init() {
  7532. * // `listenTo()` and `editor` are available thanks to `Plugin`.
  7533. * // By using `listenTo()` you will ensure that the listener is removed when
  7534. * // the plugin is destroyed.
  7535. * this.listenTo( this.editor.data, 'ready', () => {
  7536. * // Do something when the data is ready.
  7537. * } );
  7538. * }
  7539. * }
  7540. *
  7541. * The plugin can also implement methods (e.g. {@link module:core/plugin~PluginInterface#init `init()`} or
  7542. * {@link module:core/plugin~PluginInterface#destroy `destroy()`}) which, when present, will be used to properly
  7543. * initialize and destroy the plugin.
  7544. *
  7545. * **Note:** When defined as a plain function, the plugin acts as a constructor and will be
  7546. * called in parallel with other plugins' {@link module:core/plugin~PluginInterface#constructor constructors}.
  7547. * This means the code of that plugin will be executed **before** {@link module:core/plugin~PluginInterface#init `init()`} and
  7548. * {@link module:core/plugin~PluginInterface#afterInit `afterInit()`} methods of other plugins and, for instance,
  7549. * you cannot use it to extend other plugins' {@glink framework/guides/architecture/editing-engine#schema schema}
  7550. * rules as they are defined later on during the `init()` stage.
  7551. *
  7552. * @interface PluginInterface
  7553. */
  7554. /**
  7555. * Creates a new plugin instance. This is the first step of the plugin initialization.
  7556. * See also {@link #init} and {@link #afterInit}.
  7557. *
  7558. * A plugin is always instantiated after its {@link module:core/plugin~PluginInterface.requires dependencies} and the
  7559. * {@link #init} and {@link #afterInit} methods are called in the same order.
  7560. *
  7561. * Usually, you will want to put your plugin's initialization code in the {@link #init} method.
  7562. * The constructor can be understood as "before init" and used in special cases, just like
  7563. * {@link #afterInit} serves the special "after init" scenarios (e.g.the code which depends on other
  7564. * plugins, but which does not {@link module:core/plugin~PluginInterface.requires explicitly require} them).
  7565. *
  7566. * @method #constructor
  7567. * @param {module:core/editor/editor~Editor} editor
  7568. */
  7569. /**
  7570. * An array of plugins required by this plugin.
  7571. *
  7572. * To keep the plugin class definition tight it is recommended to define this property as a static getter:
  7573. *
  7574. * import Image from './image.js';
  7575. *
  7576. * export default class ImageCaption {
  7577. * static get requires() {
  7578. * return [ Image ];
  7579. * }
  7580. * }
  7581. *
  7582. * @static
  7583. * @readonly
  7584. * @member {Array.<Function>|undefined} module:core/plugin~PluginInterface.requires
  7585. */
  7586. /**
  7587. * An optional name of the plugin. If set, the plugin will be available in
  7588. * {@link module:core/plugincollection~PluginCollection#get} by its
  7589. * name and its constructor. If not, then only by its constructor.
  7590. *
  7591. * The name should reflect the constructor name.
  7592. *
  7593. * To keep the plugin class definition tight, it is recommended to define this property as a static getter:
  7594. *
  7595. * export default class ImageCaption {
  7596. * static get pluginName() {
  7597. * return 'ImageCaption';
  7598. * }
  7599. * }
  7600. *
  7601. * Note: The native `Function.name` property could not be used to keep the plugin name because
  7602. * it will be mangled during code minification.
  7603. *
  7604. * Naming a plugin is necessary to enable removing it through the
  7605. * {@link module:core/editor/editorconfig~EditorConfig#removePlugins `config.removePlugins`} option.
  7606. *
  7607. * @static
  7608. * @readonly
  7609. * @member {String|undefined} module:core/plugin~PluginInterface.pluginName
  7610. */
  7611. /**
  7612. * The second stage (after plugin {@link #constructor}) of the plugin initialization.
  7613. * Unlike the plugin constructor this method can be asynchronous.
  7614. *
  7615. * A plugin's `init()` method is called after its {@link module:core/plugin~PluginInterface.requires dependencies} are initialized,
  7616. * so in the same order as the constructors of these plugins.
  7617. *
  7618. * **Note:** This method is optional. A plugin instance does not need to have it defined.
  7619. *
  7620. * @method #init
  7621. * @returns {null|Promise}
  7622. */
  7623. /**
  7624. * The third (and last) stage of the plugin initialization. See also {@link #constructor} and {@link #init}.
  7625. *
  7626. * **Note:** This method is optional. A plugin instance does not need to have it defined.
  7627. *
  7628. * @method #afterInit
  7629. * @returns {null|Promise}
  7630. */
  7631. /**
  7632. * Destroys the plugin.
  7633. *
  7634. * **Note:** This method is optional. A plugin instance does not need to have it defined.
  7635. *
  7636. * @method #destroy
  7637. * @returns {null|Promise}
  7638. */
  7639. /**
  7640. * A flag which defines if a plugin is allowed or not allowed to be used directly by a {@link module:core/context~Context}.
  7641. *
  7642. * @static
  7643. * @readonly
  7644. * @member {Boolean} module:core/plugin~PluginInterface.isContextPlugin
  7645. */
  7646. /**
  7647. * An array of loaded plugins.
  7648. *
  7649. * @typedef {Array.<module:core/plugin~PluginInterface>} module:core/plugin~LoadedPlugins
  7650. */
  7651. // Helper function that forces plugin to be disabled.
  7652. function forceDisable( evt ) {
  7653. evt.return = false;
  7654. evt.stop();
  7655. }
  7656. /***/ }),
  7657. /***/ "./node_modules/@ckeditor/ckeditor5-core/src/plugincollection.js":
  7658. /*!***********************************************************************!*\
  7659. !*** ./node_modules/@ckeditor/ckeditor5-core/src/plugincollection.js ***!
  7660. \***********************************************************************/
  7661. /*! exports provided: default */
  7662. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7663. "use strict";
  7664. __webpack_require__.r(__webpack_exports__);
  7665. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return PluginCollection; });
  7666. /* 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");
  7667. /* 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");
  7668. /* 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");
  7669. /**
  7670. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  7671. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  7672. */
  7673. /**
  7674. * @module core/plugincollection
  7675. */
  7676. /**
  7677. * Manages a list of CKEditor plugins, including loading, resolving dependencies and initialization.
  7678. *
  7679. * @mixes module:utils/emittermixin~EmitterMixin
  7680. */
  7681. class PluginCollection {
  7682. /**
  7683. * Creates an instance of the plugin collection class.
  7684. * Allows loading and initializing plugins and their dependencies.
  7685. * Allows providing a list of already loaded plugins. These plugins will not be destroyed along with this collection.
  7686. *
  7687. * @param {module:core/editor/editor~Editor|module:core/context~Context} context
  7688. * @param {Array.<Function>} [availablePlugins] Plugins (constructors) which the collection will be able to use
  7689. * when {@link module:core/plugincollection~PluginCollection#init} is used with the plugin names (strings, instead of constructors).
  7690. * Usually, the editor will pass its built-in plugins to the collection so they can later be
  7691. * used in `config.plugins` or `config.removePlugins` by names.
  7692. * @param {Iterable.<Array>} contextPlugins A list of already initialized plugins represented by a
  7693. * `[ PluginConstructor, pluginInstance ]` pair.
  7694. */
  7695. constructor( context, availablePlugins = [], contextPlugins = [] ) {
  7696. /**
  7697. * @protected
  7698. * @type {module:core/editor/editor~Editor|module:core/context~Context}
  7699. */
  7700. this._context = context;
  7701. /**
  7702. * @protected
  7703. * @type {Map}
  7704. */
  7705. this._plugins = new Map();
  7706. /**
  7707. * A map of plugin constructors that can be retrieved by their names.
  7708. *
  7709. * @protected
  7710. * @type {Map.<String|Function,Function>}
  7711. */
  7712. this._availablePlugins = new Map();
  7713. for ( const PluginConstructor of availablePlugins ) {
  7714. if ( PluginConstructor.pluginName ) {
  7715. this._availablePlugins.set( PluginConstructor.pluginName, PluginConstructor );
  7716. }
  7717. }
  7718. /**
  7719. * Map of {@link module:core/contextplugin~ContextPlugin context plugins} which can be retrieved by their constructors or instances.
  7720. *
  7721. * @protected
  7722. * @type {Map<Function,Function>}
  7723. */
  7724. this._contextPlugins = new Map();
  7725. for ( const [ PluginConstructor, pluginInstance ] of contextPlugins ) {
  7726. this._contextPlugins.set( PluginConstructor, pluginInstance );
  7727. this._contextPlugins.set( pluginInstance, PluginConstructor );
  7728. // To make it possible to require a plugin by its name.
  7729. if ( PluginConstructor.pluginName ) {
  7730. this._availablePlugins.set( PluginConstructor.pluginName, PluginConstructor );
  7731. }
  7732. }
  7733. }
  7734. /**
  7735. * Iterable interface.
  7736. *
  7737. * Returns `[ PluginConstructor, pluginInstance ]` pairs.
  7738. *
  7739. * @returns {Iterable.<Array>}
  7740. */
  7741. * [ Symbol.iterator ]() {
  7742. for ( const entry of this._plugins ) {
  7743. if ( typeof entry[ 0 ] == 'function' ) {
  7744. yield entry;
  7745. }
  7746. }
  7747. }
  7748. /**
  7749. * Gets the plugin instance by its constructor or name.
  7750. *
  7751. * // Check if 'Clipboard' plugin was loaded.
  7752. * if ( editor.plugins.has( 'ClipboardPipeline' ) ) {
  7753. * // Get clipboard plugin instance
  7754. * const clipboard = editor.plugins.get( 'ClipboardPipeline' );
  7755. *
  7756. * this.listenTo( clipboard, 'inputTransformation', ( evt, data ) => {
  7757. * // Do something on clipboard input.
  7758. * } );
  7759. * }
  7760. *
  7761. * **Note**: This method will throw an error if a plugin is not loaded. Use `{@link #has editor.plugins.has()}`
  7762. * to check if a plugin is available.
  7763. *
  7764. * @param {Function|String} key The plugin constructor or {@link module:core/plugin~PluginInterface.pluginName name}.
  7765. * @returns {module:core/plugin~PluginInterface}
  7766. */
  7767. get( key ) {
  7768. const plugin = this._plugins.get( key );
  7769. if ( !plugin ) {
  7770. let pluginName = key;
  7771. if ( typeof key == 'function' ) {
  7772. pluginName = key.pluginName || key.name;
  7773. }
  7774. /**
  7775. * The plugin is not loaded and could not be obtained.
  7776. *
  7777. * Plugin classes (constructors) need to be provided to the editor and must be loaded before they can be obtained from
  7778. * the plugin collection.
  7779. * This is usually done in CKEditor 5 builds by setting the {@link module:core/editor/editor~Editor.builtinPlugins}
  7780. * property.
  7781. *
  7782. * **Note**: You can use `{@link module:core/plugincollection~PluginCollection#has editor.plugins.has()}`
  7783. * to check if a plugin was loaded.
  7784. *
  7785. * @error plugincollection-plugin-not-loaded
  7786. * @param {String} plugin The name of the plugin which is not loaded.
  7787. */
  7788. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"]( 'plugincollection-plugin-not-loaded', this._context, { plugin: pluginName } );
  7789. }
  7790. return plugin;
  7791. }
  7792. /**
  7793. * Checks if a plugin is loaded.
  7794. *
  7795. * // Check if the 'Clipboard' plugin was loaded.
  7796. * if ( editor.plugins.has( 'ClipboardPipeline' ) ) {
  7797. * // Now use the clipboard plugin instance:
  7798. * const clipboard = editor.plugins.get( 'ClipboardPipeline' );
  7799. *
  7800. * // ...
  7801. * }
  7802. *
  7803. * @param {Function|String} key The plugin constructor or {@link module:core/plugin~PluginInterface.pluginName name}.
  7804. * @returns {Boolean}
  7805. */
  7806. has( key ) {
  7807. return this._plugins.has( key );
  7808. }
  7809. /**
  7810. * Initializes a set of plugins and adds them to the collection.
  7811. *
  7812. * @param {Array.<Function|String>} plugins An array of {@link module:core/plugin~PluginInterface plugin constructors}
  7813. * or {@link module:core/plugin~PluginInterface.pluginName plugin names}.
  7814. * @param {Array.<String|Function>} [pluginsToRemove] Names of the plugins or plugin constructors
  7815. * that should not be loaded (despite being specified in the `plugins` array).
  7816. * @param {Array.<Function>} [pluginsSubstitutions] An array of {@link module:core/plugin~PluginInterface plugin constructors}
  7817. * that will be used to replace plugins of the same names that were passed in `plugins` or that are in their dependency tree.
  7818. * A useful option for replacing built-in plugins while creating tests (for mocking their APIs). Plugins that will be replaced
  7819. * must follow these rules:
  7820. * * The new plugin must be a class.
  7821. * * The new plugin must be named.
  7822. * * Both plugins must not depend on other plugins.
  7823. * @returns {Promise.<module:core/plugin~LoadedPlugins>} A promise which gets resolved once all plugins are loaded
  7824. * and available in the collection.
  7825. */
  7826. init( plugins, pluginsToRemove = [], pluginsSubstitutions = [] ) {
  7827. // Plugin initialization procedure consists of 2 main steps:
  7828. // 1) collecting all available plugin constructors,
  7829. // 2) verification whether all required plugins can be instantiated.
  7830. //
  7831. // In the first step, all plugin constructors, available in the provided `plugins` array and inside
  7832. // plugin's dependencies (from the `Plugin.requires` array), are recursively collected and added to the existing
  7833. // `this._availablePlugins` map, but without any verification at the given moment. Performing the verification
  7834. // at this point (during the plugin constructor searching) would cause false errors to occur, that some plugin
  7835. // is missing but in fact it may be defined further in the array as the dependency of other plugin. After
  7836. // traversing the entire dependency tree, it will be checked if all required "top level" plugins are available.
  7837. //
  7838. // In the second step, the list of plugins that have not been explicitly removed is traversed to get all the
  7839. // plugin constructors to be instantiated in the correct order and to validate against some rules. Finally, if
  7840. // no plugin is missing and no other error has been found, they all will be instantiated.
  7841. const that = this;
  7842. const context = this._context;
  7843. findAvailablePluginConstructors( plugins );
  7844. validatePlugins( plugins );
  7845. const pluginsToLoad = plugins.filter( plugin => !isPluginRemoved( plugin, pluginsToRemove ) );
  7846. const pluginConstructors = [ ...getPluginConstructors( pluginsToLoad ) ];
  7847. substitutePlugins( pluginConstructors, pluginsSubstitutions );
  7848. const pluginInstances = loadPlugins( pluginConstructors );
  7849. return initPlugins( pluginInstances, 'init' )
  7850. .then( () => initPlugins( pluginInstances, 'afterInit' ) )
  7851. .then( () => pluginInstances );
  7852. function isPluginConstructor( plugin ) {
  7853. return typeof plugin === 'function';
  7854. }
  7855. function isContextPlugin( plugin ) {
  7856. return isPluginConstructor( plugin ) && plugin.isContextPlugin;
  7857. }
  7858. function isPluginRemoved( plugin, pluginsToRemove ) {
  7859. return pluginsToRemove.some( removedPlugin => {
  7860. if ( removedPlugin === plugin ) {
  7861. return true;
  7862. }
  7863. if ( getPluginName( plugin ) === removedPlugin ) {
  7864. return true;
  7865. }
  7866. if ( getPluginName( removedPlugin ) === plugin ) {
  7867. return true;
  7868. }
  7869. return false;
  7870. } );
  7871. }
  7872. function getPluginName( plugin ) {
  7873. return isPluginConstructor( plugin ) ?
  7874. plugin.pluginName || plugin.name :
  7875. plugin;
  7876. }
  7877. function findAvailablePluginConstructors( plugins, processed = new Set() ) {
  7878. plugins.forEach( plugin => {
  7879. if ( !isPluginConstructor( plugin ) ) {
  7880. return;
  7881. }
  7882. if ( processed.has( plugin ) ) {
  7883. return;
  7884. }
  7885. processed.add( plugin );
  7886. if ( plugin.pluginName && !that._availablePlugins.has( plugin.pluginName ) ) {
  7887. that._availablePlugins.set( plugin.pluginName, plugin );
  7888. }
  7889. if ( plugin.requires ) {
  7890. findAvailablePluginConstructors( plugin.requires, processed );
  7891. }
  7892. } );
  7893. }
  7894. function getPluginConstructors( plugins, processed = new Set() ) {
  7895. return plugins
  7896. .map( plugin => {
  7897. return isPluginConstructor( plugin ) ?
  7898. plugin :
  7899. that._availablePlugins.get( plugin );
  7900. } )
  7901. .reduce( ( result, plugin ) => {
  7902. if ( processed.has( plugin ) ) {
  7903. return result;
  7904. }
  7905. processed.add( plugin );
  7906. if ( plugin.requires ) {
  7907. validatePlugins( plugin.requires, plugin );
  7908. getPluginConstructors( plugin.requires, processed ).forEach( plugin => result.add( plugin ) );
  7909. }
  7910. return result.add( plugin );
  7911. }, new Set() );
  7912. }
  7913. function validatePlugins( plugins, parentPluginConstructor = null ) {
  7914. plugins
  7915. .map( plugin => {
  7916. return isPluginConstructor( plugin ) ?
  7917. plugin :
  7918. that._availablePlugins.get( plugin ) || plugin;
  7919. } )
  7920. .forEach( plugin => {
  7921. checkMissingPlugin( plugin, parentPluginConstructor );
  7922. checkContextPlugin( plugin, parentPluginConstructor );
  7923. checkRemovedPlugin( plugin, parentPluginConstructor );
  7924. } );
  7925. }
  7926. function checkMissingPlugin( plugin, parentPluginConstructor ) {
  7927. if ( isPluginConstructor( plugin ) ) {
  7928. return;
  7929. }
  7930. if ( parentPluginConstructor ) {
  7931. /**
  7932. * A required "soft" dependency was not found on the plugin list.
  7933. *
  7934. * When configuring the editor, either prior to building (via
  7935. * {@link module:core/editor/editor~Editor.builtinPlugins `Editor.builtinPlugins`}) or when
  7936. * creating a new instance of the editor (e.g. via
  7937. * {@link module:core/editor/editorconfig~EditorConfig#plugins `config.plugins`}), you need to provide
  7938. * some of the dependencies for other plugins that you used.
  7939. *
  7940. * This error is thrown when one of these dependencies was not provided. The name of the missing plugin
  7941. * can be found in `missingPlugin` and the plugin that required it in `requiredBy`.
  7942. *
  7943. * In order to resolve it, you need to import the missing plugin and add it to the
  7944. * current list of plugins (`Editor.builtinPlugins` or `config.plugins`/`config.extraPlugins`).
  7945. *
  7946. * Soft requirements were introduced in version 26.0.0. If you happen to stumble upon this error
  7947. * when upgrading to version 26.0.0, read also the
  7948. * {@glink builds/guides/migration/migration-to-26 Migration to 26.0.0} guide.
  7949. *
  7950. * @error plugincollection-soft-required
  7951. * @param {String} missingPlugin The name of the required plugin.
  7952. * @param {String} requiredBy The name of the plugin that requires the other plugin.
  7953. */
  7954. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"](
  7955. 'plugincollection-soft-required',
  7956. context,
  7957. { missingPlugin: plugin, requiredBy: getPluginName( parentPluginConstructor ) }
  7958. );
  7959. }
  7960. /**
  7961. * A plugin is not available and could not be loaded.
  7962. *
  7963. * Plugin classes (constructors) need to be provided to the editor before they can be loaded by name.
  7964. * This is usually done in CKEditor 5 builds by setting the {@link module:core/editor/editor~Editor.builtinPlugins}
  7965. * property.
  7966. *
  7967. * **If you see this warning when using one of the {@glink builds/index CKEditor 5 Builds}**, it means
  7968. * that you try to enable a plugin which was not included in that build. This may be due to a typo
  7969. * in the plugin name or simply because that plugin is not a part of this build. In the latter scenario,
  7970. * read more about {@glink builds/guides/development/custom-builds custom builds}.
  7971. *
  7972. * **If you see this warning when using one of the editor creators directly** (not a build), then it means
  7973. * that you tried loading plugins by name. However, unlike CKEditor 4, CKEditor 5 does not implement a "plugin loader".
  7974. * This means that CKEditor 5 does not know where to load the plugin modules from. Therefore, you need to
  7975. * provide each plugin through a reference (as a constructor function). Check out the examples in
  7976. * {@glink builds/guides/integration/advanced-setup#scenario-2-building-from-source "Building from source"}.
  7977. *
  7978. * @error plugincollection-plugin-not-found
  7979. * @param {String} plugin The name of the plugin which could not be loaded.
  7980. */
  7981. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"](
  7982. 'plugincollection-plugin-not-found',
  7983. context,
  7984. { plugin }
  7985. );
  7986. }
  7987. function checkContextPlugin( plugin, parentPluginConstructor ) {
  7988. if ( !isContextPlugin( parentPluginConstructor ) ) {
  7989. return;
  7990. }
  7991. if ( isContextPlugin( plugin ) ) {
  7992. return;
  7993. }
  7994. /**
  7995. * If a plugin is a context plugin, all plugins it requires should also be context plugins
  7996. * instead of plugins. In other words, if one plugin can be used in the context,
  7997. * all its requirements should also be ready to be used in the context. Note that the context
  7998. * provides only a part of the API provided by the editor. If one plugin needs a full
  7999. * editor API, all plugins which require it are considered as plugins that need a full
  8000. * editor API.
  8001. *
  8002. * @error plugincollection-context-required
  8003. * @param {String} plugin The name of the required plugin.
  8004. * @param {String} requiredBy The name of the parent plugin.
  8005. */
  8006. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"](
  8007. 'plugincollection-context-required',
  8008. context,
  8009. { plugin: getPluginName( plugin ), requiredBy: getPluginName( parentPluginConstructor ) }
  8010. );
  8011. }
  8012. function checkRemovedPlugin( plugin, parentPluginConstructor ) {
  8013. if ( !parentPluginConstructor ) {
  8014. return;
  8015. }
  8016. if ( !isPluginRemoved( plugin, pluginsToRemove ) ) {
  8017. return;
  8018. }
  8019. /**
  8020. * Cannot load a plugin because one of its dependencies is listed in the `removePlugins` option.
  8021. *
  8022. * @error plugincollection-required
  8023. * @param {String} plugin The name of the required plugin.
  8024. * @param {String} requiredBy The name of the parent plugin.
  8025. */
  8026. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"](
  8027. 'plugincollection-required',
  8028. context,
  8029. { plugin: getPluginName( plugin ), requiredBy: getPluginName( parentPluginConstructor ) }
  8030. );
  8031. }
  8032. function loadPlugins( pluginConstructors ) {
  8033. return pluginConstructors.map( PluginConstructor => {
  8034. const pluginInstance = that._contextPlugins.get( PluginConstructor ) || new PluginConstructor( context );
  8035. that._add( PluginConstructor, pluginInstance );
  8036. return pluginInstance;
  8037. } );
  8038. }
  8039. function initPlugins( pluginInstances, method ) {
  8040. return pluginInstances.reduce( ( promise, plugin ) => {
  8041. if ( !plugin[ method ] ) {
  8042. return promise;
  8043. }
  8044. if ( that._contextPlugins.has( plugin ) ) {
  8045. return promise;
  8046. }
  8047. return promise.then( plugin[ method ].bind( plugin ) );
  8048. }, Promise.resolve() );
  8049. }
  8050. // Replaces plugin constructors with the specified set of plugins.
  8051. //
  8052. // @param {Array.<Function>} pluginConstructors
  8053. // @param {Array.<Function>} pluginsSubstitutions
  8054. function substitutePlugins( pluginConstructors, pluginsSubstitutions ) {
  8055. for ( const pluginItem of pluginsSubstitutions ) {
  8056. if ( typeof pluginItem != 'function' ) {
  8057. /**
  8058. * The plugin replacing an existing plugin must be a function.
  8059. *
  8060. * @error plugincollection-replace-plugin-invalid-type
  8061. */
  8062. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"]( 'plugincollection-replace-plugin-invalid-type', null, { pluginItem } );
  8063. }
  8064. const pluginName = pluginItem.pluginName;
  8065. if ( !pluginName ) {
  8066. /**
  8067. * The plugin replacing an existing plugin must have a name.
  8068. *
  8069. * @error plugincollection-replace-plugin-missing-name
  8070. */
  8071. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"]( 'plugincollection-replace-plugin-missing-name', null, { pluginItem } );
  8072. }
  8073. if ( pluginItem.requires && pluginItem.requires.length ) {
  8074. /**
  8075. * The plugin replacing an existing plugin cannot depend on other plugins.
  8076. *
  8077. * @error plugincollection-plugin-for-replacing-cannot-have-dependencies
  8078. */
  8079. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"]( 'plugincollection-plugin-for-replacing-cannot-have-dependencies', null, { pluginName } );
  8080. }
  8081. const pluginToReplace = that._availablePlugins.get( pluginName );
  8082. if ( !pluginToReplace ) {
  8083. /**
  8084. * The replaced plugin does not exist in the
  8085. * {@link module:core/plugincollection~PluginCollection available plugins} collection.
  8086. *
  8087. * @error plugincollection-plugin-for-replacing-not-exist
  8088. */
  8089. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"]( 'plugincollection-plugin-for-replacing-not-exist', null, { pluginName } );
  8090. }
  8091. const indexInPluginConstructors = pluginConstructors.indexOf( pluginToReplace );
  8092. if ( indexInPluginConstructors === -1 ) {
  8093. // The Context feature can substitute plugins as well.
  8094. // It may happen that the editor will be created with the given context, where the plugin for substitute
  8095. // was already replaced. In such a case, we don't want to do it again.
  8096. if ( that._contextPlugins.has( pluginToReplace ) ) {
  8097. return;
  8098. }
  8099. /**
  8100. * The replaced plugin will not be loaded so it cannot be replaced.
  8101. *
  8102. * @error plugincollection-plugin-for-replacing-not-loaded
  8103. */
  8104. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"]( 'plugincollection-plugin-for-replacing-not-loaded', null, { pluginName } );
  8105. }
  8106. if ( pluginToReplace.requires && pluginToReplace.requires.length ) {
  8107. /**
  8108. * The replaced plugin cannot depend on other plugins.
  8109. *
  8110. * @error plugincollection-replaced-plugin-cannot-have-dependencies
  8111. */
  8112. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"]( 'plugincollection-replaced-plugin-cannot-have-dependencies', null, { pluginName } );
  8113. }
  8114. pluginConstructors.splice( indexInPluginConstructors, 1, pluginItem );
  8115. that._availablePlugins.set( pluginName, pluginItem );
  8116. }
  8117. }
  8118. }
  8119. /**
  8120. * Destroys all loaded plugins.
  8121. *
  8122. * @returns {Promise}
  8123. */
  8124. destroy() {
  8125. const promises = [];
  8126. for ( const [ , pluginInstance ] of this ) {
  8127. if ( typeof pluginInstance.destroy == 'function' && !this._contextPlugins.has( pluginInstance ) ) {
  8128. promises.push( pluginInstance.destroy() );
  8129. }
  8130. }
  8131. return Promise.all( promises );
  8132. }
  8133. /**
  8134. * Adds the plugin to the collection. Exposed mainly for testing purposes.
  8135. *
  8136. * @protected
  8137. * @param {Function} PluginConstructor The plugin constructor.
  8138. * @param {module:core/plugin~PluginInterface} plugin The instance of the plugin.
  8139. */
  8140. _add( PluginConstructor, plugin ) {
  8141. this._plugins.set( PluginConstructor, plugin );
  8142. const pluginName = PluginConstructor.pluginName;
  8143. if ( !pluginName ) {
  8144. return;
  8145. }
  8146. if ( this._plugins.has( pluginName ) ) {
  8147. /**
  8148. * Two plugins with the same {@link module:core/plugin~PluginInterface.pluginName} were loaded.
  8149. * This will lead to runtime conflicts between these plugins.
  8150. *
  8151. * In practice, this warning usually means that new plugins were added to an existing CKEditor 5 build.
  8152. * Plugins should always be added to a source version of the editor (`@ckeditor/ckeditor5-editor-*`),
  8153. * not to an editor imported from one of the `@ckeditor/ckeditor5-build-*` packages.
  8154. *
  8155. * Check your import paths and the list of plugins passed to
  8156. * {@link module:core/editor/editor~Editor.create `Editor.create()`}
  8157. * or specified in {@link module:core/editor/editor~Editor.builtinPlugins `Editor.builtinPlugins`}.
  8158. *
  8159. * The second option is that your `node_modules/` directory contains duplicated versions of the same
  8160. * CKEditor 5 packages. Normally, on clean installations, npm deduplicates packages in `node_modules/`, so
  8161. * it may be enough to call `rm -rf node_modules && npm i`. However, if you installed conflicting versions
  8162. * of some packages, their dependencies may need to be installed in more than one version which may lead to this
  8163. * warning.
  8164. *
  8165. * Technically speaking, this error occurs because after adding a plugin to an existing editor build
  8166. * the dependencies of this plugin are being duplicated.
  8167. * They are already built into that editor build and now get added for the second time as dependencies
  8168. * of the plugin you are installing.
  8169. *
  8170. * Read more about {@glink builds/guides/integration/installing-plugins installing plugins}.
  8171. *
  8172. * @error plugincollection-plugin-name-conflict
  8173. * @param {String} pluginName The duplicated plugin name.
  8174. * @param {Function} plugin1 The first plugin constructor.
  8175. * @param {Function} plugin2 The second plugin constructor.
  8176. */
  8177. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"](
  8178. 'plugincollection-plugin-name-conflict',
  8179. null,
  8180. { pluginName, plugin1: this._plugins.get( pluginName ).constructor, plugin2: PluginConstructor }
  8181. );
  8182. }
  8183. this._plugins.set( pluginName, plugin );
  8184. }
  8185. }
  8186. Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_2__["default"])( PluginCollection, _ckeditor_ckeditor5_utils_src_emittermixin__WEBPACK_IMPORTED_MODULE_1__["default"] );
  8187. /***/ }),
  8188. /***/ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/align-bottom.svg":
  8189. /*!****************************************************************************!*\
  8190. !*** ./node_modules/@ckeditor/ckeditor5-core/theme/icons/align-bottom.svg ***!
  8191. \****************************************************************************/
  8192. /*! exports provided: default */
  8193. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8194. "use strict";
  8195. __webpack_require__.r(__webpack_exports__);
  8196. /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"m9.239 13.938-2.88-1.663a.75.75 0 0 1 .75-1.3L9 12.067V4.75a.75.75 0 1 1 1.5 0v7.318l1.89-1.093a.75.75 0 0 1 .75 1.3l-2.879 1.663a.752.752 0 0 1-.511.187.752.752 0 0 1-.511-.187zM4.25 17a.75.75 0 1 1 0-1.5h10.5a.75.75 0 0 1 0 1.5H4.25z\"/></svg>");
  8197. /***/ }),
  8198. /***/ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/align-center.svg":
  8199. /*!****************************************************************************!*\
  8200. !*** ./node_modules/@ckeditor/ckeditor5-core/theme/icons/align-center.svg ***!
  8201. \****************************************************************************/
  8202. /*! exports provided: default */
  8203. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8204. "use strict";
  8205. __webpack_require__.r(__webpack_exports__);
  8206. /* 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>");
  8207. /***/ }),
  8208. /***/ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/align-justify.svg":
  8209. /*!*****************************************************************************!*\
  8210. !*** ./node_modules/@ckeditor/ckeditor5-core/theme/icons/align-justify.svg ***!
  8211. \*****************************************************************************/
  8212. /*! exports provided: default */
  8213. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8214. "use strict";
  8215. __webpack_require__.r(__webpack_exports__);
  8216. /* 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>");
  8217. /***/ }),
  8218. /***/ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/align-left.svg":
  8219. /*!**************************************************************************!*\
  8220. !*** ./node_modules/@ckeditor/ckeditor5-core/theme/icons/align-left.svg ***!
  8221. \**************************************************************************/
  8222. /*! exports provided: default */
  8223. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8224. "use strict";
  8225. __webpack_require__.r(__webpack_exports__);
  8226. /* 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>");
  8227. /***/ }),
  8228. /***/ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/align-middle.svg":
  8229. /*!****************************************************************************!*\
  8230. !*** ./node_modules/@ckeditor/ckeditor5-core/theme/icons/align-middle.svg ***!
  8231. \****************************************************************************/
  8232. /*! exports provided: default */
  8233. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8234. "use strict";
  8235. __webpack_require__.r(__webpack_exports__);
  8236. /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M9.75 11.875a.752.752 0 0 1 .508.184l2.883 1.666a.75.75 0 0 1-.659 1.344l-.091-.044-1.892-1.093.001 4.318a.75.75 0 1 1-1.5 0v-4.317l-1.89 1.092a.75.75 0 0 1-.75-1.3l2.879-1.663a.752.752 0 0 1 .51-.187zM15.25 9a.75.75 0 1 1 0 1.5H4.75a.75.75 0 1 1 0-1.5h10.5zM9.75.375a.75.75 0 0 1 .75.75v4.318l1.89-1.093.092-.045a.75.75 0 0 1 .659 1.344l-2.883 1.667a.752.752 0 0 1-.508.184.752.752 0 0 1-.511-.187L6.359 5.65a.75.75 0 0 1 .75-1.299L9 5.442V1.125a.75.75 0 0 1 .75-.75z\"/></svg>");
  8237. /***/ }),
  8238. /***/ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/align-right.svg":
  8239. /*!***************************************************************************!*\
  8240. !*** ./node_modules/@ckeditor/ckeditor5-core/theme/icons/align-right.svg ***!
  8241. \***************************************************************************/
  8242. /*! exports provided: default */
  8243. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8244. "use strict";
  8245. __webpack_require__.r(__webpack_exports__);
  8246. /* 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>");
  8247. /***/ }),
  8248. /***/ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/align-top.svg":
  8249. /*!*************************************************************************!*\
  8250. !*** ./node_modules/@ckeditor/ckeditor5-core/theme/icons/align-top.svg ***!
  8251. \*************************************************************************/
  8252. /*! exports provided: default */
  8253. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8254. "use strict";
  8255. __webpack_require__.r(__webpack_exports__);
  8256. /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"m10.261 7.062 2.88 1.663a.75.75 0 0 1-.75 1.3L10.5 8.933v7.317a.75.75 0 1 1-1.5 0V8.932l-1.89 1.093a.75.75 0 0 1-.75-1.3l2.879-1.663a.752.752 0 0 1 .511-.187.752.752 0 0 1 .511.187zM15.25 4a.75.75 0 1 1 0 1.5H4.75a.75.75 0 0 1 0-1.5h10.5z\"/></svg>");
  8257. /***/ }),
  8258. /***/ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/cancel.svg":
  8259. /*!**********************************************************************!*\
  8260. !*** ./node_modules/@ckeditor/ckeditor5-core/theme/icons/cancel.svg ***!
  8261. \**********************************************************************/
  8262. /*! exports provided: default */
  8263. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8264. "use strict";
  8265. __webpack_require__.r(__webpack_exports__);
  8266. /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"m11.591 10.177 4.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>");
  8267. /***/ }),
  8268. /***/ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/caption.svg":
  8269. /*!***********************************************************************!*\
  8270. !*** ./node_modules/@ckeditor/ckeditor5-core/theme/icons/caption.svg ***!
  8271. \***********************************************************************/
  8272. /*! exports provided: default */
  8273. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8274. "use strict";
  8275. __webpack_require__.r(__webpack_exports__);
  8276. /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M2 16h9a1 1 0 0 1 0 2H2a1 1 0 0 1 0-2z\"/><path d=\"M17 1a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V3a2 2 0 0 1 2-2h14zm0 1.5H3a.5.5 0 0 0-.492.41L2.5 3v9a.5.5 0 0 0 .41.492L3 12.5h14a.5.5 0 0 0 .492-.41L17.5 12V3a.5.5 0 0 0-.41-.492L17 2.5z\" fill-opacity=\".6\"/></svg>");
  8277. /***/ }),
  8278. /***/ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/check.svg":
  8279. /*!*********************************************************************!*\
  8280. !*** ./node_modules/@ckeditor/ckeditor5-core/theme/icons/check.svg ***!
  8281. \*********************************************************************/
  8282. /*! exports provided: default */
  8283. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8284. "use strict";
  8285. __webpack_require__.r(__webpack_exports__);
  8286. /* 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>");
  8287. /***/ }),
  8288. /***/ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/eraser.svg":
  8289. /*!**********************************************************************!*\
  8290. !*** ./node_modules/@ckeditor/ckeditor5-core/theme/icons/eraser.svg ***!
  8291. \**********************************************************************/
  8292. /*! exports provided: default */
  8293. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8294. "use strict";
  8295. __webpack_require__.r(__webpack_exports__);
  8296. /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"m8.636 9.531-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>");
  8297. /***/ }),
  8298. /***/ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/image.svg":
  8299. /*!*********************************************************************!*\
  8300. !*** ./node_modules/@ckeditor/ckeditor5-core/theme/icons/image.svg ***!
  8301. \*********************************************************************/
  8302. /*! exports provided: default */
  8303. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8304. "use strict";
  8305. __webpack_require__.r(__webpack_exports__);
  8306. /* 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>");
  8307. /***/ }),
  8308. /***/ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/low-vision.svg":
  8309. /*!**************************************************************************!*\
  8310. !*** ./node_modules/@ckeditor/ckeditor5-core/theme/icons/low-vision.svg ***!
  8311. \**************************************************************************/
  8312. /*! exports provided: default */
  8313. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8314. "use strict";
  8315. __webpack_require__.r(__webpack_exports__);
  8316. /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M5.085 6.22 2.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.21-.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>");
  8317. /***/ }),
  8318. /***/ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/object-center.svg":
  8319. /*!*****************************************************************************!*\
  8320. !*** ./node_modules/@ckeditor/ckeditor5-core/theme/icons/object-center.svg ***!
  8321. \*****************************************************************************/
  8322. /*! exports provided: default */
  8323. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8324. "use strict";
  8325. __webpack_require__.r(__webpack_exports__);
  8326. /* 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>");
  8327. /***/ }),
  8328. /***/ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/object-full-width.svg":
  8329. /*!*********************************************************************************!*\
  8330. !*** ./node_modules/@ckeditor/ckeditor5-core/theme/icons/object-full-width.svg ***!
  8331. \*********************************************************************************/
  8332. /*! exports provided: default */
  8333. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8334. "use strict";
  8335. __webpack_require__.r(__webpack_exports__);
  8336. /* 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>");
  8337. /***/ }),
  8338. /***/ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/object-left.svg":
  8339. /*!***************************************************************************!*\
  8340. !*** ./node_modules/@ckeditor/ckeditor5-core/theme/icons/object-left.svg ***!
  8341. \***************************************************************************/
  8342. /*! exports provided: default */
  8343. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8344. "use strict";
  8345. __webpack_require__.r(__webpack_exports__);
  8346. /* 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>");
  8347. /***/ }),
  8348. /***/ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/object-right.svg":
  8349. /*!****************************************************************************!*\
  8350. !*** ./node_modules/@ckeditor/ckeditor5-core/theme/icons/object-right.svg ***!
  8351. \****************************************************************************/
  8352. /*! exports provided: default */
  8353. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8354. "use strict";
  8355. __webpack_require__.r(__webpack_exports__);
  8356. /* 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>");
  8357. /***/ }),
  8358. /***/ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/object-size-full.svg":
  8359. /*!********************************************************************************!*\
  8360. !*** ./node_modules/@ckeditor/ckeditor5-core/theme/icons/object-size-full.svg ***!
  8361. \********************************************************************************/
  8362. /*! exports provided: default */
  8363. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8364. "use strict";
  8365. __webpack_require__.r(__webpack_exports__);
  8366. /* 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>");
  8367. /***/ }),
  8368. /***/ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/object-size-large.svg":
  8369. /*!*********************************************************************************!*\
  8370. !*** ./node_modules/@ckeditor/ckeditor5-core/theme/icons/object-size-large.svg ***!
  8371. \*********************************************************************************/
  8372. /*! exports provided: default */
  8373. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8374. "use strict";
  8375. __webpack_require__.r(__webpack_exports__);
  8376. /* 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>");
  8377. /***/ }),
  8378. /***/ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/object-size-medium.svg":
  8379. /*!**********************************************************************************!*\
  8380. !*** ./node_modules/@ckeditor/ckeditor5-core/theme/icons/object-size-medium.svg ***!
  8381. \**********************************************************************************/
  8382. /*! exports provided: default */
  8383. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8384. "use strict";
  8385. __webpack_require__.r(__webpack_exports__);
  8386. /* 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>");
  8387. /***/ }),
  8388. /***/ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/object-size-small.svg":
  8389. /*!*********************************************************************************!*\
  8390. !*** ./node_modules/@ckeditor/ckeditor5-core/theme/icons/object-size-small.svg ***!
  8391. \*********************************************************************************/
  8392. /*! exports provided: default */
  8393. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8394. "use strict";
  8395. __webpack_require__.r(__webpack_exports__);
  8396. /* 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>");
  8397. /***/ }),
  8398. /***/ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/pencil.svg":
  8399. /*!**********************************************************************!*\
  8400. !*** ./node_modules/@ckeditor/ckeditor5-core/theme/icons/pencil.svg ***!
  8401. \**********************************************************************/
  8402. /*! exports provided: default */
  8403. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8404. "use strict";
  8405. __webpack_require__.r(__webpack_exports__);
  8406. /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"m7.3 17.37-.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.506 13.271 5.8c.316-.452-.16-1.333-1.065-1.966-.905-.634-1.895-.78-2.212-.328zM8 18.5 9.375 17H19v1.5H8z\"/></svg>");
  8407. /***/ }),
  8408. /***/ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/pilcrow.svg":
  8409. /*!***********************************************************************!*\
  8410. !*** ./node_modules/@ckeditor/ckeditor5-core/theme/icons/pilcrow.svg ***!
  8411. \***********************************************************************/
  8412. /*! exports provided: default */
  8413. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8414. "use strict";
  8415. __webpack_require__.r(__webpack_exports__);
  8416. /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M6.999 2H15a1 1 0 0 1 0 2h-1.004v13a1 1 0 1 1-2 0V4H8.999v13a1 1 0 1 1-2 0v-7A4 4 0 0 1 3 6a4 4 0 0 1 3.999-4z\"/></svg>");
  8417. /***/ }),
  8418. /***/ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/quote.svg":
  8419. /*!*********************************************************************!*\
  8420. !*** ./node_modules/@ckeditor/ckeditor5-core/theme/icons/quote.svg ***!
  8421. \*********************************************************************/
  8422. /*! exports provided: default */
  8423. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8424. "use strict";
  8425. __webpack_require__.r(__webpack_exports__);
  8426. /* 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>");
  8427. /***/ }),
  8428. /***/ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/three-vertical-dots.svg":
  8429. /*!***********************************************************************************!*\
  8430. !*** ./node_modules/@ckeditor/ckeditor5-core/theme/icons/three-vertical-dots.svg ***!
  8431. \***********************************************************************************/
  8432. /*! exports provided: default */
  8433. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8434. "use strict";
  8435. __webpack_require__.r(__webpack_exports__);
  8436. /* 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>");
  8437. /***/ }),
  8438. /***/ "./node_modules/@ckeditor/ckeditor5-easy-image/src/cloudservicesuploadadapter.js":
  8439. /*!***************************************************************************************!*\
  8440. !*** ./node_modules/@ckeditor/ckeditor5-easy-image/src/cloudservicesuploadadapter.js ***!
  8441. \***************************************************************************************/
  8442. /*! exports provided: default */
  8443. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8444. "use strict";
  8445. __webpack_require__.r(__webpack_exports__);
  8446. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return CloudServicesUploadAdapter; });
  8447. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  8448. /* harmony import */ var ckeditor5_src_upload__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/upload */ "./node_modules/ckeditor5/src/upload.js");
  8449. /**
  8450. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  8451. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  8452. */
  8453. /**
  8454. * @module easy-image/cloudservicesuploadadapter
  8455. */
  8456. /**
  8457. * A plugin that enables upload to [CKEditor Cloud Services](https://ckeditor.com/ckeditor-cloud-services/).
  8458. *
  8459. * It is mainly used by the {@link module:easy-image/easyimage~EasyImage} feature.
  8460. *
  8461. * After enabling this adapter you need to configure the CKEditor Cloud Services integration through
  8462. * {@link module:cloud-services/cloudservices~CloudServicesConfig `config.cloudServices`}.
  8463. *
  8464. * @extends module:core/plugin~Plugin
  8465. */
  8466. class CloudServicesUploadAdapter extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  8467. /**
  8468. * @inheritDoc
  8469. */
  8470. static get pluginName() {
  8471. return 'CloudServicesUploadAdapter';
  8472. }
  8473. /**
  8474. * @inheritDoc
  8475. */
  8476. static get requires() {
  8477. return [ 'CloudServices', ckeditor5_src_upload__WEBPACK_IMPORTED_MODULE_1__["FileRepository"] ];
  8478. }
  8479. /**
  8480. * @inheritDoc
  8481. */
  8482. init() {
  8483. const editor = this.editor;
  8484. const cloudServices = editor.plugins.get( 'CloudServices' );
  8485. const token = cloudServices.token;
  8486. const uploadUrl = cloudServices.uploadUrl;
  8487. if ( !token ) {
  8488. return;
  8489. }
  8490. this._uploadGateway = editor.plugins.get( 'CloudServicesCore' ).createUploadGateway( token, uploadUrl );
  8491. editor.plugins.get( ckeditor5_src_upload__WEBPACK_IMPORTED_MODULE_1__["FileRepository"] ).createUploadAdapter = loader => {
  8492. return new Adapter( this._uploadGateway, loader );
  8493. };
  8494. }
  8495. }
  8496. /**
  8497. * @private
  8498. */
  8499. class Adapter {
  8500. constructor( uploadGateway, loader ) {
  8501. this.uploadGateway = uploadGateway;
  8502. this.loader = loader;
  8503. }
  8504. upload() {
  8505. return this.loader.file.then( file => {
  8506. this.fileUploader = this.uploadGateway.upload( file );
  8507. this.fileUploader.on( 'progress', ( evt, data ) => {
  8508. this.loader.uploadTotal = data.total;
  8509. this.loader.uploaded = data.uploaded;
  8510. } );
  8511. return this.fileUploader.send();
  8512. } );
  8513. }
  8514. abort() {
  8515. this.fileUploader.abort();
  8516. }
  8517. }
  8518. /***/ }),
  8519. /***/ "./node_modules/@ckeditor/ckeditor5-easy-image/src/easyimage.js":
  8520. /*!**********************************************************************!*\
  8521. !*** ./node_modules/@ckeditor/ckeditor5-easy-image/src/easyimage.js ***!
  8522. \**********************************************************************/
  8523. /*! exports provided: default */
  8524. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8525. "use strict";
  8526. __webpack_require__.r(__webpack_exports__);
  8527. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return EasyImage; });
  8528. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  8529. /* harmony import */ var _cloudservicesuploadadapter__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./cloudservicesuploadadapter */ "./node_modules/@ckeditor/ckeditor5-easy-image/src/cloudservicesuploadadapter.js");
  8530. /**
  8531. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  8532. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  8533. */
  8534. /**
  8535. * @module easy-image/easyimage
  8536. */
  8537. /**
  8538. * The Easy Image feature, which makes the image upload in CKEditor 5 possible with virtually zero
  8539. * server setup. A part of the [CKEditor Cloud Services](https://ckeditor.com/ckeditor-cloud-services/)
  8540. * family.
  8541. *
  8542. * This is a "glue" plugin which enables:
  8543. *
  8544. * * {@link module:easy-image/cloudservicesuploadadapter~CloudServicesUploadAdapter}.
  8545. *
  8546. * This plugin requires plugin to be present in the editor configuration:
  8547. *
  8548. * * {@link module:image/image~Image},
  8549. * * {@link module:image/imageupload~ImageUpload},
  8550. *
  8551. * See the {@glink features/image-upload/easy-image "Easy Image integration" guide} to learn how to configure
  8552. * and use this feature.
  8553. *
  8554. * Check out the {@glink features/image-upload/image-upload comprehensive "Image upload" guide} to learn about
  8555. * other ways to upload images into CKEditor 5.
  8556. *
  8557. * **Note**: After enabling the Easy Image plugin you need to configure the
  8558. * [CKEditor Cloud Services](https://ckeditor.com/ckeditor-cloud-services/)
  8559. * integration through {@link module:cloud-services/cloudservices~CloudServicesConfig `config.cloudServices`}.
  8560. *
  8561. * @extends module:core/plugin~Plugin
  8562. */
  8563. class EasyImage extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  8564. /**
  8565. * @inheritDoc
  8566. */
  8567. static get requires() {
  8568. return [ _cloudservicesuploadadapter__WEBPACK_IMPORTED_MODULE_1__["default"], 'Image', 'ImageUpload' ];
  8569. }
  8570. /**
  8571. * @inheritDoc
  8572. */
  8573. static get pluginName() {
  8574. return 'EasyImage';
  8575. }
  8576. }
  8577. /***/ }),
  8578. /***/ "./node_modules/@ckeditor/ckeditor5-editor-classic/src/classiceditor.js":
  8579. /*!******************************************************************************!*\
  8580. !*** ./node_modules/@ckeditor/ckeditor5-editor-classic/src/classiceditor.js ***!
  8581. \******************************************************************************/
  8582. /*! exports provided: default */
  8583. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8584. "use strict";
  8585. __webpack_require__.r(__webpack_exports__);
  8586. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ClassicEditor; });
  8587. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  8588. /* harmony import */ var ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/utils */ "./node_modules/ckeditor5/src/utils.js");
  8589. /* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lodash-es */ "./node_modules/lodash-es/lodash.js");
  8590. /* harmony import */ var _classiceditorui__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./classiceditorui */ "./node_modules/@ckeditor/ckeditor5-editor-classic/src/classiceditorui.js");
  8591. /* harmony import */ var _classiceditoruiview__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./classiceditoruiview */ "./node_modules/@ckeditor/ckeditor5-editor-classic/src/classiceditoruiview.js");
  8592. /**
  8593. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  8594. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  8595. */
  8596. /**
  8597. * @module editor-classic/classiceditor
  8598. */
  8599. /**
  8600. * The {@glink builds/guides/overview#classic-editor classic editor} implementation.
  8601. * It uses an inline editable and a sticky toolbar, all enclosed in a boxed UI.
  8602. * See the {@glink examples/builds/classic-editor demo}.
  8603. *
  8604. * In order to create a classic editor instance, use the static
  8605. * {@link module:editor-classic/classiceditor~ClassicEditor.create `ClassicEditor.create()`} method.
  8606. *
  8607. * # Classic editor and classic build
  8608. *
  8609. * The classic editor can be used directly from source (if you installed the
  8610. * [`@ckeditor/ckeditor5-editor-classic`](https://www.npmjs.com/package/@ckeditor/ckeditor5-editor-classic) package)
  8611. * but it is also available in the {@glink builds/guides/overview#classic-editor classic build}.
  8612. *
  8613. * {@glink builds/guides/overview Builds} are ready-to-use editors with plugins bundled in. When using the editor from
  8614. * source you need to take care of loading all plugins by yourself
  8615. * (through the {@link module:core/editor/editorconfig~EditorConfig#plugins `config.plugins`} option).
  8616. * Using the editor from source gives much better flexibility and allows easier customization.
  8617. *
  8618. * Read more about initializing the editor from source or as a build in
  8619. * {@link module:editor-classic/classiceditor~ClassicEditor.create `ClassicEditor.create()`}.
  8620. *
  8621. * @mixes module:core/editor/utils/dataapimixin~DataApiMixin
  8622. * @mixes module:core/editor/utils/elementapimixin~ElementApiMixin
  8623. * @implements module:core/editor/editorwithui~EditorWithUI
  8624. * @extends module:core/editor/editor~Editor
  8625. */
  8626. class ClassicEditor extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Editor"] {
  8627. /**
  8628. * Creates an instance of the classic editor.
  8629. *
  8630. * **Note:** do not use the constructor to create editor instances. Use the static
  8631. * {@link module:editor-classic/classiceditor~ClassicEditor.create `ClassicEditor.create()`} method instead.
  8632. *
  8633. * @protected
  8634. * @param {HTMLElement|String} sourceElementOrData The DOM element that will be the source for the created editor
  8635. * or the editor's initial data. For more information see
  8636. * {@link module:editor-classic/classiceditor~ClassicEditor.create `ClassicEditor.create()`}.
  8637. * @param {module:core/editor/editorconfig~EditorConfig} config The editor configuration.
  8638. */
  8639. constructor( sourceElementOrData, config ) {
  8640. super( config );
  8641. if ( Object(lodash_es__WEBPACK_IMPORTED_MODULE_2__["isElement"])( sourceElementOrData ) ) {
  8642. this.sourceElement = sourceElementOrData;
  8643. }
  8644. this.model.document.createRoot();
  8645. const shouldToolbarGroupWhenFull = !this.config.get( 'toolbar.shouldNotGroupWhenFull' );
  8646. const view = new _classiceditoruiview__WEBPACK_IMPORTED_MODULE_4__["default"]( this.locale, this.editing.view, {
  8647. shouldToolbarGroupWhenFull
  8648. } );
  8649. this.ui = new _classiceditorui__WEBPACK_IMPORTED_MODULE_3__["default"]( this, view );
  8650. Object(ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["attachToForm"])( this );
  8651. }
  8652. /**
  8653. * Destroys the editor instance, releasing all resources used by it.
  8654. *
  8655. * Updates the editor's source element with the data.
  8656. *
  8657. * @returns {Promise}
  8658. */
  8659. destroy() {
  8660. if ( this.sourceElement ) {
  8661. this.updateSourceElement();
  8662. }
  8663. this.ui.destroy();
  8664. return super.destroy();
  8665. }
  8666. /**
  8667. * Creates a new classic editor instance.
  8668. *
  8669. * There are three ways how the editor can be initialized.
  8670. *
  8671. * # Replacing a DOM element (and loading data from it)
  8672. *
  8673. * You can initialize the editor using an existing DOM element:
  8674. *
  8675. * ClassicEditor
  8676. * .create( document.querySelector( '#editor' ) )
  8677. * .then( editor => {
  8678. * console.log( 'Editor was initialized', editor );
  8679. * } )
  8680. * .catch( err => {
  8681. * console.error( err.stack );
  8682. * } );
  8683. *
  8684. * The element's content will be used as the editor data and the element will be replaced by the editor UI.
  8685. *
  8686. * # Creating a detached editor
  8687. *
  8688. * Alternatively, you can initialize the editor by passing the initial data directly as a string.
  8689. * In this case, the editor will render an element that must be inserted into the DOM:
  8690. *
  8691. * ClassicEditor
  8692. * .create( '<p>Hello world!</p>' )
  8693. * .then( editor => {
  8694. * console.log( 'Editor was initialized', editor );
  8695. *
  8696. * // Initial data was provided so the editor UI element needs to be added manually to the DOM.
  8697. * document.body.appendChild( editor.ui.element );
  8698. * } )
  8699. * .catch( err => {
  8700. * console.error( err.stack );
  8701. * } );
  8702. *
  8703. * This lets you dynamically append the editor to your web page whenever it is convenient for you. You may use this method if your
  8704. * web page content is generated on the client side and the DOM structure is not ready at the moment when you initialize the editor.
  8705. *
  8706. * # Replacing a DOM element (and data provided in `config.initialData`)
  8707. *
  8708. * You can also mix these two ways by providing a DOM element to be used and passing the initial data through the configuration:
  8709. *
  8710. * ClassicEditor
  8711. * .create( document.querySelector( '#editor' ), {
  8712. * initialData: '<h2>Initial data</h2><p>Foo bar.</p>'
  8713. * } )
  8714. * .then( editor => {
  8715. * console.log( 'Editor was initialized', editor );
  8716. * } )
  8717. * .catch( err => {
  8718. * console.error( err.stack );
  8719. * } );
  8720. *
  8721. * This method can be used to initialize the editor on an existing element with the specified content in case if your integration
  8722. * makes it difficult to set the content of the source element.
  8723. *
  8724. * Note that an error will be thrown if you pass the initial data both as the first parameter and also in the configuration.
  8725. *
  8726. * # Configuring the editor
  8727. *
  8728. * See the {@link module:core/editor/editorconfig~EditorConfig editor configuration documentation} to learn more about
  8729. * customizing plugins, toolbar and more.
  8730. *
  8731. * # Using the editor from source
  8732. *
  8733. * The code samples listed in the previous sections of this documentation assume that you are using an
  8734. * {@glink builds/guides/overview editor build} (for example – `@ckeditor/ckeditor5-build-classic`).
  8735. *
  8736. * If you want to use the classic editor from source (`@ckeditor/ckeditor5-editor-classic/src/classiceditor`),
  8737. * you need to define the list of
  8738. * {@link module:core/editor/editorconfig~EditorConfig#plugins plugins to be initialized} and
  8739. * {@link module:core/editor/editorconfig~EditorConfig#toolbar toolbar items}. Read more about using the editor from
  8740. * source in the {@glink builds/guides/integration/advanced-setup "Advanced setup" guide}.
  8741. *
  8742. * @param {HTMLElement|String} sourceElementOrData The DOM element that will be the source for the created editor
  8743. * or the editor's initial data.
  8744. *
  8745. * If a DOM element is passed, its content will be automatically loaded to the editor upon initialization
  8746. * and the {@link module:editor-classic/classiceditorui~ClassicEditorUI#element editor element} will replace the passed element
  8747. * in the DOM (the original one will be hidden and the editor will be injected next to it).
  8748. *
  8749. * Moreover, the editor data will be set back to the original element once the editor is destroyed and when a form, in which
  8750. * this element is contained, is submitted (if the original element is a `<textarea>`). This ensures seamless integration with native
  8751. * web forms.
  8752. *
  8753. * If the initial data is passed, a detached editor will be created. In this case you need to insert it into the DOM manually.
  8754. * It is available under the {@link module:editor-classic/classiceditorui~ClassicEditorUI#element `editor.ui.element`} property.
  8755. *
  8756. * @param {module:core/editor/editorconfig~EditorConfig} [config] The editor configuration.
  8757. * @returns {Promise} A promise resolved once the editor is ready. The promise resolves with the created editor instance.
  8758. */
  8759. static create( sourceElementOrData, config = {} ) {
  8760. return new Promise( resolve => {
  8761. const editor = new this( sourceElementOrData, config );
  8762. resolve(
  8763. editor.initPlugins()
  8764. .then( () => editor.ui.init( Object(lodash_es__WEBPACK_IMPORTED_MODULE_2__["isElement"])( sourceElementOrData ) ? sourceElementOrData : null ) )
  8765. .then( () => {
  8766. if ( !Object(lodash_es__WEBPACK_IMPORTED_MODULE_2__["isElement"])( sourceElementOrData ) && config.initialData ) {
  8767. // Documented in core/editor/editorconfig.jdoc.
  8768. // eslint-disable-next-line ckeditor5-rules/ckeditor-error-message
  8769. throw new ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_1__["CKEditorError"]( 'editor-create-initial-data', null );
  8770. }
  8771. const initialData = config.initialData !== undefined ? config.initialData : getInitialData( sourceElementOrData );
  8772. return editor.data.init( initialData );
  8773. } )
  8774. .then( () => editor.fire( 'ready' ) )
  8775. .then( () => editor )
  8776. );
  8777. } );
  8778. }
  8779. }
  8780. Object(ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_1__["mix"])( ClassicEditor, ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["DataApiMixin"] );
  8781. Object(ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_1__["mix"])( ClassicEditor, ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["ElementApiMixin"] );
  8782. function getInitialData( sourceElementOrData ) {
  8783. return Object(lodash_es__WEBPACK_IMPORTED_MODULE_2__["isElement"])( sourceElementOrData ) ? Object(ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_1__["getDataFromElement"])( sourceElementOrData ) : sourceElementOrData;
  8784. }
  8785. /***/ }),
  8786. /***/ "./node_modules/@ckeditor/ckeditor5-editor-classic/src/classiceditorui.js":
  8787. /*!********************************************************************************!*\
  8788. !*** ./node_modules/@ckeditor/ckeditor5-editor-classic/src/classiceditorui.js ***!
  8789. \********************************************************************************/
  8790. /*! exports provided: default */
  8791. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8792. "use strict";
  8793. __webpack_require__.r(__webpack_exports__);
  8794. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ClassicEditorUI; });
  8795. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  8796. /* harmony import */ var ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/ui */ "./node_modules/ckeditor5/src/ui.js");
  8797. /* harmony import */ var ckeditor5_src_engine__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ckeditor5/src/engine */ "./node_modules/ckeditor5/src/engine.js");
  8798. /* harmony import */ var ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ckeditor5/src/utils */ "./node_modules/ckeditor5/src/utils.js");
  8799. /**
  8800. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  8801. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  8802. */
  8803. /**
  8804. * @module editor-classic/classiceditorui
  8805. */
  8806. /**
  8807. * The classic editor UI class.
  8808. *
  8809. * @extends module:core/editor/editorui~EditorUI
  8810. */
  8811. class ClassicEditorUI extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["EditorUI"] {
  8812. /**
  8813. * Creates an instance of the classic editor UI class.
  8814. *
  8815. * @param {module:core/editor/editor~Editor} editor The editor instance.
  8816. * @param {module:ui/editorui/editoruiview~EditorUIView} view The view of the UI.
  8817. */
  8818. constructor( editor, view ) {
  8819. super( editor );
  8820. /**
  8821. * The main (top–most) view of the editor UI.
  8822. *
  8823. * @readonly
  8824. * @member {module:ui/editorui/editoruiview~EditorUIView} #view
  8825. */
  8826. this.view = view;
  8827. /**
  8828. * A normalized `config.toolbar` object.
  8829. *
  8830. * @private
  8831. * @member {Object}
  8832. */
  8833. this._toolbarConfig = Object(ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__["normalizeToolbarConfig"])( editor.config.get( 'toolbar' ) );
  8834. /**
  8835. * The element replacer instance used to hide the editor's source element.
  8836. *
  8837. * @protected
  8838. * @member {module:utils/elementreplacer~ElementReplacer}
  8839. */
  8840. this._elementReplacer = new ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_3__["ElementReplacer"]();
  8841. }
  8842. /**
  8843. * @inheritDoc
  8844. */
  8845. get element() {
  8846. return this.view.element;
  8847. }
  8848. /**
  8849. * Initializes the UI.
  8850. *
  8851. * @param {HTMLElement|null} replacementElement The DOM element that will be the source for the created editor.
  8852. */
  8853. init( replacementElement ) {
  8854. const editor = this.editor;
  8855. const view = this.view;
  8856. const editingView = editor.editing.view;
  8857. const editable = view.editable;
  8858. const editingRoot = editingView.document.getRoot();
  8859. // The editable UI and editing root should share the same name. Then name is used
  8860. // to recognize the particular editable, for instance in ARIA attributes.
  8861. editable.name = editingRoot.rootName;
  8862. view.render();
  8863. // The editable UI element in DOM is available for sure only after the editor UI view has been rendered.
  8864. // But it can be available earlier if a DOM element has been passed to BalloonEditor.create().
  8865. const editableElement = editable.element;
  8866. // Register the editable UI view in the editor. A single editor instance can aggregate multiple
  8867. // editable areas (roots) but the classic editor has only one.
  8868. this.setEditableElement( editable.name, editableElement );
  8869. // Let the global focus tracker know that the editable UI element is focusable and
  8870. // belongs to the editor. From now on, the focus tracker will sustain the editor focus
  8871. // as long as the editable is focused (e.g. the user is typing).
  8872. this.focusTracker.add( editableElement );
  8873. // Let the editable UI element respond to the changes in the global editor focus
  8874. // tracker. It has been added to the same tracker a few lines above but, in reality, there are
  8875. // many focusable areas in the editor, like balloons, toolbars or dropdowns and as long
  8876. // as they have focus, the editable should act like it is focused too (although technically
  8877. // it isn't), e.g. by setting the proper CSS class, visually announcing focus to the user.
  8878. // Doing otherwise will result in editable focus styles disappearing, once e.g. the
  8879. // toolbar gets focused.
  8880. view.editable.bind( 'isFocused' ).to( this.focusTracker );
  8881. // Bind the editable UI element to the editing view, making it an end– and entry–point
  8882. // of the editor's engine. This is where the engine meets the UI.
  8883. editingView.attachDomRoot( editableElement );
  8884. // If an element containing the initial data of the editor was provided, replace it with
  8885. // an editor instance's UI in DOM until the editor is destroyed. For instance, a <textarea>
  8886. // can be such element.
  8887. if ( replacementElement ) {
  8888. this._elementReplacer.replace( replacementElement, this.element );
  8889. }
  8890. this._initPlaceholder();
  8891. this._initToolbar();
  8892. this.fire( 'ready' );
  8893. }
  8894. /**
  8895. * @inheritDoc
  8896. */
  8897. destroy() {
  8898. const view = this.view;
  8899. const editingView = this.editor.editing.view;
  8900. this._elementReplacer.restore();
  8901. editingView.detachDomRoot( view.editable.name );
  8902. view.destroy();
  8903. super.destroy();
  8904. }
  8905. /**
  8906. * Initializes the editor toolbar.
  8907. *
  8908. * @private
  8909. */
  8910. _initToolbar() {
  8911. const editor = this.editor;
  8912. const view = this.view;
  8913. const editingView = editor.editing.view;
  8914. // Set–up the sticky panel with toolbar.
  8915. view.stickyPanel.bind( 'isActive' ).to( this.focusTracker, 'isFocused' );
  8916. view.stickyPanel.limiterElement = view.element;
  8917. if ( this._toolbarConfig.viewportTopOffset ) {
  8918. view.stickyPanel.viewportTopOffset = this._toolbarConfig.viewportTopOffset;
  8919. }
  8920. view.toolbar.fillFromConfig( this._toolbarConfig, this.componentFactory );
  8921. Object(ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__["enableToolbarKeyboardFocus"])( {
  8922. origin: editingView,
  8923. originFocusTracker: this.focusTracker,
  8924. originKeystrokeHandler: editor.keystrokes,
  8925. toolbar: view.toolbar
  8926. } );
  8927. }
  8928. /**
  8929. * Enable the placeholder text on the editing root, if any was configured.
  8930. *
  8931. * @private
  8932. */
  8933. _initPlaceholder() {
  8934. const editor = this.editor;
  8935. const editingView = editor.editing.view;
  8936. const editingRoot = editingView.document.getRoot();
  8937. const sourceElement = editor.sourceElement;
  8938. const placeholderText = editor.config.get( 'placeholder' ) ||
  8939. sourceElement && sourceElement.tagName.toLowerCase() === 'textarea' && sourceElement.getAttribute( 'placeholder' );
  8940. if ( placeholderText ) {
  8941. Object(ckeditor5_src_engine__WEBPACK_IMPORTED_MODULE_2__["enablePlaceholder"])( {
  8942. view: editingView,
  8943. element: editingRoot,
  8944. text: placeholderText,
  8945. isDirectHost: false,
  8946. keepOnFocus: true
  8947. } );
  8948. }
  8949. }
  8950. }
  8951. /***/ }),
  8952. /***/ "./node_modules/@ckeditor/ckeditor5-editor-classic/src/classiceditoruiview.js":
  8953. /*!************************************************************************************!*\
  8954. !*** ./node_modules/@ckeditor/ckeditor5-editor-classic/src/classiceditoruiview.js ***!
  8955. \************************************************************************************/
  8956. /*! exports provided: default */
  8957. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8958. "use strict";
  8959. __webpack_require__.r(__webpack_exports__);
  8960. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ClassicEditorUIView; });
  8961. /* harmony import */ var ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/ui */ "./node_modules/ckeditor5/src/ui.js");
  8962. /* harmony import */ var _theme_classiceditor_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../theme/classiceditor.css */ "./node_modules/@ckeditor/ckeditor5-editor-classic/theme/classiceditor.css");
  8963. /* harmony import */ var _theme_classiceditor_css__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_theme_classiceditor_css__WEBPACK_IMPORTED_MODULE_1__);
  8964. /**
  8965. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  8966. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  8967. */
  8968. /**
  8969. * @module editor-classic/classiceditoruiview
  8970. */
  8971. /**
  8972. * Classic editor UI view. Uses an inline editable and a sticky toolbar, all
  8973. * enclosed in a boxed UI view.
  8974. *
  8975. * @extends module:ui/editorui/boxed/boxededitoruiview~BoxedEditorUIView
  8976. */
  8977. class ClassicEditorUIView extends ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_0__["BoxedEditorUIView"] {
  8978. /**
  8979. * Creates an instance of the classic editor UI view.
  8980. *
  8981. * @param {module:utils/locale~Locale} locale The {@link module:core/editor/editor~Editor#locale} instance.
  8982. * @param {module:engine/view/view~View} editingView The editing view instance this view is related to.
  8983. * @param {Object} [options={}] Configuration options for the view instance.
  8984. * @param {Boolean} [options.shouldToolbarGroupWhenFull] When set `true` enables automatic items grouping
  8985. * in the main {@link module:editor-classic/classiceditoruiview~ClassicEditorUIView#toolbar toolbar}.
  8986. * See {@link module:ui/toolbar/toolbarview~ToolbarOptions#shouldGroupWhenFull} to learn more.
  8987. */
  8988. constructor( locale, editingView, options = {} ) {
  8989. super( locale );
  8990. /**
  8991. * Sticky panel view instance. This is a parent view of a {@link #toolbar}
  8992. * that makes toolbar sticky.
  8993. *
  8994. * @readonly
  8995. * @member {module:ui/panel/sticky/stickypanelview~StickyPanelView}
  8996. */
  8997. this.stickyPanel = new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_0__["StickyPanelView"]( locale );
  8998. /**
  8999. * Toolbar view instance.
  9000. *
  9001. * @readonly
  9002. * @member {module:ui/toolbar/toolbarview~ToolbarView}
  9003. */
  9004. this.toolbar = new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_0__["ToolbarView"]( locale, {
  9005. shouldGroupWhenFull: options.shouldToolbarGroupWhenFull
  9006. } );
  9007. /**
  9008. * Editable UI view.
  9009. *
  9010. * @readonly
  9011. * @member {module:ui/editableui/inline/inlineeditableuiview~InlineEditableUIView}
  9012. */
  9013. this.editable = new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_0__["InlineEditableUIView"]( locale, editingView );
  9014. }
  9015. /**
  9016. * @inheritDoc
  9017. */
  9018. render() {
  9019. super.render();
  9020. // Set toolbar as a child of a stickyPanel and makes toolbar sticky.
  9021. this.stickyPanel.content.add( this.toolbar );
  9022. this.top.add( this.stickyPanel );
  9023. this.main.add( this.editable );
  9024. }
  9025. }
  9026. /***/ }),
  9027. /***/ "./node_modules/@ckeditor/ckeditor5-editor-classic/theme/classiceditor.css":
  9028. /*!*********************************************************************************!*\
  9029. !*** ./node_modules/@ckeditor/ckeditor5-editor-classic/theme/classiceditor.css ***!
  9030. \*********************************************************************************/
  9031. /*! no static exports found */
  9032. /***/ (function(module, exports, __webpack_require__) {
  9033. var api = __webpack_require__(/*! ../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  9034. 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");
  9035. content = content.__esModule ? content.default : content;
  9036. if (typeof content === 'string') {
  9037. content = [[module.i, content, '']];
  9038. }
  9039. var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
  9040. options.insert = "head";
  9041. options.singleton = true;
  9042. var update = api(content, options);
  9043. module.exports = content.locals || {};
  9044. /***/ }),
  9045. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/controller/datacontroller.js":
  9046. /*!**********************************************************************************!*\
  9047. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/controller/datacontroller.js ***!
  9048. \**********************************************************************************/
  9049. /*! exports provided: default */
  9050. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  9051. "use strict";
  9052. __webpack_require__.r(__webpack_exports__);
  9053. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return DataController; });
  9054. /* 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");
  9055. /* 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");
  9056. /* 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");
  9057. /* harmony import */ var _conversion_mapper__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../conversion/mapper */ "./node_modules/@ckeditor/ckeditor5-engine/src/conversion/mapper.js");
  9058. /* harmony import */ var _conversion_downcastdispatcher__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../conversion/downcastdispatcher */ "./node_modules/@ckeditor/ckeditor5-engine/src/conversion/downcastdispatcher.js");
  9059. /* harmony import */ var _conversion_downcasthelpers__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../conversion/downcasthelpers */ "./node_modules/@ckeditor/ckeditor5-engine/src/conversion/downcasthelpers.js");
  9060. /* harmony import */ var _conversion_upcastdispatcher__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../conversion/upcastdispatcher */ "./node_modules/@ckeditor/ckeditor5-engine/src/conversion/upcastdispatcher.js");
  9061. /* harmony import */ var _conversion_upcasthelpers__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../conversion/upcasthelpers */ "./node_modules/@ckeditor/ckeditor5-engine/src/conversion/upcasthelpers.js");
  9062. /* harmony import */ var _view_documentfragment__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../view/documentfragment */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/documentfragment.js");
  9063. /* harmony import */ var _view_document__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../view/document */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/document.js");
  9064. /* harmony import */ var _view_downcastwriter__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../view/downcastwriter */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/downcastwriter.js");
  9065. /* harmony import */ var _model_range__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../model/range */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/range.js");
  9066. /* 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");
  9067. /* harmony import */ var _dataprocessor_htmldataprocessor__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../dataprocessor/htmldataprocessor */ "./node_modules/@ckeditor/ckeditor5-engine/src/dataprocessor/htmldataprocessor.js");
  9068. /**
  9069. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  9070. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  9071. */
  9072. /**
  9073. * @module engine/controller/datacontroller
  9074. */
  9075. /**
  9076. * Controller for the data pipeline. The data pipeline controls how data is retrieved from the document
  9077. * and set inside it. Hence, the controller features two methods which allow to {@link ~DataController#get get}
  9078. * and {@link ~DataController#set set} data of the {@link ~DataController#model model}
  9079. * using given:
  9080. *
  9081. * * {@link module:engine/dataprocessor/dataprocessor~DataProcessor data processor},
  9082. * * downcast converters,
  9083. * * upcast converters.
  9084. *
  9085. * An instance of the data controller is always available in the {@link module:core/editor/editor~Editor#data `editor.data`}
  9086. * property:
  9087. *
  9088. * editor.data.get( { rootName: 'customRoot' } ); // -> '<p>Hello!</p>'
  9089. *
  9090. * @mixes module:utils/observablemixin~ObservableMixin
  9091. */
  9092. class DataController {
  9093. /**
  9094. * Creates a data controller instance.
  9095. *
  9096. * @param {module:engine/model/model~Model} model Data model.
  9097. * @param {module:engine/view/stylesmap~StylesProcessor} stylesProcessor The styles processor instance.
  9098. */
  9099. constructor( model, stylesProcessor ) {
  9100. /**
  9101. * Data model.
  9102. *
  9103. * @readonly
  9104. * @member {module:engine/model/model~Model}
  9105. */
  9106. this.model = model;
  9107. /**
  9108. * Mapper used for the conversion. It has no permanent bindings, because they are created when getting data and
  9109. * cleared directly after the data are converted. However, the mapper is defined as a class property, because
  9110. * it needs to be passed to the `DowncastDispatcher` as a conversion API.
  9111. *
  9112. * @readonly
  9113. * @member {module:engine/conversion/mapper~Mapper}
  9114. */
  9115. this.mapper = new _conversion_mapper__WEBPACK_IMPORTED_MODULE_3__["default"]();
  9116. /**
  9117. * Downcast dispatcher used by the {@link #get get method}. Downcast converters should be attached to it.
  9118. *
  9119. * @readonly
  9120. * @member {module:engine/conversion/downcastdispatcher~DowncastDispatcher}
  9121. */
  9122. this.downcastDispatcher = new _conversion_downcastdispatcher__WEBPACK_IMPORTED_MODULE_4__["default"]( {
  9123. mapper: this.mapper,
  9124. schema: model.schema
  9125. } );
  9126. this.downcastDispatcher.on( 'insert:$text', Object(_conversion_downcasthelpers__WEBPACK_IMPORTED_MODULE_5__["insertText"])(), { priority: 'lowest' } );
  9127. /**
  9128. * Upcast dispatcher used by the {@link #set set method}. Upcast converters should be attached to it.
  9129. *
  9130. * @readonly
  9131. * @member {module:engine/conversion/upcastdispatcher~UpcastDispatcher}
  9132. */
  9133. this.upcastDispatcher = new _conversion_upcastdispatcher__WEBPACK_IMPORTED_MODULE_6__["default"]( {
  9134. schema: model.schema
  9135. } );
  9136. /**
  9137. * The view document used by the data controller.
  9138. *
  9139. * @readonly
  9140. * @member {module:engine/view/document~Document}
  9141. */
  9142. this.viewDocument = new _view_document__WEBPACK_IMPORTED_MODULE_9__["default"]( stylesProcessor );
  9143. /**
  9144. * Styles processor used during the conversion.
  9145. *
  9146. * @readonly
  9147. * @member {module:engine/view/stylesmap~StylesProcessor}
  9148. */
  9149. this.stylesProcessor = stylesProcessor;
  9150. /**
  9151. * Data processor used specifically for HTML conversion.
  9152. *
  9153. * @readonly
  9154. * @member {module:engine/dataprocessor/htmldataprocessor~HtmlDataProcessor} #htmlProcessor
  9155. */
  9156. this.htmlProcessor = new _dataprocessor_htmldataprocessor__WEBPACK_IMPORTED_MODULE_13__["default"]( this.viewDocument );
  9157. /**
  9158. * Data processor used during the conversion.
  9159. * Same instance as {@link #htmlProcessor} by default. Can be replaced at run time to handle different format, e.g. XML or Markdown.
  9160. *
  9161. * @member {module:engine/dataprocessor/dataprocessor~DataProcessor} #processor
  9162. */
  9163. this.processor = this.htmlProcessor;
  9164. /**
  9165. * The view downcast writer just for data conversion purposes, i.e. to modify
  9166. * the {@link #viewDocument}.
  9167. *
  9168. * @private
  9169. * @readonly
  9170. * @member {module:engine/view/downcastwriter~DowncastWriter}
  9171. */
  9172. this._viewWriter = new _view_downcastwriter__WEBPACK_IMPORTED_MODULE_10__["default"]( this.viewDocument );
  9173. // Define default converters for text and elements.
  9174. //
  9175. // Note that if there is no default converter for the element it will be skipped, for instance `<b>foo</b>` will be
  9176. // converted to nothing. We therefore add `convertToModelFragment` as a last converter so it converts children of that
  9177. // element to the document fragment and so `<b>foo</b>` will be converted to `foo` if there is no converter for `<b>`.
  9178. this.upcastDispatcher.on( 'text', Object(_conversion_upcasthelpers__WEBPACK_IMPORTED_MODULE_7__["convertText"])(), { priority: 'lowest' } );
  9179. this.upcastDispatcher.on( 'element', Object(_conversion_upcasthelpers__WEBPACK_IMPORTED_MODULE_7__["convertToModelFragment"])(), { priority: 'lowest' } );
  9180. this.upcastDispatcher.on( 'documentFragment', Object(_conversion_upcasthelpers__WEBPACK_IMPORTED_MODULE_7__["convertToModelFragment"])(), { priority: 'lowest' } );
  9181. this.decorate( 'init' );
  9182. this.decorate( 'set' );
  9183. // Fire the `ready` event when the initialization has completed. Such low-level listener gives possibility
  9184. // to plug into the initialization pipeline without interrupting the initialization flow.
  9185. this.on( 'init', () => {
  9186. this.fire( 'ready' );
  9187. }, { priority: 'lowest' } );
  9188. // Fix empty roots after DataController is 'ready' (note that init method could be decorated and stopped).
  9189. // We need to handle this event because initial data could be empty and post-fixer would not get triggered.
  9190. this.on( 'ready', () => {
  9191. this.model.enqueueChange( 'transparent', _model_utils_autoparagraphing__WEBPACK_IMPORTED_MODULE_12__["autoParagraphEmptyRoots"] );
  9192. }, { priority: 'lowest' } );
  9193. }
  9194. /**
  9195. * Returns the model's data converted by downcast dispatchers attached to {@link #downcastDispatcher} and
  9196. * formatted by the {@link #processor data processor}.
  9197. *
  9198. * @param {Object} [options] Additional configuration for the retrieved data. `DataController` provides two optional
  9199. * properties: `rootName` and `trim`. Other properties of this object are specified by various editor features.
  9200. * @param {String} [options.rootName='main'] Root name.
  9201. * @param {String} [options.trim='empty'] Whether returned data should be trimmed. This option is set to `empty` by default,
  9202. * which means whenever editor content is considered empty, an empty string will be returned. To turn off trimming completely
  9203. * use `'none'`. In such cases exact content will be returned (for example `<p>&nbsp;</p>` for an empty editor).
  9204. * @returns {String} Output data.
  9205. */
  9206. get( options = {} ) {
  9207. const { rootName = 'main', trim = 'empty' } = options;
  9208. if ( !this._checkIfRootsExists( [ rootName ] ) ) {
  9209. /**
  9210. * Cannot get data from a non-existing root. This error is thrown when {@link #get DataController#get() method}
  9211. * is called with non-existent root name. For example, if there is an editor instance with only `main` root,
  9212. * calling {@link #get} like:
  9213. *
  9214. * data.get( { rootName: 'root2' } );
  9215. *
  9216. * will throw this error.
  9217. *
  9218. * @error datacontroller-get-non-existent-root
  9219. */
  9220. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__["default"]( 'datacontroller-get-non-existent-root', this );
  9221. }
  9222. const root = this.model.document.getRoot( rootName );
  9223. if ( trim === 'empty' && !this.model.hasContent( root, { ignoreWhitespaces: true } ) ) {
  9224. return '';
  9225. }
  9226. return this.stringify( root, options );
  9227. }
  9228. /**
  9229. * Returns the content of the given {@link module:engine/model/element~Element model's element} or
  9230. * {@link module:engine/model/documentfragment~DocumentFragment model document fragment} converted by the downcast converters
  9231. * attached to {@link #downcastDispatcher} and formatted by the {@link #processor data processor}.
  9232. *
  9233. * @param {module:engine/model/element~Element|module:engine/model/documentfragment~DocumentFragment} modelElementOrFragment
  9234. * Element whose content will be stringified.
  9235. * @param {Object} [options] Additional configuration passed to the conversion process.
  9236. * @returns {String} Output data.
  9237. */
  9238. stringify( modelElementOrFragment, options = {} ) {
  9239. // Model -> view.
  9240. const viewDocumentFragment = this.toView( modelElementOrFragment, options );
  9241. // View -> data.
  9242. return this.processor.toData( viewDocumentFragment );
  9243. }
  9244. /**
  9245. * Returns the content of the given {@link module:engine/model/element~Element model element} or
  9246. * {@link module:engine/model/documentfragment~DocumentFragment model document fragment} converted by the downcast
  9247. * converters attached to {@link #downcastDispatcher} to a
  9248. * {@link module:engine/view/documentfragment~DocumentFragment view document fragment}.
  9249. *
  9250. * @param {module:engine/model/element~Element|module:engine/model/documentfragment~DocumentFragment} modelElementOrFragment
  9251. * Element or document fragment whose content will be converted.
  9252. * @param {Object} [options={}] Additional configuration that will be available through
  9253. * {@link module:engine/conversion/downcastdispatcher~DowncastConversionApi#options} during the conversion process.
  9254. * @returns {module:engine/view/documentfragment~DocumentFragment} Output view DocumentFragment.
  9255. */
  9256. toView( modelElementOrFragment, options = {} ) {
  9257. const viewDocument = this.viewDocument;
  9258. const viewWriter = this._viewWriter;
  9259. // Clear bindings so the call to this method gives correct results.
  9260. this.mapper.clearBindings();
  9261. // First, convert elements.
  9262. const modelRange = _model_range__WEBPACK_IMPORTED_MODULE_11__["default"]._createIn( modelElementOrFragment );
  9263. const viewDocumentFragment = new _view_documentfragment__WEBPACK_IMPORTED_MODULE_8__["default"]( viewDocument );
  9264. this.mapper.bindElements( modelElementOrFragment, viewDocumentFragment );
  9265. // Make additional options available during conversion process through `conversionApi`.
  9266. this.downcastDispatcher.conversionApi.options = options;
  9267. // We have no view controller and rendering to DOM in DataController so view.change() block is not used here.
  9268. this.downcastDispatcher.convertInsert( modelRange, viewWriter );
  9269. // Convert markers.
  9270. // For document fragment, simply take the markers assigned to this document fragment.
  9271. // For model root, all markers in that root will be taken.
  9272. // For model element, we need to check which markers are intersecting with this element and relatively modify the markers' ranges.
  9273. const markers = modelElementOrFragment.is( 'documentFragment' ) ?
  9274. Array.from( modelElementOrFragment.markers ) :
  9275. _getMarkersRelativeToElement( modelElementOrFragment );
  9276. for ( const [ name, range ] of markers ) {
  9277. this.downcastDispatcher.convertMarkerAdd( name, range, viewWriter );
  9278. }
  9279. // Clean `conversionApi`.
  9280. delete this.downcastDispatcher.conversionApi.options;
  9281. return viewDocumentFragment;
  9282. }
  9283. /**
  9284. * Sets initial input data parsed by the {@link #processor data processor} and
  9285. * converted by the {@link #upcastDispatcher view-to-model converters}.
  9286. * Initial data can be set only to document that {@link module:engine/model/document~Document#version} is equal 0.
  9287. *
  9288. * **Note** This method is {@link module:utils/observablemixin~ObservableMixin#decorate decorated} which is
  9289. * used by e.g. collaborative editing plugin that syncs remote data on init.
  9290. *
  9291. * When data is passed as a string it is initialized on a default `main` root:
  9292. *
  9293. * dataController.init( '<p>Foo</p>' ); // Initializes data on the `main` root.
  9294. *
  9295. * To initialize data on a different root or multiple roots at once, object containing `rootName` - `data` pairs should be passed:
  9296. *
  9297. * dataController.init( { main: '<p>Foo</p>', title: '<h1>Bar</h1>' } ); // Initializes data on the `main` and `title` roots.
  9298. *
  9299. * @fires init
  9300. * @param {String|Object.<String,String>} data Input data as a string or an object containing `rootName` - `data`
  9301. * pairs to initialize data on multiple roots at once.
  9302. * @returns {Promise} Promise that is resolved after the data is set on the editor.
  9303. */
  9304. init( data ) {
  9305. if ( this.model.document.version ) {
  9306. /**
  9307. * Cannot set initial data to not empty {@link module:engine/model/document~Document}.
  9308. * Initial data should be set once, during {@link module:core/editor/editor~Editor} initialization,
  9309. * when the {@link module:engine/model/document~Document#version} is equal 0.
  9310. *
  9311. * @error datacontroller-init-document-not-empty
  9312. */
  9313. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__["default"]( 'datacontroller-init-document-not-empty', this );
  9314. }
  9315. let initialData = {};
  9316. if ( typeof data === 'string' ) {
  9317. initialData.main = data; // Default root is 'main'. To initiate data on a different root, object should be passed.
  9318. } else {
  9319. initialData = data;
  9320. }
  9321. if ( !this._checkIfRootsExists( Object.keys( initialData ) ) ) {
  9322. /**
  9323. * Cannot init data on a non-existing root. This error is thrown when {@link #init DataController#init() method}
  9324. * is called with non-existent root name. For example, if there is an editor instance with only `main` root,
  9325. * calling {@link #init} like:
  9326. *
  9327. * data.init( { main: '<p>Foo</p>', root2: '<p>Bar</p>' } );
  9328. *
  9329. * will throw this error.
  9330. *
  9331. * @error datacontroller-init-non-existent-root
  9332. */
  9333. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__["default"]( 'datacontroller-init-non-existent-root', this );
  9334. }
  9335. this.model.enqueueChange( 'transparent', writer => {
  9336. for ( const rootName of Object.keys( initialData ) ) {
  9337. const modelRoot = this.model.document.getRoot( rootName );
  9338. writer.insert( this.parse( initialData[ rootName ], modelRoot ), modelRoot, 0 );
  9339. }
  9340. } );
  9341. return Promise.resolve();
  9342. }
  9343. /**
  9344. * Sets input data parsed by the {@link #processor data processor} and
  9345. * converted by the {@link #upcastDispatcher view-to-model converters}.
  9346. * This method can be used any time to replace existing editor data by the new one without clearing the
  9347. * {@link module:engine/model/document~Document#history document history}.
  9348. *
  9349. * This method also creates a batch with all the changes applied. If all you need is to parse data, use
  9350. * the {@link #parse} method.
  9351. *
  9352. * When data is passed as a string it is set on a default `main` root:
  9353. *
  9354. * dataController.set( '<p>Foo</p>' ); // Sets data on the `main` root.
  9355. *
  9356. * To set data on a different root or multiple roots at once, object containing `rootName` - `data` pairs should be passed:
  9357. *
  9358. * dataController.set( { main: '<p>Foo</p>', title: '<h1>Bar</h1>' } ); // Sets data on the `main` and `title` roots.
  9359. *
  9360. * @fires set
  9361. * @param {String|Object.<String,String>} data Input data as a string or an object containing `rootName` - `data`
  9362. * pairs to set data on multiple roots at once.
  9363. */
  9364. set( data ) {
  9365. let newData = {};
  9366. if ( typeof data === 'string' ) {
  9367. newData.main = data; // Default root is 'main'. To set data on a different root, object should be passed.
  9368. } else {
  9369. newData = data;
  9370. }
  9371. if ( !this._checkIfRootsExists( Object.keys( newData ) ) ) {
  9372. /**
  9373. * Cannot set data on a non-existing root. This error is thrown when {@link #set DataController#set() method}
  9374. * is called with non-existent root name. For example, if there is an editor instance with only `main` root,
  9375. * calling {@link #set} like:
  9376. *
  9377. * data.set( { main: '<p>Foo</p>', root2: '<p>Bar</p>' } );
  9378. *
  9379. * will throw this error.
  9380. *
  9381. * @error datacontroller-set-non-existent-root
  9382. */
  9383. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__["default"]( 'datacontroller-set-non-existent-root', this );
  9384. }
  9385. this.model.enqueueChange( 'transparent', writer => {
  9386. writer.setSelection( null );
  9387. writer.removeSelectionAttribute( this.model.document.selection.getAttributeKeys() );
  9388. for ( const rootName of Object.keys( newData ) ) {
  9389. // Save to model.
  9390. const modelRoot = this.model.document.getRoot( rootName );
  9391. writer.remove( writer.createRangeIn( modelRoot ) );
  9392. writer.insert( this.parse( newData[ rootName ], modelRoot ), modelRoot, 0 );
  9393. }
  9394. } );
  9395. }
  9396. /**
  9397. * Returns the data parsed by the {@link #processor data processor} and then converted by upcast converters
  9398. * attached to the {@link #upcastDispatcher}.
  9399. *
  9400. * @see #set
  9401. * @param {String} data Data to parse.
  9402. * @param {module:engine/model/schema~SchemaContextDefinition} [context='$root'] Base context in which the view will
  9403. * be converted to the model. See: {@link module:engine/conversion/upcastdispatcher~UpcastDispatcher#convert}.
  9404. * @returns {module:engine/model/documentfragment~DocumentFragment} Parsed data.
  9405. */
  9406. parse( data, context = '$root' ) {
  9407. // data -> view
  9408. const viewDocumentFragment = this.processor.toView( data );
  9409. // view -> model
  9410. return this.toModel( viewDocumentFragment, context );
  9411. }
  9412. /**
  9413. * Returns the result of the given {@link module:engine/view/element~Element view element} or
  9414. * {@link module:engine/view/documentfragment~DocumentFragment view document fragment} converted by the
  9415. * {@link #upcastDispatcher view-to-model converters}, wrapped by {@link module:engine/model/documentfragment~DocumentFragment}.
  9416. *
  9417. * When marker elements were converted during the conversion process, it will be set as a document fragment's
  9418. * {@link module:engine/model/documentfragment~DocumentFragment#markers static markers map}.
  9419. *
  9420. * @param {module:engine/view/element~Element|module:engine/view/documentfragment~DocumentFragment} viewElementOrFragment
  9421. * Element or document fragment whose content will be converted.
  9422. * @param {module:engine/model/schema~SchemaContextDefinition} [context='$root'] Base context in which the view will
  9423. * be converted to the model. See: {@link module:engine/conversion/upcastdispatcher~UpcastDispatcher#convert}.
  9424. * @returns {module:engine/model/documentfragment~DocumentFragment} Output document fragment.
  9425. */
  9426. toModel( viewElementOrFragment, context = '$root' ) {
  9427. return this.model.change( writer => {
  9428. return this.upcastDispatcher.convert( viewElementOrFragment, writer, context );
  9429. } );
  9430. }
  9431. /**
  9432. * Adds a style processor normalization rules.
  9433. *
  9434. * You can implement your own rules as well as use one of the available processor rules:
  9435. *
  9436. * * background: {@link module:engine/view/styles/background~addBackgroundRules}
  9437. * * border: {@link module:engine/view/styles/border~addBorderRules}
  9438. * * margin: {@link module:engine/view/styles/margin~addMarginRules}
  9439. * * padding: {@link module:engine/view/styles/padding~addPaddingRules}
  9440. *
  9441. * @param {Function} callback
  9442. */
  9443. addStyleProcessorRules( callback ) {
  9444. callback( this.stylesProcessor );
  9445. }
  9446. /**
  9447. * Registers a {@link module:engine/view/matcher~MatcherPattern} on {@link #htmlProcessor htmlProcessor}
  9448. * and {@link #processor processor} for view elements whose content should be treated as a raw data
  9449. * and not processed during conversion from DOM to view elements.
  9450. *
  9451. * The raw data can be later accessed by {@link module:engine/view/element~Element#getCustomProperty view element custom property}
  9452. * `"$rawContent"`.
  9453. *
  9454. * @param {module:engine/view/matcher~MatcherPattern} pattern Pattern matching all view elements whose content should
  9455. * be treated as a raw data.
  9456. */
  9457. registerRawContentMatcher( pattern ) {
  9458. // No need to register the pattern if both `htmlProcessor` and `processor` are the same instances.
  9459. if ( this.processor && this.processor !== this.htmlProcessor ) {
  9460. this.processor.registerRawContentMatcher( pattern );
  9461. }
  9462. this.htmlProcessor.registerRawContentMatcher( pattern );
  9463. }
  9464. /**
  9465. * Removes all event listeners set by the DataController.
  9466. */
  9467. destroy() {
  9468. this.stopListening();
  9469. }
  9470. /**
  9471. * Checks if all provided root names are existing editor roots.
  9472. *
  9473. * @private
  9474. * @param {Array.<String>} rootNames Root names to check.
  9475. * @returns {Boolean} Whether all provided root names are existing editor roots.
  9476. */
  9477. _checkIfRootsExists( rootNames ) {
  9478. for ( const rootName of rootNames ) {
  9479. if ( !this.model.document.getRootNames().includes( rootName ) ) {
  9480. return false;
  9481. }
  9482. }
  9483. return true;
  9484. }
  9485. /**
  9486. * Event fired once the data initialization has finished.
  9487. *
  9488. * @event ready
  9489. */
  9490. /**
  9491. * Event fired after the {@link #init `init()` method} was run. It can be {@link #listenTo listened to} in order to adjust or modify
  9492. * the initialization flow. However, if the `init` event is stopped or prevented, the {@link #event:ready `ready` event}
  9493. * should be fired manually.
  9494. *
  9495. * The `init` event is fired by the decorated {@link #init} method.
  9496. * See {@link module:utils/observablemixin~ObservableMixin#decorate} for more information and samples.
  9497. *
  9498. * @event init
  9499. */
  9500. /**
  9501. * Event fired after {@link #set set() method} has been run.
  9502. *
  9503. * The `set` event is fired by decorated {@link #set} method.
  9504. * See {@link module:utils/observablemixin~ObservableMixin#decorate} for more information and samples.
  9505. *
  9506. * @event set
  9507. */
  9508. }
  9509. Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_0__["default"])( DataController, _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_1__["default"] );
  9510. // Helper function for downcast conversion.
  9511. //
  9512. // Takes a document element (element that is added to a model document) and checks which markers are inside it
  9513. // and which markers are containing it. If the marker is intersecting with element, the intersection is returned.
  9514. function _getMarkersRelativeToElement( element ) {
  9515. const result = [];
  9516. const doc = element.root.document;
  9517. if ( !doc ) {
  9518. return [];
  9519. }
  9520. const elementRange = _model_range__WEBPACK_IMPORTED_MODULE_11__["default"]._createIn( element );
  9521. for ( const marker of doc.model.markers ) {
  9522. const intersection = elementRange.getIntersection( marker.getRange() );
  9523. if ( intersection ) {
  9524. result.push( [ marker.name, intersection ] );
  9525. }
  9526. }
  9527. return result;
  9528. }
  9529. /***/ }),
  9530. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/controller/editingcontroller.js":
  9531. /*!*************************************************************************************!*\
  9532. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/controller/editingcontroller.js ***!
  9533. \*************************************************************************************/
  9534. /*! exports provided: default */
  9535. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  9536. "use strict";
  9537. __webpack_require__.r(__webpack_exports__);
  9538. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return EditingController; });
  9539. /* harmony import */ var _view_rooteditableelement__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../view/rooteditableelement */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/rooteditableelement.js");
  9540. /* harmony import */ var _view_view__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../view/view */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/view.js");
  9541. /* harmony import */ var _conversion_mapper__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../conversion/mapper */ "./node_modules/@ckeditor/ckeditor5-engine/src/conversion/mapper.js");
  9542. /* harmony import */ var _conversion_downcastdispatcher__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../conversion/downcastdispatcher */ "./node_modules/@ckeditor/ckeditor5-engine/src/conversion/downcastdispatcher.js");
  9543. /* harmony import */ var _conversion_downcasthelpers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../conversion/downcasthelpers */ "./node_modules/@ckeditor/ckeditor5-engine/src/conversion/downcasthelpers.js");
  9544. /* 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");
  9545. /* 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");
  9546. /* harmony import */ var _conversion_upcasthelpers__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../conversion/upcasthelpers */ "./node_modules/@ckeditor/ckeditor5-engine/src/conversion/upcasthelpers.js");
  9547. /**
  9548. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  9549. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  9550. */
  9551. /**
  9552. * @module engine/controller/editingcontroller
  9553. */
  9554. // @if CK_DEBUG_ENGINE // const { dumpTrees, initDocumentDumping } = require( '../dev-utils/utils' );
  9555. /**
  9556. * Controller for the editing pipeline. The editing pipeline controls {@link ~EditingController#model model} rendering,
  9557. * including selection handling. It also creates the {@link ~EditingController#view view} which builds a
  9558. * browser-independent virtualization over the DOM elements. The editing controller also attaches default converters.
  9559. *
  9560. * @mixes module:utils/observablemixin~ObservableMixin
  9561. */
  9562. class EditingController {
  9563. /**
  9564. * Creates an editing controller instance.
  9565. *
  9566. * @param {module:engine/model/model~Model} model Editing model.
  9567. * @param {module:engine/view/stylesmap~StylesProcessor} stylesProcessor The styles processor instance.
  9568. */
  9569. constructor( model, stylesProcessor ) {
  9570. /**
  9571. * Editor model.
  9572. *
  9573. * @readonly
  9574. * @member {module:engine/model/model~Model}
  9575. */
  9576. this.model = model;
  9577. /**
  9578. * Editing view controller.
  9579. *
  9580. * @readonly
  9581. * @member {module:engine/view/view~View}
  9582. */
  9583. this.view = new _view_view__WEBPACK_IMPORTED_MODULE_1__["default"]( stylesProcessor );
  9584. /**
  9585. * Mapper which describes the model-view binding.
  9586. *
  9587. * @readonly
  9588. * @member {module:engine/conversion/mapper~Mapper}
  9589. */
  9590. this.mapper = new _conversion_mapper__WEBPACK_IMPORTED_MODULE_2__["default"]();
  9591. /**
  9592. * Downcast dispatcher that converts changes from the model to {@link #view the editing view}.
  9593. *
  9594. * @readonly
  9595. * @member {module:engine/conversion/downcastdispatcher~DowncastDispatcher} #downcastDispatcher
  9596. */
  9597. this.downcastDispatcher = new _conversion_downcastdispatcher__WEBPACK_IMPORTED_MODULE_3__["default"]( {
  9598. mapper: this.mapper,
  9599. schema: model.schema
  9600. } );
  9601. const doc = this.model.document;
  9602. const selection = doc.selection;
  9603. const markers = this.model.markers;
  9604. // When plugins listen on model changes (on selection change, post fixers, etc.) and change the view as a result of
  9605. // model's change, they might trigger view rendering before the conversion is completed (e.g. before the selection
  9606. // is converted). We disable rendering for the length of the outermost model change() block to prevent that.
  9607. //
  9608. // See https://github.com/ckeditor/ckeditor5-engine/issues/1528
  9609. this.listenTo( this.model, '_beforeChanges', () => {
  9610. this.view._disableRendering( true );
  9611. }, { priority: 'highest' } );
  9612. this.listenTo( this.model, '_afterChanges', () => {
  9613. this.view._disableRendering( false );
  9614. }, { priority: 'lowest' } );
  9615. // Whenever model document is changed, convert those changes to the view (using model.Document#differ).
  9616. // Do it on 'low' priority, so changes are converted after other listeners did their job.
  9617. // Also convert model selection.
  9618. this.listenTo( doc, 'change', () => {
  9619. this.view.change( writer => {
  9620. this.downcastDispatcher.convertChanges( doc.differ, markers, writer );
  9621. this.downcastDispatcher.convertSelection( selection, markers, writer );
  9622. } );
  9623. }, { priority: 'low' } );
  9624. // Convert selection from the view to the model when it changes in the view.
  9625. this.listenTo( this.view.document, 'selectionChange', Object(_conversion_upcasthelpers__WEBPACK_IMPORTED_MODULE_7__["convertSelectionChange"])( this.model, this.mapper ) );
  9626. // Attach default model converters.
  9627. this.downcastDispatcher.on( 'insert:$text', Object(_conversion_downcasthelpers__WEBPACK_IMPORTED_MODULE_4__["insertText"])(), { priority: 'lowest' } );
  9628. this.downcastDispatcher.on( 'remove', Object(_conversion_downcasthelpers__WEBPACK_IMPORTED_MODULE_4__["remove"])(), { priority: 'low' } );
  9629. // Attach default model selection converters.
  9630. this.downcastDispatcher.on( 'selection', Object(_conversion_downcasthelpers__WEBPACK_IMPORTED_MODULE_4__["clearAttributes"])(), { priority: 'low' } );
  9631. this.downcastDispatcher.on( 'selection', Object(_conversion_downcasthelpers__WEBPACK_IMPORTED_MODULE_4__["convertRangeSelection"])(), { priority: 'low' } );
  9632. this.downcastDispatcher.on( 'selection', Object(_conversion_downcasthelpers__WEBPACK_IMPORTED_MODULE_4__["convertCollapsedSelection"])(), { priority: 'low' } );
  9633. // Binds {@link module:engine/view/document~Document#roots view roots collection} to
  9634. // {@link module:engine/model/document~Document#roots model roots collection} so creating
  9635. // model root automatically creates corresponding view root.
  9636. this.view.document.roots.bindTo( this.model.document.roots ).using( root => {
  9637. // $graveyard is a special root that has no reflection in the view.
  9638. if ( root.rootName == '$graveyard' ) {
  9639. return null;
  9640. }
  9641. const viewRoot = new _view_rooteditableelement__WEBPACK_IMPORTED_MODULE_0__["default"]( this.view.document, root.name );
  9642. viewRoot.rootName = root.rootName;
  9643. this.mapper.bindElements( root, viewRoot );
  9644. return viewRoot;
  9645. } );
  9646. // @if CK_DEBUG_ENGINE // initDocumentDumping( this.model.document );
  9647. // @if CK_DEBUG_ENGINE // initDocumentDumping( this.view.document );
  9648. // @if CK_DEBUG_ENGINE // dumpTrees( this.model.document, this.model.document.version );
  9649. // @if CK_DEBUG_ENGINE // dumpTrees( this.view.document, this.model.document.version );
  9650. // @if CK_DEBUG_ENGINE // this.model.document.on( 'change', () => {
  9651. // @if CK_DEBUG_ENGINE // dumpTrees( this.view.document, this.model.document.version );
  9652. // @if CK_DEBUG_ENGINE // }, { priority: 'lowest' } );
  9653. }
  9654. /**
  9655. * Removes all event listeners attached to the `EditingController`. Destroys all objects created
  9656. * by `EditingController` that need to be destroyed.
  9657. */
  9658. destroy() {
  9659. this.view.destroy();
  9660. this.stopListening();
  9661. }
  9662. }
  9663. Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_6__["default"])( EditingController, _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_5__["default"] );
  9664. /***/ }),
  9665. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/conversion/conversion.js":
  9666. /*!******************************************************************************!*\
  9667. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/conversion/conversion.js ***!
  9668. \******************************************************************************/
  9669. /*! exports provided: default */
  9670. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  9671. "use strict";
  9672. __webpack_require__.r(__webpack_exports__);
  9673. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Conversion; });
  9674. /* 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");
  9675. /* harmony import */ var _upcasthelpers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./upcasthelpers */ "./node_modules/@ckeditor/ckeditor5-engine/src/conversion/upcasthelpers.js");
  9676. /* harmony import */ var _downcasthelpers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./downcasthelpers */ "./node_modules/@ckeditor/ckeditor5-engine/src/conversion/downcasthelpers.js");
  9677. /* harmony import */ var _ckeditor_ckeditor5_utils_src_toarray__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/toarray */ "./node_modules/@ckeditor/ckeditor5-utils/src/toarray.js");
  9678. /**
  9679. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  9680. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  9681. */
  9682. /**
  9683. * @module engine/conversion/conversion
  9684. */
  9685. /**
  9686. * A utility class that helps add converters to upcast and downcast dispatchers.
  9687. *
  9688. * We recommend reading the {@glink framework/guides/architecture/editing-engine Editing engine architecture} guide first to
  9689. * understand the core concepts of the conversion mechanisms.
  9690. *
  9691. * An instance of the conversion manager is available in the
  9692. * {@link module:core/editor/editor~Editor#conversion `editor.conversion`} property
  9693. * and by default has the following groups of dispatchers (i.e. directions of conversion):
  9694. *
  9695. * * `downcast` (editing and data downcasts)
  9696. * * `editingDowncast`
  9697. * * `dataDowncast`
  9698. * * `upcast`
  9699. *
  9700. * # One-way converters
  9701. *
  9702. * To add a converter to a specific group, use the {@link module:engine/conversion/conversion~Conversion#for `for()`}
  9703. * method:
  9704. *
  9705. * // Add a converter to editing downcast and data downcast.
  9706. * editor.conversion.for( 'downcast' ).elementToElement( config ) );
  9707. *
  9708. * // Add a converter to the data pipepline only:
  9709. * editor.conversion.for( 'dataDowncast' ).elementToElement( dataConversionConfig ) );
  9710. *
  9711. * // And a slightly different one for the editing pipeline:
  9712. * editor.conversion.for( 'editingDowncast' ).elementToElement( editingConversionConfig ) );
  9713. *
  9714. * See {@link module:engine/conversion/conversion~Conversion#for `for()`} method documentation to learn more about
  9715. * available conversion helpers and how to use your custom ones.
  9716. *
  9717. * # Two-way converters
  9718. *
  9719. * Besides using one-way converters via the `for()` method, you can also use other methods available in this
  9720. * class to add two-way converters (upcast and downcast):
  9721. *
  9722. * * {@link module:engine/conversion/conversion~Conversion#elementToElement `elementToElement()`} &ndash;
  9723. * Model element to view element and vice versa.
  9724. * * {@link module:engine/conversion/conversion~Conversion#attributeToElement `attributeToElement()`} &ndash;
  9725. * Model attribute to view element and vice versa.
  9726. * * {@link module:engine/conversion/conversion~Conversion#attributeToAttribute `attributeToAttribute()`} &ndash;
  9727. * Model attribute to view element and vice versa.
  9728. */
  9729. class Conversion {
  9730. /**
  9731. * Creates a new conversion instance.
  9732. *
  9733. * @param {module:engine/conversion/downcastdispatcher~DowncastDispatcher|
  9734. * Array.<module:engine/conversion/downcastdispatcher~DowncastDispatcher>} downcastDispatchers
  9735. * @param {module:engine/conversion/upcastdispatcher~UpcastDispatcher|
  9736. * Array.<module:engine/conversion/upcastdispatcher~UpcastDispatcher>} upcastDispatchers
  9737. */
  9738. constructor( downcastDispatchers, upcastDispatchers ) {
  9739. /**
  9740. * Maps dispatchers group name to ConversionHelpers instances.
  9741. *
  9742. * @private
  9743. * @member {Map.<String,module:engine/conversion/conversionhelpers~ConversionHelpers>}
  9744. */
  9745. this._helpers = new Map();
  9746. // Define default 'downcast' & 'upcast' dispatchers groups. Those groups are always available as two-way converters needs them.
  9747. this._downcast = Object(_ckeditor_ckeditor5_utils_src_toarray__WEBPACK_IMPORTED_MODULE_3__["default"])( downcastDispatchers );
  9748. this._createConversionHelpers( { name: 'downcast', dispatchers: this._downcast, isDowncast: true } );
  9749. this._upcast = Object(_ckeditor_ckeditor5_utils_src_toarray__WEBPACK_IMPORTED_MODULE_3__["default"])( upcastDispatchers );
  9750. this._createConversionHelpers( { name: 'upcast', dispatchers: this._upcast, isDowncast: false } );
  9751. }
  9752. /**
  9753. * Define an alias for registered dispatcher.
  9754. *
  9755. * const conversion = new Conversion(
  9756. * [ dataDowncastDispatcher, editingDowncastDispatcher ],
  9757. * upcastDispatcher
  9758. * );
  9759. *
  9760. * conversion.addAlias( 'dataDowncast', dataDowncastDispatcher );
  9761. *
  9762. * @param {String} alias An alias of a dispatcher.
  9763. * @param {module:engine/conversion/downcastdispatcher~DowncastDispatcher|
  9764. * module:engine/conversion/upcastdispatcher~UpcastDispatcher} dispatcher Dispatcher which should have an alias.
  9765. */
  9766. addAlias( alias, dispatcher ) {
  9767. const isDowncast = this._downcast.includes( dispatcher );
  9768. const isUpcast = this._upcast.includes( dispatcher );
  9769. if ( !isUpcast && !isDowncast ) {
  9770. /**
  9771. * Trying to register and alias for a dispatcher that nas not been registered.
  9772. *
  9773. * @error conversion-add-alias-dispatcher-not-registered
  9774. */
  9775. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"](
  9776. 'conversion-add-alias-dispatcher-not-registered',
  9777. this
  9778. );
  9779. }
  9780. this._createConversionHelpers( { name: alias, dispatchers: [ dispatcher ], isDowncast } );
  9781. }
  9782. /**
  9783. * Provides a chainable API to assign converters to conversion dispatchers group.
  9784. *
  9785. * If the given group name has not been registered, the
  9786. * {@link module:utils/ckeditorerror~CKEditorError `conversion-for-unknown-group` error} is thrown.
  9787. *
  9788. * You can use conversion helpers available directly in the `for()` chain or your custom ones via
  9789. * the {@link module:engine/conversion/conversionhelpers~ConversionHelpers#add `add()`} method.
  9790. *
  9791. * # Using bulit-in conversion helpers
  9792. *
  9793. * The `for()` chain comes with a set of conversion helpers which you can use like this:
  9794. *
  9795. * editor.conversion.for( 'downcast' )
  9796. * .elementToElement( config1 ) // Adds an element-to-element downcast converter.
  9797. * .attributeToElement( config2 ); // Adds an attribute-to-element downcast converter.
  9798. *
  9799. * editor.conversion.for( 'upcast' )
  9800. * .elementToAttribute( config3 ); // Adds an element-to-attribute upcast converter.
  9801. *
  9802. * Refer to the documentation of built-in conversion helpers to learn about their configuration options.
  9803. *
  9804. * * downcast (model-to-view) conversion helpers:
  9805. *
  9806. * * {@link module:engine/conversion/downcasthelpers~DowncastHelpers#elementToElement `elementToElement()`},
  9807. * * {@link module:engine/conversion/downcasthelpers~DowncastHelpers#attributeToElement `attributeToElement()`},
  9808. * * {@link module:engine/conversion/downcasthelpers~DowncastHelpers#attributeToAttribute `attributeToAttribute()`}.
  9809. * * {@link module:engine/conversion/downcasthelpers~DowncastHelpers#markerToElement `markerToElement()`}.
  9810. * * {@link module:engine/conversion/downcasthelpers~DowncastHelpers#markerToHighlight `markerToHighlight()`}.
  9811. *
  9812. * * upcast (view-to-model) conversion helpers:
  9813. *
  9814. * * {@link module:engine/conversion/upcasthelpers~UpcastHelpers#elementToElement `elementToElement()`},
  9815. * * {@link module:engine/conversion/upcasthelpers~UpcastHelpers#elementToAttribute `elementToAttribute()`},
  9816. * * {@link module:engine/conversion/upcasthelpers~UpcastHelpers#attributeToAttribute `attributeToAttribute()`}.
  9817. * * {@link module:engine/conversion/upcasthelpers~UpcastHelpers#elementToMarker `elementToMarker()`}.
  9818. *
  9819. * # Using custom conversion helpers
  9820. *
  9821. * If you need to implement a nontypical converter, you can do so by calling:
  9822. *
  9823. * editor.conversion.for( direction ).add( customHelper );
  9824. *
  9825. * The `.add()` method takes exactly one parameter, which is a function. This function should accept one parameter that
  9826. * is a dispatcher instance. The function should add an actual converter to the passed dispatcher instance.
  9827. *
  9828. * Example:
  9829. *
  9830. * editor.conversion.for( 'upcast' ).add( dispatcher => {
  9831. * dispatcher.on( 'element:a', ( evt, data, conversionApi ) => {
  9832. * // Do something with a view <a> element.
  9833. * } );
  9834. * } );
  9835. *
  9836. * Refer to the documentation of {@link module:engine/conversion/upcastdispatcher~UpcastDispatcher}
  9837. * and {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher} to learn how to write
  9838. * custom converters.
  9839. *
  9840. * @param {String} groupName The name of dispatchers group to add the converters to.
  9841. * @returns {module:engine/conversion/downcasthelpers~DowncastHelpers|module:engine/conversion/upcasthelpers~UpcastHelpers}
  9842. */
  9843. for( groupName ) {
  9844. if ( !this._helpers.has( groupName ) ) {
  9845. /**
  9846. * Trying to add a converter to an unknown dispatchers group.
  9847. *
  9848. * @error conversion-for-unknown-group
  9849. */
  9850. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"]( 'conversion-for-unknown-group', this );
  9851. }
  9852. return this._helpers.get( groupName );
  9853. }
  9854. /**
  9855. * Sets up converters between the model and the view that convert a model element to a view element (and vice versa).
  9856. * For example, the model `<paragraph>Foo</paragraph>` is `<p>Foo</p>` in the view.
  9857. *
  9858. * // A simple conversion from the `paragraph` model element to the `<p>` view element (and vice versa).
  9859. * editor.conversion.elementToElement( { model: 'paragraph', view: 'p' } );
  9860. *
  9861. * // Override other converters by specifying a converter definition with a higher priority.
  9862. * editor.conversion.elementToElement( { model: 'paragraph', view: 'div', converterPriority: 'high' } );
  9863. *
  9864. * // View specified as an object instead of a string.
  9865. * editor.conversion.elementToElement( {
  9866. * model: 'fancyParagraph',
  9867. * view: {
  9868. * name: 'p',
  9869. * classes: 'fancy'
  9870. * }
  9871. * } );
  9872. *
  9873. * // Use `upcastAlso` to define other view elements that should also be converted to a `paragraph` element.
  9874. * editor.conversion.elementToElement( {
  9875. * model: 'paragraph',
  9876. * view: 'p',
  9877. * upcastAlso: [
  9878. * 'div',
  9879. * {
  9880. * // Any element with the `display: block` style.
  9881. * styles: {
  9882. * display: 'block'
  9883. * }
  9884. * }
  9885. * ]
  9886. * } );
  9887. *
  9888. * // `upcastAlso` set as callback enables a conversion of a wide range of different view elements.
  9889. * editor.conversion.elementToElement( {
  9890. * model: 'heading',
  9891. * view: 'h2',
  9892. * // Convert "heading-like" paragraphs to headings.
  9893. * upcastAlso: viewElement => {
  9894. * const fontSize = viewElement.getStyle( 'font-size' );
  9895. *
  9896. * if ( !fontSize ) {
  9897. * return null;
  9898. * }
  9899. *
  9900. * const match = fontSize.match( /(\d+)\s*px/ );
  9901. *
  9902. * if ( !match ) {
  9903. * return null;
  9904. * }
  9905. *
  9906. * const size = Number( match[ 1 ] );
  9907. *
  9908. * if ( size > 26 ) {
  9909. * // Returned value can be an object with the matched properties.
  9910. * // These properties will be "consumed" during the conversion.
  9911. * // See `engine.view.Matcher~MatcherPattern` and `engine.view.Matcher#match` for more details.
  9912. *
  9913. * return { name: true, styles: [ 'font-size' ] };
  9914. * }
  9915. *
  9916. * return null;
  9917. * }
  9918. * } );
  9919. *
  9920. * `definition.model` is a `String` with a model element name to convert from or to.
  9921. * See {@link module:engine/conversion/conversion~ConverterDefinition} to learn about other parameters.
  9922. *
  9923. * @param {module:engine/conversion/conversion~ConverterDefinition} definition The converter definition.
  9924. */
  9925. elementToElement( definition ) {
  9926. // Set up downcast converter.
  9927. this.for( 'downcast' ).elementToElement( definition );
  9928. // Set up upcast converter.
  9929. for ( const { model, view } of _getAllUpcastDefinitions( definition ) ) {
  9930. this.for( 'upcast' )
  9931. .elementToElement( {
  9932. model,
  9933. view,
  9934. converterPriority: definition.converterPriority
  9935. } );
  9936. }
  9937. }
  9938. /**
  9939. * Sets up converters between the model and the view that convert a model attribute to a view element (and vice versa).
  9940. * For example, a model text node with `"Foo"` as data and the `bold` attribute is `<strong>Foo</strong>` in the view.
  9941. *
  9942. * // A simple conversion from the `bold=true` attribute to the `<strong>` view element (and vice versa).
  9943. * editor.conversion.attributeToElement( { model: 'bold', view: 'strong' } );
  9944. *
  9945. * // Override other converters by specifying a converter definition with a higher priority.
  9946. * editor.conversion.attributeToElement( { model: 'bold', view: 'b', converterPriority: 'high' } );
  9947. *
  9948. * // View specified as an object instead of a string.
  9949. * editor.conversion.attributeToElement( {
  9950. * model: 'bold',
  9951. * view: {
  9952. * name: 'span',
  9953. * classes: 'bold'
  9954. * }
  9955. * } );
  9956. *
  9957. * // Use `config.model.name` to define the conversion only from a given node type, `$text` in this case.
  9958. * // The same attribute on different elements may then be handled by a different converter.
  9959. * editor.conversion.attributeToElement( {
  9960. * model: {
  9961. * key: 'textDecoration',
  9962. * values: [ 'underline', 'lineThrough' ],
  9963. * name: '$text'
  9964. * },
  9965. * view: {
  9966. * underline: {
  9967. * name: 'span',
  9968. * styles: {
  9969. * 'text-decoration': 'underline'
  9970. * }
  9971. * },
  9972. * lineThrough: {
  9973. * name: 'span',
  9974. * styles: {
  9975. * 'text-decoration': 'line-through'
  9976. * }
  9977. * }
  9978. * }
  9979. * } );
  9980. *
  9981. * // Use `upcastAlso` to define other view elements that should also be converted to the `bold` attribute.
  9982. * editor.conversion.attributeToElement( {
  9983. * model: 'bold',
  9984. * view: 'strong',
  9985. * upcastAlso: [
  9986. * 'b',
  9987. * {
  9988. * name: 'span',
  9989. * classes: 'bold'
  9990. * },
  9991. * {
  9992. * name: 'span',
  9993. * styles: {
  9994. * 'font-weight': 'bold'
  9995. * }
  9996. * },
  9997. * viewElement => {
  9998. * const fontWeight = viewElement.getStyle( 'font-weight' );
  9999. *
  10000. * if ( viewElement.is( 'element', 'span' ) && fontWeight && /\d+/.test() && Number( fontWeight ) > 500 ) {
  10001. * // Returned value can be an object with the matched properties.
  10002. * // These properties will be "consumed" during the conversion.
  10003. * // See `engine.view.Matcher~MatcherPattern` and `engine.view.Matcher#match` for more details.
  10004. *
  10005. * return {
  10006. * name: true,
  10007. * styles: [ 'font-weight' ]
  10008. * };
  10009. * }
  10010. * }
  10011. * ]
  10012. * } );
  10013. *
  10014. * // Conversion from and to a model attribute key whose value is an enum (`fontSize=big|small`).
  10015. * // `upcastAlso` set as callback enables a conversion of a wide range of different view elements.
  10016. * editor.conversion.attributeToElement( {
  10017. * model: {
  10018. * key: 'fontSize',
  10019. * values: [ 'big', 'small' ]
  10020. * },
  10021. * view: {
  10022. * big: {
  10023. * name: 'span',
  10024. * styles: {
  10025. * 'font-size': '1.2em'
  10026. * }
  10027. * },
  10028. * small: {
  10029. * name: 'span',
  10030. * styles: {
  10031. * 'font-size': '0.8em'
  10032. * }
  10033. * }
  10034. * },
  10035. * upcastAlso: {
  10036. * big: viewElement => {
  10037. * const fontSize = viewElement.getStyle( 'font-size' );
  10038. *
  10039. * if ( !fontSize ) {
  10040. * return null;
  10041. * }
  10042. *
  10043. * const match = fontSize.match( /(\d+)\s*px/ );
  10044. *
  10045. * if ( !match ) {
  10046. * return null;
  10047. * }
  10048. *
  10049. * const size = Number( match[ 1 ] );
  10050. *
  10051. * if ( viewElement.is( 'element', 'span' ) && size > 10 ) {
  10052. * // Returned value can be an object with the matched properties.
  10053. * // These properties will be "consumed" during the conversion.
  10054. * // See `engine.view.Matcher~MatcherPattern` and `engine.view.Matcher#match` for more details.
  10055. *
  10056. * return { name: true, styles: [ 'font-size' ] };
  10057. * }
  10058. *
  10059. * return null;
  10060. * },
  10061. * small: viewElement => {
  10062. * const fontSize = viewElement.getStyle( 'font-size' );
  10063. *
  10064. * if ( !fontSize ) {
  10065. * return null;
  10066. * }
  10067. *
  10068. * const match = fontSize.match( /(\d+)\s*px/ );
  10069. *
  10070. * if ( !match ) {
  10071. * return null;
  10072. * }
  10073. *
  10074. * const size = Number( match[ 1 ] );
  10075. *
  10076. * if ( viewElement.is( 'element', 'span' ) && size < 10 ) {
  10077. * // Returned value can be an object with the matched properties.
  10078. * // These properties will be "consumed" during the conversion.
  10079. * // See `engine.view.Matcher~MatcherPattern` and `engine.view.Matcher#match` for more details.
  10080. *
  10081. * return { name: true, styles: [ 'font-size' ] };
  10082. * }
  10083. *
  10084. * return null;
  10085. * }
  10086. * }
  10087. * } );
  10088. *
  10089. * The `definition.model` parameter specifies which model attribute should be converted from or to. It can be a `{ key, value }` object
  10090. * describing the attribute key and value to convert or a `String` specifying just the attribute key (then `value` is set to `true`).
  10091. * See {@link module:engine/conversion/conversion~ConverterDefinition} to learn about other parameters.
  10092. *
  10093. * @param {module:engine/conversion/conversion~ConverterDefinition} definition The converter definition.
  10094. */
  10095. attributeToElement( definition ) {
  10096. // Set up downcast converter.
  10097. this.for( 'downcast' ).attributeToElement( definition );
  10098. // Set up upcast converter.
  10099. for ( const { model, view } of _getAllUpcastDefinitions( definition ) ) {
  10100. this.for( 'upcast' )
  10101. .elementToAttribute( {
  10102. view,
  10103. model,
  10104. converterPriority: definition.converterPriority
  10105. } );
  10106. }
  10107. }
  10108. /**
  10109. * Sets up converters between the model and the view that convert a model attribute to a view attribute (and vice versa).
  10110. * For example, `<image src='foo.jpg'></image>` is converted to `<img src='foo.jpg'></img>` (the same attribute key and value).
  10111. * This type of converters is intended to be used with {@link module:engine/model/element~Element model element} nodes.
  10112. * To convert text attributes {@link module:engine/conversion/conversion~Conversion#attributeToElement `attributeToElement converter`}
  10113. * should be set up.
  10114. *
  10115. * // A simple conversion from the `source` model attribute to the `src` view attribute (and vice versa).
  10116. * editor.conversion.attributeToAttribute( { model: 'source', view: 'src' } );
  10117. *
  10118. * // Attribute values are strictly specified.
  10119. * editor.conversion.attributeToAttribute( {
  10120. * model: {
  10121. * name: 'image',
  10122. * key: 'aside',
  10123. * values: [ 'aside' ]
  10124. * },
  10125. * view: {
  10126. * aside: {
  10127. * name: 'img',
  10128. * key: 'class',
  10129. * value: [ 'aside', 'half-size' ]
  10130. * }
  10131. * }
  10132. * } );
  10133. *
  10134. * // Set the style attribute.
  10135. * editor.conversion.attributeToAttribute( {
  10136. * model: {
  10137. * name: 'image',
  10138. * key: 'aside',
  10139. * values: [ 'aside' ]
  10140. * },
  10141. * view: {
  10142. * aside: {
  10143. * name: 'img',
  10144. * key: 'style',
  10145. * value: {
  10146. * float: 'right',
  10147. * width: '50%',
  10148. * margin: '5px'
  10149. * }
  10150. * }
  10151. * }
  10152. * } );
  10153. *
  10154. * // Conversion from and to a model attribute key whose value is an enum (`align=right|center`).
  10155. * // Use `upcastAlso` to define other view elements that should also be converted to the `align=right` attribute.
  10156. * editor.conversion.attributeToAttribute( {
  10157. * model: {
  10158. * key: 'align',
  10159. * values: [ 'right', 'center' ]
  10160. * },
  10161. * view: {
  10162. * right: {
  10163. * key: 'class',
  10164. * value: 'align-right'
  10165. * },
  10166. * center: {
  10167. * key: 'class',
  10168. * value: 'align-center'
  10169. * }
  10170. * },
  10171. * upcastAlso: {
  10172. * right: {
  10173. * styles: {
  10174. * 'text-align': 'right'
  10175. * }
  10176. * },
  10177. * center: {
  10178. * styles: {
  10179. * 'text-align': 'center'
  10180. * }
  10181. * }
  10182. * }
  10183. * } );
  10184. *
  10185. * The `definition.model` parameter specifies which model attribute should be converted from and to.
  10186. * It can be a `{ key, [ values ], [ name ] }` object or a `String`, which will be treated like `{ key: definition.model }`.
  10187. * The `key` property is the model attribute key to convert from and to.
  10188. * The `values` are the possible model attribute values. If `values` is not set, the model attribute value will be the same as the
  10189. * view attribute value.
  10190. * If `name` is set, the conversion will be set up only for model elements with the given name.
  10191. *
  10192. * The `definition.view` parameter specifies which view attribute should be converted from and to.
  10193. * It can be a `{ key, value, [ name ] }` object or a `String`, which will be treated like `{ key: definition.view }`.
  10194. * The `key` property is the view attribute key to convert from and to.
  10195. * The `value` is the view attribute value to convert from and to. If `definition.value` is not set, the view attribute value will be
  10196. * the same as the model attribute value.
  10197. * If `key` is `'class'`, `value` can be a `String` or an array of `String`s.
  10198. * If `key` is `'style'`, `value` is an object with key-value pairs.
  10199. * In other cases, `value` is a `String`.
  10200. * If `name` is set, the conversion will be set up only for model elements with the given name.
  10201. * If `definition.model.values` is set, `definition.view` is an object that assigns values from `definition.model.values`
  10202. * to `{ key, value, [ name ] }` objects.
  10203. *
  10204. * `definition.upcastAlso` specifies which other matching view elements should also be upcast to the given model configuration.
  10205. * If `definition.model.values` is set, `definition.upcastAlso` should be an object assigning values from `definition.model.values`
  10206. * to {@link module:engine/view/matcher~MatcherPattern}s or arrays of {@link module:engine/view/matcher~MatcherPattern}s.
  10207. *
  10208. * **Note:** `definition.model` and `definition.view` form should be mirrored, so the same types of parameters should
  10209. * be given in both parameters.
  10210. *
  10211. * @param {Object} definition The converter definition.
  10212. * @param {String|Object} definition.model The model attribute to convert from and to.
  10213. * @param {String|Object} definition.view The view attribute to convert from and to.
  10214. * @param {module:engine/view/matcher~MatcherPattern|Array.<module:engine/view/matcher~MatcherPattern>} [definition.upcastAlso]
  10215. * Any view element matching `definition.upcastAlso` will also be converted to the given model attribute. `definition.upcastAlso`
  10216. * is used only if `config.model.values` is specified.
  10217. */
  10218. attributeToAttribute( definition ) {
  10219. // Set up downcast converter.
  10220. this.for( 'downcast' ).attributeToAttribute( definition );
  10221. // Set up upcast converter.
  10222. for ( const { model, view } of _getAllUpcastDefinitions( definition ) ) {
  10223. this.for( 'upcast' )
  10224. .attributeToAttribute( {
  10225. view,
  10226. model
  10227. } );
  10228. }
  10229. }
  10230. /**
  10231. * Creates and caches conversion helpers for given dispatchers group.
  10232. *
  10233. * @private
  10234. * @param {Object} options
  10235. * @param {String} options.name Group name.
  10236. * @param {Array.<module:engine/conversion/downcastdispatcher~DowncastDispatcher|
  10237. * module:engine/conversion/upcastdispatcher~UpcastDispatcher>} options.dispatchers
  10238. * @param {Boolean} options.isDowncast
  10239. */
  10240. _createConversionHelpers( { name, dispatchers, isDowncast } ) {
  10241. if ( this._helpers.has( name ) ) {
  10242. /**
  10243. * Trying to register a group name that has already been registered.
  10244. *
  10245. * @error conversion-group-exists
  10246. */
  10247. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"]( 'conversion-group-exists', this );
  10248. }
  10249. const helpers = isDowncast ? new _downcasthelpers__WEBPACK_IMPORTED_MODULE_2__["default"]( dispatchers ) : new _upcasthelpers__WEBPACK_IMPORTED_MODULE_1__["default"]( dispatchers );
  10250. this._helpers.set( name, helpers );
  10251. }
  10252. }
  10253. /**
  10254. * Defines how the model should be converted from and to the view.
  10255. *
  10256. * @typedef {Object} module:engine/conversion/conversion~ConverterDefinition
  10257. *
  10258. * @property {*} [model] The model conversion definition. Describes the model element or model attribute to convert. This parameter differs
  10259. * for different functions that accept `ConverterDefinition`. See the description of the function to learn how to set it.
  10260. * @property {module:engine/view/elementdefinition~ElementDefinition|Object} view The definition of the view element to convert from and
  10261. * to. If `model` describes multiple values, `view` is an object that assigns these values (`view` object keys) to view element definitions
  10262. * (`view` object values).
  10263. * @property {module:engine/view/matcher~MatcherPattern|Array.<module:engine/view/matcher~MatcherPattern>} [upcastAlso]
  10264. * Any view element matching `upcastAlso` will also be converted to the model. If `model` describes multiple values, `upcastAlso`
  10265. * is an object that assigns these values (`upcastAlso` object keys) to {@link module:engine/view/matcher~MatcherPattern}s
  10266. * (`upcastAlso` object values).
  10267. * @property {module:utils/priorities~PriorityString} [converterPriority] The converter priority.
  10268. */
  10269. // Helper function that creates a joint array out of an item passed in `definition.view` and items passed in
  10270. // `definition.upcastAlso`.
  10271. //
  10272. // @param {module:engine/conversion/conversion~ConverterDefinition} definition
  10273. // @returns {Array} Array containing view definitions.
  10274. function* _getAllUpcastDefinitions( definition ) {
  10275. if ( definition.model.values ) {
  10276. for ( const value of definition.model.values ) {
  10277. const model = { key: definition.model.key, value };
  10278. const view = definition.view[ value ];
  10279. const upcastAlso = definition.upcastAlso ? definition.upcastAlso[ value ] : undefined;
  10280. yield* _getUpcastDefinition( model, view, upcastAlso );
  10281. }
  10282. } else {
  10283. yield* _getUpcastDefinition( definition.model, definition.view, definition.upcastAlso );
  10284. }
  10285. }
  10286. function* _getUpcastDefinition( model, view, upcastAlso ) {
  10287. yield { model, view };
  10288. if ( upcastAlso ) {
  10289. for ( const upcastAlsoItem of Object(_ckeditor_ckeditor5_utils_src_toarray__WEBPACK_IMPORTED_MODULE_3__["default"])( upcastAlso ) ) {
  10290. yield { model, view: upcastAlsoItem };
  10291. }
  10292. }
  10293. }
  10294. /***/ }),
  10295. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/conversion/conversionhelpers.js":
  10296. /*!*************************************************************************************!*\
  10297. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/conversion/conversionhelpers.js ***!
  10298. \*************************************************************************************/
  10299. /*! exports provided: default */
  10300. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  10301. "use strict";
  10302. __webpack_require__.r(__webpack_exports__);
  10303. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ConversionHelpers; });
  10304. /**
  10305. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  10306. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  10307. */
  10308. /**
  10309. * @module engine/conversion/conversionhelpers
  10310. */
  10311. /**
  10312. * Base class for conversion helpers.
  10313. */
  10314. class ConversionHelpers {
  10315. /**
  10316. * Creates a conversion helpers instance.
  10317. *
  10318. * @param {Array.<module:engine/conversion/downcastdispatcher~DowncastDispatcher|
  10319. * module:engine/conversion/upcastdispatcher~UpcastDispatcher>} dispatchers
  10320. */
  10321. constructor( dispatchers ) {
  10322. this._dispatchers = dispatchers;
  10323. }
  10324. /**
  10325. * Registers a conversion helper.
  10326. *
  10327. * **Note**: See full usage example in the `{@link module:engine/conversion/conversion~Conversion#for conversion.for()}`
  10328. * method description.
  10329. *
  10330. * @param {Function} conversionHelper The function to be called on event.
  10331. * @returns {module:engine/conversion/downcasthelpers~DowncastHelpers|module:engine/conversion/upcasthelpers~UpcastHelpers}
  10332. */
  10333. add( conversionHelper ) {
  10334. for ( const dispatcher of this._dispatchers ) {
  10335. conversionHelper( dispatcher );
  10336. }
  10337. return this;
  10338. }
  10339. }
  10340. /***/ }),
  10341. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/conversion/downcastdispatcher.js":
  10342. /*!**************************************************************************************!*\
  10343. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/conversion/downcastdispatcher.js ***!
  10344. \**************************************************************************************/
  10345. /*! exports provided: default */
  10346. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  10347. "use strict";
  10348. __webpack_require__.r(__webpack_exports__);
  10349. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return DowncastDispatcher; });
  10350. /* harmony import */ var _modelconsumable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./modelconsumable */ "./node_modules/@ckeditor/ckeditor5-engine/src/conversion/modelconsumable.js");
  10351. /* harmony import */ var _model_range__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../model/range */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/range.js");
  10352. /* harmony import */ var _model_position__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../model/position */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/position.js");
  10353. /* 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");
  10354. /* 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");
  10355. /**
  10356. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  10357. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  10358. */
  10359. /**
  10360. * @module engine/conversion/downcastdispatcher
  10361. */
  10362. /**
  10363. * The downcast dispatcher is a central point of downcasting (conversion from the model to the view), which is a process of reacting
  10364. * to changes in the model and firing a set of events. Callbacks listening to these events are called converters. The
  10365. * converters' role is to convert the model changes to changes in view (for example, adding view nodes or
  10366. * changing attributes on view elements).
  10367. *
  10368. * During the conversion process, downcast dispatcher fires events basing on the state of the model and prepares
  10369. * data for these events. It is important to understand that the events are connected with the changes done on the model,
  10370. * for example: "a node has been inserted" or "an attribute has changed". This is in contrary to upcasting (a view-to-model conversion)
  10371. * where you convert the view state (view nodes) to a model tree.
  10372. *
  10373. * The events are prepared basing on a diff created by {@link module:engine/model/differ~Differ Differ}, which buffers them
  10374. * and then passes to the downcast dispatcher as a diff between the old model state and the new model state.
  10375. *
  10376. * Note that because the changes are converted, there is a need to have a mapping between the model structure and the view structure.
  10377. * To map positions and elements during the downcast (a model-to-view conversion), use {@link module:engine/conversion/mapper~Mapper}.
  10378. *
  10379. * Downcast dispatcher fires the following events for model tree changes:
  10380. *
  10381. * * {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:insert `insert`} &ndash;
  10382. * If a range of nodes was inserted to the model tree.
  10383. * * {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:remove `remove`} &ndash;
  10384. * If a range of nodes was removed from the model tree.
  10385. * * {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:attribute `attribute`} &ndash;
  10386. * If an attribute was added, changed or removed from a model node.
  10387. *
  10388. * For {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:insert `insert`}
  10389. * and {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:attribute `attribute`},
  10390. * downcast dispatcher generates {@link module:engine/conversion/modelconsumable~ModelConsumable consumables}.
  10391. * These are used to have control over which changes have already been consumed. It is useful when some converters
  10392. * overwrite others or convert multiple changes (for example, it converts an insertion of an element and also converts that
  10393. * element's attributes during the insertion).
  10394. *
  10395. * Additionally, downcast dispatcher fires events for {@link module:engine/model/markercollection~Marker marker} changes:
  10396. *
  10397. * * {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:addMarker} &ndash; If a marker was added.
  10398. * * {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:removeMarker} &ndash; If a marker was removed.
  10399. *
  10400. * Note that changing a marker is done through removing the marker from the old range and adding it to the new range,
  10401. * so both events are fired.
  10402. *
  10403. * Finally, downcast dispatcher also handles firing events for the {@link module:engine/model/selection model selection}
  10404. * conversion:
  10405. *
  10406. * * {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:selection}
  10407. * &ndash; Converts the selection from the model to the view.
  10408. * * {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:attribute}
  10409. * &ndash; Fired for every selection attribute.
  10410. * * {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:addMarker}
  10411. * &ndash; Fired for every marker that contains a selection.
  10412. *
  10413. * Unlike the model tree and the markers, the events for selection are not fired for changes but for a selection state.
  10414. *
  10415. * When providing custom listeners for a downcast dispatcher, remember to check whether a given change has not been
  10416. * {@link module:engine/conversion/modelconsumable~ModelConsumable#consume consumed} yet.
  10417. *
  10418. * When providing custom listeners for downcast dispatcher, keep in mind that any callback that has
  10419. * {@link module:engine/conversion/modelconsumable~ModelConsumable#consume consumed} a value from a consumable and
  10420. * converted the change should also stop the event (for efficiency purposes).
  10421. *
  10422. * When providing custom listeners for downcast dispatcher, remember to use the provided
  10423. * {@link module:engine/view/downcastwriter~DowncastWriter view downcast writer} to apply changes to the view document.
  10424. *
  10425. * You can read more about conversion in the following guides:
  10426. *
  10427. * * {@glink framework/guides/deep-dive/conversion/conversion-introduction Advanced conversion concepts &mdash; attributes}
  10428. * * {@glink framework/guides/deep-dive/conversion/conversion-extending-output Extending the editor output }
  10429. * * {@glink framework/guides/deep-dive/conversion/custom-element-conversion Custom element conversion}
  10430. *
  10431. * An example of a custom converter for the downcast dispatcher:
  10432. *
  10433. * // You will convert inserting a "paragraph" model element into the model.
  10434. * downcastDispatcher.on( 'insert:paragraph', ( evt, data, conversionApi ) => {
  10435. * // Remember to check whether the change has not been consumed yet and consume it.
  10436. * if ( conversionApi.consumable.consume( data.item, 'insert' ) ) {
  10437. * return;
  10438. * }
  10439. *
  10440. * // Translate the position in the model to a position in the view.
  10441. * const viewPosition = conversionApi.mapper.toViewPosition( data.range.start );
  10442. *
  10443. * // Create a <p> element that will be inserted into the view at the `viewPosition`.
  10444. * const viewElement = conversionApi.writer.createContainerElement( 'p' );
  10445. *
  10446. * // Bind the newly created view element to the model element so positions will map accordingly in the future.
  10447. * conversionApi.mapper.bindElements( data.item, viewElement );
  10448. *
  10449. * // Add the newly created view element to the view.
  10450. * conversionApi.writer.insert( viewPosition, viewElement );
  10451. *
  10452. * // Remember to stop the event propagation.
  10453. * evt.stop();
  10454. * } );
  10455. */
  10456. class DowncastDispatcher {
  10457. /**
  10458. * Creates a downcast dispatcher instance.
  10459. *
  10460. * @see module:engine/conversion/downcastdispatcher~DowncastConversionApi
  10461. * @param {Object} conversionApi Additional properties for an interface that will be passed to events fired
  10462. * by the downcast dispatcher.
  10463. */
  10464. constructor( conversionApi ) {
  10465. /**
  10466. * An interface passed by the dispatcher to the event callbacks.
  10467. *
  10468. * @member {module:engine/conversion/downcastdispatcher~DowncastConversionApi}
  10469. */
  10470. this.conversionApi = Object.assign( { dispatcher: this }, conversionApi );
  10471. /**
  10472. * Maps conversion event names that will trigger element reconversion for a given element name.
  10473. *
  10474. * @type {Map<String, String>}
  10475. * @private
  10476. */
  10477. this._reconversionEventsMapping = new Map();
  10478. }
  10479. /**
  10480. * Takes a {@link module:engine/model/differ~Differ model differ} object with buffered changes and fires conversion basing on it.
  10481. *
  10482. * @param {module:engine/model/differ~Differ} differ The differ object with buffered changes.
  10483. * @param {module:engine/model/markercollection~MarkerCollection} markers Markers connected with the converted model.
  10484. * @param {module:engine/view/downcastwriter~DowncastWriter} writer The view writer that should be used to modify the view document.
  10485. */
  10486. convertChanges( differ, markers, writer ) {
  10487. // Before the view is updated, remove markers which have changed.
  10488. for ( const change of differ.getMarkersToRemove() ) {
  10489. this.convertMarkerRemove( change.name, change.range, writer );
  10490. }
  10491. const changes = this._mapChangesWithAutomaticReconversion( differ );
  10492. // Convert changes that happened on model tree.
  10493. for ( const entry of changes ) {
  10494. if ( entry.type === 'insert' ) {
  10495. this.convertInsert( _model_range__WEBPACK_IMPORTED_MODULE_1__["default"]._createFromPositionAndShift( entry.position, entry.length ), writer );
  10496. } else if ( entry.type === 'remove' ) {
  10497. this.convertRemove( entry.position, entry.length, entry.name, writer );
  10498. } else if ( entry.type === 'reconvert' ) {
  10499. this.reconvertElement( entry.element, writer );
  10500. } else {
  10501. // Defaults to 'attribute' change.
  10502. this.convertAttribute( entry.range, entry.attributeKey, entry.attributeOldValue, entry.attributeNewValue, writer );
  10503. }
  10504. }
  10505. for ( const markerName of this.conversionApi.mapper.flushUnboundMarkerNames() ) {
  10506. const markerRange = markers.get( markerName ).getRange();
  10507. this.convertMarkerRemove( markerName, markerRange, writer );
  10508. this.convertMarkerAdd( markerName, markerRange, writer );
  10509. }
  10510. // After the view is updated, convert markers which have changed.
  10511. for ( const change of differ.getMarkersToAdd() ) {
  10512. this.convertMarkerAdd( change.name, change.range, writer );
  10513. }
  10514. }
  10515. /**
  10516. * Starts a conversion of a range insertion.
  10517. *
  10518. * For each node in the range, {@link #event:insert `insert` event is fired}. For each attribute on each node,
  10519. * {@link #event:attribute `attribute` event is fired}.
  10520. *
  10521. * @fires insert
  10522. * @fires attribute
  10523. * @param {module:engine/model/range~Range} range The inserted range.
  10524. * @param {module:engine/view/downcastwriter~DowncastWriter} writer The view writer that should be used to modify the view document.
  10525. */
  10526. convertInsert( range, writer ) {
  10527. this.conversionApi.writer = writer;
  10528. // Create a list of things that can be consumed, consisting of nodes and their attributes.
  10529. this.conversionApi.consumable = this._createInsertConsumable( range );
  10530. // Fire a separate insert event for each node and text fragment contained in the range.
  10531. for ( const data of Array.from( range ).map( walkerValueToEventData ) ) {
  10532. this._convertInsertWithAttributes( data );
  10533. }
  10534. this._clearConversionApi();
  10535. }
  10536. /**
  10537. * Fires conversion of a single node removal. Fires {@link #event:remove remove event} with provided data.
  10538. *
  10539. * @param {module:engine/model/position~Position} position Position from which node was removed.
  10540. * @param {Number} length Offset size of removed node.
  10541. * @param {String} name Name of removed node.
  10542. * @param {module:engine/view/downcastwriter~DowncastWriter} writer View writer that should be used to modify view document.
  10543. */
  10544. convertRemove( position, length, name, writer ) {
  10545. this.conversionApi.writer = writer;
  10546. this.fire( 'remove:' + name, { position, length }, this.conversionApi );
  10547. this._clearConversionApi();
  10548. }
  10549. /**
  10550. * Starts a conversion of an attribute change on a given `range`.
  10551. *
  10552. * For each node in the given `range`, {@link #event:attribute attribute event} is fired with the passed data.
  10553. *
  10554. * @fires attribute
  10555. * @param {module:engine/model/range~Range} range Changed range.
  10556. * @param {String} key Key of the attribute that has changed.
  10557. * @param {*} oldValue Attribute value before the change or `null` if the attribute has not been set before.
  10558. * @param {*} newValue New attribute value or `null` if the attribute has been removed.
  10559. * @param {module:engine/view/downcastwriter~DowncastWriter} writer View writer that should be used to modify view document.
  10560. */
  10561. convertAttribute( range, key, oldValue, newValue, writer ) {
  10562. this.conversionApi.writer = writer;
  10563. // Create a list with attributes to consume.
  10564. this.conversionApi.consumable = this._createConsumableForRange( range, `attribute:${ key }` );
  10565. // Create a separate attribute event for each node in the range.
  10566. for ( const value of range ) {
  10567. const item = value.item;
  10568. const itemRange = _model_range__WEBPACK_IMPORTED_MODULE_1__["default"]._createFromPositionAndShift( value.previousPosition, value.length );
  10569. const data = {
  10570. item,
  10571. range: itemRange,
  10572. attributeKey: key,
  10573. attributeOldValue: oldValue,
  10574. attributeNewValue: newValue
  10575. };
  10576. this._testAndFire( `attribute:${ key }`, data );
  10577. }
  10578. this._clearConversionApi();
  10579. }
  10580. /**
  10581. * Starts the reconversion of an element. It will:
  10582. *
  10583. * * Fire an {@link #event:insert `insert` event} for the element to reconvert.
  10584. * * Fire an {@link #event:attribute `attribute` event} for element attributes.
  10585. *
  10586. * This will not reconvert children of the element if they have existing (already converted) views. For newly inserted child elements
  10587. * it will behave the same as {@link #convertInsert}.
  10588. *
  10589. * Element reconversion is defined by the `triggerBy` configuration for the
  10590. * {@link module:engine/conversion/downcasthelpers~DowncastHelpers#elementToElement `elementToElement()`} conversion helper.
  10591. *
  10592. * @fires insert
  10593. * @fires attribute
  10594. * @param {module:engine/model/element~Element} element The element to be reconverted.
  10595. * @param {module:engine/view/downcastwriter~DowncastWriter} writer The view writer that should be used to modify the view document.
  10596. */
  10597. reconvertElement( element, writer ) {
  10598. const elementRange = _model_range__WEBPACK_IMPORTED_MODULE_1__["default"]._createOn( element );
  10599. this.conversionApi.writer = writer;
  10600. // Create a list of things that can be consumed, consisting of nodes and their attributes.
  10601. this.conversionApi.consumable = this._createInsertConsumable( elementRange );
  10602. const mapper = this.conversionApi.mapper;
  10603. const currentView = mapper.toViewElement( element );
  10604. // Remove the old view but do not remove mapper mappings - those will be used to revive existing elements.
  10605. writer.remove( currentView );
  10606. // Convert the element - without converting children.
  10607. this._convertInsertWithAttributes( {
  10608. item: element,
  10609. range: elementRange
  10610. } );
  10611. const convertedViewElement = mapper.toViewElement( element );
  10612. // Iterate over children of reconverted element in order to...
  10613. for ( const value of _model_range__WEBPACK_IMPORTED_MODULE_1__["default"]._createIn( element ) ) {
  10614. const { item } = value;
  10615. const view = elementOrTextProxyToView( item, mapper );
  10616. // ...either bring back previously converted view...
  10617. if ( view ) {
  10618. // Do not move views that are already in converted element - those might be created by the main element converter in case
  10619. // when main element converts also its direct children.
  10620. if ( view.root !== convertedViewElement.root ) {
  10621. writer.move(
  10622. writer.createRangeOn( view ),
  10623. mapper.toViewPosition( _model_position__WEBPACK_IMPORTED_MODULE_2__["default"]._createBefore( item ) )
  10624. );
  10625. }
  10626. }
  10627. // ... or by converting newly inserted elements.
  10628. else {
  10629. this._convertInsertWithAttributes( walkerValueToEventData( value ) );
  10630. }
  10631. }
  10632. // After reconversion is done we can unbind the old view.
  10633. mapper.unbindViewElement( currentView );
  10634. this._clearConversionApi();
  10635. }
  10636. /**
  10637. * Starts the model selection conversion.
  10638. *
  10639. * Fires events for a given {@link module:engine/model/selection~Selection selection} to start the selection conversion.
  10640. *
  10641. * @fires selection
  10642. * @fires addMarker
  10643. * @fires attribute
  10644. * @param {module:engine/model/selection~Selection} selection The selection to convert.
  10645. * @param {module:engine/model/markercollection~MarkerCollection} markers Markers connected with the converted model.
  10646. * @param {module:engine/view/downcastwriter~DowncastWriter} writer View writer that should be used to modify the view document.
  10647. */
  10648. convertSelection( selection, markers, writer ) {
  10649. const markersAtSelection = Array.from( markers.getMarkersAtPosition( selection.getFirstPosition() ) );
  10650. this.conversionApi.writer = writer;
  10651. this.conversionApi.consumable = this._createSelectionConsumable( selection, markersAtSelection );
  10652. this.fire( 'selection', { selection }, this.conversionApi );
  10653. if ( !selection.isCollapsed ) {
  10654. return;
  10655. }
  10656. for ( const marker of markersAtSelection ) {
  10657. const markerRange = marker.getRange();
  10658. if ( !shouldMarkerChangeBeConverted( selection.getFirstPosition(), marker, this.conversionApi.mapper ) ) {
  10659. continue;
  10660. }
  10661. const data = {
  10662. item: selection,
  10663. markerName: marker.name,
  10664. markerRange
  10665. };
  10666. if ( this.conversionApi.consumable.test( selection, 'addMarker:' + marker.name ) ) {
  10667. this.fire( 'addMarker:' + marker.name, data, this.conversionApi );
  10668. }
  10669. }
  10670. for ( const key of selection.getAttributeKeys() ) {
  10671. const data = {
  10672. item: selection,
  10673. range: selection.getFirstRange(),
  10674. attributeKey: key,
  10675. attributeOldValue: null,
  10676. attributeNewValue: selection.getAttribute( key )
  10677. };
  10678. // Do not fire event if the attribute has been consumed.
  10679. if ( this.conversionApi.consumable.test( selection, 'attribute:' + data.attributeKey ) ) {
  10680. this.fire( 'attribute:' + data.attributeKey + ':$text', data, this.conversionApi );
  10681. }
  10682. }
  10683. this._clearConversionApi();
  10684. }
  10685. /**
  10686. * Converts the added marker. Fires the {@link #event:addMarker `addMarker`} event for each item
  10687. * in the marker's range. If the range is collapsed, a single event is dispatched. See the event description for more details.
  10688. *
  10689. * @fires addMarker
  10690. * @param {String} markerName Marker name.
  10691. * @param {module:engine/model/range~Range} markerRange The marker range.
  10692. * @param {module:engine/view/downcastwriter~DowncastWriter} writer View writer that should be used to modify the view document.
  10693. */
  10694. convertMarkerAdd( markerName, markerRange, writer ) {
  10695. // Do not convert if range is in graveyard.
  10696. if ( markerRange.root.rootName == '$graveyard' ) {
  10697. return;
  10698. }
  10699. this.conversionApi.writer = writer;
  10700. // In markers' case, event name == consumable name.
  10701. const eventName = 'addMarker:' + markerName;
  10702. //
  10703. // First, fire an event for the whole marker.
  10704. //
  10705. const consumable = new _modelconsumable__WEBPACK_IMPORTED_MODULE_0__["default"]();
  10706. consumable.add( markerRange, eventName );
  10707. this.conversionApi.consumable = consumable;
  10708. this.fire( eventName, { markerName, markerRange }, this.conversionApi );
  10709. //
  10710. // Do not fire events for each item inside the range if the range got consumed.
  10711. //
  10712. if ( !consumable.test( markerRange, eventName ) ) {
  10713. return;
  10714. }
  10715. //
  10716. // Then, fire an event for each item inside the marker range.
  10717. //
  10718. this.conversionApi.consumable = this._createConsumableForRange( markerRange, eventName );
  10719. for ( const item of markerRange.getItems() ) {
  10720. // Do not fire event for already consumed items.
  10721. if ( !this.conversionApi.consumable.test( item, eventName ) ) {
  10722. continue;
  10723. }
  10724. const data = { item, range: _model_range__WEBPACK_IMPORTED_MODULE_1__["default"]._createOn( item ), markerName, markerRange };
  10725. this.fire( eventName, data, this.conversionApi );
  10726. }
  10727. this._clearConversionApi();
  10728. }
  10729. /**
  10730. * Fires the conversion of the marker removal. Fires the {@link #event:removeMarker `removeMarker`} event with the provided data.
  10731. *
  10732. * @fires removeMarker
  10733. * @param {String} markerName Marker name.
  10734. * @param {module:engine/model/range~Range} markerRange The marker range.
  10735. * @param {module:engine/view/downcastwriter~DowncastWriter} writer View writer that should be used to modify the view document.
  10736. */
  10737. convertMarkerRemove( markerName, markerRange, writer ) {
  10738. // Do not convert if range is in graveyard.
  10739. if ( markerRange.root.rootName == '$graveyard' ) {
  10740. return;
  10741. }
  10742. this.conversionApi.writer = writer;
  10743. this.fire( 'removeMarker:' + markerName, { markerName, markerRange }, this.conversionApi );
  10744. this._clearConversionApi();
  10745. }
  10746. /**
  10747. * Maps the model element "insert" reconversion for given event names. The event names must be fully specified:
  10748. *
  10749. * * For "attribute" change event, it should include the main element name, i.e: `'attribute:attributeName:elementName'`.
  10750. * * For child node change events, these should use the child event name as well, i.e:
  10751. * * For adding a node: `'insert:childElementName'`.
  10752. * * For removing a node: `'remove:childElementName'`.
  10753. *
  10754. * **Note**: This method should not be used directly. The reconversion is defined by the `triggerBy()` configuration of the
  10755. * `elementToElement()` conversion helper.
  10756. *
  10757. * @protected
  10758. * @param {String} modelName The name of the main model element for which the events will trigger the reconversion.
  10759. * @param {String} eventName The name of an event that would trigger conversion for a given model element.
  10760. */
  10761. _mapReconversionTriggerEvent( modelName, eventName ) {
  10762. this._reconversionEventsMapping.set( eventName, modelName );
  10763. }
  10764. /**
  10765. * Creates {@link module:engine/conversion/modelconsumable~ModelConsumable} with values to consume from a given range,
  10766. * assuming that the range has just been inserted to the model.
  10767. *
  10768. * @private
  10769. * @param {module:engine/model/range~Range} range The inserted range.
  10770. * @returns {module:engine/conversion/modelconsumable~ModelConsumable} The values to consume.
  10771. */
  10772. _createInsertConsumable( range ) {
  10773. const consumable = new _modelconsumable__WEBPACK_IMPORTED_MODULE_0__["default"]();
  10774. for ( const value of range ) {
  10775. const item = value.item;
  10776. consumable.add( item, 'insert' );
  10777. for ( const key of item.getAttributeKeys() ) {
  10778. consumable.add( item, 'attribute:' + key );
  10779. }
  10780. }
  10781. return consumable;
  10782. }
  10783. /**
  10784. * Creates {@link module:engine/conversion/modelconsumable~ModelConsumable} with values to consume for a given range.
  10785. *
  10786. * @private
  10787. * @param {module:engine/model/range~Range} range The affected range.
  10788. * @param {String} type Consumable type.
  10789. * @returns {module:engine/conversion/modelconsumable~ModelConsumable} The values to consume.
  10790. */
  10791. _createConsumableForRange( range, type ) {
  10792. const consumable = new _modelconsumable__WEBPACK_IMPORTED_MODULE_0__["default"]();
  10793. for ( const item of range.getItems() ) {
  10794. consumable.add( item, type );
  10795. }
  10796. return consumable;
  10797. }
  10798. /**
  10799. * Creates {@link module:engine/conversion/modelconsumable~ModelConsumable} with selection consumable values.
  10800. *
  10801. * @private
  10802. * @param {module:engine/model/selection~Selection} selection The selection to create the consumable from.
  10803. * @param {Iterable.<module:engine/model/markercollection~Marker>} markers Markers that contain the selection.
  10804. * @returns {module:engine/conversion/modelconsumable~ModelConsumable} The values to consume.
  10805. */
  10806. _createSelectionConsumable( selection, markers ) {
  10807. const consumable = new _modelconsumable__WEBPACK_IMPORTED_MODULE_0__["default"]();
  10808. consumable.add( selection, 'selection' );
  10809. for ( const marker of markers ) {
  10810. consumable.add( selection, 'addMarker:' + marker.name );
  10811. }
  10812. for ( const key of selection.getAttributeKeys() ) {
  10813. consumable.add( selection, 'attribute:' + key );
  10814. }
  10815. return consumable;
  10816. }
  10817. /**
  10818. * Tests passed `consumable` to check whether given event can be fired and if so, fires it.
  10819. *
  10820. * @private
  10821. * @fires insert
  10822. * @fires attribute
  10823. * @param {String} type Event type.
  10824. * @param {Object} data Event data.
  10825. */
  10826. _testAndFire( type, data ) {
  10827. if ( !this.conversionApi.consumable.test( data.item, type ) ) {
  10828. // Do not fire event if the item was consumed.
  10829. return;
  10830. }
  10831. this.fire( getEventName( type, data ), data, this.conversionApi );
  10832. }
  10833. /**
  10834. * Clears the conversion API object.
  10835. *
  10836. * @private
  10837. */
  10838. _clearConversionApi() {
  10839. delete this.conversionApi.writer;
  10840. delete this.conversionApi.consumable;
  10841. }
  10842. /**
  10843. * Internal method for converting element insertion. It will fire events for the inserted element and events for its attributes.
  10844. *
  10845. * @private
  10846. * @fires insert
  10847. * @fires attribute
  10848. * @param {Object} data Event data.
  10849. */
  10850. _convertInsertWithAttributes( data ) {
  10851. this._testAndFire( 'insert', data );
  10852. // Fire a separate addAttribute event for each attribute that was set on inserted items.
  10853. // This is important because most attributes converters will listen only to add/change/removeAttribute events.
  10854. // If we would not add this part, attributes on inserted nodes would not be converted.
  10855. for ( const key of data.item.getAttributeKeys() ) {
  10856. data.attributeKey = key;
  10857. data.attributeOldValue = null;
  10858. data.attributeNewValue = data.item.getAttribute( key );
  10859. this._testAndFire( `attribute:${ key }`, data );
  10860. }
  10861. }
  10862. /**
  10863. * Returns differ changes together with added "reconvert" type changes for {@link #reconvertElement}. These are defined by
  10864. * a the `triggerBy()` configuration for the
  10865. * {@link module:engine/conversion/downcasthelpers~DowncastHelpers#elementToElement `elementToElement()`} conversion helper.
  10866. *
  10867. * This method will remove every mapped insert or remove change with a single "reconvert" change.
  10868. *
  10869. * For instance: Having a `triggerBy()` configuration defined for the `<complex>` element that issues this element reconversion on
  10870. * `foo` and `bar` attributes change, and a set of changes for this element:
  10871. *
  10872. * const differChanges = [
  10873. * { type: 'attribute', attributeKey: 'foo', ... },
  10874. * { type: 'attribute', attributeKey: 'bar', ... },
  10875. * { type: 'attribute', attributeKey: 'baz', ... }
  10876. * ];
  10877. *
  10878. * This method will return:
  10879. *
  10880. * const updatedChanges = [
  10881. * { type: 'reconvert', element: complexElementInstance },
  10882. * { type: 'attribute', attributeKey: 'baz', ... }
  10883. * ];
  10884. *
  10885. * In the example above, the `'baz'` attribute change will fire an {@link #event:attribute attribute event}
  10886. *
  10887. * @param {module:engine/model/differ~Differ} differ The differ object with buffered changes.
  10888. * @returns {Array.<Object>} Updated set of changes.
  10889. * @private
  10890. */
  10891. _mapChangesWithAutomaticReconversion( differ ) {
  10892. const itemsToReconvert = new Set();
  10893. const updated = [];
  10894. for ( const entry of differ.getChanges() ) {
  10895. const position = entry.position || entry.range.start;
  10896. // Cached parent - just in case. See https://github.com/ckeditor/ckeditor5/issues/6579.
  10897. const positionParent = position.parent;
  10898. const textNode = Object(_model_position__WEBPACK_IMPORTED_MODULE_2__["getTextNodeAtPosition"])( position, positionParent );
  10899. // Reconversion is done only on elements so skip text changes.
  10900. if ( textNode ) {
  10901. updated.push( entry );
  10902. continue;
  10903. }
  10904. const element = entry.type === 'attribute' ? Object(_model_position__WEBPACK_IMPORTED_MODULE_2__["getNodeAfterPosition"])( position, positionParent, null ) : positionParent;
  10905. // Case of text node set directly in root. For now used only in tests but can be possible when enabled in paragraph-like roots.
  10906. // See: https://github.com/ckeditor/ckeditor5/issues/762.
  10907. if ( element.is( '$text' ) ) {
  10908. updated.push( entry );
  10909. continue;
  10910. }
  10911. let eventName;
  10912. if ( entry.type === 'attribute' ) {
  10913. eventName = `attribute:${ entry.attributeKey }:${ element.name }`;
  10914. } else {
  10915. eventName = `${ entry.type }:${ entry.name }`;
  10916. }
  10917. if ( this._isReconvertTriggerEvent( eventName, element.name ) ) {
  10918. if ( itemsToReconvert.has( element ) ) {
  10919. // Element is already reconverted, so skip this change.
  10920. continue;
  10921. }
  10922. itemsToReconvert.add( element );
  10923. // Add special "reconvert" change.
  10924. updated.push( { type: 'reconvert', element } );
  10925. } else {
  10926. updated.push( entry );
  10927. }
  10928. }
  10929. return updated;
  10930. }
  10931. /**
  10932. * Checks if the resulting change should trigger element reconversion.
  10933. *
  10934. * These are defined by a `triggerBy()` configuration for the
  10935. * {@link module:engine/conversion/downcasthelpers~DowncastHelpers#elementToElement `elementToElement()`} conversion helper.
  10936. *
  10937. * @private
  10938. * @param {String} eventName The event name to check.
  10939. * @param {String} elementName The element name to check.
  10940. * @returns {Boolean}
  10941. */
  10942. _isReconvertTriggerEvent( eventName, elementName ) {
  10943. return this._reconversionEventsMapping.get( eventName ) === elementName;
  10944. }
  10945. /**
  10946. * Fired for inserted nodes.
  10947. *
  10948. * `insert` is a namespace for a class of events. Names of actually called events follow this pattern:
  10949. * `insert:name`. `name` is either `'$text'`, when {@link module:engine/model/text~Text a text node} has been inserted,
  10950. * or {@link module:engine/model/element~Element#name name} of inserted element.
  10951. *
  10952. * This way listeners can either listen to a general `insert` event or specific event (for example `insert:paragraph`).
  10953. *
  10954. * @event insert
  10955. * @param {Object} data Additional information about the change.
  10956. * @param {module:engine/model/item~Item} data.item Inserted item.
  10957. * @param {module:engine/model/range~Range} data.range Range spanning over inserted item.
  10958. * @param {module:engine/conversion/downcastdispatcher~DowncastConversionApi} conversionApi Conversion interface
  10959. * to be used by callback, passed in `DowncastDispatcher` constructor.
  10960. */
  10961. /**
  10962. * Fired for removed nodes.
  10963. *
  10964. * `remove` is a namespace for a class of events. Names of actually called events follow this pattern:
  10965. * `remove:name`. `name` is either `'$text'`, when {@link module:engine/model/text~Text a text node} has been removed,
  10966. * or the {@link module:engine/model/element~Element#name name} of removed element.
  10967. *
  10968. * This way listeners can either listen to a general `remove` event or specific event (for example `remove:paragraph`).
  10969. *
  10970. * @event remove
  10971. * @param {Object} data Additional information about the change.
  10972. * @param {module:engine/model/position~Position} data.position Position from which the node has been removed.
  10973. * @param {Number} data.length Offset size of the removed node.
  10974. * @param {module:engine/conversion/downcastdispatcher~DowncastConversionApi} conversionApi Conversion interface
  10975. * to be used by callback, passed in `DowncastDispatcher` constructor.
  10976. */
  10977. /**
  10978. * Fired in the following cases:
  10979. *
  10980. * * when an attribute has been added, changed, or removed from a node,
  10981. * * when a node with an attribute is inserted,
  10982. * * when collapsed model selection attribute is converted.
  10983. *
  10984. * `attribute` is a namespace for a class of events. Names of actually called events follow this pattern:
  10985. * `attribute:attributeKey:name`. `attributeKey` is the key of added/changed/removed attribute.
  10986. * `name` is either `'$text'` if change was on {@link module:engine/model/text~Text a text node},
  10987. * or the {@link module:engine/model/element~Element#name name} of element which attribute has changed.
  10988. *
  10989. * This way listeners can either listen to a general `attribute:bold` event or specific event (for example `attribute:src:image`).
  10990. *
  10991. * @event attribute
  10992. * @param {Object} data Additional information about the change.
  10993. * @param {module:engine/model/item~Item|module:engine/model/documentselection~DocumentSelection} data.item Changed item
  10994. * or converted selection.
  10995. * @param {module:engine/model/range~Range} data.range Range spanning over changed item or selection range.
  10996. * @param {String} data.attributeKey Attribute key.
  10997. * @param {*} data.attributeOldValue Attribute value before the change. This is `null` when selection attribute is converted.
  10998. * @param {*} data.attributeNewValue New attribute value.
  10999. * @param {module:engine/conversion/downcastdispatcher~DowncastConversionApi} conversionApi Conversion interface
  11000. * to be used by callback, passed in `DowncastDispatcher` constructor.
  11001. */
  11002. /**
  11003. * Fired for {@link module:engine/model/selection~Selection selection} changes.
  11004. *
  11005. * @event selection
  11006. * @param {module:engine/model/selection~Selection} selection Selection that is converted.
  11007. * @param {module:engine/conversion/downcastdispatcher~DowncastConversionApi} conversionApi Conversion interface
  11008. * to be used by callback, passed in `DowncastDispatcher` constructor.
  11009. */
  11010. /**
  11011. * Fired when a new marker is added to the model. Also fired when a collapsed model selection that is inside a marker is converted.
  11012. *
  11013. * `addMarker` is a namespace for a class of events. Names of actually called events follow this pattern:
  11014. * `addMarker:markerName`. By specifying certain marker names, you can make the events even more gradual. For example,
  11015. * if markers are named `foo:abc`, `foo:bar`, then it is possible to listen to `addMarker:foo` or `addMarker:foo:abc` and
  11016. * `addMarker:foo:bar` events.
  11017. *
  11018. * If the marker range is not collapsed:
  11019. *
  11020. * * the event is fired for each item in the marker range one by one,
  11021. * * `conversionApi.consumable` includes each item of the marker range and the consumable value is same as the event name.
  11022. *
  11023. * If the marker range is collapsed:
  11024. *
  11025. * * there is only one event,
  11026. * * `conversionApi.consumable` includes marker range with the event name.
  11027. *
  11028. * If the selection inside a marker is converted:
  11029. *
  11030. * * there is only one event,
  11031. * * `conversionApi.consumable` includes the selection instance with the event name.
  11032. *
  11033. * @event addMarker
  11034. * @param {Object} data Additional information about the change.
  11035. * @param {module:engine/model/item~Item|module:engine/model/selection~Selection} data.item Item inside the new marker or
  11036. * the selection that is being converted.
  11037. * @param {module:engine/model/range~Range} [data.range] Range spanning over converted item. Available only in marker conversion, if
  11038. * the marker range was not collapsed.
  11039. * @param {module:engine/model/range~Range} data.markerRange Marker range.
  11040. * @param {String} data.markerName Marker name.
  11041. * @param {module:engine/conversion/downcastdispatcher~DowncastConversionApi} conversionApi Conversion interface
  11042. * to be used by callback, passed in `DowncastDispatcher` constructor.
  11043. */
  11044. /**
  11045. * Fired when a marker is removed from the model.
  11046. *
  11047. * `removeMarker` is a namespace for a class of events. Names of actually called events follow this pattern:
  11048. * `removeMarker:markerName`. By specifying certain marker names, you can make the events even more gradual. For example,
  11049. * if markers are named `foo:abc`, `foo:bar`, then it is possible to listen to `removeMarker:foo` or `removeMarker:foo:abc` and
  11050. * `removeMarker:foo:bar` events.
  11051. *
  11052. * @event removeMarker
  11053. * @param {Object} data Additional information about the change.
  11054. * @param {module:engine/model/range~Range} data.markerRange Marker range.
  11055. * @param {String} data.markerName Marker name.
  11056. * @param {module:engine/conversion/downcastdispatcher~DowncastConversionApi} conversionApi Conversion interface
  11057. * to be used by callback, passed in `DowncastDispatcher` constructor.
  11058. */
  11059. }
  11060. Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_4__["default"])( DowncastDispatcher, _ckeditor_ckeditor5_utils_src_emittermixin__WEBPACK_IMPORTED_MODULE_3__["default"] );
  11061. // Helper function, checks whether change of `marker` at `modelPosition` should be converted. Marker changes are not
  11062. // converted if they happen inside an element with custom conversion method.
  11063. //
  11064. // @param {module:engine/model/position~Position} modelPosition
  11065. // @param {module:engine/model/markercollection~Marker} marker
  11066. // @param {module:engine/conversion/mapper~Mapper} mapper
  11067. // @returns {Boolean}
  11068. function shouldMarkerChangeBeConverted( modelPosition, marker, mapper ) {
  11069. const range = marker.getRange();
  11070. const ancestors = Array.from( modelPosition.getAncestors() );
  11071. ancestors.shift(); // Remove root element. It cannot be passed to `model.Range#containsItem`.
  11072. ancestors.reverse();
  11073. const hasCustomHandling = ancestors.some( element => {
  11074. if ( range.containsItem( element ) ) {
  11075. const viewElement = mapper.toViewElement( element );
  11076. return !!viewElement.getCustomProperty( 'addHighlight' );
  11077. }
  11078. } );
  11079. return !hasCustomHandling;
  11080. }
  11081. function getEventName( type, data ) {
  11082. const name = data.item.name || '$text';
  11083. return `${ type }:${ name }`;
  11084. }
  11085. function walkerValueToEventData( value ) {
  11086. const item = value.item;
  11087. const itemRange = _model_range__WEBPACK_IMPORTED_MODULE_1__["default"]._createFromPositionAndShift( value.previousPosition, value.length );
  11088. return {
  11089. item,
  11090. range: itemRange
  11091. };
  11092. }
  11093. function elementOrTextProxyToView( item, mapper ) {
  11094. if ( item.is( 'textProxy' ) ) {
  11095. const mappedPosition = mapper.toViewPosition( _model_position__WEBPACK_IMPORTED_MODULE_2__["default"]._createBefore( item ) );
  11096. const positionParent = mappedPosition.parent;
  11097. return positionParent.is( '$text' ) ? positionParent : null;
  11098. }
  11099. return mapper.toViewElement( item );
  11100. }
  11101. /**
  11102. * Conversion interface that is registered for given {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher}
  11103. * and is passed as one of parameters when {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher dispatcher}
  11104. * fires its events.
  11105. *
  11106. * @interface module:engine/conversion/downcastdispatcher~DowncastConversionApi
  11107. */
  11108. /**
  11109. * The {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher} instance.
  11110. *
  11111. * @member {module:engine/conversion/downcastdispatcher~DowncastDispatcher} #dispatcher
  11112. */
  11113. /**
  11114. * Stores the information about what parts of a processed model item are still waiting to be handled. After a piece of a model item was
  11115. * converted, an appropriate consumable value should be {@link module:engine/conversion/modelconsumable~ModelConsumable#consume consumed}.
  11116. *
  11117. * @member {module:engine/conversion/modelconsumable~ModelConsumable} #consumable
  11118. */
  11119. /**
  11120. * The {@link module:engine/conversion/mapper~Mapper} instance.
  11121. *
  11122. * @member {module:engine/conversion/mapper~Mapper} #mapper
  11123. */
  11124. /**
  11125. * The {@link module:engine/model/schema~Schema} instance set for the model that is downcast.
  11126. *
  11127. * @member {module:engine/model/schema~Schema} #schema
  11128. */
  11129. /**
  11130. * The {@link module:engine/view/downcastwriter~DowncastWriter} instance used to manipulate the data during conversion.
  11131. *
  11132. * @member {module:engine/view/downcastwriter~DowncastWriter} #writer
  11133. */
  11134. /**
  11135. * An object with an additional configuration which can be used during the conversion process. Available only for data downcast conversion.
  11136. *
  11137. * @member {Object} #options
  11138. */
  11139. /***/ }),
  11140. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/conversion/downcasthelpers.js":
  11141. /*!***********************************************************************************!*\
  11142. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/conversion/downcasthelpers.js ***!
  11143. \***********************************************************************************/
  11144. /*! exports provided: default, insertText, remove, createViewElementFromHighlightDescriptor, convertRangeSelection, convertCollapsedSelection, clearAttributes, wrap, insertElement, insertUIElement */
  11145. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  11146. "use strict";
  11147. __webpack_require__.r(__webpack_exports__);
  11148. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return DowncastHelpers; });
  11149. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "insertText", function() { return insertText; });
  11150. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "remove", function() { return remove; });
  11151. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createViewElementFromHighlightDescriptor", function() { return createViewElementFromHighlightDescriptor; });
  11152. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "convertRangeSelection", function() { return convertRangeSelection; });
  11153. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "convertCollapsedSelection", function() { return convertCollapsedSelection; });
  11154. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "clearAttributes", function() { return clearAttributes; });
  11155. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "wrap", function() { return wrap; });
  11156. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "insertElement", function() { return insertElement; });
  11157. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "insertUIElement", function() { return insertUIElement; });
  11158. /* harmony import */ var _model_range__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../model/range */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/range.js");
  11159. /* harmony import */ var _model_selection__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../model/selection */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/selection.js");
  11160. /* harmony import */ var _model_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../model/element */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/element.js");
  11161. /* harmony import */ var _view_attributeelement__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../view/attributeelement */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/attributeelement.js");
  11162. /* harmony import */ var _model_documentselection__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../model/documentselection */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/documentselection.js");
  11163. /* harmony import */ var _conversionhelpers__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./conversionhelpers */ "./node_modules/@ckeditor/ckeditor5-engine/src/conversion/conversionhelpers.js");
  11164. /* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! lodash-es */ "./node_modules/lodash-es/lodash.js");
  11165. /* 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");
  11166. /* harmony import */ var _ckeditor_ckeditor5_utils_src_toarray__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/toarray */ "./node_modules/@ckeditor/ckeditor5-utils/src/toarray.js");
  11167. /**
  11168. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  11169. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  11170. */
  11171. /**
  11172. * Contains downcast (model-to-view) converters for {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher}.
  11173. *
  11174. * @module engine/conversion/downcasthelpers
  11175. */
  11176. /**
  11177. * Downcast conversion helper functions.
  11178. *
  11179. * @extends module:engine/conversion/conversionhelpers~ConversionHelpers
  11180. */
  11181. class DowncastHelpers extends _conversionhelpers__WEBPACK_IMPORTED_MODULE_5__["default"] {
  11182. /**
  11183. * Model element to view element conversion helper.
  11184. *
  11185. * This conversion results in creating a view element. For example, model `<paragraph>Foo</paragraph>` becomes `<p>Foo</p>` in the view.
  11186. *
  11187. * editor.conversion.for( 'downcast' ).elementToElement( {
  11188. * model: 'paragraph',
  11189. * view: 'p'
  11190. * } );
  11191. *
  11192. * editor.conversion.for( 'downcast' ).elementToElement( {
  11193. * model: 'paragraph',
  11194. * view: 'div',
  11195. * converterPriority: 'high'
  11196. * } );
  11197. *
  11198. * editor.conversion.for( 'downcast' ).elementToElement( {
  11199. * model: 'fancyParagraph',
  11200. * view: {
  11201. * name: 'p',
  11202. * classes: 'fancy'
  11203. * }
  11204. * } );
  11205. *
  11206. * editor.conversion.for( 'downcast' ).elementToElement( {
  11207. * model: 'heading',
  11208. * view: ( modelElement, conversionApi ) => {
  11209. * const { writer } = conversionApi;
  11210. *
  11211. * return writer.createContainerElement( 'h' + modelElement.getAttribute( 'level' ) );
  11212. * }
  11213. * } );
  11214. *
  11215. * The element-to-element conversion supports the reconversion mechanism. This is helpful in the conversion to complex view structures
  11216. * where multiple atomic element-to-element and attribute-to-attribute or attribute-to-element could be used. By specifying
  11217. * `triggerBy()` events you can trigger reconverting the model to full view tree structures at once.
  11218. *
  11219. * editor.conversion.for( 'downcast' ).elementToElement( {
  11220. * model: 'complex',
  11221. * view: ( modelElement, conversionApi ) => createComplexViewFromModel( modelElement, conversionApi ),
  11222. * triggerBy: {
  11223. * attributes: [ 'foo', 'bar' ],
  11224. * children: [ 'slot' ]
  11225. * }
  11226. * } );
  11227. *
  11228. * See {@link module:engine/conversion/conversion~Conversion#for `conversion.for()`} to learn how to add a converter
  11229. * to the conversion process.
  11230. *
  11231. * You can read more about element-to-element conversion in the
  11232. * {@glink framework/guides/deep-dive/conversion/custom-element-conversion Custom element conversion} guide.
  11233. *
  11234. * @method #elementToElement
  11235. * @param {Object} config Conversion configuration.
  11236. * @param {String} config.model The name of the model element to convert.
  11237. * @param {module:engine/view/elementdefinition~ElementDefinition|Function} config.view A view element definition or a function
  11238. * that takes the model element and {@link module:engine/conversion/downcastdispatcher~DowncastConversionApi downcast conversion API}
  11239. * as parameters and returns a view container element.
  11240. * @param {Object} [config.triggerBy] Reconversion triggers. At least one trigger must be defined.
  11241. * @param {Array.<String>} config.triggerBy.attributes The name of the element's attributes whose change will trigger element
  11242. * reconversion.
  11243. * @param {Array.<String>} config.triggerBy.children The name of direct children whose adding or removing will trigger element
  11244. * reconversion.
  11245. * @returns {module:engine/conversion/downcasthelpers~DowncastHelpers}
  11246. */
  11247. elementToElement( config ) {
  11248. return this.add( downcastElementToElement( config ) );
  11249. }
  11250. /**
  11251. * Model attribute to view element conversion helper.
  11252. *
  11253. * This conversion results in wrapping view nodes with a view attribute element. For example, a model text node with
  11254. * `"Foo"` as data and the `bold` attribute becomes `<strong>Foo</strong>` in the view.
  11255. *
  11256. * editor.conversion.for( 'downcast' ).attributeToElement( {
  11257. * model: 'bold',
  11258. * view: 'strong'
  11259. * } );
  11260. *
  11261. * editor.conversion.for( 'downcast' ).attributeToElement( {
  11262. * model: 'bold',
  11263. * view: 'b',
  11264. * converterPriority: 'high'
  11265. * } );
  11266. *
  11267. * editor.conversion.for( 'downcast' ).attributeToElement( {
  11268. * model: 'invert',
  11269. * view: {
  11270. * name: 'span',
  11271. * classes: [ 'font-light', 'bg-dark' ]
  11272. * }
  11273. * } );
  11274. *
  11275. * editor.conversion.for( 'downcast' ).attributeToElement( {
  11276. * model: {
  11277. * key: 'fontSize',
  11278. * values: [ 'big', 'small' ]
  11279. * },
  11280. * view: {
  11281. * big: {
  11282. * name: 'span',
  11283. * styles: {
  11284. * 'font-size': '1.2em'
  11285. * }
  11286. * },
  11287. * small: {
  11288. * name: 'span',
  11289. * styles: {
  11290. * 'font-size': '0.8em'
  11291. * }
  11292. * }
  11293. * }
  11294. * } );
  11295. *
  11296. * editor.conversion.for( 'downcast' ).attributeToElement( {
  11297. * model: 'bold',
  11298. * view: ( modelAttributeValue, conversionApi ) => {
  11299. * const { writer } = conversionApi;
  11300. *
  11301. * return writer.createAttributeElement( 'span', {
  11302. * style: 'font-weight:' + modelAttributeValue
  11303. * } );
  11304. * }
  11305. * } );
  11306. *
  11307. * editor.conversion.for( 'downcast' ).attributeToElement( {
  11308. * model: {
  11309. * key: 'color',
  11310. * name: '$text'
  11311. * },
  11312. * view: ( modelAttributeValue, conversionApi ) => {
  11313. * const { writer } = conversionApi;
  11314. *
  11315. * return writer.createAttributeElement( 'span', {
  11316. * style: 'color:' + modelAttributeValue
  11317. * } );
  11318. * }
  11319. * } );
  11320. *
  11321. * See {@link module:engine/conversion/conversion~Conversion#for `conversion.for()`} to learn how to add a converter
  11322. * to the conversion process.
  11323. *
  11324. * @method #attributeToElement
  11325. * @param {Object} config Conversion configuration.
  11326. * @param {String|Object} config.model The key of the attribute to convert from or a `{ key, values }` object. `values` is an array
  11327. * of `String`s with possible values if the model attribute is an enumerable.
  11328. * @param {module:engine/view/elementdefinition~ElementDefinition|Function|Object} config.view A view element definition or a function
  11329. * that takes the model attribute value and
  11330. * {@link module:engine/conversion/downcastdispatcher~DowncastConversionApi downcast conversion API} as parameters and returns a view
  11331. * attribute element. If `config.model.values` is given, `config.view` should be an object assigning values from `config.model.values`
  11332. * to view element definitions or functions.
  11333. * @param {module:utils/priorities~PriorityString} [config.converterPriority='normal'] Converter priority.
  11334. * @returns {module:engine/conversion/downcasthelpers~DowncastHelpers}
  11335. */
  11336. attributeToElement( config ) {
  11337. return this.add( downcastAttributeToElement( config ) );
  11338. }
  11339. /**
  11340. * Model attribute to view attribute conversion helper.
  11341. *
  11342. * This conversion results in adding an attribute to a view node, basing on an attribute from a model node. For example,
  11343. * `<image src='foo.jpg'></image>` is converted to `<img src='foo.jpg'></img>`.
  11344. *
  11345. * editor.conversion.for( 'downcast' ).attributeToAttribute( {
  11346. * model: 'source',
  11347. * view: 'src'
  11348. * } );
  11349. *
  11350. * editor.conversion.for( 'downcast' ).attributeToAttribute( {
  11351. * model: 'source',
  11352. * view: 'href',
  11353. * converterPriority: 'high'
  11354. * } );
  11355. *
  11356. * editor.conversion.for( 'downcast' ).attributeToAttribute( {
  11357. * model: {
  11358. * name: 'image',
  11359. * key: 'source'
  11360. * },
  11361. * view: 'src'
  11362. * } );
  11363. *
  11364. * editor.conversion.for( 'downcast' ).attributeToAttribute( {
  11365. * model: {
  11366. * name: 'styled',
  11367. * values: [ 'dark', 'light' ]
  11368. * },
  11369. * view: {
  11370. * dark: {
  11371. * key: 'class',
  11372. * value: [ 'styled', 'styled-dark' ]
  11373. * },
  11374. * light: {
  11375. * key: 'class',
  11376. * value: [ 'styled', 'styled-light' ]
  11377. * }
  11378. * }
  11379. * } );
  11380. *
  11381. * editor.conversion.for( 'downcast' ).attributeToAttribute( {
  11382. * model: 'styled',
  11383. * view: modelAttributeValue => ( {
  11384. * key: 'class',
  11385. * value: 'styled-' + modelAttributeValue
  11386. * } )
  11387. * } );
  11388. *
  11389. * **Note**: Downcasting to a style property requires providing `value` as an object:
  11390. *
  11391. * editor.conversion.for( 'downcast' ).attributeToAttribute( {
  11392. * model: 'lineHeight',
  11393. * view: modelAttributeValue => ( {
  11394. * key: 'style',
  11395. * value: {
  11396. * 'line-height': modelAttributeValue,
  11397. * 'border-bottom': '1px dotted #ba2'
  11398. * }
  11399. * } )
  11400. * } );
  11401. *
  11402. * See {@link module:engine/conversion/conversion~Conversion#for `conversion.for()`} to learn how to add a converter
  11403. * to the conversion process.
  11404. *
  11405. * @method #attributeToAttribute
  11406. * @param {Object} config Conversion configuration.
  11407. * @param {String|Object} config.model The key of the attribute to convert from or a `{ key, values, [ name ] }` object describing
  11408. * the attribute key, possible values and, optionally, an element name to convert from.
  11409. * @param {String|Object|Function} config.view A view attribute key, or a `{ key, value }` object or a function that takes
  11410. * the model attribute value and {@link module:engine/conversion/downcastdispatcher~DowncastConversionApi downcast conversion API}
  11411. * as parameters and returns a `{ key, value }` object. If `key` is `'class'`, `value` can be a `String` or an
  11412. * array of `String`s. If `key` is `'style'`, `value` is an object with key-value pairs. In other cases, `value` is a `String`.
  11413. * If `config.model.values` is set, `config.view` should be an object assigning values from `config.model.values` to
  11414. * `{ key, value }` objects or a functions.
  11415. * @param {module:utils/priorities~PriorityString} [config.converterPriority='normal'] Converter priority.
  11416. * @returns {module:engine/conversion/downcasthelpers~DowncastHelpers}
  11417. */
  11418. attributeToAttribute( config ) {
  11419. return this.add( downcastAttributeToAttribute( config ) );
  11420. }
  11421. /**
  11422. * Model marker to view element conversion helper.
  11423. *
  11424. * **Note**: This method should be used only for editing downcast. For data downcast, use
  11425. * {@link #markerToData `#markerToData()`} that produces valid HTML data.
  11426. *
  11427. * This conversion results in creating a view element on the boundaries of the converted marker. If the converted marker
  11428. * is collapsed, only one element is created. For example, model marker set like this: `<paragraph>F[oo b]ar</paragraph>`
  11429. * becomes `<p>F<span data-marker="search"></span>oo b<span data-marker="search"></span>ar</p>` in the view.
  11430. *
  11431. * editor.conversion.for( 'editingDowncast' ).markerToElement( {
  11432. * model: 'search',
  11433. * view: 'marker-search'
  11434. * } );
  11435. *
  11436. * editor.conversion.for( 'editingDowncast' ).markerToElement( {
  11437. * model: 'search',
  11438. * view: 'search-result',
  11439. * converterPriority: 'high'
  11440. * } );
  11441. *
  11442. * editor.conversion.for( 'editingDowncast' ).markerToElement( {
  11443. * model: 'search',
  11444. * view: {
  11445. * name: 'span',
  11446. * attributes: {
  11447. * 'data-marker': 'search'
  11448. * }
  11449. * }
  11450. * } );
  11451. *
  11452. * editor.conversion.for( 'editingDowncast' ).markerToElement( {
  11453. * model: 'search',
  11454. * view: ( markerData, conversionApi ) => {
  11455. * const { writer } = conversionApi;
  11456. *
  11457. * return writer.createUIElement( 'span', {
  11458. * 'data-marker': 'search',
  11459. * 'data-start': markerData.isOpening
  11460. * } );
  11461. * }
  11462. * } );
  11463. *
  11464. * If a function is passed as the `config.view` parameter, it will be used to generate both boundary elements. The function
  11465. * receives the `data` object and {@link module:engine/conversion/downcastdispatcher~DowncastConversionApi downcast conversion API}
  11466. * as a parameters and should return an instance of the
  11467. * {@link module:engine/view/uielement~UIElement view UI element}. The `data` object and
  11468. * {@link module:engine/conversion/downcastdispatcher~DowncastConversionApi `conversionApi`} are passed from
  11469. * {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:addMarker}. Additionally,
  11470. * the `data.isOpening` parameter is passed, which is set to `true` for the marker start boundary element, and `false` to
  11471. * the marker end boundary element.
  11472. *
  11473. * See {@link module:engine/conversion/conversion~Conversion#for `conversion.for()`} to learn how to add a converter
  11474. * to the conversion process.
  11475. *
  11476. * @method #markerToElement
  11477. * @param {Object} config Conversion configuration.
  11478. * @param {String} config.model The name of the model marker (or model marker group) to convert.
  11479. * @param {module:engine/view/elementdefinition~ElementDefinition|Function} config.view A view element definition or a function that
  11480. * takes the model marker data and {@link module:engine/conversion/downcastdispatcher~DowncastConversionApi downcast conversion API}
  11481. * as a parameters and returns a view UI element.
  11482. * @param {module:utils/priorities~PriorityString} [config.converterPriority='normal'] Converter priority.
  11483. * @returns {module:engine/conversion/downcasthelpers~DowncastHelpers}
  11484. */
  11485. markerToElement( config ) {
  11486. return this.add( downcastMarkerToElement( config ) );
  11487. }
  11488. /**
  11489. * Model marker to highlight conversion helper.
  11490. *
  11491. * This conversion results in creating a highlight on view nodes. For this kind of conversion,
  11492. * {@link module:engine/conversion/downcasthelpers~HighlightDescriptor} should be provided.
  11493. *
  11494. * For text nodes, a `<span>` {@link module:engine/view/attributeelement~AttributeElement} is created and it wraps all text nodes
  11495. * in the converted marker range. For example, a model marker set like this: `<paragraph>F[oo b]ar</paragraph>` becomes
  11496. * `<p>F<span class="comment">oo b</span>ar</p>` in the view.
  11497. *
  11498. * {@link module:engine/view/containerelement~ContainerElement} may provide a custom way of handling highlight. Most often,
  11499. * the element itself is given classes and attributes described in the highlight descriptor (instead of being wrapped in `<span>`).
  11500. * For example, a model marker set like this: `[<image src="foo.jpg"></image>]` becomes `<img src="foo.jpg" class="comment"></img>`
  11501. * in the view.
  11502. *
  11503. * For container elements, the conversion is two-step. While the converter processes the highlight descriptor and passes it
  11504. * to a container element, it is the container element instance itself that applies values from the highlight descriptor.
  11505. * So, in a sense, the converter takes care of stating what should be applied on what, while the element decides how to apply that.
  11506. *
  11507. * editor.conversion.for( 'downcast' ).markerToHighlight( { model: 'comment', view: { classes: 'comment' } } );
  11508. *
  11509. * editor.conversion.for( 'downcast' ).markerToHighlight( {
  11510. * model: 'comment',
  11511. * view: { classes: 'comment' },
  11512. * converterPriority: 'high'
  11513. * } );
  11514. *
  11515. * editor.conversion.for( 'downcast' ).markerToHighlight( {
  11516. * model: 'comment',
  11517. * view: ( data, conversionApi ) => {
  11518. * // Assuming that the marker name is in a form of comment:commentType:commentId.
  11519. * const [ , commentType, commentId ] = data.markerName.split( ':' );
  11520. *
  11521. * return {
  11522. * classes: [ 'comment', 'comment-' + commentType ],
  11523. * attributes: { 'data-comment-id': commentId }
  11524. * };
  11525. * }
  11526. * } );
  11527. *
  11528. * If a function is passed as the `config.view` parameter, it will be used to generate the highlight descriptor. The function
  11529. * receives the `data` object and {@link module:engine/conversion/downcastdispatcher~DowncastConversionApi downcast conversion API}
  11530. * as a parameters and should return a
  11531. * {@link module:engine/conversion/downcasthelpers~HighlightDescriptor highlight descriptor}.
  11532. * The `data` object properties are passed from {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:addMarker}.
  11533. *
  11534. * See {@link module:engine/conversion/conversion~Conversion#for `conversion.for()`} to learn how to add a converter
  11535. * to the conversion process.
  11536. *
  11537. * @method #markerToHighlight
  11538. * @param {Object} config Conversion configuration.
  11539. * @param {String} config.model The name of the model marker (or model marker group) to convert.
  11540. * @param {module:engine/conversion/downcasthelpers~HighlightDescriptor|Function} config.view A highlight descriptor
  11541. * that will be used for highlighting or a function that takes the model marker data and
  11542. * {@link module:engine/conversion/downcastdispatcher~DowncastConversionApi downcast conversion API} as a parameters
  11543. * and returns a highlight descriptor.
  11544. * @param {module:utils/priorities~PriorityString} [config.converterPriority='normal'] Converter priority.
  11545. * @returns {module:engine/conversion/downcasthelpers~DowncastHelpers}
  11546. */
  11547. markerToHighlight( config ) {
  11548. return this.add( downcastMarkerToHighlight( config ) );
  11549. }
  11550. /**
  11551. * Model marker converter for data downcast.
  11552. *
  11553. * This conversion creates a representation for model marker boundaries in the view:
  11554. *
  11555. * * If the marker boundary is before or after a model element, a view attribute is set on a corresponding view element.
  11556. * * In other cases, a view element with the specified tag name is inserted at corresponding view position.
  11557. *
  11558. * Typically, marker names use the `group:uniqueId:otherData` convention. For example: `comment:e34zfk9k2n459df53sjl34:zx32c`.
  11559. * The default configuration for this conversion is that the first part is the `group` part and the rest of
  11560. * the marker name becomes the `name` part.
  11561. *
  11562. * Tag and attribute names and values are generated from the marker name:
  11563. *
  11564. * * Templates for attributes are `data-[group]-start-before="[name]"`, `data-[group]-start-after="[name]"`,
  11565. * `data-[group]-end-before="[name]"` and `data-[group]-end-after="[name]"`.
  11566. * * Templates for view elements are `<[group]-start name="[name]">` and `<[group]-end name="[name]">`.
  11567. *
  11568. * Attributes mark whether the given marker's start or end boundary is before or after the given element.
  11569. * Attributes `data-[group]-start-before` and `data-[group]-end-after` are favored.
  11570. * The other two are used when the former two cannot be used.
  11571. *
  11572. * The conversion configuration can take a function that will generate different group and name parts.
  11573. * 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
  11574. * properties: `group` and `name`. If the function returns a falsy value, the conversion will not take place.
  11575. *
  11576. * Basic usage:
  11577. *
  11578. * // Using the default conversion.
  11579. * // In this case, all markers whose name starts with 'comment:' will be converted.
  11580. * // The `group` parameter will be set to `comment`.
  11581. * // The `name` parameter will be the rest of the marker name (without `:`).
  11582. * editor.conversion.for( 'dataDowncast' ).markerToData( {
  11583. * model: 'comment'
  11584. * } );
  11585. *
  11586. * An example of a view that may be generated by this conversion (assuming a marker with the name `comment:commentId:uid` marked
  11587. * by `[]`):
  11588. *
  11589. * // Model:
  11590. * <paragraph>Foo[bar</paragraph>
  11591. * <image src="abc.jpg"></image>]
  11592. *
  11593. * // View:
  11594. * <p>Foo<comment-start name="commentId:uid"></comment-start>bar</p>
  11595. * <figure data-comment-end-after="commentId:uid" class="image"><img src="abc.jpg" /></figure>
  11596. *
  11597. * In the example above, the comment starts before "bar" and ends after the image.
  11598. *
  11599. * If the `name` part is empty, the following view may be generated:
  11600. *
  11601. * <p>Foo <myMarker-start></myMarker-start>bar</p>
  11602. * <figure data-myMarker-end-after="" class="image"><img src="abc.jpg" /></figure>
  11603. *
  11604. * **Note:** A situation where some markers have the `name` part and some do not have it is incorrect and should be avoided.
  11605. *
  11606. * Examples where `data-group-start-after` and `data-group-end-before` are used:
  11607. *
  11608. * // Model:
  11609. * <blockQuote>[]<paragraph>Foo</paragraph></blockQuote>
  11610. *
  11611. * // View:
  11612. * <blockquote><p data-group-end-before="name" data-group-start-before="name">Foo</p></blockquote>
  11613. *
  11614. * Similarly, when a marker is collapsed after the last element:
  11615. *
  11616. * // Model:
  11617. * <blockQuote><paragraph>Foo</paragraph>[]</blockQuote>
  11618. *
  11619. * // View:
  11620. * <blockquote><p data-group-end-after="name" data-group-start-after="name">Foo</p></blockquote>
  11621. *
  11622. * When there are multiple markers from the same group stored in the same attribute of the same element, their
  11623. * name parts are put together in the attribute value, for example: `data-group-start-before="name1,name2,name3"`.
  11624. *
  11625. * Other examples of usage:
  11626. *
  11627. * // Using a custom function which is the same as the default conversion:
  11628. * editor.conversion.for( 'dataDowncast' ).markerToData( {
  11629. * model: 'comment'
  11630. * view: markerName => ( {
  11631. * group: 'comment',
  11632. * name: markerName.substr( 8 ) // Removes 'comment:' part.
  11633. * } )
  11634. * } );
  11635. *
  11636. * // Using the converter priority:
  11637. * editor.conversion.for( 'dataDowncast' ).markerToData( {
  11638. * model: 'comment'
  11639. * view: markerName => ( {
  11640. * group: 'comment',
  11641. * name: markerName.substr( 8 ) // Removes 'comment:' part.
  11642. * } ),
  11643. * converterPriority: 'high'
  11644. * } );
  11645. *
  11646. * This kind of conversion is useful for saving data into the database, so it should be used in the data conversion pipeline.
  11647. *
  11648. * See {@link module:engine/conversion/conversion~Conversion#for `conversion.for()`} to learn how to add a converter
  11649. * to the conversion process.
  11650. *
  11651. * @method #markerToData
  11652. * @param {Object} config Conversion configuration.
  11653. * @param {String} config.model The name of the model marker (or model marker group) to convert.
  11654. * @param {Function} [config.view] A function that takes the model marker name and
  11655. * {@link module:engine/conversion/downcastdispatcher~DowncastConversionApi downcast conversion API} as a parameters
  11656. * and returns an object with the `group` and `name` properties.
  11657. * @param {module:utils/priorities~PriorityString} [config.converterPriority='normal'] Converter priority.
  11658. * @returns {module:engine/conversion/downcasthelpers~DowncastHelpers}
  11659. */
  11660. markerToData( config ) {
  11661. return this.add( downcastMarkerToData( config ) );
  11662. }
  11663. }
  11664. /**
  11665. * Function factory that creates a default downcast converter for text insertion changes.
  11666. *
  11667. * The converter automatically consumes the corresponding value from the consumables list and stops the event (see
  11668. * {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher}).
  11669. *
  11670. * modelDispatcher.on( 'insert:$text', insertText() );
  11671. *
  11672. * @returns {Function} Insert text event converter.
  11673. */
  11674. function insertText() {
  11675. return ( evt, data, conversionApi ) => {
  11676. if ( !conversionApi.consumable.consume( data.item, 'insert' ) ) {
  11677. return;
  11678. }
  11679. const viewWriter = conversionApi.writer;
  11680. const viewPosition = conversionApi.mapper.toViewPosition( data.range.start );
  11681. const viewText = viewWriter.createText( data.item.data );
  11682. viewWriter.insert( viewPosition, viewText );
  11683. };
  11684. }
  11685. /**
  11686. * Function factory that creates a default downcast converter for node remove changes.
  11687. *
  11688. * modelDispatcher.on( 'remove', remove() );
  11689. *
  11690. * @returns {Function} Remove event converter.
  11691. */
  11692. function remove() {
  11693. return ( evt, data, conversionApi ) => {
  11694. // Find view range start position by mapping model position at which the remove happened.
  11695. const viewStart = conversionApi.mapper.toViewPosition( data.position );
  11696. const modelEnd = data.position.getShiftedBy( data.length );
  11697. const viewEnd = conversionApi.mapper.toViewPosition( modelEnd, { isPhantom: true } );
  11698. const viewRange = conversionApi.writer.createRange( viewStart, viewEnd );
  11699. // Trim the range to remove in case some UI elements are on the view range boundaries.
  11700. const removed = conversionApi.writer.remove( viewRange.getTrimmed() );
  11701. // After the range is removed, unbind all view elements from the model.
  11702. // Range inside view document fragment is used to unbind deeply.
  11703. for ( const child of conversionApi.writer.createRangeIn( removed ).getItems() ) {
  11704. conversionApi.mapper.unbindViewElement( child );
  11705. }
  11706. };
  11707. }
  11708. /**
  11709. * Creates a `<span>` {@link module:engine/view/attributeelement~AttributeElement view attribute element} from the information
  11710. * provided by the {@link module:engine/conversion/downcasthelpers~HighlightDescriptor highlight descriptor} object. If a priority
  11711. * is not provided in the descriptor, the default priority will be used.
  11712. *
  11713. * @param {module:engine/view/downcastwriter~DowncastWriter} writer
  11714. * @param {module:engine/conversion/downcasthelpers~HighlightDescriptor} descriptor
  11715. * @returns {module:engine/view/attributeelement~AttributeElement}
  11716. */
  11717. function createViewElementFromHighlightDescriptor( writer, descriptor ) {
  11718. const viewElement = writer.createAttributeElement( 'span', descriptor.attributes );
  11719. if ( descriptor.classes ) {
  11720. viewElement._addClass( descriptor.classes );
  11721. }
  11722. if ( typeof descriptor.priority === 'number' ) {
  11723. viewElement._priority = descriptor.priority;
  11724. }
  11725. viewElement._id = descriptor.id;
  11726. return viewElement;
  11727. }
  11728. /**
  11729. * Function factory that creates a converter which converts a non-collapsed {@link module:engine/model/selection~Selection model selection}
  11730. * to a {@link module:engine/view/documentselection~DocumentSelection view selection}. The converter consumes appropriate
  11731. * value from the `consumable` object and maps model positions from the selection to view positions.
  11732. *
  11733. * modelDispatcher.on( 'selection', convertRangeSelection() );
  11734. *
  11735. * @returns {Function} Selection converter.
  11736. */
  11737. function convertRangeSelection() {
  11738. return ( evt, data, conversionApi ) => {
  11739. const selection = data.selection;
  11740. if ( selection.isCollapsed ) {
  11741. return;
  11742. }
  11743. if ( !conversionApi.consumable.consume( selection, 'selection' ) ) {
  11744. return;
  11745. }
  11746. const viewRanges = [];
  11747. for ( const range of selection.getRanges() ) {
  11748. const viewRange = conversionApi.mapper.toViewRange( range );
  11749. viewRanges.push( viewRange );
  11750. }
  11751. conversionApi.writer.setSelection( viewRanges, { backward: selection.isBackward } );
  11752. };
  11753. }
  11754. /**
  11755. * Function factory that creates a converter which converts a collapsed {@link module:engine/model/selection~Selection model selection} to
  11756. * a {@link module:engine/view/documentselection~DocumentSelection view selection}. The converter consumes appropriate
  11757. * value from the `consumable` object, maps the model selection position to the view position and breaks
  11758. * {@link module:engine/view/attributeelement~AttributeElement attribute elements} at the selection position.
  11759. *
  11760. * modelDispatcher.on( 'selection', convertCollapsedSelection() );
  11761. *
  11762. * An example of the view state before and after converting the collapsed selection:
  11763. *
  11764. * <p><strong>f^oo<strong>bar</p>
  11765. * -> <p><strong>f</strong>^<strong>oo</strong>bar</p>
  11766. *
  11767. * By breaking attribute elements like `<strong>`, the selection is in a correct element. Then, when the selection attribute is
  11768. * converted, broken attributes might be merged again, or the position where the selection is may be wrapped
  11769. * with different, appropriate attribute elements.
  11770. *
  11771. * See also {@link module:engine/conversion/downcasthelpers~clearAttributes} which does a clean-up
  11772. * by merging attributes.
  11773. *
  11774. * @returns {Function} Selection converter.
  11775. */
  11776. function convertCollapsedSelection() {
  11777. return ( evt, data, conversionApi ) => {
  11778. const selection = data.selection;
  11779. if ( !selection.isCollapsed ) {
  11780. return;
  11781. }
  11782. if ( !conversionApi.consumable.consume( selection, 'selection' ) ) {
  11783. return;
  11784. }
  11785. const viewWriter = conversionApi.writer;
  11786. const modelPosition = selection.getFirstPosition();
  11787. const viewPosition = conversionApi.mapper.toViewPosition( modelPosition );
  11788. const brokenPosition = viewWriter.breakAttributes( viewPosition );
  11789. viewWriter.setSelection( brokenPosition );
  11790. };
  11791. }
  11792. /**
  11793. * Function factory that creates a converter which clears artifacts after the previous
  11794. * {@link module:engine/model/selection~Selection model selection} conversion. It removes all empty
  11795. * {@link module:engine/view/attributeelement~AttributeElement view attribute elements} and merges sibling attributes at all start and end
  11796. * positions of all ranges.
  11797. *
  11798. * <p><strong>^</strong></p>
  11799. * -> <p>^</p>
  11800. *
  11801. * <p><strong>foo</strong>^<strong>bar</strong>bar</p>
  11802. * -> <p><strong>foo^bar<strong>bar</p>
  11803. *
  11804. * <p><strong>foo</strong><em>^</em><strong>bar</strong>bar</p>
  11805. * -> <p><strong>foo^bar<strong>bar</p>
  11806. *
  11807. * This listener should be assigned before any converter for the new selection:
  11808. *
  11809. * modelDispatcher.on( 'selection', clearAttributes() );
  11810. *
  11811. * See {@link module:engine/conversion/downcasthelpers~convertCollapsedSelection}
  11812. * which does the opposite by breaking attributes in the selection position.
  11813. *
  11814. * @returns {Function} Selection converter.
  11815. */
  11816. function clearAttributes() {
  11817. return ( evt, data, conversionApi ) => {
  11818. const viewWriter = conversionApi.writer;
  11819. const viewSelection = viewWriter.document.selection;
  11820. for ( const range of viewSelection.getRanges() ) {
  11821. // Not collapsed selection should not have artifacts.
  11822. if ( range.isCollapsed ) {
  11823. // Position might be in the node removed by the view writer.
  11824. if ( range.end.parent.isAttached() ) {
  11825. conversionApi.writer.mergeAttributes( range.start );
  11826. }
  11827. }
  11828. }
  11829. viewWriter.setSelection( null );
  11830. };
  11831. }
  11832. /**
  11833. * Function factory that creates a converter which converts set/change/remove attribute changes from the model to the view.
  11834. * It can also be used to convert selection attributes. In that case, an empty attribute element will be created and the
  11835. * selection will be put inside it.
  11836. *
  11837. * Attributes from the model are converted to a view element that will be wrapping these view nodes that are bound to
  11838. * model elements having the given attribute. This is useful for attributes like `bold` that may be set on text nodes in the model
  11839. * but are represented as an element in the view:
  11840. *
  11841. * [paragraph] MODEL ====> VIEW <p>
  11842. * |- a {bold: true} |- <b>
  11843. * |- b {bold: true} | |- ab
  11844. * |- c |- c
  11845. *
  11846. * Passed `Function` will be provided with the attribute value and then all the parameters of the
  11847. * {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:attribute `attribute` event}.
  11848. * It is expected that the function returns an {@link module:engine/view/element~Element}.
  11849. * The result of the function will be the wrapping element.
  11850. * When the provided `Function` does not return any element, no conversion will take place.
  11851. *
  11852. * The converter automatically consumes the corresponding value from the consumables list and stops the event (see
  11853. * {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher}).
  11854. *
  11855. * modelDispatcher.on( 'attribute:bold', wrap( ( modelAttributeValue, { writer } ) => {
  11856. * return writer.createAttributeElement( 'strong' );
  11857. * } );
  11858. *
  11859. * @protected
  11860. * @param {Function} elementCreator Function returning a view element that will be used for wrapping.
  11861. * @returns {Function} Set/change attribute converter.
  11862. */
  11863. function wrap( elementCreator ) {
  11864. return ( evt, data, conversionApi ) => {
  11865. // Recreate current wrapping node. It will be used to unwrap view range if the attribute value has changed
  11866. // or the attribute was removed.
  11867. const oldViewElement = elementCreator( data.attributeOldValue, conversionApi );
  11868. // Create node to wrap with.
  11869. const newViewElement = elementCreator( data.attributeNewValue, conversionApi );
  11870. if ( !oldViewElement && !newViewElement ) {
  11871. return;
  11872. }
  11873. if ( !conversionApi.consumable.consume( data.item, evt.name ) ) {
  11874. return;
  11875. }
  11876. const viewWriter = conversionApi.writer;
  11877. const viewSelection = viewWriter.document.selection;
  11878. if ( data.item instanceof _model_selection__WEBPACK_IMPORTED_MODULE_1__["default"] || data.item instanceof _model_documentselection__WEBPACK_IMPORTED_MODULE_4__["default"] ) {
  11879. // Selection attribute conversion.
  11880. viewWriter.wrap( viewSelection.getFirstRange(), newViewElement );
  11881. } else {
  11882. // Node attribute conversion.
  11883. let viewRange = conversionApi.mapper.toViewRange( data.range );
  11884. // First, unwrap the range from current wrapper.
  11885. if ( data.attributeOldValue !== null && oldViewElement ) {
  11886. viewRange = viewWriter.unwrap( viewRange, oldViewElement );
  11887. }
  11888. if ( data.attributeNewValue !== null && newViewElement ) {
  11889. viewWriter.wrap( viewRange, newViewElement );
  11890. }
  11891. }
  11892. };
  11893. }
  11894. /**
  11895. * Function factory that creates a converter which converts node insertion changes from the model to the view.
  11896. * The function passed will be provided with all the parameters of the dispatcher's
  11897. * {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:insert `insert` event}.
  11898. * It is expected that the function returns an {@link module:engine/view/element~Element}.
  11899. * The result of the function will be inserted into the view.
  11900. *
  11901. * The converter automatically consumes the corresponding value from the consumables list, stops the event (see
  11902. * {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher}) and binds the model and view elements.
  11903. *
  11904. * downcastDispatcher.on(
  11905. * 'insert:myElem',
  11906. * insertElement( ( modelItem, { writer } ) => {
  11907. * const text = writer.createText( 'myText' );
  11908. * const myElem = writer.createElement( 'myElem', { myAttr: 'my-' + modelItem.getAttribute( 'myAttr' ) }, text );
  11909. *
  11910. * // Do something fancy with `myElem` using `modelItem` or other parameters.
  11911. *
  11912. * return myElem;
  11913. * }
  11914. * ) );
  11915. *
  11916. * @protected
  11917. * @param {Function} elementCreator Function returning a view element, which will be inserted.
  11918. * @returns {Function} Insert element event converter.
  11919. */
  11920. function insertElement( elementCreator ) {
  11921. return ( evt, data, conversionApi ) => {
  11922. const viewElement = elementCreator( data.item, conversionApi );
  11923. if ( !viewElement ) {
  11924. return;
  11925. }
  11926. if ( !conversionApi.consumable.consume( data.item, 'insert' ) ) {
  11927. return;
  11928. }
  11929. const viewPosition = conversionApi.mapper.toViewPosition( data.range.start );
  11930. conversionApi.mapper.bindElements( data.item, viewElement );
  11931. conversionApi.writer.insert( viewPosition, viewElement );
  11932. };
  11933. }
  11934. /**
  11935. * Function factory that creates a converter which converts marker adding change to the
  11936. * {@link module:engine/view/uielement~UIElement view UI element}.
  11937. *
  11938. * The view UI element that will be added to the view depends on the passed parameter. See {@link ~insertElement}.
  11939. * In case of a non-collapsed range, the UI element will not wrap nodes but separate elements will be placed at the beginning
  11940. * and at the end of the range.
  11941. *
  11942. * This converter binds created UI elements with the marker name using {@link module:engine/conversion/mapper~Mapper#bindElementToMarker}.
  11943. *
  11944. * @protected
  11945. * @param {module:engine/view/uielement~UIElement|Function} elementCreator A view UI element or a function returning the view element
  11946. * that will be inserted.
  11947. * @returns {Function} Insert element event converter.
  11948. */
  11949. function insertUIElement( elementCreator ) {
  11950. return ( evt, data, conversionApi ) => {
  11951. // Create two view elements. One will be inserted at the beginning of marker, one at the end.
  11952. // If marker is collapsed, only "opening" element will be inserted.
  11953. data.isOpening = true;
  11954. const viewStartElement = elementCreator( data, conversionApi );
  11955. data.isOpening = false;
  11956. const viewEndElement = elementCreator( data, conversionApi );
  11957. if ( !viewStartElement || !viewEndElement ) {
  11958. return;
  11959. }
  11960. const markerRange = data.markerRange;
  11961. // Marker that is collapsed has consumable build differently that non-collapsed one.
  11962. // For more information see `addMarker` event description.
  11963. // If marker's range is collapsed - check if it can be consumed.
  11964. if ( markerRange.isCollapsed && !conversionApi.consumable.consume( markerRange, evt.name ) ) {
  11965. return;
  11966. }
  11967. // If marker's range is not collapsed - consume all items inside.
  11968. for ( const value of markerRange ) {
  11969. if ( !conversionApi.consumable.consume( value.item, evt.name ) ) {
  11970. return;
  11971. }
  11972. }
  11973. const mapper = conversionApi.mapper;
  11974. const viewWriter = conversionApi.writer;
  11975. // Add "opening" element.
  11976. viewWriter.insert( mapper.toViewPosition( markerRange.start ), viewStartElement );
  11977. conversionApi.mapper.bindElementToMarker( viewStartElement, data.markerName );
  11978. // Add "closing" element only if range is not collapsed.
  11979. if ( !markerRange.isCollapsed ) {
  11980. viewWriter.insert( mapper.toViewPosition( markerRange.end ), viewEndElement );
  11981. conversionApi.mapper.bindElementToMarker( viewEndElement, data.markerName );
  11982. }
  11983. evt.stop();
  11984. };
  11985. }
  11986. // Function factory that returns a default downcast converter for removing a {@link module:engine/view/uielement~UIElement UI element}
  11987. // based on marker remove change.
  11988. //
  11989. // This converter unbinds elements from the marker name.
  11990. //
  11991. // @returns {Function} Removed UI element converter.
  11992. function removeUIElement() {
  11993. return ( evt, data, conversionApi ) => {
  11994. const elements = conversionApi.mapper.markerNameToElements( data.markerName );
  11995. if ( !elements ) {
  11996. return;
  11997. }
  11998. for ( const element of elements ) {
  11999. conversionApi.mapper.unbindElementFromMarkerName( element, data.markerName );
  12000. conversionApi.writer.clear( conversionApi.writer.createRangeOn( element ), element );
  12001. }
  12002. conversionApi.writer.clearClonedElementsGroup( data.markerName );
  12003. evt.stop();
  12004. };
  12005. }
  12006. // Function factory that creates a default converter for model markers.
  12007. //
  12008. // See {@link DowncastHelpers#markerToData} for more information what type of view is generated.
  12009. //
  12010. // This converter binds created UI elements and affected view elements with the marker name
  12011. // using {@link module:engine/conversion/mapper~Mapper#bindElementToMarker}.
  12012. //
  12013. // @returns {Function} Add marker converter.
  12014. function insertMarkerData( viewCreator ) {
  12015. return ( evt, data, conversionApi ) => {
  12016. const viewMarkerData = viewCreator( data.markerName, conversionApi );
  12017. if ( !viewMarkerData ) {
  12018. return;
  12019. }
  12020. const markerRange = data.markerRange;
  12021. if ( !conversionApi.consumable.consume( markerRange, evt.name ) ) {
  12022. return;
  12023. }
  12024. // Adding closing data first to keep the proper order in the view.
  12025. handleMarkerBoundary( markerRange, false, conversionApi, data, viewMarkerData );
  12026. handleMarkerBoundary( markerRange, true, conversionApi, data, viewMarkerData );
  12027. evt.stop();
  12028. };
  12029. }
  12030. // Helper function for `insertMarkerData()` that marks a marker boundary at the beginning or end of given `range`.
  12031. function handleMarkerBoundary( range, isStart, conversionApi, data, viewMarkerData ) {
  12032. const modelPosition = isStart ? range.start : range.end;
  12033. const elementAfter = modelPosition.nodeAfter && modelPosition.nodeAfter.is( 'element' ) ? modelPosition.nodeAfter : null;
  12034. const elementBefore = modelPosition.nodeBefore && modelPosition.nodeBefore.is( 'element' ) ? modelPosition.nodeBefore : null;
  12035. if ( elementAfter || elementBefore ) {
  12036. let modelElement;
  12037. let isBefore;
  12038. // If possible, we want to add `data-group-start-before` and `data-group-end-after` attributes.
  12039. if ( isStart && elementAfter || !isStart && !elementBefore ) {
  12040. // [<elementAfter>...</elementAfter> -> <elementAfter data-group-start-before="...">...</elementAfter>
  12041. // <parent>]<elementAfter> -> <parent><elementAfter data-group-end-before="...">
  12042. modelElement = elementAfter;
  12043. isBefore = true;
  12044. } else {
  12045. // <elementBefore>...</elementBefore>] -> <elementBefore data-group-end-after="...">...</elementBefore>
  12046. // </elementBefore>[</parent> -> </elementBefore data-group-start-after="..."></parent>
  12047. modelElement = elementBefore;
  12048. isBefore = false;
  12049. }
  12050. const viewElement = conversionApi.mapper.toViewElement( modelElement );
  12051. // On rare circumstances, the model element could be not mapped to any view element and that would cause an error.
  12052. // One of those situations is a soft break inside code block.
  12053. if ( viewElement ) {
  12054. insertMarkerAsAttribute( viewElement, isStart, isBefore, conversionApi, data, viewMarkerData );
  12055. return;
  12056. }
  12057. }
  12058. const viewPosition = conversionApi.mapper.toViewPosition( modelPosition );
  12059. insertMarkerAsElement( viewPosition, isStart, conversionApi, data, viewMarkerData );
  12060. }
  12061. // Helper function for `insertMarkerData()` that marks a marker boundary in the view as an attribute on a view element.
  12062. function insertMarkerAsAttribute( viewElement, isStart, isBefore, conversionApi, data, viewMarkerData ) {
  12063. const attributeName = `data-${ viewMarkerData.group }-${ isStart ? 'start' : 'end' }-${ isBefore ? 'before' : 'after' }`;
  12064. const markerNames = viewElement.hasAttribute( attributeName ) ? viewElement.getAttribute( attributeName ).split( ',' ) : [];
  12065. // Adding marker name at the beginning to have the same order in the attribute as there is with marker elements.
  12066. markerNames.unshift( viewMarkerData.name );
  12067. conversionApi.writer.setAttribute( attributeName, markerNames.join( ',' ), viewElement );
  12068. conversionApi.mapper.bindElementToMarker( viewElement, data.markerName );
  12069. }
  12070. // Helper function for `insertMarkerData()` that marks a marker boundary in the view as a separate view ui element.
  12071. function insertMarkerAsElement( position, isStart, conversionApi, data, viewMarkerData ) {
  12072. const viewElementName = `${ viewMarkerData.group }-${ isStart ? 'start' : 'end' }`;
  12073. const attrs = viewMarkerData.name ? { 'name': viewMarkerData.name } : null;
  12074. const viewElement = conversionApi.writer.createUIElement( viewElementName, attrs );
  12075. conversionApi.writer.insert( position, viewElement );
  12076. conversionApi.mapper.bindElementToMarker( viewElement, data.markerName );
  12077. }
  12078. // Function factory that creates a converter for removing a model marker data added by the {@link #insertMarkerData} converter.
  12079. //
  12080. // @returns {Function} Remove marker converter.
  12081. function removeMarkerData( viewCreator ) {
  12082. return ( evt, data, conversionApi ) => {
  12083. const viewData = viewCreator( data.markerName, conversionApi );
  12084. if ( !viewData ) {
  12085. return;
  12086. }
  12087. const elements = conversionApi.mapper.markerNameToElements( data.markerName );
  12088. if ( !elements ) {
  12089. return;
  12090. }
  12091. for ( const element of elements ) {
  12092. conversionApi.mapper.unbindElementFromMarkerName( element, data.markerName );
  12093. if ( element.is( 'containerElement' ) ) {
  12094. removeMarkerFromAttribute( `data-${ viewData.group }-start-before`, element );
  12095. removeMarkerFromAttribute( `data-${ viewData.group }-start-after`, element );
  12096. removeMarkerFromAttribute( `data-${ viewData.group }-end-before`, element );
  12097. removeMarkerFromAttribute( `data-${ viewData.group }-end-after`, element );
  12098. } else {
  12099. conversionApi.writer.clear( conversionApi.writer.createRangeOn( element ), element );
  12100. }
  12101. }
  12102. conversionApi.writer.clearClonedElementsGroup( data.markerName );
  12103. evt.stop();
  12104. function removeMarkerFromAttribute( attributeName, element ) {
  12105. if ( element.hasAttribute( attributeName ) ) {
  12106. const markerNames = new Set( element.getAttribute( attributeName ).split( ',' ) );
  12107. markerNames.delete( viewData.name );
  12108. if ( markerNames.size == 0 ) {
  12109. conversionApi.writer.removeAttribute( attributeName, element );
  12110. } else {
  12111. conversionApi.writer.setAttribute( attributeName, Array.from( markerNames ).join( ',' ), element );
  12112. }
  12113. }
  12114. }
  12115. };
  12116. }
  12117. // Function factory that creates a converter which converts set/change/remove attribute changes from the model to the view.
  12118. //
  12119. // Attributes from the model are converted to the view element attributes in the view. You may provide a custom function to generate
  12120. // a key-value attribute pair to add/change/remove. If not provided, model attributes will be converted to view element
  12121. // attributes on a one-to-one basis.
  12122. //
  12123. // *Note:** The provided attribute creator should always return the same `key` for a given attribute from the model.
  12124. //
  12125. // The converter automatically consumes the corresponding value from the consumables list and stops the event (see
  12126. // {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher}).
  12127. //
  12128. // modelDispatcher.on( 'attribute:customAttr:myElem', changeAttribute( ( value, data ) => {
  12129. // // Change attribute key from `customAttr` to `class` in the view.
  12130. // const key = 'class';
  12131. // let value = data.attributeNewValue;
  12132. //
  12133. // // Force attribute value to 'empty' if the model element is empty.
  12134. // if ( data.item.childCount === 0 ) {
  12135. // value = 'empty';
  12136. // }
  12137. //
  12138. // // Return the key-value pair.
  12139. // return { key, value };
  12140. // } ) );
  12141. //
  12142. // @param {Function} [attributeCreator] Function returning an object with two properties: `key` and `value`, which
  12143. // represent the attribute key and attribute value to be set on a {@link module:engine/view/element~Element view element}.
  12144. // The function is passed the model attribute value as the first parameter and additional data about the change as the second parameter.
  12145. // @returns {Function} Set/change attribute converter.
  12146. function changeAttribute( attributeCreator ) {
  12147. return ( evt, data, conversionApi ) => {
  12148. const oldAttribute = attributeCreator( data.attributeOldValue, conversionApi );
  12149. const newAttribute = attributeCreator( data.attributeNewValue, conversionApi );
  12150. if ( !oldAttribute && !newAttribute ) {
  12151. return;
  12152. }
  12153. if ( !conversionApi.consumable.consume( data.item, evt.name ) ) {
  12154. return;
  12155. }
  12156. const viewElement = conversionApi.mapper.toViewElement( data.item );
  12157. const viewWriter = conversionApi.writer;
  12158. // If model item cannot be mapped to a view element, it means item is not an `Element` instance but a `TextProxy` node.
  12159. // Only elements can have attributes in a view so do not proceed for anything else (#1587).
  12160. if ( !viewElement ) {
  12161. /**
  12162. * This error occurs when a {@link module:engine/model/textproxy~TextProxy text node's} attribute is to be downcasted
  12163. * by {@link module:engine/conversion/conversion~Conversion#attributeToAttribute `Attribute to Attribute converter`}.
  12164. * In most cases it is caused by converters misconfiguration when only "generic" converter is defined:
  12165. *
  12166. * editor.conversion.for( 'downcast' ).attributeToAttribute( {
  12167. * model: 'attribute-name',
  12168. * view: 'attribute-name'
  12169. * } ) );
  12170. *
  12171. * and given attribute is used on text node, for example:
  12172. *
  12173. * model.change( writer => {
  12174. * writer.insertText( 'Foo', { 'attribute-name': 'bar' }, parent, 0 );
  12175. * } );
  12176. *
  12177. * In such cases, to convert the same attribute for both {@link module:engine/model/element~Element}
  12178. * and {@link module:engine/model/textproxy~TextProxy `Text`} nodes, text specific
  12179. * {@link module:engine/conversion/conversion~Conversion#attributeToElement `Attribute to Element converter`}
  12180. * with higher {@link module:utils/priorities~PriorityString priority} must also be defined:
  12181. *
  12182. * editor.conversion.for( 'downcast' ).attributeToElement( {
  12183. * model: {
  12184. * key: 'attribute-name',
  12185. * name: '$text'
  12186. * },
  12187. * view: ( value, { writer } ) => {
  12188. * return writer.createAttributeElement( 'span', { 'attribute-name': value } );
  12189. * },
  12190. * converterPriority: 'high'
  12191. * } ) );
  12192. *
  12193. * @error conversion-attribute-to-attribute-on-text
  12194. */
  12195. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_7__["default"](
  12196. 'conversion-attribute-to-attribute-on-text',
  12197. [ data, conversionApi ]
  12198. );
  12199. }
  12200. // First remove the old attribute if there was one.
  12201. if ( data.attributeOldValue !== null && oldAttribute ) {
  12202. if ( oldAttribute.key == 'class' ) {
  12203. const classes = Object(_ckeditor_ckeditor5_utils_src_toarray__WEBPACK_IMPORTED_MODULE_8__["default"])( oldAttribute.value );
  12204. for ( const className of classes ) {
  12205. viewWriter.removeClass( className, viewElement );
  12206. }
  12207. } else if ( oldAttribute.key == 'style' ) {
  12208. const keys = Object.keys( oldAttribute.value );
  12209. for ( const key of keys ) {
  12210. viewWriter.removeStyle( key, viewElement );
  12211. }
  12212. } else {
  12213. viewWriter.removeAttribute( oldAttribute.key, viewElement );
  12214. }
  12215. }
  12216. // Then set the new attribute.
  12217. if ( data.attributeNewValue !== null && newAttribute ) {
  12218. if ( newAttribute.key == 'class' ) {
  12219. const classes = Object(_ckeditor_ckeditor5_utils_src_toarray__WEBPACK_IMPORTED_MODULE_8__["default"])( newAttribute.value );
  12220. for ( const className of classes ) {
  12221. viewWriter.addClass( className, viewElement );
  12222. }
  12223. } else if ( newAttribute.key == 'style' ) {
  12224. const keys = Object.keys( newAttribute.value );
  12225. for ( const key of keys ) {
  12226. viewWriter.setStyle( key, newAttribute.value[ key ], viewElement );
  12227. }
  12228. } else {
  12229. viewWriter.setAttribute( newAttribute.key, newAttribute.value, viewElement );
  12230. }
  12231. }
  12232. };
  12233. }
  12234. // Function factory that creates a converter which converts the text inside marker's range. The converter wraps the text with
  12235. // {@link module:engine/view/attributeelement~AttributeElement} created from the provided descriptor.
  12236. // See {link module:engine/conversion/downcasthelpers~createViewElementFromHighlightDescriptor}.
  12237. //
  12238. // It can also be used to convert the selection that is inside a marker. In that case, an empty attribute element will be
  12239. // created and the selection will be put inside it.
  12240. //
  12241. // If the highlight descriptor does not provide the `priority` property, `10` will be used.
  12242. //
  12243. // If the highlight descriptor does not provide the `id` property, the name of the marker will be used.
  12244. //
  12245. // This converter binds the created {@link module:engine/view/attributeelement~AttributeElement attribute elemens} with the marker name
  12246. // using the {@link module:engine/conversion/mapper~Mapper#bindElementToMarker} method.
  12247. //
  12248. // @param {module:engine/conversion/downcasthelpers~HighlightDescriptor|Function} highlightDescriptor
  12249. // @returns {Function}
  12250. function highlightText( highlightDescriptor ) {
  12251. return ( evt, data, conversionApi ) => {
  12252. if ( !data.item ) {
  12253. return;
  12254. }
  12255. 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' ) ) {
  12256. return;
  12257. }
  12258. const descriptor = prepareDescriptor( highlightDescriptor, data, conversionApi );
  12259. if ( !descriptor ) {
  12260. return;
  12261. }
  12262. if ( !conversionApi.consumable.consume( data.item, evt.name ) ) {
  12263. return;
  12264. }
  12265. const viewWriter = conversionApi.writer;
  12266. const viewElement = createViewElementFromHighlightDescriptor( viewWriter, descriptor );
  12267. const viewSelection = viewWriter.document.selection;
  12268. if ( data.item instanceof _model_selection__WEBPACK_IMPORTED_MODULE_1__["default"] || data.item instanceof _model_documentselection__WEBPACK_IMPORTED_MODULE_4__["default"] ) {
  12269. viewWriter.wrap( viewSelection.getFirstRange(), viewElement, viewSelection );
  12270. } else {
  12271. const viewRange = conversionApi.mapper.toViewRange( data.range );
  12272. const rangeAfterWrap = viewWriter.wrap( viewRange, viewElement );
  12273. for ( const element of rangeAfterWrap.getItems() ) {
  12274. if ( element.is( 'attributeElement' ) && element.isSimilar( viewElement ) ) {
  12275. conversionApi.mapper.bindElementToMarker( element, data.markerName );
  12276. // One attribute element is enough, because all of them are bound together by the view writer.
  12277. // Mapper uses this binding to get all the elements no matter how many of them are registered in the mapper.
  12278. break;
  12279. }
  12280. }
  12281. }
  12282. };
  12283. }
  12284. // Converter function factory. It creates a function which applies the marker's highlight to an element inside the marker's range.
  12285. //
  12286. // The converter checks if an element has the `addHighlight` function stored as a
  12287. // {@link module:engine/view/element~Element#_setCustomProperty custom property} and, if so, uses it to apply the highlight.
  12288. // In such case the converter will consume all element's children, assuming that they were handled by the element itself.
  12289. //
  12290. // When the `addHighlight` custom property is not present, the element is not converted in any special way.
  12291. // This means that converters will proceed to convert the element's child nodes.
  12292. //
  12293. // If the highlight descriptor does not provide the `priority` property, `10` will be used.
  12294. //
  12295. // If the highlight descriptor does not provide the `id` property, the name of the marker will be used.
  12296. //
  12297. // This converter binds altered {@link module:engine/view/containerelement~ContainerElement container elements} with the marker name using
  12298. // the {@link module:engine/conversion/mapper~Mapper#bindElementToMarker} method.
  12299. //
  12300. // @param {module:engine/conversion/downcasthelpers~HighlightDescriptor|Function} highlightDescriptor
  12301. // @returns {Function}
  12302. function highlightElement( highlightDescriptor ) {
  12303. return ( evt, data, conversionApi ) => {
  12304. if ( !data.item ) {
  12305. return;
  12306. }
  12307. if ( !( data.item instanceof _model_element__WEBPACK_IMPORTED_MODULE_2__["default"] ) ) {
  12308. return;
  12309. }
  12310. const descriptor = prepareDescriptor( highlightDescriptor, data, conversionApi );
  12311. if ( !descriptor ) {
  12312. return;
  12313. }
  12314. if ( !conversionApi.consumable.test( data.item, evt.name ) ) {
  12315. return;
  12316. }
  12317. const viewElement = conversionApi.mapper.toViewElement( data.item );
  12318. if ( viewElement && viewElement.getCustomProperty( 'addHighlight' ) ) {
  12319. // Consume element itself.
  12320. conversionApi.consumable.consume( data.item, evt.name );
  12321. // Consume all children nodes.
  12322. for ( const value of _model_range__WEBPACK_IMPORTED_MODULE_0__["default"]._createIn( data.item ) ) {
  12323. conversionApi.consumable.consume( value.item, evt.name );
  12324. }
  12325. viewElement.getCustomProperty( 'addHighlight' )( viewElement, descriptor, conversionApi.writer );
  12326. conversionApi.mapper.bindElementToMarker( viewElement, data.markerName );
  12327. }
  12328. };
  12329. }
  12330. // Function factory that creates a converter which converts the removing model marker to the view.
  12331. //
  12332. // Both text nodes and elements are handled by this converter but they are handled a bit differently.
  12333. //
  12334. // Text nodes are unwrapped using the {@link module:engine/view/attributeelement~AttributeElement attribute element} created from the
  12335. // provided highlight descriptor. See {link module:engine/conversion/downcasthelpers~HighlightDescriptor}.
  12336. //
  12337. // For elements, the converter checks if an element has the `removeHighlight` function stored as a
  12338. // {@link module:engine/view/element~Element#_setCustomProperty custom property}. If so, it uses it to remove the highlight.
  12339. // In such case, the children of that element will not be converted.
  12340. //
  12341. // When `removeHighlight` is not present, the element is not converted in any special way.
  12342. // The converter will proceed to convert the element's child nodes instead.
  12343. //
  12344. // If the highlight descriptor does not provide the `priority` property, `10` will be used.
  12345. //
  12346. // If the highlight descriptor does not provide the `id` property, the name of the marker will be used.
  12347. //
  12348. // This converter unbinds elements from the marker name.
  12349. //
  12350. // @param {module:engine/conversion/downcasthelpers~HighlightDescriptor|Function} highlightDescriptor
  12351. // @returns {Function}
  12352. function removeHighlight( highlightDescriptor ) {
  12353. return ( evt, data, conversionApi ) => {
  12354. // This conversion makes sense only for non-collapsed range.
  12355. if ( data.markerRange.isCollapsed ) {
  12356. return;
  12357. }
  12358. const descriptor = prepareDescriptor( highlightDescriptor, data, conversionApi );
  12359. if ( !descriptor ) {
  12360. return;
  12361. }
  12362. // View element that will be used to unwrap `AttributeElement`s.
  12363. const viewHighlightElement = createViewElementFromHighlightDescriptor( conversionApi.writer, descriptor );
  12364. // Get all elements bound with given marker name.
  12365. const elements = conversionApi.mapper.markerNameToElements( data.markerName );
  12366. if ( !elements ) {
  12367. return;
  12368. }
  12369. for ( const element of elements ) {
  12370. conversionApi.mapper.unbindElementFromMarkerName( element, data.markerName );
  12371. if ( element.is( 'attributeElement' ) ) {
  12372. conversionApi.writer.unwrap( conversionApi.writer.createRangeOn( element ), viewHighlightElement );
  12373. } else {
  12374. // if element.is( 'containerElement' ).
  12375. element.getCustomProperty( 'removeHighlight' )( element, descriptor.id, conversionApi.writer );
  12376. }
  12377. }
  12378. conversionApi.writer.clearClonedElementsGroup( data.markerName );
  12379. evt.stop();
  12380. };
  12381. }
  12382. // Model element to view element conversion helper.
  12383. //
  12384. // See {@link ~DowncastHelpers#elementToElement `.elementToElement()` downcast helper} for examples and config params description.
  12385. //
  12386. // @param {Object} config Conversion configuration.
  12387. // @param {String} config.model
  12388. // @param {module:engine/view/elementdefinition~ElementDefinition|Function} config.view
  12389. // @param {Object} [config.triggerBy]
  12390. // @param {Array.<String>} [config.triggerBy.attributes]
  12391. // @param {Array.<String>} [config.triggerBy.children]
  12392. // @returns {Function} Conversion helper.
  12393. function downcastElementToElement( config ) {
  12394. config = Object(lodash_es__WEBPACK_IMPORTED_MODULE_6__["cloneDeep"])( config );
  12395. config.view = normalizeToElementConfig( config.view, 'container' );
  12396. return dispatcher => {
  12397. dispatcher.on( 'insert:' + config.model, insertElement( config.view ), { priority: config.converterPriority || 'normal' } );
  12398. if ( config.triggerBy ) {
  12399. if ( config.triggerBy.attributes ) {
  12400. for ( const attributeKey of config.triggerBy.attributes ) {
  12401. dispatcher._mapReconversionTriggerEvent( config.model, `attribute:${ attributeKey }:${ config.model }` );
  12402. }
  12403. }
  12404. if ( config.triggerBy.children ) {
  12405. for ( const childName of config.triggerBy.children ) {
  12406. dispatcher._mapReconversionTriggerEvent( config.model, `insert:${ childName }` );
  12407. dispatcher._mapReconversionTriggerEvent( config.model, `remove:${ childName }` );
  12408. }
  12409. }
  12410. }
  12411. };
  12412. }
  12413. // Model attribute to view element conversion helper.
  12414. //
  12415. // See {@link ~DowncastHelpers#attributeToElement `.attributeToElement()` downcast helper} for examples.
  12416. //
  12417. // @param {Object} config Conversion configuration.
  12418. // @param {String|Object} config.model The key of the attribute to convert from or a `{ key, values }` object. `values` is an array
  12419. // of `String`s with possible values if the model attribute is an enumerable.
  12420. // @param {module:engine/view/elementdefinition~ElementDefinition|Function|Object} config.view A view element definition or a function
  12421. // that takes the model attribute value and {@link module:engine/view/downcastwriter~DowncastWriter view downcast writer}
  12422. // as parameters and returns a view attribute element. If `config.model.values` is
  12423. // given, `config.view` should be an object assigning values from `config.model.values` to view element definitions or functions.
  12424. // @param {module:utils/priorities~PriorityString} [config.converterPriority='normal'] Converter priority.
  12425. // @returns {Function} Conversion helper.
  12426. function downcastAttributeToElement( config ) {
  12427. config = Object(lodash_es__WEBPACK_IMPORTED_MODULE_6__["cloneDeep"])( config );
  12428. const modelKey = config.model.key ? config.model.key : config.model;
  12429. let eventName = 'attribute:' + modelKey;
  12430. if ( config.model.name ) {
  12431. eventName += ':' + config.model.name;
  12432. }
  12433. if ( config.model.values ) {
  12434. for ( const modelValue of config.model.values ) {
  12435. config.view[ modelValue ] = normalizeToElementConfig( config.view[ modelValue ], 'attribute' );
  12436. }
  12437. } else {
  12438. config.view = normalizeToElementConfig( config.view, 'attribute' );
  12439. }
  12440. const elementCreator = getFromAttributeCreator( config );
  12441. return dispatcher => {
  12442. dispatcher.on( eventName, wrap( elementCreator ), { priority: config.converterPriority || 'normal' } );
  12443. };
  12444. }
  12445. // Model attribute to view attribute conversion helper.
  12446. //
  12447. // See {@link ~DowncastHelpers#attributeToAttribute `.attributeToAttribute()` downcast helper} for examples.
  12448. //
  12449. // @param {Object} config Conversion configuration.
  12450. // @param {String|Object} config.model The key of the attribute to convert from or a `{ key, values, [ name ] }` object describing
  12451. // the attribute key, possible values and, optionally, an element name to convert from.
  12452. // @param {String|Object|Function} config.view A view attribute key, or a `{ key, value }` object or a function that takes
  12453. // the model attribute value and returns a `{ key, value }` object. If `key` is `'class'`, `value` can be a `String` or an
  12454. // array of `String`s. If `key` is `'style'`, `value` is an object with key-value pairs. In other cases, `value` is a `String`.
  12455. // If `config.model.values` is set, `config.view` should be an object assigning values from `config.model.values` to
  12456. // `{ key, value }` objects or a functions.
  12457. // @param {module:utils/priorities~PriorityString} [config.converterPriority='normal'] Converter priority.
  12458. // @returns {Function} Conversion helper.
  12459. function downcastAttributeToAttribute( config ) {
  12460. config = Object(lodash_es__WEBPACK_IMPORTED_MODULE_6__["cloneDeep"])( config );
  12461. const modelKey = config.model.key ? config.model.key : config.model;
  12462. let eventName = 'attribute:' + modelKey;
  12463. if ( config.model.name ) {
  12464. eventName += ':' + config.model.name;
  12465. }
  12466. if ( config.model.values ) {
  12467. for ( const modelValue of config.model.values ) {
  12468. config.view[ modelValue ] = normalizeToAttributeConfig( config.view[ modelValue ] );
  12469. }
  12470. } else {
  12471. config.view = normalizeToAttributeConfig( config.view );
  12472. }
  12473. const elementCreator = getFromAttributeCreator( config );
  12474. return dispatcher => {
  12475. dispatcher.on( eventName, changeAttribute( elementCreator ), { priority: config.converterPriority || 'normal' } );
  12476. };
  12477. }
  12478. // Model marker to view element conversion helper.
  12479. //
  12480. // See {@link ~DowncastHelpers#markerToElement `.markerToElement()` downcast helper} for examples.
  12481. //
  12482. // @param {Object} config Conversion configuration.
  12483. // @param {String} config.model The name of the model marker (or model marker group) to convert.
  12484. // @param {module:engine/view/elementdefinition~ElementDefinition|Function} config.view A view element definition or a function
  12485. // that takes the model marker data as a parameter and returns a view UI element.
  12486. // @param {module:utils/priorities~PriorityString} [config.converterPriority='normal'] Converter priority.
  12487. // @returns {Function} Conversion helper.
  12488. function downcastMarkerToElement( config ) {
  12489. config = Object(lodash_es__WEBPACK_IMPORTED_MODULE_6__["cloneDeep"])( config );
  12490. config.view = normalizeToElementConfig( config.view, 'ui' );
  12491. return dispatcher => {
  12492. dispatcher.on( 'addMarker:' + config.model, insertUIElement( config.view ), { priority: config.converterPriority || 'normal' } );
  12493. dispatcher.on( 'removeMarker:' + config.model, removeUIElement( config.view ), { priority: config.converterPriority || 'normal' } );
  12494. };
  12495. }
  12496. // Model marker to view data conversion helper.
  12497. //
  12498. // See {@link ~DowncastHelpers#markerToData `markerToData()` downcast helper} to learn more.
  12499. //
  12500. // @param {Object} config
  12501. // @param {String} config.model
  12502. // @param {Function} [config.view]
  12503. // @param {module:utils/priorities~PriorityString} [config.converterPriority='normal']
  12504. // @returns {Function} Conversion helper.
  12505. function downcastMarkerToData( config ) {
  12506. config = Object(lodash_es__WEBPACK_IMPORTED_MODULE_6__["cloneDeep"])( config );
  12507. const group = config.model;
  12508. // Default conversion.
  12509. if ( !config.view ) {
  12510. config.view = markerName => ( {
  12511. group,
  12512. name: markerName.substr( config.model.length + 1 )
  12513. } );
  12514. }
  12515. return dispatcher => {
  12516. dispatcher.on( 'addMarker:' + group, insertMarkerData( config.view ), { priority: config.converterPriority || 'normal' } );
  12517. dispatcher.on( 'removeMarker:' + group, removeMarkerData( config.view ), { priority: config.converterPriority || 'normal' } );
  12518. };
  12519. }
  12520. // Model marker to highlight conversion helper.
  12521. //
  12522. // See {@link ~DowncastHelpers#markerToElement `.markerToElement()` downcast helper} for examples.
  12523. //
  12524. // @param {Object} config Conversion configuration.
  12525. // @param {String} config.model The name of the model marker (or model marker group) to convert.
  12526. // @param {module:engine/conversion/downcasthelpers~HighlightDescriptor|Function} config.view A highlight descriptor
  12527. // that will be used for highlighting or a function that takes the model marker data as a parameter and returns a highlight descriptor.
  12528. // @param {module:utils/priorities~PriorityString} [config.converterPriority='normal'] Converter priority.
  12529. // @returns {Function} Conversion helper.
  12530. function downcastMarkerToHighlight( config ) {
  12531. return dispatcher => {
  12532. dispatcher.on( 'addMarker:' + config.model, highlightText( config.view ), { priority: config.converterPriority || 'normal' } );
  12533. dispatcher.on( 'addMarker:' + config.model, highlightElement( config.view ), { priority: config.converterPriority || 'normal' } );
  12534. dispatcher.on( 'removeMarker:' + config.model, removeHighlight( config.view ), { priority: config.converterPriority || 'normal' } );
  12535. };
  12536. }
  12537. // Takes `config.view`, and if it is an {@link module:engine/view/elementdefinition~ElementDefinition}, converts it
  12538. // to a function (because lower level converters accept only element creator functions).
  12539. //
  12540. // @param {module:engine/view/elementdefinition~ElementDefinition|Function} view View configuration.
  12541. // @param {'container'|'attribute'|'ui'} viewElementType View element type to create.
  12542. // @returns {Function} Element creator function to use in lower level converters.
  12543. function normalizeToElementConfig( view, viewElementType ) {
  12544. if ( typeof view == 'function' ) {
  12545. // If `view` is already a function, don't do anything.
  12546. return view;
  12547. }
  12548. return ( modelData, conversionApi ) => createViewElementFromDefinition( view, conversionApi, viewElementType );
  12549. }
  12550. // Creates a view element instance from the provided {@link module:engine/view/elementdefinition~ElementDefinition} and class.
  12551. //
  12552. // @param {module:engine/view/elementdefinition~ElementDefinition} viewElementDefinition
  12553. // @param {module:engine/view/downcastwriter~DowncastWriter} viewWriter
  12554. // @param {'container'|'attribute'|'ui'} viewElementType
  12555. // @returns {module:engine/view/element~Element}
  12556. function createViewElementFromDefinition( viewElementDefinition, conversionApi, viewElementType ) {
  12557. if ( typeof viewElementDefinition == 'string' ) {
  12558. // If `viewElementDefinition` is given as a `String`, normalize it to an object with `name` property.
  12559. viewElementDefinition = { name: viewElementDefinition };
  12560. }
  12561. let element;
  12562. const viewWriter = conversionApi.writer;
  12563. const attributes = Object.assign( {}, viewElementDefinition.attributes );
  12564. if ( viewElementType == 'container' ) {
  12565. element = viewWriter.createContainerElement( viewElementDefinition.name, attributes );
  12566. } else if ( viewElementType == 'attribute' ) {
  12567. const options = {
  12568. priority: viewElementDefinition.priority || _view_attributeelement__WEBPACK_IMPORTED_MODULE_3__["default"].DEFAULT_PRIORITY
  12569. };
  12570. element = viewWriter.createAttributeElement( viewElementDefinition.name, attributes, options );
  12571. } else {
  12572. // 'ui'.
  12573. element = viewWriter.createUIElement( viewElementDefinition.name, attributes );
  12574. }
  12575. if ( viewElementDefinition.styles ) {
  12576. const keys = Object.keys( viewElementDefinition.styles );
  12577. for ( const key of keys ) {
  12578. viewWriter.setStyle( key, viewElementDefinition.styles[ key ], element );
  12579. }
  12580. }
  12581. if ( viewElementDefinition.classes ) {
  12582. const classes = viewElementDefinition.classes;
  12583. if ( typeof classes == 'string' ) {
  12584. viewWriter.addClass( classes, element );
  12585. } else {
  12586. for ( const className of classes ) {
  12587. viewWriter.addClass( className, element );
  12588. }
  12589. }
  12590. }
  12591. return element;
  12592. }
  12593. function getFromAttributeCreator( config ) {
  12594. if ( config.model.values ) {
  12595. return ( modelAttributeValue, conversionApi ) => {
  12596. const view = config.view[ modelAttributeValue ];
  12597. if ( view ) {
  12598. return view( modelAttributeValue, conversionApi );
  12599. }
  12600. return null;
  12601. };
  12602. } else {
  12603. return config.view;
  12604. }
  12605. }
  12606. // Takes the configuration, adds default parameters if they do not exist and normalizes other parameters to be used in downcast converters
  12607. // for generating a view attribute.
  12608. //
  12609. // @param {Object} view View configuration.
  12610. function normalizeToAttributeConfig( view ) {
  12611. if ( typeof view == 'string' ) {
  12612. return modelAttributeValue => ( { key: view, value: modelAttributeValue } );
  12613. } else if ( typeof view == 'object' ) {
  12614. // { key, value, ... }
  12615. if ( view.value ) {
  12616. return () => view;
  12617. }
  12618. // { key, ... }
  12619. else {
  12620. return modelAttributeValue => ( { key: view.key, value: modelAttributeValue } );
  12621. }
  12622. } else {
  12623. // function.
  12624. return view;
  12625. }
  12626. }
  12627. // Helper function for `highlight`. Prepares the actual descriptor object using value passed to the converter.
  12628. function prepareDescriptor( highlightDescriptor, data, conversionApi ) {
  12629. // If passed descriptor is a creator function, call it. If not, just use passed value.
  12630. const descriptor = typeof highlightDescriptor == 'function' ?
  12631. highlightDescriptor( data, conversionApi ) :
  12632. highlightDescriptor;
  12633. if ( !descriptor ) {
  12634. return null;
  12635. }
  12636. // Apply default descriptor priority.
  12637. if ( !descriptor.priority ) {
  12638. descriptor.priority = 10;
  12639. }
  12640. // Default descriptor id is marker name.
  12641. if ( !descriptor.id ) {
  12642. descriptor.id = data.markerName;
  12643. }
  12644. return descriptor;
  12645. }
  12646. /**
  12647. * An object describing how the marker highlight should be represented in the view.
  12648. *
  12649. * Each text node contained in a highlighted range will be wrapped in a `<span>`
  12650. * {@link module:engine/view/attributeelement~AttributeElement view attribute element} with CSS class(es), attributes and a priority
  12651. * described by this object.
  12652. *
  12653. * Additionally, each {@link module:engine/view/containerelement~ContainerElement container element} can handle displaying the highlight
  12654. * separately by providing the `addHighlight` and `removeHighlight` custom properties. In this case:
  12655. *
  12656. * * The `HighlightDescriptor` object is passed to the `addHighlight` function upon conversion and should be used to apply the highlight to
  12657. * the element.
  12658. * * The descriptor `id` is passed to the `removeHighlight` function upon conversion and should be used to remove the highlight with the
  12659. * given ID from the element.
  12660. *
  12661. * @typedef {Object} module:engine/conversion/downcasthelpers~HighlightDescriptor
  12662. *
  12663. * @property {String|Array.<String>} classes A CSS class or an array of classes to set. If the descriptor is used to
  12664. * create an {@link module:engine/view/attributeelement~AttributeElement attribute element} over text nodes, these classes will be set
  12665. * on that attribute element. If the descriptor is applied to an element, usually these classes will be set on that element, however,
  12666. * this depends on how the element converts the descriptor.
  12667. *
  12668. * @property {String} [id] Descriptor identifier. If not provided, it defaults to the converted marker's name.
  12669. *
  12670. * @property {Number} [priority] Descriptor priority. If not provided, it defaults to `10`. If the descriptor is used to create
  12671. * an {@link module:engine/view/attributeelement~AttributeElement attribute element}, it will be that element's
  12672. * {@link module:engine/view/attributeelement~AttributeElement#priority priority}. If the descriptor is applied to an element,
  12673. * the priority will be used to determine which descriptor is more important.
  12674. *
  12675. * @property {Object} [attributes] Attributes to set. If the descriptor is used to create
  12676. * an {@link module:engine/view/attributeelement~AttributeElement attribute element} over text nodes, these attributes will be set on that
  12677. * attribute element. If the descriptor is applied to an element, usually these attributes will be set on that element, however,
  12678. * this depends on how the element converts the descriptor.
  12679. */
  12680. /***/ }),
  12681. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/conversion/mapper.js":
  12682. /*!**************************************************************************!*\
  12683. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/conversion/mapper.js ***!
  12684. \**************************************************************************/
  12685. /*! exports provided: default */
  12686. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  12687. "use strict";
  12688. __webpack_require__.r(__webpack_exports__);
  12689. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Mapper; });
  12690. /* harmony import */ var _model_position__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../model/position */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/position.js");
  12691. /* harmony import */ var _model_range__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../model/range */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/range.js");
  12692. /* harmony import */ var _view_position__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../view/position */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/position.js");
  12693. /* harmony import */ var _view_range__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../view/range */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/range.js");
  12694. /* harmony import */ var _view_text__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../view/text */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/text.js");
  12695. /* 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");
  12696. /* 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");
  12697. /**
  12698. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  12699. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  12700. */
  12701. /**
  12702. * @module engine/conversion/mapper
  12703. */
  12704. /**
  12705. * Maps elements, positions and markers between {@link module:engine/view/document~Document the view} and
  12706. * {@link module:engine/model/model the model}.
  12707. *
  12708. * The instance of the Mapper used for the editing pipeline is available in
  12709. * {@link module:engine/controller/editingcontroller~EditingController#mapper `editor.editing.mapper`}.
  12710. *
  12711. * Mapper uses bound elements to find corresponding elements and positions, so, to get proper results,
  12712. * all model elements should be {@link module:engine/conversion/mapper~Mapper#bindElements bound}.
  12713. *
  12714. * To map complex model to/from view relations, you may provide custom callbacks for
  12715. * {@link module:engine/conversion/mapper~Mapper#event:modelToViewPosition modelToViewPosition event} and
  12716. * {@link module:engine/conversion/mapper~Mapper#event:viewToModelPosition viewToModelPosition event} that are fired whenever
  12717. * a position mapping request occurs.
  12718. * Those events are fired by {@link module:engine/conversion/mapper~Mapper#toViewPosition toViewPosition}
  12719. * and {@link module:engine/conversion/mapper~Mapper#toModelPosition toModelPosition} methods. `Mapper` adds it's own default callbacks
  12720. * with `'lowest'` priority. To override default `Mapper` mapping, add custom callback with higher priority and
  12721. * stop the event.
  12722. */
  12723. class Mapper {
  12724. /**
  12725. * Creates an instance of the mapper.
  12726. */
  12727. constructor() {
  12728. /**
  12729. * Model element to view element mapping.
  12730. *
  12731. * @private
  12732. * @member {WeakMap}
  12733. */
  12734. this._modelToViewMapping = new WeakMap();
  12735. /**
  12736. * View element to model element mapping.
  12737. *
  12738. * @private
  12739. * @member {WeakMap}
  12740. */
  12741. this._viewToModelMapping = new WeakMap();
  12742. /**
  12743. * A map containing callbacks between view element names and functions evaluating length of view elements
  12744. * in model.
  12745. *
  12746. * @private
  12747. * @member {Map}
  12748. */
  12749. this._viewToModelLengthCallbacks = new Map();
  12750. /**
  12751. * Model marker name to view elements mapping.
  12752. *
  12753. * Keys are `String`s while values are `Set`s with {@link module:engine/view/element~Element view elements}.
  12754. * One marker (name) can be mapped to multiple elements.
  12755. *
  12756. * @private
  12757. * @member {Map}
  12758. */
  12759. this._markerNameToElements = new Map();
  12760. /**
  12761. * View element to model marker names mapping.
  12762. *
  12763. * This is reverse to {@link ~Mapper#_markerNameToElements} map.
  12764. *
  12765. * @private
  12766. * @member {Map}
  12767. */
  12768. this._elementToMarkerNames = new Map();
  12769. /**
  12770. * Stores marker names of markers which has changed due to unbinding a view element (so it is assumed that the view element
  12771. * has been removed, moved or renamed).
  12772. *
  12773. * @private
  12774. * @member {Set.<module:engine/model/markercollection~Marker>}
  12775. */
  12776. this._unboundMarkerNames = new Set();
  12777. // Default mapper algorithm for mapping model position to view position.
  12778. this.on( 'modelToViewPosition', ( evt, data ) => {
  12779. if ( data.viewPosition ) {
  12780. return;
  12781. }
  12782. const viewContainer = this._modelToViewMapping.get( data.modelPosition.parent );
  12783. data.viewPosition = this.findPositionIn( viewContainer, data.modelPosition.offset );
  12784. }, { priority: 'low' } );
  12785. // Default mapper algorithm for mapping view position to model position.
  12786. this.on( 'viewToModelPosition', ( evt, data ) => {
  12787. if ( data.modelPosition ) {
  12788. return;
  12789. }
  12790. const viewBlock = this.findMappedViewAncestor( data.viewPosition );
  12791. const modelParent = this._viewToModelMapping.get( viewBlock );
  12792. const modelOffset = this._toModelOffset( data.viewPosition.parent, data.viewPosition.offset, viewBlock );
  12793. data.modelPosition = _model_position__WEBPACK_IMPORTED_MODULE_0__["default"]._createAt( modelParent, modelOffset );
  12794. }, { priority: 'low' } );
  12795. }
  12796. /**
  12797. * Marks model and view elements as corresponding. Corresponding elements can be retrieved by using
  12798. * the {@link module:engine/conversion/mapper~Mapper#toModelElement toModelElement} and
  12799. * {@link module:engine/conversion/mapper~Mapper#toViewElement toViewElement} methods.
  12800. * The information that elements are bound is also used to translate positions.
  12801. *
  12802. * @param {module:engine/model/element~Element} modelElement Model element.
  12803. * @param {module:engine/view/element~Element} viewElement View element.
  12804. */
  12805. bindElements( modelElement, viewElement ) {
  12806. this._modelToViewMapping.set( modelElement, viewElement );
  12807. this._viewToModelMapping.set( viewElement, modelElement );
  12808. }
  12809. /**
  12810. * Unbinds given {@link module:engine/view/element~Element view element} from the map.
  12811. *
  12812. * **Note:** view-to-model binding will be removed, if it existed. However, corresponding model-to-view binding
  12813. * will be removed only if model element is still bound to passed `viewElement`.
  12814. *
  12815. * This behavior lets for re-binding model element to another view element without fear of losing the new binding
  12816. * when the previously bound view element is unbound.
  12817. *
  12818. * @param {module:engine/view/element~Element} viewElement View element to unbind.
  12819. */
  12820. unbindViewElement( viewElement ) {
  12821. const modelElement = this.toModelElement( viewElement );
  12822. this._viewToModelMapping.delete( viewElement );
  12823. if ( this._elementToMarkerNames.has( viewElement ) ) {
  12824. for ( const markerName of this._elementToMarkerNames.get( viewElement ) ) {
  12825. this._unboundMarkerNames.add( markerName );
  12826. }
  12827. }
  12828. if ( this._modelToViewMapping.get( modelElement ) == viewElement ) {
  12829. this._modelToViewMapping.delete( modelElement );
  12830. }
  12831. }
  12832. /**
  12833. * Unbinds given {@link module:engine/model/element~Element model element} from the map.
  12834. *
  12835. * **Note:** model-to-view binding will be removed, if it existed. However, corresponding view-to-model binding
  12836. * will be removed only if view element is still bound to passed `modelElement`.
  12837. *
  12838. * This behavior lets for re-binding view element to another model element without fear of losing the new binding
  12839. * when the previously bound model element is unbound.
  12840. *
  12841. * @param {module:engine/model/element~Element} modelElement Model element to unbind.
  12842. */
  12843. unbindModelElement( modelElement ) {
  12844. const viewElement = this.toViewElement( modelElement );
  12845. this._modelToViewMapping.delete( modelElement );
  12846. if ( this._viewToModelMapping.get( viewElement ) == modelElement ) {
  12847. this._viewToModelMapping.delete( viewElement );
  12848. }
  12849. }
  12850. /**
  12851. * Binds given marker name with given {@link module:engine/view/element~Element view element}. The element
  12852. * will be added to the current set of elements bound with given marker name.
  12853. *
  12854. * @param {module:engine/view/element~Element} element Element to bind.
  12855. * @param {String} name Marker name.
  12856. */
  12857. bindElementToMarker( element, name ) {
  12858. const elements = this._markerNameToElements.get( name ) || new Set();
  12859. elements.add( element );
  12860. const names = this._elementToMarkerNames.get( element ) || new Set();
  12861. names.add( name );
  12862. this._markerNameToElements.set( name, elements );
  12863. this._elementToMarkerNames.set( element, names );
  12864. }
  12865. /**
  12866. * Unbinds an element from given marker name.
  12867. *
  12868. * @param {module:engine/view/element~Element} element Element to unbind.
  12869. * @param {String} name Marker name.
  12870. */
  12871. unbindElementFromMarkerName( element, name ) {
  12872. const nameToElements = this._markerNameToElements.get( name );
  12873. if ( nameToElements ) {
  12874. nameToElements.delete( element );
  12875. if ( nameToElements.size == 0 ) {
  12876. this._markerNameToElements.delete( name );
  12877. }
  12878. }
  12879. const elementToNames = this._elementToMarkerNames.get( element );
  12880. if ( elementToNames ) {
  12881. elementToNames.delete( name );
  12882. if ( elementToNames.size == 0 ) {
  12883. this._elementToMarkerNames.delete( element );
  12884. }
  12885. }
  12886. }
  12887. /**
  12888. * Returns all marker names of markers which has changed due to unbinding a view element (so it is assumed that the view element
  12889. * has been removed, moved or renamed) since the last flush. After returning, the marker names list is cleared.
  12890. *
  12891. * @returns {Array.<String>}
  12892. */
  12893. flushUnboundMarkerNames() {
  12894. const markerNames = Array.from( this._unboundMarkerNames );
  12895. this._unboundMarkerNames.clear();
  12896. return markerNames;
  12897. }
  12898. /**
  12899. * Removes all model to view and view to model bindings.
  12900. */
  12901. clearBindings() {
  12902. this._modelToViewMapping = new WeakMap();
  12903. this._viewToModelMapping = new WeakMap();
  12904. this._markerNameToElements = new Map();
  12905. this._elementToMarkerNames = new Map();
  12906. this._unboundMarkerNames = new Set();
  12907. }
  12908. /**
  12909. * Gets the corresponding model element.
  12910. *
  12911. * **Note:** {@link module:engine/view/uielement~UIElement} does not have corresponding element in model.
  12912. *
  12913. * @param {module:engine/view/element~Element} viewElement View element.
  12914. * @returns {module:engine/model/element~Element|undefined} Corresponding model element or `undefined` if not found.
  12915. */
  12916. toModelElement( viewElement ) {
  12917. return this._viewToModelMapping.get( viewElement );
  12918. }
  12919. /**
  12920. * Gets the corresponding view element.
  12921. *
  12922. * @param {module:engine/model/element~Element} modelElement Model element.
  12923. * @returns {module:engine/view/element~Element|undefined} Corresponding view element or `undefined` if not found.
  12924. */
  12925. toViewElement( modelElement ) {
  12926. return this._modelToViewMapping.get( modelElement );
  12927. }
  12928. /**
  12929. * Gets the corresponding model range.
  12930. *
  12931. * @param {module:engine/view/range~Range} viewRange View range.
  12932. * @returns {module:engine/model/range~Range} Corresponding model range.
  12933. */
  12934. toModelRange( viewRange ) {
  12935. return new _model_range__WEBPACK_IMPORTED_MODULE_1__["default"]( this.toModelPosition( viewRange.start ), this.toModelPosition( viewRange.end ) );
  12936. }
  12937. /**
  12938. * Gets the corresponding view range.
  12939. *
  12940. * @param {module:engine/model/range~Range} modelRange Model range.
  12941. * @returns {module:engine/view/range~Range} Corresponding view range.
  12942. */
  12943. toViewRange( modelRange ) {
  12944. return new _view_range__WEBPACK_IMPORTED_MODULE_3__["default"]( this.toViewPosition( modelRange.start ), this.toViewPosition( modelRange.end ) );
  12945. }
  12946. /**
  12947. * Gets the corresponding model position.
  12948. *
  12949. * @fires viewToModelPosition
  12950. * @param {module:engine/view/position~Position} viewPosition View position.
  12951. * @returns {module:engine/model/position~Position} Corresponding model position.
  12952. */
  12953. toModelPosition( viewPosition ) {
  12954. const data = {
  12955. viewPosition,
  12956. mapper: this
  12957. };
  12958. this.fire( 'viewToModelPosition', data );
  12959. return data.modelPosition;
  12960. }
  12961. /**
  12962. * Gets the corresponding view position.
  12963. *
  12964. * @fires modelToViewPosition
  12965. * @param {module:engine/model/position~Position} modelPosition Model position.
  12966. * @param {Object} [options] Additional options for position mapping process.
  12967. * @param {Boolean} [options.isPhantom=false] Should be set to `true` if the model position to map is pointing to a place
  12968. * in model tree which no longer exists. For example, it could be an end of a removed model range.
  12969. * @returns {module:engine/view/position~Position} Corresponding view position.
  12970. */
  12971. toViewPosition( modelPosition, options = { isPhantom: false } ) {
  12972. const data = {
  12973. modelPosition,
  12974. mapper: this,
  12975. isPhantom: options.isPhantom
  12976. };
  12977. this.fire( 'modelToViewPosition', data );
  12978. return data.viewPosition;
  12979. }
  12980. /**
  12981. * Gets all view elements bound to the given marker name.
  12982. *
  12983. * @param {String} name Marker name.
  12984. * @returns {Set.<module:engine/view/element~Element>|null} View elements bound with given marker name or `null`
  12985. * if no elements are bound to given marker name.
  12986. */
  12987. markerNameToElements( name ) {
  12988. const boundElements = this._markerNameToElements.get( name );
  12989. if ( !boundElements ) {
  12990. return null;
  12991. }
  12992. const elements = new Set();
  12993. for ( const element of boundElements ) {
  12994. if ( element.is( 'attributeElement' ) ) {
  12995. for ( const clone of element.getElementsWithSameId() ) {
  12996. elements.add( clone );
  12997. }
  12998. } else {
  12999. elements.add( element );
  13000. }
  13001. }
  13002. return elements;
  13003. }
  13004. /**
  13005. * Registers a callback that evaluates the length in the model of a view element with given name.
  13006. *
  13007. * The callback is fired with one argument, which is a view element instance. The callback is expected to return
  13008. * a number representing the length of view element in model.
  13009. *
  13010. * // List item in view may contain nested list, which have other list items. In model though,
  13011. * // the lists are represented by flat structure. Because of those differences, length of list view element
  13012. * // may be greater than one. In the callback it's checked how many nested list items are in evaluated list item.
  13013. *
  13014. * function getViewListItemLength( element ) {
  13015. * let length = 1;
  13016. *
  13017. * for ( let child of element.getChildren() ) {
  13018. * if ( child.name == 'ul' || child.name == 'ol' ) {
  13019. * for ( let item of child.getChildren() ) {
  13020. * length += getViewListItemLength( item );
  13021. * }
  13022. * }
  13023. * }
  13024. *
  13025. * return length;
  13026. * }
  13027. *
  13028. * mapper.registerViewToModelLength( 'li', getViewListItemLength );
  13029. *
  13030. * @param {String} viewElementName Name of view element for which callback is registered.
  13031. * @param {Function} lengthCallback Function return a length of view element instance in model.
  13032. */
  13033. registerViewToModelLength( viewElementName, lengthCallback ) {
  13034. this._viewToModelLengthCallbacks.set( viewElementName, lengthCallback );
  13035. }
  13036. /**
  13037. * For given `viewPosition`, finds and returns the closest ancestor of this position that has a mapping to
  13038. * the model.
  13039. *
  13040. * @param {module:engine/view/position~Position} viewPosition Position for which mapped ancestor should be found.
  13041. * @returns {module:engine/view/element~Element}
  13042. */
  13043. findMappedViewAncestor( viewPosition ) {
  13044. let parent = viewPosition.parent;
  13045. while ( !this._viewToModelMapping.has( parent ) ) {
  13046. parent = parent.parent;
  13047. }
  13048. return parent;
  13049. }
  13050. /**
  13051. * Calculates model offset based on the view position and the block element.
  13052. *
  13053. * Example:
  13054. *
  13055. * <p>foo<b>ba|r</b></p> // _toModelOffset( b, 2, p ) -> 5
  13056. *
  13057. * Is a sum of:
  13058. *
  13059. * <p>foo|<b>bar</b></p> // _toModelOffset( p, 3, p ) -> 3
  13060. * <p>foo<b>ba|r</b></p> // _toModelOffset( b, 2, b ) -> 2
  13061. *
  13062. * @private
  13063. * @param {module:engine/view/element~Element} viewParent Position parent.
  13064. * @param {Number} viewOffset Position offset.
  13065. * @param {module:engine/view/element~Element} viewBlock Block used as a base to calculate offset.
  13066. * @returns {Number} Offset in the model.
  13067. */
  13068. _toModelOffset( viewParent, viewOffset, viewBlock ) {
  13069. if ( viewBlock != viewParent ) {
  13070. // See example.
  13071. const offsetToParentStart = this._toModelOffset( viewParent.parent, viewParent.index, viewBlock );
  13072. const offsetInParent = this._toModelOffset( viewParent, viewOffset, viewParent );
  13073. return offsetToParentStart + offsetInParent;
  13074. }
  13075. // viewBlock == viewParent, so we need to calculate the offset in the parent element.
  13076. // If the position is a text it is simple ("ba|r" -> 2).
  13077. if ( viewParent.is( '$text' ) ) {
  13078. return viewOffset;
  13079. }
  13080. // If the position is in an element we need to sum lengths of siblings ( <b> bar </b> foo | -> 3 + 3 = 6 ).
  13081. let modelOffset = 0;
  13082. for ( let i = 0; i < viewOffset; i++ ) {
  13083. modelOffset += this.getModelLength( viewParent.getChild( i ) );
  13084. }
  13085. return modelOffset;
  13086. }
  13087. /**
  13088. * Gets the length of the view element in the model.
  13089. *
  13090. * The length is calculated as follows:
  13091. * * if {@link #registerViewToModelLength length mapping callback} is provided for given `viewNode` it is used to
  13092. * evaluate model length (`viewNode` is used as first and only parameter passed to the callback),
  13093. * * length of a {@link module:engine/view/text~Text text node} is equal to the length of it's
  13094. * {@link module:engine/view/text~Text#data data},
  13095. * * length of a {@link module:engine/view/uielement~UIElement ui element} is equal to 0,
  13096. * * length of a mapped {@link module:engine/view/element~Element element} is equal to 1,
  13097. * * length of a not-mapped {@link module:engine/view/element~Element element} is equal to the length of it's children.
  13098. *
  13099. * Examples:
  13100. *
  13101. * foo -> 3 // Text length is equal to it's data length.
  13102. * <p>foo</p> -> 1 // Length of an element which is mapped is by default equal to 1.
  13103. * <b>foo</b> -> 3 // Length of an element which is not mapped is a length of its children.
  13104. * <div><p>x</p><p>y</p></div> -> 2 // Assuming that <div> is not mapped and <p> are mapped.
  13105. *
  13106. * @param {module:engine/view/element~Element} viewNode View node.
  13107. * @returns {Number} Length of the node in the tree model.
  13108. */
  13109. getModelLength( viewNode ) {
  13110. if ( this._viewToModelLengthCallbacks.get( viewNode.name ) ) {
  13111. const callback = this._viewToModelLengthCallbacks.get( viewNode.name );
  13112. return callback( viewNode );
  13113. } else if ( this._viewToModelMapping.has( viewNode ) ) {
  13114. return 1;
  13115. } else if ( viewNode.is( '$text' ) ) {
  13116. return viewNode.data.length;
  13117. } else if ( viewNode.is( 'uiElement' ) ) {
  13118. return 0;
  13119. } else {
  13120. let len = 0;
  13121. for ( const child of viewNode.getChildren() ) {
  13122. len += this.getModelLength( child );
  13123. }
  13124. return len;
  13125. }
  13126. }
  13127. /**
  13128. * Finds the position in the view node (or its children) with the expected model offset.
  13129. *
  13130. * Example:
  13131. *
  13132. * <p>fo<b>bar</b>bom</p> -> expected offset: 4
  13133. *
  13134. * findPositionIn( p, 4 ):
  13135. * <p>|fo<b>bar</b>bom</p> -> expected offset: 4, actual offset: 0
  13136. * <p>fo|<b>bar</b>bom</p> -> expected offset: 4, actual offset: 2
  13137. * <p>fo<b>bar</b>|bom</p> -> expected offset: 4, actual offset: 5 -> we are too far
  13138. *
  13139. * findPositionIn( b, 4 - ( 5 - 3 ) ):
  13140. * <p>fo<b>|bar</b>bom</p> -> expected offset: 2, actual offset: 0
  13141. * <p>fo<b>bar|</b>bom</p> -> expected offset: 2, actual offset: 3 -> we are too far
  13142. *
  13143. * findPositionIn( bar, 2 - ( 3 - 3 ) ):
  13144. * We are in the text node so we can simple find the offset.
  13145. * <p>fo<b>ba|r</b>bom</p> -> expected offset: 2, actual offset: 2 -> position found
  13146. *
  13147. * @param {module:engine/view/element~Element} viewParent Tree view element in which we are looking for the position.
  13148. * @param {Number} expectedOffset Expected offset.
  13149. * @returns {module:engine/view/position~Position} Found position.
  13150. */
  13151. findPositionIn( viewParent, expectedOffset ) {
  13152. // Last scanned view node.
  13153. let viewNode;
  13154. // Length of the last scanned view node.
  13155. let lastLength = 0;
  13156. let modelOffset = 0;
  13157. let viewOffset = 0;
  13158. // In the text node it is simple: offset in the model equals offset in the text.
  13159. if ( viewParent.is( '$text' ) ) {
  13160. return new _view_position__WEBPACK_IMPORTED_MODULE_2__["default"]( viewParent, expectedOffset );
  13161. }
  13162. // In other cases we add lengths of child nodes to find the proper offset.
  13163. // If it is smaller we add the length.
  13164. while ( modelOffset < expectedOffset ) {
  13165. viewNode = viewParent.getChild( viewOffset );
  13166. lastLength = this.getModelLength( viewNode );
  13167. modelOffset += lastLength;
  13168. viewOffset++;
  13169. }
  13170. // If it equals we found the position.
  13171. if ( modelOffset == expectedOffset ) {
  13172. return this._moveViewPositionToTextNode( new _view_position__WEBPACK_IMPORTED_MODULE_2__["default"]( viewParent, viewOffset ) );
  13173. }
  13174. // If it is higher we need to enter last child.
  13175. else {
  13176. // ( modelOffset - lastLength ) is the offset to the child we enter,
  13177. // so we subtract it from the expected offset to fine the offset in the child.
  13178. return this.findPositionIn( viewNode, expectedOffset - ( modelOffset - lastLength ) );
  13179. }
  13180. }
  13181. /**
  13182. * Because we prefer positions in text nodes over positions next to text node moves view position to the text node
  13183. * if it was next to it.
  13184. *
  13185. * <p>[]<b>foo</b></p> -> <p>[]<b>foo</b></p> // do not touch if position is not directly next to text
  13186. * <p>foo[]<b>foo</b></p> -> <p>foo{}<b>foo</b></p> // move to text node
  13187. * <p><b>[]foo</b></p> -> <p><b>{}foo</b></p> // move to text node
  13188. *
  13189. * @private
  13190. * @param {module:engine/view/position~Position} viewPosition Position potentially next to text node.
  13191. * @returns {module:engine/view/position~Position} Position in text node if possible.
  13192. */
  13193. _moveViewPositionToTextNode( viewPosition ) {
  13194. // If the position is just after text node, put it at the end of that text node.
  13195. // If the position is just before text node, put it at the beginning of that text node.
  13196. const nodeBefore = viewPosition.nodeBefore;
  13197. const nodeAfter = viewPosition.nodeAfter;
  13198. if ( nodeBefore instanceof _view_text__WEBPACK_IMPORTED_MODULE_4__["default"] ) {
  13199. return new _view_position__WEBPACK_IMPORTED_MODULE_2__["default"]( nodeBefore, nodeBefore.data.length );
  13200. } else if ( nodeAfter instanceof _view_text__WEBPACK_IMPORTED_MODULE_4__["default"] ) {
  13201. return new _view_position__WEBPACK_IMPORTED_MODULE_2__["default"]( nodeAfter, 0 );
  13202. }
  13203. // Otherwise, just return the given position.
  13204. return viewPosition;
  13205. }
  13206. /**
  13207. * Fired for each model-to-view position mapping request. The purpose of this event is to enable custom model-to-view position
  13208. * mapping. Callbacks added to this event take {@link module:engine/model/position~Position model position} and are expected to
  13209. * calculate {@link module:engine/view/position~Position view position}. Calculated view position should be added as `viewPosition`
  13210. * value in `data` object that is passed as one of parameters to the event callback.
  13211. *
  13212. * // Assume that "captionedImage" model element is converted to <img> and following <span> elements in view,
  13213. * // and the model element is bound to <img> element. Force mapping model positions inside "captionedImage" to that
  13214. * // <span> element.
  13215. * mapper.on( 'modelToViewPosition', ( evt, data ) => {
  13216. * const positionParent = modelPosition.parent;
  13217. *
  13218. * if ( positionParent.name == 'captionedImage' ) {
  13219. * const viewImg = data.mapper.toViewElement( positionParent );
  13220. * const viewCaption = viewImg.nextSibling; // The <span> element.
  13221. *
  13222. * data.viewPosition = new ViewPosition( viewCaption, modelPosition.offset );
  13223. *
  13224. * // Stop the event if other callbacks should not modify calculated value.
  13225. * evt.stop();
  13226. * }
  13227. * } );
  13228. *
  13229. * **Note:** keep in mind that sometimes a "phantom" model position is being converted. "Phantom" model position is
  13230. * a position that points to a non-existing place in model. Such position might still be valid for conversion, though
  13231. * (it would point to a correct place in view when converted). One example of such situation is when a range is
  13232. * removed from model, there may be a need to map the range's end (which is no longer valid model position). To
  13233. * handle such situation, check `data.isPhantom` flag:
  13234. *
  13235. * // Assume that there is "customElement" model element and whenever position is before it, we want to move it
  13236. * // to the inside of the view element bound to "customElement".
  13237. * mapper.on( 'modelToViewPosition', ( evt, data ) => {
  13238. * if ( data.isPhantom ) {
  13239. * return;
  13240. * }
  13241. *
  13242. * // Below line might crash for phantom position that does not exist in model.
  13243. * const sibling = data.modelPosition.nodeBefore;
  13244. *
  13245. * // Check if this is the element we are interested in.
  13246. * if ( !sibling.is( 'element', 'customElement' ) ) {
  13247. * return;
  13248. * }
  13249. *
  13250. * const viewElement = data.mapper.toViewElement( sibling );
  13251. *
  13252. * data.viewPosition = new ViewPosition( sibling, 0 );
  13253. *
  13254. * evt.stop();
  13255. * } );
  13256. *
  13257. * **Note:** default mapping callback is provided with `low` priority setting and does not cancel the event, so it is possible to
  13258. * attach a custom callback after default callback and also use `data.viewPosition` calculated by default callback
  13259. * (for example to fix it).
  13260. *
  13261. * **Note:** default mapping callback will not fire if `data.viewPosition` is already set.
  13262. *
  13263. * **Note:** these callbacks are called **very often**. For efficiency reasons, it is advised to use them only when position
  13264. * mapping between given model and view elements is unsolvable using just elements mapping and default algorithm. Also,
  13265. * the condition that checks if special case scenario happened should be as simple as possible.
  13266. *
  13267. * @event modelToViewPosition
  13268. * @param {Object} data Data pipeline object that can store and pass data between callbacks. The callback should add
  13269. * `viewPosition` value to that object with calculated {@link module:engine/view/position~Position view position}.
  13270. * @param {module:engine/conversion/mapper~Mapper} data.mapper Mapper instance that fired the event.
  13271. */
  13272. /**
  13273. * Fired for each view-to-model position mapping request. See {@link module:engine/conversion/mapper~Mapper#event:modelToViewPosition}.
  13274. *
  13275. * // See example in `modelToViewPosition` event description.
  13276. * // This custom mapping will map positions from <span> element next to <img> to the "captionedImage" element.
  13277. * mapper.on( 'viewToModelPosition', ( evt, data ) => {
  13278. * const positionParent = viewPosition.parent;
  13279. *
  13280. * if ( positionParent.hasClass( 'image-caption' ) ) {
  13281. * const viewImg = positionParent.previousSibling;
  13282. * const modelImg = data.mapper.toModelElement( viewImg );
  13283. *
  13284. * data.modelPosition = new ModelPosition( modelImg, viewPosition.offset );
  13285. * evt.stop();
  13286. * }
  13287. * } );
  13288. *
  13289. * **Note:** default mapping callback is provided with `low` priority setting and does not cancel the event, so it is possible to
  13290. * attach a custom callback after default callback and also use `data.modelPosition` calculated by default callback
  13291. * (for example to fix it).
  13292. *
  13293. * **Note:** default mapping callback will not fire if `data.modelPosition` is already set.
  13294. *
  13295. * **Note:** these callbacks are called **very often**. For efficiency reasons, it is advised to use them only when position
  13296. * mapping between given model and view elements is unsolvable using just elements mapping and default algorithm. Also,
  13297. * the condition that checks if special case scenario happened should be as simple as possible.
  13298. *
  13299. * @event viewToModelPosition
  13300. * @param {Object} data Data pipeline object that can store and pass data between callbacks. The callback should add
  13301. * `modelPosition` value to that object with calculated {@link module:engine/model/position~Position model position}.
  13302. * @param {module:engine/conversion/mapper~Mapper} data.mapper Mapper instance that fired the event.
  13303. */
  13304. }
  13305. Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_6__["default"])( Mapper, _ckeditor_ckeditor5_utils_src_emittermixin__WEBPACK_IMPORTED_MODULE_5__["default"] );
  13306. /***/ }),
  13307. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/conversion/modelconsumable.js":
  13308. /*!***********************************************************************************!*\
  13309. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/conversion/modelconsumable.js ***!
  13310. \***********************************************************************************/
  13311. /*! exports provided: default */
  13312. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  13313. "use strict";
  13314. __webpack_require__.r(__webpack_exports__);
  13315. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ModelConsumable; });
  13316. /* harmony import */ var _model_textproxy__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../model/textproxy */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/textproxy.js");
  13317. /**
  13318. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  13319. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  13320. */
  13321. /**
  13322. * @module engine/conversion/modelconsumable
  13323. */
  13324. /**
  13325. * Manages a list of consumable values for {@link module:engine/model/item~Item model items}.
  13326. *
  13327. * Consumables are various aspects of the model. A model item can be broken down into singular properties that might be
  13328. * taken into consideration when converting that item.
  13329. *
  13330. * `ModelConsumable` is used by {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher} while analyzing changed
  13331. * parts of {@link module:engine/model/document~Document the document}. The added / changed / removed model items are broken down
  13332. * into singular properties (the item itself and it's attributes). All those parts are saved in `ModelConsumable`. Then,
  13333. * during conversion, when given part of model item is converted (i.e. the view element has been inserted into the view,
  13334. * but without attributes), consumable value is removed from `ModelConsumable`.
  13335. *
  13336. * For model items, `ModelConsumable` stores consumable values of one of following types: `insert`, `addattribute:<attributeKey>`,
  13337. * `changeattributes:<attributeKey>`, `removeattributes:<attributeKey>`.
  13338. *
  13339. * In most cases, it is enough to let {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher}
  13340. * gather consumable values, so there is no need to use
  13341. * {@link module:engine/conversion/modelconsumable~ModelConsumable#add add method} directly.
  13342. * However, it is important to understand how consumable values can be
  13343. * {@link module:engine/conversion/modelconsumable~ModelConsumable#consume consumed}.
  13344. * See {@link module:engine/conversion/downcasthelpers default downcast converters} for more information.
  13345. *
  13346. * Keep in mind, that one conversion event may have multiple callbacks (converters) attached to it. Each of those is
  13347. * able to convert one or more parts of the model. However, when one of those callbacks actually converts
  13348. * something, other should not, because they would duplicate the results. Using `ModelConsumable` helps avoiding
  13349. * this situation, because callbacks should only convert those values, which were not yet consumed from `ModelConsumable`.
  13350. *
  13351. * Consuming multiple values in a single callback:
  13352. *
  13353. * // Converter for custom `image` element that might have a `caption` element inside which changes
  13354. * // how the image is displayed in the view:
  13355. * //
  13356. * // Model:
  13357. * //
  13358. * // [image]
  13359. * // └─ [caption]
  13360. * // └─ foo
  13361. * //
  13362. * // View:
  13363. * //
  13364. * // <figure>
  13365. * // ├─ <img />
  13366. * // └─ <caption>
  13367. * // └─ foo
  13368. * modelConversionDispatcher.on( 'insert:image', ( evt, data, conversionApi ) => {
  13369. * // First, consume the `image` element.
  13370. * conversionApi.consumable.consume( data.item, 'insert' );
  13371. *
  13372. * // Just create normal image element for the view.
  13373. * // Maybe it will be "decorated" later.
  13374. * const viewImage = new ViewElement( 'img' );
  13375. * const insertPosition = conversionApi.mapper.toViewPosition( data.range.start );
  13376. * const viewWriter = conversionApi.writer;
  13377. *
  13378. * // Check if the `image` element has children.
  13379. * if ( data.item.childCount > 0 ) {
  13380. * const modelCaption = data.item.getChild( 0 );
  13381. *
  13382. * // `modelCaption` insertion change is consumed from consumable values.
  13383. * // It will not be converted by other converters, but it's children (probably some text) will be.
  13384. * // Through mapping, converters for text will know where to insert contents of `modelCaption`.
  13385. * if ( conversionApi.consumable.consume( modelCaption, 'insert' ) ) {
  13386. * const viewCaption = new ViewElement( 'figcaption' );
  13387. *
  13388. * const viewImageHolder = new ViewElement( 'figure', null, [ viewImage, viewCaption ] );
  13389. *
  13390. * conversionApi.mapper.bindElements( modelCaption, viewCaption );
  13391. * conversionApi.mapper.bindElements( data.item, viewImageHolder );
  13392. * viewWriter.insert( insertPosition, viewImageHolder );
  13393. * }
  13394. * } else {
  13395. * conversionApi.mapper.bindElements( data.item, viewImage );
  13396. * viewWriter.insert( insertPosition, viewImage );
  13397. * }
  13398. *
  13399. * evt.stop();
  13400. * } );
  13401. */
  13402. class ModelConsumable {
  13403. /**
  13404. * Creates an empty consumables list.
  13405. */
  13406. constructor() {
  13407. /**
  13408. * Contains list of consumable values.
  13409. *
  13410. * @private
  13411. * @member {Map} module:engine/conversion/modelconsumable~ModelConsumable#_consumable
  13412. */
  13413. this._consumable = new Map();
  13414. /**
  13415. * For each {@link module:engine/model/textproxy~TextProxy} added to `ModelConsumable`, this registry holds parent
  13416. * of that `TextProxy` and start and end indices of that `TextProxy`. This allows identification of `TextProxy`
  13417. * instances that points to the same part of the model but are different instances. Each distinct `TextProxy`
  13418. * is given unique `Symbol` which is then registered as consumable. This process is transparent for `ModelConsumable`
  13419. * API user because whenever `TextProxy` is added, tested, consumed or reverted, internal mechanisms of
  13420. * `ModelConsumable` translates `TextProxy` to that unique `Symbol`.
  13421. *
  13422. * @private
  13423. * @member {Map} module:engine/conversion/modelconsumable~ModelConsumable#_textProxyRegistry
  13424. */
  13425. this._textProxyRegistry = new Map();
  13426. }
  13427. /**
  13428. * Adds a consumable value to the consumables list and links it with given model item.
  13429. *
  13430. * modelConsumable.add( modelElement, 'insert' ); // Add `modelElement` insertion change to consumable values.
  13431. * modelConsumable.add( modelElement, 'addAttribute:bold' ); // Add `bold` attribute insertion on `modelElement` change.
  13432. * modelConsumable.add( modelElement, 'removeAttribute:bold' ); // Add `bold` attribute removal on `modelElement` change.
  13433. * modelConsumable.add( modelSelection, 'selection' ); // Add `modelSelection` to consumable values.
  13434. * modelConsumable.add( modelRange, 'range' ); // Add `modelRange` to consumable values.
  13435. *
  13436. * @param {module:engine/model/item~Item|module:engine/model/selection~Selection|module:engine/model/range~Range} item
  13437. * Model item, range or selection that has the consumable.
  13438. * @param {String} type Consumable type. Will be normalized to a proper form, that is either `<word>` or `<part>:<part>`.
  13439. * Second colon and everything after will be cut. Passing event name is a safe and good practice.
  13440. */
  13441. add( item, type ) {
  13442. type = _normalizeConsumableType( type );
  13443. if ( item instanceof _model_textproxy__WEBPACK_IMPORTED_MODULE_0__["default"] ) {
  13444. item = this._getSymbolForTextProxy( item );
  13445. }
  13446. if ( !this._consumable.has( item ) ) {
  13447. this._consumable.set( item, new Map() );
  13448. }
  13449. this._consumable.get( item ).set( type, true );
  13450. }
  13451. /**
  13452. * Removes given consumable value from given model item.
  13453. *
  13454. * modelConsumable.consume( modelElement, 'insert' ); // Remove `modelElement` insertion change from consumable values.
  13455. * modelConsumable.consume( modelElement, 'addAttribute:bold' ); // Remove `bold` attribute insertion on `modelElement` change.
  13456. * modelConsumable.consume( modelElement, 'removeAttribute:bold' ); // Remove `bold` attribute removal on `modelElement` change.
  13457. * modelConsumable.consume( modelSelection, 'selection' ); // Remove `modelSelection` from consumable values.
  13458. * modelConsumable.consume( modelRange, 'range' ); // Remove 'modelRange' from consumable values.
  13459. *
  13460. * @param {module:engine/model/item~Item|module:engine/model/selection~Selection|module:engine/model/range~Range} item
  13461. * Model item, range or selection from which consumable will be consumed.
  13462. * @param {String} type Consumable type. Will be normalized to a proper form, that is either `<word>` or `<part>:<part>`.
  13463. * Second colon and everything after will be cut. Passing event name is a safe and good practice.
  13464. * @returns {Boolean} `true` if consumable value was available and was consumed, `false` otherwise.
  13465. */
  13466. consume( item, type ) {
  13467. type = _normalizeConsumableType( type );
  13468. if ( item instanceof _model_textproxy__WEBPACK_IMPORTED_MODULE_0__["default"] ) {
  13469. item = this._getSymbolForTextProxy( item );
  13470. }
  13471. if ( this.test( item, type ) ) {
  13472. this._consumable.get( item ).set( type, false );
  13473. return true;
  13474. } else {
  13475. return false;
  13476. }
  13477. }
  13478. /**
  13479. * Tests whether there is a consumable value of given type connected with given model item.
  13480. *
  13481. * modelConsumable.test( modelElement, 'insert' ); // Check for `modelElement` insertion change.
  13482. * modelConsumable.test( modelElement, 'addAttribute:bold' ); // Check for `bold` attribute insertion on `modelElement` change.
  13483. * modelConsumable.test( modelElement, 'removeAttribute:bold' ); // Check for `bold` attribute removal on `modelElement` change.
  13484. * modelConsumable.test( modelSelection, 'selection' ); // Check if `modelSelection` is consumable.
  13485. * modelConsumable.test( modelRange, 'range' ); // Check if `modelRange` is consumable.
  13486. *
  13487. * @param {module:engine/model/item~Item|module:engine/model/selection~Selection|module:engine/model/range~Range} item
  13488. * Model item, range or selection to be tested.
  13489. * @param {String} type Consumable type. Will be normalized to a proper form, that is either `<word>` or `<part>:<part>`.
  13490. * Second colon and everything after will be cut. Passing event name is a safe and good practice.
  13491. * @returns {null|Boolean} `null` if such consumable was never added, `false` if the consumable values was
  13492. * already consumed or `true` if it was added and not consumed yet.
  13493. */
  13494. test( item, type ) {
  13495. type = _normalizeConsumableType( type );
  13496. if ( item instanceof _model_textproxy__WEBPACK_IMPORTED_MODULE_0__["default"] ) {
  13497. item = this._getSymbolForTextProxy( item );
  13498. }
  13499. const itemConsumables = this._consumable.get( item );
  13500. if ( itemConsumables === undefined ) {
  13501. return null;
  13502. }
  13503. const value = itemConsumables.get( type );
  13504. if ( value === undefined ) {
  13505. return null;
  13506. }
  13507. return value;
  13508. }
  13509. /**
  13510. * Reverts consuming of consumable value.
  13511. *
  13512. * modelConsumable.revert( modelElement, 'insert' ); // Revert consuming `modelElement` insertion change.
  13513. * modelConsumable.revert( modelElement, 'addAttribute:bold' ); // Revert consuming `bold` attribute insert from `modelElement`.
  13514. * modelConsumable.revert( modelElement, 'removeAttribute:bold' ); // Revert consuming `bold` attribute remove from `modelElement`.
  13515. * modelConsumable.revert( modelSelection, 'selection' ); // Revert consuming `modelSelection`.
  13516. * modelConsumable.revert( modelRange, 'range' ); // Revert consuming `modelRange`.
  13517. *
  13518. * @param {module:engine/model/item~Item|module:engine/model/selection~Selection|module:engine/model/range~Range} item
  13519. * Model item, range or selection to be reverted.
  13520. * @param {String} type Consumable type.
  13521. * @returns {null|Boolean} `true` if consumable has been reversed, `false` otherwise. `null` if the consumable has
  13522. * never been added.
  13523. */
  13524. revert( item, type ) {
  13525. type = _normalizeConsumableType( type );
  13526. if ( item instanceof _model_textproxy__WEBPACK_IMPORTED_MODULE_0__["default"] ) {
  13527. item = this._getSymbolForTextProxy( item );
  13528. }
  13529. const test = this.test( item, type );
  13530. if ( test === false ) {
  13531. this._consumable.get( item ).set( type, true );
  13532. return true;
  13533. } else if ( test === true ) {
  13534. return false;
  13535. }
  13536. return null;
  13537. }
  13538. /**
  13539. * Gets a unique symbol for passed {@link module:engine/model/textproxy~TextProxy} instance. All `TextProxy` instances that
  13540. * have same parent, same start index and same end index will get the same symbol.
  13541. *
  13542. * Used internally to correctly consume `TextProxy` instances.
  13543. *
  13544. * @private
  13545. * @param {module:engine/model/textproxy~TextProxy} textProxy `TextProxy` instance to get a symbol for.
  13546. * @returns {Symbol} Symbol representing all equal instances of `TextProxy`.
  13547. */
  13548. _getSymbolForTextProxy( textProxy ) {
  13549. let symbol = null;
  13550. const startMap = this._textProxyRegistry.get( textProxy.startOffset );
  13551. if ( startMap ) {
  13552. const endMap = startMap.get( textProxy.endOffset );
  13553. if ( endMap ) {
  13554. symbol = endMap.get( textProxy.parent );
  13555. }
  13556. }
  13557. if ( !symbol ) {
  13558. symbol = this._addSymbolForTextProxy( textProxy.startOffset, textProxy.endOffset, textProxy.parent );
  13559. }
  13560. return symbol;
  13561. }
  13562. /**
  13563. * Adds a symbol for given properties that characterizes a {@link module:engine/model/textproxy~TextProxy} instance.
  13564. *
  13565. * Used internally to correctly consume `TextProxy` instances.
  13566. *
  13567. * @private
  13568. * @param {Number} startIndex Text proxy start index in it's parent.
  13569. * @param {Number} endIndex Text proxy end index in it's parent.
  13570. * @param {module:engine/model/element~Element} parent Text proxy parent.
  13571. * @returns {Symbol} Symbol generated for given properties.
  13572. */
  13573. _addSymbolForTextProxy( start, end, parent ) {
  13574. const symbol = Symbol( 'textProxySymbol' );
  13575. let startMap, endMap;
  13576. startMap = this._textProxyRegistry.get( start );
  13577. if ( !startMap ) {
  13578. startMap = new Map();
  13579. this._textProxyRegistry.set( start, startMap );
  13580. }
  13581. endMap = startMap.get( end );
  13582. if ( !endMap ) {
  13583. endMap = new Map();
  13584. startMap.set( end, endMap );
  13585. }
  13586. endMap.set( parent, symbol );
  13587. return symbol;
  13588. }
  13589. }
  13590. // Returns a normalized consumable type name from given string. A normalized consumable type name is a string that has
  13591. // at most one colon, for example: `insert` or `addMarker:highlight`. If string to normalize has more "parts" (more colons),
  13592. // the other parts are dropped, for example: `addattribute:bold:$text` -> `addattributes:bold`.
  13593. //
  13594. // @param {String} type Consumable type.
  13595. // @returns {String} Normalized consumable type.
  13596. function _normalizeConsumableType( type ) {
  13597. const parts = type.split( ':' );
  13598. return parts.length > 1 ? parts[ 0 ] + ':' + parts[ 1 ] : parts[ 0 ];
  13599. }
  13600. /***/ }),
  13601. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/conversion/upcastdispatcher.js":
  13602. /*!************************************************************************************!*\
  13603. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/conversion/upcastdispatcher.js ***!
  13604. \************************************************************************************/
  13605. /*! exports provided: default */
  13606. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  13607. "use strict";
  13608. __webpack_require__.r(__webpack_exports__);
  13609. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return UpcastDispatcher; });
  13610. /* harmony import */ var _viewconsumable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./viewconsumable */ "./node_modules/@ckeditor/ckeditor5-engine/src/conversion/viewconsumable.js");
  13611. /* harmony import */ var _model_range__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../model/range */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/range.js");
  13612. /* harmony import */ var _model_position__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../model/position */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/position.js");
  13613. /* harmony import */ var _model_schema__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../model/schema */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/schema.js");
  13614. /* 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");
  13615. /* 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");
  13616. /* 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");
  13617. /* 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");
  13618. /**
  13619. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  13620. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  13621. */
  13622. /**
  13623. * @module engine/conversion/upcastdispatcher
  13624. */
  13625. /**
  13626. * Upcast dispatcher is a central point of the view-to-model conversion, which is a process of
  13627. * converting a given {@link module:engine/view/documentfragment~DocumentFragment view document fragment} or
  13628. * {@link module:engine/view/element~Element view element} into a correct model structure.
  13629. *
  13630. * During the conversion process, the dispatcher fires events for all {@link module:engine/view/node~Node view nodes}
  13631. * from the converted view document fragment.
  13632. * Special callbacks called "converters" should listen to these events in order to convert the view nodes.
  13633. *
  13634. * The second parameter of the callback is the `data` object with the following properties:
  13635. *
  13636. * * `data.viewItem` contains a {@link module:engine/view/node~Node view node} or a
  13637. * {@link module:engine/view/documentfragment~DocumentFragment view document fragment}
  13638. * that is converted at the moment and might be handled by the callback.
  13639. * * `data.modelRange` is used to point to the result
  13640. * of the current conversion (e.g. the element that is being inserted)
  13641. * and is always a {@link module:engine/model/range~Range} when the conversion succeeds.
  13642. * * `data.modelCursor` is a {@link module:engine/model/position~Position position} on which the converter should insert
  13643. * the newly created items.
  13644. *
  13645. * The third parameter of the callback is an instance of {@link module:engine/conversion/upcastdispatcher~UpcastConversionApi}
  13646. * which provides additional tools for converters.
  13647. *
  13648. * You can read more about conversion in the following guides:
  13649. *
  13650. * * {@glink framework/guides/deep-dive/conversion/conversion-introduction Advanced conversion concepts &mdash; attributes}
  13651. * * {@glink framework/guides/deep-dive/conversion/custom-element-conversion Custom element conversion}
  13652. *
  13653. * Examples of event-based converters:
  13654. *
  13655. * // A converter for links (<a>).
  13656. * editor.data.upcastDispatcher.on( 'element:a', ( evt, data, conversionApi ) => {
  13657. * if ( conversionApi.consumable.consume( data.viewItem, { name: true, attributes: [ 'href' ] } ) ) {
  13658. * // The <a> element is inline and is represented by an attribute in the model.
  13659. * // This is why you need to convert only children.
  13660. * const { modelRange } = conversionApi.convertChildren( data.viewItem, data.modelCursor );
  13661. *
  13662. * for ( let item of modelRange.getItems() ) {
  13663. * if ( conversionApi.schema.checkAttribute( item, 'linkHref' ) ) {
  13664. * conversionApi.writer.setAttribute( 'linkHref', data.viewItem.getAttribute( 'href' ), item );
  13665. * }
  13666. * }
  13667. * }
  13668. * } );
  13669. *
  13670. * // Convert <p> element's font-size style.
  13671. * // Note: You should use a low-priority observer in order to ensure that
  13672. * // it is executed after the element-to-element converter.
  13673. * editor.data.upcastDispatcher.on( 'element:p', ( evt, data, conversionApi ) => {
  13674. * const { consumable, schema, writer } = conversionApi;
  13675. *
  13676. * if ( !consumable.consume( data.viewItem, { style: 'font-size' } ) ) {
  13677. * return;
  13678. * }
  13679. *
  13680. * const fontSize = data.viewItem.getStyle( 'font-size' );
  13681. *
  13682. * // Do not go for the model element after data.modelCursor because it might happen
  13683. * // that a single view element was converted to multiple model elements. Get all of them.
  13684. * for ( const item of data.modelRange.getItems( { shallow: true } ) ) {
  13685. * if ( schema.checkAttribute( item, 'fontSize' ) ) {
  13686. * writer.setAttribute( 'fontSize', fontSize, item );
  13687. * }
  13688. * }
  13689. * }, { priority: 'low' } );
  13690. *
  13691. * // Convert all elements which have no custom converter into a paragraph (autoparagraphing).
  13692. * editor.data.upcastDispatcher.on( 'element', ( evt, data, conversionApi ) => {
  13693. * // Check if an element can be converted.
  13694. * if ( !conversionApi.consumable.test( data.viewItem, { name: data.viewItem.name } ) ) {
  13695. * // When an element is already consumed by higher priority converters, do nothing.
  13696. * return;
  13697. * }
  13698. *
  13699. * const paragraph = conversionApi.writer.createElement( 'paragraph' );
  13700. *
  13701. * // Try to safely insert a paragraph at the model cursor - it will find an allowed parent for the current element.
  13702. * if ( !conversionApi.safeInsert( paragraph, data.modelCursor ) ) {
  13703. * // When an element was not inserted, it means that you cannot insert a paragraph at this position.
  13704. * return;
  13705. * }
  13706. *
  13707. * // Consume the inserted element.
  13708. * conversionApi.consumable.consume( data.viewItem, { name: data.viewItem.name } ) );
  13709. *
  13710. * // Convert the children to a paragraph.
  13711. * const { modelRange } = conversionApi.convertChildren( data.viewItem, paragraph ) );
  13712. *
  13713. * // Update `modelRange` and `modelCursor` in the `data` as a conversion result.
  13714. * conversionApi.updateConversionResult( paragraph, data );
  13715. * }, { priority: 'low' } );
  13716. *
  13717. * @mixes module:utils/emittermixin~EmitterMixin
  13718. * @fires viewCleanup
  13719. * @fires element
  13720. * @fires text
  13721. * @fires documentFragment
  13722. */
  13723. class UpcastDispatcher {
  13724. /**
  13725. * Creates an upcast dispatcher that operates using the passed API.
  13726. *
  13727. * @see module:engine/conversion/upcastdispatcher~UpcastConversionApi
  13728. * @param {Object} [conversionApi] Additional properties for an interface that will be passed to events fired
  13729. * by the upcast dispatcher.
  13730. */
  13731. constructor( conversionApi = {} ) {
  13732. /**
  13733. * The list of elements that were created during splitting.
  13734. *
  13735. * After the conversion process the list is cleared.
  13736. *
  13737. * @private
  13738. * @type {Map.<module:engine/model/element~Element,Array.<module:engine/model/element~Element>>}
  13739. */
  13740. this._splitParts = new Map();
  13741. /**
  13742. * The list of cursor parent elements that were created during splitting.
  13743. *
  13744. * After the conversion process the list is cleared.
  13745. *
  13746. * @private
  13747. * @type {Map.<module:engine/model/element~Element,Array.<module:engine/model/element~Element>>}
  13748. */
  13749. this._cursorParents = new Map();
  13750. /**
  13751. * The position in the temporary structure where the converted content is inserted. The structure reflects the context of
  13752. * the target position where the content will be inserted. This property is built based on the context parameter of the
  13753. * convert method.
  13754. *
  13755. * @private
  13756. * @type {module:engine/model/position~Position|null}
  13757. */
  13758. this._modelCursor = null;
  13759. /**
  13760. * An interface passed by the dispatcher to the event callbacks.
  13761. *
  13762. * @member {module:engine/conversion/upcastdispatcher~UpcastConversionApi}
  13763. */
  13764. this.conversionApi = Object.assign( {}, conversionApi );
  13765. // The below methods are bound to this `UpcastDispatcher` instance and set on `conversionApi`.
  13766. // This way only a part of `UpcastDispatcher` API is exposed.
  13767. this.conversionApi.convertItem = this._convertItem.bind( this );
  13768. this.conversionApi.convertChildren = this._convertChildren.bind( this );
  13769. this.conversionApi.safeInsert = this._safeInsert.bind( this );
  13770. this.conversionApi.updateConversionResult = this._updateConversionResult.bind( this );
  13771. // Advanced API - use only if custom position handling is needed.
  13772. this.conversionApi.splitToAllowedParent = this._splitToAllowedParent.bind( this );
  13773. this.conversionApi.getSplitParts = this._getSplitParts.bind( this );
  13774. }
  13775. /**
  13776. * Starts the conversion process. The entry point for the conversion.
  13777. *
  13778. * @fires element
  13779. * @fires text
  13780. * @fires documentFragment
  13781. * @param {module:engine/view/documentfragment~DocumentFragment|module:engine/view/element~Element} viewItem
  13782. * The part of the view to be converted.
  13783. * @param {module:engine/model/writer~Writer} writer An instance of the model writer.
  13784. * @param {module:engine/model/schema~SchemaContextDefinition} [context=['$root']] Elements will be converted according to this context.
  13785. * @returns {module:engine/model/documentfragment~DocumentFragment} Model data that is the result of the conversion process
  13786. * wrapped in `DocumentFragment`. Converted marker elements will be set as the document fragment's
  13787. * {@link module:engine/model/documentfragment~DocumentFragment#markers static markers map}.
  13788. */
  13789. convert( viewItem, writer, context = [ '$root' ] ) {
  13790. this.fire( 'viewCleanup', viewItem );
  13791. // Create context tree and set position in the top element.
  13792. // Items will be converted according to this position.
  13793. this._modelCursor = createContextTree( context, writer );
  13794. // Store writer in conversion as a conversion API
  13795. // to be sure that conversion process will use the same batch.
  13796. this.conversionApi.writer = writer;
  13797. // Create consumable values list for conversion process.
  13798. this.conversionApi.consumable = _viewconsumable__WEBPACK_IMPORTED_MODULE_0__["default"].createFrom( viewItem );
  13799. // Custom data stored by converter for conversion process.
  13800. this.conversionApi.store = {};
  13801. // Do the conversion.
  13802. const { modelRange } = this._convertItem( viewItem, this._modelCursor );
  13803. // Conversion result is always a document fragment so let's create it.
  13804. const documentFragment = writer.createDocumentFragment();
  13805. // When there is a conversion result.
  13806. if ( modelRange ) {
  13807. // Remove all empty elements that were create while splitting.
  13808. this._removeEmptyElements();
  13809. // Move all items that were converted in context tree to the document fragment.
  13810. for ( const item of Array.from( this._modelCursor.parent.getChildren() ) ) {
  13811. writer.append( item, documentFragment );
  13812. }
  13813. // Extract temporary markers elements from model and set as static markers collection.
  13814. documentFragment.markers = extractMarkersFromModelFragment( documentFragment, writer );
  13815. }
  13816. // Clear context position.
  13817. this._modelCursor = null;
  13818. // Clear split elements & parents lists.
  13819. this._splitParts.clear();
  13820. this._cursorParents.clear();
  13821. // Clear conversion API.
  13822. this.conversionApi.writer = null;
  13823. this.conversionApi.store = null;
  13824. // Return fragment as conversion result.
  13825. return documentFragment;
  13826. }
  13827. /**
  13828. * @private
  13829. * @see module:engine/conversion/upcastdispatcher~UpcastConversionApi#convertItem
  13830. */
  13831. _convertItem( viewItem, modelCursor ) {
  13832. const data = Object.assign( { viewItem, modelCursor, modelRange: null } );
  13833. if ( viewItem.is( 'element' ) ) {
  13834. this.fire( 'element:' + viewItem.name, data, this.conversionApi );
  13835. } else if ( viewItem.is( '$text' ) ) {
  13836. this.fire( 'text', data, this.conversionApi );
  13837. } else {
  13838. this.fire( 'documentFragment', data, this.conversionApi );
  13839. }
  13840. // Handle incorrect conversion result.
  13841. if ( data.modelRange && !( data.modelRange instanceof _model_range__WEBPACK_IMPORTED_MODULE_1__["default"] ) ) {
  13842. /**
  13843. * Incorrect conversion result was dropped.
  13844. *
  13845. * {@link module:engine/model/range~Range Model range} should be a conversion result.
  13846. *
  13847. * @error view-conversion-dispatcher-incorrect-result
  13848. */
  13849. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_5__["default"]( 'view-conversion-dispatcher-incorrect-result', this );
  13850. }
  13851. return { modelRange: data.modelRange, modelCursor: data.modelCursor };
  13852. }
  13853. /**
  13854. * @private
  13855. * @see module:engine/conversion/upcastdispatcher~UpcastConversionApi#convertChildren
  13856. */
  13857. _convertChildren( viewItem, elementOrModelCursor ) {
  13858. let nextModelCursor = elementOrModelCursor.is( 'position' ) ?
  13859. elementOrModelCursor : _model_position__WEBPACK_IMPORTED_MODULE_2__["default"]._createAt( elementOrModelCursor, 0 );
  13860. const modelRange = new _model_range__WEBPACK_IMPORTED_MODULE_1__["default"]( nextModelCursor );
  13861. for ( const viewChild of Array.from( viewItem.getChildren() ) ) {
  13862. const result = this._convertItem( viewChild, nextModelCursor );
  13863. if ( result.modelRange instanceof _model_range__WEBPACK_IMPORTED_MODULE_1__["default"] ) {
  13864. modelRange.end = result.modelRange.end;
  13865. nextModelCursor = result.modelCursor;
  13866. }
  13867. }
  13868. return { modelRange, modelCursor: nextModelCursor };
  13869. }
  13870. /**
  13871. * @private
  13872. * @see module:engine/conversion/upcastdispatcher~UpcastConversionApi#safeInsert
  13873. */
  13874. _safeInsert( modelElement, position ) {
  13875. // Find allowed parent for element that we are going to insert.
  13876. // If current parent does not allow to insert element but one of the ancestors does
  13877. // then split nodes to allowed parent.
  13878. const splitResult = this._splitToAllowedParent( modelElement, position );
  13879. // When there is no split result it means that we can't insert element to model tree, so let's skip it.
  13880. if ( !splitResult ) {
  13881. return false;
  13882. }
  13883. // Insert element on allowed position.
  13884. this.conversionApi.writer.insert( modelElement, splitResult.position );
  13885. return true;
  13886. }
  13887. /**
  13888. * @private
  13889. * @see module:engine/conversion/upcastdispatcher~UpcastConversionApi#updateConversionResult
  13890. */
  13891. _updateConversionResult( modelElement, data ) {
  13892. const parts = this._getSplitParts( modelElement );
  13893. const writer = this.conversionApi.writer;
  13894. // Set conversion result range - only if not set already.
  13895. if ( !data.modelRange ) {
  13896. data.modelRange = writer.createRange(
  13897. writer.createPositionBefore( modelElement ),
  13898. writer.createPositionAfter( parts[ parts.length - 1 ] )
  13899. );
  13900. }
  13901. const savedCursorParent = this._cursorParents.get( modelElement );
  13902. // Now we need to check where the `modelCursor` should be.
  13903. if ( savedCursorParent ) {
  13904. // If we split parent to insert our element then we want to continue conversion in the new part of the split parent.
  13905. //
  13906. // before: <allowed><notAllowed>foo[]</notAllowed></allowed>
  13907. // after: <allowed><notAllowed>foo</notAllowed> <converted></converted> <notAllowed>[]</notAllowed></allowed>
  13908. data.modelCursor = writer.createPositionAt( savedCursorParent, 0 );
  13909. } else {
  13910. // Otherwise just continue after inserted element.
  13911. data.modelCursor = data.modelRange.end;
  13912. }
  13913. }
  13914. /**
  13915. * @private
  13916. * @see module:engine/conversion/upcastdispatcher~UpcastConversionApi#splitToAllowedParent
  13917. */
  13918. _splitToAllowedParent( node, modelCursor ) {
  13919. const { schema, writer } = this.conversionApi;
  13920. // Try to find allowed parent.
  13921. let allowedParent = schema.findAllowedParent( modelCursor, node );
  13922. if ( allowedParent ) {
  13923. // When current position parent allows to insert node then return this position.
  13924. if ( allowedParent === modelCursor.parent ) {
  13925. return { position: modelCursor };
  13926. }
  13927. // When allowed parent is in context tree (it's outside the converted tree).
  13928. if ( this._modelCursor.parent.getAncestors().includes( allowedParent ) ) {
  13929. allowedParent = null;
  13930. }
  13931. }
  13932. if ( !allowedParent ) {
  13933. // Check if the node wrapped with a paragraph would be accepted by the schema.
  13934. if ( !Object(_model_utils_autoparagraphing__WEBPACK_IMPORTED_MODULE_4__["isParagraphable"])( modelCursor, node, schema ) ) {
  13935. return null;
  13936. }
  13937. return {
  13938. position: Object(_model_utils_autoparagraphing__WEBPACK_IMPORTED_MODULE_4__["wrapInParagraph"])( modelCursor, writer )
  13939. };
  13940. }
  13941. // Split element to allowed parent.
  13942. const splitResult = this.conversionApi.writer.split( modelCursor, allowedParent );
  13943. // Using the range returned by `model.Writer#split`, we will pair original elements with their split parts.
  13944. //
  13945. // The range returned from the writer spans "over the split" or, precisely saying, from the end of the original element (the one
  13946. // that got split) to the beginning of the other part of that element:
  13947. //
  13948. // <limit><a><b><c>X[]Y</c></b><a></limit> ->
  13949. // <limit><a><b><c>X[</c></b></a><a><b><c>]Y</c></b></a>
  13950. //
  13951. // After the split there cannot be any full node between the positions in `splitRange`. The positions are touching.
  13952. // Also, because of how splitting works, it is easy to notice, that "closing tags" are in the reverse order than "opening tags".
  13953. // Also, since we split all those elements, each of them has to have the other part.
  13954. //
  13955. // With those observations in mind, we will pair the original elements with their split parts by saving "closing tags" and matching
  13956. // them with "opening tags" in the reverse order. For that we can use a stack.
  13957. const stack = [];
  13958. for ( const treeWalkerValue of splitResult.range.getWalker() ) {
  13959. if ( treeWalkerValue.type == 'elementEnd' ) {
  13960. stack.push( treeWalkerValue.item );
  13961. } else {
  13962. // There should not be any text nodes after the element is split, so the only other value is `elementStart`.
  13963. const originalPart = stack.pop();
  13964. const splitPart = treeWalkerValue.item;
  13965. this._registerSplitPair( originalPart, splitPart );
  13966. }
  13967. }
  13968. const cursorParent = splitResult.range.end.parent;
  13969. this._cursorParents.set( node, cursorParent );
  13970. return {
  13971. position: splitResult.position,
  13972. cursorParent
  13973. };
  13974. }
  13975. /**
  13976. * Registers that a `splitPart` element is a split part of the `originalPart` element.
  13977. *
  13978. * The data set by this method is used by {@link #_getSplitParts} and {@link #_removeEmptyElements}.
  13979. *
  13980. * @private
  13981. * @param {module:engine/model/element~Element} originalPart
  13982. * @param {module:engine/model/element~Element} splitPart
  13983. */
  13984. _registerSplitPair( originalPart, splitPart ) {
  13985. if ( !this._splitParts.has( originalPart ) ) {
  13986. this._splitParts.set( originalPart, [ originalPart ] );
  13987. }
  13988. const list = this._splitParts.get( originalPart );
  13989. this._splitParts.set( splitPart, list );
  13990. list.push( splitPart );
  13991. }
  13992. /**
  13993. * @private
  13994. * @see module:engine/conversion/upcastdispatcher~UpcastConversionApi#getSplitParts
  13995. */
  13996. _getSplitParts( element ) {
  13997. let parts;
  13998. if ( !this._splitParts.has( element ) ) {
  13999. parts = [ element ];
  14000. } else {
  14001. parts = this._splitParts.get( element );
  14002. }
  14003. return parts;
  14004. }
  14005. /**
  14006. * Checks if there are any empty elements created while splitting and removes them.
  14007. *
  14008. * This method works recursively to re-check empty elements again after at least one element was removed in the initial call,
  14009. * as some elements might have become empty after other empty elements were removed from them.
  14010. *
  14011. * @private
  14012. */
  14013. _removeEmptyElements() {
  14014. let anyRemoved = false;
  14015. for ( const element of this._splitParts.keys() ) {
  14016. if ( element.isEmpty ) {
  14017. this.conversionApi.writer.remove( element );
  14018. this._splitParts.delete( element );
  14019. anyRemoved = true;
  14020. }
  14021. }
  14022. if ( anyRemoved ) {
  14023. this._removeEmptyElements();
  14024. }
  14025. }
  14026. /**
  14027. * Fired before the first conversion event, at the beginning of the upcast (view-to-model conversion) process.
  14028. *
  14029. * @event viewCleanup
  14030. * @param {module:engine/view/documentfragment~DocumentFragment|module:engine/view/element~Element}
  14031. * viewItem A part of the view to be converted.
  14032. */
  14033. /**
  14034. * Fired when an {@link module:engine/view/element~Element} is converted.
  14035. *
  14036. * `element` is a namespace event for a class of events. Names of actually called events follow the pattern of
  14037. * `element:<elementName>` where `elementName` is the name of the converted element. This way listeners may listen to
  14038. * a conversion of all or just specific elements.
  14039. *
  14040. * @event element
  14041. * @param {module:engine/conversion/upcastdispatcher~UpcastConversionData} data The conversion data. Keep in mind that this object is
  14042. * shared by reference between all callbacks that will be called. This means that callbacks can override values if needed, and these
  14043. * values will be available in other callbacks.
  14044. * @param {module:engine/conversion/upcastdispatcher~UpcastConversionApi} conversionApi Conversion utilities to be used by the
  14045. * callback.
  14046. */
  14047. /**
  14048. * Fired when a {@link module:engine/view/text~Text} is converted.
  14049. *
  14050. * @event text
  14051. * @see #event:element
  14052. */
  14053. /**
  14054. * Fired when a {@link module:engine/view/documentfragment~DocumentFragment} is converted.
  14055. *
  14056. * @event documentFragment
  14057. * @see #event:element
  14058. */
  14059. }
  14060. Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_7__["default"])( UpcastDispatcher, _ckeditor_ckeditor5_utils_src_emittermixin__WEBPACK_IMPORTED_MODULE_6__["default"] );
  14061. // Traverses given model item and searches elements which marks marker range. Found element is removed from
  14062. // DocumentFragment but path of this element is stored in a Map which is then returned.
  14063. //
  14064. // @param {module:engine/view/documentfragment~DocumentFragment|module:engine/view/node~Node} modelItem Fragment of model.
  14065. // @returns {Map<String, module:engine/model/range~Range>} List of static markers.
  14066. function extractMarkersFromModelFragment( modelItem, writer ) {
  14067. const markerElements = new Set();
  14068. const markers = new Map();
  14069. // Create ModelTreeWalker.
  14070. const range = _model_range__WEBPACK_IMPORTED_MODULE_1__["default"]._createIn( modelItem ).getItems();
  14071. // Walk through DocumentFragment and collect marker elements.
  14072. for ( const item of range ) {
  14073. // Check if current element is a marker.
  14074. if ( item.name == '$marker' ) {
  14075. markerElements.add( item );
  14076. }
  14077. }
  14078. // Walk through collected marker elements store its path and remove its from the DocumentFragment.
  14079. for ( const markerElement of markerElements ) {
  14080. const markerName = markerElement.getAttribute( 'data-name' );
  14081. const currentPosition = writer.createPositionBefore( markerElement );
  14082. // When marker of given name is not stored it means that we have found the beginning of the range.
  14083. if ( !markers.has( markerName ) ) {
  14084. markers.set( markerName, new _model_range__WEBPACK_IMPORTED_MODULE_1__["default"]( currentPosition.clone() ) );
  14085. // Otherwise is means that we have found end of the marker range.
  14086. } else {
  14087. markers.get( markerName ).end = currentPosition.clone();
  14088. }
  14089. // Remove marker element from DocumentFragment.
  14090. writer.remove( markerElement );
  14091. }
  14092. return markers;
  14093. }
  14094. // Creates model fragment according to given context and returns position in the bottom (the deepest) element.
  14095. function createContextTree( contextDefinition, writer ) {
  14096. let position;
  14097. for ( const item of new _model_schema__WEBPACK_IMPORTED_MODULE_3__["SchemaContext"]( contextDefinition ) ) {
  14098. const attributes = {};
  14099. for ( const key of item.getAttributeKeys() ) {
  14100. attributes[ key ] = item.getAttribute( key );
  14101. }
  14102. const current = writer.createElement( item.name, attributes );
  14103. if ( position ) {
  14104. writer.append( current, position );
  14105. }
  14106. position = _model_position__WEBPACK_IMPORTED_MODULE_2__["default"]._createAt( current, 0 );
  14107. }
  14108. return position;
  14109. }
  14110. /**
  14111. * A set of conversion utilities available as the third parameter of the
  14112. * {@link module:engine/conversion/upcastdispatcher~UpcastDispatcher upcast dispatcher}'s events.
  14113. *
  14114. * @interface module:engine/conversion/upcastdispatcher~UpcastConversionApi
  14115. */
  14116. /**
  14117. * Starts the conversion of a given item by firing an appropriate event.
  14118. *
  14119. * Every fired event is passed (as the first parameter) an object with the `modelRange` property. Every event may set and/or
  14120. * modify that property. When all callbacks are done, the final value of the `modelRange` property is returned by this method.
  14121. * The `modelRange` must be a {@link module:engine/model/range~Range model range} or `null` (as set by default).
  14122. *
  14123. * @method #convertItem
  14124. * @fires module:engine/conversion/upcastdispatcher~UpcastDispatcher#event:element
  14125. * @fires module:engine/conversion/upcastdispatcher~UpcastDispatcher#event:text
  14126. * @fires module:engine/conversion/upcastdispatcher~UpcastDispatcher#event:documentFragment
  14127. * @param {module:engine/view/item~Item} viewItem Item to convert.
  14128. * @param {module:engine/model/position~Position} modelCursor The conversion position.
  14129. * @returns {Object} result The conversion result.
  14130. * @returns {module:engine/model/range~Range|null} result.modelRange The model range containing the result of the item conversion,
  14131. * created and modified by callbacks attached to the fired event, or `null` if the conversion result was incorrect.
  14132. * @returns {module:engine/model/position~Position} result.modelCursor The position where the conversion should be continued.
  14133. */
  14134. /**
  14135. * Starts the conversion of all children of a given item by firing appropriate events for all the children.
  14136. *
  14137. * @method #convertChildren
  14138. * @fires module:engine/conversion/upcastdispatcher~UpcastDispatcher#event:element
  14139. * @fires module:engine/conversion/upcastdispatcher~UpcastDispatcher#event:text
  14140. * @fires module:engine/conversion/upcastdispatcher~UpcastDispatcher#event:documentFragment
  14141. * @param {module:engine/view/item~Item} viewItem An element whose children should be converted.
  14142. * @param {module:engine/model/position~Position|module:engine/model/element~Element} positionOrElement A position or an element of
  14143. * the conversion.
  14144. * @returns {Object} result The conversion result.
  14145. * @returns {module:engine/model/range~Range} result.modelRange The model range containing the results of the conversion of all children
  14146. * of the given item. When no child was converted, the range is collapsed.
  14147. * @returns {module:engine/model/position~Position} result.modelCursor The position where the conversion should be continued.
  14148. */
  14149. /**
  14150. * Safely inserts an element to the document, checking the {@link module:engine/model/schema~Schema schema} to find an allowed parent for
  14151. * an element that you are going to insert, starting from the given position. If the current parent does not allow to insert the element
  14152. * but one of the ancestors does, then splits the nodes to allowed parent.
  14153. *
  14154. * If the schema allows to insert the node in a given position, nothing is split.
  14155. *
  14156. * If it was not possible to find an allowed parent, `false` is returned and nothing is split.
  14157. *
  14158. * Otherwise, ancestors are split.
  14159. *
  14160. * For instance, if `<image>` is not allowed in `<paragraph>` but is allowed in `$root`:
  14161. *
  14162. * <paragraph>foo[]bar</paragraph>
  14163. *
  14164. * -> safe insert for `<image>` will split ->
  14165. *
  14166. * <paragraph>foo</paragraph>[]<paragraph>bar</paragraph>
  14167. *
  14168. * Example usage:
  14169. *
  14170. * const myElement = conversionApi.writer.createElement( 'myElement' );
  14171. *
  14172. * if ( !conversionApi.safeInsert( myElement, data.modelCursor ) ) {
  14173. * return;
  14174. * }
  14175. *
  14176. * The split result is saved and {@link #updateConversionResult} should be used to update the
  14177. * {@link module:engine/conversion/upcastdispatcher~UpcastConversionData conversion data}.
  14178. *
  14179. * @method #safeInsert
  14180. * @param {module:engine/model/node~Node} node The node to insert.
  14181. * @param {module:engine/model/position~Position} position The position where an element is going to be inserted.
  14182. * @returns {Boolean} The split result. If it was not possible to find an allowed position, `false` is returned.
  14183. */
  14184. /**
  14185. * Updates the conversion result and sets a proper {@link module:engine/conversion/upcastdispatcher~UpcastConversionData#modelRange} and
  14186. * the next {@link module:engine/conversion/upcastdispatcher~UpcastConversionData#modelCursor} after the conversion.
  14187. * Used together with {@link #safeInsert}, it enables you to easily convert elements without worrying if the node was split
  14188. * during the conversion of its children.
  14189. *
  14190. * A usage example in converter code:
  14191. *
  14192. * const myElement = conversionApi.writer.createElement( 'myElement' );
  14193. *
  14194. * if ( !conversionApi.safeInsert( myElement, data.modelCursor ) ) {
  14195. * return;
  14196. * }
  14197. *
  14198. * // Children conversion may split `myElement`.
  14199. * conversionApi.convertChildren( data.viewItem, myElement );
  14200. *
  14201. * conversionApi.updateConversionResult( myElement, data );
  14202. *
  14203. * @method #updateConversionResult
  14204. * @param {module:engine/model/element~Element} element
  14205. * @param {module:engine/conversion/upcastdispatcher~UpcastConversionData} data Conversion data.
  14206. * @param {module:engine/conversion/upcastdispatcher~UpcastConversionApi} conversionApi Conversion utilities to be used by the callback.
  14207. */
  14208. /**
  14209. * Checks the {@link module:engine/model/schema~Schema schema} to find an allowed parent for an element that is going to be inserted
  14210. * starting from the given position. If the current parent does not allow inserting an element but one of the ancestors does, the method
  14211. * splits nodes to allowed parent.
  14212. *
  14213. * If the schema allows inserting the node in the given position, nothing is split and an object with that position is returned.
  14214. *
  14215. * If it was not possible to find an allowed parent, `null` is returned and nothing is split.
  14216. *
  14217. * Otherwise, ancestors are split and an object with a position and the copy of the split element is returned.
  14218. *
  14219. * For instance, if `<image>` is not allowed in `<paragraph>` but is allowed in `$root`:
  14220. *
  14221. * <paragraph>foo[]bar</paragraph>
  14222. *
  14223. * -> split for `<image>` ->
  14224. *
  14225. * <paragraph>foo</paragraph>[]<paragraph>bar</paragraph>
  14226. *
  14227. * In the example above, the position between `<paragraph>` elements will be returned as `position` and the second `paragraph`
  14228. * as `cursorParent`.
  14229. *
  14230. * **Note:** This is an advanced method. For most cases {@link #safeInsert} and {@link #updateConversionResult} should be used.
  14231. *
  14232. * @method #splitToAllowedParent
  14233. * @param {module:engine/model/position~Position} position The position where the element is going to be inserted.
  14234. * @param {module:engine/model/node~Node} node The node to insert.
  14235. * @returns {Object|null} The split result. If it was not possible to find an allowed position, `null` is returned.
  14236. * @returns {module:engine/model/position~Position} The position between split elements.
  14237. * @returns {module:engine/model/element~Element} [cursorParent] The element inside which the cursor should be placed to
  14238. * continue the conversion. When the element is not defined it means that there was no split.
  14239. */
  14240. /**
  14241. * Returns all the split parts of the given `element` that were created during upcasting through using {@link #splitToAllowedParent}.
  14242. * It enables you to easily track these elements and continue processing them after they are split during the conversion of their children.
  14243. *
  14244. * <paragraph>Foo<image />bar<image />baz</paragraph> ->
  14245. * <paragraph>Foo</paragraph><image /><paragraph>bar</paragraph><image /><paragraph>baz</paragraph>
  14246. *
  14247. * For a reference to any of above paragraphs, the function will return all three paragraphs (the original element included),
  14248. * sorted in the order of their creation (the original element is the first one).
  14249. *
  14250. * If the given `element` was not split, an array with a single element is returned.
  14251. *
  14252. * A usage example in the converter code:
  14253. *
  14254. * const myElement = conversionApi.writer.createElement( 'myElement' );
  14255. *
  14256. * // Children conversion may split `myElement`.
  14257. * conversionApi.convertChildren( data.viewItem, data.modelCursor );
  14258. *
  14259. * const splitParts = conversionApi.getSplitParts( myElement );
  14260. * const lastSplitPart = splitParts[ splitParts.length - 1 ];
  14261. *
  14262. * // Setting `data.modelRange` basing on split parts:
  14263. * data.modelRange = conversionApi.writer.createRange(
  14264. * conversionApi.writer.createPositionBefore( myElement ),
  14265. * conversionApi.writer.createPositionAfter( lastSplitPart )
  14266. * );
  14267. *
  14268. * // Setting `data.modelCursor` to continue after the last split element:
  14269. * data.modelCursor = conversionApi.writer.createPositionAfter( lastSplitPart );
  14270. *
  14271. * **Tip:** If you are unable to get a reference to the original element (for example because the code is split into multiple converters
  14272. * or even classes) but it has already been converted, you may want to check the first element in `data.modelRange`. This is a common
  14273. * situation if an attribute converter is separated from an element converter.
  14274. *
  14275. * **Note:** This is an advanced method. For most cases {@link #safeInsert} and {@link #updateConversionResult} should be used.
  14276. *
  14277. * @method #getSplitParts
  14278. * @param {module:engine/model/element~Element} element
  14279. * @returns {Array.<module:engine/model/element~Element>}
  14280. */
  14281. /**
  14282. * Stores information about what parts of the processed view item are still waiting to be handled. After a piece of view item
  14283. * was converted, an appropriate consumable value should be
  14284. * {@link module:engine/conversion/viewconsumable~ViewConsumable#consume consumed}.
  14285. *
  14286. * @member {module:engine/conversion/viewconsumable~ViewConsumable} #consumable
  14287. */
  14288. /**
  14289. * Custom data stored by converters for the conversion process. Custom properties of this object can be defined and use to
  14290. * pass parameters between converters.
  14291. *
  14292. * The difference between this property and the `data` parameter of
  14293. * {@link module:engine/conversion/upcastdispatcher~UpcastDispatcher#event:element} is that the `data` parameters allow you
  14294. * to pass parameters within a single event and `store` within the whole conversion.
  14295. *
  14296. * @member {Object} #store
  14297. */
  14298. /**
  14299. * The model's schema instance.
  14300. *
  14301. * @member {module:engine/model/schema~Schema} #schema
  14302. */
  14303. /**
  14304. * The {@link module:engine/model/writer~Writer} instance used to manipulate the data during conversion.
  14305. *
  14306. * @member {module:engine/model/writer~Writer} #writer
  14307. */
  14308. /**
  14309. * Conversion data.
  14310. *
  14311. * **Note:** Keep in mind that this object is shared by reference between all conversion callbacks that will be called.
  14312. * This means that callbacks can override values if needed, and these values will be available in other callbacks.
  14313. *
  14314. * @typedef {Object} module:engine/conversion/upcastdispatcher~UpcastConversionData
  14315. *
  14316. * @property {module:engine/view/item~Item} viewItem The converted item.
  14317. * @property {module:engine/model/position~Position} modelCursor The position where the converter should start changes.
  14318. * Change this value for the next converter to tell where the conversion should continue.
  14319. * @property {module:engine/model/range~Range} [modelRange] The current state of conversion result. Every change to
  14320. * the converted element should be reflected by setting or modifying this property.
  14321. */
  14322. /***/ }),
  14323. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/conversion/upcasthelpers.js":
  14324. /*!*********************************************************************************!*\
  14325. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/conversion/upcasthelpers.js ***!
  14326. \*********************************************************************************/
  14327. /*! exports provided: default, convertToModelFragment, convertText, convertSelectionChange */
  14328. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  14329. "use strict";
  14330. __webpack_require__.r(__webpack_exports__);
  14331. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return UpcastHelpers; });
  14332. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "convertToModelFragment", function() { return convertToModelFragment; });
  14333. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "convertText", function() { return convertText; });
  14334. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "convertSelectionChange", function() { return convertSelectionChange; });
  14335. /* harmony import */ var _view_matcher__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../view/matcher */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/matcher.js");
  14336. /* harmony import */ var _conversionhelpers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./conversionhelpers */ "./node_modules/@ckeditor/ckeditor5-engine/src/conversion/conversionhelpers.js");
  14337. /* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lodash-es */ "./node_modules/lodash-es/lodash.js");
  14338. /* 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");
  14339. /* 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");
  14340. /* 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");
  14341. /**
  14342. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  14343. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  14344. */
  14345. /**
  14346. * Contains {@link module:engine/view/view view} to {@link module:engine/model/model model} converters for
  14347. * {@link module:engine/conversion/upcastdispatcher~UpcastDispatcher}.
  14348. *
  14349. * @module engine/conversion/upcasthelpers
  14350. */
  14351. /**
  14352. * Upcast conversion helper functions.
  14353. *
  14354. * @extends module:engine/conversion/conversionhelpers~ConversionHelpers
  14355. */
  14356. class UpcastHelpers extends _conversionhelpers__WEBPACK_IMPORTED_MODULE_1__["default"] {
  14357. /**
  14358. * View element to model element conversion helper.
  14359. *
  14360. * This conversion results in creating a model element. For example,
  14361. * view `<p>Foo</p>` becomes `<paragraph>Foo</paragraph>` in the model.
  14362. *
  14363. * Keep in mind that the element will be inserted only if it is allowed
  14364. * by {@link module:engine/model/schema~Schema schema} configuration.
  14365. *
  14366. * editor.conversion.for( 'upcast' ).elementToElement( {
  14367. * view: 'p',
  14368. * model: 'paragraph'
  14369. * } );
  14370. *
  14371. * editor.conversion.for( 'upcast' ).elementToElement( {
  14372. * view: 'p',
  14373. * model: 'paragraph',
  14374. * converterPriority: 'high'
  14375. * } );
  14376. *
  14377. * editor.conversion.for( 'upcast' ).elementToElement( {
  14378. * view: {
  14379. * name: 'p',
  14380. * classes: 'fancy'
  14381. * },
  14382. * model: 'fancyParagraph'
  14383. * } );
  14384. *
  14385. * editor.conversion.for( 'upcast' ).elementToElement( {
  14386. * view: {
  14387. * name: 'p',
  14388. * classes: 'heading'
  14389. * },
  14390. * model: ( viewElement, conversionApi ) => {
  14391. * const modelWriter = conversionApi.writer;
  14392. *
  14393. * return modelWriter.createElement( 'heading', { level: viewElement.getAttribute( 'data-level' ) } );
  14394. * }
  14395. * } );
  14396. *
  14397. * See {@link module:engine/conversion/conversion~Conversion#for `conversion.for()`} to learn how to add a converter
  14398. * to the conversion process.
  14399. *
  14400. * @method #elementToElement
  14401. * @param {Object} config Conversion configuration.
  14402. * @param {module:engine/view/matcher~MatcherPattern} [config.view] Pattern matching all view elements which should be converted. If not
  14403. * set, the converter will fire for every view element.
  14404. * @param {String|module:engine/model/element~Element|Function} config.model Name of the model element, a model element instance or a
  14405. * function that takes a view element and {@link module:engine/conversion/upcastdispatcher~UpcastConversionApi upcast conversion API}
  14406. * and returns a model element. The model element will be inserted in the model.
  14407. * @param {module:utils/priorities~PriorityString} [config.converterPriority='normal'] Converter priority.
  14408. * @returns {module:engine/conversion/upcasthelpers~UpcastHelpers}
  14409. */
  14410. elementToElement( config ) {
  14411. return this.add( upcastElementToElement( config ) );
  14412. }
  14413. /**
  14414. * View element to model attribute conversion helper.
  14415. *
  14416. * This conversion results in setting an attribute on a model node. For example, view `<strong>Foo</strong>` becomes
  14417. * `Foo` {@link module:engine/model/text~Text model text node} with `bold` attribute set to `true`.
  14418. *
  14419. * This helper is meant to set a model attribute on all the elements that are inside the converted element:
  14420. *
  14421. * <strong>Foo</strong> --> <strong><p>Foo</p></strong> --> <paragraph><$text bold="true">Foo</$text></paragraph>
  14422. *
  14423. * Above is a sample of HTML code, that goes through autoparagraphing (first step) and then is converted (second step).
  14424. * Even though `<strong>` is over `<p>` element, `bold="true"` was added to the text. See
  14425. * {@link module:engine/conversion/upcasthelpers~UpcastHelpers#attributeToAttribute} for comparison.
  14426. *
  14427. * Keep in mind that the attribute will be set only if it is allowed by {@link module:engine/model/schema~Schema schema} configuration.
  14428. *
  14429. * editor.conversion.for( 'upcast' ).elementToAttribute( {
  14430. * view: 'strong',
  14431. * model: 'bold'
  14432. * } );
  14433. *
  14434. * editor.conversion.for( 'upcast' ).elementToAttribute( {
  14435. * view: 'strong',
  14436. * model: 'bold',
  14437. * converterPriority: 'high'
  14438. * } );
  14439. *
  14440. * editor.conversion.for( 'upcast' ).elementToAttribute( {
  14441. * view: {
  14442. * name: 'span',
  14443. * classes: 'bold'
  14444. * },
  14445. * model: 'bold'
  14446. * } );
  14447. *
  14448. * editor.conversion.for( 'upcast' ).elementToAttribute( {
  14449. * view: {
  14450. * name: 'span',
  14451. * classes: [ 'styled', 'styled-dark' ]
  14452. * },
  14453. * model: {
  14454. * key: 'styled',
  14455. * value: 'dark'
  14456. * }
  14457. * } );
  14458. *
  14459. * editor.conversion.for( 'upcast' ).elementToAttribute( {
  14460. * view: {
  14461. * name: 'span',
  14462. * styles: {
  14463. * 'font-size': /[\s\S]+/
  14464. * }
  14465. * },
  14466. * model: {
  14467. * key: 'fontSize',
  14468. * value: ( viewElement, conversionApi ) => {
  14469. * const fontSize = viewElement.getStyle( 'font-size' );
  14470. * const value = fontSize.substr( 0, fontSize.length - 2 );
  14471. *
  14472. * if ( value <= 10 ) {
  14473. * return 'small';
  14474. * } else if ( value > 12 ) {
  14475. * return 'big';
  14476. * }
  14477. *
  14478. * return null;
  14479. * }
  14480. * }
  14481. * } );
  14482. *
  14483. * See {@link module:engine/conversion/conversion~Conversion#for `conversion.for()`} to learn how to add a converter
  14484. * to the conversion process.
  14485. *
  14486. * @method #elementToAttribute
  14487. * @param {Object} config Conversion configuration.
  14488. * @param {module:engine/view/matcher~MatcherPattern} config.view Pattern matching all view elements which should be converted.
  14489. * @param {String|Object} config.model Model attribute key or an object with `key` and `value` properties, describing
  14490. * the model attribute. `value` property may be set as a function that takes a view element and
  14491. * {@link module:engine/conversion/upcastdispatcher~UpcastConversionApi upcast conversion API} and returns the value.
  14492. * If `String` is given, the model attribute value will be set to `true`.
  14493. * @param {module:utils/priorities~PriorityString} [config.converterPriority='low'] Converter priority.
  14494. * @returns {module:engine/conversion/upcasthelpers~UpcastHelpers}
  14495. */
  14496. elementToAttribute( config ) {
  14497. return this.add( upcastElementToAttribute( config ) );
  14498. }
  14499. /**
  14500. * View attribute to model attribute conversion helper.
  14501. *
  14502. * This conversion results in setting an attribute on a model node. For example, view `<img src="foo.jpg"></img>` becomes
  14503. * `<image source="foo.jpg"></image>` in the model.
  14504. *
  14505. * This helper is meant to convert view attributes from view elements which got converted to the model, so the view attribute
  14506. * is set only on the corresponding model node:
  14507. *
  14508. * <div class="dark"><div>foo</div></div> --> <div dark="true"><div>foo</div></div>
  14509. *
  14510. * Above, `class="dark"` attribute is added only to the `<div>` elements that has it. This is in contrary to
  14511. * {@link module:engine/conversion/upcasthelpers~UpcastHelpers#elementToAttribute} which sets attributes for
  14512. * all the children in the model:
  14513. *
  14514. * <strong>Foo</strong> --> <strong><p>Foo</p></strong> --> <paragraph><$text bold="true">Foo</$text></paragraph>
  14515. *
  14516. * Above is a sample of HTML code, that goes through autoparagraphing (first step) and then is converted (second step).
  14517. * Even though `<strong>` is over `<p>` element, `bold="true"` was added to the text.
  14518. *
  14519. * Keep in mind that the attribute will be set only if it is allowed by {@link module:engine/model/schema~Schema schema} configuration.
  14520. *
  14521. * editor.conversion.for( 'upcast' ).attributeToAttribute( {
  14522. * view: 'src',
  14523. * model: 'source'
  14524. * } );
  14525. *
  14526. * editor.conversion.for( 'upcast' ).attributeToAttribute( {
  14527. * view: { key: 'src' },
  14528. * model: 'source'
  14529. * } );
  14530. *
  14531. * editor.conversion.for( 'upcast' ).attributeToAttribute( {
  14532. * view: { key: 'src' },
  14533. * model: 'source',
  14534. * converterPriority: 'normal'
  14535. * } );
  14536. *
  14537. * editor.conversion.for( 'upcast' ).attributeToAttribute( {
  14538. * view: {
  14539. * key: 'data-style',
  14540. * value: /[\s\S]+/
  14541. * },
  14542. * model: 'styled'
  14543. * } );
  14544. *
  14545. * editor.conversion.for( 'upcast' ).attributeToAttribute( {
  14546. * view: {
  14547. * name: 'img',
  14548. * key: 'class',
  14549. * value: 'styled-dark'
  14550. * },
  14551. * model: {
  14552. * key: 'styled',
  14553. * value: 'dark'
  14554. * }
  14555. * } );
  14556. *
  14557. * editor.conversion.for( 'upcast' ).attributeToAttribute( {
  14558. * view: {
  14559. * key: 'class',
  14560. * value: /styled-[\S]+/
  14561. * },
  14562. * model: {
  14563. * key: 'styled'
  14564. * value: ( viewElement, conversionApi ) => {
  14565. * const regexp = /styled-([\S]+)/;
  14566. * const match = viewElement.getAttribute( 'class' ).match( regexp );
  14567. *
  14568. * return match[ 1 ];
  14569. * }
  14570. * }
  14571. * } );
  14572. *
  14573. * Converting styles works a bit differently as it requires `view.styles` to be an object and by default
  14574. * 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`
  14575. * callback that returns the desired value.
  14576. *
  14577. * // Default conversion of font-weight style will result in setting bold attribute to true.
  14578. * editor.conversion.for( 'upcast' ).attributeToAttribute( {
  14579. * view: {
  14580. * styles: {
  14581. * 'font-weight': 'bold'
  14582. * }
  14583. * },
  14584. * model: 'bold'
  14585. * } );
  14586. *
  14587. * // This converter will pass any style value to the `lineHeight` model attribute.
  14588. * editor.conversion.for( 'upcast' ).attributeToAttribute( {
  14589. * view: {
  14590. * styles: {
  14591. * 'line-height': /[\s\S]+/
  14592. * }
  14593. * },
  14594. * model: {
  14595. * key: 'lineHeight',
  14596. * value: ( viewElement, conversionApi ) => viewElement.getStyle( 'line-height' )
  14597. * }
  14598. * } );
  14599. *
  14600. * See {@link module:engine/conversion/conversion~Conversion#for `conversion.for()`} to learn how to add a converter
  14601. * to the conversion process.
  14602. *
  14603. * @method #attributeToAttribute
  14604. * @param {Object} config Conversion configuration.
  14605. * @param {String|Object} config.view Specifies which view attribute will be converted. If a `String` is passed,
  14606. * attributes with given key will be converted. If an `Object` is passed, it must have a required `key` property,
  14607. * specifying view attribute key, and may have an optional `value` property, specifying view attribute value and optional `name`
  14608. * property specifying a view element name from/on which the attribute should be converted. `value` can be given as a `String`,
  14609. * a `RegExp` or a function callback, that takes view attribute value as the only parameter and returns `Boolean`.
  14610. * @param {String|Object} config.model Model attribute key or an object with `key` and `value` properties, describing
  14611. * the model attribute. `value` property may be set as a function that takes a view element and
  14612. * {@link module:engine/conversion/upcastdispatcher~UpcastConversionApi upcast conversion API} and returns the value.
  14613. * If `String` is given, the model attribute value will be same as view attribute value.
  14614. * @param {module:utils/priorities~PriorityString} [config.converterPriority='low'] Converter priority.
  14615. * @returns {module:engine/conversion/upcasthelpers~UpcastHelpers}
  14616. */
  14617. attributeToAttribute( config ) {
  14618. return this.add( upcastAttributeToAttribute( config ) );
  14619. }
  14620. /**
  14621. * View element to model marker conversion helper.
  14622. *
  14623. * **Note**: This method was deprecated. Please use {@link #dataToMarker} instead.
  14624. *
  14625. * This conversion results in creating a model marker. For example, if the marker was stored in a view as an element:
  14626. * `<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>`,
  14627. * after the conversion is done, the marker will be available in
  14628. * {@link module:engine/model/model~Model#markers model document markers}.
  14629. *
  14630. * editor.conversion.for( 'upcast' ).elementToMarker( {
  14631. * view: 'marker-search',
  14632. * model: 'search'
  14633. * } );
  14634. *
  14635. * editor.conversion.for( 'upcast' ).elementToMarker( {
  14636. * view: 'marker-search',
  14637. * model: 'search',
  14638. * converterPriority: 'high'
  14639. * } );
  14640. *
  14641. * editor.conversion.for( 'upcast' ).elementToMarker( {
  14642. * view: 'marker-search',
  14643. * model: ( viewElement, conversionApi ) => 'comment:' + viewElement.getAttribute( 'data-comment-id' )
  14644. * } );
  14645. *
  14646. * editor.conversion.for( 'upcast' ).elementToMarker( {
  14647. * view: {
  14648. * name: 'span',
  14649. * attributes: {
  14650. * 'data-marker': 'search'
  14651. * }
  14652. * },
  14653. * model: 'search'
  14654. * } );
  14655. *
  14656. * See {@link module:engine/conversion/conversion~Conversion#for `conversion.for()`} to learn how to add a converter
  14657. * to the conversion process.
  14658. *
  14659. * @deprecated
  14660. * @method #elementToMarker
  14661. * @param {Object} config Conversion configuration.
  14662. * @param {module:engine/view/matcher~MatcherPattern} config.view Pattern matching all view elements which should be converted.
  14663. * @param {String|Function} config.model Name of the model marker, or a function that takes a view element and returns
  14664. * a model marker name.
  14665. * @param {module:utils/priorities~PriorityString} [config.converterPriority='normal'] Converter priority.
  14666. * @returns {module:engine/conversion/upcasthelpers~UpcastHelpers}
  14667. */
  14668. elementToMarker( config ) {
  14669. /**
  14670. * The {@link module:engine/conversion/upcasthelpers~UpcastHelpers#elementToMarker `UpcastHelpers#elementToMarker()`}
  14671. * method was deprecated and will be removed in the near future.
  14672. * Please use {@link module:engine/conversion/upcasthelpers~UpcastHelpers#dataToMarker `UpcastHelpers#dataToMarker()`} instead.
  14673. *
  14674. * @error upcast-helpers-element-to-marker-deprecated
  14675. */
  14676. Object(_ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_3__["logWarning"])( 'upcast-helpers-element-to-marker-deprecated' );
  14677. return this.add( upcastElementToMarker( config ) );
  14678. }
  14679. /**
  14680. * View-to-model marker conversion helper.
  14681. *
  14682. * Converts view data created by {@link module:engine/conversion/downcasthelpers~DowncastHelpers#markerToData `#markerToData()`}
  14683. * back to a model marker.
  14684. *
  14685. * This converter looks for specific view elements and view attributes that mark marker boundaries. See
  14686. * {@link module:engine/conversion/downcasthelpers~DowncastHelpers#markerToData `#markerToData()`} to learn what view data
  14687. * is expected by this converter.
  14688. *
  14689. * The `config.view` property is equal to the marker group name to convert.
  14690. *
  14691. * By default, this converter creates markers with the `group:name` name convention (to match the default `markerToData` conversion).
  14692. *
  14693. * The conversion configuration can take a function that will generate a marker name.
  14694. * 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
  14695. * expected to return a string with the marker name.
  14696. *
  14697. * Basic usage:
  14698. *
  14699. * // Using the default conversion.
  14700. * // In this case, all markers from the `comment` group will be converted.
  14701. * // The conversion will look for `<comment-start>` and `<comment-end>` tags and
  14702. * // `data-comment-start-before`, `data-comment-start-after`,
  14703. * // `data-comment-end-before` and `data-comment-end-after` attributes.
  14704. * editor.conversion.for( 'upcast' ).dataToMarker( {
  14705. * view: 'comment'
  14706. * } );
  14707. *
  14708. * An example of a model that may be generated by this conversion:
  14709. *
  14710. * // View:
  14711. * <p>Foo<comment-start name="commentId:uid"></comment-start>bar</p>
  14712. * <figure data-comment-end-after="commentId:uid" class="image"><img src="abc.jpg" /></figure>
  14713. *
  14714. * // Model:
  14715. * <paragraph>Foo[bar</paragraph>
  14716. * <image src="abc.jpg"></image>]
  14717. *
  14718. * Where `[]` are boundaries of a marker that will receive the `comment:commentId:uid` name.
  14719. *
  14720. * Other examples of usage:
  14721. *
  14722. * // Using a custom function which is the same as the default conversion:
  14723. * editor.conversion.for( 'upcast' ).dataToMarker( {
  14724. * view: 'comment',
  14725. * model: ( name, conversionApi ) => 'comment:' + name,
  14726. * } );
  14727. *
  14728. * // Using the converter priority:
  14729. * editor.conversion.for( 'upcast' ).dataToMarker( {
  14730. * view: 'comment',
  14731. * model: ( name, conversionApi ) => 'comment:' + name,
  14732. * converterPriority: 'high'
  14733. * } );
  14734. *
  14735. * See {@link module:engine/conversion/conversion~Conversion#for `conversion.for()`} to learn how to add a converter
  14736. * to the conversion process.
  14737. *
  14738. * @method #dataToMarker
  14739. * @param {Object} config Conversion configuration.
  14740. * @param {String} config.view The marker group name to convert.
  14741. * @param {Function} [config.model] A function that takes the `name` part from the view element or attribute and
  14742. * {@link module:engine/conversion/upcastdispatcher~UpcastConversionApi upcast conversion API} and returns the marker name.
  14743. * @param {module:utils/priorities~PriorityString} [config.converterPriority='normal'] Converter priority.
  14744. * @returns {module:engine/conversion/upcasthelpers~UpcastHelpers}
  14745. */
  14746. dataToMarker( config ) {
  14747. return this.add( upcastDataToMarker( config ) );
  14748. }
  14749. }
  14750. /**
  14751. * Function factory, creates a converter that converts {@link module:engine/view/documentfragment~DocumentFragment view document fragment}
  14752. * or all children of {@link module:engine/view/element~Element} into
  14753. * {@link module:engine/model/documentfragment~DocumentFragment model document fragment}.
  14754. * This is the "entry-point" converter for upcast (view to model conversion). This converter starts the conversion of all children
  14755. * of passed view document fragment. Those children {@link module:engine/view/node~Node view nodes} are then handled by other converters.
  14756. *
  14757. * This also a "default", last resort converter for all view elements that has not been converted by other converters.
  14758. * When a view element is being converted to the model but it does not have converter specified, that view element
  14759. * will be converted to {@link module:engine/model/documentfragment~DocumentFragment model document fragment} and returned.
  14760. *
  14761. * @returns {Function} Universal converter for view {@link module:engine/view/documentfragment~DocumentFragment fragments} and
  14762. * {@link module:engine/view/element~Element elements} that returns
  14763. * {@link module:engine/model/documentfragment~DocumentFragment model fragment} with children of converted view item.
  14764. */
  14765. function convertToModelFragment() {
  14766. return ( evt, data, conversionApi ) => {
  14767. // Second argument in `consumable.consume` is discarded for ViewDocumentFragment but is needed for ViewElement.
  14768. if ( !data.modelRange && conversionApi.consumable.consume( data.viewItem, { name: true } ) ) {
  14769. const { modelRange, modelCursor } = conversionApi.convertChildren( data.viewItem, data.modelCursor );
  14770. data.modelRange = modelRange;
  14771. data.modelCursor = modelCursor;
  14772. }
  14773. };
  14774. }
  14775. /**
  14776. * Function factory, creates a converter that converts {@link module:engine/view/text~Text} to {@link module:engine/model/text~Text}.
  14777. *
  14778. * @returns {Function} {@link module:engine/view/text~Text View text} converter.
  14779. */
  14780. function convertText() {
  14781. return ( evt, data, { schema, consumable, writer } ) => {
  14782. let position = data.modelCursor;
  14783. // When node is already converted then do nothing.
  14784. if ( !consumable.test( data.viewItem ) ) {
  14785. return;
  14786. }
  14787. if ( !schema.checkChild( position, '$text' ) ) {
  14788. if ( !Object(_model_utils_autoparagraphing__WEBPACK_IMPORTED_MODULE_5__["isParagraphable"])( position, '$text', schema ) ) {
  14789. return;
  14790. }
  14791. position = Object(_model_utils_autoparagraphing__WEBPACK_IMPORTED_MODULE_5__["wrapInParagraph"])( position, writer );
  14792. }
  14793. consumable.consume( data.viewItem );
  14794. const text = writer.createText( data.viewItem.data );
  14795. writer.insert( text, position );
  14796. data.modelRange = writer.createRange(
  14797. position,
  14798. position.getShiftedBy( text.offsetSize )
  14799. );
  14800. data.modelCursor = data.modelRange.end;
  14801. };
  14802. }
  14803. /**
  14804. * Function factory, creates a callback function which converts a {@link module:engine/view/selection~Selection
  14805. * view selection} taken from the {@link module:engine/view/document~Document#event:selectionChange} event
  14806. * and sets in on the {@link module:engine/model/document~Document#selection model}.
  14807. *
  14808. * **Note**: because there is no view selection change dispatcher nor any other advanced view selection to model
  14809. * conversion mechanism, the callback should be set directly on view document.
  14810. *
  14811. * view.document.on( 'selectionChange', convertSelectionChange( modelDocument, mapper ) );
  14812. *
  14813. * @param {module:engine/model/model~Model} model Data model.
  14814. * @param {module:engine/conversion/mapper~Mapper} mapper Conversion mapper.
  14815. * @returns {Function} {@link module:engine/view/document~Document#event:selectionChange} callback function.
  14816. */
  14817. function convertSelectionChange( model, mapper ) {
  14818. return ( evt, data ) => {
  14819. const viewSelection = data.newSelection;
  14820. const ranges = [];
  14821. for ( const viewRange of viewSelection.getRanges() ) {
  14822. ranges.push( mapper.toModelRange( viewRange ) );
  14823. }
  14824. const modelSelection = model.createSelection( ranges, { backward: viewSelection.isBackward } );
  14825. if ( !modelSelection.isEqual( model.document.selection ) ) {
  14826. model.change( writer => {
  14827. writer.setSelection( modelSelection );
  14828. } );
  14829. }
  14830. };
  14831. }
  14832. // View element to model element conversion helper.
  14833. //
  14834. // See {@link ~UpcastHelpers#elementToElement `.elementToElement()` upcast helper} for examples.
  14835. //
  14836. // @param {Object} config Conversion configuration.
  14837. // @param {module:engine/view/matcher~MatcherPattern} [config.view] Pattern matching all view elements which should be converted. If not
  14838. // set, the converter will fire for every view element.
  14839. // @param {String|module:engine/model/element~Element|Function} config.model Name of the model element, a model element
  14840. // instance or a function that takes a view element and returns a model element. The model element will be inserted in the model.
  14841. // @param {module:utils/priorities~PriorityString} [config.converterPriority='normal'] Converter priority.
  14842. // @returns {Function} Conversion helper.
  14843. function upcastElementToElement( config ) {
  14844. config = Object(lodash_es__WEBPACK_IMPORTED_MODULE_2__["cloneDeep"])( config );
  14845. const converter = prepareToElementConverter( config );
  14846. const elementName = getViewElementNameFromConfig( config.view );
  14847. const eventName = elementName ? 'element:' + elementName : 'element';
  14848. return dispatcher => {
  14849. dispatcher.on( eventName, converter, { priority: config.converterPriority || 'normal' } );
  14850. };
  14851. }
  14852. // View element to model attribute conversion helper.
  14853. //
  14854. // See {@link ~UpcastHelpers#elementToAttribute `.elementToAttribute()` upcast helper} for examples.
  14855. //
  14856. // @param {Object} config Conversion configuration.
  14857. // @param {module:engine/view/matcher~MatcherPattern} config.view Pattern matching all view elements which should be converted.
  14858. // @param {String|Object} config.model Model attribute key or an object with `key` and `value` properties, describing
  14859. // the model attribute. `value` property may be set as a function that takes a view element and returns the value.
  14860. // If `String` is given, the model attribute value will be set to `true`.
  14861. // @param {module:utils/priorities~PriorityString} [config.converterPriority='low'] Converter priority.
  14862. // @returns {Function} Conversion helper.
  14863. function upcastElementToAttribute( config ) {
  14864. config = Object(lodash_es__WEBPACK_IMPORTED_MODULE_2__["cloneDeep"])( config );
  14865. normalizeModelAttributeConfig( config );
  14866. const converter = prepareToAttributeConverter( config, false );
  14867. const elementName = getViewElementNameFromConfig( config.view );
  14868. const eventName = elementName ? 'element:' + elementName : 'element';
  14869. return dispatcher => {
  14870. dispatcher.on( eventName, converter, { priority: config.converterPriority || 'low' } );
  14871. };
  14872. }
  14873. // View attribute to model attribute conversion helper.
  14874. //
  14875. // See {@link ~UpcastHelpers#attributeToAttribute `.attributeToAttribute()` upcast helper} for examples.
  14876. //
  14877. // @param {Object} config Conversion configuration.
  14878. // @param {String|Object} config.view Specifies which view attribute will be converted. If a `String` is passed,
  14879. // attributes with given key will be converted. If an `Object` is passed, it must have a required `key` property,
  14880. // specifying view attribute key, and may have an optional `value` property, specifying view attribute value and optional `name`
  14881. // property specifying a view element name from/on which the attribute should be converted. `value` can be given as a `String`,
  14882. // a `RegExp` or a function callback, that takes view attribute value as the only parameter and returns `Boolean`.
  14883. // @param {String|Object} config.model Model attribute key or an object with `key` and `value` properties, describing
  14884. // the model attribute. `value` property may be set as a function that takes a view element and returns the value.
  14885. // If `String` is given, the model attribute value will be same as view attribute value.
  14886. // @param {module:utils/priorities~PriorityString} [config.converterPriority='low'] Converter priority.
  14887. // @returns {Function} Conversion helper.
  14888. function upcastAttributeToAttribute( config ) {
  14889. config = Object(lodash_es__WEBPACK_IMPORTED_MODULE_2__["cloneDeep"])( config );
  14890. let viewKey = null;
  14891. if ( typeof config.view == 'string' || config.view.key ) {
  14892. viewKey = normalizeViewAttributeKeyValueConfig( config );
  14893. }
  14894. normalizeModelAttributeConfig( config, viewKey );
  14895. const converter = prepareToAttributeConverter( config, true );
  14896. return dispatcher => {
  14897. dispatcher.on( 'element', converter, { priority: config.converterPriority || 'low' } );
  14898. };
  14899. }
  14900. // View element to model marker conversion helper.
  14901. //
  14902. // See {@link ~UpcastHelpers#elementToMarker `.elementToMarker()` upcast helper} for examples.
  14903. //
  14904. // @param {Object} config Conversion configuration.
  14905. // @param {module:engine/view/matcher~MatcherPattern} config.view Pattern matching all view elements which should be converted.
  14906. // @param {String|Function} config.model Name of the model marker, or a function that takes a view element and returns
  14907. // a model marker name.
  14908. // @param {module:utils/priorities~PriorityString} [config.converterPriority='normal'] Converter priority.
  14909. // @returns {Function} Conversion helper.
  14910. function upcastElementToMarker( config ) {
  14911. config = Object(lodash_es__WEBPACK_IMPORTED_MODULE_2__["cloneDeep"])( config );
  14912. normalizeElementToMarkerConfig( config );
  14913. return upcastElementToElement( config );
  14914. }
  14915. // View data to model marker conversion helper.
  14916. //
  14917. // See {@link ~UpcastHelpers#dataToMarker} to learn more.
  14918. //
  14919. // @param {Object} config
  14920. // @param {String} config.view
  14921. // @param {Function} [config.model]
  14922. // @param {module:utils/priorities~PriorityString} [config.converterPriority='normal']
  14923. // @returns {Function} Conversion helper.
  14924. function upcastDataToMarker( config ) {
  14925. config = Object(lodash_es__WEBPACK_IMPORTED_MODULE_2__["cloneDeep"])( config );
  14926. // Default conversion.
  14927. if ( !config.model ) {
  14928. config.model = name => {
  14929. return name ? config.view + ':' + name : config.view;
  14930. };
  14931. }
  14932. const converterStart = prepareToElementConverter( normalizeDataToMarkerConfig( config, 'start' ) );
  14933. const converterEnd = prepareToElementConverter( normalizeDataToMarkerConfig( config, 'end' ) );
  14934. return dispatcher => {
  14935. dispatcher.on( 'element:' + config.view + '-start', converterStart, { priority: config.converterPriority || 'normal' } );
  14936. dispatcher.on( 'element:' + config.view + '-end', converterEnd, { priority: config.converterPriority || 'normal' } );
  14937. // Below is a hack that is needed to properly handle `converterPriority` for both elements and attributes.
  14938. // Attribute conversion needs to be performed *after* element conversion.
  14939. // This converter handles both element conversion and attribute conversion, which means that if a single
  14940. // `config.converterPriority` is used, it will lead to problems. For example, if `'high'` priority is used,
  14941. // then attribute conversion will be performed before a lot of element upcast converters.
  14942. // On the other hand we want to support `config.converterPriority` and overwriting converters.
  14943. //
  14944. // To have it work, we need to do some extra processing for priority for attribute converter.
  14945. // Priority `'low'` value should be the base value and then we will change it depending on `config.converterPriority` value.
  14946. //
  14947. // This hack probably would not be needed if attributes are upcasted separately.
  14948. //
  14949. const basePriority = _ckeditor_ckeditor5_utils_src_priorities__WEBPACK_IMPORTED_MODULE_4__["default"].get( 'low' );
  14950. const maxPriority = _ckeditor_ckeditor5_utils_src_priorities__WEBPACK_IMPORTED_MODULE_4__["default"].get( 'highest' );
  14951. const priorityFactor = _ckeditor_ckeditor5_utils_src_priorities__WEBPACK_IMPORTED_MODULE_4__["default"].get( config.converterPriority ) / maxPriority; // Number in range [ -1, 1 ].
  14952. dispatcher.on( 'element', upcastAttributeToMarker( config ), { priority: basePriority + priorityFactor } );
  14953. };
  14954. }
  14955. // Function factory, returns a callback function which converts view attributes to a model marker.
  14956. //
  14957. // The converter looks for elements with `data-group-start-before`, `data-group-start-after`, `data-group-end-before`
  14958. // and `data-group-end-after` attributes and inserts `$marker` model elements before/after those elements.
  14959. // `group` part is specified in `config.view`.
  14960. //
  14961. // @param {Object} config
  14962. // @param {String} config.view
  14963. // @param {Function} [config.model]
  14964. // @returns {Function} Marker converter.
  14965. function upcastAttributeToMarker( config ) {
  14966. return ( evt, data, conversionApi ) => {
  14967. const attrName = `data-${ config.view }`;
  14968. // Check if any attribute for the given view item can be consumed before changing the conversion data
  14969. // and consuming view items with these attributes.
  14970. if (
  14971. !conversionApi.consumable.test( data.viewItem, { attributes: attrName + '-end-after' } ) &&
  14972. !conversionApi.consumable.test( data.viewItem, { attributes: attrName + '-start-after' } ) &&
  14973. !conversionApi.consumable.test( data.viewItem, { attributes: attrName + '-end-before' } ) &&
  14974. !conversionApi.consumable.test( data.viewItem, { attributes: attrName + '-start-before' } )
  14975. ) {
  14976. return;
  14977. }
  14978. // This converter wants to add a model element, marking a marker, before/after an element (or maybe even group of elements).
  14979. // To do that, we can use `data.modelRange` which is set on an element (or a group of elements) that has been upcasted.
  14980. // But, if the processed view element has not been upcasted yet (it does not have been converted), we need to
  14981. // fire conversion for its children first, then we will have `data.modelRange` available.
  14982. if ( !data.modelRange ) {
  14983. Object.assign( data, conversionApi.convertChildren( data.viewItem, data.modelCursor ) );
  14984. }
  14985. if ( conversionApi.consumable.consume( data.viewItem, { attributes: attrName + '-end-after' } ) ) {
  14986. addMarkerElements( data.modelRange.end, data.viewItem.getAttribute( attrName + '-end-after' ).split( ',' ) );
  14987. }
  14988. if ( conversionApi.consumable.consume( data.viewItem, { attributes: attrName + '-start-after' } ) ) {
  14989. addMarkerElements( data.modelRange.end, data.viewItem.getAttribute( attrName + '-start-after' ).split( ',' ) );
  14990. }
  14991. if ( conversionApi.consumable.consume( data.viewItem, { attributes: attrName + '-end-before' } ) ) {
  14992. addMarkerElements( data.modelRange.start, data.viewItem.getAttribute( attrName + '-end-before' ).split( ',' ) );
  14993. }
  14994. if ( conversionApi.consumable.consume( data.viewItem, { attributes: attrName + '-start-before' } ) ) {
  14995. addMarkerElements( data.modelRange.start, data.viewItem.getAttribute( attrName + '-start-before' ).split( ',' ) );
  14996. }
  14997. function addMarkerElements( position, markerViewNames ) {
  14998. for ( const markerViewName of markerViewNames ) {
  14999. const markerName = config.model( markerViewName, conversionApi );
  15000. const element = conversionApi.writer.createElement( '$marker', { 'data-name': markerName } );
  15001. conversionApi.writer.insert( element, position );
  15002. if ( data.modelCursor.isEqual( position ) ) {
  15003. data.modelCursor = data.modelCursor.getShiftedBy( 1 );
  15004. } else {
  15005. data.modelCursor = data.modelCursor._getTransformedByInsertion( position, 1 );
  15006. }
  15007. data.modelRange = data.modelRange._getTransformedByInsertion( position, 1 )[ 0 ];
  15008. }
  15009. }
  15010. };
  15011. }
  15012. // Helper function for from-view-element conversion. Checks if `config.view` directly specifies converted view element's name
  15013. // and if so, returns it.
  15014. //
  15015. // @param {Object} config Conversion view config.
  15016. // @returns {String|null} View element name or `null` if name is not directly set.
  15017. function getViewElementNameFromConfig( viewConfig ) {
  15018. if ( typeof viewConfig == 'string' ) {
  15019. return viewConfig;
  15020. }
  15021. if ( typeof viewConfig == 'object' && typeof viewConfig.name == 'string' ) {
  15022. return viewConfig.name;
  15023. }
  15024. return null;
  15025. }
  15026. // Helper for to-model-element conversion. Takes a config object and returns a proper converter function.
  15027. //
  15028. // @param {Object} config Conversion configuration.
  15029. // @returns {Function} View to model converter.
  15030. function prepareToElementConverter( config ) {
  15031. const matcher = new _view_matcher__WEBPACK_IMPORTED_MODULE_0__["default"]( config.view );
  15032. return ( evt, data, conversionApi ) => {
  15033. const matcherResult = matcher.match( data.viewItem );
  15034. if ( !matcherResult ) {
  15035. return;
  15036. }
  15037. const match = matcherResult.match;
  15038. // Force consuming element's name.
  15039. match.name = true;
  15040. if ( !conversionApi.consumable.test( data.viewItem, match ) ) {
  15041. return;
  15042. }
  15043. const modelElement = getModelElement( config.model, data.viewItem, conversionApi );
  15044. if ( !modelElement ) {
  15045. return;
  15046. }
  15047. if ( !conversionApi.safeInsert( modelElement, data.modelCursor ) ) {
  15048. return;
  15049. }
  15050. conversionApi.consumable.consume( data.viewItem, match );
  15051. conversionApi.convertChildren( data.viewItem, modelElement );
  15052. conversionApi.updateConversionResult( modelElement, data );
  15053. };
  15054. }
  15055. // Helper function for upcasting-to-element converter. Takes the model configuration, the converted view element
  15056. // and a writer instance and returns a model element instance to be inserted in the model.
  15057. //
  15058. // @param {String|Function|module:engine/model/element~Element} model Model conversion configuration.
  15059. // @param {module:engine/view/node~Node} input The converted view node.
  15060. // @param {module:engine/conversion/upcastdispatcher~UpcastConversionApi} conversionApi The upcast conversion API.
  15061. function getModelElement( model, input, conversionApi ) {
  15062. if ( model instanceof Function ) {
  15063. return model( input, conversionApi );
  15064. } else {
  15065. return conversionApi.writer.createElement( model );
  15066. }
  15067. }
  15068. // Helper function view-attribute-to-model-attribute helper. Normalizes `config.view` which was set as `String` or
  15069. // as an `Object` with `key`, `value` and `name` properties. Normalized `config.view` has is compatible with
  15070. // {@link module:engine/view/matcher~MatcherPattern}.
  15071. //
  15072. // @param {Object} config Conversion config.
  15073. // @returns {String} Key of the converted view attribute.
  15074. function normalizeViewAttributeKeyValueConfig( config ) {
  15075. if ( typeof config.view == 'string' ) {
  15076. config.view = { key: config.view };
  15077. }
  15078. const key = config.view.key;
  15079. let normalized;
  15080. if ( key == 'class' || key == 'style' ) {
  15081. const keyName = key == 'class' ? 'classes' : 'styles';
  15082. normalized = {
  15083. [ keyName ]: config.view.value
  15084. };
  15085. } else {
  15086. const value = typeof config.view.value == 'undefined' ? /[\s\S]*/ : config.view.value;
  15087. normalized = {
  15088. attributes: {
  15089. [ key ]: value
  15090. }
  15091. };
  15092. }
  15093. if ( config.view.name ) {
  15094. normalized.name = config.view.name;
  15095. }
  15096. config.view = normalized;
  15097. return key;
  15098. }
  15099. // Helper function that normalizes `config.model` in from-model-attribute conversion. `config.model` can be set
  15100. // as a `String`, an `Object` with only `key` property or an `Object` with `key` and `value` properties. Normalized
  15101. // `config.model` is an `Object` with `key` and `value` properties.
  15102. //
  15103. // @param {Object} config Conversion config.
  15104. // @param {String} viewAttributeKeyToCopy Key of the converted view attribute. If it is set, model attribute value
  15105. // will be equal to view attribute value.
  15106. function normalizeModelAttributeConfig( config, viewAttributeKeyToCopy = null ) {
  15107. const defaultModelValue = viewAttributeKeyToCopy === null ? true : viewElement => viewElement.getAttribute( viewAttributeKeyToCopy );
  15108. const key = typeof config.model != 'object' ? config.model : config.model.key;
  15109. const value = typeof config.model != 'object' || typeof config.model.value == 'undefined' ? defaultModelValue : config.model.value;
  15110. config.model = { key, value };
  15111. }
  15112. // Helper for to-model-attribute conversion. Takes the model attribute name and conversion configuration and returns
  15113. // a proper converter function.
  15114. //
  15115. // @param {String} modelAttributeKey The key of the model attribute to set on a model node.
  15116. // @param {Object|Array.<Object>} config Conversion configuration. It is possible to provide multiple configurations in an array.
  15117. // @param {Boolean} shallow If set to `true` the attribute will be set only on top-level nodes. Otherwise, it will be set
  15118. // on all elements in the range.
  15119. function prepareToAttributeConverter( config, shallow ) {
  15120. const matcher = new _view_matcher__WEBPACK_IMPORTED_MODULE_0__["default"]( config.view );
  15121. return ( evt, data, conversionApi ) => {
  15122. const match = matcher.match( data.viewItem );
  15123. // If there is no match, this callback should not do anything.
  15124. if ( !match ) {
  15125. return;
  15126. }
  15127. if ( onlyViewNameIsDefined( config.view, data.viewItem ) ) {
  15128. match.match.name = true;
  15129. } else {
  15130. // Do not test or consume `name` consumable.
  15131. delete match.match.name;
  15132. }
  15133. // Try to consume appropriate values from consumable values list.
  15134. if ( !conversionApi.consumable.test( data.viewItem, match.match ) ) {
  15135. return;
  15136. }
  15137. const modelKey = config.model.key;
  15138. const modelValue = typeof config.model.value == 'function' ?
  15139. config.model.value( data.viewItem, conversionApi ) : config.model.value;
  15140. // Do not convert if attribute building function returned falsy value.
  15141. if ( modelValue === null ) {
  15142. return;
  15143. }
  15144. // Since we are converting to attribute we need a range on which we will set the attribute.
  15145. // If the range is not created yet, let's create it by converting children of the current node first.
  15146. if ( !data.modelRange ) {
  15147. // Convert children and set conversion result as a current data.
  15148. Object.assign( data, conversionApi.convertChildren( data.viewItem, data.modelCursor ) );
  15149. }
  15150. // Set attribute on current `output`. `Schema` is checked inside this helper function.
  15151. const attributeWasSet = setAttributeOn( data.modelRange, { key: modelKey, value: modelValue }, shallow, conversionApi );
  15152. // It may happen that a converter will try to set an attribute that is not allowed in the given context.
  15153. // In such a situation we cannot consume the attribute. See: https://github.com/ckeditor/ckeditor5/pull/9249#issuecomment-815658459.
  15154. if ( attributeWasSet ) {
  15155. conversionApi.consumable.consume( data.viewItem, match.match );
  15156. }
  15157. };
  15158. }
  15159. // Helper function that checks if element name should be consumed in attribute converters.
  15160. //
  15161. // @param {Object} config Conversion view config.
  15162. // @returns {Boolean}
  15163. function onlyViewNameIsDefined( viewConfig, viewItem ) {
  15164. // https://github.com/ckeditor/ckeditor5-engine/issues/1786
  15165. const configToTest = typeof viewConfig == 'function' ? viewConfig( viewItem ) : viewConfig;
  15166. if ( typeof configToTest == 'object' && !getViewElementNameFromConfig( configToTest ) ) {
  15167. return false;
  15168. }
  15169. return !configToTest.classes && !configToTest.attributes && !configToTest.styles;
  15170. }
  15171. // Helper function for to-model-attribute converter. Sets model attribute on given range. Checks {@link module:engine/model/schema~Schema}
  15172. // to ensure proper model structure.
  15173. //
  15174. // If any node on the given range has already defined an attribute with the same name, its value will not be updated.
  15175. //
  15176. // @param {module:engine/model/range~Range} modelRange Model range on which attribute should be set.
  15177. // @param {Object} modelAttribute Model attribute to set.
  15178. // @param {module:engine/conversion/upcastdispatcher~UpcastConversionApi} conversionApi Conversion API.
  15179. // @param {Boolean} shallow If set to `true` the attribute will be set only on top-level nodes. Otherwise, it will be set
  15180. // on all elements in the range.
  15181. // @returns {Boolean} `true` if attribute was set on at least one node from given `modelRange`.
  15182. function setAttributeOn( modelRange, modelAttribute, shallow, conversionApi ) {
  15183. let result = false;
  15184. // Set attribute on each item in range according to Schema.
  15185. for ( const node of Array.from( modelRange.getItems( { shallow } ) ) ) {
  15186. // Skip if not allowed.
  15187. if ( !conversionApi.schema.checkAttribute( node, modelAttribute.key ) ) {
  15188. continue;
  15189. }
  15190. // Mark the node as consumed even if the attribute will not be updated because it's in a valid context (schema)
  15191. // and would be converted if the attribute wouldn't be present. See #8921.
  15192. result = true;
  15193. // Do not override the attribute if it's already present.
  15194. if ( node.hasAttribute( modelAttribute.key ) ) {
  15195. continue;
  15196. }
  15197. conversionApi.writer.setAttribute( modelAttribute.key, modelAttribute.value, node );
  15198. }
  15199. return result;
  15200. }
  15201. // Helper function for upcasting-to-marker conversion. Takes the config in a format requested by `upcastElementToMarker()`
  15202. // function and converts it to a format that is supported by `upcastElementToElement()` function.
  15203. //
  15204. // @param {Object} config Conversion configuration.
  15205. function normalizeElementToMarkerConfig( config ) {
  15206. const oldModel = config.model;
  15207. config.model = ( viewElement, conversionApi ) => {
  15208. const markerName = typeof oldModel == 'string' ? oldModel : oldModel( viewElement, conversionApi );
  15209. return conversionApi.writer.createElement( '$marker', { 'data-name': markerName } );
  15210. };
  15211. }
  15212. // Helper function for upcasting-to-marker conversion. Takes the config in a format requested by `upcastDataToMarker()`
  15213. // function and converts it to a format that is supported by `upcastElementToElement()` function.
  15214. //
  15215. // @param {Object} config Conversion configuration.
  15216. function normalizeDataToMarkerConfig( config, type ) {
  15217. const configForElements = {};
  15218. // Upcast <markerGroup-start> and <markerGroup-end> elements.
  15219. configForElements.view = config.view + '-' + type;
  15220. configForElements.model = ( viewElement, conversionApi ) => {
  15221. const viewName = viewElement.getAttribute( 'name' );
  15222. const markerName = config.model( viewName, conversionApi );
  15223. return conversionApi.writer.createElement( '$marker', { 'data-name': markerName } );
  15224. };
  15225. return configForElements;
  15226. }
  15227. /***/ }),
  15228. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/conversion/viewconsumable.js":
  15229. /*!**********************************************************************************!*\
  15230. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/conversion/viewconsumable.js ***!
  15231. \**********************************************************************************/
  15232. /*! exports provided: default */
  15233. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  15234. "use strict";
  15235. __webpack_require__.r(__webpack_exports__);
  15236. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ViewConsumable; });
  15237. /* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash-es */ "./node_modules/lodash-es/lodash.js");
  15238. /* 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");
  15239. /**
  15240. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  15241. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  15242. */
  15243. /**
  15244. * @module engine/conversion/viewconsumable
  15245. */
  15246. /**
  15247. * Class used for handling consumption of view {@link module:engine/view/element~Element elements},
  15248. * {@link module:engine/view/text~Text text nodes} and {@link module:engine/view/documentfragment~DocumentFragment document fragments}.
  15249. * Element's name and its parts (attributes, classes and styles) can be consumed separately. Consuming an element's name
  15250. * does not consume its attributes, classes and styles.
  15251. * To add items for consumption use {@link module:engine/conversion/viewconsumable~ViewConsumable#add add method}.
  15252. * To test items use {@link module:engine/conversion/viewconsumable~ViewConsumable#test test method}.
  15253. * To consume items use {@link module:engine/conversion/viewconsumable~ViewConsumable#consume consume method}.
  15254. * To revert already consumed items use {@link module:engine/conversion/viewconsumable~ViewConsumable#revert revert method}.
  15255. *
  15256. * viewConsumable.add( element, { name: true } ); // Adds element's name as ready to be consumed.
  15257. * viewConsumable.add( textNode ); // Adds text node for consumption.
  15258. * viewConsumable.add( docFragment ); // Adds document fragment for consumption.
  15259. * viewConsumable.test( element, { name: true } ); // Tests if element's name can be consumed.
  15260. * viewConsumable.test( textNode ); // Tests if text node can be consumed.
  15261. * viewConsumable.test( docFragment ); // Tests if document fragment can be consumed.
  15262. * viewConsumable.consume( element, { name: true } ); // Consume element's name.
  15263. * viewConsumable.consume( textNode ); // Consume text node.
  15264. * viewConsumable.consume( docFragment ); // Consume document fragment.
  15265. * viewConsumable.revert( element, { name: true } ); // Revert already consumed element's name.
  15266. * viewConsumable.revert( textNode ); // Revert already consumed text node.
  15267. * viewConsumable.revert( docFragment ); // Revert already consumed document fragment.
  15268. */
  15269. class ViewConsumable {
  15270. /**
  15271. * Creates new ViewConsumable.
  15272. */
  15273. constructor() {
  15274. /**
  15275. * Map of consumable elements. If {@link module:engine/view/element~Element element} is used as a key,
  15276. * {@link module:engine/conversion/viewconsumable~ViewElementConsumables ViewElementConsumables} instance is stored as value.
  15277. * For {@link module:engine/view/text~Text text nodes} and
  15278. * {@link module:engine/view/documentfragment~DocumentFragment document fragments} boolean value is stored as value.
  15279. *
  15280. * @protected
  15281. * @member {Map.<module:engine/conversion/viewconsumable~ViewElementConsumables|Boolean>}
  15282. */
  15283. this._consumables = new Map();
  15284. }
  15285. /**
  15286. * Adds {@link module:engine/view/element~Element view element}, {@link module:engine/view/text~Text text node} or
  15287. * {@link module:engine/view/documentfragment~DocumentFragment document fragment} as ready to be consumed.
  15288. *
  15289. * viewConsumable.add( p, { name: true } ); // Adds element's name to consume.
  15290. * viewConsumable.add( p, { attributes: 'name' } ); // Adds element's attribute.
  15291. * viewConsumable.add( p, { classes: 'foobar' } ); // Adds element's class.
  15292. * viewConsumable.add( p, { styles: 'color' } ); // Adds element's style
  15293. * viewConsumable.add( p, { attributes: 'name', styles: 'color' } ); // Adds attribute and style.
  15294. * viewConsumable.add( p, { classes: [ 'baz', 'bar' ] } ); // Multiple consumables can be provided.
  15295. * viewConsumable.add( textNode ); // Adds text node to consume.
  15296. * viewConsumable.add( docFragment ); // Adds document fragment to consume.
  15297. *
  15298. * Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `viewconsumable-invalid-attribute` when `class` or `style`
  15299. * attribute is provided - it should be handled separately by providing actual style/class.
  15300. *
  15301. * viewConsumable.add( p, { attributes: 'style' } ); // This call will throw an exception.
  15302. * viewConsumable.add( p, { styles: 'color' } ); // This is properly handled style.
  15303. *
  15304. * @param {module:engine/view/element~Element|module:engine/view/text~Text|module:engine/view/documentfragment~DocumentFragment} element
  15305. * @param {Object} [consumables] Used only if first parameter is {@link module:engine/view/element~Element view element} instance.
  15306. * @param {Boolean} consumables.name If set to true element's name will be included.
  15307. * @param {String|Array.<String>} consumables.attributes Attribute name or array of attribute names.
  15308. * @param {String|Array.<String>} consumables.classes Class name or array of class names.
  15309. * @param {String|Array.<String>} consumables.styles Style name or array of style names.
  15310. */
  15311. add( element, consumables ) {
  15312. let elementConsumables;
  15313. // For text nodes and document fragments just mark them as consumable.
  15314. if ( element.is( '$text' ) || element.is( 'documentFragment' ) ) {
  15315. this._consumables.set( element, true );
  15316. return;
  15317. }
  15318. // For elements create new ViewElementConsumables or update already existing one.
  15319. if ( !this._consumables.has( element ) ) {
  15320. elementConsumables = new ViewElementConsumables( element );
  15321. this._consumables.set( element, elementConsumables );
  15322. } else {
  15323. elementConsumables = this._consumables.get( element );
  15324. }
  15325. elementConsumables.add( consumables );
  15326. }
  15327. /**
  15328. * Tests if {@link module:engine/view/element~Element view element}, {@link module:engine/view/text~Text text node} or
  15329. * {@link module:engine/view/documentfragment~DocumentFragment document fragment} can be consumed.
  15330. * It returns `true` when all items included in method's call can be consumed. Returns `false` when
  15331. * first already consumed item is found and `null` when first non-consumable item is found.
  15332. *
  15333. * viewConsumable.test( p, { name: true } ); // Tests element's name.
  15334. * viewConsumable.test( p, { attributes: 'name' } ); // Tests attribute.
  15335. * viewConsumable.test( p, { classes: 'foobar' } ); // Tests class.
  15336. * viewConsumable.test( p, { styles: 'color' } ); // Tests style.
  15337. * viewConsumable.test( p, { attributes: 'name', styles: 'color' } ); // Tests attribute and style.
  15338. * viewConsumable.test( p, { classes: [ 'baz', 'bar' ] } ); // Multiple consumables can be tested.
  15339. * viewConsumable.test( textNode ); // Tests text node.
  15340. * viewConsumable.test( docFragment ); // Tests document fragment.
  15341. *
  15342. * Testing classes and styles as attribute will test if all added classes/styles can be consumed.
  15343. *
  15344. * viewConsumable.test( p, { attributes: 'class' } ); // Tests if all added classes can be consumed.
  15345. * viewConsumable.test( p, { attributes: 'style' } ); // Tests if all added styles can be consumed.
  15346. *
  15347. * @param {module:engine/view/element~Element|module:engine/view/text~Text|module:engine/view/documentfragment~DocumentFragment} element
  15348. * @param {Object} [consumables] Used only if first parameter is {@link module:engine/view/element~Element view element} instance.
  15349. * @param {Boolean} consumables.name If set to true element's name will be included.
  15350. * @param {String|Array.<String>} consumables.attributes Attribute name or array of attribute names.
  15351. * @param {String|Array.<String>} consumables.classes Class name or array of class names.
  15352. * @param {String|Array.<String>} consumables.styles Style name or array of style names.
  15353. * @returns {Boolean|null} Returns `true` when all items included in method's call can be consumed. Returns `false`
  15354. * when first already consumed item is found and `null` when first non-consumable item is found.
  15355. */
  15356. test( element, consumables ) {
  15357. const elementConsumables = this._consumables.get( element );
  15358. if ( elementConsumables === undefined ) {
  15359. return null;
  15360. }
  15361. // For text nodes and document fragments return stored boolean value.
  15362. if ( element.is( '$text' ) || element.is( 'documentFragment' ) ) {
  15363. return elementConsumables;
  15364. }
  15365. // For elements test consumables object.
  15366. return elementConsumables.test( consumables );
  15367. }
  15368. /**
  15369. * Consumes {@link module:engine/view/element~Element view element}, {@link module:engine/view/text~Text text node} or
  15370. * {@link module:engine/view/documentfragment~DocumentFragment document fragment}.
  15371. * It returns `true` when all items included in method's call can be consumed, otherwise returns `false`.
  15372. *
  15373. * viewConsumable.consume( p, { name: true } ); // Consumes element's name.
  15374. * viewConsumable.consume( p, { attributes: 'name' } ); // Consumes element's attribute.
  15375. * viewConsumable.consume( p, { classes: 'foobar' } ); // Consumes element's class.
  15376. * viewConsumable.consume( p, { styles: 'color' } ); // Consumes element's style.
  15377. * viewConsumable.consume( p, { attributes: 'name', styles: 'color' } ); // Consumes attribute and style.
  15378. * viewConsumable.consume( p, { classes: [ 'baz', 'bar' ] } ); // Multiple consumables can be consumed.
  15379. * viewConsumable.consume( textNode ); // Consumes text node.
  15380. * viewConsumable.consume( docFragment ); // Consumes document fragment.
  15381. *
  15382. * Consuming classes and styles as attribute will test if all added classes/styles can be consumed.
  15383. *
  15384. * viewConsumable.consume( p, { attributes: 'class' } ); // Consume only if all added classes can be consumed.
  15385. * viewConsumable.consume( p, { attributes: 'style' } ); // Consume only if all added styles can be consumed.
  15386. *
  15387. * @param {module:engine/view/element~Element|module:engine/view/text~Text|module:engine/view/documentfragment~DocumentFragment} element
  15388. * @param {Object} [consumables] Used only if first parameter is {@link module:engine/view/element~Element view element} instance.
  15389. * @param {Boolean} consumables.name If set to true element's name will be included.
  15390. * @param {String|Array.<String>} consumables.attributes Attribute name or array of attribute names.
  15391. * @param {String|Array.<String>} consumables.classes Class name or array of class names.
  15392. * @param {String|Array.<String>} consumables.styles Style name or array of style names.
  15393. * @returns {Boolean} Returns `true` when all items included in method's call can be consumed,
  15394. * otherwise returns `false`.
  15395. */
  15396. consume( element, consumables ) {
  15397. if ( this.test( element, consumables ) ) {
  15398. if ( element.is( '$text' ) || element.is( 'documentFragment' ) ) {
  15399. // For text nodes and document fragments set value to false.
  15400. this._consumables.set( element, false );
  15401. } else {
  15402. // For elements - consume consumables object.
  15403. this._consumables.get( element ).consume( consumables );
  15404. }
  15405. return true;
  15406. }
  15407. return false;
  15408. }
  15409. /**
  15410. * Reverts {@link module:engine/view/element~Element view element}, {@link module:engine/view/text~Text text node} or
  15411. * {@link module:engine/view/documentfragment~DocumentFragment document fragment} so they can be consumed once again.
  15412. * Method does not revert items that were never previously added for consumption, even if they are included in
  15413. * method's call.
  15414. *
  15415. * viewConsumable.revert( p, { name: true } ); // Reverts element's name.
  15416. * viewConsumable.revert( p, { attributes: 'name' } ); // Reverts element's attribute.
  15417. * viewConsumable.revert( p, { classes: 'foobar' } ); // Reverts element's class.
  15418. * viewConsumable.revert( p, { styles: 'color' } ); // Reverts element's style.
  15419. * viewConsumable.revert( p, { attributes: 'name', styles: 'color' } ); // Reverts attribute and style.
  15420. * viewConsumable.revert( p, { classes: [ 'baz', 'bar' ] } ); // Multiple names can be reverted.
  15421. * viewConsumable.revert( textNode ); // Reverts text node.
  15422. * viewConsumable.revert( docFragment ); // Reverts document fragment.
  15423. *
  15424. * Reverting classes and styles as attribute will revert all classes/styles that were previously added for
  15425. * consumption.
  15426. *
  15427. * viewConsumable.revert( p, { attributes: 'class' } ); // Reverts all classes added for consumption.
  15428. * viewConsumable.revert( p, { attributes: 'style' } ); // Reverts all styles added for consumption.
  15429. *
  15430. * @param {module:engine/view/element~Element|module:engine/view/text~Text|module:engine/view/documentfragment~DocumentFragment} element
  15431. * @param {Object} [consumables] Used only if first parameter is {@link module:engine/view/element~Element view element} instance.
  15432. * @param {Boolean} consumables.name If set to true element's name will be included.
  15433. * @param {String|Array.<String>} consumables.attributes Attribute name or array of attribute names.
  15434. * @param {String|Array.<String>} consumables.classes Class name or array of class names.
  15435. * @param {String|Array.<String>} consumables.styles Style name or array of style names.
  15436. */
  15437. revert( element, consumables ) {
  15438. const elementConsumables = this._consumables.get( element );
  15439. if ( elementConsumables !== undefined ) {
  15440. if ( element.is( '$text' ) || element.is( 'documentFragment' ) ) {
  15441. // For text nodes and document fragments - set consumable to true.
  15442. this._consumables.set( element, true );
  15443. } else {
  15444. // For elements - revert items from consumables object.
  15445. elementConsumables.revert( consumables );
  15446. }
  15447. }
  15448. }
  15449. /**
  15450. * Creates consumable object from {@link module:engine/view/element~Element view element}. Consumable object will include
  15451. * element's name and all its attributes, classes and styles.
  15452. *
  15453. * @static
  15454. * @param {module:engine/view/element~Element} element
  15455. * @returns {Object} consumables
  15456. */
  15457. static consumablesFromElement( element ) {
  15458. const consumables = {
  15459. element,
  15460. name: true,
  15461. attributes: [],
  15462. classes: [],
  15463. styles: []
  15464. };
  15465. const attributes = element.getAttributeKeys();
  15466. for ( const attribute of attributes ) {
  15467. // Skip classes and styles - will be added separately.
  15468. if ( attribute == 'style' || attribute == 'class' ) {
  15469. continue;
  15470. }
  15471. consumables.attributes.push( attribute );
  15472. }
  15473. const classes = element.getClassNames();
  15474. for ( const className of classes ) {
  15475. consumables.classes.push( className );
  15476. }
  15477. const styles = element.getStyleNames();
  15478. for ( const style of styles ) {
  15479. consumables.styles.push( style );
  15480. }
  15481. return consumables;
  15482. }
  15483. /**
  15484. * Creates {@link module:engine/conversion/viewconsumable~ViewConsumable ViewConsumable} instance from
  15485. * {@link module:engine/view/node~Node node} or {@link module:engine/view/documentfragment~DocumentFragment document fragment}.
  15486. * Instance will contain all elements, child nodes, attributes, styles and classes added for consumption.
  15487. *
  15488. * @static
  15489. * @param {module:engine/view/node~Node|module:engine/view/documentfragment~DocumentFragment} from View node or document fragment
  15490. * from which `ViewConsumable` will be created.
  15491. * @param {module:engine/conversion/viewconsumable~ViewConsumable} [instance] If provided, given `ViewConsumable` instance will be used
  15492. * to add all consumables. It will be returned instead of a new instance.
  15493. */
  15494. static createFrom( from, instance ) {
  15495. if ( !instance ) {
  15496. instance = new ViewConsumable( from );
  15497. }
  15498. if ( from.is( '$text' ) ) {
  15499. instance.add( from );
  15500. return instance;
  15501. }
  15502. // Add `from` itself, if it is an element.
  15503. if ( from.is( 'element' ) ) {
  15504. instance.add( from, ViewConsumable.consumablesFromElement( from ) );
  15505. }
  15506. if ( from.is( 'documentFragment' ) ) {
  15507. instance.add( from );
  15508. }
  15509. for ( const child of from.getChildren() ) {
  15510. instance = ViewConsumable.createFrom( child, instance );
  15511. }
  15512. return instance;
  15513. }
  15514. }
  15515. /**
  15516. * This is a private helper-class for {@link module:engine/conversion/viewconsumable~ViewConsumable}.
  15517. * It represents and manipulates consumable parts of a single {@link module:engine/view/element~Element}.
  15518. *
  15519. * @private
  15520. */
  15521. class ViewElementConsumables {
  15522. /**
  15523. * Creates ViewElementConsumables instance.
  15524. *
  15525. * @param {module:engine/view/node~Node|module:engine/view/documentfragment~DocumentFragment} from View node or document fragment
  15526. * from which `ViewElementConsumables` is being created.
  15527. */
  15528. constructor( from ) {
  15529. /**
  15530. * @readonly
  15531. * @member {module:engine/view/node~Node|module:engine/view/documentfragment~DocumentFragment}
  15532. */
  15533. this.element = from;
  15534. /**
  15535. * Flag indicating if name of the element can be consumed.
  15536. *
  15537. * @private
  15538. * @member {Boolean}
  15539. */
  15540. this._canConsumeName = null;
  15541. /**
  15542. * Contains maps of element's consumables: attributes, classes and styles.
  15543. *
  15544. * @private
  15545. * @member {Object}
  15546. */
  15547. this._consumables = {
  15548. attributes: new Map(),
  15549. styles: new Map(),
  15550. classes: new Map()
  15551. };
  15552. }
  15553. /**
  15554. * Adds consumable parts of the {@link module:engine/view/element~Element view element}.
  15555. * Element's name itself can be marked to be consumed (when element's name is consumed its attributes, classes and
  15556. * styles still could be consumed):
  15557. *
  15558. * consumables.add( { name: true } );
  15559. *
  15560. * Attributes classes and styles:
  15561. *
  15562. * consumables.add( { attributes: 'title', classes: 'foo', styles: 'color' } );
  15563. * consumables.add( { attributes: [ 'title', 'name' ], classes: [ 'foo', 'bar' ] );
  15564. *
  15565. * Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `viewconsumable-invalid-attribute` when `class` or `style`
  15566. * attribute is provided - it should be handled separately by providing `style` and `class` in consumables object.
  15567. *
  15568. * @param {Object} consumables Object describing which parts of the element can be consumed.
  15569. * @param {Boolean} consumables.name If set to `true` element's name will be added as consumable.
  15570. * @param {String|Array.<String>} consumables.attributes Attribute name or array of attribute names to add as consumable.
  15571. * @param {String|Array.<String>} consumables.classes Class name or array of class names to add as consumable.
  15572. * @param {String|Array.<String>} consumables.styles Style name or array of style names to add as consumable.
  15573. */
  15574. add( consumables ) {
  15575. if ( consumables.name ) {
  15576. this._canConsumeName = true;
  15577. }
  15578. for ( const type in this._consumables ) {
  15579. if ( type in consumables ) {
  15580. this._add( type, consumables[ type ] );
  15581. }
  15582. }
  15583. }
  15584. /**
  15585. * Tests if parts of the {@link module:engine/view/node~Node view node} can be consumed.
  15586. *
  15587. * Element's name can be tested:
  15588. *
  15589. * consumables.test( { name: true } );
  15590. *
  15591. * Attributes classes and styles:
  15592. *
  15593. * consumables.test( { attributes: 'title', classes: 'foo', styles: 'color' } );
  15594. * consumables.test( { attributes: [ 'title', 'name' ], classes: [ 'foo', 'bar' ] );
  15595. *
  15596. * @param {Object} consumables Object describing which parts of the element should be tested.
  15597. * @param {Boolean} consumables.name If set to `true` element's name will be tested.
  15598. * @param {String|Array.<String>} consumables.attributes Attribute name or array of attribute names to test.
  15599. * @param {String|Array.<String>} consumables.classes Class name or array of class names to test.
  15600. * @param {String|Array.<String>} consumables.styles Style name or array of style names to test.
  15601. * @returns {Boolean|null} `true` when all tested items can be consumed, `null` when even one of the items
  15602. * was never marked for consumption and `false` when even one of the items was already consumed.
  15603. */
  15604. test( consumables ) {
  15605. // Check if name can be consumed.
  15606. if ( consumables.name && !this._canConsumeName ) {
  15607. return this._canConsumeName;
  15608. }
  15609. for ( const type in this._consumables ) {
  15610. if ( type in consumables ) {
  15611. const value = this._test( type, consumables[ type ] );
  15612. if ( value !== true ) {
  15613. return value;
  15614. }
  15615. }
  15616. }
  15617. // Return true only if all can be consumed.
  15618. return true;
  15619. }
  15620. /**
  15621. * Consumes parts of {@link module:engine/view/element~Element view element}. This function does not check if consumable item
  15622. * is already consumed - it consumes all consumable items provided.
  15623. * Element's name can be consumed:
  15624. *
  15625. * consumables.consume( { name: true } );
  15626. *
  15627. * Attributes classes and styles:
  15628. *
  15629. * consumables.consume( { attributes: 'title', classes: 'foo', styles: 'color' } );
  15630. * consumables.consume( { attributes: [ 'title', 'name' ], classes: [ 'foo', 'bar' ] );
  15631. *
  15632. * @param {Object} consumables Object describing which parts of the element should be consumed.
  15633. * @param {Boolean} consumables.name If set to `true` element's name will be consumed.
  15634. * @param {String|Array.<String>} consumables.attributes Attribute name or array of attribute names to consume.
  15635. * @param {String|Array.<String>} consumables.classes Class name or array of class names to consume.
  15636. * @param {String|Array.<String>} consumables.styles Style name or array of style names to consume.
  15637. */
  15638. consume( consumables ) {
  15639. if ( consumables.name ) {
  15640. this._canConsumeName = false;
  15641. }
  15642. for ( const type in this._consumables ) {
  15643. if ( type in consumables ) {
  15644. this._consume( type, consumables[ type ] );
  15645. }
  15646. }
  15647. }
  15648. /**
  15649. * Revert already consumed parts of {@link module:engine/view/element~Element view Element}, so they can be consumed once again.
  15650. * Element's name can be reverted:
  15651. *
  15652. * consumables.revert( { name: true } );
  15653. *
  15654. * Attributes classes and styles:
  15655. *
  15656. * consumables.revert( { attributes: 'title', classes: 'foo', styles: 'color' } );
  15657. * consumables.revert( { attributes: [ 'title', 'name' ], classes: [ 'foo', 'bar' ] );
  15658. *
  15659. * @param {Object} consumables Object describing which parts of the element should be reverted.
  15660. * @param {Boolean} consumables.name If set to `true` element's name will be reverted.
  15661. * @param {String|Array.<String>} consumables.attributes Attribute name or array of attribute names to revert.
  15662. * @param {String|Array.<String>} consumables.classes Class name or array of class names to revert.
  15663. * @param {String|Array.<String>} consumables.styles Style name or array of style names to revert.
  15664. */
  15665. revert( consumables ) {
  15666. if ( consumables.name ) {
  15667. this._canConsumeName = true;
  15668. }
  15669. for ( const type in this._consumables ) {
  15670. if ( type in consumables ) {
  15671. this._revert( type, consumables[ type ] );
  15672. }
  15673. }
  15674. }
  15675. /**
  15676. * Helper method that adds consumables of a given type: attribute, class or style.
  15677. *
  15678. * Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `viewconsumable-invalid-attribute` when `class` or `style`
  15679. * type is provided - it should be handled separately by providing actual style/class type.
  15680. *
  15681. * @private
  15682. * @param {String} type Type of the consumable item: `attributes`, `classes` or `styles`.
  15683. * @param {String|Array.<String>} item Consumable item or array of items.
  15684. */
  15685. _add( type, item ) {
  15686. const items = Object(lodash_es__WEBPACK_IMPORTED_MODULE_0__["isArray"])( item ) ? item : [ item ];
  15687. const consumables = this._consumables[ type ];
  15688. for ( const name of items ) {
  15689. if ( type === 'attributes' && ( name === 'class' || name === 'style' ) ) {
  15690. /**
  15691. * Class and style attributes should be handled separately in
  15692. * {@link module:engine/conversion/viewconsumable~ViewConsumable#add `ViewConsumable#add()`}.
  15693. *
  15694. * What you have done is trying to use:
  15695. *
  15696. * consumables.add( { attributes: [ 'class', 'style' ] } );
  15697. *
  15698. * While each class and style should be registered separately:
  15699. *
  15700. * consumables.add( { classes: 'some-class', styles: 'font-weight' } );
  15701. *
  15702. * @error viewconsumable-invalid-attribute
  15703. */
  15704. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_1__["default"]( 'viewconsumable-invalid-attribute', this );
  15705. }
  15706. consumables.set( name, true );
  15707. if ( type === 'styles' ) {
  15708. for ( const alsoName of this.element.document.stylesProcessor.getRelatedStyles( name ) ) {
  15709. consumables.set( alsoName, true );
  15710. }
  15711. }
  15712. }
  15713. }
  15714. /**
  15715. * Helper method that tests consumables of a given type: attribute, class or style.
  15716. *
  15717. * @private
  15718. * @param {String} type Type of the consumable item: `attributes`, `classes` or `styles`.
  15719. * @param {String|Array.<String>} item Consumable item or array of items.
  15720. * @returns {Boolean|null} Returns `true` if all items can be consumed, `null` when one of the items cannot be
  15721. * consumed and `false` when one of the items is already consumed.
  15722. */
  15723. _test( type, item ) {
  15724. const items = Object(lodash_es__WEBPACK_IMPORTED_MODULE_0__["isArray"])( item ) ? item : [ item ];
  15725. const consumables = this._consumables[ type ];
  15726. for ( const name of items ) {
  15727. if ( type === 'attributes' && ( name === 'class' || name === 'style' ) ) {
  15728. const consumableName = name == 'class' ? 'classes' : 'styles';
  15729. // Check all classes/styles if class/style attribute is tested.
  15730. const value = this._test( consumableName, [ ...this._consumables[ consumableName ].keys() ] );
  15731. if ( value !== true ) {
  15732. return value;
  15733. }
  15734. } else {
  15735. const value = consumables.get( name );
  15736. // Return null if attribute is not found.
  15737. if ( value === undefined ) {
  15738. return null;
  15739. }
  15740. if ( !value ) {
  15741. return false;
  15742. }
  15743. }
  15744. }
  15745. return true;
  15746. }
  15747. /**
  15748. * Helper method that consumes items of a given type: attribute, class or style.
  15749. *
  15750. * @private
  15751. * @param {String} type Type of the consumable item: `attributes`, `classes` or `styles`.
  15752. * @param {String|Array.<String>} item Consumable item or array of items.
  15753. */
  15754. _consume( type, item ) {
  15755. const items = Object(lodash_es__WEBPACK_IMPORTED_MODULE_0__["isArray"])( item ) ? item : [ item ];
  15756. const consumables = this._consumables[ type ];
  15757. for ( const name of items ) {
  15758. if ( type === 'attributes' && ( name === 'class' || name === 'style' ) ) {
  15759. const consumableName = name == 'class' ? 'classes' : 'styles';
  15760. // If class or style is provided for consumption - consume them all.
  15761. this._consume( consumableName, [ ...this._consumables[ consumableName ].keys() ] );
  15762. } else {
  15763. consumables.set( name, false );
  15764. if ( type == 'styles' ) {
  15765. for ( const toConsume of this.element.document.stylesProcessor.getRelatedStyles( name ) ) {
  15766. consumables.set( toConsume, false );
  15767. }
  15768. }
  15769. }
  15770. }
  15771. }
  15772. /**
  15773. * Helper method that reverts items of a given type: attribute, class or style.
  15774. *
  15775. * @private
  15776. * @param {String} type Type of the consumable item: `attributes`, `classes` or , `styles`.
  15777. * @param {String|Array.<String>} item Consumable item or array of items.
  15778. */
  15779. _revert( type, item ) {
  15780. const items = Object(lodash_es__WEBPACK_IMPORTED_MODULE_0__["isArray"])( item ) ? item : [ item ];
  15781. const consumables = this._consumables[ type ];
  15782. for ( const name of items ) {
  15783. if ( type === 'attributes' && ( name === 'class' || name === 'style' ) ) {
  15784. const consumableName = name == 'class' ? 'classes' : 'styles';
  15785. // If class or style is provided for reverting - revert them all.
  15786. this._revert( consumableName, [ ...this._consumables[ consumableName ].keys() ] );
  15787. } else {
  15788. const value = consumables.get( name );
  15789. if ( value === false ) {
  15790. consumables.set( name, true );
  15791. }
  15792. }
  15793. }
  15794. }
  15795. }
  15796. /***/ }),
  15797. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/dataprocessor/basichtmlwriter.js":
  15798. /*!**************************************************************************************!*\
  15799. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/dataprocessor/basichtmlwriter.js ***!
  15800. \**************************************************************************************/
  15801. /*! exports provided: default */
  15802. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  15803. "use strict";
  15804. __webpack_require__.r(__webpack_exports__);
  15805. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return BasicHtmlWriter; });
  15806. /**
  15807. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  15808. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  15809. */
  15810. /**
  15811. * @module engine/dataprocessor/basichtmlwriter
  15812. */
  15813. /* globals document */
  15814. /**
  15815. * Basic HTML writer. It uses the native `innerHTML` property for basic conversion
  15816. * from a document fragment to an HTML string.
  15817. *
  15818. * @implements module:engine/dataprocessor/htmlwriter~HtmlWriter
  15819. */
  15820. class BasicHtmlWriter {
  15821. /**
  15822. * Returns an HTML string created from the document fragment.
  15823. *
  15824. * @param {DocumentFragment} fragment
  15825. * @returns {String}
  15826. */
  15827. getHtml( fragment ) {
  15828. const doc = document.implementation.createHTMLDocument( '' );
  15829. const container = doc.createElement( 'div' );
  15830. container.appendChild( fragment );
  15831. return container.innerHTML;
  15832. }
  15833. }
  15834. /***/ }),
  15835. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/dataprocessor/htmldataprocessor.js":
  15836. /*!****************************************************************************************!*\
  15837. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/dataprocessor/htmldataprocessor.js ***!
  15838. \****************************************************************************************/
  15839. /*! exports provided: default */
  15840. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  15841. "use strict";
  15842. __webpack_require__.r(__webpack_exports__);
  15843. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return HtmlDataProcessor; });
  15844. /* harmony import */ var _basichtmlwriter__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./basichtmlwriter */ "./node_modules/@ckeditor/ckeditor5-engine/src/dataprocessor/basichtmlwriter.js");
  15845. /* harmony import */ var _view_domconverter__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../view/domconverter */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/domconverter.js");
  15846. /**
  15847. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  15848. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  15849. */
  15850. /**
  15851. * @module engine/dataprocessor/htmldataprocessor
  15852. */
  15853. /* globals document, DOMParser */
  15854. /**
  15855. * The HTML data processor class.
  15856. * This data processor implementation uses HTML as input and output data.
  15857. *
  15858. * @implements module:engine/dataprocessor/dataprocessor~DataProcessor
  15859. */
  15860. class HtmlDataProcessor {
  15861. /**
  15862. * Creates a new instance of the HTML data processor class.
  15863. *
  15864. * @param {module:engine/view/document~Document} document The view document instance.
  15865. */
  15866. constructor( document ) {
  15867. /**
  15868. * A DOM parser instance used to parse an HTML string to an HTML document.
  15869. *
  15870. * @private
  15871. * @member {DOMParser}
  15872. */
  15873. this._domParser = new DOMParser();
  15874. /**
  15875. * A DOM converter used to convert DOM elements to view elements.
  15876. *
  15877. * @private
  15878. * @member {module:engine/view/domconverter~DomConverter}
  15879. */
  15880. this._domConverter = new _view_domconverter__WEBPACK_IMPORTED_MODULE_1__["default"]( document, { blockFillerMode: 'nbsp' } );
  15881. /**
  15882. * A basic HTML writer instance used to convert DOM elements to an HTML string.
  15883. *
  15884. * @private
  15885. * @member {module:engine/dataprocessor/basichtmlwriter~BasicHtmlWriter}
  15886. */
  15887. this._htmlWriter = new _basichtmlwriter__WEBPACK_IMPORTED_MODULE_0__["default"]();
  15888. }
  15889. /**
  15890. * Converts a provided {@link module:engine/view/documentfragment~DocumentFragment document fragment}
  15891. * to data format &mdash; in this case to an HTML string.
  15892. *
  15893. * @param {module:engine/view/documentfragment~DocumentFragment} viewFragment
  15894. * @returns {String} HTML string.
  15895. */
  15896. toData( viewFragment ) {
  15897. // Convert view DocumentFragment to DOM DocumentFragment.
  15898. const domFragment = this._domConverter.viewToDom( viewFragment, document );
  15899. // Convert DOM DocumentFragment to HTML output.
  15900. return this._htmlWriter.getHtml( domFragment );
  15901. }
  15902. /**
  15903. * Converts the provided HTML string to a view tree.
  15904. *
  15905. * @param {String} data An HTML string.
  15906. * @returns {module:engine/view/node~Node|module:engine/view/documentfragment~DocumentFragment|null} A converted view element.
  15907. */
  15908. toView( data ) {
  15909. // Convert input HTML data to DOM DocumentFragment.
  15910. const domFragment = this._toDom( data );
  15911. // Convert DOM DocumentFragment to view DocumentFragment.
  15912. return this._domConverter.domToView( domFragment );
  15913. }
  15914. /**
  15915. * Registers a {@link module:engine/view/matcher~MatcherPattern} for view elements whose content should be treated as raw data
  15916. * and not processed during the conversion from the DOM to the view elements.
  15917. *
  15918. * The raw data can be later accessed by a
  15919. * {@link module:engine/view/element~Element#getCustomProperty custom property of a view element} called `"$rawContent"`.
  15920. *
  15921. * @param {module:engine/view/matcher~MatcherPattern} pattern Pattern matching all view elements whose content should
  15922. * be treated as raw data.
  15923. */
  15924. registerRawContentMatcher( pattern ) {
  15925. this._domConverter.registerRawContentMatcher( pattern );
  15926. }
  15927. /**
  15928. * If the processor is set to use marked fillers, it will insert `&nbsp;` fillers wrapped in `<span>` elements
  15929. * (`<span data-cke-filler="true">&nbsp;</span>`) instead of regular `&nbsp;` characters.
  15930. *
  15931. * This mode allows for more precise handling of block fillers (so they do not leak into the editor content) but bloats the
  15932. * editor data with additional markup.
  15933. *
  15934. * This mode may be required by some features and will be turned on by them automatically.
  15935. *
  15936. * @param {'default'|'marked'} type Whether to use the default or marked `&nbsp;` block fillers.
  15937. */
  15938. useFillerType( type ) {
  15939. this._domConverter.blockFillerMode = type == 'marked' ? 'markedNbsp' : 'nbsp';
  15940. }
  15941. /**
  15942. * Converts an HTML string to its DOM representation. Returns a document fragment containing nodes parsed from
  15943. * the provided data.
  15944. *
  15945. * @private
  15946. * @param {String} data
  15947. * @returns {DocumentFragment}
  15948. */
  15949. _toDom( data ) {
  15950. const document = this._domParser.parseFromString( data, 'text/html' );
  15951. const fragment = document.createDocumentFragment();
  15952. const nodes = document.body.childNodes;
  15953. while ( nodes.length > 0 ) {
  15954. fragment.appendChild( nodes[ 0 ] );
  15955. }
  15956. return fragment;
  15957. }
  15958. }
  15959. /***/ }),
  15960. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/index.js":
  15961. /*!**************************************************************!*\
  15962. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/index.js ***!
  15963. \**************************************************************/
  15964. /*! exports provided: enablePlaceholder, disablePlaceholder, showPlaceholder, hidePlaceholder, needsPlaceholder, EditingController, DataController, Conversion, HtmlDataProcessor, InsertOperation, MarkerOperation, OperationFactory, transformSets, DocumentSelection, Range, LiveRange, LivePosition, Model, TreeWalker, Element, DomConverter, ViewDocument, getFillerOffset, Observer, ClickObserver, DomEventObserver, MouseObserver, DowncastWriter, UpcastWriter, Matcher, DomEventData, StylesProcessor, addBackgroundRules, addBorderRules, addMarginRules, addPaddingRules, isColor, isLineStyle, isLength, isPercentage, isRepeat, isPosition, isAttachment, isURL, getBoxSidesValues, getBoxSidesValueReducer, getBoxSidesShorthandValue, getPositionShorthandNormalizer, getShorthandValues */
  15965. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  15966. "use strict";
  15967. __webpack_require__.r(__webpack_exports__);
  15968. /* harmony import */ var _view_placeholder__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./view/placeholder */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/placeholder.js");
  15969. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "enablePlaceholder", function() { return _view_placeholder__WEBPACK_IMPORTED_MODULE_0__["enablePlaceholder"]; });
  15970. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "disablePlaceholder", function() { return _view_placeholder__WEBPACK_IMPORTED_MODULE_0__["disablePlaceholder"]; });
  15971. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "showPlaceholder", function() { return _view_placeholder__WEBPACK_IMPORTED_MODULE_0__["showPlaceholder"]; });
  15972. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "hidePlaceholder", function() { return _view_placeholder__WEBPACK_IMPORTED_MODULE_0__["hidePlaceholder"]; });
  15973. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "needsPlaceholder", function() { return _view_placeholder__WEBPACK_IMPORTED_MODULE_0__["needsPlaceholder"]; });
  15974. /* harmony import */ var _controller_editingcontroller__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./controller/editingcontroller */ "./node_modules/@ckeditor/ckeditor5-engine/src/controller/editingcontroller.js");
  15975. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "EditingController", function() { return _controller_editingcontroller__WEBPACK_IMPORTED_MODULE_1__["default"]; });
  15976. /* harmony import */ var _controller_datacontroller__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./controller/datacontroller */ "./node_modules/@ckeditor/ckeditor5-engine/src/controller/datacontroller.js");
  15977. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DataController", function() { return _controller_datacontroller__WEBPACK_IMPORTED_MODULE_2__["default"]; });
  15978. /* harmony import */ var _conversion_conversion__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./conversion/conversion */ "./node_modules/@ckeditor/ckeditor5-engine/src/conversion/conversion.js");
  15979. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Conversion", function() { return _conversion_conversion__WEBPACK_IMPORTED_MODULE_3__["default"]; });
  15980. /* harmony import */ var _dataprocessor_htmldataprocessor__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./dataprocessor/htmldataprocessor */ "./node_modules/@ckeditor/ckeditor5-engine/src/dataprocessor/htmldataprocessor.js");
  15981. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "HtmlDataProcessor", function() { return _dataprocessor_htmldataprocessor__WEBPACK_IMPORTED_MODULE_4__["default"]; });
  15982. /* harmony import */ var _model_operation_insertoperation__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./model/operation/insertoperation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/insertoperation.js");
  15983. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "InsertOperation", function() { return _model_operation_insertoperation__WEBPACK_IMPORTED_MODULE_5__["default"]; });
  15984. /* harmony import */ var _model_operation_markeroperation__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./model/operation/markeroperation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/markeroperation.js");
  15985. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MarkerOperation", function() { return _model_operation_markeroperation__WEBPACK_IMPORTED_MODULE_6__["default"]; });
  15986. /* harmony import */ var _model_operation_operationfactory__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./model/operation/operationfactory */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/operationfactory.js");
  15987. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "OperationFactory", function() { return _model_operation_operationfactory__WEBPACK_IMPORTED_MODULE_7__["default"]; });
  15988. /* harmony import */ var _model_operation_transform__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./model/operation/transform */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/transform.js");
  15989. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "transformSets", function() { return _model_operation_transform__WEBPACK_IMPORTED_MODULE_8__["transformSets"]; });
  15990. /* harmony import */ var _model_documentselection__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./model/documentselection */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/documentselection.js");
  15991. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DocumentSelection", function() { return _model_documentselection__WEBPACK_IMPORTED_MODULE_9__["default"]; });
  15992. /* harmony import */ var _model_range__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./model/range */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/range.js");
  15993. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Range", function() { return _model_range__WEBPACK_IMPORTED_MODULE_10__["default"]; });
  15994. /* harmony import */ var _model_liverange__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./model/liverange */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/liverange.js");
  15995. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "LiveRange", function() { return _model_liverange__WEBPACK_IMPORTED_MODULE_11__["default"]; });
  15996. /* harmony import */ var _model_liveposition__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./model/liveposition */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/liveposition.js");
  15997. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "LivePosition", function() { return _model_liveposition__WEBPACK_IMPORTED_MODULE_12__["default"]; });
  15998. /* harmony import */ var _model_model__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./model/model */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/model.js");
  15999. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Model", function() { return _model_model__WEBPACK_IMPORTED_MODULE_13__["default"]; });
  16000. /* harmony import */ var _model_treewalker__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./model/treewalker */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/treewalker.js");
  16001. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TreeWalker", function() { return _model_treewalker__WEBPACK_IMPORTED_MODULE_14__["default"]; });
  16002. /* harmony import */ var _model_element__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./model/element */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/element.js");
  16003. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Element", function() { return _model_element__WEBPACK_IMPORTED_MODULE_15__["default"]; });
  16004. /* harmony import */ var _view_domconverter__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./view/domconverter */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/domconverter.js");
  16005. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DomConverter", function() { return _view_domconverter__WEBPACK_IMPORTED_MODULE_16__["default"]; });
  16006. /* harmony import */ var _view_document__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./view/document */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/document.js");
  16007. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ViewDocument", function() { return _view_document__WEBPACK_IMPORTED_MODULE_17__["default"]; });
  16008. /* harmony import */ var _view_containerelement__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./view/containerelement */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/containerelement.js");
  16009. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getFillerOffset", function() { return _view_containerelement__WEBPACK_IMPORTED_MODULE_18__["getFillerOffset"]; });
  16010. /* harmony import */ var _view_observer_observer__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./view/observer/observer */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/observer.js");
  16011. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Observer", function() { return _view_observer_observer__WEBPACK_IMPORTED_MODULE_19__["default"]; });
  16012. /* harmony import */ var _view_observer_clickobserver__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./view/observer/clickobserver */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/clickobserver.js");
  16013. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ClickObserver", function() { return _view_observer_clickobserver__WEBPACK_IMPORTED_MODULE_20__["default"]; });
  16014. /* harmony import */ var _view_observer_domeventobserver__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./view/observer/domeventobserver */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/domeventobserver.js");
  16015. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DomEventObserver", function() { return _view_observer_domeventobserver__WEBPACK_IMPORTED_MODULE_21__["default"]; });
  16016. /* harmony import */ var _view_observer_mouseobserver__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./view/observer/mouseobserver */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/mouseobserver.js");
  16017. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MouseObserver", function() { return _view_observer_mouseobserver__WEBPACK_IMPORTED_MODULE_22__["default"]; });
  16018. /* harmony import */ var _view_downcastwriter__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./view/downcastwriter */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/downcastwriter.js");
  16019. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DowncastWriter", function() { return _view_downcastwriter__WEBPACK_IMPORTED_MODULE_23__["default"]; });
  16020. /* harmony import */ var _view_upcastwriter__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./view/upcastwriter */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/upcastwriter.js");
  16021. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "UpcastWriter", function() { return _view_upcastwriter__WEBPACK_IMPORTED_MODULE_24__["default"]; });
  16022. /* harmony import */ var _view_matcher__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./view/matcher */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/matcher.js");
  16023. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Matcher", function() { return _view_matcher__WEBPACK_IMPORTED_MODULE_25__["default"]; });
  16024. /* harmony import */ var _view_observer_domeventdata__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./view/observer/domeventdata */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/domeventdata.js");
  16025. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DomEventData", function() { return _view_observer_domeventdata__WEBPACK_IMPORTED_MODULE_26__["default"]; });
  16026. /* harmony import */ var _view_stylesmap__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./view/stylesmap */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/stylesmap.js");
  16027. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "StylesProcessor", function() { return _view_stylesmap__WEBPACK_IMPORTED_MODULE_27__["StylesProcessor"]; });
  16028. /* harmony import */ var _view_styles_background__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./view/styles/background */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/styles/background.js");
  16029. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "addBackgroundRules", function() { return _view_styles_background__WEBPACK_IMPORTED_MODULE_28__["addBackgroundRules"]; });
  16030. /* harmony import */ var _view_styles_border__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./view/styles/border */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/styles/border.js");
  16031. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "addBorderRules", function() { return _view_styles_border__WEBPACK_IMPORTED_MODULE_29__["addBorderRules"]; });
  16032. /* harmony import */ var _view_styles_margin__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./view/styles/margin */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/styles/margin.js");
  16033. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "addMarginRules", function() { return _view_styles_margin__WEBPACK_IMPORTED_MODULE_30__["addMarginRules"]; });
  16034. /* harmony import */ var _view_styles_padding__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ./view/styles/padding */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/styles/padding.js");
  16035. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "addPaddingRules", function() { return _view_styles_padding__WEBPACK_IMPORTED_MODULE_31__["addPaddingRules"]; });
  16036. /* harmony import */ var _view_styles_utils__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ./view/styles/utils */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/styles/utils.js");
  16037. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isColor", function() { return _view_styles_utils__WEBPACK_IMPORTED_MODULE_32__["isColor"]; });
  16038. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isLineStyle", function() { return _view_styles_utils__WEBPACK_IMPORTED_MODULE_32__["isLineStyle"]; });
  16039. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isLength", function() { return _view_styles_utils__WEBPACK_IMPORTED_MODULE_32__["isLength"]; });
  16040. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isPercentage", function() { return _view_styles_utils__WEBPACK_IMPORTED_MODULE_32__["isPercentage"]; });
  16041. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isRepeat", function() { return _view_styles_utils__WEBPACK_IMPORTED_MODULE_32__["isRepeat"]; });
  16042. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isPosition", function() { return _view_styles_utils__WEBPACK_IMPORTED_MODULE_32__["isPosition"]; });
  16043. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isAttachment", function() { return _view_styles_utils__WEBPACK_IMPORTED_MODULE_32__["isAttachment"]; });
  16044. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isURL", function() { return _view_styles_utils__WEBPACK_IMPORTED_MODULE_32__["isURL"]; });
  16045. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getBoxSidesValues", function() { return _view_styles_utils__WEBPACK_IMPORTED_MODULE_32__["getBoxSidesValues"]; });
  16046. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getBoxSidesValueReducer", function() { return _view_styles_utils__WEBPACK_IMPORTED_MODULE_32__["getBoxSidesValueReducer"]; });
  16047. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getBoxSidesShorthandValue", function() { return _view_styles_utils__WEBPACK_IMPORTED_MODULE_32__["getBoxSidesShorthandValue"]; });
  16048. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getPositionShorthandNormalizer", function() { return _view_styles_utils__WEBPACK_IMPORTED_MODULE_32__["getPositionShorthandNormalizer"]; });
  16049. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getShorthandValues", function() { return _view_styles_utils__WEBPACK_IMPORTED_MODULE_32__["getShorthandValues"]; });
  16050. /**
  16051. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  16052. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  16053. */
  16054. /**
  16055. * @module engine
  16056. */
  16057. /***/ }),
  16058. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/batch.js":
  16059. /*!********************************************************************!*\
  16060. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/batch.js ***!
  16061. \********************************************************************/
  16062. /*! exports provided: default */
  16063. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  16064. "use strict";
  16065. __webpack_require__.r(__webpack_exports__);
  16066. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Batch; });
  16067. /**
  16068. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  16069. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  16070. */
  16071. /**
  16072. * @module engine/model/batch
  16073. */
  16074. /**
  16075. * A batch instance groups model changes ({@link module:engine/model/operation/operation~Operation operations}). All operations
  16076. * 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
  16077. * to extend a given undo step, you can add more changes to the batch using {@link module:engine/model/model~Model#enqueueChange}:
  16078. *
  16079. * model.enqueueChange( batch, writer => {
  16080. * writer.insertText( 'foo', paragraph, 'end' );
  16081. * } );
  16082. *
  16083. * @see module:engine/model/model~Model#enqueueChange
  16084. * @see module:engine/model/model~Model#change
  16085. */
  16086. class Batch {
  16087. /**
  16088. * Creates a batch instance.
  16089. *
  16090. * @see module:engine/model/model~Model#enqueueChange
  16091. * @see module:engine/model/model~Model#change
  16092. * @param {'transparent'|'default'} [type='default'] The type of the batch.
  16093. */
  16094. constructor( type = 'default' ) {
  16095. /**
  16096. * An array of operations that compose this batch.
  16097. *
  16098. * @readonly
  16099. * @type {Array.<module:engine/model/operation/operation~Operation>}
  16100. */
  16101. this.operations = [];
  16102. /**
  16103. * The type of the batch.
  16104. *
  16105. * It can be one of the following values:
  16106. * * `'default'` &ndash; All "normal" batches. This is the most commonly used type.
  16107. * * `'transparent'` &ndash; A batch that should be ignored by other features, i.e. an initial batch or collaborative editing
  16108. * changes.
  16109. *
  16110. * @readonly
  16111. * @type {'transparent'|'default'}
  16112. */
  16113. this.type = type;
  16114. }
  16115. /**
  16116. * Returns the base version of this batch, which is equal to the base version of the first operation in the batch.
  16117. * If there are no operations in the batch or neither operation has the base version set, it returns `null`.
  16118. *
  16119. * @readonly
  16120. * @type {Number|null}
  16121. */
  16122. get baseVersion() {
  16123. for ( const op of this.operations ) {
  16124. if ( op.baseVersion !== null ) {
  16125. return op.baseVersion;
  16126. }
  16127. }
  16128. return null;
  16129. }
  16130. /**
  16131. * Adds an operation to the batch instance.
  16132. *
  16133. * @param {module:engine/model/operation/operation~Operation} operation An operation to add.
  16134. * @returns {module:engine/model/operation/operation~Operation} The added operation.
  16135. */
  16136. addOperation( operation ) {
  16137. operation.batch = this;
  16138. this.operations.push( operation );
  16139. return operation;
  16140. }
  16141. }
  16142. /***/ }),
  16143. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/differ.js":
  16144. /*!*********************************************************************!*\
  16145. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/differ.js ***!
  16146. \*********************************************************************/
  16147. /*! exports provided: default */
  16148. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  16149. "use strict";
  16150. __webpack_require__.r(__webpack_exports__);
  16151. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Differ; });
  16152. /* harmony import */ var _position__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./position */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/position.js");
  16153. /* harmony import */ var _range__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./range */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/range.js");
  16154. /**
  16155. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  16156. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  16157. */
  16158. /**
  16159. * @module engine/model/differ
  16160. */
  16161. /**
  16162. * Calculates the difference between two model states.
  16163. *
  16164. * Receives operations that are to be applied on the model document. Marks parts of the model document tree which
  16165. * are changed and saves the state of these elements before the change. Then, it compares saved elements with the
  16166. * changed elements, after all changes are applied on the model document. Calculates the diff between saved
  16167. * elements and new ones and returns a change set.
  16168. */
  16169. class Differ {
  16170. /**
  16171. * Creates a `Differ` instance.
  16172. *
  16173. * @param {module:engine/model/markercollection~MarkerCollection} markerCollection Model's marker collection.
  16174. */
  16175. constructor( markerCollection ) {
  16176. /**
  16177. * Reference to the model's marker collection.
  16178. *
  16179. * @private
  16180. * @type {module:engine/model/markercollection~MarkerCollection}
  16181. */
  16182. this._markerCollection = markerCollection;
  16183. /**
  16184. * A map that stores changes that happened in a given element.
  16185. *
  16186. * The keys of the map are references to the model elements.
  16187. * The values of the map are arrays with changes that were done on this element.
  16188. *
  16189. * @private
  16190. * @type {Map}
  16191. */
  16192. this._changesInElement = new Map();
  16193. /**
  16194. * A map that stores "element's children snapshots". A snapshot is representing children of a given element before
  16195. * the first change was applied on that element. Snapshot items are objects with two properties: `name`,
  16196. * containing the element name (or `'$text'` for a text node) and `attributes` which is a map of the node's attributes.
  16197. *
  16198. * @private
  16199. * @type {Map}
  16200. */
  16201. this._elementSnapshots = new Map();
  16202. /**
  16203. * A map that stores all changed markers.
  16204. *
  16205. * The keys of the map are marker names.
  16206. * The values of the map are objects with the `oldRange` and `newRange` properties. They store the marker range
  16207. * state before and after the change.
  16208. *
  16209. * @private
  16210. * @type {Map}
  16211. */
  16212. this._changedMarkers = new Map();
  16213. /**
  16214. * Stores the number of changes that were processed. Used to order the changes chronologically. It is important
  16215. * when changes are sorted.
  16216. *
  16217. * @private
  16218. * @type {Number}
  16219. */
  16220. this._changeCount = 0;
  16221. /**
  16222. * For efficiency purposes, `Differ` stores the change set returned by the differ after {@link #getChanges} call.
  16223. * Cache is reset each time a new operation is buffered. If the cache has not been reset, {@link #getChanges} will
  16224. * return the cached value instead of calculating it again.
  16225. *
  16226. * This property stores those changes that did not take place in graveyard root.
  16227. *
  16228. * @private
  16229. * @type {Array.<Object>|null}
  16230. */
  16231. this._cachedChanges = null;
  16232. /**
  16233. * For efficiency purposes, `Differ` stores the change set returned by the differ after the {@link #getChanges} call.
  16234. * The cache is reset each time a new operation is buffered. If the cache has not been reset, {@link #getChanges} will
  16235. * return the cached value instead of calculating it again.
  16236. *
  16237. * This property stores all changes evaluated by `Differ`, including those that took place in the graveyard.
  16238. *
  16239. * @private
  16240. * @type {Array.<Object>|null}
  16241. */
  16242. this._cachedChangesWithGraveyard = null;
  16243. }
  16244. /**
  16245. * Informs whether there are any changes buffered in `Differ`.
  16246. *
  16247. * @readonly
  16248. * @type {Boolean}
  16249. */
  16250. get isEmpty() {
  16251. return this._changesInElement.size == 0 && this._changedMarkers.size == 0;
  16252. }
  16253. /**
  16254. * Marks given `item` in differ to be "refreshed". It means that the item will be marked as removed and inserted in the differ changes
  16255. * set, so it will be effectively re-converted when differ changes will be handled by a dispatcher.
  16256. *
  16257. * @param {module:engine/model/item~Item} item Item to refresh.
  16258. */
  16259. refreshItem( item ) {
  16260. if ( this._isInInsertedElement( item.parent ) ) {
  16261. return;
  16262. }
  16263. this._markRemove( item.parent, item.startOffset, item.offsetSize );
  16264. this._markInsert( item.parent, item.startOffset, item.offsetSize );
  16265. const range = _range__WEBPACK_IMPORTED_MODULE_1__["default"]._createOn( item );
  16266. for ( const marker of this._markerCollection.getMarkersIntersectingRange( range ) ) {
  16267. const markerRange = marker.getRange();
  16268. this.bufferMarkerChange( marker.name, markerRange, markerRange, marker.affectsData );
  16269. }
  16270. // Clear cache after each buffered operation as it is no longer valid.
  16271. this._cachedChanges = null;
  16272. }
  16273. /**
  16274. * Buffers the given operation. An operation has to be buffered before it is executed.
  16275. *
  16276. * Operation type is checked and it is checked which nodes it will affect. These nodes are then stored in `Differ`
  16277. * in the state before the operation is executed.
  16278. *
  16279. * @param {module:engine/model/operation/operation~Operation} operation An operation to buffer.
  16280. */
  16281. bufferOperation( operation ) {
  16282. // Below we take an operation, check its type, then use its parameters in marking (private) methods.
  16283. // The general rule is to not mark elements inside inserted element. All inserted elements are re-rendered.
  16284. // Marking changes in them would cause a "double" changing then.
  16285. //
  16286. switch ( operation.type ) {
  16287. case 'insert': {
  16288. if ( this._isInInsertedElement( operation.position.parent ) ) {
  16289. return;
  16290. }
  16291. this._markInsert( operation.position.parent, operation.position.offset, operation.nodes.maxOffset );
  16292. break;
  16293. }
  16294. case 'addAttribute':
  16295. case 'removeAttribute':
  16296. case 'changeAttribute': {
  16297. for ( const item of operation.range.getItems( { shallow: true } ) ) {
  16298. if ( this._isInInsertedElement( item.parent ) ) {
  16299. continue;
  16300. }
  16301. this._markAttribute( item );
  16302. }
  16303. break;
  16304. }
  16305. case 'remove':
  16306. case 'move':
  16307. case 'reinsert': {
  16308. // When range is moved to the same position then not mark it as a change.
  16309. // See: https://github.com/ckeditor/ckeditor5-engine/issues/1664.
  16310. if (
  16311. operation.sourcePosition.isEqual( operation.targetPosition ) ||
  16312. operation.sourcePosition.getShiftedBy( operation.howMany ).isEqual( operation.targetPosition )
  16313. ) {
  16314. return;
  16315. }
  16316. const sourceParentInserted = this._isInInsertedElement( operation.sourcePosition.parent );
  16317. const targetParentInserted = this._isInInsertedElement( operation.targetPosition.parent );
  16318. if ( !sourceParentInserted ) {
  16319. this._markRemove( operation.sourcePosition.parent, operation.sourcePosition.offset, operation.howMany );
  16320. }
  16321. if ( !targetParentInserted ) {
  16322. this._markInsert( operation.targetPosition.parent, operation.getMovedRangeStart().offset, operation.howMany );
  16323. }
  16324. break;
  16325. }
  16326. case 'rename': {
  16327. if ( this._isInInsertedElement( operation.position.parent ) ) {
  16328. return;
  16329. }
  16330. this._markRemove( operation.position.parent, operation.position.offset, 1 );
  16331. this._markInsert( operation.position.parent, operation.position.offset, 1 );
  16332. const range = _range__WEBPACK_IMPORTED_MODULE_1__["default"]._createFromPositionAndShift( operation.position, 1 );
  16333. for ( const marker of this._markerCollection.getMarkersIntersectingRange( range ) ) {
  16334. const markerRange = marker.getRange();
  16335. this.bufferMarkerChange( marker.name, markerRange, markerRange, marker.affectsData );
  16336. }
  16337. break;
  16338. }
  16339. case 'split': {
  16340. const splitElement = operation.splitPosition.parent;
  16341. // Mark that children of the split element were removed.
  16342. if ( !this._isInInsertedElement( splitElement ) ) {
  16343. this._markRemove( splitElement, operation.splitPosition.offset, operation.howMany );
  16344. }
  16345. // Mark that the new element (split copy) was inserted.
  16346. if ( !this._isInInsertedElement( operation.insertionPosition.parent ) ) {
  16347. this._markInsert( operation.insertionPosition.parent, operation.insertionPosition.offset, 1 );
  16348. }
  16349. // If the split took the element from the graveyard, mark that the element from the graveyard was removed.
  16350. if ( operation.graveyardPosition ) {
  16351. this._markRemove( operation.graveyardPosition.parent, operation.graveyardPosition.offset, 1 );
  16352. }
  16353. break;
  16354. }
  16355. case 'merge': {
  16356. // Mark that the merged element was removed.
  16357. const mergedElement = operation.sourcePosition.parent;
  16358. if ( !this._isInInsertedElement( mergedElement.parent ) ) {
  16359. this._markRemove( mergedElement.parent, mergedElement.startOffset, 1 );
  16360. }
  16361. // Mark that the merged element was inserted into graveyard.
  16362. const graveyardParent = operation.graveyardPosition.parent;
  16363. this._markInsert( graveyardParent, operation.graveyardPosition.offset, 1 );
  16364. // Mark that children of merged element were inserted at new parent.
  16365. const mergedIntoElement = operation.targetPosition.parent;
  16366. if ( !this._isInInsertedElement( mergedIntoElement ) ) {
  16367. this._markInsert( mergedIntoElement, operation.targetPosition.offset, mergedElement.maxOffset );
  16368. }
  16369. break;
  16370. }
  16371. }
  16372. // Clear cache after each buffered operation as it is no longer valid.
  16373. this._cachedChanges = null;
  16374. }
  16375. /**
  16376. * Buffers a marker change.
  16377. *
  16378. * @param {String} markerName The name of the marker that changed.
  16379. * @param {module:engine/model/range~Range|null} oldRange Marker range before the change or `null` if the marker has just
  16380. * been created.
  16381. * @param {module:engine/model/range~Range|null} newRange Marker range after the change or `null` if the marker was removed.
  16382. * @param {Boolean} affectsData Flag indicating whether marker affects the editor data.
  16383. */
  16384. bufferMarkerChange( markerName, oldRange, newRange, affectsData ) {
  16385. const buffered = this._changedMarkers.get( markerName );
  16386. if ( !buffered ) {
  16387. this._changedMarkers.set( markerName, {
  16388. oldRange,
  16389. newRange,
  16390. affectsData
  16391. } );
  16392. } else {
  16393. buffered.newRange = newRange;
  16394. buffered.affectsData = affectsData;
  16395. if ( buffered.oldRange == null && buffered.newRange == null ) {
  16396. // The marker is going to be removed (`newRange == null`) but it did not exist before the first buffered change
  16397. // (`buffered.oldRange == null`). In this case, do not keep the marker in buffer at all.
  16398. this._changedMarkers.delete( markerName );
  16399. }
  16400. }
  16401. }
  16402. /**
  16403. * Returns all markers that should be removed as a result of buffered changes.
  16404. *
  16405. * @returns {Array.<Object>} Markers to remove. Each array item is an object containing the `name` and `range` properties.
  16406. */
  16407. getMarkersToRemove() {
  16408. const result = [];
  16409. for ( const [ name, change ] of this._changedMarkers ) {
  16410. if ( change.oldRange != null ) {
  16411. result.push( { name, range: change.oldRange } );
  16412. }
  16413. }
  16414. return result;
  16415. }
  16416. /**
  16417. * Returns all markers which should be added as a result of buffered changes.
  16418. *
  16419. * @returns {Array.<Object>} Markers to add. Each array item is an object containing the `name` and `range` properties.
  16420. */
  16421. getMarkersToAdd() {
  16422. const result = [];
  16423. for ( const [ name, change ] of this._changedMarkers ) {
  16424. if ( change.newRange != null ) {
  16425. result.push( { name, range: change.newRange } );
  16426. }
  16427. }
  16428. return result;
  16429. }
  16430. /**
  16431. * Returns all markers which changed.
  16432. *
  16433. * @returns {Array.<Object>}
  16434. */
  16435. getChangedMarkers() {
  16436. return Array.from( this._changedMarkers ).map( item => (
  16437. {
  16438. name: item[ 0 ],
  16439. data: {
  16440. oldRange: item[ 1 ].oldRange,
  16441. newRange: item[ 1 ].newRange
  16442. }
  16443. }
  16444. ) );
  16445. }
  16446. /**
  16447. * Checks whether some of the buffered changes affect the editor data.
  16448. *
  16449. * Types of changes which affect the editor data:
  16450. *
  16451. * * model structure changes,
  16452. * * attribute changes,
  16453. * * changes of markers which were defined as `affectingData`.
  16454. *
  16455. * @returns {Boolean}
  16456. */
  16457. hasDataChanges() {
  16458. for ( const [ , change ] of this._changedMarkers ) {
  16459. if ( change.affectsData ) {
  16460. return true;
  16461. }
  16462. }
  16463. // If markers do not affect the data, check whether there are some changes in elements.
  16464. return this._changesInElement.size > 0;
  16465. }
  16466. /**
  16467. * Calculates the diff between the old model tree state (the state before the first buffered operations since the last {@link #reset}
  16468. * call) and the new model tree state (actual one). It should be called after all buffered operations are executed.
  16469. *
  16470. * The diff set is returned as an array of {@link module:engine/model/differ~DiffItem diff items}, each describing a change done
  16471. * on the model. The items are sorted by the position on which the change happened. If a position
  16472. * {@link module:engine/model/position~Position#isBefore is before} another one, it will be on an earlier index in the diff set.
  16473. *
  16474. * **Note**: Elements inside inserted element will not have a separate diff item, only the top most element change will be reported.
  16475. *
  16476. * Because calculating the diff is a costly operation, the result is cached. If no new operation was buffered since the
  16477. * previous {@link #getChanges} call, the next call will return the cached value.
  16478. *
  16479. * @param {Object} options Additional options.
  16480. * @param {Boolean} [options.includeChangesInGraveyard=false] If set to `true`, also changes that happened
  16481. * in the graveyard root will be returned. By default, changes in the graveyard root are not returned.
  16482. * @returns {Array.<module:engine/model/differ~DiffItem>} Diff between the old and the new model tree state.
  16483. */
  16484. getChanges( options = { includeChangesInGraveyard: false } ) {
  16485. // If there are cached changes, just return them instead of calculating changes again.
  16486. if ( this._cachedChanges ) {
  16487. if ( options.includeChangesInGraveyard ) {
  16488. return this._cachedChangesWithGraveyard.slice();
  16489. } else {
  16490. return this._cachedChanges.slice();
  16491. }
  16492. }
  16493. // Will contain returned results.
  16494. let diffSet = [];
  16495. // Check all changed elements.
  16496. for ( const element of this._changesInElement.keys() ) {
  16497. // Get changes for this element and sort them.
  16498. const changes = this._changesInElement.get( element ).sort( ( a, b ) => {
  16499. if ( a.offset === b.offset ) {
  16500. if ( a.type != b.type ) {
  16501. // If there are multiple changes at the same position, "remove" change should be first.
  16502. // If the order is different, for example, we would first add some nodes and then removed them
  16503. // (instead of the nodes that we should remove).
  16504. return a.type == 'remove' ? -1 : 1;
  16505. }
  16506. return 0;
  16507. }
  16508. return a.offset < b.offset ? -1 : 1;
  16509. } );
  16510. // Get children of this element before any change was applied on it.
  16511. const snapshotChildren = this._elementSnapshots.get( element );
  16512. // Get snapshot of current element's children.
  16513. const elementChildren = _getChildrenSnapshot( element.getChildren() );
  16514. // Generate actions basing on changes done on element.
  16515. const actions = _generateActionsFromChanges( snapshotChildren.length, changes );
  16516. let i = 0; // Iterator in `elementChildren` array -- iterates through current children of element.
  16517. let j = 0; // Iterator in `snapshotChildren` array -- iterates through old children of element.
  16518. // Process every action.
  16519. for ( const action of actions ) {
  16520. if ( action === 'i' ) {
  16521. // Generate diff item for this element and insert it into the diff set.
  16522. diffSet.push( this._getInsertDiff( element, i, elementChildren[ i ].name ) );
  16523. i++;
  16524. } else if ( action === 'r' ) {
  16525. // Generate diff item for this element and insert it into the diff set.
  16526. diffSet.push( this._getRemoveDiff( element, i, snapshotChildren[ j ].name ) );
  16527. j++;
  16528. } else if ( action === 'a' ) {
  16529. // Take attributes from saved and current children.
  16530. const elementAttributes = elementChildren[ i ].attributes;
  16531. const snapshotAttributes = snapshotChildren[ j ].attributes;
  16532. let range;
  16533. if ( elementChildren[ i ].name == '$text' ) {
  16534. 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 ) );
  16535. } else {
  16536. const index = element.offsetToIndex( i );
  16537. 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 ) );
  16538. }
  16539. // Generate diff items for this change (there might be multiple attributes changed and
  16540. // there is a single diff for each of them) and insert them into the diff set.
  16541. diffSet.push( ...this._getAttributesDiff( range, snapshotAttributes, elementAttributes ) );
  16542. i++;
  16543. j++;
  16544. } else {
  16545. // `action` is 'equal'. Child not changed.
  16546. i++;
  16547. j++;
  16548. }
  16549. }
  16550. }
  16551. // Then, sort the changes by the position (change at position before other changes is first).
  16552. diffSet.sort( ( a, b ) => {
  16553. // If the change is in different root, we don't care much, but we'd like to have all changes in given
  16554. // root "together" in the array. So let's just sort them by the root name. It does not matter which root
  16555. // will be processed first.
  16556. if ( a.position.root != b.position.root ) {
  16557. return a.position.root.rootName < b.position.root.rootName ? -1 : 1;
  16558. }
  16559. // If change happens at the same position...
  16560. if ( a.position.isEqual( b.position ) ) {
  16561. // Keep chronological order of operations.
  16562. return a.changeCount - b.changeCount;
  16563. }
  16564. // If positions differ, position "on the left" should be earlier in the result.
  16565. return a.position.isBefore( b.position ) ? -1 : 1;
  16566. } );
  16567. // Glue together multiple changes (mostly on text nodes).
  16568. for ( let i = 1, prevIndex = 0; i < diffSet.length; i++ ) {
  16569. const prevDiff = diffSet[ prevIndex ];
  16570. const thisDiff = diffSet[ i ];
  16571. // Glue remove changes if they happen on text on same position.
  16572. const isConsecutiveTextRemove =
  16573. prevDiff.type == 'remove' && thisDiff.type == 'remove' &&
  16574. prevDiff.name == '$text' && thisDiff.name == '$text' &&
  16575. prevDiff.position.isEqual( thisDiff.position );
  16576. // Glue insert changes if they happen on text on consecutive fragments.
  16577. const isConsecutiveTextAdd =
  16578. prevDiff.type == 'insert' && thisDiff.type == 'insert' &&
  16579. prevDiff.name == '$text' && thisDiff.name == '$text' &&
  16580. prevDiff.position.parent == thisDiff.position.parent &&
  16581. prevDiff.position.offset + prevDiff.length == thisDiff.position.offset;
  16582. // Glue attribute changes if they happen on consecutive fragments and have same key, old value and new value.
  16583. const isConsecutiveAttributeChange =
  16584. prevDiff.type == 'attribute' && thisDiff.type == 'attribute' &&
  16585. prevDiff.position.parent == thisDiff.position.parent &&
  16586. prevDiff.range.isFlat && thisDiff.range.isFlat &&
  16587. prevDiff.position.offset + prevDiff.length == thisDiff.position.offset &&
  16588. prevDiff.attributeKey == thisDiff.attributeKey &&
  16589. prevDiff.attributeOldValue == thisDiff.attributeOldValue &&
  16590. prevDiff.attributeNewValue == thisDiff.attributeNewValue;
  16591. if ( isConsecutiveTextRemove || isConsecutiveTextAdd || isConsecutiveAttributeChange ) {
  16592. prevDiff.length++;
  16593. if ( isConsecutiveAttributeChange ) {
  16594. prevDiff.range.end = prevDiff.range.end.getShiftedBy( 1 );
  16595. }
  16596. diffSet[ i ] = null;
  16597. } else {
  16598. prevIndex = i;
  16599. }
  16600. }
  16601. diffSet = diffSet.filter( v => v );
  16602. // Remove `changeCount` property from diff items. It is used only for sorting and is internal thing.
  16603. for ( const item of diffSet ) {
  16604. delete item.changeCount;
  16605. if ( item.type == 'attribute' ) {
  16606. delete item.position;
  16607. delete item.length;
  16608. }
  16609. }
  16610. this._changeCount = 0;
  16611. // Cache changes.
  16612. this._cachedChangesWithGraveyard = diffSet.slice();
  16613. this._cachedChanges = diffSet.filter( _changesInGraveyardFilter );
  16614. if ( options.includeChangesInGraveyard ) {
  16615. return this._cachedChangesWithGraveyard;
  16616. } else {
  16617. return this._cachedChanges;
  16618. }
  16619. }
  16620. /**
  16621. * Resets `Differ`. Removes all buffered changes.
  16622. */
  16623. reset() {
  16624. this._changesInElement.clear();
  16625. this._elementSnapshots.clear();
  16626. this._changedMarkers.clear();
  16627. this._cachedChanges = null;
  16628. }
  16629. /**
  16630. * Saves and handles an insert change.
  16631. *
  16632. * @private
  16633. * @param {module:engine/model/element~Element} parent
  16634. * @param {Number} offset
  16635. * @param {Number} howMany
  16636. */
  16637. _markInsert( parent, offset, howMany ) {
  16638. const changeItem = { type: 'insert', offset, howMany, count: this._changeCount++ };
  16639. this._markChange( parent, changeItem );
  16640. }
  16641. /**
  16642. * Saves and handles a remove change.
  16643. *
  16644. * @private
  16645. * @param {module:engine/model/element~Element} parent
  16646. * @param {Number} offset
  16647. * @param {Number} howMany
  16648. */
  16649. _markRemove( parent, offset, howMany ) {
  16650. const changeItem = { type: 'remove', offset, howMany, count: this._changeCount++ };
  16651. this._markChange( parent, changeItem );
  16652. this._removeAllNestedChanges( parent, offset, howMany );
  16653. }
  16654. /**
  16655. * Saves and handles an attribute change.
  16656. *
  16657. * @private
  16658. * @param {module:engine/model/item~Item} item
  16659. */
  16660. _markAttribute( item ) {
  16661. const changeItem = { type: 'attribute', offset: item.startOffset, howMany: item.offsetSize, count: this._changeCount++ };
  16662. this._markChange( item.parent, changeItem );
  16663. }
  16664. /**
  16665. * Saves and handles a model change.
  16666. *
  16667. * @private
  16668. * @param {module:engine/model/element~Element} parent
  16669. * @param {Object} changeItem
  16670. */
  16671. _markChange( parent, changeItem ) {
  16672. // First, make a snapshot of this parent's children (it will be made only if it was not made before).
  16673. this._makeSnapshot( parent );
  16674. // Then, get all changes that already were done on the element (empty array if this is the first change).
  16675. const changes = this._getChangesForElement( parent );
  16676. // Then, look through all the changes, and transform them or the new change.
  16677. this._handleChange( changeItem, changes );
  16678. // Add the new change.
  16679. changes.push( changeItem );
  16680. // Remove incorrect changes. During transformation some change might be, for example, included in another.
  16681. // In that case, the change will have `howMany` property set to `0` or less. We need to remove those changes.
  16682. for ( let i = 0; i < changes.length; i++ ) {
  16683. if ( changes[ i ].howMany < 1 ) {
  16684. changes.splice( i, 1 );
  16685. i--;
  16686. }
  16687. }
  16688. }
  16689. /**
  16690. * Gets an array of changes that have already been saved for a given element.
  16691. *
  16692. * @private
  16693. * @param {module:engine/model/element~Element} element
  16694. * @returns {Array.<Object>}
  16695. */
  16696. _getChangesForElement( element ) {
  16697. let changes;
  16698. if ( this._changesInElement.has( element ) ) {
  16699. changes = this._changesInElement.get( element );
  16700. } else {
  16701. changes = [];
  16702. this._changesInElement.set( element, changes );
  16703. }
  16704. return changes;
  16705. }
  16706. /**
  16707. * Saves a children snapshot for a given element.
  16708. *
  16709. * @private
  16710. * @param {module:engine/model/element~Element} element
  16711. */
  16712. _makeSnapshot( element ) {
  16713. if ( !this._elementSnapshots.has( element ) ) {
  16714. this._elementSnapshots.set( element, _getChildrenSnapshot( element.getChildren() ) );
  16715. }
  16716. }
  16717. /**
  16718. * For a given newly saved change, compares it with a change already done on the element and modifies the incoming
  16719. * change and/or the old change.
  16720. *
  16721. * @private
  16722. * @param {Object} inc Incoming (new) change.
  16723. * @param {Array.<Object>} changes An array containing all the changes done on that element.
  16724. */
  16725. _handleChange( inc, changes ) {
  16726. // We need a helper variable that will store how many nodes are to be still handled for this change item.
  16727. // `nodesToHandle` (how many nodes still need to be handled) and `howMany` (how many nodes were affected)
  16728. // needs to be differentiated.
  16729. //
  16730. // This comes up when there are multiple changes that are affected by `inc` change item.
  16731. //
  16732. // For example: assume two insert changes: `{ offset: 2, howMany: 1 }` and `{ offset: 5, howMany: 1 }`.
  16733. // Assume that `inc` change is remove `{ offset: 2, howMany: 2, nodesToHandle: 2 }`.
  16734. //
  16735. // Then, we:
  16736. // - "forget" about first insert change (it is "eaten" by remove),
  16737. // - because of that, at the end we will want to remove only one node (`nodesToHandle = 1`),
  16738. // - but still we have to change offset of the second insert change from `5` to `3`!
  16739. //
  16740. // So, `howMany` does not change throughout items transformation and keeps information about how many nodes were affected,
  16741. // while `nodesToHandle` means how many nodes need to be handled after the change item is transformed by other changes.
  16742. inc.nodesToHandle = inc.howMany;
  16743. for ( const old of changes ) {
  16744. const incEnd = inc.offset + inc.howMany;
  16745. const oldEnd = old.offset + old.howMany;
  16746. if ( inc.type == 'insert' ) {
  16747. if ( old.type == 'insert' ) {
  16748. if ( inc.offset <= old.offset ) {
  16749. old.offset += inc.howMany;
  16750. } else if ( inc.offset < oldEnd ) {
  16751. old.howMany += inc.nodesToHandle;
  16752. inc.nodesToHandle = 0;
  16753. }
  16754. }
  16755. if ( old.type == 'remove' ) {
  16756. if ( inc.offset < old.offset ) {
  16757. old.offset += inc.howMany;
  16758. }
  16759. }
  16760. if ( old.type == 'attribute' ) {
  16761. if ( inc.offset <= old.offset ) {
  16762. old.offset += inc.howMany;
  16763. } else if ( inc.offset < oldEnd ) {
  16764. // This case is more complicated, because attribute change has to be split into two.
  16765. // Example (assume that uppercase and lowercase letters mean different attributes):
  16766. //
  16767. // initial state: abcxyz
  16768. // attribute change: aBCXYz
  16769. // incoming insert: aBCfooXYz
  16770. //
  16771. // Change ranges cannot intersect because each item has to be described exactly (it was either
  16772. // not changed, inserted, removed, or its attribute was changed). That's why old attribute
  16773. // change has to be split and both parts has to be handled separately from now on.
  16774. const howMany = old.howMany;
  16775. old.howMany = inc.offset - old.offset;
  16776. // Add the second part of attribute change to the beginning of processed array so it won't
  16777. // be processed again in this loop.
  16778. changes.unshift( {
  16779. type: 'attribute',
  16780. offset: incEnd,
  16781. howMany: howMany - old.howMany,
  16782. count: this._changeCount++
  16783. } );
  16784. }
  16785. }
  16786. }
  16787. if ( inc.type == 'remove' ) {
  16788. if ( old.type == 'insert' ) {
  16789. if ( incEnd <= old.offset ) {
  16790. old.offset -= inc.howMany;
  16791. } else if ( incEnd <= oldEnd ) {
  16792. if ( inc.offset < old.offset ) {
  16793. const intersectionLength = incEnd - old.offset;
  16794. old.offset = inc.offset;
  16795. old.howMany -= intersectionLength;
  16796. inc.nodesToHandle -= intersectionLength;
  16797. } else {
  16798. old.howMany -= inc.nodesToHandle;
  16799. inc.nodesToHandle = 0;
  16800. }
  16801. } else {
  16802. if ( inc.offset <= old.offset ) {
  16803. inc.nodesToHandle -= old.howMany;
  16804. old.howMany = 0;
  16805. } else if ( inc.offset < oldEnd ) {
  16806. const intersectionLength = oldEnd - inc.offset;
  16807. old.howMany -= intersectionLength;
  16808. inc.nodesToHandle -= intersectionLength;
  16809. }
  16810. }
  16811. }
  16812. if ( old.type == 'remove' ) {
  16813. if ( incEnd <= old.offset ) {
  16814. old.offset -= inc.howMany;
  16815. } else if ( inc.offset < old.offset ) {
  16816. inc.nodesToHandle += old.howMany;
  16817. old.howMany = 0;
  16818. }
  16819. }
  16820. if ( old.type == 'attribute' ) {
  16821. if ( incEnd <= old.offset ) {
  16822. old.offset -= inc.howMany;
  16823. } else if ( inc.offset < old.offset ) {
  16824. const intersectionLength = incEnd - old.offset;
  16825. old.offset = inc.offset;
  16826. old.howMany -= intersectionLength;
  16827. } else if ( inc.offset < oldEnd ) {
  16828. if ( incEnd <= oldEnd ) {
  16829. // On first sight in this case we don't need to split attribute operation into two.
  16830. // However the changes set is later converted to actions (see `_generateActionsFromChanges`).
  16831. // For that reason, no two changes may intersect.
  16832. // So we cannot have an attribute change that "contains" remove change.
  16833. // Attribute change needs to be split.
  16834. const howMany = old.howMany;
  16835. old.howMany = inc.offset - old.offset;
  16836. const howManyAfter = howMany - old.howMany - inc.nodesToHandle;
  16837. // Add the second part of attribute change to the beginning of processed array so it won't
  16838. // be processed again in this loop.
  16839. changes.unshift( {
  16840. type: 'attribute',
  16841. offset: inc.offset,
  16842. howMany: howManyAfter,
  16843. count: this._changeCount++
  16844. } );
  16845. } else {
  16846. old.howMany -= oldEnd - inc.offset;
  16847. }
  16848. }
  16849. }
  16850. }
  16851. if ( inc.type == 'attribute' ) {
  16852. // In case of attribute change, `howMany` should be kept same as `nodesToHandle`. It's not an error.
  16853. if ( old.type == 'insert' ) {
  16854. if ( inc.offset < old.offset && incEnd > old.offset ) {
  16855. if ( incEnd > oldEnd ) {
  16856. // This case is similar to a case described when incoming change was insert and old change was attribute.
  16857. // See comment above.
  16858. //
  16859. // This time incoming change is attribute. We need to split incoming change in this case too.
  16860. // However this time, the second part of the attribute change needs to be processed further
  16861. // because there might be other changes that it collides with.
  16862. const attributePart = {
  16863. type: 'attribute',
  16864. offset: oldEnd,
  16865. howMany: incEnd - oldEnd,
  16866. count: this._changeCount++
  16867. };
  16868. this._handleChange( attributePart, changes );
  16869. changes.push( attributePart );
  16870. }
  16871. inc.nodesToHandle = old.offset - inc.offset;
  16872. inc.howMany = inc.nodesToHandle;
  16873. } else if ( inc.offset >= old.offset && inc.offset < oldEnd ) {
  16874. if ( incEnd > oldEnd ) {
  16875. inc.nodesToHandle = incEnd - oldEnd;
  16876. inc.offset = oldEnd;
  16877. } else {
  16878. inc.nodesToHandle = 0;
  16879. }
  16880. }
  16881. }
  16882. if ( old.type == 'remove' ) {
  16883. // This is a case when attribute change "contains" remove change.
  16884. // The attribute change needs to be split into two because changes cannot intersect.
  16885. if ( inc.offset < old.offset && incEnd > old.offset ) {
  16886. const attributePart = {
  16887. type: 'attribute',
  16888. offset: old.offset,
  16889. howMany: incEnd - old.offset,
  16890. count: this._changeCount++
  16891. };
  16892. this._handleChange( attributePart, changes );
  16893. changes.push( attributePart );
  16894. inc.nodesToHandle = old.offset - inc.offset;
  16895. inc.howMany = inc.nodesToHandle;
  16896. }
  16897. }
  16898. if ( old.type == 'attribute' ) {
  16899. // There are only two conflicting scenarios possible here:
  16900. if ( inc.offset >= old.offset && incEnd <= oldEnd ) {
  16901. // `old` change includes `inc` change, or they are the same.
  16902. inc.nodesToHandle = 0;
  16903. inc.howMany = 0;
  16904. inc.offset = 0;
  16905. } else if ( inc.offset <= old.offset && incEnd >= oldEnd ) {
  16906. // `inc` change includes `old` change.
  16907. old.howMany = 0;
  16908. }
  16909. }
  16910. }
  16911. }
  16912. inc.howMany = inc.nodesToHandle;
  16913. delete inc.nodesToHandle;
  16914. }
  16915. /**
  16916. * Returns an object with a single insert change description.
  16917. *
  16918. * @private
  16919. * @param {module:engine/model/element~Element} parent The element in which the change happened.
  16920. * @param {Number} offset The offset at which change happened.
  16921. * @param {String} name The name of the removed element or `'$text'` for a character.
  16922. * @returns {Object} The diff item.
  16923. */
  16924. _getInsertDiff( parent, offset, name ) {
  16925. return {
  16926. type: 'insert',
  16927. position: _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createAt( parent, offset ),
  16928. name,
  16929. length: 1,
  16930. changeCount: this._changeCount++
  16931. };
  16932. }
  16933. /**
  16934. * Returns an object with a single remove change description.
  16935. *
  16936. * @private
  16937. * @param {module:engine/model/element~Element} parent The element in which change happened.
  16938. * @param {Number} offset The offset at which change happened.
  16939. * @param {String} name The name of the removed element or `'$text'` for a character.
  16940. * @returns {Object} The diff item.
  16941. */
  16942. _getRemoveDiff( parent, offset, name ) {
  16943. return {
  16944. type: 'remove',
  16945. position: _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createAt( parent, offset ),
  16946. name,
  16947. length: 1,
  16948. changeCount: this._changeCount++
  16949. };
  16950. }
  16951. /**
  16952. * Returns an array of objects where each one is a single attribute change description.
  16953. *
  16954. * @private
  16955. * @param {module:engine/model/range~Range} range The range where the change happened.
  16956. * @param {Map} oldAttributes A map, map iterator or compatible object that contains attributes before the change.
  16957. * @param {Map} newAttributes A map, map iterator or compatible object that contains attributes after the change.
  16958. * @returns {Array.<Object>} An array containing one or more diff items.
  16959. */
  16960. _getAttributesDiff( range, oldAttributes, newAttributes ) {
  16961. // Results holder.
  16962. const diffs = [];
  16963. // Clone new attributes as we will be performing changes on this object.
  16964. newAttributes = new Map( newAttributes );
  16965. // Look through old attributes.
  16966. for ( const [ key, oldValue ] of oldAttributes ) {
  16967. // Check what is the new value of the attribute (or if it was removed).
  16968. const newValue = newAttributes.has( key ) ? newAttributes.get( key ) : null;
  16969. // If values are different (or attribute was removed)...
  16970. if ( newValue !== oldValue ) {
  16971. // Add diff item.
  16972. diffs.push( {
  16973. type: 'attribute',
  16974. position: range.start,
  16975. range: range.clone(),
  16976. length: 1,
  16977. attributeKey: key,
  16978. attributeOldValue: oldValue,
  16979. attributeNewValue: newValue,
  16980. changeCount: this._changeCount++
  16981. } );
  16982. }
  16983. // Prevent returning two diff items for the same change.
  16984. newAttributes.delete( key );
  16985. }
  16986. // Look through new attributes that weren't handled above.
  16987. for ( const [ key, newValue ] of newAttributes ) {
  16988. // Each of them is a new attribute. Add diff item.
  16989. diffs.push( {
  16990. type: 'attribute',
  16991. position: range.start,
  16992. range: range.clone(),
  16993. length: 1,
  16994. attributeKey: key,
  16995. attributeOldValue: null,
  16996. attributeNewValue: newValue,
  16997. changeCount: this._changeCount++
  16998. } );
  16999. }
  17000. return diffs;
  17001. }
  17002. /**
  17003. * Checks whether given element or any of its parents is an element that is buffered as an inserted element.
  17004. *
  17005. * @private
  17006. * @param {module:engine/model/element~Element} element Element to check.
  17007. * @returns {Boolean}
  17008. */
  17009. _isInInsertedElement( element ) {
  17010. const parent = element.parent;
  17011. if ( !parent ) {
  17012. return false;
  17013. }
  17014. const changes = this._changesInElement.get( parent );
  17015. const offset = element.startOffset;
  17016. if ( changes ) {
  17017. for ( const change of changes ) {
  17018. if ( change.type == 'insert' && offset >= change.offset && offset < change.offset + change.howMany ) {
  17019. return true;
  17020. }
  17021. }
  17022. }
  17023. return this._isInInsertedElement( parent );
  17024. }
  17025. /**
  17026. * Removes deeply all buffered changes that are registered in elements from range specified by `parent`, `offset`
  17027. * and `howMany`.
  17028. *
  17029. * @private
  17030. * @param {module:engine/model/element~Element} parent
  17031. * @param {Number} offset
  17032. * @param {Number} howMany
  17033. */
  17034. _removeAllNestedChanges( parent, offset, howMany ) {
  17035. 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 ) );
  17036. for ( const item of range.getItems( { shallow: true } ) ) {
  17037. if ( item.is( 'element' ) ) {
  17038. this._elementSnapshots.delete( item );
  17039. this._changesInElement.delete( item );
  17040. this._removeAllNestedChanges( item, 0, item.maxOffset );
  17041. }
  17042. }
  17043. }
  17044. }
  17045. // Returns an array that is a copy of passed child list with the exception that text nodes are split to one or more
  17046. // objects, each representing one character and attributes set on that character.
  17047. function _getChildrenSnapshot( children ) {
  17048. const snapshot = [];
  17049. for ( const child of children ) {
  17050. if ( child.is( '$text' ) ) {
  17051. for ( let i = 0; i < child.data.length; i++ ) {
  17052. snapshot.push( {
  17053. name: '$text',
  17054. attributes: new Map( child.getAttributes() )
  17055. } );
  17056. }
  17057. } else {
  17058. snapshot.push( {
  17059. name: child.name,
  17060. attributes: new Map( child.getAttributes() )
  17061. } );
  17062. }
  17063. }
  17064. return snapshot;
  17065. }
  17066. // Generates array of actions for given changes set.
  17067. // It simulates what `diff` function does.
  17068. // Generated actions are:
  17069. // - 'e' for 'equal' - when item at that position did not change,
  17070. // - 'i' for 'insert' - when item at that position was inserted,
  17071. // - 'r' for 'remove' - when item at that position was removed,
  17072. // - 'a' for 'attribute' - when item at that position has it attributes changed.
  17073. //
  17074. // Example (assume that uppercase letters have bold attribute, compare with function code):
  17075. //
  17076. // children before: fooBAR
  17077. // children after: foxybAR
  17078. //
  17079. // changes: type: remove, offset: 1, howMany: 1
  17080. // type: insert, offset: 2, howMany: 2
  17081. // type: attribute, offset: 4, howMany: 1
  17082. //
  17083. // expected actions: equal (f), remove (o), equal (o), insert (x), insert (y), attribute (b), equal (A), equal (R)
  17084. //
  17085. // steps taken by th script:
  17086. //
  17087. // 1. change = "type: remove, offset: 1, howMany: 1"; offset = 0; oldChildrenHandled = 0
  17088. // 1.1 between this change and the beginning is one not-changed node, fill with one equal action, one old child has been handled
  17089. // 1.2 this change removes one node, add one remove action
  17090. // 1.3 change last visited `offset` to 1
  17091. // 1.4 since an old child has been removed, one more old child has been handled
  17092. // 1.5 actions at this point are: equal, remove
  17093. //
  17094. // 2. change = "type: insert, offset: 2, howMany: 2"; offset = 1; oldChildrenHandled = 2
  17095. // 2.1 between this change and previous change is one not-changed node, add equal action, another one old children has been handled
  17096. // 2.2 this change inserts two nodes, add two insert actions
  17097. // 2.3 change last visited offset to the end of the inserted range, that is 4
  17098. // 2.4 actions at this point are: equal, remove, equal, insert, insert
  17099. //
  17100. // 3. change = "type: attribute, offset: 4, howMany: 1"; offset = 4, oldChildrenHandled = 3
  17101. // 3.1 between this change and previous change are no not-changed nodes
  17102. // 3.2 this change changes one node, add one attribute action
  17103. // 3.3 change last visited `offset` to the end of change range, that is 5
  17104. // 3.4 since an old child has been changed, one more old child has been handled
  17105. // 3.5 actions at this point are: equal, remove, equal, insert, insert, attribute
  17106. //
  17107. // 4. after loop oldChildrenHandled = 4, oldChildrenLength = 6 (fooBAR is 6 characters)
  17108. // 4.1 fill up with two equal actions
  17109. //
  17110. // The result actions are: equal, remove, equal, insert, insert, attribute, equal, equal.
  17111. function _generateActionsFromChanges( oldChildrenLength, changes ) {
  17112. const actions = [];
  17113. let offset = 0;
  17114. let oldChildrenHandled = 0;
  17115. // Go through all buffered changes.
  17116. for ( const change of changes ) {
  17117. // First, fill "holes" between changes with "equal" actions.
  17118. if ( change.offset > offset ) {
  17119. for ( let i = 0; i < change.offset - offset; i++ ) {
  17120. actions.push( 'e' );
  17121. }
  17122. oldChildrenHandled += change.offset - offset;
  17123. }
  17124. // Then, fill up actions accordingly to change type.
  17125. if ( change.type == 'insert' ) {
  17126. for ( let i = 0; i < change.howMany; i++ ) {
  17127. actions.push( 'i' );
  17128. }
  17129. // The last handled offset is after inserted range.
  17130. offset = change.offset + change.howMany;
  17131. } else if ( change.type == 'remove' ) {
  17132. for ( let i = 0; i < change.howMany; i++ ) {
  17133. actions.push( 'r' );
  17134. }
  17135. // The last handled offset is at the position where the nodes were removed.
  17136. offset = change.offset;
  17137. // We removed `howMany` old nodes, update `oldChildrenHandled`.
  17138. oldChildrenHandled += change.howMany;
  17139. } else {
  17140. actions.push( ...'a'.repeat( change.howMany ).split( '' ) );
  17141. // The last handled offset is at the position after the changed range.
  17142. offset = change.offset + change.howMany;
  17143. // We changed `howMany` old nodes, update `oldChildrenHandled`.
  17144. oldChildrenHandled += change.howMany;
  17145. }
  17146. }
  17147. // Fill "equal" actions at the end of actions set. Use `oldChildrenHandled` to see how many children
  17148. // has not been changed / removed at the end of their parent.
  17149. if ( oldChildrenHandled < oldChildrenLength ) {
  17150. for ( let i = 0; i < oldChildrenLength - oldChildrenHandled - offset; i++ ) {
  17151. actions.push( 'e' );
  17152. }
  17153. }
  17154. return actions;
  17155. }
  17156. // Filter callback for Array.filter that filters out change entries that are in graveyard.
  17157. function _changesInGraveyardFilter( entry ) {
  17158. const posInGy = entry.position && entry.position.root.rootName == '$graveyard';
  17159. const rangeInGy = entry.range && entry.range.root.rootName == '$graveyard';
  17160. return !posInGy && !rangeInGy;
  17161. }
  17162. /**
  17163. * The single diff item.
  17164. *
  17165. * Could be one of:
  17166. *
  17167. * * {@link module:engine/model/differ~DiffItemInsert `DiffItemInsert`},
  17168. * * {@link module:engine/model/differ~DiffItemRemove `DiffItemRemove`},
  17169. * * {@link module:engine/model/differ~DiffItemAttribute `DiffItemAttribute`}.
  17170. *
  17171. * @interface DiffItem
  17172. */
  17173. /**
  17174. * The single diff item for inserted nodes.
  17175. *
  17176. * @class DiffItemInsert
  17177. * @implements module:engine/model/differ~DiffItem
  17178. */
  17179. /**
  17180. * The type of diff item.
  17181. *
  17182. * @member {'insert'} module:engine/model/differ~DiffItemInsert#type
  17183. */
  17184. /**
  17185. * The name of the inserted elements or `'$text'` for a text node.
  17186. *
  17187. * @member {String} module:engine/model/differ~DiffItemInsert#name
  17188. */
  17189. /**
  17190. * The position where the node was inserted.
  17191. *
  17192. * @member {module:engine/model/position~Position} module:engine/model/differ~DiffItemInsert#position
  17193. */
  17194. /**
  17195. * The length of an inserted text node. For elements it is always 1 as each inserted element is counted as a one.
  17196. *
  17197. * @member {Number} module:engine/model/differ~DiffItemInsert#length
  17198. */
  17199. /**
  17200. * The single diff item for removed nodes.
  17201. *
  17202. * @class DiffItemRemove
  17203. * @implements module:engine/model/differ~DiffItem
  17204. */
  17205. /**
  17206. * The type of diff item.
  17207. *
  17208. * @member {'remove'} module:engine/model/differ~DiffItemRemove#type
  17209. */
  17210. /**
  17211. * The name of the removed element or `'$text'` for a text node.
  17212. *
  17213. * @member {String} module:engine/model/differ~DiffItemRemove#name
  17214. */
  17215. /**
  17216. * The position where the node was removed.
  17217. *
  17218. * @member {module:engine/model/position~Position} module:engine/model/differ~DiffItemRemove#position
  17219. */
  17220. /**
  17221. * The length of a removed text node. For elements it is always 1 as each removed element is counted as a one.
  17222. *
  17223. * @member {Number} module:engine/model/differ~DiffItemRemove#length
  17224. */
  17225. /**
  17226. * The single diff item for attribute change.
  17227. *
  17228. * @class DiffItemAttribute
  17229. * @implements module:engine/model/differ~DiffItem
  17230. */
  17231. /**
  17232. * The type of diff item.
  17233. *
  17234. * @member {'attribute'} module:engine/model/differ~DiffItemAttribute#type
  17235. */
  17236. /**
  17237. * The name of the changed attribute.
  17238. *
  17239. * @member {String} module:engine/model/differ~DiffItemAttribute#attributeKey
  17240. */
  17241. /**
  17242. * An attribute previous value (before change).
  17243. *
  17244. * @member {String} module:engine/model/differ~DiffItemAttribute#attributeOldValue
  17245. */
  17246. /**
  17247. * An attribute new value (after change).
  17248. *
  17249. * @member {String} module:engine/model/differ~DiffItemAttribute#attributeNewValue
  17250. */
  17251. /**
  17252. * The range where the change happened.
  17253. *
  17254. * @member {module:engine/model/range~Range} module:engine/model/differ~DiffItemAttribute#range
  17255. */
  17256. /***/ }),
  17257. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/document.js":
  17258. /*!***********************************************************************!*\
  17259. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/document.js ***!
  17260. \***********************************************************************/
  17261. /*! exports provided: default */
  17262. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  17263. "use strict";
  17264. __webpack_require__.r(__webpack_exports__);
  17265. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Document; });
  17266. /* harmony import */ var _differ__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./differ */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/differ.js");
  17267. /* harmony import */ var _rootelement__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./rootelement */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/rootelement.js");
  17268. /* harmony import */ var _history__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./history */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/history.js");
  17269. /* harmony import */ var _documentselection__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./documentselection */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/documentselection.js");
  17270. /* 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");
  17271. /* 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");
  17272. /* 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");
  17273. /* 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");
  17274. /* 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");
  17275. /* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! lodash-es */ "./node_modules/lodash-es/lodash.js");
  17276. /**
  17277. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  17278. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  17279. */
  17280. /**
  17281. * @module engine/model/document
  17282. */
  17283. // @if CK_DEBUG_ENGINE // const { logDocument } = require( '../dev-utils/utils' );
  17284. const graveyardName = '$graveyard';
  17285. /**
  17286. * Data model's document. It contains the model's structure, its selection and the history of changes.
  17287. *
  17288. * Read more about working with the model in
  17289. * {@glink framework/guides/architecture/editing-engine#model introduction to the the editing engine's architecture}.
  17290. *
  17291. * Usually, the document contains just one {@link module:engine/model/document~Document#roots root element}, so
  17292. * you can retrieve it by just calling {@link module:engine/model/document~Document#getRoot} without specifying its name:
  17293. *
  17294. * model.document.getRoot(); // -> returns the main root
  17295. *
  17296. * However, the document may contain multiple roots – e.g. when the editor has multiple editable areas
  17297. * (e.g. a title and a body of a message).
  17298. *
  17299. * @mixes module:utils/emittermixin~EmitterMixin
  17300. */
  17301. class Document {
  17302. /**
  17303. * Creates an empty document instance with no {@link #roots} (other than
  17304. * the {@link #graveyard graveyard root}).
  17305. */
  17306. constructor( model ) {
  17307. /**
  17308. * The {@link module:engine/model/model~Model model} that the document is a part of.
  17309. *
  17310. * @readonly
  17311. * @type {module:engine/model/model~Model}
  17312. */
  17313. this.model = model;
  17314. /**
  17315. * The document version. It starts from `0` and every operation increases the version number. It is used to ensure that
  17316. * operations are applied on a proper document version.
  17317. *
  17318. * If the {@link module:engine/model/operation/operation~Operation#baseVersion base version} does not match the document version,
  17319. * a {@link module:utils/ckeditorerror~CKEditorError model-document-applyoperation-wrong-version} error is thrown.
  17320. *
  17321. * @type {Number}
  17322. */
  17323. this.version = 0;
  17324. /**
  17325. * The document's history.
  17326. *
  17327. * @readonly
  17328. * @type {module:engine/model/history~History}
  17329. */
  17330. this.history = new _history__WEBPACK_IMPORTED_MODULE_2__["default"]( this );
  17331. /**
  17332. * The selection in this document.
  17333. *
  17334. * @readonly
  17335. * @type {module:engine/model/documentselection~DocumentSelection}
  17336. */
  17337. this.selection = new _documentselection__WEBPACK_IMPORTED_MODULE_3__["default"]( this );
  17338. /**
  17339. * A list of roots that are owned and managed by this document. Use {@link #createRoot} and
  17340. * {@link #getRoot} to manipulate it.
  17341. *
  17342. * @readonly
  17343. * @type {module:utils/collection~Collection}
  17344. */
  17345. this.roots = new _ckeditor_ckeditor5_utils_src_collection__WEBPACK_IMPORTED_MODULE_4__["default"]( { idProperty: 'rootName' } );
  17346. /**
  17347. * The model differ object. Its role is to buffer changes done on the model document and then calculate a diff of those changes.
  17348. *
  17349. * @readonly
  17350. * @type {module:engine/model/differ~Differ}
  17351. */
  17352. this.differ = new _differ__WEBPACK_IMPORTED_MODULE_0__["default"]( model.markers );
  17353. /**
  17354. * Post-fixer callbacks registered to the model document.
  17355. *
  17356. * @private
  17357. * @type {Set.<Function>}
  17358. */
  17359. this._postFixers = new Set();
  17360. /**
  17361. * A boolean indicates whether the selection has changed until
  17362. *
  17363. * @private
  17364. * @type {Boolean}
  17365. */
  17366. this._hasSelectionChangedFromTheLastChangeBlock = false;
  17367. // Graveyard tree root. Document always have a graveyard root, which stores removed nodes.
  17368. this.createRoot( '$root', graveyardName );
  17369. // First, if the operation is a document operation check if it's base version is correct.
  17370. this.listenTo( model, 'applyOperation', ( evt, args ) => {
  17371. const operation = args[ 0 ];
  17372. if ( operation.isDocumentOperation && operation.baseVersion !== this.version ) {
  17373. /**
  17374. * Only operations with matching versions can be applied.
  17375. *
  17376. * @error model-document-applyoperation-wrong-version
  17377. * @param {module:engine/model/operation/operation~Operation} operation
  17378. */
  17379. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_6__["default"]( 'model-document-applyoperation-wrong-version', this, { operation } );
  17380. }
  17381. }, { priority: 'highest' } );
  17382. // Then, still before an operation is applied on model, buffer the change in differ.
  17383. this.listenTo( model, 'applyOperation', ( evt, args ) => {
  17384. const operation = args[ 0 ];
  17385. if ( operation.isDocumentOperation ) {
  17386. this.differ.bufferOperation( operation );
  17387. }
  17388. }, { priority: 'high' } );
  17389. // After the operation is applied, bump document's version and add the operation to the history.
  17390. this.listenTo( model, 'applyOperation', ( evt, args ) => {
  17391. const operation = args[ 0 ];
  17392. if ( operation.isDocumentOperation ) {
  17393. this.version++;
  17394. this.history.addOperation( operation );
  17395. }
  17396. }, { priority: 'low' } );
  17397. // Listen to selection changes. If selection changed, mark it.
  17398. this.listenTo( this.selection, 'change', () => {
  17399. this._hasSelectionChangedFromTheLastChangeBlock = true;
  17400. } );
  17401. // Buffer marker changes.
  17402. // This is not covered in buffering operations because markers may change outside of them (when they
  17403. // are modified using `model.markers` collection, not through `MarkerOperation`).
  17404. this.listenTo( model.markers, 'update', ( evt, marker, oldRange, newRange ) => {
  17405. // Whenever marker is updated, buffer that change.
  17406. this.differ.bufferMarkerChange( marker.name, oldRange, newRange, marker.affectsData );
  17407. if ( oldRange === null ) {
  17408. // If this is a new marker, add a listener that will buffer change whenever marker changes.
  17409. marker.on( 'change', ( evt, oldRange ) => {
  17410. this.differ.bufferMarkerChange( marker.name, oldRange, marker.getRange(), marker.affectsData );
  17411. } );
  17412. }
  17413. } );
  17414. }
  17415. /**
  17416. * The graveyard tree root. A document always has a graveyard root that stores removed nodes.
  17417. *
  17418. * @readonly
  17419. * @member {module:engine/model/rootelement~RootElement}
  17420. */
  17421. get graveyard() {
  17422. return this.getRoot( graveyardName );
  17423. }
  17424. /**
  17425. * Creates a new root.
  17426. *
  17427. * @param {String} [elementName='$root'] The element name. Defaults to `'$root'` which also has some basic schema defined
  17428. * (`$block`s are allowed inside the `$root`). Make sure to define a proper schema if you use a different name.
  17429. * @param {String} [rootName='main'] A unique root name.
  17430. * @returns {module:engine/model/rootelement~RootElement} The created root.
  17431. */
  17432. createRoot( elementName = '$root', rootName = 'main' ) {
  17433. if ( this.roots.get( rootName ) ) {
  17434. /**
  17435. * A root with the specified name already exists.
  17436. *
  17437. * @error model-document-createroot-name-exists
  17438. * @param {module:engine/model/document~Document} doc
  17439. * @param {String} name
  17440. */
  17441. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_6__["default"]( 'model-document-createroot-name-exists', this, { name: rootName } );
  17442. }
  17443. const root = new _rootelement__WEBPACK_IMPORTED_MODULE_1__["default"]( this, elementName, rootName );
  17444. this.roots.add( root );
  17445. return root;
  17446. }
  17447. /**
  17448. * Removes all event listeners set by the document instance.
  17449. */
  17450. destroy() {
  17451. this.selection.destroy();
  17452. this.stopListening();
  17453. }
  17454. /**
  17455. * Returns a root by its name.
  17456. *
  17457. * @param {String} [name='main'] A unique root name.
  17458. * @returns {module:engine/model/rootelement~RootElement|null} The root registered under a given name or `null` when
  17459. * there is no root with the given name.
  17460. */
  17461. getRoot( name = 'main' ) {
  17462. return this.roots.get( name );
  17463. }
  17464. /**
  17465. * Returns an array with names of all roots (without the {@link #graveyard}) added to the document.
  17466. *
  17467. * @returns {Array.<String>} Roots names.
  17468. */
  17469. getRootNames() {
  17470. return Array.from( this.roots, root => root.rootName ).filter( name => name != graveyardName );
  17471. }
  17472. /**
  17473. * Used to register a post-fixer callback. A post-fixer mechanism guarantees that the features
  17474. * will operate on a correct model state.
  17475. *
  17476. * An execution of a feature may lead to an incorrect document tree state. The callbacks are used to fix the document tree after
  17477. * it has changed. Post-fixers are fired just after all changes from the outermost change block were applied but
  17478. * before the {@link module:engine/model/document~Document#event:change change event} is fired. If a post-fixer callback made
  17479. * a change, it should return `true`. When this happens, all post-fixers are fired again to check if something else should
  17480. * not be fixed in the new document tree state.
  17481. *
  17482. * As a parameter, a post-fixer callback receives a {@link module:engine/model/writer~Writer writer} instance connected with the
  17483. * executed changes block. Thanks to that, all changes done by the callback will be added to the same
  17484. * {@link module:engine/model/batch~Batch batch} (and undo step) as the original changes. This makes post-fixer changes transparent
  17485. * for the user.
  17486. *
  17487. * An example of a post-fixer is a callback that checks if all the data were removed from the editor. If so, the
  17488. * callback should add an empty paragraph so that the editor is never empty:
  17489. *
  17490. * document.registerPostFixer( writer => {
  17491. * const changes = document.differ.getChanges();
  17492. *
  17493. * // Check if the changes lead to an empty root in the editor.
  17494. * for ( const entry of changes ) {
  17495. * if ( entry.type == 'remove' && entry.position.root.isEmpty ) {
  17496. * writer.insertElement( 'paragraph', entry.position.root, 0 );
  17497. *
  17498. * // It is fine to return early, even if multiple roots would need to be fixed.
  17499. * // All post-fixers will be fired again, so if there are more empty roots, those will be fixed, too.
  17500. * return true;
  17501. * }
  17502. * }
  17503. * } );
  17504. *
  17505. * @param {Function} postFixer
  17506. */
  17507. registerPostFixer( postFixer ) {
  17508. this._postFixers.add( postFixer );
  17509. }
  17510. /**
  17511. * A custom `toJSON()` method to solve child-parent circular dependencies.
  17512. *
  17513. * @returns {Object} A clone of this object with the document property changed to a string.
  17514. */
  17515. toJSON() {
  17516. const json = Object(lodash_es__WEBPACK_IMPORTED_MODULE_9__["clone"])( this );
  17517. // Due to circular references we need to remove parent reference.
  17518. json.selection = '[engine.model.DocumentSelection]';
  17519. json.model = '[engine.model.Model]';
  17520. return json;
  17521. }
  17522. /**
  17523. * Check if there were any changes done on document, and if so, call post-fixers,
  17524. * fire `change` event for features and conversion and then reset the differ.
  17525. * Fire `change:data` event when at least one operation or buffered marker changes the data.
  17526. *
  17527. * @protected
  17528. * @fires change
  17529. * @fires change:data
  17530. * @param {module:engine/model/writer~Writer} writer The writer on which post-fixers will be called.
  17531. */
  17532. _handleChangeBlock( writer ) {
  17533. if ( this._hasDocumentChangedFromTheLastChangeBlock() ) {
  17534. this._callPostFixers( writer );
  17535. // Refresh selection attributes according to the final position in the model after the change.
  17536. this.selection.refresh();
  17537. if ( this.differ.hasDataChanges() ) {
  17538. this.fire( 'change:data', writer.batch );
  17539. } else {
  17540. this.fire( 'change', writer.batch );
  17541. }
  17542. // Theoretically, it is not necessary to refresh selection after change event because
  17543. // post-fixers are the last who should change the model, but just in case...
  17544. this.selection.refresh();
  17545. this.differ.reset();
  17546. }
  17547. this._hasSelectionChangedFromTheLastChangeBlock = false;
  17548. }
  17549. /**
  17550. * Returns whether there is a buffered change or if the selection has changed from the last
  17551. * {@link module:engine/model/model~Model#enqueueChange `enqueueChange()` block}
  17552. * or {@link module:engine/model/model~Model#change `change()` block}.
  17553. *
  17554. * @protected
  17555. * @returns {Boolean} Returns `true` if document has changed from the last `change()` or `enqueueChange()` block.
  17556. */
  17557. _hasDocumentChangedFromTheLastChangeBlock() {
  17558. return !this.differ.isEmpty || this._hasSelectionChangedFromTheLastChangeBlock;
  17559. }
  17560. /**
  17561. * Returns the default root for this document which is either the first root that was added to the document using
  17562. * {@link #createRoot} or the {@link #graveyard graveyard root} if no other roots were created.
  17563. *
  17564. * @protected
  17565. * @returns {module:engine/model/rootelement~RootElement} The default root for this document.
  17566. */
  17567. _getDefaultRoot() {
  17568. for ( const root of this.roots ) {
  17569. if ( root !== this.graveyard ) {
  17570. return root;
  17571. }
  17572. }
  17573. return this.graveyard;
  17574. }
  17575. /**
  17576. * Returns the default range for this selection. The default range is a collapsed range that starts and ends
  17577. * at the beginning of this selection's document {@link #_getDefaultRoot default root}.
  17578. *
  17579. * @protected
  17580. * @returns {module:engine/model/range~Range}
  17581. */
  17582. _getDefaultRange() {
  17583. const defaultRoot = this._getDefaultRoot();
  17584. const model = this.model;
  17585. const schema = model.schema;
  17586. // Find the first position where the selection can be put.
  17587. const position = model.createPositionFromPath( defaultRoot, [ 0 ] );
  17588. const nearestRange = schema.getNearestSelectionRange( position );
  17589. // If valid selection range is not found - return range collapsed at the beginning of the root.
  17590. return nearestRange || model.createRange( position );
  17591. }
  17592. /**
  17593. * Checks whether a given {@link module:engine/model/range~Range range} is a valid range for
  17594. * the {@link #selection document's selection}.
  17595. *
  17596. * @private
  17597. * @param {module:engine/model/range~Range} range A range to check.
  17598. * @returns {Boolean} `true` if `range` is valid, `false` otherwise.
  17599. */
  17600. _validateSelectionRange( range ) {
  17601. return validateTextNodePosition( range.start ) && validateTextNodePosition( range.end );
  17602. }
  17603. /**
  17604. * Performs post-fixer loops. Executes post-fixer callbacks as long as none of them has done any changes to the model.
  17605. *
  17606. * @private
  17607. * @param {module:engine/model/writer~Writer} writer The writer on which post-fixer callbacks will be called.
  17608. */
  17609. _callPostFixers( writer ) {
  17610. let wasFixed = false;
  17611. do {
  17612. for ( const callback of this._postFixers ) {
  17613. // Ensure selection attributes are up to date before each post-fixer.
  17614. // https://github.com/ckeditor/ckeditor5-engine/issues/1673.
  17615. //
  17616. // It might be good to refresh the selection after each operation but at the moment it leads
  17617. // to losing attributes for composition or and spell checking
  17618. // https://github.com/ckeditor/ckeditor5-typing/issues/188
  17619. this.selection.refresh();
  17620. wasFixed = callback( writer );
  17621. if ( wasFixed ) {
  17622. break;
  17623. }
  17624. }
  17625. } while ( wasFixed );
  17626. }
  17627. /**
  17628. * Fired after each {@link module:engine/model/model~Model#enqueueChange `enqueueChange()` block} or the outermost
  17629. * {@link module:engine/model/model~Model#change `change()` block} was executed and the document was changed
  17630. * during that block's execution.
  17631. *
  17632. * The changes which this event will cover include:
  17633. *
  17634. * * document structure changes,
  17635. * * selection changes,
  17636. * * marker changes.
  17637. *
  17638. * If you want to be notified about all these changes, then simply listen to this event like this:
  17639. *
  17640. * model.document.on( 'change', () => {
  17641. * console.log( 'The document has changed!' );
  17642. * } );
  17643. *
  17644. * If, however, you only want to be notified about the data changes, then use the
  17645. * {@link module:engine/model/document~Document#event:change:data change:data} event,
  17646. * which is fired for document structure changes and marker changes (which affects the data).
  17647. *
  17648. * model.document.on( 'change:data', () => {
  17649. * console.log( 'The data has changed!' );
  17650. * } );
  17651. *
  17652. * @event change
  17653. * @param {module:engine/model/batch~Batch} batch The batch that was used in the executed changes block.
  17654. */
  17655. /**
  17656. * It is a narrower version of the {@link #event:change} event. It is fired for changes which
  17657. * affect the editor data. This is:
  17658. *
  17659. * * document structure changes,
  17660. * * marker changes (which affects the data).
  17661. *
  17662. * If you want to be notified about the data changes, then listen to this event:
  17663. *
  17664. * model.document.on( 'change:data', () => {
  17665. * console.log( 'The data has changed!' );
  17666. * } );
  17667. *
  17668. * If you would like to listen to all document changes, then check out the
  17669. * {@link module:engine/model/document~Document#event:change change} event.
  17670. *
  17671. * @event change:data
  17672. * @param {module:engine/model/batch~Batch} batch The batch that was used in the executed changes block.
  17673. */
  17674. // @if CK_DEBUG_ENGINE // log( version = null ) {
  17675. // @if CK_DEBUG_ENGINE // version = version === null ? this.version : version;
  17676. // @if CK_DEBUG_ENGINE // logDocument( this, version );
  17677. // @if CK_DEBUG_ENGINE // }
  17678. }
  17679. Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_7__["default"])( Document, _ckeditor_ckeditor5_utils_src_emittermixin__WEBPACK_IMPORTED_MODULE_5__["default"] );
  17680. // Checks whether given range boundary position is valid for document selection, meaning that is not between
  17681. // unicode surrogate pairs or base character and combining marks.
  17682. function validateTextNodePosition( rangeBoundary ) {
  17683. const textNode = rangeBoundary.textNode;
  17684. if ( textNode ) {
  17685. const data = textNode.data;
  17686. const offset = rangeBoundary.offset - textNode.startOffset;
  17687. 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 );
  17688. }
  17689. return true;
  17690. }
  17691. /***/ }),
  17692. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/documentfragment.js":
  17693. /*!*******************************************************************************!*\
  17694. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/documentfragment.js ***!
  17695. \*******************************************************************************/
  17696. /*! exports provided: default */
  17697. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  17698. "use strict";
  17699. __webpack_require__.r(__webpack_exports__);
  17700. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return DocumentFragment; });
  17701. /* harmony import */ var _nodelist__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./nodelist */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/nodelist.js");
  17702. /* harmony import */ var _element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./element */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/element.js");
  17703. /* harmony import */ var _text__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./text */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/text.js");
  17704. /* harmony import */ var _textproxy__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./textproxy */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/textproxy.js");
  17705. /* 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");
  17706. /**
  17707. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  17708. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  17709. */
  17710. /**
  17711. * @module module:engine/model/documentfragment
  17712. */
  17713. // @if CK_DEBUG_ENGINE // const { stringifyMap } = require( '../dev-utils/utils' );
  17714. /**
  17715. * DocumentFragment represents a part of model which does not have a common root but its top-level nodes
  17716. * can be seen as siblings. In other words, it is a detached part of model tree, without a root.
  17717. *
  17718. * DocumentFragment has own {@link module:engine/model/markercollection~MarkerCollection}. Markers from this collection
  17719. * will be set to the {@link module:engine/model/model~Model#markers model markers} by a
  17720. * {@link module:engine/model/writer~Writer#insert} function.
  17721. */
  17722. class DocumentFragment {
  17723. /**
  17724. * Creates an empty `DocumentFragment`.
  17725. *
  17726. * **Note:** Constructor of this class shouldn't be used directly in the code.
  17727. * Use the {@link module:engine/model/writer~Writer#createDocumentFragment} method instead.
  17728. *
  17729. * @protected
  17730. * @param {module:engine/model/node~Node|Iterable.<module:engine/model/node~Node>} [children]
  17731. * Nodes to be contained inside the `DocumentFragment`.
  17732. */
  17733. constructor( children ) {
  17734. /**
  17735. * DocumentFragment static markers map. This is a list of names and {@link module:engine/model/range~Range ranges}
  17736. * which will be set as Markers to {@link module:engine/model/model~Model#markers model markers collection}
  17737. * when DocumentFragment will be inserted to the document.
  17738. *
  17739. * @readonly
  17740. * @member {Map<String,module:engine/model/range~Range>} module:engine/model/documentfragment~DocumentFragment#markers
  17741. */
  17742. this.markers = new Map();
  17743. /**
  17744. * List of nodes contained inside the document fragment.
  17745. *
  17746. * @private
  17747. * @member {module:engine/model/nodelist~NodeList} module:engine/model/documentfragment~DocumentFragment#_children
  17748. */
  17749. this._children = new _nodelist__WEBPACK_IMPORTED_MODULE_0__["default"]();
  17750. if ( children ) {
  17751. this._insertChild( 0, children );
  17752. }
  17753. }
  17754. /**
  17755. * Returns an iterator that iterates over all nodes contained inside this document fragment.
  17756. *
  17757. * @returns {Iterable.<module:engine/model/node~Node>}
  17758. */
  17759. [ Symbol.iterator ]() {
  17760. return this.getChildren();
  17761. }
  17762. /**
  17763. * Number of this document fragment's children.
  17764. *
  17765. * @readonly
  17766. * @type {Number}
  17767. */
  17768. get childCount() {
  17769. return this._children.length;
  17770. }
  17771. /**
  17772. * Sum of {@link module:engine/model/node~Node#offsetSize offset sizes} of all of this document fragment's children.
  17773. *
  17774. * @readonly
  17775. * @type {Number}
  17776. */
  17777. get maxOffset() {
  17778. return this._children.maxOffset;
  17779. }
  17780. /**
  17781. * Is `true` if there are no nodes inside this document fragment, `false` otherwise.
  17782. *
  17783. * @readonly
  17784. * @type {Boolean}
  17785. */
  17786. get isEmpty() {
  17787. return this.childCount === 0;
  17788. }
  17789. /**
  17790. * Artificial root of `DocumentFragment`. Returns itself. Added for compatibility reasons.
  17791. *
  17792. * @readonly
  17793. * @type {module:engine/model/documentfragment~DocumentFragment}
  17794. */
  17795. get root() {
  17796. return this;
  17797. }
  17798. /**
  17799. * Artificial parent of `DocumentFragment`. Returns `null`. Added for compatibility reasons.
  17800. *
  17801. * @readonly
  17802. * @type {null}
  17803. */
  17804. get parent() {
  17805. return null;
  17806. }
  17807. /**
  17808. * Checks whether this object is of the given type.
  17809. *
  17810. * docFrag.is( 'documentFragment' ); // -> true
  17811. * docFrag.is( 'model:documentFragment' ); // -> true
  17812. *
  17813. * docFrag.is( 'view:documentFragment' ); // -> false
  17814. * docFrag.is( 'element' ); // -> false
  17815. * docFrag.is( 'node' ); // -> false
  17816. *
  17817. * {@link module:engine/model/node~Node#is Check the entire list of model objects} which implement the `is()` method.
  17818. *
  17819. * @param {String} type
  17820. * @returns {Boolean}
  17821. */
  17822. is( type ) {
  17823. return type === 'documentFragment' || type === 'model:documentFragment';
  17824. }
  17825. /**
  17826. * Gets the child at the given index. Returns `null` if incorrect index was passed.
  17827. *
  17828. * @param {Number} index Index of child.
  17829. * @returns {module:engine/model/node~Node|null} Child node.
  17830. */
  17831. getChild( index ) {
  17832. return this._children.getNode( index );
  17833. }
  17834. /**
  17835. * Returns an iterator that iterates over all of this document fragment's children.
  17836. *
  17837. * @returns {Iterable.<module:engine/model/node~Node>}
  17838. */
  17839. getChildren() {
  17840. return this._children[ Symbol.iterator ]();
  17841. }
  17842. /**
  17843. * Returns an index of the given child node. Returns `null` if given node is not a child of this document fragment.
  17844. *
  17845. * @param {module:engine/model/node~Node} node Child node to look for.
  17846. * @returns {Number|null} Child node's index.
  17847. */
  17848. getChildIndex( node ) {
  17849. return this._children.getNodeIndex( node );
  17850. }
  17851. /**
  17852. * Returns the starting offset of given child. Starting offset is equal to the sum of
  17853. * {@link module:engine/model/node~Node#offsetSize offset sizes} of all node's siblings that are before it. Returns `null` if
  17854. * given node is not a child of this document fragment.
  17855. *
  17856. * @param {module:engine/model/node~Node} node Child node to look for.
  17857. * @returns {Number|null} Child node's starting offset.
  17858. */
  17859. getChildStartOffset( node ) {
  17860. return this._children.getNodeStartOffset( node );
  17861. }
  17862. /**
  17863. * Returns path to a `DocumentFragment`, which is an empty array. Added for compatibility reasons.
  17864. *
  17865. * @returns {Array}
  17866. */
  17867. getPath() {
  17868. return [];
  17869. }
  17870. /**
  17871. * Returns a descendant node by its path relative to this element.
  17872. *
  17873. * // <this>a<b>c</b></this>
  17874. * this.getNodeByPath( [ 0 ] ); // -> "a"
  17875. * this.getNodeByPath( [ 1 ] ); // -> <b>
  17876. * this.getNodeByPath( [ 1, 0 ] ); // -> "c"
  17877. *
  17878. * @param {Array.<Number>} relativePath Path of the node to find, relative to this element.
  17879. * @returns {module:engine/model/node~Node|module:engine/model/documentfragment~DocumentFragment}
  17880. */
  17881. getNodeByPath( relativePath ) {
  17882. let node = this; // eslint-disable-line consistent-this
  17883. for ( const index of relativePath ) {
  17884. node = node.getChild( node.offsetToIndex( index ) );
  17885. }
  17886. return node;
  17887. }
  17888. /**
  17889. * Converts offset "position" to index "position".
  17890. *
  17891. * Returns index of a node that occupies given offset. If given offset is too low, returns `0`. If given offset is
  17892. * too high, returns index after last child}.
  17893. *
  17894. * const textNode = new Text( 'foo' );
  17895. * const pElement = new Element( 'p' );
  17896. * const docFrag = new DocumentFragment( [ textNode, pElement ] );
  17897. * docFrag.offsetToIndex( -1 ); // Returns 0, because offset is too low.
  17898. * docFrag.offsetToIndex( 0 ); // Returns 0, because offset 0 is taken by `textNode` which is at index 0.
  17899. * docFrag.offsetToIndex( 1 ); // Returns 0, because `textNode` has `offsetSize` equal to 3, so it occupies offset 1 too.
  17900. * docFrag.offsetToIndex( 2 ); // Returns 0.
  17901. * docFrag.offsetToIndex( 3 ); // Returns 1.
  17902. * docFrag.offsetToIndex( 4 ); // Returns 2. There are no nodes at offset 4, so last available index is returned.
  17903. *
  17904. * @param {Number} offset Offset to look for.
  17905. * @returns {Number} Index of a node that occupies given offset.
  17906. */
  17907. offsetToIndex( offset ) {
  17908. return this._children.offsetToIndex( offset );
  17909. }
  17910. /**
  17911. * Converts `DocumentFragment` instance to plain object and returns it.
  17912. * Takes care of converting all of this document fragment's children.
  17913. *
  17914. * @returns {Object} `DocumentFragment` instance converted to plain object.
  17915. */
  17916. toJSON() {
  17917. const json = [];
  17918. for ( const node of this._children ) {
  17919. json.push( node.toJSON() );
  17920. }
  17921. return json;
  17922. }
  17923. /**
  17924. * Creates a `DocumentFragment` instance from given plain object (i.e. parsed JSON string).
  17925. * Converts `DocumentFragment` children to proper nodes.
  17926. *
  17927. * @param {Object} json Plain object to be converted to `DocumentFragment`.
  17928. * @returns {module:engine/model/documentfragment~DocumentFragment} `DocumentFragment` instance created using given plain object.
  17929. */
  17930. static fromJSON( json ) {
  17931. const children = [];
  17932. for ( const child of json ) {
  17933. if ( child.name ) {
  17934. // If child has name property, it is an Element.
  17935. children.push( _element__WEBPACK_IMPORTED_MODULE_1__["default"].fromJSON( child ) );
  17936. } else {
  17937. // Otherwise, it is a Text node.
  17938. children.push( _text__WEBPACK_IMPORTED_MODULE_2__["default"].fromJSON( child ) );
  17939. }
  17940. }
  17941. return new DocumentFragment( children );
  17942. }
  17943. /**
  17944. * {@link #_insertChild Inserts} one or more nodes at the end of this document fragment.
  17945. *
  17946. * @protected
  17947. * @param {module:engine/model/item~Item|Iterable.<module:engine/model/item~Item>} items Items to be inserted.
  17948. */
  17949. _appendChild( items ) {
  17950. this._insertChild( this.childCount, items );
  17951. }
  17952. /**
  17953. * Inserts one or more nodes at the given index and sets {@link module:engine/model/node~Node#parent parent} of these nodes
  17954. * to this document fragment.
  17955. *
  17956. * @protected
  17957. * @param {Number} index Index at which nodes should be inserted.
  17958. * @param {module:engine/model/item~Item|Iterable.<module:engine/model/item~Item>} items Items to be inserted.
  17959. */
  17960. _insertChild( index, items ) {
  17961. const nodes = normalize( items );
  17962. for ( const node of nodes ) {
  17963. // If node that is being added to this element is already inside another element, first remove it from the old parent.
  17964. if ( node.parent !== null ) {
  17965. node._remove();
  17966. }
  17967. node.parent = this;
  17968. }
  17969. this._children._insertNodes( index, nodes );
  17970. }
  17971. /**
  17972. * Removes one or more nodes starting at the given index
  17973. * and sets {@link module:engine/model/node~Node#parent parent} of these nodes to `null`.
  17974. *
  17975. * @protected
  17976. * @param {Number} index Index of the first node to remove.
  17977. * @param {Number} [howMany=1] Number of nodes to remove.
  17978. * @returns {Array.<module:engine/model/node~Node>} Array containing removed nodes.
  17979. */
  17980. _removeChildren( index, howMany = 1 ) {
  17981. const nodes = this._children._removeNodes( index, howMany );
  17982. for ( const node of nodes ) {
  17983. node.parent = null;
  17984. }
  17985. return nodes;
  17986. }
  17987. // @if CK_DEBUG_ENGINE // toString() {
  17988. // @if CK_DEBUG_ENGINE // return 'documentFragment';
  17989. // @if CK_DEBUG_ENGINE // }
  17990. // @if CK_DEBUG_ENGINE // log() {
  17991. // @if CK_DEBUG_ENGINE // console.log( 'ModelDocumentFragment: ' + this );
  17992. // @if CK_DEBUG_ENGINE // }
  17993. // @if CK_DEBUG_ENGINE // printTree() {
  17994. // @if CK_DEBUG_ENGINE // let string = 'ModelDocumentFragment: [';
  17995. // @if CK_DEBUG_ENGINE // for ( const child of this.getChildren() ) {
  17996. // @if CK_DEBUG_ENGINE // string += '\n';
  17997. // @if CK_DEBUG_ENGINE // if ( child.is( '$text' ) ) {
  17998. // @if CK_DEBUG_ENGINE // const textAttrs = stringifyMap( child._attrs );
  17999. // @if CK_DEBUG_ENGINE // string += '\t'.repeat( 1 );
  18000. // @if CK_DEBUG_ENGINE // if ( textAttrs !== '' ) {
  18001. // @if CK_DEBUG_ENGINE // string += `<$text${ textAttrs }>` + child.data + '</$text>';
  18002. // @if CK_DEBUG_ENGINE // } else {
  18003. // @if CK_DEBUG_ENGINE // string += child.data;
  18004. // @if CK_DEBUG_ENGINE // }
  18005. // @if CK_DEBUG_ENGINE // } else {
  18006. // @if CK_DEBUG_ENGINE // string += child.printTree( 1 );
  18007. // @if CK_DEBUG_ENGINE // }
  18008. // @if CK_DEBUG_ENGINE // }
  18009. // @if CK_DEBUG_ENGINE // string += '\n]';
  18010. // @if CK_DEBUG_ENGINE // return string;
  18011. // @if CK_DEBUG_ENGINE // }
  18012. // @if CK_DEBUG_ENGINE // logTree() {
  18013. // @if CK_DEBUG_ENGINE // console.log( this.printTree() );
  18014. // @if CK_DEBUG_ENGINE // }
  18015. }
  18016. // Converts strings to Text and non-iterables to arrays.
  18017. //
  18018. // @param {String|module:engine/model/item~Item|Iterable.<module:engine/model/item~Item>}
  18019. // @returns {Iterable.<module:engine/model/node~Node>}
  18020. function normalize( nodes ) {
  18021. // Separate condition because string is iterable.
  18022. if ( typeof nodes == 'string' ) {
  18023. return [ new _text__WEBPACK_IMPORTED_MODULE_2__["default"]( nodes ) ];
  18024. }
  18025. if ( !Object(_ckeditor_ckeditor5_utils_src_isiterable__WEBPACK_IMPORTED_MODULE_4__["default"])( nodes ) ) {
  18026. nodes = [ nodes ];
  18027. }
  18028. // Array.from to enable .map() on non-arrays.
  18029. return Array.from( nodes )
  18030. .map( node => {
  18031. if ( typeof node == 'string' ) {
  18032. return new _text__WEBPACK_IMPORTED_MODULE_2__["default"]( node );
  18033. }
  18034. if ( node instanceof _textproxy__WEBPACK_IMPORTED_MODULE_3__["default"] ) {
  18035. return new _text__WEBPACK_IMPORTED_MODULE_2__["default"]( node.data, node.getAttributes() );
  18036. }
  18037. return node;
  18038. } );
  18039. }
  18040. /***/ }),
  18041. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/documentselection.js":
  18042. /*!********************************************************************************!*\
  18043. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/documentselection.js ***!
  18044. \********************************************************************************/
  18045. /*! exports provided: default */
  18046. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  18047. "use strict";
  18048. __webpack_require__.r(__webpack_exports__);
  18049. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return DocumentSelection; });
  18050. /* 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");
  18051. /* 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");
  18052. /* harmony import */ var _selection__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./selection */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/selection.js");
  18053. /* harmony import */ var _liverange__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./liverange */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/liverange.js");
  18054. /* harmony import */ var _text__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./text */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/text.js");
  18055. /* harmony import */ var _textproxy__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./textproxy */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/textproxy.js");
  18056. /* 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");
  18057. /* 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");
  18058. /* 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");
  18059. /* 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");
  18060. /**
  18061. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  18062. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  18063. */
  18064. /**
  18065. * @module engine/model/documentselection
  18066. */
  18067. const storePrefix = 'selection:';
  18068. /**
  18069. * `DocumentSelection` is a special selection which is used as the
  18070. * {@link module:engine/model/document~Document#selection document's selection}.
  18071. * There can be only one instance of `DocumentSelection` per document.
  18072. *
  18073. * Document selection can only be changed by using the {@link module:engine/model/writer~Writer} instance
  18074. * inside the {@link module:engine/model/model~Model#change `change()`} block, as it provides a secure way to modify model.
  18075. *
  18076. * `DocumentSelection` is automatically updated upon changes in the {@link module:engine/model/document~Document document}
  18077. * to always contain valid ranges. Its attributes are inherited from the text unless set explicitly.
  18078. *
  18079. * Differences between {@link module:engine/model/selection~Selection} and `DocumentSelection` are:
  18080. * * there is always a range in `DocumentSelection` - even if no ranges were added there is a "default range"
  18081. * present in the selection,
  18082. * * ranges added to this selection updates automatically when the document changes,
  18083. * * attributes of `DocumentSelection` are updated automatically according to selection ranges.
  18084. *
  18085. * Since `DocumentSelection` uses {@link module:engine/model/liverange~LiveRange live ranges}
  18086. * and is updated when {@link module:engine/model/document~Document document}
  18087. * changes, it cannot be set on {@link module:engine/model/node~Node nodes}
  18088. * that are inside {@link module:engine/model/documentfragment~DocumentFragment document fragment}.
  18089. * If you need to represent a selection in document fragment,
  18090. * use {@link module:engine/model/selection~Selection Selection class} instead.
  18091. *
  18092. * @mixes module:utils/emittermixin~EmitterMixin
  18093. */
  18094. class DocumentSelection {
  18095. /**
  18096. * Creates an empty live selection for given {@link module:engine/model/document~Document}.
  18097. *
  18098. * @param {module:engine/model/document~Document} doc Document which owns this selection.
  18099. */
  18100. constructor( doc ) {
  18101. /**
  18102. * Selection used internally by that class (`DocumentSelection` is a proxy to that selection).
  18103. *
  18104. * @protected
  18105. */
  18106. this._selection = new LiveSelection( doc );
  18107. this._selection.delegate( 'change:range' ).to( this );
  18108. this._selection.delegate( 'change:attribute' ).to( this );
  18109. this._selection.delegate( 'change:marker' ).to( this );
  18110. }
  18111. /**
  18112. * Returns whether the selection is collapsed. Selection is collapsed when there is exactly one range which is
  18113. * collapsed.
  18114. *
  18115. * @readonly
  18116. * @type {Boolean}
  18117. */
  18118. get isCollapsed() {
  18119. return this._selection.isCollapsed;
  18120. }
  18121. /**
  18122. * Selection anchor. Anchor may be described as a position where the most recent part of the selection starts.
  18123. * Together with {@link #focus} they define the direction of selection, which is important
  18124. * when expanding/shrinking selection. Anchor is always {@link module:engine/model/range~Range#start start} or
  18125. * {@link module:engine/model/range~Range#end end} position of the most recently added range.
  18126. *
  18127. * Is set to `null` if there are no ranges in selection.
  18128. *
  18129. * @see #focus
  18130. * @readonly
  18131. * @type {module:engine/model/position~Position|null}
  18132. */
  18133. get anchor() {
  18134. return this._selection.anchor;
  18135. }
  18136. /**
  18137. * Selection focus. Focus is a position where the selection ends.
  18138. *
  18139. * Is set to `null` if there are no ranges in selection.
  18140. *
  18141. * @see #anchor
  18142. * @readonly
  18143. * @type {module:engine/model/position~Position|null}
  18144. */
  18145. get focus() {
  18146. return this._selection.focus;
  18147. }
  18148. /**
  18149. * Returns number of ranges in selection.
  18150. *
  18151. * @readonly
  18152. * @type {Number}
  18153. */
  18154. get rangeCount() {
  18155. return this._selection.rangeCount;
  18156. }
  18157. /**
  18158. * Describes whether `Documentselection` has own range(s) set, or if it is defaulted to
  18159. * {@link module:engine/model/document~Document#_getDefaultRange document's default range}.
  18160. *
  18161. * @readonly
  18162. * @type {Boolean}
  18163. */
  18164. get hasOwnRange() {
  18165. return this._selection.hasOwnRange;
  18166. }
  18167. /**
  18168. * Specifies whether the {@link #focus}
  18169. * precedes {@link #anchor}.
  18170. *
  18171. * @readonly
  18172. * @type {Boolean}
  18173. */
  18174. get isBackward() {
  18175. return this._selection.isBackward;
  18176. }
  18177. /**
  18178. * Describes whether the gravity is overridden (using {@link module:engine/model/writer~Writer#overrideSelectionGravity}) or not.
  18179. *
  18180. * Note that the gravity remains overridden as long as will not be restored the same number of times as it was overridden.
  18181. *
  18182. * @readonly
  18183. * @returns {Boolean}
  18184. */
  18185. get isGravityOverridden() {
  18186. return this._selection.isGravityOverridden;
  18187. }
  18188. /**
  18189. * A collection of selection {@link module:engine/model/markercollection~Marker markers}.
  18190. * Marker is a selection marker when selection range is inside the marker range.
  18191. *
  18192. * **Note**: Only markers from {@link ~DocumentSelection#observeMarkers observed markers groups} are collected.
  18193. *
  18194. * @readonly
  18195. * @type {module:utils/collection~Collection}
  18196. */
  18197. get markers() {
  18198. return this._selection.markers;
  18199. }
  18200. /**
  18201. * Used for the compatibility with the {@link module:engine/model/selection~Selection#isEqual} method.
  18202. *
  18203. * @protected
  18204. */
  18205. get _ranges() {
  18206. return this._selection._ranges;
  18207. }
  18208. /**
  18209. * Returns an iterable that iterates over copies of selection ranges.
  18210. *
  18211. * @returns {Iterable.<module:engine/model/range~Range>}
  18212. */
  18213. getRanges() {
  18214. return this._selection.getRanges();
  18215. }
  18216. /**
  18217. * Returns the first position in the selection.
  18218. * First position is the position that {@link module:engine/model/position~Position#isBefore is before}
  18219. * any other position in the selection.
  18220. *
  18221. * Returns `null` if there are no ranges in selection.
  18222. *
  18223. * @returns {module:engine/model/position~Position|null}
  18224. */
  18225. getFirstPosition() {
  18226. return this._selection.getFirstPosition();
  18227. }
  18228. /**
  18229. * Returns the last position in the selection.
  18230. * Last position is the position that {@link module:engine/model/position~Position#isAfter is after}
  18231. * any other position in the selection.
  18232. *
  18233. * Returns `null` if there are no ranges in selection.
  18234. *
  18235. * @returns {module:engine/model/position~Position|null}
  18236. */
  18237. getLastPosition() {
  18238. return this._selection.getLastPosition();
  18239. }
  18240. /**
  18241. * Returns a copy of the first range in the selection.
  18242. * First range is the one which {@link module:engine/model/range~Range#start start} position
  18243. * {@link module:engine/model/position~Position#isBefore is before} start position of all other ranges
  18244. * (not to confuse with the first range added to the selection).
  18245. *
  18246. * Returns `null` if there are no ranges in selection.
  18247. *
  18248. * @returns {module:engine/model/range~Range|null}
  18249. */
  18250. getFirstRange() {
  18251. return this._selection.getFirstRange();
  18252. }
  18253. /**
  18254. * Returns a copy of the last range in the selection.
  18255. * Last range is the one which {@link module:engine/model/range~Range#end end} position
  18256. * {@link module:engine/model/position~Position#isAfter is after} end position of all other ranges (not to confuse with the range most
  18257. * recently added to the selection).
  18258. *
  18259. * Returns `null` if there are no ranges in selection.
  18260. *
  18261. * @returns {module:engine/model/range~Range|null}
  18262. */
  18263. getLastRange() {
  18264. return this._selection.getLastRange();
  18265. }
  18266. /**
  18267. * Gets elements of type {@link module:engine/model/schema~Schema#isBlock "block"} touched by the selection.
  18268. *
  18269. * This method's result can be used for example to apply block styling to all blocks covered by this selection.
  18270. *
  18271. * **Note:** `getSelectedBlocks()` returns blocks that are nested in other non-block elements
  18272. * but will not return blocks nested in other blocks.
  18273. *
  18274. * In this case the function will return exactly all 3 paragraphs (note: `<blockQuote>` is not a block itself):
  18275. *
  18276. * <paragraph>[a</paragraph>
  18277. * <blockQuote>
  18278. * <paragraph>b</paragraph>
  18279. * </blockQuote>
  18280. * <paragraph>c]d</paragraph>
  18281. *
  18282. * In this case the paragraph will also be returned, despite the collapsed selection:
  18283. *
  18284. * <paragraph>[]a</paragraph>
  18285. *
  18286. * In such a scenario, however, only blocks A, B & E will be returned as blocks C & D are nested in block B:
  18287. *
  18288. * [<blockA></blockA>
  18289. * <blockB>
  18290. * <blockC></blockC>
  18291. * <blockD></blockD>
  18292. * </blockB>
  18293. * <blockE></blockE>]
  18294. *
  18295. * If the selection is inside a block all the inner blocks (A & B) are returned:
  18296. *
  18297. * <block>
  18298. * <blockA>[a</blockA>
  18299. * <blockB>b]</blockB>
  18300. * </block>
  18301. *
  18302. * **Special case**: If a selection ends at the beginning of a block, that block is not returned as from user perspective
  18303. * this block wasn't selected. See [#984](https://github.com/ckeditor/ckeditor5-engine/issues/984) for more details.
  18304. *
  18305. * <paragraph>[a</paragraph>
  18306. * <paragraph>b</paragraph>
  18307. * <paragraph>]c</paragraph> // this block will not be returned
  18308. *
  18309. * @returns {Iterable.<module:engine/model/element~Element>}
  18310. */
  18311. getSelectedBlocks() {
  18312. return this._selection.getSelectedBlocks();
  18313. }
  18314. /**
  18315. * Returns the selected element. {@link module:engine/model/element~Element Element} is considered as selected if there is only
  18316. * one range in the selection, and that range contains exactly one element.
  18317. * Returns `null` if there is no selected element.
  18318. *
  18319. * @returns {module:engine/model/element~Element|null}
  18320. */
  18321. getSelectedElement() {
  18322. return this._selection.getSelectedElement();
  18323. }
  18324. /**
  18325. * Checks whether the selection contains the entire content of the given element. This means that selection must start
  18326. * at a position {@link module:engine/model/position~Position#isTouching touching} the element's start and ends at position
  18327. * touching the element's end.
  18328. *
  18329. * By default, this method will check whether the entire content of the selection's current root is selected.
  18330. * Useful to check if e.g. the user has just pressed <kbd>Ctrl</kbd> + <kbd>A</kbd>.
  18331. *
  18332. * @param {module:engine/model/element~Element} [element=this.anchor.root]
  18333. * @returns {Boolean}
  18334. */
  18335. containsEntireContent( element ) {
  18336. return this._selection.containsEntireContent( element );
  18337. }
  18338. /**
  18339. * Unbinds all events previously bound by document selection.
  18340. */
  18341. destroy() {
  18342. this._selection.destroy();
  18343. }
  18344. /**
  18345. * Returns iterable that iterates over this selection's attribute keys.
  18346. *
  18347. * @returns {Iterable.<String>}
  18348. */
  18349. getAttributeKeys() {
  18350. return this._selection.getAttributeKeys();
  18351. }
  18352. /**
  18353. * Returns iterable that iterates over this selection's attributes.
  18354. *
  18355. * Attributes are returned as arrays containing two items. First one is attribute key and second is attribute value.
  18356. * This format is accepted by native `Map` object and also can be passed in `Node` constructor.
  18357. *
  18358. * @returns {Iterable.<*>}
  18359. */
  18360. getAttributes() {
  18361. return this._selection.getAttributes();
  18362. }
  18363. /**
  18364. * Gets an attribute value for given key or `undefined` if that attribute is not set on the selection.
  18365. *
  18366. * @param {String} key Key of attribute to look for.
  18367. * @returns {*} Attribute value or `undefined`.
  18368. */
  18369. getAttribute( key ) {
  18370. return this._selection.getAttribute( key );
  18371. }
  18372. /**
  18373. * Checks if the selection has an attribute for given key.
  18374. *
  18375. * @param {String} key Key of attribute to check.
  18376. * @returns {Boolean} `true` if attribute with given key is set on selection, `false` otherwise.
  18377. */
  18378. hasAttribute( key ) {
  18379. return this._selection.hasAttribute( key );
  18380. }
  18381. /**
  18382. * Refreshes selection attributes and markers according to the current position in the model.
  18383. */
  18384. refresh() {
  18385. this._selection._updateMarkers();
  18386. this._selection._updateAttributes( false );
  18387. }
  18388. /**
  18389. * Registers a marker group prefix or a marker name to be collected in the
  18390. * {@link ~DocumentSelection#markers selection markers collection}.
  18391. *
  18392. * See also {@link module:engine/model/markercollection~MarkerCollection#getMarkersGroup `MarkerCollection#getMarkersGroup()`}.
  18393. *
  18394. * @param {String} prefixOrName The marker group prefix or marker name.
  18395. */
  18396. observeMarkers( prefixOrName ) {
  18397. this._selection.observeMarkers( prefixOrName );
  18398. }
  18399. /**
  18400. * Checks whether this object is of the given type.
  18401. *
  18402. * selection.is( 'selection' ); // -> true
  18403. * selection.is( 'documentSelection' ); // -> true
  18404. * selection.is( 'model:selection' ); // -> true
  18405. * selection.is( 'model:documentSelection' ); // -> true
  18406. *
  18407. * selection.is( 'view:selection' ); // -> false
  18408. * selection.is( 'element' ); // -> false
  18409. * selection.is( 'node' ); // -> false
  18410. *
  18411. * {@link module:engine/model/node~Node#is Check the entire list of model objects} which implement the `is()` method.
  18412. *
  18413. * @param {String} type
  18414. * @returns {Boolean}
  18415. */
  18416. is( type ) {
  18417. return type === 'selection' ||
  18418. type == 'model:selection' ||
  18419. type == 'documentSelection' ||
  18420. type == 'model:documentSelection';
  18421. }
  18422. /**
  18423. * Moves {@link module:engine/model/documentselection~DocumentSelection#focus} to the specified location.
  18424. * Should be used only within the {@link module:engine/model/writer~Writer#setSelectionFocus} method.
  18425. *
  18426. * The location can be specified in the same form as
  18427. * {@link module:engine/model/writer~Writer#createPositionAt writer.createPositionAt()} parameters.
  18428. *
  18429. * @see module:engine/model/writer~Writer#setSelectionFocus
  18430. * @protected
  18431. * @param {module:engine/model/item~Item|module:engine/model/position~Position} itemOrPosition
  18432. * @param {Number|'end'|'before'|'after'} [offset] Offset or one of the flags. Used only when
  18433. * first parameter is a {@link module:engine/model/item~Item model item}.
  18434. */
  18435. _setFocus( itemOrPosition, offset ) {
  18436. this._selection.setFocus( itemOrPosition, offset );
  18437. }
  18438. /**
  18439. * Sets this selection's ranges and direction to the specified location based on the given
  18440. * {@link module:engine/model/selection~Selectable selectable}.
  18441. * Should be used only within the {@link module:engine/model/writer~Writer#setSelection} method.
  18442. *
  18443. * @see module:engine/model/writer~Writer#setSelection
  18444. * @protected
  18445. * @param {module:engine/model/selection~Selectable} selectable
  18446. * @param {Number|'before'|'end'|'after'|'on'|'in'} [placeOrOffset] Sets place or offset of the selection.
  18447. * @param {Object} [options]
  18448. * @param {Boolean} [options.backward] Sets this selection instance to be backward.
  18449. */
  18450. _setTo( selectable, placeOrOffset, options ) {
  18451. this._selection.setTo( selectable, placeOrOffset, options );
  18452. }
  18453. /**
  18454. * Sets attribute on the selection. If attribute with the same key already is set, it's value is overwritten.
  18455. * Should be used only within the {@link module:engine/model/writer~Writer#setSelectionAttribute} method.
  18456. *
  18457. * @see module:engine/model/writer~Writer#setSelectionAttribute
  18458. * @protected
  18459. * @param {String} key Key of the attribute to set.
  18460. * @param {*} value Attribute value.
  18461. */
  18462. _setAttribute( key, value ) {
  18463. this._selection.setAttribute( key, value );
  18464. }
  18465. /**
  18466. * Removes an attribute with given key from the selection.
  18467. * If the given attribute was set on the selection, fires the {@link module:engine/model/selection~Selection#event:change:range}
  18468. * event with removed attribute key.
  18469. * Should be used only within the {@link module:engine/model/writer~Writer#removeSelectionAttribute} method.
  18470. *
  18471. * @see module:engine/model/writer~Writer#removeSelectionAttribute
  18472. * @protected
  18473. * @param {String} key Key of the attribute to remove.
  18474. */
  18475. _removeAttribute( key ) {
  18476. this._selection.removeAttribute( key );
  18477. }
  18478. /**
  18479. * Returns an iterable that iterates through all selection attributes stored in current selection's parent.
  18480. *
  18481. * @protected
  18482. * @returns {Iterable.<*>}
  18483. */
  18484. _getStoredAttributes() {
  18485. return this._selection._getStoredAttributes();
  18486. }
  18487. /**
  18488. * Temporarily changes the gravity of the selection from the left to the right.
  18489. *
  18490. * The gravity defines from which direction the selection inherits its attributes. If it's the default left
  18491. * gravity, the selection (after being moved by the the user) inherits attributes from its left hand side.
  18492. * This method allows to temporarily override this behavior by forcing the gravity to the right.
  18493. *
  18494. * It returns an unique identifier which is required to restore the gravity. It guarantees the symmetry
  18495. * of the process.
  18496. *
  18497. * @see module:engine/model/writer~Writer#overrideSelectionGravity
  18498. * @protected
  18499. * @returns {String} The unique id which allows restoring the gravity.
  18500. */
  18501. _overrideGravity() {
  18502. return this._selection.overrideGravity();
  18503. }
  18504. /**
  18505. * Restores the {@link ~DocumentSelection#_overrideGravity overridden gravity}.
  18506. *
  18507. * Restoring the gravity is only possible using the unique identifier returned by
  18508. * {@link ~DocumentSelection#_overrideGravity}. Note that the gravity remains overridden as long as won't be restored
  18509. * the same number of times it was overridden.
  18510. *
  18511. * @see module:engine/model/writer~Writer#restoreSelectionGravity
  18512. * @protected
  18513. * @param {String} uid The unique id returned by {@link #_overrideGravity}.
  18514. */
  18515. _restoreGravity( uid ) {
  18516. this._selection.restoreGravity( uid );
  18517. }
  18518. /**
  18519. * Generates and returns an attribute key for selection attributes store, basing on original attribute key.
  18520. *
  18521. * @protected
  18522. * @param {String} key Attribute key to convert.
  18523. * @returns {String} Converted attribute key, applicable for selection store.
  18524. */
  18525. static _getStoreAttributeKey( key ) {
  18526. return storePrefix + key;
  18527. }
  18528. /**
  18529. * Checks whether the given attribute key is an attribute stored on an element.
  18530. *
  18531. * @protected
  18532. * @param {String} key
  18533. * @returns {Boolean}
  18534. */
  18535. static _isStoreAttributeKey( key ) {
  18536. return key.startsWith( storePrefix );
  18537. }
  18538. }
  18539. Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_0__["default"])( DocumentSelection, _ckeditor_ckeditor5_utils_src_emittermixin__WEBPACK_IMPORTED_MODULE_1__["default"] );
  18540. /**
  18541. * Fired when selection range(s) changed.
  18542. *
  18543. * @event change:range
  18544. * @param {Boolean} directChange In case of {@link module:engine/model/selection~Selection} class it is always set
  18545. * to `true` which indicates that the selection change was caused by a direct use of selection's API.
  18546. * The {@link module:engine/model/documentselection~DocumentSelection}, however, may change because its position
  18547. * was directly changed through the {@link module:engine/model/writer~Writer writer} or because its position was
  18548. * changed because the structure of the model has been changed (which means an indirect change).
  18549. * The indirect change does not occur in case of normal (detached) selections because they are "static" (as "not live")
  18550. * which mean that they are not updated once the document changes.
  18551. */
  18552. /**
  18553. * Fired when selection attribute changed.
  18554. *
  18555. * @event change:attribute
  18556. * @param {Boolean} directChange In case of {@link module:engine/model/selection~Selection} class it is always set
  18557. * to `true` which indicates that the selection change was caused by a direct use of selection's API.
  18558. * The {@link module:engine/model/documentselection~DocumentSelection}, however, may change because its attributes
  18559. * were directly changed through the {@link module:engine/model/writer~Writer writer} or because its position was
  18560. * changed in the model and its attributes were refreshed (which means an indirect change).
  18561. * The indirect change does not occur in case of normal (detached) selections because they are "static" (as "not live")
  18562. * which mean that they are not updated once the document changes.
  18563. * @param {Array.<String>} attributeKeys Array containing keys of attributes that changed.
  18564. */
  18565. /**
  18566. * Fired when selection marker(s) changed.
  18567. *
  18568. * @event change:marker
  18569. * @param {Boolean} directChange This is always set to `false` in case of `change:marker` event as there is no possibility
  18570. * to change markers directly through {@link module:engine/model/documentselection~DocumentSelection} API.
  18571. * See also {@link module:engine/model/documentselection~DocumentSelection#event:change:range} and
  18572. * {@link module:engine/model/documentselection~DocumentSelection#event:change:attribute}.
  18573. * @param {Array.<module:engine/model/markercollection~Marker>} oldMarkers Markers in which the selection was before the change.
  18574. */
  18575. // `LiveSelection` is used internally by {@link module:engine/model/documentselection~DocumentSelection} and shouldn't be used directly.
  18576. //
  18577. // LiveSelection` is automatically updated upon changes in the {@link module:engine/model/document~Document document}
  18578. // to always contain valid ranges. Its attributes are inherited from the text unless set explicitly.
  18579. //
  18580. // Differences between {@link module:engine/model/selection~Selection} and `LiveSelection` are:
  18581. // * there is always a range in `LiveSelection` - even if no ranges were added there is a "default range"
  18582. // present in the selection,
  18583. // * ranges added to this selection updates automatically when the document changes,
  18584. // * attributes of `LiveSelection` are updated automatically according to selection ranges.
  18585. //
  18586. // @extends module:engine/model/selection~Selection
  18587. //
  18588. class LiveSelection extends _selection__WEBPACK_IMPORTED_MODULE_2__["default"] {
  18589. // Creates an empty live selection for given {@link module:engine/model/document~Document}.
  18590. // @param {module:engine/model/document~Document} doc Document which owns this selection.
  18591. constructor( doc ) {
  18592. super();
  18593. // List of selection markers.
  18594. // Marker is a selection marker when selection range is inside the marker range.
  18595. //
  18596. // @type {module:utils/collection~Collection}
  18597. this.markers = new _ckeditor_ckeditor5_utils_src_collection__WEBPACK_IMPORTED_MODULE_7__["default"]( { idProperty: 'name' } );
  18598. // Document which owns this selection.
  18599. //
  18600. // @protected
  18601. // @member {module:engine/model/model~Model}
  18602. this._model = doc.model;
  18603. // Document which owns this selection.
  18604. //
  18605. // @protected
  18606. // @member {module:engine/model/document~Document}
  18607. this._document = doc;
  18608. // Keeps mapping of attribute name to priority with which the attribute got modified (added/changed/removed)
  18609. // last time. Possible values of priority are: `'low'` and `'normal'`.
  18610. //
  18611. // Priorities are used by internal `LiveSelection` mechanisms. All attributes set using `LiveSelection`
  18612. // attributes API are set with `'normal'` priority.
  18613. //
  18614. // @private
  18615. // @member {Map} module:engine/model/liveselection~LiveSelection#_attributePriority
  18616. this._attributePriority = new Map();
  18617. // Position to which the selection should be set if the last selection range was moved to the graveyard.
  18618. // @private
  18619. // @member {module:engine/model/position~Position} module:engine/model/liveselection~LiveSelection#_selectionRestorePosition
  18620. this._selectionRestorePosition = null;
  18621. // Flag that informs whether the selection ranges have changed. It is changed on true when `LiveRange#change:range` event is fired.
  18622. // @private
  18623. // @member {Array} module:engine/model/liveselection~LiveSelection#_hasChangedRange
  18624. this._hasChangedRange = false;
  18625. // Each overriding gravity adds an UID to the set and each removal removes it.
  18626. // Gravity is overridden when there's at least one UID in the set.
  18627. // Gravity is restored when the set is empty.
  18628. // This is to prevent conflicts when gravity is overridden by more than one feature at the same time.
  18629. // @private
  18630. // @type {Set}
  18631. this._overriddenGravityRegister = new Set();
  18632. // Prefixes of marker names that should affect `LiveSelection#markers` collection.
  18633. // @private
  18634. // @type {Set}
  18635. this._observedMarkers = new Set();
  18636. // Ensure selection is correct after each operation.
  18637. this.listenTo( this._model, 'applyOperation', ( evt, args ) => {
  18638. const operation = args[ 0 ];
  18639. if ( !operation.isDocumentOperation || operation.type == 'marker' || operation.type == 'rename' || operation.type == 'noop' ) {
  18640. return;
  18641. }
  18642. // Fix selection if the last range was removed from it and we have a position to which we can restore the selection.
  18643. if ( this._ranges.length == 0 && this._selectionRestorePosition ) {
  18644. this._fixGraveyardSelection( this._selectionRestorePosition );
  18645. }
  18646. // "Forget" the restore position even if it was not "used".
  18647. this._selectionRestorePosition = null;
  18648. if ( this._hasChangedRange ) {
  18649. this._hasChangedRange = false;
  18650. this.fire( 'change:range', { directChange: false } );
  18651. }
  18652. }, { priority: 'lowest' } );
  18653. // Ensure selection is correct and up to date after each range change.
  18654. this.on( 'change:range', () => {
  18655. for ( const range of this.getRanges() ) {
  18656. if ( !this._document._validateSelectionRange( range ) ) {
  18657. /**
  18658. * Range from {@link module:engine/model/documentselection~DocumentSelection document selection}
  18659. * starts or ends at incorrect position.
  18660. *
  18661. * @error document-selection-wrong-position
  18662. * @param {module:engine/model/range~Range} range
  18663. */
  18664. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_8__["default"](
  18665. 'document-selection-wrong-position',
  18666. this,
  18667. { range }
  18668. );
  18669. }
  18670. }
  18671. } );
  18672. // Update markers data stored by the selection after each marker change.
  18673. // This handles only marker changes done through marker operations (not model tree changes).
  18674. this.listenTo( this._model.markers, 'update', ( evt, marker, oldRange, newRange ) => {
  18675. this._updateMarker( marker, newRange );
  18676. } );
  18677. // Ensure selection is up to date after each change block.
  18678. this.listenTo( this._document, 'change', ( evt, batch ) => {
  18679. clearAttributesStoredInElement( this._model, batch );
  18680. } );
  18681. }
  18682. get isCollapsed() {
  18683. const length = this._ranges.length;
  18684. return length === 0 ? this._document._getDefaultRange().isCollapsed : super.isCollapsed;
  18685. }
  18686. get anchor() {
  18687. return super.anchor || this._document._getDefaultRange().start;
  18688. }
  18689. get focus() {
  18690. return super.focus || this._document._getDefaultRange().end;
  18691. }
  18692. get rangeCount() {
  18693. return this._ranges.length ? this._ranges.length : 1;
  18694. }
  18695. // Describes whether `LiveSelection` has own range(s) set, or if it is defaulted to
  18696. // {@link module:engine/model/document~Document#_getDefaultRange document's default range}.
  18697. //
  18698. // @readonly
  18699. // @type {Boolean}
  18700. get hasOwnRange() {
  18701. return this._ranges.length > 0;
  18702. }
  18703. // When set to `true` then selection attributes on node before the caret won't be taken
  18704. // into consideration while updating selection attributes.
  18705. //
  18706. // @protected
  18707. // @type {Boolean}
  18708. get isGravityOverridden() {
  18709. return !!this._overriddenGravityRegister.size;
  18710. }
  18711. // Unbinds all events previously bound by live selection.
  18712. destroy() {
  18713. for ( let i = 0; i < this._ranges.length; i++ ) {
  18714. this._ranges[ i ].detach();
  18715. }
  18716. this.stopListening();
  18717. }
  18718. * getRanges() {
  18719. if ( this._ranges.length ) {
  18720. yield* super.getRanges();
  18721. } else {
  18722. yield this._document._getDefaultRange();
  18723. }
  18724. }
  18725. getFirstRange() {
  18726. return super.getFirstRange() || this._document._getDefaultRange();
  18727. }
  18728. getLastRange() {
  18729. return super.getLastRange() || this._document._getDefaultRange();
  18730. }
  18731. setTo( selectable, optionsOrPlaceOrOffset, options ) {
  18732. super.setTo( selectable, optionsOrPlaceOrOffset, options );
  18733. this._updateAttributes( true );
  18734. this._updateMarkers();
  18735. }
  18736. setFocus( itemOrPosition, offset ) {
  18737. super.setFocus( itemOrPosition, offset );
  18738. this._updateAttributes( true );
  18739. this._updateMarkers();
  18740. }
  18741. setAttribute( key, value ) {
  18742. if ( this._setAttribute( key, value ) ) {
  18743. // Fire event with exact data.
  18744. const attributeKeys = [ key ];
  18745. this.fire( 'change:attribute', { attributeKeys, directChange: true } );
  18746. }
  18747. }
  18748. removeAttribute( key ) {
  18749. if ( this._removeAttribute( key ) ) {
  18750. // Fire event with exact data.
  18751. const attributeKeys = [ key ];
  18752. this.fire( 'change:attribute', { attributeKeys, directChange: true } );
  18753. }
  18754. }
  18755. overrideGravity() {
  18756. const overrideUid = Object(_ckeditor_ckeditor5_utils_src_uid__WEBPACK_IMPORTED_MODULE_9__["default"])();
  18757. // Remember that another overriding has been requested. It will need to be removed
  18758. // before the gravity is to be restored.
  18759. this._overriddenGravityRegister.add( overrideUid );
  18760. if ( this._overriddenGravityRegister.size === 1 ) {
  18761. this._updateAttributes( true );
  18762. }
  18763. return overrideUid;
  18764. }
  18765. restoreGravity( uid ) {
  18766. if ( !this._overriddenGravityRegister.has( uid ) ) {
  18767. /**
  18768. * Restoring gravity for an unknown UID is not possible. Make sure you are using a correct
  18769. * UID obtained from the {@link module:engine/model/writer~Writer#overrideSelectionGravity} to restore.
  18770. *
  18771. * @error document-selection-gravity-wrong-restore
  18772. * @param {String} uid The unique identifier returned by
  18773. * {@link module:engine/model/documentselection~DocumentSelection#_overrideGravity}.
  18774. */
  18775. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_8__["default"](
  18776. 'document-selection-gravity-wrong-restore',
  18777. this,
  18778. { uid }
  18779. );
  18780. }
  18781. this._overriddenGravityRegister.delete( uid );
  18782. // Restore gravity only when all overriding have been restored.
  18783. if ( !this.isGravityOverridden ) {
  18784. this._updateAttributes( true );
  18785. }
  18786. }
  18787. observeMarkers( prefixOrName ) {
  18788. this._observedMarkers.add( prefixOrName );
  18789. this._updateMarkers();
  18790. }
  18791. _popRange() {
  18792. this._ranges.pop().detach();
  18793. }
  18794. _pushRange( range ) {
  18795. const liveRange = this._prepareRange( range );
  18796. // `undefined` is returned when given `range` is in graveyard root.
  18797. if ( liveRange ) {
  18798. this._ranges.push( liveRange );
  18799. }
  18800. }
  18801. // Prepares given range to be added to selection. Checks if it is correct,
  18802. // converts it to {@link module:engine/model/liverange~LiveRange LiveRange}
  18803. // and sets listeners listening to the range's change event.
  18804. //
  18805. // @private
  18806. // @param {module:engine/model/range~Range} range
  18807. _prepareRange( range ) {
  18808. this._checkRange( range );
  18809. if ( range.root == this._document.graveyard ) {
  18810. // @if CK_DEBUG // console.warn( 'Trying to add a Range that is in the graveyard root. Range rejected.' );
  18811. return;
  18812. }
  18813. const liveRange = _liverange__WEBPACK_IMPORTED_MODULE_3__["default"].fromRange( range );
  18814. // If selection range is moved to the graveyard remove it from the selection object.
  18815. // Also, save some data that can be used to restore selection later, on `Model#applyOperation` event.
  18816. liveRange.on( 'change:range', ( evt, oldRange, data ) => {
  18817. this._hasChangedRange = true;
  18818. if ( liveRange.root == this._document.graveyard ) {
  18819. this._selectionRestorePosition = data.deletionPosition;
  18820. const index = this._ranges.indexOf( liveRange );
  18821. this._ranges.splice( index, 1 );
  18822. liveRange.detach();
  18823. }
  18824. } );
  18825. return liveRange;
  18826. }
  18827. _updateMarkers() {
  18828. if ( !this._observedMarkers.size ) {
  18829. return;
  18830. }
  18831. const markers = [];
  18832. let changed = false;
  18833. for ( const marker of this._model.markers ) {
  18834. const markerGroup = marker.name.split( ':', 1 )[ 0 ];
  18835. if ( !this._observedMarkers.has( markerGroup ) ) {
  18836. continue;
  18837. }
  18838. const markerRange = marker.getRange();
  18839. for ( const selectionRange of this.getRanges() ) {
  18840. if ( markerRange.containsRange( selectionRange, !selectionRange.isCollapsed ) ) {
  18841. markers.push( marker );
  18842. }
  18843. }
  18844. }
  18845. const oldMarkers = Array.from( this.markers );
  18846. for ( const marker of markers ) {
  18847. if ( !this.markers.has( marker ) ) {
  18848. this.markers.add( marker );
  18849. changed = true;
  18850. }
  18851. }
  18852. for ( const marker of Array.from( this.markers ) ) {
  18853. if ( !markers.includes( marker ) ) {
  18854. this.markers.remove( marker );
  18855. changed = true;
  18856. }
  18857. }
  18858. if ( changed ) {
  18859. this.fire( 'change:marker', { oldMarkers, directChange: false } );
  18860. }
  18861. }
  18862. _updateMarker( marker, markerRange ) {
  18863. const markerGroup = marker.name.split( ':', 1 )[ 0 ];
  18864. if ( !this._observedMarkers.has( markerGroup ) ) {
  18865. return;
  18866. }
  18867. let changed = false;
  18868. const oldMarkers = Array.from( this.markers );
  18869. const hasMarker = this.markers.has( marker );
  18870. if ( !markerRange ) {
  18871. if ( hasMarker ) {
  18872. this.markers.remove( marker );
  18873. changed = true;
  18874. }
  18875. } else {
  18876. let contained = false;
  18877. for ( const selectionRange of this.getRanges() ) {
  18878. if ( markerRange.containsRange( selectionRange, !selectionRange.isCollapsed ) ) {
  18879. contained = true;
  18880. break;
  18881. }
  18882. }
  18883. if ( contained && !hasMarker ) {
  18884. this.markers.add( marker );
  18885. changed = true;
  18886. } else if ( !contained && hasMarker ) {
  18887. this.markers.remove( marker );
  18888. changed = true;
  18889. }
  18890. }
  18891. if ( changed ) {
  18892. this.fire( 'change:marker', { oldMarkers, directChange: false } );
  18893. }
  18894. }
  18895. // Updates this selection attributes according to its ranges and the {@link module:engine/model/document~Document model document}.
  18896. //
  18897. // @protected
  18898. // @param {Boolean} clearAll
  18899. // @fires change:attribute
  18900. _updateAttributes( clearAll ) {
  18901. const newAttributes = Object(_ckeditor_ckeditor5_utils_src_tomap__WEBPACK_IMPORTED_MODULE_6__["default"])( this._getSurroundingAttributes() );
  18902. const oldAttributes = Object(_ckeditor_ckeditor5_utils_src_tomap__WEBPACK_IMPORTED_MODULE_6__["default"])( this.getAttributes() );
  18903. if ( clearAll ) {
  18904. // If `clearAll` remove all attributes and reset priorities.
  18905. this._attributePriority = new Map();
  18906. this._attrs = new Map();
  18907. } else {
  18908. // If not, remove only attributes added with `low` priority.
  18909. for ( const [ key, priority ] of this._attributePriority ) {
  18910. if ( priority == 'low' ) {
  18911. this._attrs.delete( key );
  18912. this._attributePriority.delete( key );
  18913. }
  18914. }
  18915. }
  18916. this._setAttributesTo( newAttributes );
  18917. // Let's evaluate which attributes really changed.
  18918. const changed = [];
  18919. // First, loop through all attributes that are set on selection right now.
  18920. // Check which of them are different than old attributes.
  18921. for ( const [ newKey, newValue ] of this.getAttributes() ) {
  18922. if ( !oldAttributes.has( newKey ) || oldAttributes.get( newKey ) !== newValue ) {
  18923. changed.push( newKey );
  18924. }
  18925. }
  18926. // Then, check which of old attributes got removed.
  18927. for ( const [ oldKey ] of oldAttributes ) {
  18928. if ( !this.hasAttribute( oldKey ) ) {
  18929. changed.push( oldKey );
  18930. }
  18931. }
  18932. // Fire event with exact data (fire only if anything changed).
  18933. if ( changed.length > 0 ) {
  18934. this.fire( 'change:attribute', { attributeKeys: changed, directChange: false } );
  18935. }
  18936. }
  18937. // Internal method for setting `LiveSelection` attribute. Supports attribute priorities (through `directChange`
  18938. // parameter).
  18939. //
  18940. // @private
  18941. // @param {String} key Attribute key.
  18942. // @param {*} value Attribute value.
  18943. // @param {Boolean} [directChange=true] `true` if the change is caused by `Selection` API, `false` if change
  18944. // is caused by `Batch` API.
  18945. // @returns {Boolean} Whether value has changed.
  18946. _setAttribute( key, value, directChange = true ) {
  18947. const priority = directChange ? 'normal' : 'low';
  18948. if ( priority == 'low' && this._attributePriority.get( key ) == 'normal' ) {
  18949. // Priority too low.
  18950. return false;
  18951. }
  18952. const oldValue = super.getAttribute( key );
  18953. // Don't do anything if value has not changed.
  18954. if ( oldValue === value ) {
  18955. return false;
  18956. }
  18957. this._attrs.set( key, value );
  18958. // Update priorities map.
  18959. this._attributePriority.set( key, priority );
  18960. return true;
  18961. }
  18962. // Internal method for removing `LiveSelection` attribute. Supports attribute priorities (through `directChange`
  18963. // parameter).
  18964. //
  18965. // NOTE: Even if attribute is not present in the selection but is provided to this method, it's priority will
  18966. // be changed according to `directChange` parameter.
  18967. //
  18968. // @private
  18969. // @param {String} key Attribute key.
  18970. // @param {Boolean} [directChange=true] `true` if the change is caused by `Selection` API, `false` if change
  18971. // is caused by `Batch` API.
  18972. // @returns {Boolean} Whether attribute was removed. May not be true if such attributes didn't exist or the
  18973. // existing attribute had higher priority.
  18974. _removeAttribute( key, directChange = true ) {
  18975. const priority = directChange ? 'normal' : 'low';
  18976. if ( priority == 'low' && this._attributePriority.get( key ) == 'normal' ) {
  18977. // Priority too low.
  18978. return false;
  18979. }
  18980. // Update priorities map.
  18981. this._attributePriority.set( key, priority );
  18982. // Don't do anything if value has not changed.
  18983. if ( !super.hasAttribute( key ) ) {
  18984. return false;
  18985. }
  18986. this._attrs.delete( key );
  18987. return true;
  18988. }
  18989. // Internal method for setting multiple `LiveSelection` attributes. Supports attribute priorities (through
  18990. // `directChange` parameter).
  18991. //
  18992. // @private
  18993. // @param {Map.<String,*>} attrs Iterable object containing attributes to be set.
  18994. // @returns {Set.<String>} Changed attribute keys.
  18995. _setAttributesTo( attrs ) {
  18996. const changed = new Set();
  18997. for ( const [ oldKey, oldValue ] of this.getAttributes() ) {
  18998. // Do not remove attribute if attribute with same key and value is about to be set.
  18999. if ( attrs.get( oldKey ) === oldValue ) {
  19000. continue;
  19001. }
  19002. // All rest attributes will be removed so changed attributes won't change .
  19003. this._removeAttribute( oldKey, false );
  19004. }
  19005. for ( const [ key, value ] of attrs ) {
  19006. // Attribute may not be set because of attributes or because same key/value is already added.
  19007. const gotAdded = this._setAttribute( key, value, false );
  19008. if ( gotAdded ) {
  19009. changed.add( key );
  19010. }
  19011. }
  19012. return changed;
  19013. }
  19014. // Returns an iterable that iterates through all selection attributes stored in current selection's parent.
  19015. //
  19016. // @protected
  19017. // @returns {Iterable.<*>}
  19018. * _getStoredAttributes() {
  19019. const selectionParent = this.getFirstPosition().parent;
  19020. if ( this.isCollapsed && selectionParent.isEmpty ) {
  19021. for ( const key of selectionParent.getAttributeKeys() ) {
  19022. if ( key.startsWith( storePrefix ) ) {
  19023. const realKey = key.substr( storePrefix.length );
  19024. yield [ realKey, selectionParent.getAttribute( key ) ];
  19025. }
  19026. }
  19027. }
  19028. }
  19029. // Checks model text nodes that are closest to the selection's first position and returns attributes of first
  19030. // found element. If there are no text nodes in selection's first position parent, it returns selection
  19031. // attributes stored in that parent.
  19032. //
  19033. // @private
  19034. // @returns {Iterable.<*>} Collection of attributes.
  19035. _getSurroundingAttributes() {
  19036. const position = this.getFirstPosition();
  19037. const schema = this._model.schema;
  19038. let attrs = null;
  19039. if ( !this.isCollapsed ) {
  19040. // 1. If selection is a range...
  19041. const range = this.getFirstRange();
  19042. // ...look for a first character node in that range and take attributes from it.
  19043. for ( const value of range ) {
  19044. // If the item is an object, we don't want to get attributes from its children.
  19045. if ( value.item.is( 'element' ) && schema.isObject( value.item ) ) {
  19046. break;
  19047. }
  19048. if ( value.type == 'text' ) {
  19049. attrs = value.item.getAttributes();
  19050. break;
  19051. }
  19052. }
  19053. } else {
  19054. // 2. If the selection is a caret or the range does not contain a character node...
  19055. const nodeBefore = position.textNode ? position.textNode : position.nodeBefore;
  19056. const nodeAfter = position.textNode ? position.textNode : position.nodeAfter;
  19057. // When gravity is overridden then don't take node before into consideration.
  19058. if ( !this.isGravityOverridden ) {
  19059. // ...look at the node before caret and take attributes from it if it is a character node.
  19060. attrs = getAttrsIfCharacter( nodeBefore );
  19061. }
  19062. // 3. If not, look at the node after caret...
  19063. if ( !attrs ) {
  19064. attrs = getAttrsIfCharacter( nodeAfter );
  19065. }
  19066. // 4. If not, try to find the first character on the left, that is in the same node.
  19067. // When gravity is overridden then don't take node before into consideration.
  19068. if ( !this.isGravityOverridden && !attrs ) {
  19069. let node = nodeBefore;
  19070. while ( node && !schema.isInline( node ) && !attrs ) {
  19071. node = node.previousSibling;
  19072. attrs = getAttrsIfCharacter( node );
  19073. }
  19074. }
  19075. // 5. If not found, try to find the first character on the right, that is in the same node.
  19076. if ( !attrs ) {
  19077. let node = nodeAfter;
  19078. while ( node && !schema.isInline( node ) && !attrs ) {
  19079. node = node.nextSibling;
  19080. attrs = getAttrsIfCharacter( node );
  19081. }
  19082. }
  19083. // 6. If not found, selection should retrieve attributes from parent.
  19084. if ( !attrs ) {
  19085. attrs = this._getStoredAttributes();
  19086. }
  19087. }
  19088. return attrs;
  19089. }
  19090. // Fixes the selection after all its ranges got removed.
  19091. //
  19092. // @private
  19093. // @param {module:engine/model/position~Position} deletionPosition Position where the deletion happened.
  19094. _fixGraveyardSelection( deletionPosition ) {
  19095. // Find a range that is a correct selection range and is closest to the position where the deletion happened.
  19096. const selectionRange = this._model.schema.getNearestSelectionRange( deletionPosition );
  19097. // If nearest valid selection range has been found - add it in the place of old range.
  19098. if ( selectionRange ) {
  19099. // Check the range, convert it to live range, bind events, etc.
  19100. this._pushRange( selectionRange );
  19101. }
  19102. // If nearest valid selection range cannot be found don't add any range. Selection will be set to the default range.
  19103. }
  19104. }
  19105. // Helper function for {@link module:engine/model/liveselection~LiveSelection#_updateAttributes}.
  19106. //
  19107. // 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`.
  19108. //
  19109. // @param {module:engine/model/item~Item|null} node
  19110. // @returns {Boolean}
  19111. function getAttrsIfCharacter( node ) {
  19112. if ( node instanceof _textproxy__WEBPACK_IMPORTED_MODULE_5__["default"] || node instanceof _text__WEBPACK_IMPORTED_MODULE_4__["default"] ) {
  19113. return node.getAttributes();
  19114. }
  19115. return null;
  19116. }
  19117. // Removes selection attributes from element which is not empty anymore.
  19118. //
  19119. // @param {module:engine/model/model~Model} model
  19120. // @param {module:engine/model/batch~Batch} batch
  19121. function clearAttributesStoredInElement( model, batch ) {
  19122. const differ = model.document.differ;
  19123. for ( const entry of differ.getChanges() ) {
  19124. if ( entry.type != 'insert' ) {
  19125. continue;
  19126. }
  19127. const changeParent = entry.position.parent;
  19128. const isNoLongerEmpty = entry.length === changeParent.maxOffset;
  19129. if ( isNoLongerEmpty ) {
  19130. model.enqueueChange( batch, writer => {
  19131. const storedAttributes = Array.from( changeParent.getAttributeKeys() )
  19132. .filter( key => key.startsWith( storePrefix ) );
  19133. for ( const key of storedAttributes ) {
  19134. writer.removeAttribute( key, changeParent );
  19135. }
  19136. } );
  19137. }
  19138. }
  19139. }
  19140. /***/ }),
  19141. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/element.js":
  19142. /*!**********************************************************************!*\
  19143. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/element.js ***!
  19144. \**********************************************************************/
  19145. /*! exports provided: default */
  19146. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  19147. "use strict";
  19148. __webpack_require__.r(__webpack_exports__);
  19149. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Element; });
  19150. /* harmony import */ var _node__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/node.js");
  19151. /* harmony import */ var _nodelist__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./nodelist */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/nodelist.js");
  19152. /* harmony import */ var _text__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./text */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/text.js");
  19153. /* harmony import */ var _textproxy__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./textproxy */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/textproxy.js");
  19154. /* 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");
  19155. /**
  19156. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  19157. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  19158. */
  19159. /**
  19160. * @module engine/model/element
  19161. */
  19162. // @if CK_DEBUG_ENGINE // const { stringifyMap, convertMapToStringifiedObject, convertMapToTags } = require( '../dev-utils/utils' );
  19163. /**
  19164. * Model element. Type of {@link module:engine/model/node~Node node} that has a {@link module:engine/model/element~Element#name name} and
  19165. * {@link module:engine/model/element~Element#getChildren child nodes}.
  19166. *
  19167. * **Important**: see {@link module:engine/model/node~Node} to read about restrictions using `Element` and `Node` API.
  19168. *
  19169. * @extends module:engine/model/node~Node
  19170. */
  19171. class Element extends _node__WEBPACK_IMPORTED_MODULE_0__["default"] {
  19172. /**
  19173. * Creates a model element.
  19174. *
  19175. * **Note:** Constructor of this class shouldn't be used directly in the code.
  19176. * Use the {@link module:engine/model/writer~Writer#createElement} method instead.
  19177. *
  19178. * @protected
  19179. * @param {String} name Element's name.
  19180. * @param {Object} [attrs] Element's attributes. See {@link module:utils/tomap~toMap} for a list of accepted values.
  19181. * @param {module:engine/model/node~Node|Iterable.<module:engine/model/node~Node>} [children]
  19182. * One or more nodes to be inserted as children of created element.
  19183. */
  19184. constructor( name, attrs, children ) {
  19185. super( attrs );
  19186. /**
  19187. * Element name.
  19188. *
  19189. * @readonly
  19190. * @member {String} module:engine/model/element~Element#name
  19191. */
  19192. this.name = name;
  19193. /**
  19194. * List of children nodes.
  19195. *
  19196. * @private
  19197. * @member {module:engine/model/nodelist~NodeList} module:engine/model/element~Element#_children
  19198. */
  19199. this._children = new _nodelist__WEBPACK_IMPORTED_MODULE_1__["default"]();
  19200. if ( children ) {
  19201. this._insertChild( 0, children );
  19202. }
  19203. }
  19204. /**
  19205. * Number of this element's children.
  19206. *
  19207. * @readonly
  19208. * @type {Number}
  19209. */
  19210. get childCount() {
  19211. return this._children.length;
  19212. }
  19213. /**
  19214. * Sum of {@link module:engine/model/node~Node#offsetSize offset sizes} of all of this element's children.
  19215. *
  19216. * @readonly
  19217. * @type {Number}
  19218. */
  19219. get maxOffset() {
  19220. return this._children.maxOffset;
  19221. }
  19222. /**
  19223. * Is `true` if there are no nodes inside this element, `false` otherwise.
  19224. *
  19225. * @readonly
  19226. * @type {Boolean}
  19227. */
  19228. get isEmpty() {
  19229. return this.childCount === 0;
  19230. }
  19231. /**
  19232. * Checks whether this object is of the given.
  19233. *
  19234. * element.is( 'element' ); // -> true
  19235. * element.is( 'node' ); // -> true
  19236. * element.is( 'model:element' ); // -> true
  19237. * element.is( 'model:node' ); // -> true
  19238. *
  19239. * element.is( 'view:element' ); // -> false
  19240. * element.is( 'documentSelection' ); // -> false
  19241. *
  19242. * Assuming that the object being checked is an element, you can also check its
  19243. * {@link module:engine/model/element~Element#name name}:
  19244. *
  19245. * element.is( 'element', 'image' ); // -> true if this is an <image> element
  19246. * element.is( 'element', 'image' ); // -> same as above
  19247. * text.is( 'element', 'image' ); -> false
  19248. *
  19249. * {@link module:engine/model/node~Node#is Check the entire list of model objects} which implement the `is()` method.
  19250. *
  19251. * @param {String} type Type to check.
  19252. * @param {String} [name] Element name.
  19253. * @returns {Boolean}
  19254. */
  19255. is( type, name = null ) {
  19256. if ( !name ) {
  19257. return type === 'element' || type === 'model:element' ||
  19258. // From super.is(). This is highly utilised method and cannot call super. See ckeditor/ckeditor5#6529.
  19259. type === 'node' || type === 'model:node';
  19260. }
  19261. return name === this.name && ( type === 'element' || type === 'model:element' );
  19262. }
  19263. /**
  19264. * Gets the child at the given index.
  19265. *
  19266. * @param {Number} index Index of child.
  19267. * @returns {module:engine/model/node~Node} Child node.
  19268. */
  19269. getChild( index ) {
  19270. return this._children.getNode( index );
  19271. }
  19272. /**
  19273. * Returns an iterator that iterates over all of this element's children.
  19274. *
  19275. * @returns {Iterable.<module:engine/model/node~Node>}
  19276. */
  19277. getChildren() {
  19278. return this._children[ Symbol.iterator ]();
  19279. }
  19280. /**
  19281. * Returns an index of the given child node. Returns `null` if given node is not a child of this element.
  19282. *
  19283. * @param {module:engine/model/node~Node} node Child node to look for.
  19284. * @returns {Number} Child node's index in this element.
  19285. */
  19286. getChildIndex( node ) {
  19287. return this._children.getNodeIndex( node );
  19288. }
  19289. /**
  19290. * Returns the starting offset of given child. Starting offset is equal to the sum of
  19291. * {@link module:engine/model/node~Node#offsetSize offset sizes} of all node's siblings that are before it. Returns `null` if
  19292. * given node is not a child of this element.
  19293. *
  19294. * @param {module:engine/model/node~Node} node Child node to look for.
  19295. * @returns {Number} Child node's starting offset.
  19296. */
  19297. getChildStartOffset( node ) {
  19298. return this._children.getNodeStartOffset( node );
  19299. }
  19300. /**
  19301. * Returns index of a node that occupies given offset. If given offset is too low, returns `0`. If given offset is
  19302. * too high, returns {@link module:engine/model/element~Element#getChildIndex index after last child}.
  19303. *
  19304. * const textNode = new Text( 'foo' );
  19305. * const pElement = new Element( 'p' );
  19306. * const divElement = new Element( [ textNode, pElement ] );
  19307. * divElement.offsetToIndex( -1 ); // Returns 0, because offset is too low.
  19308. * divElement.offsetToIndex( 0 ); // Returns 0, because offset 0 is taken by `textNode` which is at index 0.
  19309. * divElement.offsetToIndex( 1 ); // Returns 0, because `textNode` has `offsetSize` equal to 3, so it occupies offset 1 too.
  19310. * divElement.offsetToIndex( 2 ); // Returns 0.
  19311. * divElement.offsetToIndex( 3 ); // Returns 1.
  19312. * divElement.offsetToIndex( 4 ); // Returns 2. There are no nodes at offset 4, so last available index is returned.
  19313. *
  19314. * @param {Number} offset Offset to look for.
  19315. * @returns {Number}
  19316. */
  19317. offsetToIndex( offset ) {
  19318. return this._children.offsetToIndex( offset );
  19319. }
  19320. /**
  19321. * Returns a descendant node by its path relative to this element.
  19322. *
  19323. * // <this>a<b>c</b></this>
  19324. * this.getNodeByPath( [ 0 ] ); // -> "a"
  19325. * this.getNodeByPath( [ 1 ] ); // -> <b>
  19326. * this.getNodeByPath( [ 1, 0 ] ); // -> "c"
  19327. *
  19328. * @param {Array.<Number>} relativePath Path of the node to find, relative to this element.
  19329. * @returns {module:engine/model/node~Node}
  19330. */
  19331. getNodeByPath( relativePath ) {
  19332. let node = this; // eslint-disable-line consistent-this
  19333. for ( const index of relativePath ) {
  19334. node = node.getChild( node.offsetToIndex( index ) );
  19335. }
  19336. return node;
  19337. }
  19338. /**
  19339. * Returns the parent element of the given name. Returns null if the element is not inside the desired parent.
  19340. *
  19341. * @param {String} parentName The name of the parent element to find.
  19342. * @param {Object} [options] Options object.
  19343. * @param {Boolean} [options.includeSelf=false] When set to `true` this node will be also included while searching.
  19344. * @returns {module:engine/model/element~Element|null}
  19345. */
  19346. findAncestor( parentName, options = { includeSelf: false } ) {
  19347. let parent = options.includeSelf ? this : this.parent;
  19348. while ( parent ) {
  19349. if ( parent.name === parentName ) {
  19350. return parent;
  19351. }
  19352. parent = parent.parent;
  19353. }
  19354. return null;
  19355. }
  19356. /**
  19357. * Converts `Element` instance to plain object and returns it. Takes care of converting all of this element's children.
  19358. *
  19359. * @returns {Object} `Element` instance converted to plain object.
  19360. */
  19361. toJSON() {
  19362. const json = super.toJSON();
  19363. json.name = this.name;
  19364. if ( this._children.length > 0 ) {
  19365. json.children = [];
  19366. for ( const node of this._children ) {
  19367. json.children.push( node.toJSON() );
  19368. }
  19369. }
  19370. return json;
  19371. }
  19372. /**
  19373. * Creates a copy of this element and returns it. Created element has the same name and attributes as the original element.
  19374. * If clone is deep, the original element's children are also cloned. If not, then empty element is returned.
  19375. *
  19376. * @protected
  19377. * @param {Boolean} [deep=false] If set to `true` clones element and all its children recursively. When set to `false`,
  19378. * element will be cloned without any child.
  19379. */
  19380. _clone( deep = false ) {
  19381. const children = deep ? Array.from( this._children ).map( node => node._clone( true ) ) : null;
  19382. return new Element( this.name, this.getAttributes(), children );
  19383. }
  19384. /**
  19385. * {@link module:engine/model/element~Element#_insertChild Inserts} one or more nodes at the end of this element.
  19386. *
  19387. * @see module:engine/model/writer~Writer#append
  19388. * @protected
  19389. * @param {module:engine/model/item~Item|Iterable.<module:engine/model/item~Item>} nodes Nodes to be inserted.
  19390. */
  19391. _appendChild( nodes ) {
  19392. this._insertChild( this.childCount, nodes );
  19393. }
  19394. /**
  19395. * Inserts one or more nodes at the given index and sets {@link module:engine/model/node~Node#parent parent} of these nodes
  19396. * to this element.
  19397. *
  19398. * @see module:engine/model/writer~Writer#insert
  19399. * @protected
  19400. * @param {Number} index Index at which nodes should be inserted.
  19401. * @param {module:engine/model/item~Item|Iterable.<module:engine/model/item~Item>} items Items to be inserted.
  19402. */
  19403. _insertChild( index, items ) {
  19404. const nodes = normalize( items );
  19405. for ( const node of nodes ) {
  19406. // If node that is being added to this element is already inside another element, first remove it from the old parent.
  19407. if ( node.parent !== null ) {
  19408. node._remove();
  19409. }
  19410. node.parent = this;
  19411. }
  19412. this._children._insertNodes( index, nodes );
  19413. }
  19414. /**
  19415. * Removes one or more nodes starting at the given index and sets
  19416. * {@link module:engine/model/node~Node#parent parent} of these nodes to `null`.
  19417. *
  19418. * @see module:engine/model/writer~Writer#remove
  19419. * @protected
  19420. * @param {Number} index Index of the first node to remove.
  19421. * @param {Number} [howMany=1] Number of nodes to remove.
  19422. * @returns {Array.<module:engine/model/node~Node>} Array containing removed nodes.
  19423. */
  19424. _removeChildren( index, howMany = 1 ) {
  19425. const nodes = this._children._removeNodes( index, howMany );
  19426. for ( const node of nodes ) {
  19427. node.parent = null;
  19428. }
  19429. return nodes;
  19430. }
  19431. /**
  19432. * Creates an `Element` instance from given plain object (i.e. parsed JSON string).
  19433. * Converts `Element` children to proper nodes.
  19434. *
  19435. * @param {Object} json Plain object to be converted to `Element`.
  19436. * @returns {module:engine/model/element~Element} `Element` instance created using given plain object.
  19437. */
  19438. static fromJSON( json ) {
  19439. let children = null;
  19440. if ( json.children ) {
  19441. children = [];
  19442. for ( const child of json.children ) {
  19443. if ( child.name ) {
  19444. // If child has name property, it is an Element.
  19445. children.push( Element.fromJSON( child ) );
  19446. } else {
  19447. // Otherwise, it is a Text node.
  19448. children.push( _text__WEBPACK_IMPORTED_MODULE_2__["default"].fromJSON( child ) );
  19449. }
  19450. }
  19451. }
  19452. return new Element( json.name, json.attributes, children );
  19453. }
  19454. // @if CK_DEBUG_ENGINE // toString() {
  19455. // @if CK_DEBUG_ENGINE // return `<${ this.rootName || this.name }>`;
  19456. // @if CK_DEBUG_ENGINE // }
  19457. // @if CK_DEBUG_ENGINE // log() {
  19458. // @if CK_DEBUG_ENGINE // console.log( 'ModelElement: ' + this );
  19459. // @if CK_DEBUG_ENGINE // }
  19460. // @if CK_DEBUG_ENGINE // logExtended() {
  19461. // @if CK_DEBUG_ENGINE // console.log( `ModelElement: ${ this }, ${ this.childCount } children,
  19462. // @if CK_DEBUG_ENGINE // attrs: ${ convertMapToStringifiedObject( this.getAttributes() ) }` );
  19463. // @if CK_DEBUG_ENGINE // }
  19464. // @if CK_DEBUG_ENGINE // logAll() {
  19465. // @if CK_DEBUG_ENGINE // console.log( '--------------------' );
  19466. // @if CK_DEBUG_ENGINE //
  19467. // @if CK_DEBUG_ENGINE // this.logExtended();
  19468. // @if CK_DEBUG_ENGINE // console.log( 'List of children:' );
  19469. // @if CK_DEBUG_ENGINE //
  19470. // @if CK_DEBUG_ENGINE // for ( const child of this.getChildren() ) {
  19471. // @if CK_DEBUG_ENGINE // child.log();
  19472. // @if CK_DEBUG_ENGINE // }
  19473. // @if CK_DEBUG_ENGINE // }
  19474. // @if CK_DEBUG_ENGINE // printTree( level = 0) {
  19475. // @if CK_DEBUG_ENGINE // let string = '';
  19476. // @if CK_DEBUG_ENGINE // string += '\t'.repeat( level );
  19477. // @if CK_DEBUG_ENGINE // string += `<${ this.rootName || this.name }${ convertMapToTags( this.getAttributes() ) }>`;
  19478. // @if CK_DEBUG_ENGINE // for ( const child of this.getChildren() ) {
  19479. // @if CK_DEBUG_ENGINE // string += '\n';
  19480. // @if CK_DEBUG_ENGINE // if ( child.is( '$text' ) ) {
  19481. // @if CK_DEBUG_ENGINE // const textAttrs = convertMapToTags( child._attrs );
  19482. // @if CK_DEBUG_ENGINE // string += '\t'.repeat( level + 1 );
  19483. // @if CK_DEBUG_ENGINE // if ( textAttrs !== '' ) {
  19484. // @if CK_DEBUG_ENGINE // string += `<$text${ textAttrs }>` + child.data + '</$text>';
  19485. // @if CK_DEBUG_ENGINE // } else {
  19486. // @if CK_DEBUG_ENGINE // string += child.data;
  19487. // @if CK_DEBUG_ENGINE // }
  19488. // @if CK_DEBUG_ENGINE // } else {
  19489. // @if CK_DEBUG_ENGINE // string += child.printTree( level + 1 );
  19490. // @if CK_DEBUG_ENGINE // }
  19491. // @if CK_DEBUG_ENGINE // }
  19492. // @if CK_DEBUG_ENGINE // if ( this.childCount ) {
  19493. // @if CK_DEBUG_ENGINE // string += '\n' + '\t'.repeat( level );
  19494. // @if CK_DEBUG_ENGINE // }
  19495. // @if CK_DEBUG_ENGINE // string += `</${ this.rootName || this.name }>`;
  19496. // @if CK_DEBUG_ENGINE // return string;
  19497. // @if CK_DEBUG_ENGINE // }
  19498. // @if CK_DEBUG_ENGINE // logTree() {
  19499. // @if CK_DEBUG_ENGINE // console.log( this.printTree() );
  19500. // @if CK_DEBUG_ENGINE // }
  19501. }
  19502. // Converts strings to Text and non-iterables to arrays.
  19503. //
  19504. // @param {String|module:engine/model/item~Item|Iterable.<String|module:engine/model/item~Item>}
  19505. // @returns {Iterable.<module:engine/model/node~Node>}
  19506. function normalize( nodes ) {
  19507. // Separate condition because string is iterable.
  19508. if ( typeof nodes == 'string' ) {
  19509. return [ new _text__WEBPACK_IMPORTED_MODULE_2__["default"]( nodes ) ];
  19510. }
  19511. if ( !Object(_ckeditor_ckeditor5_utils_src_isiterable__WEBPACK_IMPORTED_MODULE_4__["default"])( nodes ) ) {
  19512. nodes = [ nodes ];
  19513. }
  19514. // Array.from to enable .map() on non-arrays.
  19515. return Array.from( nodes )
  19516. .map( node => {
  19517. if ( typeof node == 'string' ) {
  19518. return new _text__WEBPACK_IMPORTED_MODULE_2__["default"]( node );
  19519. }
  19520. if ( node instanceof _textproxy__WEBPACK_IMPORTED_MODULE_3__["default"] ) {
  19521. return new _text__WEBPACK_IMPORTED_MODULE_2__["default"]( node.data, node.getAttributes() );
  19522. }
  19523. return node;
  19524. } );
  19525. }
  19526. /***/ }),
  19527. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/history.js":
  19528. /*!**********************************************************************!*\
  19529. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/history.js ***!
  19530. \**********************************************************************/
  19531. /*! exports provided: default */
  19532. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  19533. "use strict";
  19534. __webpack_require__.r(__webpack_exports__);
  19535. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return History; });
  19536. /**
  19537. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  19538. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  19539. */
  19540. /**
  19541. * @module engine/model/history
  19542. */
  19543. /**
  19544. * `History` keeps the track of all the operations applied to the {@link module:engine/model/document~Document document}.
  19545. */
  19546. class History {
  19547. /**
  19548. * Creates an empty History instance.
  19549. */
  19550. constructor() {
  19551. /**
  19552. * Operations added to the history.
  19553. *
  19554. * @protected
  19555. * @member {Array.<module:engine/model/operation/operation~Operation>} module:engine/model/history~History#_operations
  19556. */
  19557. this._operations = [];
  19558. /**
  19559. * Holds an information which {@link module:engine/model/operation/operation~Operation operation} undoes which
  19560. * {@link module:engine/model/operation/operation~Operation operation}.
  19561. *
  19562. * Keys of the map are "undoing operations", that is operations that undone some other operations. For each key, the
  19563. * value is an operation that has been undone by the "undoing operation".
  19564. *
  19565. * @private
  19566. * @member {Map} module:engine/model/history~History#_undoPairs
  19567. */
  19568. this._undoPairs = new Map();
  19569. /**
  19570. * Holds all undone operations.
  19571. *
  19572. * @private
  19573. * @member {Set.<module:engine/model/operation/operation~Operation>} module:engine/model/history~History#_undoneOperations
  19574. */
  19575. this._undoneOperations = new Set();
  19576. }
  19577. /**
  19578. * Adds an operation to the history.
  19579. *
  19580. * @param {module:engine/model/operation/operation~Operation} operation Operation to add.
  19581. */
  19582. addOperation( operation ) {
  19583. if ( this._operations.includes( operation ) ) {
  19584. return;
  19585. }
  19586. this._operations.push( operation );
  19587. }
  19588. /**
  19589. * Returns operations added to the history.
  19590. *
  19591. * @param {Number} [from=Number.NEGATIVE_INFINITY] Base version from which operations should be returned (inclusive).
  19592. * Defaults to `Number.NEGATIVE_INFINITY`, which means that operations from the first one will be returned.
  19593. * @param {Number} [to=Number.POSITIVE_INFINITY] Base version up to which operations should be returned (exclusive).
  19594. * Defaults to `Number.POSITIVE_INFINITY` which means that operations up to the last one will be returned.
  19595. * @returns {Array.<module:engine/model/operation/operation~Operation>} Operations added to the history.
  19596. */
  19597. getOperations( from = Number.NEGATIVE_INFINITY, to = Number.POSITIVE_INFINITY ) {
  19598. const operations = [];
  19599. for ( const operation of this._operations ) {
  19600. if ( operation.baseVersion >= from && operation.baseVersion < to ) {
  19601. operations.push( operation );
  19602. }
  19603. }
  19604. return operations;
  19605. }
  19606. /**
  19607. * Returns operation from the history that bases on given `baseVersion`.
  19608. *
  19609. * @param {Number} baseVersion Base version of the operation to get.
  19610. * @returns {module:engine/model/operation/operation~Operation|undefined} Operation with given base version or `undefined` if
  19611. * there is no such operation in history.
  19612. */
  19613. getOperation( baseVersion ) {
  19614. for ( const operation of this._operations ) {
  19615. if ( operation.baseVersion == baseVersion ) {
  19616. return operation;
  19617. }
  19618. }
  19619. }
  19620. /**
  19621. * Marks in history that one operation is an operation that is undoing the other operation. By marking operation this way,
  19622. * history is keeping more context information about operations, which helps in operational transformation.
  19623. *
  19624. * @param {module:engine/model/operation/operation~Operation} undoneOperation Operation which is undone by `undoingOperation`.
  19625. * @param {module:engine/model/operation/operation~Operation} undoingOperation Operation which undoes `undoneOperation`.
  19626. */
  19627. setOperationAsUndone( undoneOperation, undoingOperation ) {
  19628. this._undoPairs.set( undoingOperation, undoneOperation );
  19629. this._undoneOperations.add( undoneOperation );
  19630. }
  19631. /**
  19632. * Checks whether given `operation` is undoing any other operation.
  19633. *
  19634. * @param {module:engine/model/operation/operation~Operation} operation Operation to check.
  19635. * @returns {Boolean} `true` if given `operation` is undoing any other operation, `false` otherwise.
  19636. */
  19637. isUndoingOperation( operation ) {
  19638. return this._undoPairs.has( operation );
  19639. }
  19640. /**
  19641. * Checks whether given `operation` has been undone by any other operation.
  19642. *
  19643. * @param {module:engine/model/operation/operation~Operation} operation Operation to check.
  19644. * @returns {Boolean} `true` if given `operation` has been undone any other operation, `false` otherwise.
  19645. */
  19646. isUndoneOperation( operation ) {
  19647. return this._undoneOperations.has( operation );
  19648. }
  19649. /**
  19650. * For given `undoingOperation`, returns the operation which has been undone by it.
  19651. *
  19652. * @param {module:engine/model/operation/operation~Operation} undoingOperation
  19653. * @returns {module:engine/model/operation/operation~Operation|undefined} Operation that has been undone by given
  19654. * `undoingOperation` or `undefined` if given `undoingOperation` is not undoing any other operation.
  19655. */
  19656. getUndoneOperation( undoingOperation ) {
  19657. return this._undoPairs.get( undoingOperation );
  19658. }
  19659. }
  19660. /***/ }),
  19661. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/liveposition.js":
  19662. /*!***************************************************************************!*\
  19663. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/liveposition.js ***!
  19664. \***************************************************************************/
  19665. /*! exports provided: default */
  19666. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  19667. "use strict";
  19668. __webpack_require__.r(__webpack_exports__);
  19669. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return LivePosition; });
  19670. /* harmony import */ var _position__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./position */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/position.js");
  19671. /* 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");
  19672. /* 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");
  19673. /* 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");
  19674. /**
  19675. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  19676. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  19677. */
  19678. /**
  19679. * @module engine/model/liveposition
  19680. */
  19681. /**
  19682. * `LivePosition` is a type of {@link module:engine/model/position~Position Position}
  19683. * that updates itself as {@link module:engine/model/document~Document document}
  19684. * is changed through operations. It may be used as a bookmark.
  19685. *
  19686. * **Note:** Contrary to {@link module:engine/model/position~Position}, `LivePosition` works only in roots that are
  19687. * {@link module:engine/model/rootelement~RootElement}.
  19688. * If {@link module:engine/model/documentfragment~DocumentFragment} is passed, error will be thrown.
  19689. *
  19690. * **Note:** Be very careful when dealing with `LivePosition`. Each `LivePosition` instance bind events that might
  19691. * have to be unbound.
  19692. * Use {@link module:engine/model/liveposition~LivePosition#detach} whenever you don't need `LivePosition` anymore.
  19693. *
  19694. * @extends module:engine/model/position~Position
  19695. */
  19696. class LivePosition extends _position__WEBPACK_IMPORTED_MODULE_0__["default"] {
  19697. /**
  19698. * Creates a live position.
  19699. *
  19700. * @see module:engine/model/position~Position
  19701. * @param {module:engine/model/rootelement~RootElement} root
  19702. * @param {Array.<Number>} path
  19703. * @param {module:engine/model/position~PositionStickiness} [stickiness]
  19704. */
  19705. constructor( root, path, stickiness = 'toNone' ) {
  19706. super( root, path, stickiness );
  19707. if ( !this.root.is( 'rootElement' ) ) {
  19708. /**
  19709. * LivePosition's root has to be an instance of RootElement.
  19710. *
  19711. * @error model-liveposition-root-not-rootelement
  19712. */
  19713. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_3__["default"]( 'model-liveposition-root-not-rootelement', root );
  19714. }
  19715. bindWithDocument.call( this );
  19716. }
  19717. /**
  19718. * Unbinds all events previously bound by `LivePosition`. Use it whenever you don't need `LivePosition` instance
  19719. * anymore (i.e. when leaving scope in which it was declared or before re-assigning variable that was
  19720. * referring to it).
  19721. */
  19722. detach() {
  19723. this.stopListening();
  19724. }
  19725. /**
  19726. * Checks whether this object is of the given.
  19727. *
  19728. * livePosition.is( 'position' ); // -> true
  19729. * livePosition.is( 'model:position' ); // -> true
  19730. * livePosition.is( 'liveposition' ); // -> true
  19731. * livePosition.is( 'model:livePosition' ); // -> true
  19732. *
  19733. * livePosition.is( 'view:position' ); // -> false
  19734. * livePosition.is( 'documentSelection' ); // -> false
  19735. *
  19736. * {@link module:engine/model/node~Node#is Check the entire list of model objects} which implement the `is()` method.
  19737. *
  19738. * @param {String} type
  19739. * @returns {Boolean}
  19740. */
  19741. is( type ) {
  19742. return type === 'livePosition' || type === 'model:livePosition' ||
  19743. // From super.is(). This is highly utilised method and cannot call super. See ckeditor/ckeditor5#6529.
  19744. type == 'position' || type === 'model:position';
  19745. }
  19746. /**
  19747. * Creates a {@link module:engine/model/position~Position position instance}, which is equal to this live position.
  19748. *
  19749. * @returns {module:engine/model/position~Position}
  19750. */
  19751. toPosition() {
  19752. return new _position__WEBPACK_IMPORTED_MODULE_0__["default"]( this.root, this.path.slice(), this.stickiness );
  19753. }
  19754. /**
  19755. * Creates a `LivePosition` instance that is equal to position.
  19756. *
  19757. * @param {module:engine/model/position~Position} position
  19758. * @param {module:engine/model/position~PositionStickiness} [stickiness]
  19759. * @returns {module:engine/model/liveposition~LivePosition}
  19760. */
  19761. static fromPosition( position, stickiness ) {
  19762. return new this( position.root, position.path.slice(), stickiness ? stickiness : position.stickiness );
  19763. }
  19764. /**
  19765. * @static
  19766. * @protected
  19767. * @method module:engine/model/liveposition~LivePosition._createAfter
  19768. * @see module:engine/model/position~Position._createAfter
  19769. * @param {module:engine/model/node~Node} node
  19770. * @param {module:engine/model/position~PositionStickiness} [stickiness='toNone']
  19771. * @returns {module:engine/model/liveposition~LivePosition}
  19772. */
  19773. /**
  19774. * @static
  19775. * @protected
  19776. * @method module:engine/model/liveposition~LivePosition._createBefore
  19777. * @see module:engine/model/position~Position._createBefore
  19778. * @param {module:engine/model/node~Node} node
  19779. * @param {module:engine/model/position~PositionStickiness} [stickiness='toNone']
  19780. * @returns {module:engine/model/liveposition~LivePosition}
  19781. */
  19782. /**
  19783. * @static
  19784. * @protected
  19785. * @method module:engine/model/liveposition~LivePosition._createAt
  19786. * @see module:engine/model/position~Position._createAt
  19787. * @param {module:engine/model/item~Item|module:engine/model/position~Position} itemOrPosition
  19788. * @param {Number|'end'|'before'|'after'} [offset]
  19789. * @param {module:engine/model/position~PositionStickiness} [stickiness='toNone']
  19790. * @returns {module:engine/model/liveposition~LivePosition}
  19791. */
  19792. /**
  19793. * Fired when `LivePosition` instance is changed due to changes on {@link module:engine/model/document~Document}.
  19794. *
  19795. * @event module:engine/model/liveposition~LivePosition#change
  19796. * @param {module:engine/model/position~Position} oldPosition Position equal to this live position before it got changed.
  19797. */
  19798. }
  19799. // Binds this `LivePosition` to the {@link module:engine/model/document~Document document} that owns
  19800. // this position's {@link module:engine/model/position~Position#root root}.
  19801. //
  19802. // @private
  19803. function bindWithDocument() {
  19804. this.listenTo(
  19805. this.root.document.model,
  19806. 'applyOperation',
  19807. ( event, args ) => {
  19808. const operation = args[ 0 ];
  19809. if ( !operation.isDocumentOperation ) {
  19810. return;
  19811. }
  19812. transform.call( this, operation );
  19813. },
  19814. { priority: 'low' }
  19815. );
  19816. }
  19817. // Updates this position accordingly to the updates applied to the model. Bases on change events.
  19818. //
  19819. // @private
  19820. // @param {module:engine/model/operation/operation~Operation} operation Executed operation.
  19821. function transform( operation ) {
  19822. const result = this.getTransformedByOperation( operation );
  19823. if ( !this.isEqual( result ) ) {
  19824. const oldPosition = this.toPosition();
  19825. this.path = result.path;
  19826. this.root = result.root;
  19827. this.fire( 'change', oldPosition );
  19828. }
  19829. }
  19830. Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_2__["default"])( LivePosition, _ckeditor_ckeditor5_utils_src_emittermixin__WEBPACK_IMPORTED_MODULE_1__["default"] );
  19831. /***/ }),
  19832. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/liverange.js":
  19833. /*!************************************************************************!*\
  19834. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/liverange.js ***!
  19835. \************************************************************************/
  19836. /*! exports provided: default */
  19837. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  19838. "use strict";
  19839. __webpack_require__.r(__webpack_exports__);
  19840. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return LiveRange; });
  19841. /* harmony import */ var _range__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./range */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/range.js");
  19842. /* 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");
  19843. /* 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");
  19844. /**
  19845. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  19846. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  19847. */
  19848. /**
  19849. * @module engine/model/liverange
  19850. */
  19851. /**
  19852. * `LiveRange` is a type of {@link module:engine/model/range~Range Range}
  19853. * that updates itself as {@link module:engine/model/document~Document document}
  19854. * is changed through operations. It may be used as a bookmark.
  19855. *
  19856. * **Note:** Be very careful when dealing with `LiveRange`. Each `LiveRange` instance bind events that might
  19857. * have to be unbound. Use {@link module:engine/model/liverange~LiveRange#detach detach} whenever you don't need `LiveRange` anymore.
  19858. */
  19859. class LiveRange extends _range__WEBPACK_IMPORTED_MODULE_0__["default"] {
  19860. /**
  19861. * Creates a live range.
  19862. *
  19863. * @see module:engine/model/range~Range
  19864. */
  19865. constructor( start, end ) {
  19866. super( start, end );
  19867. bindWithDocument.call( this );
  19868. }
  19869. /**
  19870. * Unbinds all events previously bound by `LiveRange`. Use it whenever you don't need `LiveRange` instance
  19871. * anymore (i.e. when leaving scope in which it was declared or before re-assigning variable that was
  19872. * referring to it).
  19873. */
  19874. detach() {
  19875. this.stopListening();
  19876. }
  19877. /**
  19878. * Checks whether this object is of the given.
  19879. *
  19880. * liveRange.is( 'range' ); // -> true
  19881. * liveRange.is( 'model:range' ); // -> true
  19882. * liveRange.is( 'liveRange' ); // -> true
  19883. * liveRange.is( 'model:liveRange' ); // -> true
  19884. *
  19885. * liveRange.is( 'view:range' ); // -> false
  19886. * liveRange.is( 'documentSelection' ); // -> false
  19887. *
  19888. * {@link module:engine/model/node~Node#is Check the entire list of model objects} which implement the `is()` method.
  19889. *
  19890. * @param {String} type
  19891. * @returns {Boolean}
  19892. */
  19893. is( type ) {
  19894. return type === 'liveRange' || type === 'model:liveRange' ||
  19895. // From super.is(). This is highly utilised method and cannot call super. See ckeditor/ckeditor5#6529.
  19896. type == 'range' || type === 'model:range';
  19897. }
  19898. /**
  19899. * Creates a {@link module:engine/model/range~Range range instance} that is equal to this live range.
  19900. *
  19901. * @returns {module:engine/model/range~Range}
  19902. */
  19903. toRange() {
  19904. return new _range__WEBPACK_IMPORTED_MODULE_0__["default"]( this.start, this.end );
  19905. }
  19906. /**
  19907. * Creates a `LiveRange` instance that is equal to the given range.
  19908. *
  19909. * @param {module:engine/model/range~Range} range
  19910. * @returns {module:engine/model/liverange~LiveRange}
  19911. */
  19912. static fromRange( range ) {
  19913. return new LiveRange( range.start, range.end );
  19914. }
  19915. /**
  19916. * @see module:engine/model/range~Range._createIn
  19917. * @static
  19918. * @protected
  19919. * @method module:engine/model/liverange~LiveRange._createIn
  19920. * @param {module:engine/model/element~Element} element
  19921. * @returns {module:engine/model/liverange~LiveRange}
  19922. */
  19923. /**
  19924. * @see module:engine/model/range~Range._createOn
  19925. * @static
  19926. * @protected
  19927. * @method module:engine/model/liverange~LiveRange._createOn
  19928. * @param {module:engine/model/element~Element} element
  19929. * @returns {module:engine/model/liverange~LiveRange}
  19930. */
  19931. /**
  19932. * @see module:engine/model/range~Range._createFromPositionAndShift
  19933. * @static
  19934. * @protected
  19935. * @method module:engine/model/liverange~LiveRange._createFromPositionAndShift
  19936. * @param {module:engine/model/position~Position} position
  19937. * @param {Number} shift
  19938. * @returns {module:engine/model/liverange~LiveRange}
  19939. */
  19940. /**
  19941. * Fired when `LiveRange` instance boundaries have changed due to changes in the
  19942. * {@link module:engine/model/document~Document document}.
  19943. *
  19944. * @event change:range
  19945. * @param {module:engine/model/range~Range} oldRange Range with start and end position equal to start and end position of this live
  19946. * range before it got changed.
  19947. * @param {Object} data Object with additional information about the change.
  19948. * @param {module:engine/model/position~Position|null} data.deletionPosition Source position for remove and merge changes.
  19949. * Available if the range was moved to the graveyard root, `null` otherwise.
  19950. */
  19951. /**
  19952. * Fired when `LiveRange` instance boundaries have not changed after a change in {@link module:engine/model/document~Document document}
  19953. * but the change took place inside the range, effectively changing its content.
  19954. *
  19955. * @event change:content
  19956. * @param {module:engine/model/range~Range} range Range with start and end position equal to start and end position of
  19957. * change range.
  19958. * @param {Object} data Object with additional information about the change.
  19959. * @param {null} data.deletionPosition Due to the nature of this event, this property is always set to `null`. It is passed
  19960. * for compatibility with the {@link module:engine/model/liverange~LiveRange#event:change:range} event.
  19961. */
  19962. }
  19963. // Binds this `LiveRange` to the {@link module:engine/model/document~Document document}
  19964. // that owns this range's {@link module:engine/model/range~Range#root root}.
  19965. //
  19966. // @private
  19967. function bindWithDocument() {
  19968. this.listenTo(
  19969. this.root.document.model,
  19970. 'applyOperation',
  19971. ( event, args ) => {
  19972. const operation = args[ 0 ];
  19973. if ( !operation.isDocumentOperation ) {
  19974. return;
  19975. }
  19976. transform.call( this, operation );
  19977. },
  19978. { priority: 'low' }
  19979. );
  19980. }
  19981. // Updates this range accordingly to the updates applied to the model. Bases on change events.
  19982. //
  19983. // @private
  19984. // @param {module:engine/model/operation/operation~Operation} operation Executed operation.
  19985. function transform( operation ) {
  19986. // Transform the range by the operation. Join the result ranges if needed.
  19987. const ranges = this.getTransformedByOperation( operation );
  19988. const result = _range__WEBPACK_IMPORTED_MODULE_0__["default"]._createFromRanges( ranges );
  19989. const boundariesChanged = !result.isEqual( this );
  19990. const contentChanged = doesOperationChangeRangeContent( this, operation );
  19991. let deletionPosition = null;
  19992. if ( boundariesChanged ) {
  19993. // If range boundaries have changed, fire `change:range` event.
  19994. //
  19995. if ( result.root.rootName == '$graveyard' ) {
  19996. // If the range was moved to the graveyard root, set `deletionPosition`.
  19997. if ( operation.type == 'remove' ) {
  19998. deletionPosition = operation.sourcePosition;
  19999. } else {
  20000. // Merge operation.
  20001. deletionPosition = operation.deletionPosition;
  20002. }
  20003. }
  20004. const oldRange = this.toRange();
  20005. this.start = result.start;
  20006. this.end = result.end;
  20007. this.fire( 'change:range', oldRange, { deletionPosition } );
  20008. } else if ( contentChanged ) {
  20009. // If range boundaries have not changed, but there was change inside the range, fire `change:content` event.
  20010. this.fire( 'change:content', this.toRange(), { deletionPosition } );
  20011. }
  20012. }
  20013. // Checks whether given operation changes something inside the range (even if it does not change boundaries).
  20014. //
  20015. // @private
  20016. // @param {module:engine/model/range~Range} range Range to check.
  20017. // @param {module:engine/model/operation/operation~Operation} operation Executed operation.
  20018. // @returns {Boolean}
  20019. function doesOperationChangeRangeContent( range, operation ) {
  20020. switch ( operation.type ) {
  20021. case 'insert':
  20022. return range.containsPosition( operation.position );
  20023. case 'move':
  20024. case 'remove':
  20025. case 'reinsert':
  20026. case 'merge':
  20027. return range.containsPosition( operation.sourcePosition ) ||
  20028. range.start.isEqual( operation.sourcePosition ) ||
  20029. range.containsPosition( operation.targetPosition );
  20030. case 'split':
  20031. return range.containsPosition( operation.splitPosition ) || range.containsPosition( operation.insertionPosition );
  20032. }
  20033. return false;
  20034. }
  20035. Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_2__["default"])( LiveRange, _ckeditor_ckeditor5_utils_src_emittermixin__WEBPACK_IMPORTED_MODULE_1__["default"] );
  20036. /***/ }),
  20037. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/markercollection.js":
  20038. /*!*******************************************************************************!*\
  20039. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/markercollection.js ***!
  20040. \*******************************************************************************/
  20041. /*! exports provided: default */
  20042. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  20043. "use strict";
  20044. __webpack_require__.r(__webpack_exports__);
  20045. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return MarkerCollection; });
  20046. /* harmony import */ var _liverange__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./liverange */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/liverange.js");
  20047. /* 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");
  20048. /* 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");
  20049. /* 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");
  20050. /**
  20051. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  20052. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  20053. */
  20054. /**
  20055. * @module engine/model/markercollection
  20056. */
  20057. /**
  20058. * The collection of all {@link module:engine/model/markercollection~Marker markers} attached to the document.
  20059. * It lets you {@link module:engine/model/markercollection~MarkerCollection#get get} markers or track them using
  20060. * {@link module:engine/model/markercollection~MarkerCollection#event:update} event.
  20061. *
  20062. * To create, change or remove makers use {@link module:engine/model/writer~Writer model writers'} methods:
  20063. * {@link module:engine/model/writer~Writer#addMarker} or {@link module:engine/model/writer~Writer#removeMarker}. Since
  20064. * the writer is the only proper way to change the data model it is not possible to change markers directly using this
  20065. * collection. All markers created by the writer will be automatically added to this collection.
  20066. *
  20067. * By default there is one marker collection available as {@link module:engine/model/model~Model#markers model property}.
  20068. *
  20069. * @see module:engine/model/markercollection~Marker
  20070. */
  20071. class MarkerCollection {
  20072. /**
  20073. * Creates a markers collection.
  20074. */
  20075. constructor() {
  20076. /**
  20077. * Stores {@link ~Marker markers} added to the collection.
  20078. *
  20079. * @private
  20080. * @member {Map} #_markers
  20081. */
  20082. this._markers = new Map();
  20083. }
  20084. /**
  20085. * Iterable interface.
  20086. *
  20087. * Iterates over all {@link ~Marker markers} added to the collection.
  20088. *
  20089. * @returns {Iterable}
  20090. */
  20091. [ Symbol.iterator ]() {
  20092. return this._markers.values();
  20093. }
  20094. /**
  20095. * Checks if marker with given `markerName` is in the collection.
  20096. *
  20097. * @param {String} markerName Marker name.
  20098. * @returns {Boolean} `true` if marker with given `markerName` is in the collection, `false` otherwise.
  20099. */
  20100. has( markerName ) {
  20101. return this._markers.has( markerName );
  20102. }
  20103. /**
  20104. * Returns {@link ~Marker marker} with given `markerName`.
  20105. *
  20106. * @param {String} markerName Name of marker to get.
  20107. * @returns {module:engine/model/markercollection~Marker|null} Marker with given name or `null` if such marker was
  20108. * not added to the collection.
  20109. */
  20110. get( markerName ) {
  20111. return this._markers.get( markerName ) || null;
  20112. }
  20113. /**
  20114. * Creates and adds a {@link ~Marker marker} to the `MarkerCollection` with given name on given
  20115. * {@link module:engine/model/range~Range range}.
  20116. *
  20117. * If `MarkerCollection` already had a marker with given name (or {@link ~Marker marker} was passed), the marker in
  20118. * collection is updated and {@link module:engine/model/markercollection~MarkerCollection#event:update} event is fired
  20119. * but only if there was a change (marker range or {@link module:engine/model/markercollection~Marker#managedUsingOperations}
  20120. * flag has changed.
  20121. *
  20122. * @protected
  20123. * @fires module:engine/model/markercollection~MarkerCollection#event:update
  20124. * @param {String|module:engine/model/markercollection~Marker} markerOrName Name of marker to set or marker instance to update.
  20125. * @param {module:engine/model/range~Range} range Marker range.
  20126. * @param {Boolean} [managedUsingOperations=false] Specifies whether the marker is managed using operations.
  20127. * @param {Boolean} [affectsData=false] Specifies whether the marker affects the data produced by the data pipeline
  20128. * (is persisted in the editor's data).
  20129. * @returns {module:engine/model/markercollection~Marker} `Marker` instance which was added or updated.
  20130. */
  20131. _set( markerOrName, range, managedUsingOperations = false, affectsData = false ) {
  20132. const markerName = markerOrName instanceof Marker ? markerOrName.name : markerOrName;
  20133. if ( markerName.includes( ',' ) ) {
  20134. /**
  20135. * Marker name cannot contain the "," character.
  20136. *
  20137. * @error markercollection-incorrect-marker-name
  20138. */
  20139. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__["default"]( 'markercollection-incorrect-marker-name', this );
  20140. }
  20141. const oldMarker = this._markers.get( markerName );
  20142. if ( oldMarker ) {
  20143. const oldRange = oldMarker.getRange();
  20144. let hasChanged = false;
  20145. if ( !oldRange.isEqual( range ) ) {
  20146. oldMarker._attachLiveRange( _liverange__WEBPACK_IMPORTED_MODULE_0__["default"].fromRange( range ) );
  20147. hasChanged = true;
  20148. }
  20149. if ( managedUsingOperations != oldMarker.managedUsingOperations ) {
  20150. oldMarker._managedUsingOperations = managedUsingOperations;
  20151. hasChanged = true;
  20152. }
  20153. if ( typeof affectsData === 'boolean' && affectsData != oldMarker.affectsData ) {
  20154. oldMarker._affectsData = affectsData;
  20155. hasChanged = true;
  20156. }
  20157. if ( hasChanged ) {
  20158. this.fire( 'update:' + markerName, oldMarker, oldRange, range );
  20159. }
  20160. return oldMarker;
  20161. }
  20162. const liveRange = _liverange__WEBPACK_IMPORTED_MODULE_0__["default"].fromRange( range );
  20163. const marker = new Marker( markerName, liveRange, managedUsingOperations, affectsData );
  20164. this._markers.set( markerName, marker );
  20165. this.fire( 'update:' + markerName, marker, null, range );
  20166. return marker;
  20167. }
  20168. /**
  20169. * Removes given {@link ~Marker marker} or a marker with given name from the `MarkerCollection`.
  20170. *
  20171. * @protected
  20172. * @fires module:engine/model/markercollection~MarkerCollection#event:update
  20173. * @param {String} markerOrName Marker or name of a marker to remove.
  20174. * @returns {Boolean} `true` if marker was found and removed, `false` otherwise.
  20175. */
  20176. _remove( markerOrName ) {
  20177. const markerName = markerOrName instanceof Marker ? markerOrName.name : markerOrName;
  20178. const oldMarker = this._markers.get( markerName );
  20179. if ( oldMarker ) {
  20180. this._markers.delete( markerName );
  20181. this.fire( 'update:' + markerName, oldMarker, oldMarker.getRange(), null );
  20182. this._destroyMarker( oldMarker );
  20183. return true;
  20184. }
  20185. return false;
  20186. }
  20187. /**
  20188. * Fires an {@link module:engine/model/markercollection~MarkerCollection#event:update} event for the given {@link ~Marker marker}
  20189. * but does not change the marker. Useful to force {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher downcast
  20190. * conversion} for the marker.
  20191. *
  20192. * @protected
  20193. * @fires module:engine/model/markercollection~MarkerCollection#event:update
  20194. * @param {String} markerOrName Marker or name of a marker to refresh.
  20195. */
  20196. _refresh( markerOrName ) {
  20197. const markerName = markerOrName instanceof Marker ? markerOrName.name : markerOrName;
  20198. const marker = this._markers.get( markerName );
  20199. if ( !marker ) {
  20200. /**
  20201. * Marker with provided name does not exists.
  20202. *
  20203. * @error markercollection-refresh-marker-not-exists
  20204. */
  20205. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__["default"]( 'markercollection-refresh-marker-not-exists', this );
  20206. }
  20207. const range = marker.getRange();
  20208. this.fire( 'update:' + markerName, marker, range, range, marker.managedUsingOperations, marker.affectsData );
  20209. }
  20210. /**
  20211. * Returns iterator that iterates over all markers, which ranges contain given {@link module:engine/model/position~Position position}.
  20212. *
  20213. * @param {module:engine/model/position~Position} position
  20214. * @returns {Iterable.<module:engine/model/markercollection~Marker>}
  20215. */
  20216. * getMarkersAtPosition( position ) {
  20217. for ( const marker of this ) {
  20218. if ( marker.getRange().containsPosition( position ) ) {
  20219. yield marker;
  20220. }
  20221. }
  20222. }
  20223. /**
  20224. * Returns iterator that iterates over all markers, which intersects with given {@link module:engine/model/range~Range range}.
  20225. *
  20226. * @param {module:engine/model/range~Range} range
  20227. * @returns {Iterable.<module:engine/model/markercollection~Marker>}
  20228. */
  20229. * getMarkersIntersectingRange( range ) {
  20230. for ( const marker of this ) {
  20231. if ( marker.getRange().getIntersection( range ) !== null ) {
  20232. yield marker;
  20233. }
  20234. }
  20235. }
  20236. /**
  20237. * Destroys marker collection and all markers inside it.
  20238. */
  20239. destroy() {
  20240. for ( const marker of this._markers.values() ) {
  20241. this._destroyMarker( marker );
  20242. }
  20243. this._markers = null;
  20244. this.stopListening();
  20245. }
  20246. /**
  20247. * Iterates over all markers that starts with given `prefix`.
  20248. *
  20249. * const markerFooA = markersCollection.set( 'foo:a', rangeFooA );
  20250. * const markerFooB = markersCollection.set( 'foo:b', rangeFooB );
  20251. * const markerBarA = markersCollection.set( 'bar:a', rangeBarA );
  20252. * const markerFooBarA = markersCollection.set( 'foobar:a', rangeFooBarA );
  20253. * Array.from( markersCollection.getMarkersGroup( 'foo' ) ); // [ markerFooA, markerFooB ]
  20254. * Array.from( markersCollection.getMarkersGroup( 'a' ) ); // []
  20255. *
  20256. * @param prefix
  20257. * @returns {Iterable.<module:engine/model/markercollection~Marker>}
  20258. */
  20259. * getMarkersGroup( prefix ) {
  20260. for ( const marker of this._markers.values() ) {
  20261. if ( marker.name.startsWith( prefix + ':' ) ) {
  20262. yield marker;
  20263. }
  20264. }
  20265. }
  20266. /**
  20267. * Destroys the marker.
  20268. *
  20269. * @private
  20270. * @param {module:engine/model/markercollection~Marker} marker Marker to destroy.
  20271. */
  20272. _destroyMarker( marker ) {
  20273. marker.stopListening();
  20274. marker._detachLiveRange();
  20275. }
  20276. /**
  20277. * Fired whenever marker is added, updated or removed from `MarkerCollection`.
  20278. *
  20279. * @event update
  20280. * @param {module:engine/model/markercollection~Marker} marker Updated Marker.
  20281. * @param {module:engine/model/range~Range|null} oldRange Marker range before the update. When is not defined it
  20282. * means that marker is just added.
  20283. * @param {module:engine/model/range~Range|null} newRange Marker range after update. When is not defined it
  20284. * means that marker is just removed.
  20285. */
  20286. }
  20287. Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_3__["default"])( MarkerCollection, _ckeditor_ckeditor5_utils_src_emittermixin__WEBPACK_IMPORTED_MODULE_1__["default"] );
  20288. /**
  20289. * `Marker` is a continuous parts of model (like a range), is named and represent some kind of information about marked
  20290. * part of model document. In contrary to {@link module:engine/model/node~Node nodes}, which are building blocks of
  20291. * model document tree, markers are not stored directly in document tree but in
  20292. * {@link module:engine/model/model~Model#markers model markers' collection}. Still, they are document data, by giving
  20293. * additional meaning to the part of a model document between marker start and marker end.
  20294. *
  20295. * In this sense, markers are similar to adding and converting attributes on nodes. The difference is that attribute is
  20296. * connected with a given node (e.g. a character is bold no matter if it gets moved or content around it changes).
  20297. * Markers on the other hand are continuous ranges and are characterized by their start and end position. This means that
  20298. * any character in the marker is marked by the marker. For example, if a character is moved outside of marker it stops being
  20299. * "special" and the marker is shrunk. Similarly, when a character is moved into the marker from other place in document
  20300. * model, it starts being "special" and the marker is enlarged.
  20301. *
  20302. * Another upside of markers is that finding marked part of document is fast and easy. Using attributes to mark some nodes
  20303. * and then trying to find that part of document would require traversing whole document tree. Marker gives instant access
  20304. * to the range which it is marking at the moment.
  20305. *
  20306. * Markers are built from a name and a range.
  20307. *
  20308. * Range of the marker is updated automatically when document changes, using
  20309. * {@link module:engine/model/liverange~LiveRange live range} mechanism.
  20310. *
  20311. * Name is used to group and identify markers. Names have to be unique, but markers can be grouped by
  20312. * using common prefixes, separated with `:`, for example: `user:john` or `search:3`. That's useful in term of creating
  20313. * namespaces for custom elements (e.g. comments, highlights). You can use this prefixes in
  20314. * {@link module:engine/model/markercollection~MarkerCollection#event:update} listeners to listen on changes in a group of markers.
  20315. * For instance: `model.markers.on( 'update:user', callback );` will be called whenever any `user:*` markers changes.
  20316. *
  20317. * There are two types of markers.
  20318. *
  20319. * 1. Markers managed directly, without using operations. They are added directly by {@link module:engine/model/writer~Writer}
  20320. * to the {@link module:engine/model/markercollection~MarkerCollection} without any additional mechanism. They can be used
  20321. * as bookmarks or visual markers. They are great for showing results of the find, or select link when the focus is in the input.
  20322. *
  20323. * 1. Markers managed using operations. These markers are also stored in {@link module:engine/model/markercollection~MarkerCollection}
  20324. * but changes in these markers is managed the same way all other changes in the model structure - using operations.
  20325. * Therefore, they are handled in the undo stack and synchronized between clients if the collaboration plugin is enabled.
  20326. * This type of markers is useful for solutions like spell checking or comments.
  20327. *
  20328. * Both type of them should be added / updated by {@link module:engine/model/writer~Writer#addMarker}
  20329. * and removed by {@link module:engine/model/writer~Writer#removeMarker} methods.
  20330. *
  20331. * model.change( ( writer ) => {
  20332. * const marker = writer.addMarker( name, { range, usingOperation: true } );
  20333. *
  20334. * // ...
  20335. *
  20336. * writer.removeMarker( marker );
  20337. * } );
  20338. *
  20339. * See {@link module:engine/model/writer~Writer} to find more examples.
  20340. *
  20341. * Since markers need to track change in the document, for efficiency reasons, it is best to create and keep as little
  20342. * markers as possible and remove them as soon as they are not needed anymore.
  20343. *
  20344. * Markers can be downcasted and upcasted.
  20345. *
  20346. * Markers downcast happens on {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:addMarker} and
  20347. * {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:removeMarker} events.
  20348. * Use {@link module:engine/conversion/downcasthelpers downcast converters} or attach a custom converter to mentioned events.
  20349. * For {@link module:engine/controller/datacontroller~DataController data pipeline}, marker should be downcasted to an element.
  20350. * Then, it can be upcasted back to a marker. Again, use {@link module:engine/conversion/upcasthelpers upcast converters} or
  20351. * attach a custom converter to {@link module:engine/conversion/upcastdispatcher~UpcastDispatcher#event:element}.
  20352. *
  20353. * `Marker` instances are created and destroyed only by {@link ~MarkerCollection MarkerCollection}.
  20354. */
  20355. class Marker {
  20356. /**
  20357. * Creates a marker instance.
  20358. *
  20359. * @param {String} name Marker name.
  20360. * @param {module:engine/model/liverange~LiveRange} liveRange Range marked by the marker.
  20361. * @param {Boolean} managedUsingOperations Specifies whether the marker is managed using operations.
  20362. * @param {Boolean} affectsData Specifies whether the marker affects the data produced by the data pipeline
  20363. * (is persisted in the editor's data).
  20364. */
  20365. constructor( name, liveRange, managedUsingOperations, affectsData ) {
  20366. /**
  20367. * Marker's name.
  20368. *
  20369. * @readonly
  20370. * @type {String}
  20371. */
  20372. this.name = name;
  20373. /**
  20374. * Range marked by the marker.
  20375. *
  20376. * @protected
  20377. * @member {module:engine/model/liverange~LiveRange}
  20378. */
  20379. this._liveRange = this._attachLiveRange( liveRange );
  20380. /**
  20381. * Flag indicates if the marker is managed using operations or not.
  20382. *
  20383. * @private
  20384. * @member {Boolean}
  20385. */
  20386. this._managedUsingOperations = managedUsingOperations;
  20387. /**
  20388. * Specifies whether the marker affects the data produced by the data pipeline
  20389. * (is persisted in the editor's data).
  20390. *
  20391. * @private
  20392. * @member {Boolean}
  20393. */
  20394. this._affectsData = affectsData;
  20395. }
  20396. /**
  20397. * A value indicating if the marker is managed using operations.
  20398. * See {@link ~Marker marker class description} to learn more about marker types.
  20399. * See {@link module:engine/model/writer~Writer#addMarker}.
  20400. *
  20401. * @returns {Boolean}
  20402. */
  20403. get managedUsingOperations() {
  20404. if ( !this._liveRange ) {
  20405. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__["default"]( 'marker-destroyed', this );
  20406. }
  20407. return this._managedUsingOperations;
  20408. }
  20409. /**
  20410. * A value indicating if the marker changes the data.
  20411. *
  20412. * @returns {Boolean}
  20413. */
  20414. get affectsData() {
  20415. if ( !this._liveRange ) {
  20416. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__["default"]( 'marker-destroyed', this );
  20417. }
  20418. return this._affectsData;
  20419. }
  20420. /**
  20421. * Returns current marker start position.
  20422. *
  20423. * @returns {module:engine/model/position~Position}
  20424. */
  20425. getStart() {
  20426. if ( !this._liveRange ) {
  20427. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__["default"]( 'marker-destroyed', this );
  20428. }
  20429. return this._liveRange.start.clone();
  20430. }
  20431. /**
  20432. * Returns current marker end position.
  20433. *
  20434. * @returns {module:engine/model/position~Position}
  20435. */
  20436. getEnd() {
  20437. if ( !this._liveRange ) {
  20438. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__["default"]( 'marker-destroyed', this );
  20439. }
  20440. return this._liveRange.end.clone();
  20441. }
  20442. /**
  20443. * Returns a range that represents the current state of the marker.
  20444. *
  20445. * Keep in mind that returned value is a {@link module:engine/model/range~Range Range}, not a
  20446. * {@link module:engine/model/liverange~LiveRange LiveRange}. This means that it is up-to-date and relevant only
  20447. * until next model document change. Do not store values returned by this method. Instead, store {@link ~Marker#name}
  20448. * and get `Marker` instance from {@link module:engine/model/markercollection~MarkerCollection MarkerCollection} every
  20449. * time there is a need to read marker properties. This will guarantee that the marker has not been removed and
  20450. * that it's data is up-to-date.
  20451. *
  20452. * @returns {module:engine/model/range~Range}
  20453. */
  20454. getRange() {
  20455. if ( !this._liveRange ) {
  20456. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__["default"]( 'marker-destroyed', this );
  20457. }
  20458. return this._liveRange.toRange();
  20459. }
  20460. /**
  20461. * Checks whether this object is of the given.
  20462. *
  20463. * marker.is( 'marker' ); // -> true
  20464. * marker.is( 'model:marker' ); // -> true
  20465. *
  20466. * marker.is( 'view:element' ); // -> false
  20467. * marker.is( 'documentSelection' ); // -> false
  20468. *
  20469. * {@link module:engine/model/node~Node#is Check the entire list of model objects} which implement the `is()` method.
  20470. *
  20471. * @param {String} type
  20472. * @returns {Boolean}
  20473. */
  20474. is( type ) {
  20475. return type === 'marker' || type === 'model:marker';
  20476. }
  20477. /**
  20478. * Binds new live range to the marker and detach the old one if is attached.
  20479. *
  20480. * @protected
  20481. * @param {module:engine/model/liverange~LiveRange} liveRange Live range to attach
  20482. * @returns {module:engine/model/liverange~LiveRange} Attached live range.
  20483. */
  20484. _attachLiveRange( liveRange ) {
  20485. if ( this._liveRange ) {
  20486. this._detachLiveRange();
  20487. }
  20488. // Delegating does not work with namespaces. Alternatively, we could delegate all events (using `*`).
  20489. liveRange.delegate( 'change:range' ).to( this );
  20490. liveRange.delegate( 'change:content' ).to( this );
  20491. this._liveRange = liveRange;
  20492. return liveRange;
  20493. }
  20494. /**
  20495. * Unbinds and destroys currently attached live range.
  20496. *
  20497. * @protected
  20498. */
  20499. _detachLiveRange() {
  20500. this._liveRange.stopDelegating( 'change:range', this );
  20501. this._liveRange.stopDelegating( 'change:content', this );
  20502. this._liveRange.detach();
  20503. this._liveRange = null;
  20504. }
  20505. /**
  20506. * Fired whenever {@link ~Marker#_liveRange marker range} is changed due to changes on {@link module:engine/model/document~Document}.
  20507. * This is a delegated {@link module:engine/model/liverange~LiveRange#event:change:range LiveRange change:range event}.
  20508. *
  20509. * When marker is removed from {@link module:engine/model/markercollection~MarkerCollection MarkerCollection},
  20510. * all event listeners listening to it should be removed. It is best to do it on
  20511. * {@link module:engine/model/markercollection~MarkerCollection#event:update MarkerCollection update event}.
  20512. *
  20513. * @see module:engine/model/liverange~LiveRange#event:change:range
  20514. * @event change:range
  20515. * @param {module:engine/model/range~Range} oldRange
  20516. * @param {Object} data
  20517. */
  20518. /**
  20519. * Fired whenever change on {@link module:engine/model/document~Document} is done inside {@link ~Marker#_liveRange marker range}.
  20520. * This is a delegated {@link module:engine/model/liverange~LiveRange#event:change:content LiveRange change:content event}.
  20521. *
  20522. * When marker is removed from {@link module:engine/model/markercollection~MarkerCollection MarkerCollection},
  20523. * all event listeners listening to it should be removed. It is best to do it on
  20524. * {@link module:engine/model/markercollection~MarkerCollection#event:update MarkerCollection update event}.
  20525. *
  20526. * @see module:engine/model/liverange~LiveRange#event:change:content
  20527. * @event change:content
  20528. * @param {module:engine/model/range~Range} oldRange
  20529. * @param {Object} data
  20530. */
  20531. }
  20532. Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_3__["default"])( Marker, _ckeditor_ckeditor5_utils_src_emittermixin__WEBPACK_IMPORTED_MODULE_1__["default"] );
  20533. /**
  20534. * Cannot use a {@link module:engine/model/markercollection~MarkerCollection#destroy destroyed marker} instance.
  20535. *
  20536. * @error marker-destroyed
  20537. */
  20538. /***/ }),
  20539. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/model.js":
  20540. /*!********************************************************************!*\
  20541. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/model.js ***!
  20542. \********************************************************************/
  20543. /*! exports provided: default */
  20544. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  20545. "use strict";
  20546. __webpack_require__.r(__webpack_exports__);
  20547. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Model; });
  20548. /* harmony import */ var _batch__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./batch */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/batch.js");
  20549. /* harmony import */ var _writer__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./writer */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/writer.js");
  20550. /* harmony import */ var _schema__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./schema */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/schema.js");
  20551. /* harmony import */ var _document__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./document */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/document.js");
  20552. /* harmony import */ var _markercollection__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./markercollection */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/markercollection.js");
  20553. /* 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");
  20554. /* 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");
  20555. /* harmony import */ var _element__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./element */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/element.js");
  20556. /* harmony import */ var _range__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./range */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/range.js");
  20557. /* harmony import */ var _position__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./position */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/position.js");
  20558. /* harmony import */ var _selection__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./selection */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/selection.js");
  20559. /* harmony import */ var _operation_operationfactory__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./operation/operationfactory */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/operationfactory.js");
  20560. /* harmony import */ var _utils_insertcontent__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./utils/insertcontent */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/utils/insertcontent.js");
  20561. /* harmony import */ var _utils_deletecontent__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./utils/deletecontent */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/utils/deletecontent.js");
  20562. /* harmony import */ var _utils_modifyselection__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./utils/modifyselection */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/utils/modifyselection.js");
  20563. /* harmony import */ var _utils_getselectedcontent__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./utils/getselectedcontent */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/utils/getselectedcontent.js");
  20564. /* 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");
  20565. /* harmony import */ var _utils_autoparagraphing__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./utils/autoparagraphing */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/utils/autoparagraphing.js");
  20566. /* 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");
  20567. /**
  20568. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  20569. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  20570. */
  20571. /**
  20572. * @module engine/model/model
  20573. */
  20574. // @if CK_DEBUG_ENGINE // const { dumpTrees } = require( '../dev-utils/utils' );
  20575. // @if CK_DEBUG_ENGINE // const { OperationReplayer } = require( '../dev-utils/operationreplayer' ).default;
  20576. /**
  20577. * Editor's data model. Read about the model in the
  20578. * {@glink framework/guides/architecture/editing-engine engine architecture guide}.
  20579. *
  20580. * @mixes module:utils/observablemixin~ObservableMixin
  20581. */
  20582. class Model {
  20583. constructor() {
  20584. /**
  20585. * Model's marker collection.
  20586. *
  20587. * @readonly
  20588. * @member {module:engine/model/markercollection~MarkerCollection}
  20589. */
  20590. this.markers = new _markercollection__WEBPACK_IMPORTED_MODULE_4__["default"]();
  20591. /**
  20592. * Model's document.
  20593. *
  20594. * @readonly
  20595. * @member {module:engine/model/document~Document}
  20596. */
  20597. this.document = new _document__WEBPACK_IMPORTED_MODULE_3__["default"]( this );
  20598. /**
  20599. * Model's schema.
  20600. *
  20601. * @readonly
  20602. * @member {module:engine/model/schema~Schema}
  20603. */
  20604. this.schema = new _schema__WEBPACK_IMPORTED_MODULE_2__["default"]();
  20605. /**
  20606. * All callbacks added by {@link module:engine/model/model~Model#change} or
  20607. * {@link module:engine/model/model~Model#enqueueChange} methods waiting to be executed.
  20608. *
  20609. * @private
  20610. * @type {Array.<Function>}
  20611. */
  20612. this._pendingChanges = [];
  20613. /**
  20614. * The last created and currently used writer instance.
  20615. *
  20616. * @private
  20617. * @member {module:engine/model/writer~Writer}
  20618. */
  20619. this._currentWriter = null;
  20620. [ 'insertContent', 'deleteContent', 'modifySelection', 'getSelectedContent', 'applyOperation' ]
  20621. .forEach( methodName => this.decorate( methodName ) );
  20622. // Adding operation validation with `highest` priority, so it is called before any other feature would like
  20623. // to do anything with the operation. If the operation has incorrect parameters it should throw on the earliest occasion.
  20624. this.on( 'applyOperation', ( evt, args ) => {
  20625. const operation = args[ 0 ];
  20626. operation._validate();
  20627. }, { priority: 'highest' } );
  20628. // Register some default abstract entities.
  20629. this.schema.register( '$root', {
  20630. isLimit: true
  20631. } );
  20632. this.schema.register( '$block', {
  20633. allowIn: '$root',
  20634. isBlock: true
  20635. } );
  20636. this.schema.register( '$text', {
  20637. allowIn: '$block',
  20638. isInline: true,
  20639. isContent: true
  20640. } );
  20641. this.schema.register( '$clipboardHolder', {
  20642. allowContentOf: '$root',
  20643. allowChildren: '$text',
  20644. isLimit: true
  20645. } );
  20646. this.schema.register( '$documentFragment', {
  20647. allowContentOf: '$root',
  20648. allowChildren: '$text',
  20649. isLimit: true
  20650. } );
  20651. // An element needed by the `upcastElementToMarker` converter.
  20652. // This element temporarily represents a marker boundary during the conversion process and is removed
  20653. // at the end of the conversion. `UpcastDispatcher` or at least `Conversion` class looks like a
  20654. // better place for this registration but both know nothing about `Schema`.
  20655. this.schema.register( '$marker' );
  20656. this.schema.addChildCheck( ( context, childDefinition ) => {
  20657. if ( childDefinition.name === '$marker' ) {
  20658. return true;
  20659. }
  20660. } );
  20661. Object(_utils_selection_post_fixer__WEBPACK_IMPORTED_MODULE_16__["injectSelectionPostFixer"])( this );
  20662. // Post-fixer which takes care of adding empty paragraph elements to the empty roots.
  20663. this.document.registerPostFixer( _utils_autoparagraphing__WEBPACK_IMPORTED_MODULE_17__["autoParagraphEmptyRoots"] );
  20664. // @if CK_DEBUG_ENGINE // this.on( 'applyOperation', () => {
  20665. // @if CK_DEBUG_ENGINE // dumpTrees( this.document, this.document.version );
  20666. // @if CK_DEBUG_ENGINE // }, { priority: 'lowest' } );
  20667. }
  20668. /**
  20669. * The `change()` method is the primary way of changing the model. You should use it to modify all document nodes
  20670. * (including detached nodes – i.e. nodes not added to the {@link module:engine/model/model~Model#document model document}),
  20671. * the {@link module:engine/model/document~Document#selection document's selection}, and
  20672. * {@link module:engine/model/model~Model#markers model markers}.
  20673. *
  20674. * model.change( writer => {
  20675. * writer.insertText( 'foo', paragraph, 'end' );
  20676. * } );
  20677. *
  20678. * All changes inside the change block use the same {@link module:engine/model/batch~Batch} so they are combined
  20679. * into a single undo step.
  20680. *
  20681. * model.change( writer => {
  20682. * writer.insertText( 'foo', paragraph, 'end' ); // foo.
  20683. *
  20684. * model.change( writer => {
  20685. * writer.insertText( 'bar', paragraph, 'end' ); // foobar.
  20686. * } );
  20687. *
  20688. * writer.insertText( 'bom', paragraph, 'end' ); // foobarbom.
  20689. * } );
  20690. *
  20691. * The callback of the `change()` block is executed synchronously.
  20692. *
  20693. * You can also return a value from the change block.
  20694. *
  20695. * const img = model.change( writer => {
  20696. * return writer.createElement( 'img' );
  20697. * } );
  20698. *
  20699. * @see #enqueueChange
  20700. * @param {Function} callback Callback function which may modify the model.
  20701. * @returns {*} Value returned by the callback.
  20702. */
  20703. change( callback ) {
  20704. try {
  20705. if ( this._pendingChanges.length === 0 ) {
  20706. // If this is the outermost block, create a new batch and start `_runPendingChanges` execution flow.
  20707. this._pendingChanges.push( { batch: new _batch__WEBPACK_IMPORTED_MODULE_0__["default"](), callback } );
  20708. return this._runPendingChanges()[ 0 ];
  20709. } else {
  20710. // If this is not the outermost block, just execute the callback.
  20711. return callback( this._currentWriter );
  20712. }
  20713. } catch ( err ) {
  20714. // @if CK_DEBUG // throw err;
  20715. /* istanbul ignore next */
  20716. _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_18__["default"].rethrowUnexpectedError( err, this );
  20717. }
  20718. }
  20719. /**
  20720. * The `enqueueChange()` method performs similar task as the {@link #change `change()` method}, with two major differences.
  20721. *
  20722. * First, the callback of `enqueueChange()` is executed when all other enqueued changes are done. It might be executed
  20723. * immediately if it is not nested in any other change block, but if it is nested in another (enqueue)change block,
  20724. * it will be delayed and executed after the outermost block.
  20725. *
  20726. * model.change( writer => {
  20727. * console.log( 1 );
  20728. *
  20729. * model.enqueueChange( writer => {
  20730. * console.log( 2 );
  20731. * } );
  20732. *
  20733. * console.log( 3 );
  20734. * } ); // Will log: 1, 3, 2.
  20735. *
  20736. * In addition to that, the changes enqueued with `enqueueChange()` will be converted separately from the changes
  20737. * done in the outer `change()` block.
  20738. *
  20739. * Second, it lets you define the {@link module:engine/model/batch~Batch} into which you want to add your changes.
  20740. * By default, a new batch is created. In the sample above, `change` and `enqueueChange` blocks use a different
  20741. * batch (and different {@link module:engine/model/writer~Writer} since each of them operates on the separate batch).
  20742. *
  20743. * When using the `enqueueChange()` block you can also add some changes to the batch you used before.
  20744. *
  20745. * model.enqueueChange( batch, writer => {
  20746. * writer.insertText( 'foo', paragraph, 'end' );
  20747. * } );
  20748. *
  20749. * In order to make a nested `enqueueChange()` create a single undo step together with the changes done in the outer `change()`
  20750. * block, you can obtain the batch instance from the {@link module:engine/model/writer~Writer#batch writer} of the outer block.
  20751. *
  20752. * @param {module:engine/model/batch~Batch|'transparent'|'default'} batchOrType Batch or batch type should be used in the callback.
  20753. * If not defined, a new batch will be created.
  20754. * @param {Function} callback Callback function which may modify the model.
  20755. */
  20756. enqueueChange( batchOrType, callback ) {
  20757. try {
  20758. if ( typeof batchOrType === 'string' ) {
  20759. batchOrType = new _batch__WEBPACK_IMPORTED_MODULE_0__["default"]( batchOrType );
  20760. } else if ( typeof batchOrType == 'function' ) {
  20761. callback = batchOrType;
  20762. batchOrType = new _batch__WEBPACK_IMPORTED_MODULE_0__["default"]();
  20763. }
  20764. this._pendingChanges.push( { batch: batchOrType, callback } );
  20765. if ( this._pendingChanges.length == 1 ) {
  20766. this._runPendingChanges();
  20767. }
  20768. } catch ( err ) {
  20769. // @if CK_DEBUG // throw err;
  20770. /* istanbul ignore next */
  20771. _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_18__["default"].rethrowUnexpectedError( err, this );
  20772. }
  20773. }
  20774. /**
  20775. * {@link module:utils/observablemixin~ObservableMixin#decorate Decorated} function for applying
  20776. * {@link module:engine/model/operation/operation~Operation operations} to the model.
  20777. *
  20778. * This is a low-level way of changing the model. It is exposed for very specific use cases (like the undo feature).
  20779. * Normally, to modify the model, you will want to use {@link module:engine/model/writer~Writer `Writer`}.
  20780. * See also {@glink framework/guides/architecture/editing-engine#changing-the-model Changing the model} section
  20781. * of the {@glink framework/guides/architecture/editing-engine Editing architecture} guide.
  20782. *
  20783. * @param {module:engine/model/operation/operation~Operation} operation The operation to apply.
  20784. */
  20785. applyOperation( operation ) {
  20786. // @if CK_DEBUG_ENGINE // console.log( 'Applying ' + operation );
  20787. // @if CK_DEBUG_ENGINE // if ( !this._operationLogs ) {
  20788. // @if CK_DEBUG_ENGINE // this._operationLogs = [];
  20789. // @if CK_DEBUG_ENGINE // }
  20790. // @if CK_DEBUG_ENGINE // this._operationLogs.push( JSON.stringify( operation ) );
  20791. // @if CK_DEBUG_ENGINE //if ( !this._appliedOperations ) {
  20792. // @if CK_DEBUG_ENGINE // this._appliedOperations = [];
  20793. // @if CK_DEBUG_ENGINE //}
  20794. // @if CK_DEBUG_ENGINE //this._appliedOperations.push( operation );
  20795. operation._execute();
  20796. }
  20797. // @if CK_DEBUG_ENGINE // getAppliedOperation() {
  20798. // @if CK_DEBUG_ENGINE // if ( !this._appliedOperations ) {
  20799. // @if CK_DEBUG_ENGINE // return '';
  20800. // @if CK_DEBUG_ENGINE // }
  20801. // @if CK_DEBUG_ENGINE // return this._appliedOperations.map( JSON.stringify ).join( '-------' );
  20802. // @if CK_DEBUG_ENGINE // }
  20803. // @if CK_DEBUG_ENGINE // createReplayer( stringifiedOperations ) {
  20804. // @if CK_DEBUG_ENGINE // return new OperationReplayer( this, '-------', stringifiedOperations );
  20805. // @if CK_DEBUG_ENGINE // }
  20806. /**
  20807. * Inserts content at the position in the editor specified by the selection, as one would expect the paste
  20808. * functionality to work.
  20809. *
  20810. * This is a high-level method. It takes the {@link #schema schema} into consideration when inserting
  20811. * the content, clears the given selection's content before inserting nodes and moves the selection
  20812. * to its target position at the end of the process.
  20813. * It can split elements, merge them, wrap bare text nodes with paragraphs, etc. &mdash; just like the
  20814. * pasting feature should do.
  20815. *
  20816. * For lower-level methods see {@link module:engine/model/writer~Writer `Writer`}.
  20817. *
  20818. * This method, unlike {@link module:engine/model/writer~Writer `Writer`}'s methods, does not have to be used
  20819. * inside a {@link #change `change()` block}.
  20820. *
  20821. * # Conversion and schema
  20822. *
  20823. * Inserting elements and text nodes into the model is not enough to make CKEditor 5 render that content
  20824. * to the user. CKEditor 5 implements a model-view-controller architecture and what `model.insertContent()` does
  20825. * is only adding nodes to the model. Additionally, you need to define
  20826. * {@glink framework/guides/architecture/editing-engine#conversion converters} between the model and view
  20827. * and define those nodes in the {@glink framework/guides/architecture/editing-engine#schema schema}.
  20828. *
  20829. * So, while this method may seem similar to CKEditor 4 `editor.insertHtml()` (in fact, both methods
  20830. * are used for paste-like content insertion), the CKEditor 5 method cannot be use to insert arbitrary HTML
  20831. * unless converters are defined for all elements and attributes in that HTML.
  20832. *
  20833. * # Examples
  20834. *
  20835. * Using `insertContent()` with a manually created model structure:
  20836. *
  20837. * // Let's create a document fragment containing such content as:
  20838. * //
  20839. * // <paragraph>foo</paragraph>
  20840. * // <blockQuote>
  20841. * // <paragraph>bar</paragraph>
  20842. * // </blockQuote>
  20843. * const docFrag = editor.model.change( writer => {
  20844. * const p1 = writer.createElement( 'paragraph' );
  20845. * const p2 = writer.createElement( 'paragraph' );
  20846. * const blockQuote = writer.createElement( 'blockQuote' );
  20847. * const docFrag = writer.createDocumentFragment();
  20848. *
  20849. * writer.append( p1, docFrag );
  20850. * writer.append( blockQuote, docFrag );
  20851. * writer.append( p2, blockQuote );
  20852. * writer.insertText( 'foo', p1 );
  20853. * writer.insertText( 'bar', p2 );
  20854. *
  20855. * return docFrag;
  20856. * } );
  20857. *
  20858. * // insertContent() does not have to be used in a change() block. It can, though,
  20859. * // so this code could be moved to the callback defined above.
  20860. * editor.model.insertContent( docFrag );
  20861. *
  20862. * Using `insertContent()` with an HTML string converted to a model document fragment (similar to the pasting mechanism):
  20863. *
  20864. * // You can create your own HtmlDataProcessor instance or use editor.data.processor
  20865. * // if you have not overridden the default one (which is the HtmlDataProcessor instance).
  20866. * const htmlDP = new HtmlDataProcessor( viewDocument );
  20867. *
  20868. * // Convert an HTML string to a view document fragment:
  20869. * const viewFragment = htmlDP.toView( htmlString );
  20870. *
  20871. * // Convert the view document fragment to a model document fragment
  20872. * // in the context of $root. This conversion takes the schema into
  20873. * // account so if, for example, the view document fragment contained a bare text node,
  20874. * // this text node cannot be a child of $root, so it will be automatically
  20875. * // wrapped with a <paragraph>. You can define the context yourself (in the second parameter),
  20876. * // and e.g. convert the content like it would happen in a <paragraph>.
  20877. * // Note: The clipboard feature uses a custom context called $clipboardHolder
  20878. * // which has a loosened schema.
  20879. * const modelFragment = editor.data.toModel( viewFragment );
  20880. *
  20881. * editor.model.insertContent( modelFragment );
  20882. *
  20883. * By default this method will use the document selection but it can also be used with a position, range or selection instance.
  20884. *
  20885. * // Insert text at the current document selection position.
  20886. * editor.model.change( writer => {
  20887. * editor.model.insertContent( writer.createText( 'x' ) );
  20888. * } );
  20889. *
  20890. * // Insert text at a given position - the document selection will not be modified.
  20891. * editor.model.change( writer => {
  20892. * editor.model.insertContent( writer.createText( 'x' ), doc.getRoot(), 2 );
  20893. *
  20894. * // Which is a shorthand for:
  20895. * editor.model.insertContent( writer.createText( 'x' ), writer.createPositionAt( doc.getRoot(), 2 ) );
  20896. * } );
  20897. *
  20898. * If you want the document selection to be moved to the inserted content, use the
  20899. * {@link module:engine/model/writer~Writer#setSelection `setSelection()`} method of the writer after inserting
  20900. * the content:
  20901. *
  20902. * editor.model.change( writer => {
  20903. * const paragraph = writer.createElement( 'paragraph' );
  20904. *
  20905. * // Insert an empty paragraph at the beginning of the root.
  20906. * editor.model.insertContent( paragraph, writer.createPositionAt( editor.model.document.getRoot(), 0 ) );
  20907. *
  20908. * // Move the document selection to the inserted paragraph.
  20909. * writer.setSelection( paragraph, 'in' );
  20910. * } );
  20911. *
  20912. * If an instance of the {@link module:engine/model/selection~Selection model selection} is passed as `selectable`,
  20913. * the new content will be inserted at the passed selection (instead of document selection):
  20914. *
  20915. * editor.model.change( writer => {
  20916. * // Create a selection in a paragraph that will be used as a place of insertion.
  20917. * const selection = writer.createSelection( paragraph, 'in' );
  20918. *
  20919. * // Insert the new text at the created selection.
  20920. * editor.model.insertContent( writer.createText( 'x' ), selection );
  20921. *
  20922. * // insertContent() modifies the passed selection instance so it can be used to set the document selection.
  20923. * // Note: This is not necessary when you passed the document selection to insertContent().
  20924. * writer.setSelection( selection );
  20925. * } );
  20926. *
  20927. * @fires insertContent
  20928. * @param {module:engine/model/documentfragment~DocumentFragment|module:engine/model/item~Item} content The content to insert.
  20929. * @param {module:engine/model/selection~Selectable} [selectable=model.document.selection]
  20930. * The selection into which the content should be inserted. If not provided the current model document selection will be used.
  20931. * @param {Number|'before'|'end'|'after'|'on'|'in'} [placeOrOffset] To be used when a model item was passed as `selectable`.
  20932. * This param defines a position in relation to that item.
  20933. * @returns {module:engine/model/range~Range} Range which contains all the performed changes. This is a range that, if removed,
  20934. * would return the model to the state before the insertion. If no changes were preformed by `insertContent`, returns a range collapsed
  20935. * at the insertion position.
  20936. */
  20937. insertContent( content, selectable, placeOrOffset ) {
  20938. return Object(_utils_insertcontent__WEBPACK_IMPORTED_MODULE_12__["default"])( this, content, selectable, placeOrOffset );
  20939. }
  20940. /**
  20941. * Deletes content of the selection and merge siblings. The resulting selection is always collapsed.
  20942. *
  20943. * **Note:** For the sake of predictability, the resulting selection should always be collapsed.
  20944. * In cases where a feature wants to modify deleting behavior so selection isn't collapsed
  20945. * (e.g. a table feature may want to keep row selection after pressing <kbd>Backspace</kbd>),
  20946. * then that behavior should be implemented in the view's listener. At the same time, the table feature
  20947. * will need to modify this method's behavior too, e.g. to "delete contents and then collapse
  20948. * the selection inside the last selected cell" or "delete the row and collapse selection somewhere near".
  20949. * That needs to be done in order to ensure that other features which use `deleteContent()` will work well with tables.
  20950. *
  20951. * @fires deleteContent
  20952. * @param {module:engine/model/selection~Selection|module:engine/model/documentselection~DocumentSelection} selection
  20953. * Selection of which the content should be deleted.
  20954. * @param {Object} [options]
  20955. * @param {Boolean} [options.leaveUnmerged=false] Whether to merge elements after removing the content of the selection.
  20956. *
  20957. * For example `<heading1>x[x</heading1><paragraph>y]y</paragraph>` will become:
  20958. *
  20959. * * `<heading1>x^y</heading1>` with the option disabled (`leaveUnmerged == false`)
  20960. * * `<heading1>x^</heading1><paragraph>y</paragraph>` with enabled (`leaveUnmerged == true`).
  20961. *
  20962. * Note: {@link module:engine/model/schema~Schema#isObject object} and {@link module:engine/model/schema~Schema#isLimit limit}
  20963. * elements will not be merged.
  20964. *
  20965. * @param {Boolean} [options.doNotResetEntireContent=false] Whether to skip replacing the entire content with a
  20966. * paragraph when the entire content was selected.
  20967. *
  20968. * For example `<heading1>[x</heading1><paragraph>y]</paragraph>` will become:
  20969. *
  20970. * * `<paragraph>^</paragraph>` with the option disabled (`doNotResetEntireContent == false`)
  20971. * * `<heading1>^</heading1>` with enabled (`doNotResetEntireContent == true`)
  20972. *
  20973. * @param {Boolean} [options.doNotAutoparagraph=false] Whether to create a paragraph if after content deletion selection is moved
  20974. * to a place where text cannot be inserted.
  20975. *
  20976. * For example `<paragraph>x</paragraph>[<image src="foo.jpg"></image>]` will become:
  20977. *
  20978. * * `<paragraph>x</paragraph><paragraph>[]</paragraph>` with the option disabled (`doNotAutoparagraph == false`)
  20979. * * `<paragraph>x[]</paragraph>` with the option enabled (`doNotAutoparagraph == true`).
  20980. *
  20981. * **Note:** if there is no valid position for the selection, the paragraph will always be created:
  20982. *
  20983. * `[<image src="foo.jpg"></image>]` -> `<paragraph>[]</paragraph>`.
  20984. *
  20985. * @param {'forward'|'backward'} [options.direction='backward'] The direction in which the content is being consumed.
  20986. * Deleting backward corresponds to using the <kbd>Backspace</kbd> key, while deleting content forward corresponds to
  20987. * the <kbd>Shift</kbd>+<kbd>Backspace</kbd> keystroke.
  20988. */
  20989. deleteContent( selection, options ) {
  20990. Object(_utils_deletecontent__WEBPACK_IMPORTED_MODULE_13__["default"])( this, selection, options );
  20991. }
  20992. /**
  20993. * Modifies the selection. Currently, the supported modifications are:
  20994. *
  20995. * * Extending. The selection focus is moved in the specified `options.direction` with a step specified in `options.unit`.
  20996. * Possible values for `unit` are:
  20997. * * `'character'` (default) - moves selection by one user-perceived character. In most cases this means moving by one
  20998. * character in `String` sense. However, unicode also defines "combing marks". These are special symbols, that combines
  20999. * with a symbol before it ("base character") to create one user-perceived character. For example, `q̣̇` is a normal
  21000. * letter `q` with two "combining marks": upper dot (`Ux0307`) and lower dot (`Ux0323`). For most actions, i.e. extending
  21001. * selection by one position, it is correct to include both "base character" and all of it's "combining marks". That is
  21002. * why `'character'` value is most natural and common method of modifying selection.
  21003. * * `'codePoint'` - moves selection by one unicode code point. In contrary to, `'character'` unit, this will insert
  21004. * selection between "base character" and "combining mark", because "combining marks" have their own unicode code points.
  21005. * However, for technical reasons, unicode code points with values above `UxFFFF` are represented in native `String` by
  21006. * two characters, called "surrogate pairs". Halves of "surrogate pairs" have a meaning only when placed next to each other.
  21007. * For example `𨭎` is represented in `String` by `\uD862\uDF4E`. Both `\uD862` and `\uDF4E` do not have any meaning
  21008. * outside the pair (are rendered as ? when alone). Position between them would be incorrect. In this case, selection
  21009. * extension will include whole "surrogate pair".
  21010. * * `'word'` - moves selection by a whole word.
  21011. *
  21012. * **Note:** if you extend a forward selection in a backward direction you will in fact shrink it.
  21013. *
  21014. * @fires modifySelection
  21015. * @param {module:engine/model/selection~Selection|module:engine/model/documentselection~DocumentSelection} selection
  21016. * The selection to modify.
  21017. * @param {Object} [options]
  21018. * @param {'forward'|'backward'} [options.direction='forward'] The direction in which the selection should be modified.
  21019. * @param {'character'|'codePoint'|'word'} [options.unit='character'] The unit by which selection should be modified.
  21020. */
  21021. modifySelection( selection, options ) {
  21022. Object(_utils_modifyselection__WEBPACK_IMPORTED_MODULE_14__["default"])( this, selection, options );
  21023. }
  21024. /**
  21025. * Gets a clone of the selected content.
  21026. *
  21027. * For example, for the following selection:
  21028. *
  21029. * ```html
  21030. * <paragraph>x</paragraph>
  21031. * <blockQuote>
  21032. * <paragraph>y</paragraph>
  21033. * <heading1>fir[st</heading1>
  21034. * </blockQuote>
  21035. * <paragraph>se]cond</paragraph>
  21036. * <paragraph>z</paragraph>
  21037. * ```
  21038. *
  21039. * It will return a document fragment with such a content:
  21040. *
  21041. * ```html
  21042. * <blockQuote>
  21043. * <heading1>st</heading1>
  21044. * </blockQuote>
  21045. * <paragraph>se</paragraph>
  21046. * ```
  21047. *
  21048. * @fires getSelectedContent
  21049. * @param {module:engine/model/selection~Selection|module:engine/model/documentselection~DocumentSelection} selection
  21050. * The selection of which content will be returned.
  21051. * @returns {module:engine/model/documentfragment~DocumentFragment}
  21052. */
  21053. getSelectedContent( selection ) {
  21054. return Object(_utils_getselectedcontent__WEBPACK_IMPORTED_MODULE_15__["default"])( this, selection );
  21055. }
  21056. /**
  21057. * Checks whether the given {@link module:engine/model/range~Range range} or
  21058. * {@link module:engine/model/element~Element element} has any meaningful content.
  21059. *
  21060. * Meaningful content is:
  21061. *
  21062. * * any text node (`options.ignoreWhitespaces` allows controlling whether this text node must also contain
  21063. * any non-whitespace characters),
  21064. * * or any {@link module:engine/model/schema~Schema#isContent content element},
  21065. * * or any {@link module:engine/model/markercollection~Marker marker} which
  21066. * {@link module:engine/model/markercollection~Marker#_affectsData affects data}.
  21067. *
  21068. * This means that a range containing an empty `<paragraph></paragraph>` is not considered to have a meaningful content.
  21069. * However, a range containing an `<image></image>` (which would normally be marked in the schema as an object element)
  21070. * is considered non-empty.
  21071. *
  21072. * @param {module:engine/model/range~Range|module:engine/model/element~Element} rangeOrElement Range or element to check.
  21073. * @param {Object} [options]
  21074. * @param {Boolean} [options.ignoreWhitespaces] Whether text node with whitespaces only should be considered empty.
  21075. * @param {Boolean} [options.ignoreMarkers] Whether markers should be ignored.
  21076. * @returns {Boolean}
  21077. */
  21078. hasContent( rangeOrElement, options = {} ) {
  21079. const range = rangeOrElement instanceof _element__WEBPACK_IMPORTED_MODULE_7__["default"] ? _range__WEBPACK_IMPORTED_MODULE_8__["default"]._createIn( rangeOrElement ) : rangeOrElement;
  21080. if ( range.isCollapsed ) {
  21081. return false;
  21082. }
  21083. const { ignoreWhitespaces = false, ignoreMarkers = false } = options;
  21084. // Check if there are any markers which affects data in this given range.
  21085. if ( !ignoreMarkers ) {
  21086. for ( const intersectingMarker of this.markers.getMarkersIntersectingRange( range ) ) {
  21087. if ( intersectingMarker.affectsData ) {
  21088. return true;
  21089. }
  21090. }
  21091. }
  21092. for ( const item of range.getItems() ) {
  21093. if ( this.schema.isContent( item ) ) {
  21094. if ( item.is( '$textProxy' ) ) {
  21095. if ( !ignoreWhitespaces ) {
  21096. return true;
  21097. } else if ( item.data.search( /\S/ ) !== -1 ) {
  21098. return true;
  21099. }
  21100. } else {
  21101. return true;
  21102. }
  21103. }
  21104. }
  21105. return false;
  21106. }
  21107. /**
  21108. * Creates a position from the given root and path in that root.
  21109. *
  21110. * Note: This method is also available as
  21111. * {@link module:engine/model/writer~Writer#createPositionFromPath `Writer#createPositionFromPath()`}.
  21112. *
  21113. * @param {module:engine/model/element~Element|module:engine/model/documentfragment~DocumentFragment} root Root of the position.
  21114. * @param {Array.<Number>} path Position path. See {@link module:engine/model/position~Position#path}.
  21115. * @param {module:engine/model/position~PositionStickiness} [stickiness='toNone'] Position stickiness.
  21116. * See {@link module:engine/model/position~PositionStickiness}.
  21117. * @returns {module:engine/model/position~Position}
  21118. */
  21119. createPositionFromPath( root, path, stickiness ) {
  21120. return new _position__WEBPACK_IMPORTED_MODULE_9__["default"]( root, path, stickiness );
  21121. }
  21122. /**
  21123. * Creates position at the given location. The location can be specified as:
  21124. *
  21125. * * a {@link module:engine/model/position~Position position},
  21126. * * a parent element and offset in that element,
  21127. * * a parent element and `'end'` (the position will be set at the end of that element),
  21128. * * a {@link module:engine/model/item~Item model item} and `'before'` or `'after'`
  21129. * (the position will be set before or after the given model item).
  21130. *
  21131. * This method is a shortcut to other factory methods such as:
  21132. *
  21133. * * {@link module:engine/model/model~Model#createPositionBefore `createPositionBefore()`},
  21134. * * {@link module:engine/model/model~Model#createPositionAfter `createPositionAfter()`}.
  21135. *
  21136. * Note: This method is also available as
  21137. * {@link module:engine/model/writer~Writer#createPositionAt `Writer#createPositionAt()`},
  21138. *
  21139. * @param {module:engine/model/item~Item|module:engine/model/position~Position} itemOrPosition
  21140. * @param {Number|'end'|'before'|'after'} [offset] Offset or one of the flags. Used only when
  21141. * first parameter is a {@link module:engine/model/item~Item model item}.
  21142. */
  21143. createPositionAt( itemOrPosition, offset ) {
  21144. return _position__WEBPACK_IMPORTED_MODULE_9__["default"]._createAt( itemOrPosition, offset );
  21145. }
  21146. /**
  21147. * Creates a new position after the given {@link module:engine/model/item~Item model item}.
  21148. *
  21149. * Note: This method is also available as
  21150. * {@link module:engine/model/writer~Writer#createPositionAfter `Writer#createPositionAfter()`}.
  21151. *
  21152. * @param {module:engine/model/item~Item} item Item after which the position should be placed.
  21153. * @returns {module:engine/model/position~Position}
  21154. */
  21155. createPositionAfter( item ) {
  21156. return _position__WEBPACK_IMPORTED_MODULE_9__["default"]._createAfter( item );
  21157. }
  21158. /**
  21159. * Creates a new position before the given {@link module:engine/model/item~Item model item}.
  21160. *
  21161. * Note: This method is also available as
  21162. * {@link module:engine/model/writer~Writer#createPositionBefore `Writer#createPositionBefore()`}.
  21163. *
  21164. * @param {module:engine/model/item~Item} item Item before which the position should be placed.
  21165. * @returns {module:engine/model/position~Position}
  21166. */
  21167. createPositionBefore( item ) {
  21168. return _position__WEBPACK_IMPORTED_MODULE_9__["default"]._createBefore( item );
  21169. }
  21170. /**
  21171. * Creates a range spanning from the `start` position to the `end` position.
  21172. *
  21173. * Note: This method is also available as
  21174. * {@link module:engine/model/writer~Writer#createRange `Writer#createRange()`}:
  21175. *
  21176. * model.change( writer => {
  21177. * const range = writer.createRange( start, end );
  21178. * } );
  21179. *
  21180. * @param {module:engine/model/position~Position} start Start position.
  21181. * @param {module:engine/model/position~Position} [end] End position. If not set, the range will be collapsed
  21182. * to the `start` position.
  21183. * @returns {module:engine/model/range~Range}
  21184. */
  21185. createRange( start, end ) {
  21186. return new _range__WEBPACK_IMPORTED_MODULE_8__["default"]( start, end );
  21187. }
  21188. /**
  21189. * Creates a range inside the given element which starts before the first child of
  21190. * that element and ends after the last child of that element.
  21191. *
  21192. * Note: This method is also available as
  21193. * {@link module:engine/model/writer~Writer#createRangeIn `Writer#createRangeIn()`}:
  21194. *
  21195. * model.change( writer => {
  21196. * const range = writer.createRangeIn( paragraph );
  21197. * } );
  21198. *
  21199. * @param {module:engine/model/element~Element} element Element which is a parent for the range.
  21200. * @returns {module:engine/model/range~Range}
  21201. */
  21202. createRangeIn( element ) {
  21203. return _range__WEBPACK_IMPORTED_MODULE_8__["default"]._createIn( element );
  21204. }
  21205. /**
  21206. * Creates a range that starts before the given {@link module:engine/model/item~Item model item} and ends after it.
  21207. *
  21208. * Note: This method is also available on `writer` instance as
  21209. * {@link module:engine/model/writer~Writer#createRangeOn `Writer.createRangeOn()`}:
  21210. *
  21211. * model.change( writer => {
  21212. * const range = writer.createRangeOn( paragraph );
  21213. * } );
  21214. *
  21215. * @param {module:engine/model/item~Item} item
  21216. * @returns {module:engine/model/range~Range}
  21217. */
  21218. createRangeOn( item ) {
  21219. return _range__WEBPACK_IMPORTED_MODULE_8__["default"]._createOn( item );
  21220. }
  21221. /**
  21222. * Creates a new selection instance based on the given {@link module:engine/model/selection~Selectable selectable}
  21223. * or creates an empty selection if no arguments were passed.
  21224. *
  21225. * Note: This method is also available as
  21226. * {@link module:engine/model/writer~Writer#createSelection `Writer#createSelection()`}.
  21227. *
  21228. * // Creates empty selection without ranges.
  21229. * const selection = writer.createSelection();
  21230. *
  21231. * // Creates selection at the given range.
  21232. * const range = writer.createRange( start, end );
  21233. * const selection = writer.createSelection( range );
  21234. *
  21235. * // Creates selection at the given ranges
  21236. * const ranges = [ writer.createRange( start1, end2 ), writer.createRange( star2, end2 ) ];
  21237. * const selection = writer.createSelection( ranges );
  21238. *
  21239. * // Creates selection from the other selection.
  21240. * // Note: It doesn't copies selection attributes.
  21241. * const otherSelection = writer.createSelection();
  21242. * const selection = writer.createSelection( otherSelection );
  21243. *
  21244. * // Creates selection from the given document selection.
  21245. * // Note: It doesn't copies selection attributes.
  21246. * const documentSelection = model.document.selection;
  21247. * const selection = writer.createSelection( documentSelection );
  21248. *
  21249. * // Creates selection at the given position.
  21250. * const position = writer.createPositionFromPath( root, path );
  21251. * const selection = writer.createSelection( position );
  21252. *
  21253. * // Creates selection at the given offset in the given element.
  21254. * const paragraph = writer.createElement( 'paragraph' );
  21255. * const selection = writer.createSelection( paragraph, offset );
  21256. *
  21257. * // Creates a range inside an {@link module:engine/model/element~Element element} which starts before the
  21258. * // first child of that element and ends after the last child of that element.
  21259. * const selection = writer.createSelection( paragraph, 'in' );
  21260. *
  21261. * // Creates a range on an {@link module:engine/model/item~Item item} which starts before the item and ends
  21262. * // just after the item.
  21263. * const selection = writer.createSelection( paragraph, 'on' );
  21264. *
  21265. * // Additional options (`'backward'`) can be specified as the last argument.
  21266. *
  21267. * // Creates backward selection.
  21268. * const selection = writer.createSelection( range, { backward: true } );
  21269. *
  21270. * @param {module:engine/model/selection~Selectable} selectable
  21271. * @param {Number|'before'|'end'|'after'|'on'|'in'} [placeOrOffset] Sets place or offset of the selection.
  21272. * @param {Object} [options]
  21273. * @param {Boolean} [options.backward] Sets this selection instance to be backward.
  21274. * @returns {module:engine/model/selection~Selection}
  21275. */
  21276. createSelection( selectable, placeOrOffset, options ) {
  21277. return new _selection__WEBPACK_IMPORTED_MODULE_10__["default"]( selectable, placeOrOffset, options );
  21278. }
  21279. /**
  21280. * Creates a {@link module:engine/model/batch~Batch} instance.
  21281. *
  21282. * **Note:** In most cases creating a batch instance is not necessary as they are created when using:
  21283. *
  21284. * * {@link #change `change()`},
  21285. * * {@link #enqueueChange `enqueueChange()`}.
  21286. *
  21287. * @param {'transparent'|'default'} [type='default'] The type of the batch.
  21288. * @returns {module:engine/model/batch~Batch}
  21289. */
  21290. createBatch( type ) {
  21291. return new _batch__WEBPACK_IMPORTED_MODULE_0__["default"]( type );
  21292. }
  21293. /**
  21294. * Creates an operation instance from a JSON object (parsed JSON string).
  21295. *
  21296. * This is an alias for {@link module:engine/model/operation/operationfactory~OperationFactory.fromJSON `OperationFactory.fromJSON()`}.
  21297. *
  21298. * @param {Object} json Deserialized JSON object.
  21299. * @returns {module:engine/model/operation/operation~Operation}
  21300. */
  21301. createOperationFromJSON( json ) {
  21302. return _operation_operationfactory__WEBPACK_IMPORTED_MODULE_11__["default"].fromJSON( json, this.document );
  21303. }
  21304. /**
  21305. * Removes all events listeners set by model instance and destroys {@link module:engine/model/document~Document}.
  21306. */
  21307. destroy() {
  21308. this.document.destroy();
  21309. this.stopListening();
  21310. }
  21311. /**
  21312. * Common part of {@link module:engine/model/model~Model#change} and {@link module:engine/model/model~Model#enqueueChange}
  21313. * which calls callbacks and returns array of values returned by these callbacks.
  21314. *
  21315. * @private
  21316. * @returns {Array.<*>} Array of values returned by callbacks.
  21317. */
  21318. _runPendingChanges() {
  21319. const ret = [];
  21320. this.fire( '_beforeChanges' );
  21321. while ( this._pendingChanges.length ) {
  21322. // Create a new writer using batch instance created for this chain of changes.
  21323. const currentBatch = this._pendingChanges[ 0 ].batch;
  21324. this._currentWriter = new _writer__WEBPACK_IMPORTED_MODULE_1__["default"]( this, currentBatch );
  21325. // Execute changes callback and gather the returned value.
  21326. const callbackReturnValue = this._pendingChanges[ 0 ].callback( this._currentWriter );
  21327. ret.push( callbackReturnValue );
  21328. this.document._handleChangeBlock( this._currentWriter );
  21329. this._pendingChanges.shift();
  21330. this._currentWriter = null;
  21331. }
  21332. this.fire( '_afterChanges' );
  21333. return ret;
  21334. }
  21335. /**
  21336. * Fired when entering the outermost {@link module:engine/model/model~Model#enqueueChange} or
  21337. * {@link module:engine/model/model~Model#change} block.
  21338. *
  21339. * @protected
  21340. * @event _beforeChanges
  21341. */
  21342. /**
  21343. * Fired when leaving the outermost {@link module:engine/model/model~Model#enqueueChange} or
  21344. * {@link module:engine/model/model~Model#change} block.
  21345. *
  21346. * @protected
  21347. * @event _afterChanges
  21348. */
  21349. /**
  21350. * Fired every time any {@link module:engine/model/operation/operation~Operation operation} is applied on the model
  21351. * using {@link #applyOperation}.
  21352. *
  21353. * Note that this event is suitable only for very specific use-cases. Use it if you need to listen to every single operation
  21354. * applied on the document. However, in most cases {@link module:engine/model/document~Document#event:change} should
  21355. * be used.
  21356. *
  21357. * A few callbacks are already added to this event by engine internal classes:
  21358. *
  21359. * * with `highest` priority operation is validated,
  21360. * * with `normal` priority operation is executed,
  21361. * * with `low` priority the {@link module:engine/model/document~Document} updates its version,
  21362. * * with `low` priority {@link module:engine/model/liveposition~LivePosition} and {@link module:engine/model/liverange~LiveRange}
  21363. * update themselves.
  21364. *
  21365. * @event applyOperation
  21366. * @param {Array} args Arguments of the `applyOperation` which is an array with a single element - applied
  21367. * {@link module:engine/model/operation/operation~Operation operation}.
  21368. */
  21369. /**
  21370. * Event fired when {@link #insertContent} method is called.
  21371. *
  21372. * The {@link #insertContent default action of that method} is implemented as a
  21373. * listener to this event so it can be fully customized by the features.
  21374. *
  21375. * **Note** The `selectable` parameter for the {@link #insertContent} is optional. When `undefined` value is passed the method uses
  21376. * `model.document.selection`.
  21377. *
  21378. * @event insertContent
  21379. * @param {Array} args The arguments passed to the original method.
  21380. */
  21381. /**
  21382. * Event fired when {@link #deleteContent} method is called.
  21383. *
  21384. * The {@link #deleteContent default action of that method} is implemented as a
  21385. * listener to this event so it can be fully customized by the features.
  21386. *
  21387. * @event deleteContent
  21388. * @param {Array} args The arguments passed to the original method.
  21389. */
  21390. /**
  21391. * Event fired when {@link #modifySelection} method is called.
  21392. *
  21393. * The {@link #modifySelection default action of that method} is implemented as a
  21394. * listener to this event so it can be fully customized by the features.
  21395. *
  21396. * @event modifySelection
  21397. * @param {Array} args The arguments passed to the original method.
  21398. */
  21399. /**
  21400. * Event fired when {@link #getSelectedContent} method is called.
  21401. *
  21402. * The {@link #getSelectedContent default action of that method} is implemented as a
  21403. * listener to this event so it can be fully customized by the features.
  21404. *
  21405. * @event getSelectedContent
  21406. * @param {Array} args The arguments passed to the original method.
  21407. */
  21408. }
  21409. Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_6__["default"])( Model, _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_5__["default"] );
  21410. /***/ }),
  21411. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/node.js":
  21412. /*!*******************************************************************!*\
  21413. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/node.js ***!
  21414. \*******************************************************************/
  21415. /*! exports provided: default */
  21416. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  21417. "use strict";
  21418. __webpack_require__.r(__webpack_exports__);
  21419. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Node; });
  21420. /* 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");
  21421. /* 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");
  21422. /* 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");
  21423. /* 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");
  21424. /**
  21425. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  21426. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  21427. */
  21428. /**
  21429. * @module engine/model/node
  21430. */
  21431. // To check if component is loaded more than once.
  21432. /**
  21433. * Model node. Most basic structure of model tree.
  21434. *
  21435. * This is an abstract class that is a base for other classes representing different nodes in model.
  21436. *
  21437. * **Note:** If a node is detached from the model tree, you can manipulate it using it's API.
  21438. * However, it is **very important** that nodes already attached to model tree should be only changed through
  21439. * {@link module:engine/model/writer~Writer Writer API}.
  21440. *
  21441. * Changes done by `Node` methods, like {@link module:engine/model/element~Element#_insertChild _insertChild} or
  21442. * {@link module:engine/model/node~Node#_setAttribute _setAttribute}
  21443. * do not generate {@link module:engine/model/operation/operation~Operation operations}
  21444. * which are essential for correct editor work if you modify nodes in {@link module:engine/model/document~Document document} root.
  21445. *
  21446. * The flow of working on `Node` (and classes that inherits from it) is as such:
  21447. * 1. You can create a `Node` instance, modify it using it's API.
  21448. * 2. Add `Node` to the model using `Batch` API.
  21449. * 3. Change `Node` that was already added to the model using `Batch` API.
  21450. *
  21451. * Similarly, you cannot use `Batch` API on a node that has not been added to the model tree, with the exception
  21452. * of {@link module:engine/model/writer~Writer#insert inserting} that node to the model tree.
  21453. *
  21454. * Be aware that using {@link module:engine/model/writer~Writer#remove remove from Batch API} does not allow to use `Node` API because
  21455. * the information about `Node` is still kept in model document.
  21456. *
  21457. * In case of {@link module:engine/model/element~Element element node}, adding and removing children also counts as changing a node and
  21458. * follows same rules.
  21459. */
  21460. class Node {
  21461. /**
  21462. * Creates a model node.
  21463. *
  21464. * This is an abstract class, so this constructor should not be used directly.
  21465. *
  21466. * @abstract
  21467. * @param {Object} [attrs] Node's attributes. See {@link module:utils/tomap~toMap} for a list of accepted values.
  21468. */
  21469. constructor( attrs ) {
  21470. /**
  21471. * Parent of this node. It could be {@link module:engine/model/element~Element}
  21472. * or {@link module:engine/model/documentfragment~DocumentFragment}.
  21473. * Equals to `null` if the node has no parent.
  21474. *
  21475. * @readonly
  21476. * @member {module:engine/model/element~Element|module:engine/model/documentfragment~DocumentFragment|null}
  21477. */
  21478. this.parent = null;
  21479. /**
  21480. * Attributes set on this node.
  21481. *
  21482. * @private
  21483. * @member {Map} module:engine/model/node~Node#_attrs
  21484. */
  21485. this._attrs = Object(_ckeditor_ckeditor5_utils_src_tomap__WEBPACK_IMPORTED_MODULE_0__["default"])( attrs );
  21486. }
  21487. /**
  21488. * Index of this node in it's parent or `null` if the node has no parent.
  21489. *
  21490. * Accessing this property throws an error if this node's parent element does not contain it.
  21491. * This means that model tree got broken.
  21492. *
  21493. * @readonly
  21494. * @type {Number|null}
  21495. */
  21496. get index() {
  21497. let pos;
  21498. if ( !this.parent ) {
  21499. return null;
  21500. }
  21501. if ( ( pos = this.parent.getChildIndex( this ) ) === null ) {
  21502. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_1__["default"]( 'model-node-not-found-in-parent', this );
  21503. }
  21504. return pos;
  21505. }
  21506. /**
  21507. * Offset at which this node starts in it's parent. It is equal to the sum of {@link #offsetSize offsetSize}
  21508. * of all it's previous siblings. Equals to `null` if node has no parent.
  21509. *
  21510. * Accessing this property throws an error if this node's parent element does not contain it.
  21511. * This means that model tree got broken.
  21512. *
  21513. * @readonly
  21514. * @type {Number|null}
  21515. */
  21516. get startOffset() {
  21517. let pos;
  21518. if ( !this.parent ) {
  21519. return null;
  21520. }
  21521. if ( ( pos = this.parent.getChildStartOffset( this ) ) === null ) {
  21522. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_1__["default"]( 'model-node-not-found-in-parent', this );
  21523. }
  21524. return pos;
  21525. }
  21526. /**
  21527. * Offset size of this node. Represents how much "offset space" is occupied by the node in it's parent.
  21528. * It is important for {@link module:engine/model/position~Position position}. When node has `offsetSize` greater than `1`, position
  21529. * can be placed between that node start and end. `offsetSize` greater than `1` is for nodes that represents more
  21530. * than one entity, i.e. {@link module:engine/model/text~Text text node}.
  21531. *
  21532. * @readonly
  21533. * @type {Number}
  21534. */
  21535. get offsetSize() {
  21536. return 1;
  21537. }
  21538. /**
  21539. * Offset at which this node ends in it's parent. It is equal to the sum of this node's
  21540. * {@link module:engine/model/node~Node#startOffset start offset} and {@link #offsetSize offset size}.
  21541. * Equals to `null` if the node has no parent.
  21542. *
  21543. * @readonly
  21544. * @type {Number|null}
  21545. */
  21546. get endOffset() {
  21547. if ( !this.parent ) {
  21548. return null;
  21549. }
  21550. return this.startOffset + this.offsetSize;
  21551. }
  21552. /**
  21553. * Node's next sibling or `null` if the node is a last child of it's parent or if the node has no parent.
  21554. *
  21555. * @readonly
  21556. * @type {module:engine/model/node~Node|null}
  21557. */
  21558. get nextSibling() {
  21559. const index = this.index;
  21560. return ( index !== null && this.parent.getChild( index + 1 ) ) || null;
  21561. }
  21562. /**
  21563. * Node's previous sibling or `null` if the node is a first child of it's parent or if the node has no parent.
  21564. *
  21565. * @readonly
  21566. * @type {module:engine/model/node~Node|null}
  21567. */
  21568. get previousSibling() {
  21569. const index = this.index;
  21570. return ( index !== null && this.parent.getChild( index - 1 ) ) || null;
  21571. }
  21572. /**
  21573. * The top-most ancestor of the node. If node has no parent it is the root itself. If the node is a part
  21574. * of {@link module:engine/model/documentfragment~DocumentFragment}, it's `root` is equal to that `DocumentFragment`.
  21575. *
  21576. * @readonly
  21577. * @type {module:engine/model/node~Node|module:engine/model/documentfragment~DocumentFragment}
  21578. */
  21579. get root() {
  21580. let root = this; // eslint-disable-line consistent-this
  21581. while ( root.parent ) {
  21582. root = root.parent;
  21583. }
  21584. return root;
  21585. }
  21586. /**
  21587. * Returns true if the node is in a tree rooted in the document (is a descendant of one of its roots).
  21588. *
  21589. * @returns {Boolean}
  21590. */
  21591. isAttached() {
  21592. return this.root.is( 'rootElement' );
  21593. }
  21594. /**
  21595. * Gets path to the node. The path is an array containing starting offsets of consecutive ancestors of this node,
  21596. * beginning from {@link module:engine/model/node~Node#root root}, down to this node's starting offset. The path can be used to
  21597. * create {@link module:engine/model/position~Position Position} instance.
  21598. *
  21599. * const abc = new Text( 'abc' );
  21600. * const foo = new Text( 'foo' );
  21601. * const h1 = new Element( 'h1', null, new Text( 'header' ) );
  21602. * const p = new Element( 'p', null, [ abc, foo ] );
  21603. * const div = new Element( 'div', null, [ h1, p ] );
  21604. * foo.getPath(); // Returns [ 1, 3 ]. `foo` is in `p` which is in `div`. `p` starts at offset 1, while `foo` at 3.
  21605. * h1.getPath(); // Returns [ 0 ].
  21606. * div.getPath(); // Returns [].
  21607. *
  21608. * @returns {Array.<Number>} The path.
  21609. */
  21610. getPath() {
  21611. const path = [];
  21612. let node = this; // eslint-disable-line consistent-this
  21613. while ( node.parent ) {
  21614. path.unshift( node.startOffset );
  21615. node = node.parent;
  21616. }
  21617. return path;
  21618. }
  21619. /**
  21620. * Returns ancestors array of this node.
  21621. *
  21622. * @param {Object} options Options object.
  21623. * @param {Boolean} [options.includeSelf=false] When set to `true` this node will be also included in parent's array.
  21624. * @param {Boolean} [options.parentFirst=false] When set to `true`, array will be sorted from node's parent to root element,
  21625. * otherwise root element will be the first item in the array.
  21626. * @returns {Array} Array with ancestors.
  21627. */
  21628. getAncestors( options = { includeSelf: false, parentFirst: false } ) {
  21629. const ancestors = [];
  21630. let parent = options.includeSelf ? this : this.parent;
  21631. while ( parent ) {
  21632. ancestors[ options.parentFirst ? 'push' : 'unshift' ]( parent );
  21633. parent = parent.parent;
  21634. }
  21635. return ancestors;
  21636. }
  21637. /**
  21638. * Returns a {@link module:engine/model/element~Element} or {@link module:engine/model/documentfragment~DocumentFragment}
  21639. * which is a common ancestor of both nodes.
  21640. *
  21641. * @param {module:engine/model/node~Node} node The second node.
  21642. * @param {Object} options Options object.
  21643. * @param {Boolean} [options.includeSelf=false] When set to `true` both nodes will be considered "ancestors" too.
  21644. * Which means that if e.g. node A is inside B, then their common ancestor will be B.
  21645. * @returns {module:engine/model/element~Element|module:engine/model/documentfragment~DocumentFragment|null}
  21646. */
  21647. getCommonAncestor( node, options = {} ) {
  21648. const ancestorsA = this.getAncestors( options );
  21649. const ancestorsB = node.getAncestors( options );
  21650. let i = 0;
  21651. while ( ancestorsA[ i ] == ancestorsB[ i ] && ancestorsA[ i ] ) {
  21652. i++;
  21653. }
  21654. return i === 0 ? null : ancestorsA[ i - 1 ];
  21655. }
  21656. /**
  21657. * Returns whether this node is before given node. `false` is returned if nodes are in different trees (for example,
  21658. * in different {@link module:engine/model/documentfragment~DocumentFragment}s).
  21659. *
  21660. * @param {module:engine/model/node~Node} node Node to compare with.
  21661. * @returns {Boolean}
  21662. */
  21663. isBefore( node ) {
  21664. // Given node is not before this node if they are same.
  21665. if ( this == node ) {
  21666. return false;
  21667. }
  21668. // Return `false` if it is impossible to compare nodes.
  21669. if ( this.root !== node.root ) {
  21670. return false;
  21671. }
  21672. const thisPath = this.getPath();
  21673. const nodePath = node.getPath();
  21674. const result = Object(_ckeditor_ckeditor5_utils_src_comparearrays__WEBPACK_IMPORTED_MODULE_2__["default"])( thisPath, nodePath );
  21675. switch ( result ) {
  21676. case 'prefix':
  21677. return true;
  21678. case 'extension':
  21679. return false;
  21680. default:
  21681. return thisPath[ result ] < nodePath[ result ];
  21682. }
  21683. }
  21684. /**
  21685. * Returns whether this node is after given node. `false` is returned if nodes are in different trees (for example,
  21686. * in different {@link module:engine/model/documentfragment~DocumentFragment}s).
  21687. *
  21688. * @param {module:engine/model/node~Node} node Node to compare with.
  21689. * @returns {Boolean}
  21690. */
  21691. isAfter( node ) {
  21692. // Given node is not before this node if they are same.
  21693. if ( this == node ) {
  21694. return false;
  21695. }
  21696. // Return `false` if it is impossible to compare nodes.
  21697. if ( this.root !== node.root ) {
  21698. return false;
  21699. }
  21700. // In other cases, just check if the `node` is before, and return the opposite.
  21701. return !this.isBefore( node );
  21702. }
  21703. /**
  21704. * Checks if the node has an attribute with given key.
  21705. *
  21706. * @param {String} key Key of attribute to check.
  21707. * @returns {Boolean} `true` if attribute with given key is set on node, `false` otherwise.
  21708. */
  21709. hasAttribute( key ) {
  21710. return this._attrs.has( key );
  21711. }
  21712. /**
  21713. * Gets an attribute value for given key or `undefined` if that attribute is not set on node.
  21714. *
  21715. * @param {String} key Key of attribute to look for.
  21716. * @returns {*} Attribute value or `undefined`.
  21717. */
  21718. getAttribute( key ) {
  21719. return this._attrs.get( key );
  21720. }
  21721. /**
  21722. * Returns iterator that iterates over this node's attributes.
  21723. *
  21724. * Attributes are returned as arrays containing two items. First one is attribute key and second is attribute value.
  21725. * This format is accepted by native `Map` object and also can be passed in `Node` constructor.
  21726. *
  21727. * @returns {Iterable.<*>}
  21728. */
  21729. getAttributes() {
  21730. return this._attrs.entries();
  21731. }
  21732. /**
  21733. * Returns iterator that iterates over this node's attribute keys.
  21734. *
  21735. * @returns {Iterable.<String>}
  21736. */
  21737. getAttributeKeys() {
  21738. return this._attrs.keys();
  21739. }
  21740. /**
  21741. * Converts `Node` to plain object and returns it.
  21742. *
  21743. * @returns {Object} `Node` converted to plain object.
  21744. */
  21745. toJSON() {
  21746. const json = {};
  21747. // Serializes attributes to the object.
  21748. // attributes = { a: 'foo', b: 1, c: true }.
  21749. if ( this._attrs.size ) {
  21750. json.attributes = Array.from( this._attrs ).reduce( ( result, attr ) => {
  21751. result[ attr[ 0 ] ] = attr[ 1 ];
  21752. return result;
  21753. }, {} );
  21754. }
  21755. return json;
  21756. }
  21757. /**
  21758. * Checks whether this object is of the given type.
  21759. *
  21760. * This method is useful when processing model objects that are of unknown type. For example, a function
  21761. * may return a {@link module:engine/model/documentfragment~DocumentFragment} or a {@link module:engine/model/node~Node}
  21762. * that can be either a text node or an element. This method can be used to check what kind of object is returned.
  21763. *
  21764. * someObject.is( 'element' ); // -> true if this is an element
  21765. * someObject.is( 'node' ); // -> true if this is a node (a text node or an element)
  21766. * someObject.is( 'documentFragment' ); // -> true if this is a document fragment
  21767. *
  21768. * Since this method is also available on a range of view objects, you can prefix the type of the object with
  21769. * `model:` or `view:` to check, for example, if this is the model's or view's element:
  21770. *
  21771. * modelElement.is( 'model:element' ); // -> true
  21772. * modelElement.is( 'view:element' ); // -> false
  21773. *
  21774. * By using this method it is also possible to check a name of an element:
  21775. *
  21776. * imageElement.is( 'element', 'image' ); // -> true
  21777. * imageElement.is( 'element', 'image' ); // -> same as above
  21778. * imageElement.is( 'model:element', 'image' ); // -> same as above, but more precise
  21779. *
  21780. * The list of model objects which implement the `is()` method:
  21781. *
  21782. * * {@link module:engine/model/node~Node#is `Node#is()`}
  21783. * * {@link module:engine/model/text~Text#is `Text#is()`}
  21784. * * {@link module:engine/model/element~Element#is `Element#is()`}
  21785. * * {@link module:engine/model/rootelement~RootElement#is `RootElement#is()`}
  21786. * * {@link module:engine/model/position~Position#is `Position#is()`}
  21787. * * {@link module:engine/model/liveposition~LivePosition#is `LivePosition#is()`}
  21788. * * {@link module:engine/model/range~Range#is `Range#is()`}
  21789. * * {@link module:engine/model/liverange~LiveRange#is `LiveRange#is()`}
  21790. * * {@link module:engine/model/documentfragment~DocumentFragment#is `DocumentFragment#is()`}
  21791. * * {@link module:engine/model/selection~Selection#is `Selection#is()`}
  21792. * * {@link module:engine/model/documentselection~DocumentSelection#is `DocumentSelection#is()`}
  21793. * * {@link module:engine/model/markercollection~Marker#is `Marker#is()`}
  21794. * * {@link module:engine/model/textproxy~TextProxy#is `TextProxy#is()`}
  21795. *
  21796. * @method #is
  21797. * @param {String} type Type to check.
  21798. * @returns {Boolean}
  21799. */
  21800. is( type ) {
  21801. return type === 'node' || type === 'model:node';
  21802. }
  21803. /**
  21804. * Creates a copy of this node, that is a node with exactly same attributes, and returns it.
  21805. *
  21806. * @protected
  21807. * @returns {module:engine/model/node~Node} Node with same attributes as this node.
  21808. */
  21809. _clone() {
  21810. return new Node( this._attrs );
  21811. }
  21812. /**
  21813. * Removes this node from it's parent.
  21814. *
  21815. * @see module:engine/model/writer~Writer#remove
  21816. * @protected
  21817. */
  21818. _remove() {
  21819. this.parent._removeChildren( this.index );
  21820. }
  21821. /**
  21822. * Sets attribute on the node. If attribute with the same key already is set, it's value is overwritten.
  21823. *
  21824. * @see module:engine/model/writer~Writer#setAttribute
  21825. * @protected
  21826. * @param {String} key Key of attribute to set.
  21827. * @param {*} value Attribute value.
  21828. */
  21829. _setAttribute( key, value ) {
  21830. this._attrs.set( key, value );
  21831. }
  21832. /**
  21833. * Removes all attributes from the node and sets given attributes.
  21834. *
  21835. * @see module:engine/model/writer~Writer#setAttributes
  21836. * @protected
  21837. * @param {Object} [attrs] Attributes to set. See {@link module:utils/tomap~toMap} for a list of accepted values.
  21838. */
  21839. _setAttributesTo( attrs ) {
  21840. this._attrs = Object(_ckeditor_ckeditor5_utils_src_tomap__WEBPACK_IMPORTED_MODULE_0__["default"])( attrs );
  21841. }
  21842. /**
  21843. * Removes an attribute with given key from the node.
  21844. *
  21845. * @see module:engine/model/writer~Writer#removeAttribute
  21846. * @protected
  21847. * @param {String} key Key of attribute to remove.
  21848. * @returns {Boolean} `true` if the attribute was set on the element, `false` otherwise.
  21849. */
  21850. _removeAttribute( key ) {
  21851. return this._attrs.delete( key );
  21852. }
  21853. /**
  21854. * Removes all attributes from the node.
  21855. *
  21856. * @see module:engine/model/writer~Writer#clearAttributes
  21857. * @protected
  21858. */
  21859. _clearAttributes() {
  21860. this._attrs.clear();
  21861. }
  21862. }
  21863. /**
  21864. * The node's parent does not contain this node.
  21865. *
  21866. * @error model-node-not-found-in-parent
  21867. */
  21868. /***/ }),
  21869. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/nodelist.js":
  21870. /*!***********************************************************************!*\
  21871. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/nodelist.js ***!
  21872. \***********************************************************************/
  21873. /*! exports provided: default */
  21874. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  21875. "use strict";
  21876. __webpack_require__.r(__webpack_exports__);
  21877. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return NodeList; });
  21878. /* harmony import */ var _node__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/node.js");
  21879. /* 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");
  21880. /**
  21881. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  21882. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  21883. */
  21884. /**
  21885. * @module engine/model/nodelist
  21886. */
  21887. /**
  21888. * Provides an interface to operate on a list of {@link module:engine/model/node~Node nodes}. `NodeList` is used internally
  21889. * in classes like {@link module:engine/model/element~Element Element}
  21890. * or {@link module:engine/model/documentfragment~DocumentFragment DocumentFragment}.
  21891. */
  21892. class NodeList {
  21893. /**
  21894. * Creates an empty node list.
  21895. *
  21896. * @protected
  21897. * @param {Iterable.<module:engine/model/node~Node>} nodes Nodes contained in this node list.
  21898. */
  21899. constructor( nodes ) {
  21900. /**
  21901. * Nodes contained in this node list.
  21902. *
  21903. * @private
  21904. * @member {Array.<module:engine/model/node~Node>}
  21905. */
  21906. this._nodes = [];
  21907. if ( nodes ) {
  21908. this._insertNodes( 0, nodes );
  21909. }
  21910. }
  21911. /**
  21912. * Iterable interface.
  21913. *
  21914. * Iterates over all nodes contained inside this node list.
  21915. *
  21916. * @returns {Iterable.<module:engine/model/node~Node>}
  21917. */
  21918. [ Symbol.iterator ]() {
  21919. return this._nodes[ Symbol.iterator ]();
  21920. }
  21921. /**
  21922. * Number of nodes contained inside this node list.
  21923. *
  21924. * @readonly
  21925. * @type {Number}
  21926. */
  21927. get length() {
  21928. return this._nodes.length;
  21929. }
  21930. /**
  21931. * Sum of {@link module:engine/model/node~Node#offsetSize offset sizes} of all nodes contained inside this node list.
  21932. *
  21933. * @readonly
  21934. * @type {Number}
  21935. */
  21936. get maxOffset() {
  21937. return this._nodes.reduce( ( sum, node ) => sum + node.offsetSize, 0 );
  21938. }
  21939. /**
  21940. * Gets the node at the given index. Returns `null` if incorrect index was passed.
  21941. *
  21942. * @param {Number} index Index of node.
  21943. * @returns {module:engine/model/node~Node|null} Node at given index.
  21944. */
  21945. getNode( index ) {
  21946. return this._nodes[ index ] || null;
  21947. }
  21948. /**
  21949. * Returns an index of the given node. Returns `null` if given node is not inside this node list.
  21950. *
  21951. * @param {module:engine/model/node~Node} node Child node to look for.
  21952. * @returns {Number|null} Child node's index.
  21953. */
  21954. getNodeIndex( node ) {
  21955. const index = this._nodes.indexOf( node );
  21956. return index == -1 ? null : index;
  21957. }
  21958. /**
  21959. * Returns the starting offset of given node. Starting offset is equal to the sum of
  21960. * {@link module:engine/model/node~Node#offsetSize offset sizes} of all nodes that are before this node in this node list.
  21961. *
  21962. * @param {module:engine/model/node~Node} node Node to look for.
  21963. * @returns {Number|null} Node's starting offset.
  21964. */
  21965. getNodeStartOffset( node ) {
  21966. const index = this.getNodeIndex( node );
  21967. return index === null ? null : this._nodes.slice( 0, index ).reduce( ( sum, node ) => sum + node.offsetSize, 0 );
  21968. }
  21969. /**
  21970. * Converts index to offset in node list.
  21971. *
  21972. * Returns starting offset of a node that is at given index. Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError}
  21973. * `model-nodelist-index-out-of-bounds` if given index is less than `0` or more than {@link #length}.
  21974. *
  21975. * @param {Number} index Node's index.
  21976. * @returns {Number} Node's starting offset.
  21977. */
  21978. indexToOffset( index ) {
  21979. if ( index == this._nodes.length ) {
  21980. return this.maxOffset;
  21981. }
  21982. const node = this._nodes[ index ];
  21983. if ( !node ) {
  21984. /**
  21985. * Given index cannot be found in the node list.
  21986. *
  21987. * @error model-nodelist-index-out-of-bounds
  21988. */
  21989. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_1__["default"]( 'model-nodelist-index-out-of-bounds', this );
  21990. }
  21991. return this.getNodeStartOffset( node );
  21992. }
  21993. /**
  21994. * Converts offset in node list to index.
  21995. *
  21996. * Returns index of a node that occupies given offset. Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError}
  21997. * `model-nodelist-offset-out-of-bounds` if given offset is less than `0` or more than {@link #maxOffset}.
  21998. *
  21999. * @param {Number} offset Offset to look for.
  22000. * @returns {Number} Index of a node that occupies given offset.
  22001. */
  22002. offsetToIndex( offset ) {
  22003. let totalOffset = 0;
  22004. for ( const node of this._nodes ) {
  22005. if ( offset >= totalOffset && offset < totalOffset + node.offsetSize ) {
  22006. return this.getNodeIndex( node );
  22007. }
  22008. totalOffset += node.offsetSize;
  22009. }
  22010. if ( totalOffset != offset ) {
  22011. /**
  22012. * Given offset cannot be found in the node list.
  22013. *
  22014. * @error model-nodelist-offset-out-of-bounds
  22015. * @param {Number} offset
  22016. * @param {module:engine/model/nodelist~NodeList} nodeList Stringified node list.
  22017. */
  22018. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_1__["default"]( 'model-nodelist-offset-out-of-bounds',
  22019. this,
  22020. {
  22021. offset,
  22022. nodeList: this
  22023. }
  22024. );
  22025. }
  22026. return this.length;
  22027. }
  22028. /**
  22029. * Inserts given nodes at given index.
  22030. *
  22031. * @protected
  22032. * @param {Number} index Index at which nodes should be inserted.
  22033. * @param {Iterable.<module:engine/model/node~Node>} nodes Nodes to be inserted.
  22034. */
  22035. _insertNodes( index, nodes ) {
  22036. // Validation.
  22037. for ( const node of nodes ) {
  22038. if ( !( node instanceof _node__WEBPACK_IMPORTED_MODULE_0__["default"] ) ) {
  22039. /**
  22040. * Trying to insert an object which is not a Node instance.
  22041. *
  22042. * @error model-nodelist-insertnodes-not-node
  22043. */
  22044. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_1__["default"]( 'model-nodelist-insertnodes-not-node', this );
  22045. }
  22046. }
  22047. this._nodes.splice( index, 0, ...nodes );
  22048. }
  22049. /**
  22050. * Removes one or more nodes starting at the given index.
  22051. *
  22052. * @protected
  22053. * @param {Number} indexStart Index of the first node to remove.
  22054. * @param {Number} [howMany=1] Number of nodes to remove.
  22055. * @returns {Array.<module:engine/model/node~Node>} Array containing removed nodes.
  22056. */
  22057. _removeNodes( indexStart, howMany = 1 ) {
  22058. return this._nodes.splice( indexStart, howMany );
  22059. }
  22060. /**
  22061. * Converts `NodeList` instance to an array containing nodes that were inserted in the node list. Nodes
  22062. * are also converted to their plain object representation.
  22063. *
  22064. * @returns {Array.<module:engine/model/node~Node>} `NodeList` instance converted to `Array`.
  22065. */
  22066. toJSON() {
  22067. return this._nodes.map( node => node.toJSON() );
  22068. }
  22069. }
  22070. /***/ }),
  22071. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/attributeoperation.js":
  22072. /*!*******************************************************************************************!*\
  22073. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/attributeoperation.js ***!
  22074. \*******************************************************************************************/
  22075. /*! exports provided: default */
  22076. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  22077. "use strict";
  22078. __webpack_require__.r(__webpack_exports__);
  22079. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return AttributeOperation; });
  22080. /* harmony import */ var _operation__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./operation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/operation.js");
  22081. /* harmony import */ var _range__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../range */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/range.js");
  22082. /* 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");
  22083. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/utils.js");
  22084. /* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! lodash-es */ "./node_modules/lodash-es/lodash.js");
  22085. /**
  22086. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  22087. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  22088. */
  22089. /**
  22090. * @module engine/model/operation/attributeoperation
  22091. */
  22092. /**
  22093. * Operation to change nodes' attribute.
  22094. *
  22095. * Using this class you can add, remove or change value of the attribute.
  22096. *
  22097. * @extends module:engine/model/operation/operation~Operation
  22098. */
  22099. class AttributeOperation extends _operation__WEBPACK_IMPORTED_MODULE_0__["default"] {
  22100. /**
  22101. * Creates an operation that changes, removes or adds attributes.
  22102. *
  22103. * If only `newValue` is set, attribute will be added on a node. Note that all nodes in operation's range must not
  22104. * have an attribute with the same key as the added attribute.
  22105. *
  22106. * If only `oldValue` is set, then attribute with given key will be removed. Note that all nodes in operation's range
  22107. * must have an attribute with that key added.
  22108. *
  22109. * If both `newValue` and `oldValue` are set, then the operation will change the attribute value. Note that all nodes in
  22110. * operation's ranges must already have an attribute with given key and `oldValue` as value
  22111. *
  22112. * @param {module:engine/model/range~Range} range Range on which the operation should be applied. Must be a flat range.
  22113. * @param {String} key Key of an attribute to change or remove.
  22114. * @param {*} oldValue Old value of the attribute with given key or `null`, if attribute was not set before.
  22115. * @param {*} newValue New value of the attribute with given key or `null`, if operation should remove attribute.
  22116. * @param {Number|null} baseVersion Document {@link module:engine/model/document~Document#version} on which operation
  22117. * can be applied or `null` if the operation operates on detached (non-document) tree.
  22118. */
  22119. constructor( range, key, oldValue, newValue, baseVersion ) {
  22120. super( baseVersion );
  22121. /**
  22122. * Range on which operation should be applied.
  22123. *
  22124. * @readonly
  22125. * @member {module:engine/model/range~Range}
  22126. */
  22127. this.range = range.clone();
  22128. /**
  22129. * Key of an attribute to change or remove.
  22130. *
  22131. * @readonly
  22132. * @member {String}
  22133. */
  22134. this.key = key;
  22135. /**
  22136. * Old value of the attribute with given key or `null`, if attribute was not set before.
  22137. *
  22138. * @readonly
  22139. * @member {*}
  22140. */
  22141. this.oldValue = oldValue === undefined ? null : oldValue;
  22142. /**
  22143. * New value of the attribute with given key or `null`, if operation should remove attribute.
  22144. *
  22145. * @readonly
  22146. * @member {*}
  22147. */
  22148. this.newValue = newValue === undefined ? null : newValue;
  22149. }
  22150. /**
  22151. * @inheritDoc
  22152. */
  22153. get type() {
  22154. if ( this.oldValue === null ) {
  22155. return 'addAttribute';
  22156. } else if ( this.newValue === null ) {
  22157. return 'removeAttribute';
  22158. } else {
  22159. return 'changeAttribute';
  22160. }
  22161. }
  22162. /**
  22163. * Creates and returns an operation that has the same parameters as this operation.
  22164. *
  22165. * @returns {module:engine/model/operation/attributeoperation~AttributeOperation} Clone of this operation.
  22166. */
  22167. clone() {
  22168. return new AttributeOperation( this.range, this.key, this.oldValue, this.newValue, this.baseVersion );
  22169. }
  22170. /**
  22171. * See {@link module:engine/model/operation/operation~Operation#getReversed `Operation#getReversed()`}.
  22172. *
  22173. * @returns {module:engine/model/operation/attributeoperation~AttributeOperation}
  22174. */
  22175. getReversed() {
  22176. return new AttributeOperation( this.range, this.key, this.newValue, this.oldValue, this.baseVersion + 1 );
  22177. }
  22178. /**
  22179. * @inheritDoc
  22180. */
  22181. toJSON() {
  22182. const json = super.toJSON();
  22183. json.range = this.range.toJSON();
  22184. return json;
  22185. }
  22186. /**
  22187. * @inheritDoc
  22188. */
  22189. _validate() {
  22190. if ( !this.range.isFlat ) {
  22191. /**
  22192. * The range to change is not flat.
  22193. *
  22194. * @error attribute-operation-range-not-flat
  22195. */
  22196. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__["default"]( 'attribute-operation-range-not-flat', this );
  22197. }
  22198. for ( const item of this.range.getItems( { shallow: true } ) ) {
  22199. if ( this.oldValue !== null && !Object(lodash_es__WEBPACK_IMPORTED_MODULE_4__["isEqual"])( item.getAttribute( this.key ), this.oldValue ) ) {
  22200. /**
  22201. * Changed node has different attribute value than operation's old attribute value.
  22202. *
  22203. * @error attribute-operation-wrong-old-value
  22204. * @param {module:engine/model/item~Item} item
  22205. * @param {String} key
  22206. * @param {*} value
  22207. */
  22208. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__["default"](
  22209. 'attribute-operation-wrong-old-value',
  22210. this,
  22211. { item, key: this.key, value: this.oldValue }
  22212. );
  22213. }
  22214. if ( this.oldValue === null && this.newValue !== null && item.hasAttribute( this.key ) ) {
  22215. /**
  22216. * The attribute with given key already exists for the given node.
  22217. *
  22218. * @error attribute-operation-attribute-exists
  22219. * @param {module:engine/model/node~Node} node
  22220. * @param {String} key
  22221. */
  22222. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__["default"](
  22223. 'attribute-operation-attribute-exists',
  22224. this,
  22225. { node: item, key: this.key }
  22226. );
  22227. }
  22228. }
  22229. }
  22230. /**
  22231. * @inheritDoc
  22232. */
  22233. _execute() {
  22234. // If value to set is same as old value, don't do anything.
  22235. if ( !Object(lodash_es__WEBPACK_IMPORTED_MODULE_4__["isEqual"])( this.oldValue, this.newValue ) ) {
  22236. // Execution.
  22237. Object(_utils__WEBPACK_IMPORTED_MODULE_3__["_setAttribute"])( this.range, this.key, this.newValue );
  22238. }
  22239. }
  22240. /**
  22241. * @inheritDoc
  22242. */
  22243. static get className() {
  22244. return 'AttributeOperation';
  22245. }
  22246. /**
  22247. * Creates `AttributeOperation` object from deserilized object, i.e. from parsed JSON string.
  22248. *
  22249. * @param {Object} json Deserialized JSON object.
  22250. * @param {module:engine/model/document~Document} document Document on which this operation will be applied.
  22251. * @returns {module:engine/model/operation/attributeoperation~AttributeOperation}
  22252. */
  22253. static fromJSON( json, document ) {
  22254. return new AttributeOperation( _range__WEBPACK_IMPORTED_MODULE_1__["default"].fromJSON( json.range, document ), json.key, json.oldValue, json.newValue, json.baseVersion );
  22255. }
  22256. // @if CK_DEBUG_ENGINE // toString() {
  22257. // @if CK_DEBUG_ENGINE // return `AttributeOperation( ${ this.baseVersion } ): ` +
  22258. // @if CK_DEBUG_ENGINE // `"${ this.key }": ${ JSON.stringify( this.oldValue ) }` +
  22259. // @if CK_DEBUG_ENGINE // ` -> ${ JSON.stringify( this.newValue ) }, ${ this.range }`;
  22260. // @if CK_DEBUG_ENGINE // }
  22261. }
  22262. /***/ }),
  22263. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/detachoperation.js":
  22264. /*!****************************************************************************************!*\
  22265. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/detachoperation.js ***!
  22266. \****************************************************************************************/
  22267. /*! exports provided: default */
  22268. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  22269. "use strict";
  22270. __webpack_require__.r(__webpack_exports__);
  22271. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return DetachOperation; });
  22272. /* harmony import */ var _operation__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./operation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/operation.js");
  22273. /* harmony import */ var _range__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../range */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/range.js");
  22274. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/utils.js");
  22275. /* 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");
  22276. /**
  22277. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  22278. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  22279. */
  22280. /**
  22281. * @module engine/model/operation/detachoperation
  22282. */
  22283. // @if CK_DEBUG_ENGINE // const ModelRange = require( '../range' ).default;
  22284. /**
  22285. * Operation to permanently remove node from detached root.
  22286. * Note this operation is only a local operation and won't be send to the other clients.
  22287. *
  22288. * @extends module:engine/model/operation/operation~Operation
  22289. */
  22290. class DetachOperation extends _operation__WEBPACK_IMPORTED_MODULE_0__["default"] {
  22291. /**
  22292. * Creates an insert operation.
  22293. *
  22294. * @param {module:engine/model/position~Position} sourcePosition
  22295. * Position before the first {@link module:engine/model/item~Item model item} to move.
  22296. * @param {Number} howMany Offset size of moved range. Moved range will start from `sourcePosition` and end at
  22297. * `sourcePosition` with offset shifted by `howMany`.
  22298. */
  22299. constructor( sourcePosition, howMany ) {
  22300. super( null );
  22301. /**
  22302. * Position before the first {@link module:engine/model/item~Item model item} to detach.
  22303. *
  22304. * @member {module:engine/model/position~Position} #sourcePosition
  22305. */
  22306. this.sourcePosition = sourcePosition.clone();
  22307. /**
  22308. * Offset size of moved range.
  22309. *
  22310. * @member {Number} #howMany
  22311. */
  22312. this.howMany = howMany;
  22313. }
  22314. /**
  22315. * @inheritDoc
  22316. */
  22317. get type() {
  22318. return 'detach';
  22319. }
  22320. /**
  22321. * @inheritDoc
  22322. */
  22323. toJSON() {
  22324. const json = super.toJSON();
  22325. json.sourcePosition = this.sourcePosition.toJSON();
  22326. return json;
  22327. }
  22328. /**
  22329. * @inheritDoc
  22330. */
  22331. _validate() {
  22332. if ( this.sourcePosition.root.document ) {
  22333. /**
  22334. * Cannot detach document node.
  22335. *
  22336. * @error detach-operation-on-document-node
  22337. */
  22338. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_3__["default"]( 'detach-operation-on-document-node', this );
  22339. }
  22340. }
  22341. /**
  22342. * @inheritDoc
  22343. */
  22344. _execute() {
  22345. Object(_utils__WEBPACK_IMPORTED_MODULE_2__["_remove"])( _range__WEBPACK_IMPORTED_MODULE_1__["default"]._createFromPositionAndShift( this.sourcePosition, this.howMany ) );
  22346. }
  22347. /**
  22348. * @inheritDoc
  22349. */
  22350. static get className() {
  22351. return 'DetachOperation';
  22352. }
  22353. // @if CK_DEBUG_ENGINE // toString() {
  22354. // @if CK_DEBUG_ENGINE // const range = ModelRange._createFromPositionAndShift( this.sourcePosition, this.howMany );
  22355. // @if CK_DEBUG_ENGINE // const nodes = Array.from( range.getItems() );
  22356. // @if CK_DEBUG_ENGINE // const nodeString = nodes.length > 1 ? `[ ${ nodes.length } ]` : nodes[ 0 ];
  22357. // @if CK_DEBUG_ENGINE // return `DetachOperation( ${ this.baseVersion } ): ${ nodeString } -> ${ range }`;
  22358. // @if CK_DEBUG_ENGINE // }
  22359. }
  22360. /***/ }),
  22361. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/insertoperation.js":
  22362. /*!****************************************************************************************!*\
  22363. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/insertoperation.js ***!
  22364. \****************************************************************************************/
  22365. /*! exports provided: default */
  22366. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  22367. "use strict";
  22368. __webpack_require__.r(__webpack_exports__);
  22369. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return InsertOperation; });
  22370. /* harmony import */ var _operation__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./operation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/operation.js");
  22371. /* harmony import */ var _position__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../position */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/position.js");
  22372. /* harmony import */ var _nodelist__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../nodelist */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/nodelist.js");
  22373. /* harmony import */ var _moveoperation__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./moveoperation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/moveoperation.js");
  22374. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./utils */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/utils.js");
  22375. /* harmony import */ var _text__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../text */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/text.js");
  22376. /* harmony import */ var _element__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../element */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/element.js");
  22377. /* 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");
  22378. /**
  22379. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  22380. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  22381. */
  22382. /**
  22383. * @module engine/model/operation/insertoperation
  22384. */
  22385. /**
  22386. * Operation to insert one or more nodes at given position in the model.
  22387. *
  22388. * @extends module:engine/model/operation/operation~Operation
  22389. */
  22390. class InsertOperation extends _operation__WEBPACK_IMPORTED_MODULE_0__["default"] {
  22391. /**
  22392. * Creates an insert operation.
  22393. *
  22394. * @param {module:engine/model/position~Position} position Position of insertion.
  22395. * @param {module:engine/model/node~NodeSet} nodes The list of nodes to be inserted.
  22396. * @param {Number|null} baseVersion Document {@link module:engine/model/document~Document#version} on which operation
  22397. * can be applied or `null` if the operation operates on detached (non-document) tree.
  22398. */
  22399. constructor( position, nodes, baseVersion ) {
  22400. super( baseVersion );
  22401. /**
  22402. * Position of insertion.
  22403. *
  22404. * @readonly
  22405. * @member {module:engine/model/position~Position} module:engine/model/operation/insertoperation~InsertOperation#position
  22406. */
  22407. this.position = position.clone();
  22408. this.position.stickiness = 'toNone';
  22409. /**
  22410. * List of nodes to insert.
  22411. *
  22412. * @readonly
  22413. * @member {module:engine/model/nodelist~NodeList} module:engine/model/operation/insertoperation~InsertOperation#nodeList
  22414. */
  22415. this.nodes = new _nodelist__WEBPACK_IMPORTED_MODULE_2__["default"]( Object(_utils__WEBPACK_IMPORTED_MODULE_4__["_normalizeNodes"])( nodes ) );
  22416. /**
  22417. * Flag deciding how the operation should be transformed. If set to `true`, nodes might get additional attributes
  22418. * during operational transformation. This happens when the operation insertion position is inside of a range
  22419. * where attributes have changed.
  22420. *
  22421. * @member {Boolean} module:engine/model/operation/insertoperation~InsertOperation#shouldReceiveAttributes
  22422. */
  22423. this.shouldReceiveAttributes = false;
  22424. }
  22425. /**
  22426. * @inheritDoc
  22427. */
  22428. get type() {
  22429. return 'insert';
  22430. }
  22431. /**
  22432. * Total offset size of inserted nodes.
  22433. *
  22434. * @returns {Number}
  22435. */
  22436. get howMany() {
  22437. return this.nodes.maxOffset;
  22438. }
  22439. /**
  22440. * Creates and returns an operation that has the same parameters as this operation.
  22441. *
  22442. * @returns {module:engine/model/operation/insertoperation~InsertOperation} Clone of this operation.
  22443. */
  22444. clone() {
  22445. const nodes = new _nodelist__WEBPACK_IMPORTED_MODULE_2__["default"]( [ ...this.nodes ].map( node => node._clone( true ) ) );
  22446. const insert = new InsertOperation( this.position, nodes, this.baseVersion );
  22447. insert.shouldReceiveAttributes = this.shouldReceiveAttributes;
  22448. return insert;
  22449. }
  22450. /**
  22451. * See {@link module:engine/model/operation/operation~Operation#getReversed `Operation#getReversed()`}.
  22452. *
  22453. * @returns {module:engine/model/operation/moveoperation~MoveOperation}
  22454. */
  22455. getReversed() {
  22456. const graveyard = this.position.root.document.graveyard;
  22457. const gyPosition = new _position__WEBPACK_IMPORTED_MODULE_1__["default"]( graveyard, [ 0 ] );
  22458. return new _moveoperation__WEBPACK_IMPORTED_MODULE_3__["default"]( this.position, this.nodes.maxOffset, gyPosition, this.baseVersion + 1 );
  22459. }
  22460. /**
  22461. * @inheritDoc
  22462. */
  22463. _validate() {
  22464. const targetElement = this.position.parent;
  22465. if ( !targetElement || targetElement.maxOffset < this.position.offset ) {
  22466. /**
  22467. * Insertion position is invalid.
  22468. *
  22469. * @error insert-operation-position-invalid
  22470. */
  22471. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_7__["default"](
  22472. 'insert-operation-position-invalid',
  22473. this
  22474. );
  22475. }
  22476. }
  22477. /**
  22478. * @inheritDoc
  22479. */
  22480. _execute() {
  22481. // What happens here is that we want original nodes be passed to writer because we want original nodes
  22482. // to be inserted to the model. But in InsertOperation, we want to keep those nodes as they were added
  22483. // to the operation, not modified. For example, text nodes can get merged or cropped while Elements can
  22484. // get children. It is important that InsertOperation has the copy of original nodes in intact state.
  22485. const originalNodes = this.nodes;
  22486. this.nodes = new _nodelist__WEBPACK_IMPORTED_MODULE_2__["default"]( [ ...originalNodes ].map( node => node._clone( true ) ) );
  22487. Object(_utils__WEBPACK_IMPORTED_MODULE_4__["_insert"])( this.position, originalNodes );
  22488. }
  22489. /**
  22490. * @inheritDoc
  22491. */
  22492. toJSON() {
  22493. const json = super.toJSON();
  22494. json.position = this.position.toJSON();
  22495. json.nodes = this.nodes.toJSON();
  22496. return json;
  22497. }
  22498. /**
  22499. * @inheritDoc
  22500. */
  22501. static get className() {
  22502. return 'InsertOperation';
  22503. }
  22504. /**
  22505. * Creates `InsertOperation` object from deserilized object, i.e. from parsed JSON string.
  22506. *
  22507. * @param {Object} json Deserialized JSON object.
  22508. * @param {module:engine/model/document~Document} document Document on which this operation will be applied.
  22509. * @returns {module:engine/model/operation/insertoperation~InsertOperation}
  22510. */
  22511. static fromJSON( json, document ) {
  22512. const children = [];
  22513. for ( const child of json.nodes ) {
  22514. if ( child.name ) {
  22515. // If child has name property, it is an Element.
  22516. children.push( _element__WEBPACK_IMPORTED_MODULE_6__["default"].fromJSON( child ) );
  22517. } else {
  22518. // Otherwise, it is a Text node.
  22519. children.push( _text__WEBPACK_IMPORTED_MODULE_5__["default"].fromJSON( child ) );
  22520. }
  22521. }
  22522. const insert = new InsertOperation( _position__WEBPACK_IMPORTED_MODULE_1__["default"].fromJSON( json.position, document ), children, json.baseVersion );
  22523. insert.shouldReceiveAttributes = json.shouldReceiveAttributes;
  22524. return insert;
  22525. }
  22526. // @if CK_DEBUG_ENGINE // toString() {
  22527. // @if CK_DEBUG_ENGINE // const nodeString = this.nodes.length > 1 ? `[ ${ this.nodes.length } ]` : this.nodes.getNode( 0 );
  22528. // @if CK_DEBUG_ENGINE // return `InsertOperation( ${ this.baseVersion } ): ${ nodeString } -> ${ this.position }`;
  22529. // @if CK_DEBUG_ENGINE // }
  22530. }
  22531. /***/ }),
  22532. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/markeroperation.js":
  22533. /*!****************************************************************************************!*\
  22534. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/markeroperation.js ***!
  22535. \****************************************************************************************/
  22536. /*! exports provided: default */
  22537. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  22538. "use strict";
  22539. __webpack_require__.r(__webpack_exports__);
  22540. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return MarkerOperation; });
  22541. /* harmony import */ var _operation__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./operation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/operation.js");
  22542. /* harmony import */ var _range__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../range */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/range.js");
  22543. /**
  22544. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  22545. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  22546. */
  22547. /**
  22548. * @module engine/model/operation/markeroperation
  22549. */
  22550. /**
  22551. * @extends module:engine/model/operation/operation~Operation
  22552. */
  22553. class MarkerOperation extends _operation__WEBPACK_IMPORTED_MODULE_0__["default"] {
  22554. /**
  22555. * @param {String} name Marker name.
  22556. * @param {module:engine/model/range~Range} oldRange Marker range before the change.
  22557. * @param {module:engine/model/range~Range} newRange Marker range after the change.
  22558. * @param {module:engine/model/markercollection~MarkerCollection} markers Marker collection on which change should be executed.
  22559. * @param {Boolean} affectsData Specifies whether the marker operation affects the data produced by the data pipeline
  22560. * (is persisted in the editor's data).
  22561. * @param {Number|null} baseVersion Document {@link module:engine/model/document~Document#version} on which operation
  22562. * can be applied or `null` if the operation operates on detached (non-document) tree.
  22563. */
  22564. constructor( name, oldRange, newRange, markers, affectsData, baseVersion ) {
  22565. super( baseVersion );
  22566. /**
  22567. * Marker name.
  22568. *
  22569. * @readonly
  22570. * @member {String}
  22571. */
  22572. this.name = name;
  22573. /**
  22574. * Marker range before the change.
  22575. *
  22576. * @readonly
  22577. * @member {module:engine/model/range~Range}
  22578. */
  22579. this.oldRange = oldRange ? oldRange.clone() : null;
  22580. /**
  22581. * Marker range after the change.
  22582. *
  22583. * @readonly
  22584. * @member {module:engine/model/range~Range}
  22585. */
  22586. this.newRange = newRange ? newRange.clone() : null;
  22587. /**
  22588. * Specifies whether the marker operation affects the data produced by the data pipeline
  22589. * (is persisted in the editor's data).
  22590. *
  22591. * @readonly
  22592. * @member {Boolean}
  22593. */
  22594. this.affectsData = affectsData;
  22595. /**
  22596. * Marker collection on which change should be executed.
  22597. *
  22598. * @private
  22599. * @member {module:engine/model/markercollection~MarkerCollection}
  22600. */
  22601. this._markers = markers;
  22602. }
  22603. /**
  22604. * @inheritDoc
  22605. */
  22606. get type() {
  22607. return 'marker';
  22608. }
  22609. /**
  22610. * Creates and returns an operation that has the same parameters as this operation.
  22611. *
  22612. * @returns {module:engine/model/operation/markeroperation~MarkerOperation} Clone of this operation.
  22613. */
  22614. clone() {
  22615. return new MarkerOperation( this.name, this.oldRange, this.newRange, this._markers, this.affectsData, this.baseVersion );
  22616. }
  22617. /**
  22618. * See {@link module:engine/model/operation/operation~Operation#getReversed `Operation#getReversed()`}.
  22619. *
  22620. * @returns {module:engine/model/operation/markeroperation~MarkerOperation}
  22621. */
  22622. getReversed() {
  22623. return new MarkerOperation( this.name, this.newRange, this.oldRange, this._markers, this.affectsData, this.baseVersion + 1 );
  22624. }
  22625. /**
  22626. * @inheritDoc
  22627. */
  22628. _execute() {
  22629. const type = this.newRange ? '_set' : '_remove';
  22630. this._markers[ type ]( this.name, this.newRange, true, this.affectsData );
  22631. }
  22632. /**
  22633. * @inheritDoc
  22634. */
  22635. toJSON() {
  22636. const json = super.toJSON();
  22637. if ( this.oldRange ) {
  22638. json.oldRange = this.oldRange.toJSON();
  22639. }
  22640. if ( this.newRange ) {
  22641. json.newRange = this.newRange.toJSON();
  22642. }
  22643. delete json._markers;
  22644. return json;
  22645. }
  22646. /**
  22647. * @inheritDoc
  22648. */
  22649. static get className() {
  22650. return 'MarkerOperation';
  22651. }
  22652. /**
  22653. * Creates `MarkerOperation` object from deserialized object, i.e. from parsed JSON string.
  22654. *
  22655. * @param {Object} json Deserialized JSON object.
  22656. * @param {module:engine/model/document~Document} document Document on which this operation will be applied.
  22657. * @returns {module:engine/model/operation/markeroperation~MarkerOperation}
  22658. */
  22659. static fromJSON( json, document ) {
  22660. return new MarkerOperation(
  22661. json.name,
  22662. json.oldRange ? _range__WEBPACK_IMPORTED_MODULE_1__["default"].fromJSON( json.oldRange, document ) : null,
  22663. json.newRange ? _range__WEBPACK_IMPORTED_MODULE_1__["default"].fromJSON( json.newRange, document ) : null,
  22664. document.model.markers,
  22665. json.affectsData,
  22666. json.baseVersion
  22667. );
  22668. }
  22669. // @if CK_DEBUG_ENGINE // toString() {
  22670. // @if CK_DEBUG_ENGINE // return `MarkerOperation( ${ this.baseVersion } ): ` +
  22671. // @if CK_DEBUG_ENGINE // `"${ this.name }": ${ this.oldRange } -> ${ this.newRange }`;
  22672. // @if CK_DEBUG_ENGINE // }
  22673. }
  22674. /***/ }),
  22675. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/mergeoperation.js":
  22676. /*!***************************************************************************************!*\
  22677. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/mergeoperation.js ***!
  22678. \***************************************************************************************/
  22679. /*! exports provided: default */
  22680. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  22681. "use strict";
  22682. __webpack_require__.r(__webpack_exports__);
  22683. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return MergeOperation; });
  22684. /* harmony import */ var _operation__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./operation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/operation.js");
  22685. /* harmony import */ var _splitoperation__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./splitoperation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/splitoperation.js");
  22686. /* harmony import */ var _position__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../position */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/position.js");
  22687. /* harmony import */ var _range__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../range */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/range.js");
  22688. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./utils */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/utils.js");
  22689. /* 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");
  22690. /**
  22691. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  22692. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  22693. */
  22694. /**
  22695. * @module engine/model/operation/mergeoperation
  22696. */
  22697. /**
  22698. * Operation to merge two {@link module:engine/model/element~Element elements}.
  22699. *
  22700. * The merged element is the parent of {@link ~MergeOperation#sourcePosition} and it is merged into the parent of
  22701. * {@link ~MergeOperation#targetPosition}. All nodes from the merged element are moved to {@link ~MergeOperation#targetPosition}.
  22702. *
  22703. * The merged element is moved to the graveyard at {@link ~MergeOperation#graveyardPosition}.
  22704. *
  22705. * @extends module:engine/model/operation/operation~Operation
  22706. */
  22707. class MergeOperation extends _operation__WEBPACK_IMPORTED_MODULE_0__["default"] {
  22708. /**
  22709. * Creates a merge operation.
  22710. *
  22711. * @param {module:engine/model/position~Position} sourcePosition Position inside the merged element. All nodes from that
  22712. * element after that position will be moved to {@link ~#targetPosition}.
  22713. * @param {Number} howMany Summary offset size of nodes which will be moved from the merged element to the new parent.
  22714. * @param {module:engine/model/position~Position} targetPosition Position which the nodes from the merged elements will be moved to.
  22715. * @param {module:engine/model/position~Position} graveyardPosition Position in graveyard to which the merged element will be moved.
  22716. * @param {Number|null} baseVersion Document {@link module:engine/model/document~Document#version} on which operation
  22717. * can be applied or `null` if the operation operates on detached (non-document) tree.
  22718. */
  22719. constructor( sourcePosition, howMany, targetPosition, graveyardPosition, baseVersion ) {
  22720. super( baseVersion );
  22721. /**
  22722. * Position inside the merged element. All nodes from that element after that position will be moved to {@link ~#targetPosition}.
  22723. *
  22724. * @member {module:engine/model/position~Position} module:engine/model/operation/mergeoperation~MergeOperation#sourcePosition
  22725. */
  22726. this.sourcePosition = sourcePosition.clone();
  22727. // This is, and should always remain, the first position in its parent.
  22728. this.sourcePosition.stickiness = 'toPrevious';
  22729. /**
  22730. * Summary offset size of nodes which will be moved from the merged element to the new parent.
  22731. *
  22732. * @member {Number} module:engine/model/operation/mergeoperation~MergeOperation#howMany
  22733. */
  22734. this.howMany = howMany;
  22735. /**
  22736. * Position which the nodes from the merged elements will be moved to.
  22737. *
  22738. * @member {module:engine/model/position~Position} module:engine/model/operation/mergeoperation~MergeOperation#targetPosition
  22739. */
  22740. this.targetPosition = targetPosition.clone();
  22741. // Except of a rare scenario in `MergeOperation` x `MergeOperation` transformation,
  22742. // this is, and should always remain, the last position in its parent.
  22743. this.targetPosition.stickiness = 'toNext';
  22744. /**
  22745. * Position in graveyard to which the merged element will be moved.
  22746. *
  22747. * @member {module:engine/model/position~Position} module:engine/model/operation/mergeoperation~MergeOperation#graveyardPosition
  22748. */
  22749. this.graveyardPosition = graveyardPosition.clone();
  22750. }
  22751. /**
  22752. * @inheritDoc
  22753. */
  22754. get type() {
  22755. return 'merge';
  22756. }
  22757. /**
  22758. * Position before the merged element (which will be deleted).
  22759. *
  22760. * @readonly
  22761. * @type {module:engine/model/position~Position}
  22762. */
  22763. get deletionPosition() {
  22764. return new _position__WEBPACK_IMPORTED_MODULE_2__["default"]( this.sourcePosition.root, this.sourcePosition.path.slice( 0, -1 ) );
  22765. }
  22766. /**
  22767. * Artificial range that contains all the nodes from the merged element that will be moved to {@link ~MergeOperation#sourcePosition}.
  22768. * The range starts at {@link ~MergeOperation#sourcePosition} and ends in the same parent, at `POSITIVE_INFINITY` offset.
  22769. *
  22770. * @readonly
  22771. * @type {module:engine/model/range~Range}
  22772. */
  22773. get movedRange() {
  22774. const end = this.sourcePosition.getShiftedBy( Number.POSITIVE_INFINITY );
  22775. return new _range__WEBPACK_IMPORTED_MODULE_3__["default"]( this.sourcePosition, end );
  22776. }
  22777. /**
  22778. * Creates and returns an operation that has the same parameters as this operation.
  22779. *
  22780. * @returns {module:engine/model/operation/mergeoperation~MergeOperation} Clone of this operation.
  22781. */
  22782. clone() {
  22783. return new this.constructor( this.sourcePosition, this.howMany, this.targetPosition, this.graveyardPosition, this.baseVersion );
  22784. }
  22785. /**
  22786. * See {@link module:engine/model/operation/operation~Operation#getReversed `Operation#getReversed()`}.
  22787. *
  22788. * @returns {module:engine/model/operation/splitoperation~SplitOperation}
  22789. */
  22790. getReversed() {
  22791. // Positions in this method are transformed by this merge operation because the split operation bases on
  22792. // the context after this merge operation happened (because split operation reverses it).
  22793. // So we need to acknowledge that the merge operation happened and those positions changed a little.
  22794. const targetPosition = this.targetPosition._getTransformedByMergeOperation( this );
  22795. const path = this.sourcePosition.path.slice( 0, -1 );
  22796. const insertionPosition = new _position__WEBPACK_IMPORTED_MODULE_2__["default"]( this.sourcePosition.root, path )._getTransformedByMergeOperation( this );
  22797. return new _splitoperation__WEBPACK_IMPORTED_MODULE_1__["default"]( targetPosition, this.howMany, insertionPosition, this.graveyardPosition, this.baseVersion + 1 );
  22798. }
  22799. /**
  22800. * @inheritDoc
  22801. */
  22802. _validate() {
  22803. const sourceElement = this.sourcePosition.parent;
  22804. const targetElement = this.targetPosition.parent;
  22805. // Validate whether merge operation has correct parameters.
  22806. if ( !sourceElement.parent ) {
  22807. /**
  22808. * Merge source position is invalid. The element to be merged must have a parent node.
  22809. *
  22810. * @error merge-operation-source-position-invalid
  22811. */
  22812. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_5__["default"]( 'merge-operation-source-position-invalid', this );
  22813. } else if ( !targetElement.parent ) {
  22814. /**
  22815. * Merge target position is invalid. The element to be merged must have a parent node.
  22816. *
  22817. * @error merge-operation-target-position-invalid
  22818. */
  22819. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_5__["default"]( 'merge-operation-target-position-invalid', this );
  22820. } else if ( this.howMany != sourceElement.maxOffset ) {
  22821. /**
  22822. * Merge operation specifies wrong number of nodes to move.
  22823. *
  22824. * @error merge-operation-how-many-invalid
  22825. */
  22826. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_5__["default"]( 'merge-operation-how-many-invalid', this );
  22827. }
  22828. }
  22829. /**
  22830. * @inheritDoc
  22831. */
  22832. _execute() {
  22833. const mergedElement = this.sourcePosition.parent;
  22834. const sourceRange = _range__WEBPACK_IMPORTED_MODULE_3__["default"]._createIn( mergedElement );
  22835. Object(_utils__WEBPACK_IMPORTED_MODULE_4__["_move"])( sourceRange, this.targetPosition );
  22836. Object(_utils__WEBPACK_IMPORTED_MODULE_4__["_move"])( _range__WEBPACK_IMPORTED_MODULE_3__["default"]._createOn( mergedElement ), this.graveyardPosition );
  22837. }
  22838. /**
  22839. * @inheritDoc
  22840. */
  22841. toJSON() {
  22842. const json = super.toJSON();
  22843. json.sourcePosition = json.sourcePosition.toJSON();
  22844. json.targetPosition = json.targetPosition.toJSON();
  22845. json.graveyardPosition = json.graveyardPosition.toJSON();
  22846. return json;
  22847. }
  22848. /**
  22849. * @inheritDoc
  22850. */
  22851. static get className() {
  22852. return 'MergeOperation';
  22853. }
  22854. /**
  22855. * Creates `MergeOperation` object from deserilized object, i.e. from parsed JSON string.
  22856. *
  22857. * @param {Object} json Deserialized JSON object.
  22858. * @param {module:engine/model/document~Document} document Document on which this operation will be applied.
  22859. * @returns {module:engine/model/operation/mergeoperation~MergeOperation}
  22860. */
  22861. static fromJSON( json, document ) {
  22862. const sourcePosition = _position__WEBPACK_IMPORTED_MODULE_2__["default"].fromJSON( json.sourcePosition, document );
  22863. const targetPosition = _position__WEBPACK_IMPORTED_MODULE_2__["default"].fromJSON( json.targetPosition, document );
  22864. const graveyardPosition = _position__WEBPACK_IMPORTED_MODULE_2__["default"].fromJSON( json.graveyardPosition, document );
  22865. return new this( sourcePosition, json.howMany, targetPosition, graveyardPosition, json.baseVersion );
  22866. }
  22867. // @if CK_DEBUG_ENGINE // toString() {
  22868. // @if CK_DEBUG_ENGINE // return `MergeOperation( ${ this.baseVersion } ): ` +
  22869. // @if CK_DEBUG_ENGINE // `${ this.sourcePosition } -> ${ this.targetPosition }` +
  22870. // @if CK_DEBUG_ENGINE // ` ( ${ this.howMany } ), ${ this.graveyardPosition }`;
  22871. // @if CK_DEBUG_ENGINE // }
  22872. }
  22873. /***/ }),
  22874. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/moveoperation.js":
  22875. /*!**************************************************************************************!*\
  22876. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/moveoperation.js ***!
  22877. \**************************************************************************************/
  22878. /*! exports provided: default */
  22879. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  22880. "use strict";
  22881. __webpack_require__.r(__webpack_exports__);
  22882. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return MoveOperation; });
  22883. /* harmony import */ var _operation__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./operation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/operation.js");
  22884. /* harmony import */ var _position__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../position */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/position.js");
  22885. /* harmony import */ var _range__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../range */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/range.js");
  22886. /* 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");
  22887. /* 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");
  22888. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./utils */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/utils.js");
  22889. /**
  22890. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  22891. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  22892. */
  22893. /**
  22894. * @module engine/model/operation/moveoperation
  22895. */
  22896. // @if CK_DEBUG_ENGINE // const ModelRange = require( '../range' ).default;
  22897. /**
  22898. * Operation to move a range of {@link module:engine/model/item~Item model items}
  22899. * to given {@link module:engine/model/position~Position target position}.
  22900. *
  22901. * @extends module:engine/model/operation/operation~Operation
  22902. */
  22903. class MoveOperation extends _operation__WEBPACK_IMPORTED_MODULE_0__["default"] {
  22904. /**
  22905. * Creates a move operation.
  22906. *
  22907. * @param {module:engine/model/position~Position} sourcePosition
  22908. * Position before the first {@link module:engine/model/item~Item model item} to move.
  22909. * @param {Number} howMany Offset size of moved range. Moved range will start from `sourcePosition` and end at
  22910. * `sourcePosition` with offset shifted by `howMany`.
  22911. * @param {module:engine/model/position~Position} targetPosition Position at which moved nodes will be inserted.
  22912. * @param {Number|null} baseVersion Document {@link module:engine/model/document~Document#version} on which operation
  22913. * can be applied or `null` if the operation operates on detached (non-document) tree.
  22914. */
  22915. constructor( sourcePosition, howMany, targetPosition, baseVersion ) {
  22916. super( baseVersion );
  22917. /**
  22918. * Position before the first {@link module:engine/model/item~Item model item} to move.
  22919. *
  22920. * @member {module:engine/model/position~Position} module:engine/model/operation/moveoperation~MoveOperation#sourcePosition
  22921. */
  22922. this.sourcePosition = sourcePosition.clone();
  22923. // `'toNext'` because `sourcePosition` is a bit like a start of the moved range.
  22924. this.sourcePosition.stickiness = 'toNext';
  22925. /**
  22926. * Offset size of moved range.
  22927. *
  22928. * @member {Number} module:engine/model/operation/moveoperation~MoveOperation#howMany
  22929. */
  22930. this.howMany = howMany;
  22931. /**
  22932. * Position at which moved nodes will be inserted.
  22933. *
  22934. * @member {module:engine/model/position~Position} module:engine/model/operation/moveoperation~MoveOperation#targetPosition
  22935. */
  22936. this.targetPosition = targetPosition.clone();
  22937. this.targetPosition.stickiness = 'toNone';
  22938. }
  22939. /**
  22940. * @inheritDoc
  22941. */
  22942. get type() {
  22943. if ( this.targetPosition.root.rootName == '$graveyard' ) {
  22944. return 'remove';
  22945. } else if ( this.sourcePosition.root.rootName == '$graveyard' ) {
  22946. return 'reinsert';
  22947. }
  22948. return 'move';
  22949. }
  22950. /**
  22951. * Creates and returns an operation that has the same parameters as this operation.
  22952. *
  22953. * @returns {module:engine/model/operation/moveoperation~MoveOperation} Clone of this operation.
  22954. */
  22955. clone() {
  22956. return new this.constructor( this.sourcePosition, this.howMany, this.targetPosition, this.baseVersion );
  22957. }
  22958. /**
  22959. * Returns the start position of the moved range after it got moved. This may be different than
  22960. * {@link module:engine/model/operation/moveoperation~MoveOperation#targetPosition} in some cases, i.e. when a range is moved
  22961. * inside the same parent but {@link module:engine/model/operation/moveoperation~MoveOperation#targetPosition targetPosition}
  22962. * is after {@link module:engine/model/operation/moveoperation~MoveOperation#sourcePosition sourcePosition}.
  22963. *
  22964. * vv vv
  22965. * abcdefg ===> adefbcg
  22966. * ^ ^
  22967. * targetPos movedRangeStart
  22968. * offset 6 offset 4
  22969. *
  22970. * @returns {module:engine/model/position~Position}
  22971. */
  22972. getMovedRangeStart() {
  22973. return this.targetPosition._getTransformedByDeletion( this.sourcePosition, this.howMany );
  22974. }
  22975. /**
  22976. * See {@link module:engine/model/operation/operation~Operation#getReversed `Operation#getReversed()`}.
  22977. *
  22978. * @returns {module:engine/model/operation/moveoperation~MoveOperation}
  22979. */
  22980. getReversed() {
  22981. const newTargetPosition = this.sourcePosition._getTransformedByInsertion( this.targetPosition, this.howMany );
  22982. return new this.constructor( this.getMovedRangeStart(), this.howMany, newTargetPosition, this.baseVersion + 1 );
  22983. }
  22984. /**
  22985. * @inheritDoc
  22986. */
  22987. _validate() {
  22988. const sourceElement = this.sourcePosition.parent;
  22989. const targetElement = this.targetPosition.parent;
  22990. const sourceOffset = this.sourcePosition.offset;
  22991. const targetOffset = this.targetPosition.offset;
  22992. // Validate whether move operation has correct parameters.
  22993. // Validation is pretty complex but move operation is one of the core ways to manipulate the document state.
  22994. // We expect that many errors might be connected with one of scenarios described below.
  22995. if ( sourceOffset + this.howMany > sourceElement.maxOffset ) {
  22996. /**
  22997. * The nodes which should be moved do not exist.
  22998. *
  22999. * @error move-operation-nodes-do-not-exist
  23000. */
  23001. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_3__["default"](
  23002. 'move-operation-nodes-do-not-exist', this
  23003. );
  23004. } else if ( sourceElement === targetElement && sourceOffset < targetOffset && targetOffset < sourceOffset + this.howMany ) {
  23005. /**
  23006. * Trying to move a range of nodes into the middle of that range.
  23007. *
  23008. * @error move-operation-range-into-itself
  23009. */
  23010. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_3__["default"](
  23011. 'move-operation-range-into-itself', this
  23012. );
  23013. } else if ( this.sourcePosition.root == this.targetPosition.root ) {
  23014. if ( Object(_ckeditor_ckeditor5_utils_src_comparearrays__WEBPACK_IMPORTED_MODULE_4__["default"])( this.sourcePosition.getParentPath(), this.targetPosition.getParentPath() ) == 'prefix' ) {
  23015. const i = this.sourcePosition.path.length - 1;
  23016. if ( this.targetPosition.path[ i ] >= sourceOffset && this.targetPosition.path[ i ] < sourceOffset + this.howMany ) {
  23017. /**
  23018. * Trying to move a range of nodes into one of nodes from that range.
  23019. *
  23020. * @error move-operation-node-into-itself
  23021. */
  23022. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_3__["default"](
  23023. 'move-operation-node-into-itself', this
  23024. );
  23025. }
  23026. }
  23027. }
  23028. }
  23029. /**
  23030. * @inheritDoc
  23031. */
  23032. _execute() {
  23033. Object(_utils__WEBPACK_IMPORTED_MODULE_5__["_move"])( _range__WEBPACK_IMPORTED_MODULE_2__["default"]._createFromPositionAndShift( this.sourcePosition, this.howMany ), this.targetPosition );
  23034. }
  23035. /**
  23036. * @inheritDoc
  23037. */
  23038. toJSON() {
  23039. const json = super.toJSON();
  23040. json.sourcePosition = this.sourcePosition.toJSON();
  23041. json.targetPosition = this.targetPosition.toJSON();
  23042. return json;
  23043. }
  23044. /**
  23045. * @inheritDoc
  23046. */
  23047. static get className() {
  23048. return 'MoveOperation';
  23049. }
  23050. /**
  23051. * Creates `MoveOperation` object from deserilized object, i.e. from parsed JSON string.
  23052. *
  23053. * @param {Object} json Deserialized JSON object.
  23054. * @param {module:engine/model/document~Document} document Document on which this operation will be applied.
  23055. * @returns {module:engine/model/operation/moveoperation~MoveOperation}
  23056. */
  23057. static fromJSON( json, document ) {
  23058. const sourcePosition = _position__WEBPACK_IMPORTED_MODULE_1__["default"].fromJSON( json.sourcePosition, document );
  23059. const targetPosition = _position__WEBPACK_IMPORTED_MODULE_1__["default"].fromJSON( json.targetPosition, document );
  23060. return new this( sourcePosition, json.howMany, targetPosition, json.baseVersion );
  23061. }
  23062. // @if CK_DEBUG_ENGINE // toString() {
  23063. // @if CK_DEBUG_ENGINE // const range = ModelRange._createFromPositionAndShift( this.sourcePosition, this.howMany );
  23064. // @if CK_DEBUG_ENGINE // return `MoveOperation( ${ this.baseVersion } ): ${ range } -> ${ this.targetPosition }`;
  23065. // @if CK_DEBUG_ENGINE // }
  23066. }
  23067. /***/ }),
  23068. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/nooperation.js":
  23069. /*!************************************************************************************!*\
  23070. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/nooperation.js ***!
  23071. \************************************************************************************/
  23072. /*! exports provided: default */
  23073. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  23074. "use strict";
  23075. __webpack_require__.r(__webpack_exports__);
  23076. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return NoOperation; });
  23077. /* harmony import */ var _operation__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./operation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/operation.js");
  23078. /**
  23079. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  23080. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  23081. */
  23082. /**
  23083. * @module engine/model/operation/nooperation
  23084. */
  23085. /**
  23086. * Operation which is doing nothing ("empty operation", "do-nothing operation", "noop"). This is an operation,
  23087. * which when executed does not change the tree model. It still has some parameters defined for transformation purposes.
  23088. *
  23089. * In most cases this operation is a result of transforming operations. When transformation returns
  23090. * {@link module:engine/model/operation/nooperation~NoOperation} it means that changes done by the transformed operation
  23091. * have already been applied.
  23092. *
  23093. * @extends module:engine/model/operation/operation~Operation
  23094. */
  23095. class NoOperation extends _operation__WEBPACK_IMPORTED_MODULE_0__["default"] {
  23096. get type() {
  23097. return 'noop';
  23098. }
  23099. /**
  23100. * Creates and returns an operation that has the same parameters as this operation.
  23101. *
  23102. * @returns {module:engine/model/operation/nooperation~NoOperation} Clone of this operation.
  23103. */
  23104. clone() {
  23105. return new NoOperation( this.baseVersion );
  23106. }
  23107. /**
  23108. * See {@link module:engine/model/operation/operation~Operation#getReversed `Operation#getReversed()`}.
  23109. *
  23110. * @returns {module:engine/model/operation/nooperation~NoOperation}
  23111. */
  23112. getReversed() {
  23113. return new NoOperation( this.baseVersion + 1 );
  23114. }
  23115. _execute() {
  23116. }
  23117. /**
  23118. * @inheritDoc
  23119. */
  23120. static get className() {
  23121. return 'NoOperation';
  23122. }
  23123. // @if CK_DEBUG_ENGINE // toString() {
  23124. // @if CK_DEBUG_ENGINE // return `NoOperation( ${ this.baseVersion } )`;
  23125. // @if CK_DEBUG_ENGINE // }
  23126. }
  23127. /***/ }),
  23128. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/operation.js":
  23129. /*!**********************************************************************************!*\
  23130. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/operation.js ***!
  23131. \**********************************************************************************/
  23132. /*! exports provided: default */
  23133. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  23134. "use strict";
  23135. __webpack_require__.r(__webpack_exports__);
  23136. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Operation; });
  23137. /**
  23138. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  23139. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  23140. */
  23141. /**
  23142. * @module engine/model/operation/operation
  23143. */
  23144. /**
  23145. * Abstract base operation class.
  23146. *
  23147. * @abstract
  23148. */
  23149. class Operation {
  23150. /**
  23151. * Base operation constructor.
  23152. *
  23153. * @param {Number|null} baseVersion Document {@link module:engine/model/document~Document#version} on which operation
  23154. * can be applied or `null` if the operation operates on detached (non-document) tree.
  23155. */
  23156. constructor( baseVersion ) {
  23157. /**
  23158. * {@link module:engine/model/document~Document#version} on which operation can be applied. If you try to
  23159. * {@link module:engine/model/model~Model#applyOperation apply} operation with different base version than the
  23160. * {@link module:engine/model/document~Document#version document version} the
  23161. * {@link module:utils/ckeditorerror~CKEditorError model-document-applyOperation-wrong-version} error is thrown.
  23162. *
  23163. * @member {Number}
  23164. */
  23165. this.baseVersion = baseVersion;
  23166. /**
  23167. * Defines whether operation is executed on attached or detached {@link module:engine/model/item~Item items}.
  23168. *
  23169. * @readonly
  23170. * @member {Boolean} #isDocumentOperation
  23171. */
  23172. this.isDocumentOperation = this.baseVersion !== null;
  23173. /**
  23174. * {@link module:engine/model/batch~Batch Batch} to which the operation is added or `null` if the operation is not
  23175. * added to any batch yet.
  23176. *
  23177. * @member {module:engine/model/batch~Batch|null} #batch
  23178. */
  23179. this.batch = null;
  23180. /**
  23181. * Operation type.
  23182. *
  23183. * @readonly
  23184. * @member {String} #type
  23185. */
  23186. /**
  23187. * Creates and returns an operation that has the same parameters as this operation.
  23188. *
  23189. * @method #clone
  23190. * @returns {module:engine/model/operation/operation~Operation} Clone of this operation.
  23191. */
  23192. /**
  23193. * Creates and returns a reverse operation. Reverse operation when executed right after
  23194. * the original operation will bring back tree model state to the point before the original
  23195. * operation execution. In other words, it reverses changes done by the original operation.
  23196. *
  23197. * Keep in mind that tree model state may change since executing the original operation,
  23198. * so reverse operation will be "outdated". In that case you will need to transform it by
  23199. * all operations that were executed after the original operation.
  23200. *
  23201. * @method #getReversed
  23202. * @returns {module:engine/model/operation/operation~Operation} Reversed operation.
  23203. */
  23204. /**
  23205. * Executes the operation - modifications described by the operation properties will be applied to the model tree.
  23206. *
  23207. * @protected
  23208. * @method #_execute
  23209. */
  23210. }
  23211. /**
  23212. * Checks whether the operation's parameters are correct and the operation can be correctly executed. Throws
  23213. * an error if operation is not valid.
  23214. *
  23215. * @protected
  23216. * @method #_validate
  23217. */
  23218. _validate() {
  23219. }
  23220. /**
  23221. * Custom toJSON method to solve child-parent circular dependencies.
  23222. *
  23223. * @method #toJSON
  23224. * @returns {Object} Clone of this object with the operation property replaced with string.
  23225. */
  23226. toJSON() {
  23227. // This method creates only a shallow copy, all nested objects should be defined separately.
  23228. // See https://github.com/ckeditor/ckeditor5-engine/issues/1477.
  23229. const json = Object.assign( {}, this );
  23230. json.__className = this.constructor.className;
  23231. // Remove reference to the parent `Batch` to avoid circular dependencies.
  23232. delete json.batch;
  23233. // Only document operations are shared with other clients so it is not necessary to keep this information.
  23234. delete json.isDocumentOperation;
  23235. return json;
  23236. }
  23237. /**
  23238. * Name of the operation class used for serialization.
  23239. *
  23240. * @type {String}
  23241. */
  23242. static get className() {
  23243. return 'Operation';
  23244. }
  23245. /**
  23246. * Creates Operation object from deserilized object, i.e. from parsed JSON string.
  23247. *
  23248. * @param {Object} json Deserialized JSON object.
  23249. * @param {module:engine/model/document~Document} doc Document on which this operation will be applied.
  23250. * @returns {module:engine/model/operation/operation~Operation}
  23251. */
  23252. static fromJSON( json ) {
  23253. return new this( json.baseVersion );
  23254. }
  23255. // @if CK_DEBUG_ENGINE // log() {
  23256. // @if CK_DEBUG_ENGINE // console.log( this.toString() );
  23257. // @if CK_DEBUG_ENGINE // }
  23258. }
  23259. /***/ }),
  23260. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/operationfactory.js":
  23261. /*!*****************************************************************************************!*\
  23262. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/operationfactory.js ***!
  23263. \*****************************************************************************************/
  23264. /*! exports provided: default */
  23265. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  23266. "use strict";
  23267. __webpack_require__.r(__webpack_exports__);
  23268. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return OperationFactory; });
  23269. /* harmony import */ var _operation_attributeoperation__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../operation/attributeoperation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/attributeoperation.js");
  23270. /* harmony import */ var _operation_insertoperation__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../operation/insertoperation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/insertoperation.js");
  23271. /* harmony import */ var _operation_markeroperation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../operation/markeroperation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/markeroperation.js");
  23272. /* harmony import */ var _operation_moveoperation__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../operation/moveoperation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/moveoperation.js");
  23273. /* harmony import */ var _operation_nooperation__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../operation/nooperation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/nooperation.js");
  23274. /* harmony import */ var _operation_operation__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../operation/operation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/operation.js");
  23275. /* harmony import */ var _operation_renameoperation__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../operation/renameoperation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/renameoperation.js");
  23276. /* harmony import */ var _operation_rootattributeoperation__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../operation/rootattributeoperation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/rootattributeoperation.js");
  23277. /* harmony import */ var _operation_splitoperation__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../operation/splitoperation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/splitoperation.js");
  23278. /* harmony import */ var _operation_mergeoperation__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../operation/mergeoperation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/mergeoperation.js");
  23279. /**
  23280. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  23281. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  23282. */
  23283. /**
  23284. * @module engine/model/operation/operationfactory
  23285. */
  23286. const operations = {};
  23287. operations[ _operation_attributeoperation__WEBPACK_IMPORTED_MODULE_0__["default"].className ] = _operation_attributeoperation__WEBPACK_IMPORTED_MODULE_0__["default"];
  23288. operations[ _operation_insertoperation__WEBPACK_IMPORTED_MODULE_1__["default"].className ] = _operation_insertoperation__WEBPACK_IMPORTED_MODULE_1__["default"];
  23289. operations[ _operation_markeroperation__WEBPACK_IMPORTED_MODULE_2__["default"].className ] = _operation_markeroperation__WEBPACK_IMPORTED_MODULE_2__["default"];
  23290. operations[ _operation_moveoperation__WEBPACK_IMPORTED_MODULE_3__["default"].className ] = _operation_moveoperation__WEBPACK_IMPORTED_MODULE_3__["default"];
  23291. operations[ _operation_nooperation__WEBPACK_IMPORTED_MODULE_4__["default"].className ] = _operation_nooperation__WEBPACK_IMPORTED_MODULE_4__["default"];
  23292. operations[ _operation_operation__WEBPACK_IMPORTED_MODULE_5__["default"].className ] = _operation_operation__WEBPACK_IMPORTED_MODULE_5__["default"];
  23293. operations[ _operation_renameoperation__WEBPACK_IMPORTED_MODULE_6__["default"].className ] = _operation_renameoperation__WEBPACK_IMPORTED_MODULE_6__["default"];
  23294. operations[ _operation_rootattributeoperation__WEBPACK_IMPORTED_MODULE_7__["default"].className ] = _operation_rootattributeoperation__WEBPACK_IMPORTED_MODULE_7__["default"];
  23295. operations[ _operation_splitoperation__WEBPACK_IMPORTED_MODULE_8__["default"].className ] = _operation_splitoperation__WEBPACK_IMPORTED_MODULE_8__["default"];
  23296. operations[ _operation_mergeoperation__WEBPACK_IMPORTED_MODULE_9__["default"].className ] = _operation_mergeoperation__WEBPACK_IMPORTED_MODULE_9__["default"];
  23297. /**
  23298. * A factory class for creating operations.
  23299. *
  23300. * @abstract
  23301. */
  23302. class OperationFactory {
  23303. /**
  23304. * Creates an operation instance from a JSON object (parsed JSON string).
  23305. *
  23306. * @param {Object} json Deserialized JSON object.
  23307. * @param {module:engine/model/document~Document} document Document on which this operation will be applied.
  23308. * @returns {module:engine/model/operation/operation~Operation}
  23309. */
  23310. static fromJSON( json, document ) {
  23311. return operations[ json.__className ].fromJSON( json, document );
  23312. }
  23313. }
  23314. /***/ }),
  23315. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/renameoperation.js":
  23316. /*!****************************************************************************************!*\
  23317. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/renameoperation.js ***!
  23318. \****************************************************************************************/
  23319. /*! exports provided: default */
  23320. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  23321. "use strict";
  23322. __webpack_require__.r(__webpack_exports__);
  23323. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return RenameOperation; });
  23324. /* harmony import */ var _operation__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./operation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/operation.js");
  23325. /* harmony import */ var _element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../element */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/element.js");
  23326. /* 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");
  23327. /* harmony import */ var _position__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../position */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/position.js");
  23328. /**
  23329. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  23330. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  23331. */
  23332. /**
  23333. * @module engine/model/operation/renameoperation
  23334. */
  23335. /**
  23336. * Operation to change element's name.
  23337. *
  23338. * Using this class you can change element's name.
  23339. *
  23340. * @extends module:engine/model/operation/operation~Operation
  23341. */
  23342. class RenameOperation extends _operation__WEBPACK_IMPORTED_MODULE_0__["default"] {
  23343. /**
  23344. * Creates an operation that changes element's name.
  23345. *
  23346. * @param {module:engine/model/position~Position} position Position before an element to change.
  23347. * @param {String} oldName Current name of the element.
  23348. * @param {String} newName New name for the element.
  23349. * @param {Number|null} baseVersion Document {@link module:engine/model/document~Document#version} on which operation
  23350. * can be applied or `null` if the operation operates on detached (non-document) tree.
  23351. */
  23352. constructor( position, oldName, newName, baseVersion ) {
  23353. super( baseVersion );
  23354. /**
  23355. * Position before an element to change.
  23356. *
  23357. * @member {module:engine/model/position~Position} module:engine/model/operation/renameoperation~RenameOperation#position
  23358. */
  23359. this.position = position;
  23360. // This position sticks to the next node because it is a position before the node that we want to change.
  23361. this.position.stickiness = 'toNext';
  23362. /**
  23363. * Current name of the element.
  23364. *
  23365. * @member {String} module:engine/model/operation/renameoperation~RenameOperation#oldName
  23366. */
  23367. this.oldName = oldName;
  23368. /**
  23369. * New name for the element.
  23370. *
  23371. * @member {String} module:engine/model/operation/renameoperation~RenameOperation#newName
  23372. */
  23373. this.newName = newName;
  23374. }
  23375. /**
  23376. * @inheritDoc
  23377. */
  23378. get type() {
  23379. return 'rename';
  23380. }
  23381. /**
  23382. * Creates and returns an operation that has the same parameters as this operation.
  23383. *
  23384. * @returns {module:engine/model/operation/renameoperation~RenameOperation} Clone of this operation.
  23385. */
  23386. clone() {
  23387. return new RenameOperation( this.position.clone(), this.oldName, this.newName, this.baseVersion );
  23388. }
  23389. /**
  23390. * See {@link module:engine/model/operation/operation~Operation#getReversed `Operation#getReversed()`}.
  23391. *
  23392. * @returns {module:engine/model/operation/renameoperation~RenameOperation}
  23393. */
  23394. getReversed() {
  23395. return new RenameOperation( this.position.clone(), this.newName, this.oldName, this.baseVersion + 1 );
  23396. }
  23397. /**
  23398. * @inheritDoc
  23399. */
  23400. _validate() {
  23401. const element = this.position.nodeAfter;
  23402. if ( !( element instanceof _element__WEBPACK_IMPORTED_MODULE_1__["default"] ) ) {
  23403. /**
  23404. * Given position is invalid or node after it is not instance of Element.
  23405. *
  23406. * @error rename-operation-wrong-position
  23407. */
  23408. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__["default"](
  23409. 'rename-operation-wrong-position',
  23410. this
  23411. );
  23412. } else if ( element.name !== this.oldName ) {
  23413. /**
  23414. * Element to change has different name than operation's old name.
  23415. *
  23416. * @error rename-operation-wrong-name
  23417. */
  23418. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__["default"](
  23419. 'rename-operation-wrong-name',
  23420. this
  23421. );
  23422. }
  23423. }
  23424. /**
  23425. * @inheritDoc
  23426. */
  23427. _execute() {
  23428. const element = this.position.nodeAfter;
  23429. element.name = this.newName;
  23430. }
  23431. /**
  23432. * @inheritDoc
  23433. */
  23434. toJSON() {
  23435. const json = super.toJSON();
  23436. json.position = this.position.toJSON();
  23437. return json;
  23438. }
  23439. /**
  23440. * @inheritDoc
  23441. */
  23442. static get className() {
  23443. return 'RenameOperation';
  23444. }
  23445. /**
  23446. * Creates `RenameOperation` object from deserialized object, i.e. from parsed JSON string.
  23447. *
  23448. * @param {Object} json Deserialized JSON object.
  23449. * @param {module:engine/model/document~Document} document Document on which this operation will be applied.
  23450. * @returns {module:engine/model/operation/attributeoperation~AttributeOperation}
  23451. */
  23452. static fromJSON( json, document ) {
  23453. return new RenameOperation( _position__WEBPACK_IMPORTED_MODULE_3__["default"].fromJSON( json.position, document ), json.oldName, json.newName, json.baseVersion );
  23454. }
  23455. // @if CK_DEBUG_ENGINE // toString() {
  23456. // @if CK_DEBUG_ENGINE // return `RenameOperation( ${ this.baseVersion } ): ` +
  23457. // @if CK_DEBUG_ENGINE // `${ this.position }: "${ this.oldName }" -> "${ this.newName }"`;
  23458. // @if CK_DEBUG_ENGINE // }
  23459. }
  23460. /***/ }),
  23461. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/rootattributeoperation.js":
  23462. /*!***********************************************************************************************!*\
  23463. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/rootattributeoperation.js ***!
  23464. \***********************************************************************************************/
  23465. /*! exports provided: default */
  23466. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  23467. "use strict";
  23468. __webpack_require__.r(__webpack_exports__);
  23469. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return RootAttributeOperation; });
  23470. /* harmony import */ var _operation__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./operation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/operation.js");
  23471. /* 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");
  23472. /**
  23473. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  23474. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  23475. */
  23476. /**
  23477. * @module engine/model/operation/rootattributeoperation
  23478. */
  23479. /**
  23480. * Operation to change root element's attribute. Using this class you can add, remove or change value of the attribute.
  23481. *
  23482. * This operation is needed, because root elements can't be changed through
  23483. * @link module:engine/model/operation/attributeoperation~AttributeOperation}.
  23484. * It is because {@link module:engine/model/operation/attributeoperation~AttributeOperation}
  23485. * requires a range to change and root element can't
  23486. * be a part of range because every {@link module:engine/model/position~Position} has to be inside a root.
  23487. * {@link module:engine/model/position~Position} can't be created before a root element.
  23488. *
  23489. * @extends module:engine/model/operation/operation~Operation
  23490. */
  23491. class RootAttributeOperation extends _operation__WEBPACK_IMPORTED_MODULE_0__["default"] {
  23492. /**
  23493. * Creates an operation that changes, removes or adds attributes on root element.
  23494. *
  23495. * @see module:engine/model/operation/attributeoperation~AttributeOperation
  23496. * @param {module:engine/model/rootelement~RootElement} root Root element to change.
  23497. * @param {String} key Key of an attribute to change or remove.
  23498. * @param {*} oldValue Old value of the attribute with given key or `null` if adding a new attribute.
  23499. * @param {*} newValue New value to set for the attribute. If `null`, then the operation just removes the attribute.
  23500. * @param {Number|null} baseVersion Document {@link module:engine/model/document~Document#version} on which operation
  23501. * can be applied or `null` if the operation operates on detached (non-document) tree.
  23502. */
  23503. constructor( root, key, oldValue, newValue, baseVersion ) {
  23504. super( baseVersion );
  23505. /**
  23506. * Root element to change.
  23507. *
  23508. * @readonly
  23509. * @member {module:engine/model/rootelement~RootElement}
  23510. */
  23511. this.root = root;
  23512. /**
  23513. * Key of an attribute to change or remove.
  23514. *
  23515. * @readonly
  23516. * @member {String}
  23517. */
  23518. this.key = key;
  23519. /**
  23520. * Old value of the attribute with given key or `null` if adding a new attribute.
  23521. *
  23522. * @readonly
  23523. * @member {*}
  23524. */
  23525. this.oldValue = oldValue;
  23526. /**
  23527. * New value to set for the attribute. If `null`, then the operation just removes the attribute.
  23528. *
  23529. * @readonly
  23530. * @member {*}
  23531. */
  23532. this.newValue = newValue;
  23533. }
  23534. /**
  23535. * @inheritDoc
  23536. */
  23537. get type() {
  23538. if ( this.oldValue === null ) {
  23539. return 'addRootAttribute';
  23540. } else if ( this.newValue === null ) {
  23541. return 'removeRootAttribute';
  23542. } else {
  23543. return 'changeRootAttribute';
  23544. }
  23545. }
  23546. /**
  23547. * Creates and returns an operation that has the same parameters as this operation.
  23548. *
  23549. * @returns {module:engine/model/operation/rootattributeoperation~RootAttributeOperation} Clone of this operation.
  23550. */
  23551. clone() {
  23552. return new RootAttributeOperation( this.root, this.key, this.oldValue, this.newValue, this.baseVersion );
  23553. }
  23554. /**
  23555. * See {@link module:engine/model/operation/operation~Operation#getReversed `Operation#getReversed()`}.
  23556. *
  23557. * @returns {module:engine/model/operation/rootattributeoperation~RootAttributeOperation}
  23558. */
  23559. getReversed() {
  23560. return new RootAttributeOperation( this.root, this.key, this.newValue, this.oldValue, this.baseVersion + 1 );
  23561. }
  23562. /**
  23563. * @inheritDoc
  23564. */
  23565. _validate() {
  23566. if ( this.root != this.root.root || this.root.is( 'documentFragment' ) ) {
  23567. /**
  23568. * The element to change is not a root element.
  23569. *
  23570. * @error rootattribute-operation-not-a-root
  23571. * @param {module:engine/model/rootelement~RootElement} root
  23572. * @param {String} key
  23573. * @param {*} value
  23574. */
  23575. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_1__["default"](
  23576. 'rootattribute-operation-not-a-root',
  23577. this,
  23578. { root: this.root, key: this.key }
  23579. );
  23580. }
  23581. if ( this.oldValue !== null && this.root.getAttribute( this.key ) !== this.oldValue ) {
  23582. /**
  23583. * The attribute which should be removed does not exists for the given node.
  23584. *
  23585. * @error rootattribute-operation-wrong-old-value
  23586. * @param {module:engine/model/rootelement~RootElement} root
  23587. * @param {String} key
  23588. * @param {*} value
  23589. */
  23590. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_1__["default"](
  23591. 'rootattribute-operation-wrong-old-value',
  23592. this,
  23593. { root: this.root, key: this.key }
  23594. );
  23595. }
  23596. if ( this.oldValue === null && this.newValue !== null && this.root.hasAttribute( this.key ) ) {
  23597. /**
  23598. * The attribute with given key already exists for the given node.
  23599. *
  23600. * @error rootattribute-operation-attribute-exists
  23601. * @param {module:engine/model/rootelement~RootElement} root
  23602. * @param {String} key
  23603. */
  23604. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_1__["default"](
  23605. 'rootattribute-operation-attribute-exists',
  23606. this,
  23607. { root: this.root, key: this.key }
  23608. );
  23609. }
  23610. }
  23611. /**
  23612. * @inheritDoc
  23613. */
  23614. _execute() {
  23615. if ( this.newValue !== null ) {
  23616. this.root._setAttribute( this.key, this.newValue );
  23617. } else {
  23618. this.root._removeAttribute( this.key );
  23619. }
  23620. }
  23621. /**
  23622. * @inheritDoc
  23623. */
  23624. toJSON() {
  23625. const json = super.toJSON();
  23626. json.root = this.root.toJSON();
  23627. return json;
  23628. }
  23629. /**
  23630. * @inheritDoc
  23631. */
  23632. static get className() {
  23633. return 'RootAttributeOperation';
  23634. }
  23635. /**
  23636. * Creates RootAttributeOperation object from deserilized object, i.e. from parsed JSON string.
  23637. *
  23638. * @param {Object} json Deserialized JSON object.
  23639. * @param {module:engine/model/document~Document} document Document on which this operation will be applied.
  23640. * @returns {module:engine/model/operation/rootattributeoperation~RootAttributeOperation}
  23641. */
  23642. static fromJSON( json, document ) {
  23643. if ( !document.getRoot( json.root ) ) {
  23644. /**
  23645. * Cannot create RootAttributeOperation for document. Root with specified name does not exist.
  23646. *
  23647. * @error rootattribute-operation-fromjson-no-root
  23648. * @param {String} rootName
  23649. */
  23650. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_1__["default"]( 'rootattribute-operation-fromjson-no-root', this, { rootName: json.root } );
  23651. }
  23652. return new RootAttributeOperation( document.getRoot( json.root ), json.key, json.oldValue, json.newValue, json.baseVersion );
  23653. }
  23654. // @if CK_DEBUG_ENGINE // toString() {
  23655. // @if CK_DEBUG_ENGINE // return `RootAttributeOperation( ${ this.baseVersion } ): ` +
  23656. // @if CK_DEBUG_ENGINE // `"${ this.key }": ${ JSON.stringify( this.oldValue ) }` +
  23657. // @if CK_DEBUG_ENGINE // ` -> ${ JSON.stringify( this.newValue ) }, ${ this.root.rootName }`;
  23658. // @if CK_DEBUG_ENGINE // }
  23659. }
  23660. /***/ }),
  23661. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/splitoperation.js":
  23662. /*!***************************************************************************************!*\
  23663. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/splitoperation.js ***!
  23664. \***************************************************************************************/
  23665. /*! exports provided: default */
  23666. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  23667. "use strict";
  23668. __webpack_require__.r(__webpack_exports__);
  23669. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return SplitOperation; });
  23670. /* harmony import */ var _operation__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./operation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/operation.js");
  23671. /* harmony import */ var _mergeoperation__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./mergeoperation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/mergeoperation.js");
  23672. /* harmony import */ var _position__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../position */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/position.js");
  23673. /* harmony import */ var _range__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../range */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/range.js");
  23674. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./utils */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/utils.js");
  23675. /* 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");
  23676. /**
  23677. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  23678. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  23679. */
  23680. /**
  23681. * @module engine/model/operation/splitoperation
  23682. */
  23683. /**
  23684. * Operation to split {@link module:engine/model/element~Element an element} at given
  23685. * {@link module:engine/model/operation/splitoperation~SplitOperation#splitPosition split position} into two elements,
  23686. * both containing a part of the element's original content.
  23687. *
  23688. * @extends module:engine/model/operation/operation~Operation
  23689. */
  23690. class SplitOperation extends _operation__WEBPACK_IMPORTED_MODULE_0__["default"] {
  23691. /**
  23692. * Creates a split operation.
  23693. *
  23694. * @param {module:engine/model/position~Position} splitPosition Position at which an element should be split.
  23695. * @param {Number} howMany Total offset size of elements that are in the split element after `position`.
  23696. * @param {module:engine/model/position~Position} insertionPosition Position at which the clone of split element
  23697. * (or element from graveyard) will be inserted.
  23698. * @param {module:engine/model/position~Position|null} graveyardPosition Position in the graveyard root before the element which
  23699. * 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.
  23700. * @param {Number|null} baseVersion Document {@link module:engine/model/document~Document#version} on which operation
  23701. * can be applied or `null` if the operation operates on detached (non-document) tree.
  23702. */
  23703. constructor( splitPosition, howMany, insertionPosition, graveyardPosition, baseVersion ) {
  23704. super( baseVersion );
  23705. /**
  23706. * Position at which an element should be split.
  23707. *
  23708. * @member {module:engine/model/position~Position} module:engine/model/operation/splitoperation~SplitOperation#splitPosition
  23709. */
  23710. this.splitPosition = splitPosition.clone();
  23711. // Keep position sticking to the next node. This way any new content added at the place where the element is split
  23712. // will be left in the original element.
  23713. this.splitPosition.stickiness = 'toNext';
  23714. /**
  23715. * Total offset size of elements that are in the split element after `position`.
  23716. *
  23717. * @member {Number} module:engine/model/operation/splitoperation~SplitOperation#howMany
  23718. */
  23719. this.howMany = howMany;
  23720. /**
  23721. * Position at which the clone of split element (or element from graveyard) will be inserted.
  23722. *
  23723. * @member {module:engine/model/position~Position} module:engine/model/operation/splitoperation~SplitOperation#insertionPosition
  23724. */
  23725. this.insertionPosition = insertionPosition;
  23726. /**
  23727. * Position in the graveyard root before the element which should be used as a parent of the nodes after `position`.
  23728. * If it is not set, a copy of the the `position` parent will be used.
  23729. *
  23730. * The default behavior is to clone the split element. Element from graveyard is used during undo.
  23731. *
  23732. * @member {module:engine/model/position~Position|null} #graveyardPosition
  23733. */
  23734. this.graveyardPosition = graveyardPosition ? graveyardPosition.clone() : null;
  23735. if ( this.graveyardPosition ) {
  23736. this.graveyardPosition.stickiness = 'toNext';
  23737. }
  23738. }
  23739. /**
  23740. * @inheritDoc
  23741. */
  23742. get type() {
  23743. return 'split';
  23744. }
  23745. /**
  23746. * Position inside the new clone of a split element.
  23747. *
  23748. * This is a position where nodes that are after the split position will be moved to.
  23749. *
  23750. * @readonly
  23751. * @type {module:engine/model/position~Position}
  23752. */
  23753. get moveTargetPosition() {
  23754. const path = this.insertionPosition.path.slice();
  23755. path.push( 0 );
  23756. return new _position__WEBPACK_IMPORTED_MODULE_2__["default"]( this.insertionPosition.root, path );
  23757. }
  23758. /**
  23759. * Artificial range that contains all the nodes from the split element that will be moved to the new element.
  23760. * The range starts at {@link ~#splitPosition} and ends in the same parent, at `POSITIVE_INFINITY` offset.
  23761. *
  23762. * @readonly
  23763. * @type {module:engine/model/range~Range}
  23764. */
  23765. get movedRange() {
  23766. const end = this.splitPosition.getShiftedBy( Number.POSITIVE_INFINITY );
  23767. return new _range__WEBPACK_IMPORTED_MODULE_3__["default"]( this.splitPosition, end );
  23768. }
  23769. /**
  23770. * Creates and returns an operation that has the same parameters as this operation.
  23771. *
  23772. * @returns {module:engine/model/operation/splitoperation~SplitOperation} Clone of this operation.
  23773. */
  23774. clone() {
  23775. return new this.constructor( this.splitPosition, this.howMany, this.insertionPosition, this.graveyardPosition, this.baseVersion );
  23776. }
  23777. /**
  23778. * See {@link module:engine/model/operation/operation~Operation#getReversed `Operation#getReversed()`}.
  23779. *
  23780. * @returns {module:engine/model/operation/mergeoperation~MergeOperation}
  23781. */
  23782. getReversed() {
  23783. const graveyard = this.splitPosition.root.document.graveyard;
  23784. const graveyardPosition = new _position__WEBPACK_IMPORTED_MODULE_2__["default"]( graveyard, [ 0 ] );
  23785. return new _mergeoperation__WEBPACK_IMPORTED_MODULE_1__["default"]( this.moveTargetPosition, this.howMany, this.splitPosition, graveyardPosition, this.baseVersion + 1 );
  23786. }
  23787. /**
  23788. * @inheritDoc
  23789. */
  23790. _validate() {
  23791. const element = this.splitPosition.parent;
  23792. const offset = this.splitPosition.offset;
  23793. // Validate whether split operation has correct parameters.
  23794. if ( !element || element.maxOffset < offset ) {
  23795. /**
  23796. * Split position is invalid.
  23797. *
  23798. * @error split-operation-position-invalid
  23799. */
  23800. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_5__["default"]( 'split-operation-position-invalid', this );
  23801. } else if ( !element.parent ) {
  23802. /**
  23803. * Cannot split root element.
  23804. *
  23805. * @error split-operation-split-in-root
  23806. */
  23807. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_5__["default"]( 'split-operation-split-in-root', this );
  23808. } else if ( this.howMany != element.maxOffset - this.splitPosition.offset ) {
  23809. /**
  23810. * Split operation specifies wrong number of nodes to move.
  23811. *
  23812. * @error split-operation-how-many-invalid
  23813. */
  23814. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_5__["default"]( 'split-operation-how-many-invalid', this );
  23815. } else if ( this.graveyardPosition && !this.graveyardPosition.nodeAfter ) {
  23816. /**
  23817. * Graveyard position invalid.
  23818. *
  23819. * @error split-operation-graveyard-position-invalid
  23820. */
  23821. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_5__["default"]( 'split-operation-graveyard-position-invalid', this );
  23822. }
  23823. }
  23824. /**
  23825. * @inheritDoc
  23826. */
  23827. _execute() {
  23828. const splitElement = this.splitPosition.parent;
  23829. if ( this.graveyardPosition ) {
  23830. Object(_utils__WEBPACK_IMPORTED_MODULE_4__["_move"])( _range__WEBPACK_IMPORTED_MODULE_3__["default"]._createFromPositionAndShift( this.graveyardPosition, 1 ), this.insertionPosition );
  23831. } else {
  23832. const newElement = splitElement._clone();
  23833. Object(_utils__WEBPACK_IMPORTED_MODULE_4__["_insert"])( this.insertionPosition, newElement );
  23834. }
  23835. const sourceRange = new _range__WEBPACK_IMPORTED_MODULE_3__["default"](
  23836. _position__WEBPACK_IMPORTED_MODULE_2__["default"]._createAt( splitElement, this.splitPosition.offset ),
  23837. _position__WEBPACK_IMPORTED_MODULE_2__["default"]._createAt( splitElement, splitElement.maxOffset )
  23838. );
  23839. Object(_utils__WEBPACK_IMPORTED_MODULE_4__["_move"])( sourceRange, this.moveTargetPosition );
  23840. }
  23841. /**
  23842. * @inheritDoc
  23843. */
  23844. toJSON() {
  23845. const json = super.toJSON();
  23846. json.splitPosition = this.splitPosition.toJSON();
  23847. json.insertionPosition = this.insertionPosition.toJSON();
  23848. if ( this.graveyardPosition ) {
  23849. json.graveyardPosition = this.graveyardPosition.toJSON();
  23850. }
  23851. return json;
  23852. }
  23853. /**
  23854. * @inheritDoc
  23855. */
  23856. static get className() {
  23857. return 'SplitOperation';
  23858. }
  23859. /**
  23860. * Helper function that returns a default insertion position basing on given `splitPosition`. The default insertion
  23861. * position is after the split element.
  23862. *
  23863. * @param {module:engine/model/position~Position} splitPosition
  23864. * @returns {module:engine/model/position~Position}
  23865. */
  23866. static getInsertionPosition( splitPosition ) {
  23867. const path = splitPosition.path.slice( 0, -1 );
  23868. path[ path.length - 1 ]++;
  23869. return new _position__WEBPACK_IMPORTED_MODULE_2__["default"]( splitPosition.root, path, 'toPrevious' );
  23870. }
  23871. /**
  23872. * Creates `SplitOperation` object from deserilized object, i.e. from parsed JSON string.
  23873. *
  23874. * @param {Object} json Deserialized JSON object.
  23875. * @param {module:engine/model/document~Document} document Document on which this operation will be applied.
  23876. * @returns {module:engine/model/operation/splitoperation~SplitOperation}
  23877. */
  23878. static fromJSON( json, document ) {
  23879. const splitPosition = _position__WEBPACK_IMPORTED_MODULE_2__["default"].fromJSON( json.splitPosition, document );
  23880. const insertionPosition = _position__WEBPACK_IMPORTED_MODULE_2__["default"].fromJSON( json.insertionPosition, document );
  23881. const graveyardPosition = json.graveyardPosition ? _position__WEBPACK_IMPORTED_MODULE_2__["default"].fromJSON( json.graveyardPosition, document ) : null;
  23882. return new this( splitPosition, json.howMany, insertionPosition, graveyardPosition, json.baseVersion );
  23883. }
  23884. // @if CK_DEBUG_ENGINE // toString() {
  23885. // @if CK_DEBUG_ENGINE // return `SplitOperation( ${ this.baseVersion } ): ${ this.splitPosition } ` +
  23886. // @if CK_DEBUG_ENGINE // `( ${ this.howMany } ) -> ${ this.insertionPosition }` +
  23887. // @if CK_DEBUG_ENGINE // `${ this.graveyardPosition ? ' with ' + this.graveyardPosition : '' }`;
  23888. // @if CK_DEBUG_ENGINE // }
  23889. }
  23890. /***/ }),
  23891. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/transform.js":
  23892. /*!**********************************************************************************!*\
  23893. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/transform.js ***!
  23894. \**********************************************************************************/
  23895. /*! exports provided: transform, transformSets */
  23896. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  23897. "use strict";
  23898. __webpack_require__.r(__webpack_exports__);
  23899. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "transform", function() { return transform; });
  23900. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "transformSets", function() { return transformSets; });
  23901. /* harmony import */ var _insertoperation__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./insertoperation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/insertoperation.js");
  23902. /* harmony import */ var _attributeoperation__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./attributeoperation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/attributeoperation.js");
  23903. /* harmony import */ var _renameoperation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./renameoperation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/renameoperation.js");
  23904. /* harmony import */ var _markeroperation__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./markeroperation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/markeroperation.js");
  23905. /* harmony import */ var _moveoperation__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./moveoperation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/moveoperation.js");
  23906. /* harmony import */ var _rootattributeoperation__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./rootattributeoperation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/rootattributeoperation.js");
  23907. /* harmony import */ var _mergeoperation__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./mergeoperation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/mergeoperation.js");
  23908. /* harmony import */ var _splitoperation__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./splitoperation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/splitoperation.js");
  23909. /* harmony import */ var _nooperation__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./nooperation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/nooperation.js");
  23910. /* harmony import */ var _range__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../range */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/range.js");
  23911. /* harmony import */ var _position__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../position */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/position.js");
  23912. /* 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");
  23913. /**
  23914. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  23915. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  23916. */
  23917. const transformations = new Map();
  23918. /**
  23919. * @module engine/model/operation/transform
  23920. */
  23921. /**
  23922. * Sets a transformation function to be be used to transform instances of class `OperationA` by instances of class `OperationB`.
  23923. *
  23924. * The `transformationFunction` is passed three parameters:
  23925. *
  23926. * * `a` - operation to be transformed, an instance of `OperationA`,
  23927. * * `b` - operation to be transformed by, an instance of `OperationB`,
  23928. * * {@link module:engine/model/operation/transform~TransformationContext `context`} - object with additional information about
  23929. * transformation context.
  23930. *
  23931. * The `transformationFunction` should return transformation result, which is an array with one or multiple
  23932. * {@link module:engine/model/operation/operation~Operation operation} instances.
  23933. *
  23934. * @protected
  23935. * @param {Function} OperationA
  23936. * @param {Function} OperationB
  23937. * @param {Function} transformationFunction Function to use for transforming.
  23938. */
  23939. function setTransformation( OperationA, OperationB, transformationFunction ) {
  23940. let aGroup = transformations.get( OperationA );
  23941. if ( !aGroup ) {
  23942. aGroup = new Map();
  23943. transformations.set( OperationA, aGroup );
  23944. }
  23945. aGroup.set( OperationB, transformationFunction );
  23946. }
  23947. /**
  23948. * Returns a previously set transformation function for transforming an instance of `OperationA` by an instance of `OperationB`.
  23949. *
  23950. * If no transformation was set for given pair of operations, {@link module:engine/model/operation/transform~noUpdateTransformation}
  23951. * is returned. This means that if no transformation was set, the `OperationA` instance will not change when transformed
  23952. * by the `OperationB` instance.
  23953. *
  23954. * @private
  23955. * @param {Function} OperationA
  23956. * @param {Function} OperationB
  23957. * @returns {Function} Function set to transform an instance of `OperationA` by an instance of `OperationB`.
  23958. */
  23959. function getTransformation( OperationA, OperationB ) {
  23960. const aGroup = transformations.get( OperationA );
  23961. if ( aGroup && aGroup.has( OperationB ) ) {
  23962. return aGroup.get( OperationB );
  23963. }
  23964. return noUpdateTransformation;
  23965. }
  23966. /**
  23967. * A transformation function that only clones operation to transform, without changing it.
  23968. *
  23969. * @private
  23970. * @param {module:engine/model/operation/operation~Operation} a Operation to transform.
  23971. * @returns {Array.<module:engine/model/operation/operation~Operation>}
  23972. */
  23973. function noUpdateTransformation( a ) {
  23974. return [ a ];
  23975. }
  23976. /**
  23977. * Transforms operation `a` by operation `b`.
  23978. *
  23979. * @param {module:engine/model/operation/operation~Operation} a Operation to be transformed.
  23980. * @param {module:engine/model/operation/operation~Operation} b Operation to transform by.
  23981. * @param {module:engine/model/operation/transform~TransformationContext} context Transformation context for this transformation.
  23982. * @returns {Array.<module:engine/model/operation/operation~Operation>} Transformation result.
  23983. */
  23984. function transform( a, b, context = {} ) {
  23985. const transformationFunction = getTransformation( a.constructor, b.constructor );
  23986. /* eslint-disable no-useless-catch */
  23987. try {
  23988. a = a.clone();
  23989. return transformationFunction( a, b, context );
  23990. } catch ( e ) {
  23991. // @if CK_DEBUG // console.warn( 'Error during operation transformation!', e.message );
  23992. // @if CK_DEBUG // console.warn( 'Transformed operation', a );
  23993. // @if CK_DEBUG // console.warn( 'Operation transformed by', b );
  23994. // @if CK_DEBUG // console.warn( 'context.aIsStrong', context.aIsStrong );
  23995. // @if CK_DEBUG // console.warn( 'context.aWasUndone', context.aWasUndone );
  23996. // @if CK_DEBUG // console.warn( 'context.bWasUndone', context.bWasUndone );
  23997. // @if CK_DEBUG // console.warn( 'context.abRelation', context.abRelation );
  23998. // @if CK_DEBUG // console.warn( 'context.baRelation', context.baRelation );
  23999. throw e;
  24000. }
  24001. /* eslint-enable no-useless-catch */
  24002. }
  24003. /**
  24004. * Performs a transformation of two sets of operations - `operationsA` and `operationsB`. The transformation is two-way -
  24005. * both transformed `operationsA` and transformed `operationsB` are returned.
  24006. *
  24007. * Note, that the first operation in each set should base on the same document state (
  24008. * {@link module:engine/model/document~Document#version document version}).
  24009. *
  24010. * It is assumed that `operationsA` are "more important" during conflict resolution between two operations.
  24011. *
  24012. * New copies of both passed arrays and operations inside them are returned. Passed arguments are not altered.
  24013. *
  24014. * Base versions of the transformed operations sets are updated accordingly. For example, assume that base versions are `4`
  24015. * and there are `3` operations in `operationsA` and `5` operations in `operationsB`. Then:
  24016. *
  24017. * * transformed `operationsA` will start from base version `9` (`4` base version + `5` operations B),
  24018. * * transformed `operationsB` will start from base version `7` (`4` base version + `3` operations A).
  24019. *
  24020. * If no operation was broken into two during transformation, then both sets will end up with an operation that bases on version `11`:
  24021. *
  24022. * * transformed `operationsA` start from `9` and there are `3` of them, so the last will have `baseVersion` equal to `11`,
  24023. * * transformed `operationsB` start from `7` and there are `5` of them, so the last will have `baseVersion` equal to `11`.
  24024. *
  24025. * @param {Array.<module:engine/model/operation/operation~Operation>} operationsA
  24026. * @param {Array.<module:engine/model/operation/operation~Operation>} operationsB
  24027. * @param {Object} options Additional transformation options.
  24028. * @param {module:engine/model/document~Document|null} options.document Document which the operations change.
  24029. * @param {Boolean} [options.useRelations=false] Whether during transformation relations should be used (used during undo for
  24030. * better conflict resolution).
  24031. * @param {Boolean} [options.padWithNoOps=false] Whether additional {@link module:engine/model/operation/nooperation~NoOperation}s
  24032. * should be added to the transformation results to force the same last base version for both transformed sets (in case
  24033. * if some operations got broken into multiple operations during transformation).
  24034. * @returns {Object} Transformation result.
  24035. * @returns {Array.<module:engine/model/operation/operation~Operation>} return.operationsA Transformed `operationsA`.
  24036. * @returns {Array.<module:engine/model/operation/operation~Operation>} return.operationsB Transformed `operationsB`.
  24037. * @returns {Map} return.originalOperations A map that links transformed operations to original operations. The keys are the transformed
  24038. * operations and the values are the original operations from the input (`operationsA` and `operationsB`).
  24039. */
  24040. function transformSets( operationsA, operationsB, options ) {
  24041. // Create new arrays so the originally passed arguments are not changed.
  24042. // No need to clone operations, they are cloned as they are transformed.
  24043. operationsA = operationsA.slice();
  24044. operationsB = operationsB.slice();
  24045. const contextFactory = new ContextFactory( options.document, options.useRelations, options.forceWeakRemove );
  24046. contextFactory.setOriginalOperations( operationsA );
  24047. contextFactory.setOriginalOperations( operationsB );
  24048. const originalOperations = contextFactory.originalOperations;
  24049. // If one of sets is empty there is simply nothing to transform, so return sets as they are.
  24050. if ( operationsA.length == 0 || operationsB.length == 0 ) {
  24051. return { operationsA, operationsB, originalOperations };
  24052. }
  24053. //
  24054. // Following is a description of transformation process:
  24055. //
  24056. // There are `operationsA` and `operationsB` to be transformed, both by both.
  24057. //
  24058. // So, suppose we have sets of two operations each: `operationsA` = `[ a1, a2 ]`, `operationsB` = `[ b1, b2 ]`.
  24059. //
  24060. // Remember, that we can only transform operations that base on the same context. We assert that `a1` and `b1` base on
  24061. // the same context and we transform them. Then, we get `a1'` and `b1'`. `a2` bases on a context with `a1` -- `a2`
  24062. // is an operation that followed `a1`. Similarly, `b2` bases on a context with `b1`.
  24063. //
  24064. // However, since `a1'` is a result of transformation by `b1`, `a1'` now also has a context with `b1`. This means that
  24065. // we can safely transform `a1'` by `b2`. As we finish transforming `a1`, we also transformed all `operationsB`.
  24066. // All `operationsB` also have context including `a1`. Now, we can properly transform `a2` by those operations.
  24067. //
  24068. // The transformation process can be visualized on a transformation diagram ("diamond diagram"):
  24069. //
  24070. // [the initial state]
  24071. // [common for a1 and b1]
  24072. //
  24073. // *
  24074. // / \
  24075. // / \
  24076. // b1 a1
  24077. // / \
  24078. // / \
  24079. // * *
  24080. // / \ / \
  24081. // / \ / \
  24082. // b2 a1' b1' a2
  24083. // / \ / \
  24084. // / \ / \
  24085. // * * *
  24086. // \ / \ /
  24087. // \ / \ /
  24088. // a1'' b2' a2' b1''
  24089. // \ / \ /
  24090. // \ / \ /
  24091. // * *
  24092. // \ /
  24093. // \ /
  24094. // a2'' b2''
  24095. // \ /
  24096. // \ /
  24097. // *
  24098. //
  24099. // [the final state]
  24100. //
  24101. // The final state can be reached from the initial state by applying `a1`, `a2`, `b1''` and `b2''`, as well as by
  24102. // applying `b1`, `b2`, `a1''`, `a2''`. Note how the operations get to a proper common state before each pair is
  24103. // transformed.
  24104. //
  24105. // Another thing to consider is that an operation during transformation can be broken into multiple operations.
  24106. // Suppose that `a1` * `b1` = `[ a11', a12' ]` (instead of `a1'` that we considered previously).
  24107. //
  24108. // In that case, we leave `a12'` for later and we continue transforming `a11'` until it is transformed by all `operationsB`
  24109. // (in our case it is just `b2`). At this point, `b1` is transformed by "whole" `a1`, while `b2` is only transformed
  24110. // by `a11'`. Similarly, `a12'` is only transformed by `b1`. This leads to a conclusion that we need to start transforming `a12'`
  24111. // from the moment just after it was broken. So, `a12'` is transformed by `b2`. Now, "the whole" `a1` is transformed
  24112. // by `operationsB`, while all `operationsB` are transformed by "the whole" `a1`. This means that we can continue with
  24113. // following `operationsA` (in our case it is just `a2`).
  24114. //
  24115. // Of course, also `operationsB` can be broken. However, since we focus on transforming operation `a` to the end,
  24116. // the only thing to do is to store both pieces of operation `b`, so that the next transformed operation `a` will
  24117. // be transformed by both of them.
  24118. //
  24119. // *
  24120. // / \
  24121. // / \
  24122. // / \
  24123. // b1 a1
  24124. // / \
  24125. // / \
  24126. // / \
  24127. // * *
  24128. // / \ / \
  24129. // / a11' / \
  24130. // / \ / \
  24131. // b2 * b1' a2
  24132. // / / \ / \
  24133. // / / a12' / \
  24134. // / / \ / \
  24135. // * b2' * *
  24136. // \ / / \ /
  24137. // a11'' / b21'' \ /
  24138. // \ / / \ /
  24139. // * * a2' b1''
  24140. // \ / \ \ /
  24141. // a12'' b22''\ \ /
  24142. // \ / \ \ /
  24143. // * a2'' *
  24144. // \ \ /
  24145. // \ \ b21'''
  24146. // \ \ /
  24147. // a2''' *
  24148. // \ /
  24149. // \ b22'''
  24150. // \ /
  24151. // *
  24152. //
  24153. // Note, how `a1` is broken and transformed into `a11'` and `a12'`, while `b2'` got broken and transformed into `b21''` and `b22''`.
  24154. //
  24155. // Having all that on mind, here is an outline for the transformation process algorithm:
  24156. //
  24157. // 1. We have `operationsA` and `operationsB` array, which we dynamically update as the transformation process goes.
  24158. //
  24159. // 2. We take next (or first) operation from `operationsA` and check from which operation `b` we need to start transforming it.
  24160. // All original `operationsA` are set to be transformed starting from the first operation `b`.
  24161. //
  24162. // 3. We take operations from `operationsB`, one by one, starting from the correct one, and transform operation `a`
  24163. // by operation `b` (and vice versa). We update `operationsA` and `operationsB` by replacing the original operations
  24164. // with the transformation results.
  24165. //
  24166. // 4. If operation is broken into multiple operations, we save all the new operations in the place of the
  24167. // original operation.
  24168. //
  24169. // 5. Additionally, if operation `a` was broken, for the "new" operation, we remember from which operation `b` it should
  24170. // be transformed by.
  24171. //
  24172. // 6. We continue transforming "current" operation `a` until it is transformed by all `operationsB`. Then, go to 2.
  24173. // unless the last operation `a` was transformed.
  24174. //
  24175. // The actual implementation of the above algorithm is slightly different, as only one loop (while) is used.
  24176. // The difference is that we have "current" `a` operation to transform and we store the index of the next `b` operation
  24177. // to transform by. Each loop operates on two indexes then: index pointing to currently processed `a` operation and
  24178. // index pointing to next `b` operation. Each loop is just one `a * b` + `b * a` transformation. After each loop
  24179. // operation `b` index is updated. If all `b` operations were visited for the current `a` operation, we change
  24180. // current `a` operation index to the next one.
  24181. //
  24182. // For each operation `a`, keeps information what is the index in `operationsB` from which the transformation should start.
  24183. const nextTransformIndex = new WeakMap();
  24184. // For all the original `operationsA`, set that they should be transformed starting from the first of `operationsB`.
  24185. for ( const op of operationsA ) {
  24186. nextTransformIndex.set( op, 0 );
  24187. }
  24188. // Additional data that is used for some postprocessing after the main transformation process is done.
  24189. const data = {
  24190. nextBaseVersionA: operationsA[ operationsA.length - 1 ].baseVersion + 1,
  24191. nextBaseVersionB: operationsB[ operationsB.length - 1 ].baseVersion + 1,
  24192. originalOperationsACount: operationsA.length,
  24193. originalOperationsBCount: operationsB.length
  24194. };
  24195. // Index of currently transformed operation `a`.
  24196. let i = 0;
  24197. // While not all `operationsA` are transformed...
  24198. while ( i < operationsA.length ) {
  24199. // Get "current" operation `a`.
  24200. const opA = operationsA[ i ];
  24201. // For the "current" operation `a`, get the index of the next operation `b` to transform by.
  24202. const indexB = nextTransformIndex.get( opA );
  24203. // If operation `a` was already transformed by every operation `b`, change "current" operation `a` to the next one.
  24204. if ( indexB == operationsB.length ) {
  24205. i++;
  24206. continue;
  24207. }
  24208. const opB = operationsB[ indexB ];
  24209. // Transform `a` by `b` and `b` by `a`.
  24210. const newOpsA = transform( opA, opB, contextFactory.getContext( opA, opB, true ) );
  24211. const newOpsB = transform( opB, opA, contextFactory.getContext( opB, opA, false ) );
  24212. // As a result we get one or more `newOpsA` and one or more `newOpsB` operations.
  24213. // Update contextual information about operations.
  24214. contextFactory.updateRelation( opA, opB );
  24215. contextFactory.setOriginalOperations( newOpsA, opA );
  24216. contextFactory.setOriginalOperations( newOpsB, opB );
  24217. // For new `a` operations, update their index of the next operation `b` to transform them by.
  24218. //
  24219. // This is needed even if there was only one result (`a` was not broken) because that information is used
  24220. // at the beginning of this loop every time.
  24221. for ( const newOpA of newOpsA ) {
  24222. // Acknowledge, that operation `b` also might be broken into multiple operations.
  24223. //
  24224. // This is why we raise `indexB` not just by 1. If `newOpsB` are multiple operations, they will be
  24225. // spliced in the place of `opB`. So we need to change `transformBy` accordingly, so that an operation won't
  24226. // be transformed by the same operation (part of it) again.
  24227. nextTransformIndex.set( newOpA, indexB + newOpsB.length );
  24228. }
  24229. // Update `operationsA` and `operationsB` with the transformed versions.
  24230. operationsA.splice( i, 1, ...newOpsA );
  24231. operationsB.splice( indexB, 1, ...newOpsB );
  24232. }
  24233. if ( options.padWithNoOps ) {
  24234. // If no-operations padding is enabled, count how many extra `a` and `b` operations were generated.
  24235. const brokenOperationsACount = operationsA.length - data.originalOperationsACount;
  24236. const brokenOperationsBCount = operationsB.length - data.originalOperationsBCount;
  24237. // Then, if that number is not the same, pad `operationsA` or `operationsB` with correct number of no-ops so
  24238. // that the base versions are equalled.
  24239. //
  24240. // Note that only one array will be updated, as only one of those subtractions can be greater than zero.
  24241. padWithNoOps( operationsA, brokenOperationsBCount - brokenOperationsACount );
  24242. padWithNoOps( operationsB, brokenOperationsACount - brokenOperationsBCount );
  24243. }
  24244. // Finally, update base versions of transformed operations.
  24245. updateBaseVersions( operationsA, data.nextBaseVersionB );
  24246. updateBaseVersions( operationsB, data.nextBaseVersionA );
  24247. return { operationsA, operationsB, originalOperations };
  24248. }
  24249. // Gathers additional data about operations processed during transformation. Can be used to obtain contextual information
  24250. // about two operations that are about to be transformed. This contextual information can be used for better conflict resolution.
  24251. class ContextFactory {
  24252. // Creates `ContextFactory` instance.
  24253. //
  24254. // @param {module:engine/model/document~Document} document Document which the operations change.
  24255. // @param {Boolean} useRelations Whether during transformation relations should be used (used during undo for
  24256. // better conflict resolution).
  24257. // @param {Boolean} [forceWeakRemove=false] If set to `false`, remove operation will be always stronger than move operation,
  24258. // so the removed nodes won't end up back in the document root. When set to `true`, context data will be used.
  24259. constructor( document, useRelations, forceWeakRemove = false ) {
  24260. // For each operation that is created during transformation process, we keep a reference to the original operation
  24261. // which it comes from. The original operation works as a kind of "identifier". Every contextual information
  24262. // gathered during transformation that we want to save for given operation, is actually saved for the original operation.
  24263. // This way no matter if operation `a` is cloned, then transformed, even breaks, we still have access to the previously
  24264. // gathered data through original operation reference.
  24265. this.originalOperations = new Map();
  24266. // `model.History` instance which information about undone operations will be taken from.
  24267. this._history = document.history;
  24268. // Whether additional context should be used.
  24269. this._useRelations = useRelations;
  24270. this._forceWeakRemove = !!forceWeakRemove;
  24271. // Relations is a double-map structure (maps in map) where for two operations we store how those operations were related
  24272. // to each other. Those relations are evaluated during transformation process. For every transformated pair of operations
  24273. // we keep relations between them.
  24274. this._relations = new Map();
  24275. }
  24276. // Sets "original operation" for given operations.
  24277. //
  24278. // During transformation process, operations are cloned, then changed, then processed again, sometimes broken into two
  24279. // or multiple operations. When gathering additional data it is important that all operations can be somehow linked
  24280. // so a cloned and transformed "version" still kept track of the data assigned earlier to it.
  24281. //
  24282. // The original operation object will be used as such an universal linking id. Throughout the transformation process
  24283. // all cloned operations will refer to "the original operation" when storing and reading additional data.
  24284. //
  24285. // If `takeFrom` is not set, each operation from `operations` array will be assigned itself as "the original operation".
  24286. // This should be used as an initialization step.
  24287. //
  24288. // If `takeFrom` is set, each operation from `operations` will be assigned the same original operation as assigned
  24289. // for `takeFrom` operation. This should be used to update original operations. It should be used in a way that
  24290. // `operations` are the result of `takeFrom` transformation to ensure proper "original operation propagation".
  24291. //
  24292. // @param {Array.<module:engine/model/operation/operation~Operation>} operations
  24293. // @param {module:engine/model/operation/operation~Operation|null} [takeFrom=null]
  24294. setOriginalOperations( operations, takeFrom = null ) {
  24295. const originalOperation = takeFrom ? this.originalOperations.get( takeFrom ) : null;
  24296. for ( const operation of operations ) {
  24297. this.originalOperations.set( operation, originalOperation || operation );
  24298. }
  24299. }
  24300. // Saves a relation between operations `opA` and `opB`.
  24301. //
  24302. // Relations are then later used to help solve conflicts when operations are transformed.
  24303. //
  24304. // @param {module:engine/model/operation/operation~Operation} opA
  24305. // @param {module:engine/model/operation/operation~Operation} opB
  24306. updateRelation( opA, opB ) {
  24307. // The use of relations is described in a bigger detail in transformation functions.
  24308. //
  24309. // In brief, this function, for specified pairs of operation types, checks how positions defined in those operations relate.
  24310. // Then those relations are saved. For example, for two move operations, it is saved if one of those operations target
  24311. // position is before the other operation source position. This kind of information gives contextual information when
  24312. // transformation is used during undo. Similar checks are done for other pairs of operations.
  24313. //
  24314. switch ( opA.constructor ) {
  24315. case _moveoperation__WEBPACK_IMPORTED_MODULE_4__["default"]: {
  24316. switch ( opB.constructor ) {
  24317. case _mergeoperation__WEBPACK_IMPORTED_MODULE_6__["default"]: {
  24318. if ( opA.targetPosition.isEqual( opB.sourcePosition ) || opB.movedRange.containsPosition( opA.targetPosition ) ) {
  24319. this._setRelation( opA, opB, 'insertAtSource' );
  24320. } else if ( opA.targetPosition.isEqual( opB.deletionPosition ) ) {
  24321. this._setRelation( opA, opB, 'insertBetween' );
  24322. } else if ( opA.targetPosition.isAfter( opB.sourcePosition ) ) {
  24323. this._setRelation( opA, opB, 'moveTargetAfter' );
  24324. }
  24325. break;
  24326. }
  24327. case _moveoperation__WEBPACK_IMPORTED_MODULE_4__["default"]: {
  24328. if ( opA.targetPosition.isEqual( opB.sourcePosition ) || opA.targetPosition.isBefore( opB.sourcePosition ) ) {
  24329. this._setRelation( opA, opB, 'insertBefore' );
  24330. } else {
  24331. this._setRelation( opA, opB, 'insertAfter' );
  24332. }
  24333. break;
  24334. }
  24335. }
  24336. break;
  24337. }
  24338. case _splitoperation__WEBPACK_IMPORTED_MODULE_7__["default"]: {
  24339. switch ( opB.constructor ) {
  24340. case _mergeoperation__WEBPACK_IMPORTED_MODULE_6__["default"]: {
  24341. if ( opA.splitPosition.isBefore( opB.sourcePosition ) ) {
  24342. this._setRelation( opA, opB, 'splitBefore' );
  24343. }
  24344. break;
  24345. }
  24346. case _moveoperation__WEBPACK_IMPORTED_MODULE_4__["default"]: {
  24347. if ( opA.splitPosition.isEqual( opB.sourcePosition ) || opA.splitPosition.isBefore( opB.sourcePosition ) ) {
  24348. this._setRelation( opA, opB, 'splitBefore' );
  24349. } else {
  24350. const range = _range__WEBPACK_IMPORTED_MODULE_9__["default"]._createFromPositionAndShift( opB.sourcePosition, opB.howMany );
  24351. if ( opA.splitPosition.hasSameParentAs( opB.sourcePosition ) && range.containsPosition( opA.splitPosition ) ) {
  24352. const howMany = range.end.offset - opA.splitPosition.offset;
  24353. const offset = opA.splitPosition.offset - range.start.offset;
  24354. this._setRelation( opA, opB, { howMany, offset } );
  24355. }
  24356. }
  24357. }
  24358. }
  24359. break;
  24360. }
  24361. case _mergeoperation__WEBPACK_IMPORTED_MODULE_6__["default"]: {
  24362. switch ( opB.constructor ) {
  24363. case _mergeoperation__WEBPACK_IMPORTED_MODULE_6__["default"]: {
  24364. if ( !opA.targetPosition.isEqual( opB.sourcePosition ) ) {
  24365. this._setRelation( opA, opB, 'mergeTargetNotMoved' );
  24366. }
  24367. if ( opA.sourcePosition.isEqual( opB.targetPosition ) ) {
  24368. this._setRelation( opA, opB, 'mergeSourceNotMoved' );
  24369. }
  24370. if ( opA.sourcePosition.isEqual( opB.sourcePosition ) ) {
  24371. this._setRelation( opA, opB, 'mergeSameElement' );
  24372. }
  24373. break;
  24374. }
  24375. case _splitoperation__WEBPACK_IMPORTED_MODULE_7__["default"]: {
  24376. if ( opA.sourcePosition.isEqual( opB.splitPosition ) ) {
  24377. this._setRelation( opA, opB, 'splitAtSource' );
  24378. }
  24379. }
  24380. }
  24381. break;
  24382. }
  24383. case _markeroperation__WEBPACK_IMPORTED_MODULE_3__["default"]: {
  24384. const markerRange = opA.newRange;
  24385. if ( !markerRange ) {
  24386. return;
  24387. }
  24388. switch ( opB.constructor ) {
  24389. case _moveoperation__WEBPACK_IMPORTED_MODULE_4__["default"]: {
  24390. const movedRange = _range__WEBPACK_IMPORTED_MODULE_9__["default"]._createFromPositionAndShift( opB.sourcePosition, opB.howMany );
  24391. const affectedLeft = movedRange.containsPosition( markerRange.start ) ||
  24392. movedRange.start.isEqual( markerRange.start );
  24393. const affectedRight = movedRange.containsPosition( markerRange.end ) ||
  24394. movedRange.end.isEqual( markerRange.end );
  24395. if ( ( affectedLeft || affectedRight ) && !movedRange.containsRange( markerRange ) ) {
  24396. this._setRelation( opA, opB, {
  24397. side: affectedLeft ? 'left' : 'right',
  24398. path: affectedLeft ? markerRange.start.path.slice() : markerRange.end.path.slice()
  24399. } );
  24400. }
  24401. break;
  24402. }
  24403. case _mergeoperation__WEBPACK_IMPORTED_MODULE_6__["default"]: {
  24404. const wasInLeftElement = markerRange.start.isEqual( opB.targetPosition );
  24405. const wasStartBeforeMergedElement = markerRange.start.isEqual( opB.deletionPosition );
  24406. const wasEndBeforeMergedElement = markerRange.end.isEqual( opB.deletionPosition );
  24407. const wasInRightElement = markerRange.end.isEqual( opB.sourcePosition );
  24408. if ( wasInLeftElement || wasStartBeforeMergedElement || wasEndBeforeMergedElement || wasInRightElement ) {
  24409. this._setRelation( opA, opB, {
  24410. wasInLeftElement,
  24411. wasStartBeforeMergedElement,
  24412. wasEndBeforeMergedElement,
  24413. wasInRightElement
  24414. } );
  24415. }
  24416. break;
  24417. }
  24418. }
  24419. break;
  24420. }
  24421. }
  24422. }
  24423. // Evaluates and returns contextual information about two given operations `opA` and `opB` which are about to be transformed.
  24424. //
  24425. // @param {module:engine/model/operation/operation~Operation} opA
  24426. // @param {module:engine/model/operation/operation~Operation} opB
  24427. // @returns {module:engine/model/operation/transform~TransformationContext}
  24428. getContext( opA, opB, aIsStrong ) {
  24429. return {
  24430. aIsStrong,
  24431. aWasUndone: this._wasUndone( opA ),
  24432. bWasUndone: this._wasUndone( opB ),
  24433. abRelation: this._useRelations ? this._getRelation( opA, opB ) : null,
  24434. baRelation: this._useRelations ? this._getRelation( opB, opA ) : null,
  24435. forceWeakRemove: this._forceWeakRemove
  24436. };
  24437. }
  24438. // Returns whether given operation `op` has already been undone.
  24439. //
  24440. // Information whether an operation was undone gives more context when making a decision when two operations are in conflict.
  24441. //
  24442. // @param {module:engine/model/operation/operation~Operation} op
  24443. // @returns {Boolean}
  24444. _wasUndone( op ) {
  24445. // For `op`, get its original operation. After all, if `op` is a clone (or even transformed clone) of another
  24446. // operation, literally `op` couldn't be undone. It was just generated. If anything, it was the operation it origins
  24447. // from which was undone. So get that original operation.
  24448. const originalOp = this.originalOperations.get( op );
  24449. // And check with the document if the original operation was undone.
  24450. return originalOp.wasUndone || this._history.isUndoneOperation( originalOp );
  24451. }
  24452. // Returns a relation between `opA` and an operation which is undone by `opB`. This can be `String` value if a relation
  24453. // was set earlier or `null` if there was no relation between those operations.
  24454. //
  24455. // This is a little tricky to understand, so let's compare it to `ContextFactory#_wasUndone`.
  24456. //
  24457. // When `wasUndone( opB )` is used, we check if the `opB` has already been undone. It is obvious, that the
  24458. // undoing operation must happen after the undone operation. So, essentially, we have `opB`, we take document history,
  24459. // we look forward in the future and ask if in that future `opB` was undone.
  24460. //
  24461. // Relations is a backward process to `wasUndone()`.
  24462. //
  24463. // Long story short - using relations is asking what happened in the past. Looking back. This time we have an undoing
  24464. // operation `opB` which has undone some other operation. When there is a transformation `opA` x `opB` and there is
  24465. // a conflict to solve and `opB` is an undoing operation, we can look back in the history and see what was a relation
  24466. // between `opA` and the operation which `opB` undone. Basing on that relation from the past, we can now make
  24467. // a better decision when resolving a conflict between two operations, because we know more about the context of
  24468. // those two operations.
  24469. //
  24470. // This is why this function does not return a relation directly between `opA` and `opB` because we need to look
  24471. // back to search for a meaningful contextual information.
  24472. //
  24473. // @param {module:engine/model/operation/operation~Operation} opA
  24474. // @param {module:engine/model/operation/operation~Operation} opB
  24475. // @returns {String|null}
  24476. _getRelation( opA, opB ) {
  24477. // Get the original operation. Similarly as in `wasUndone()` it is used as an universal identifier for stored data.
  24478. const origB = this.originalOperations.get( opB );
  24479. const undoneB = this._history.getUndoneOperation( origB );
  24480. // If `opB` is not undoing any operation, there is no relation.
  24481. if ( !undoneB ) {
  24482. return null;
  24483. }
  24484. const origA = this.originalOperations.get( opA );
  24485. const relationsA = this._relations.get( origA );
  24486. // Get all relations for `opA`, and check if there is a relation with `opB`-undone-counterpart. If so, return it.
  24487. if ( relationsA ) {
  24488. return relationsA.get( undoneB ) || null;
  24489. }
  24490. return null;
  24491. }
  24492. // Helper function for `ContextFactory#updateRelations`.
  24493. //
  24494. // @private
  24495. // @param {module:engine/model/operation/operation~Operation} opA
  24496. // @param {module:engine/model/operation/operation~Operation} opB
  24497. // @param {String} relation
  24498. _setRelation( opA, opB, relation ) {
  24499. // As always, setting is for original operations, not the clones/transformed operations.
  24500. const origA = this.originalOperations.get( opA );
  24501. const origB = this.originalOperations.get( opB );
  24502. let relationsA = this._relations.get( origA );
  24503. if ( !relationsA ) {
  24504. relationsA = new Map();
  24505. this._relations.set( origA, relationsA );
  24506. }
  24507. relationsA.set( origB, relation );
  24508. }
  24509. }
  24510. /**
  24511. * Holds additional contextual information about a transformed pair of operations (`a` and `b`). Those information
  24512. * can be used for better conflict resolving.
  24513. *
  24514. * @typedef {Object} module:engine/model/operation/transform~TransformationContext
  24515. *
  24516. * @property {Boolean} aIsStrong Whether `a` is strong operation in this transformation, or weak.
  24517. * @property {Boolean} aWasUndone Whether `a` operation was undone.
  24518. * @property {Boolean} bWasUndone Whether `b` operation was undone.
  24519. * @property {String|null} abRelation The relation between `a` operation and an operation undone by `b` operation.
  24520. * @property {String|null} baRelation The relation between `b` operation and an operation undone by `a` operation.
  24521. */
  24522. /**
  24523. * An utility function that updates {@link module:engine/model/operation/operation~Operation#baseVersion base versions}
  24524. * of passed operations.
  24525. *
  24526. * The function simply sets `baseVersion` as a base version of the first passed operation and then increments it for
  24527. * each following operation in `operations`.
  24528. *
  24529. * @private
  24530. * @param {Array.<module:engine/model/operation/operation~Operation>} operations Operations to update.
  24531. * @param {Number} baseVersion Base version to set for the first operation in `operations`.
  24532. */
  24533. function updateBaseVersions( operations, baseVersion ) {
  24534. for ( const operation of operations ) {
  24535. operation.baseVersion = baseVersion++;
  24536. }
  24537. }
  24538. /**
  24539. * Adds `howMany` instances of {@link module:engine/model/operation/nooperation~NoOperation} to `operations` set.
  24540. *
  24541. * @private
  24542. * @param {Array.<module:engine/model/operation/operation~Operation>} operations
  24543. * @param {Number} howMany
  24544. */
  24545. function padWithNoOps( operations, howMany ) {
  24546. for ( let i = 0; i < howMany; i++ ) {
  24547. operations.push( new _nooperation__WEBPACK_IMPORTED_MODULE_8__["default"]( 0 ) );
  24548. }
  24549. }
  24550. // -----------------------
  24551. setTransformation( _attributeoperation__WEBPACK_IMPORTED_MODULE_1__["default"], _attributeoperation__WEBPACK_IMPORTED_MODULE_1__["default"], ( a, b, context ) => {
  24552. // If operations in conflict, check if their ranges intersect and manage them properly.
  24553. //
  24554. // Operations can be in conflict only if:
  24555. //
  24556. // * their key is the same (they change the same attribute), and
  24557. // * they are in the same parent (operations for ranges [ 1 ] - [ 3 ] and [ 2, 0 ] - [ 2, 5 ] change different
  24558. // elements and can't be in conflict).
  24559. if ( a.key === b.key && a.range.start.hasSameParentAs( b.range.start ) ) {
  24560. // First, we want to apply change to the part of a range that has not been changed by the other operation.
  24561. const operations = a.range.getDifference( b.range ).map( range => {
  24562. return new _attributeoperation__WEBPACK_IMPORTED_MODULE_1__["default"]( range, a.key, a.oldValue, a.newValue, 0 );
  24563. } );
  24564. // Then we take care of the common part of ranges.
  24565. const common = a.range.getIntersection( b.range );
  24566. if ( common ) {
  24567. // If this operation is more important, we also want to apply change to the part of the
  24568. // original range that has already been changed by the other operation. Since that range
  24569. // got changed we also have to update `oldValue`.
  24570. if ( context.aIsStrong ) {
  24571. operations.push( new _attributeoperation__WEBPACK_IMPORTED_MODULE_1__["default"]( common, b.key, b.newValue, a.newValue, 0 ) );
  24572. }
  24573. }
  24574. if ( operations.length == 0 ) {
  24575. return [ new _nooperation__WEBPACK_IMPORTED_MODULE_8__["default"]( 0 ) ];
  24576. }
  24577. return operations;
  24578. } else {
  24579. // If operations don't conflict, simply return an array containing just a clone of this operation.
  24580. return [ a ];
  24581. }
  24582. } );
  24583. setTransformation( _attributeoperation__WEBPACK_IMPORTED_MODULE_1__["default"], _insertoperation__WEBPACK_IMPORTED_MODULE_0__["default"], ( a, b ) => {
  24584. // Case 1:
  24585. //
  24586. // The attribute operation range includes the position where nodes were inserted.
  24587. // There are two possible scenarios: the inserted nodes were text and they should receive attributes or
  24588. // the inserted nodes were elements and they should not receive attributes.
  24589. //
  24590. if ( a.range.start.hasSameParentAs( b.position ) && a.range.containsPosition( b.position ) ) {
  24591. // If new nodes should not receive attributes, two separated ranges will be returned.
  24592. // Otherwise, one expanded range will be returned.
  24593. const range = a.range._getTransformedByInsertion( b.position, b.howMany, !b.shouldReceiveAttributes );
  24594. const result = range.map( r => {
  24595. return new _attributeoperation__WEBPACK_IMPORTED_MODULE_1__["default"]( r, a.key, a.oldValue, a.newValue, a.baseVersion );
  24596. } );
  24597. if ( b.shouldReceiveAttributes ) {
  24598. // `AttributeOperation#range` includes some newly inserted text.
  24599. // The operation should also change the attribute of that text. An example:
  24600. //
  24601. // Bold should be applied on the following range:
  24602. // <p>Fo[zb]ar</p>
  24603. //
  24604. // In meantime, new text is typed:
  24605. // <p>Fozxxbar</p>
  24606. //
  24607. // Bold should be applied also on the new text:
  24608. // <p>Fo[zxxb]ar</p>
  24609. // <p>Fo<$text bold="true">zxxb</$text>ar</p>
  24610. //
  24611. // There is a special case to consider here to consider.
  24612. //
  24613. // Consider setting an attribute with multiple possible values, for example `highlight`. The inserted text might
  24614. // have already an attribute value applied and the `oldValue` property of the attribute operation might be wrong:
  24615. //
  24616. // Attribute `highlight="yellow"` should be applied on the following range:
  24617. // <p>Fo[zb]ar<p>
  24618. //
  24619. // In meantime, character `x` with `highlight="red"` is typed:
  24620. // <p>Fo[z<$text highlight="red">x</$text>b]ar</p>
  24621. //
  24622. // In this case we cannot simply apply operation changing the attribute value from `null` to `"yellow"` for the whole range
  24623. // because that would lead to an exception (`oldValue` is incorrect for `x`).
  24624. //
  24625. // We also cannot break the original range as this would mess up a scenario when there are multiple following
  24626. // insert operations, because then only the first inserted character is included in those ranges:
  24627. // <p>Fo[z][x][b]ar</p> --> <p>Fo[z][x]x[b]ar</p> --> <p>Fo[z][x]xx[b]ar</p>
  24628. //
  24629. // So, the attribute range needs be expanded, no matter what attributes are set on the inserted nodes:
  24630. //
  24631. // <p>Fo[z<$text highlight="red">x</$text>b]ar</p> <--- Change from `null` to `yellow`, throwing an exception.
  24632. //
  24633. // But before that operation would be applied, we will add an additional attribute operation that will change
  24634. // attributes on the inserted nodes in a way which would make the original operation correct:
  24635. //
  24636. // <p>Fo[z{<$text highlight="red">}x</$text>b]ar</p> <--- Change range `{}` from `red` to `null`.
  24637. // <p>Fo[zxb]ar</p> <--- Now change from `null` to `yellow` is completely fine.
  24638. //
  24639. // Generate complementary attribute operation. Be sure to add it before the original operation.
  24640. const op = _getComplementaryAttributeOperations( b, a.key, a.oldValue );
  24641. if ( op ) {
  24642. result.unshift( op );
  24643. }
  24644. }
  24645. // If nodes should not receive new attribute, we are done here.
  24646. return result;
  24647. }
  24648. // If insert operation is not expanding the attribute operation range, simply transform the range.
  24649. a.range = a.range._getTransformedByInsertion( b.position, b.howMany, false )[ 0 ];
  24650. return [ a ];
  24651. } );
  24652. /**
  24653. * Helper function for `AttributeOperation` x `InsertOperation` (and reverse) transformation.
  24654. *
  24655. * For given `insertOperation` it checks the inserted node if it has an attribute `key` set to a value different
  24656. * than `newValue`. If so, it generates an `AttributeOperation` which changes the value of `key` attribute to `newValue`.
  24657. *
  24658. * @private
  24659. * @param {module:engine/model/operation/insertoperation~InsertOperation} insertOperation
  24660. * @param {String} key
  24661. * @param {*} newValue
  24662. * @returns {module:engine/model/operation/attributeoperation~AttributeOperation|null}
  24663. */
  24664. function _getComplementaryAttributeOperations( insertOperation, key, newValue ) {
  24665. const nodes = insertOperation.nodes;
  24666. // At the beginning we store the attribute value from the first node.
  24667. const insertValue = nodes.getNode( 0 ).getAttribute( key );
  24668. if ( insertValue == newValue ) {
  24669. return null;
  24670. }
  24671. const range = new _range__WEBPACK_IMPORTED_MODULE_9__["default"]( insertOperation.position, insertOperation.position.getShiftedBy( insertOperation.howMany ) );
  24672. return new _attributeoperation__WEBPACK_IMPORTED_MODULE_1__["default"]( range, key, insertValue, newValue, 0 );
  24673. }
  24674. setTransformation( _attributeoperation__WEBPACK_IMPORTED_MODULE_1__["default"], _mergeoperation__WEBPACK_IMPORTED_MODULE_6__["default"], ( a, b ) => {
  24675. const ranges = [];
  24676. // Case 1:
  24677. //
  24678. // Attribute change on the merged element. In this case, the merged element was moved to the graveyard.
  24679. // An additional attribute operation that will change the (re)moved element needs to be generated.
  24680. //
  24681. if ( a.range.start.hasSameParentAs( b.deletionPosition ) ) {
  24682. if ( a.range.containsPosition( b.deletionPosition ) || a.range.start.isEqual( b.deletionPosition ) ) {
  24683. ranges.push( _range__WEBPACK_IMPORTED_MODULE_9__["default"]._createFromPositionAndShift( b.graveyardPosition, 1 ) );
  24684. }
  24685. }
  24686. const range = a.range._getTransformedByMergeOperation( b );
  24687. // Do not add empty (collapsed) ranges to the result. `range` may be collapsed if it contained only the merged element.
  24688. if ( !range.isCollapsed ) {
  24689. ranges.push( range );
  24690. }
  24691. // Create `AttributeOperation`s out of the ranges.
  24692. return ranges.map( range => {
  24693. return new _attributeoperation__WEBPACK_IMPORTED_MODULE_1__["default"]( range, a.key, a.oldValue, a.newValue, a.baseVersion );
  24694. } );
  24695. } );
  24696. setTransformation( _attributeoperation__WEBPACK_IMPORTED_MODULE_1__["default"], _moveoperation__WEBPACK_IMPORTED_MODULE_4__["default"], ( a, b ) => {
  24697. const ranges = _breakRangeByMoveOperation( a.range, b );
  24698. // Create `AttributeOperation`s out of the ranges.
  24699. return ranges.map( range => new _attributeoperation__WEBPACK_IMPORTED_MODULE_1__["default"]( range, a.key, a.oldValue, a.newValue, a.baseVersion ) );
  24700. } );
  24701. // Helper function for `AttributeOperation` x `MoveOperation` transformation.
  24702. //
  24703. // Takes the passed `range` and transforms it by move operation `moveOp` in a specific way. Only top-level nodes of `range`
  24704. // are considered to be in the range. If move operation moves nodes deep from inside of the range, those nodes won't
  24705. // be included in the result. In other words, top-level nodes of the ranges from the result are exactly the same as
  24706. // top-level nodes of the original `range`.
  24707. //
  24708. // This is important for `AttributeOperation` because, for its range, it changes only the top-level nodes. So we need to
  24709. // track only how those nodes have been affected by `MoveOperation`.
  24710. //
  24711. // @private
  24712. // @param {module:engine/model/range~Range} range
  24713. // @param {module:engine/model/operation/moveoperation~MoveOperation} moveOp
  24714. // @returns {Array.<module:engine/model/range~Range>}
  24715. function _breakRangeByMoveOperation( range, moveOp ) {
  24716. const moveRange = _range__WEBPACK_IMPORTED_MODULE_9__["default"]._createFromPositionAndShift( moveOp.sourcePosition, moveOp.howMany );
  24717. // We are transforming `range` (original range) by `moveRange` (range moved by move operation). As usual when it comes to
  24718. // transforming a ranges, we may have a common part of the ranges and we may have a difference part (zero to two ranges).
  24719. let common = null;
  24720. let difference = [];
  24721. // Let's compare the ranges.
  24722. if ( moveRange.containsRange( range, true ) ) {
  24723. // If the whole original range is moved, treat it whole as a common part. There's also no difference part.
  24724. common = range;
  24725. } else if ( range.start.hasSameParentAs( moveRange.start ) ) {
  24726. // If the ranges are "on the same level" (in the same parent) then move operation may move exactly those nodes
  24727. // that are changed by the attribute operation. In this case we get common part and difference part in the usual way.
  24728. difference = range.getDifference( moveRange );
  24729. common = range.getIntersection( moveRange );
  24730. } else {
  24731. // In any other situation we assume that original range is different than move range, that is that move operation
  24732. // moves other nodes that attribute operation change. Even if the moved range is deep inside in the original range.
  24733. //
  24734. // Note that this is different than in `.getIntersection` (we would get a common part in that case) and different
  24735. // than `.getDifference` (we would get two ranges).
  24736. difference = [ range ];
  24737. }
  24738. const result = [];
  24739. // The default behaviour of `_getTransformedByMove` might get wrong results for difference part, though, so
  24740. // we do it by hand.
  24741. for ( let diff of difference ) {
  24742. // First, transform the range by removing moved nodes. Since this is a difference, this is safe, `null` won't be returned
  24743. // as the range is different than the moved range.
  24744. diff = diff._getTransformedByDeletion( moveOp.sourcePosition, moveOp.howMany );
  24745. // Transform also `targetPosition`.
  24746. const targetPosition = moveOp.getMovedRangeStart();
  24747. // Spread the range only if moved nodes are inserted only between the top-level nodes of the `diff` range.
  24748. const spread = diff.start.hasSameParentAs( targetPosition );
  24749. // Transform by insertion of moved nodes.
  24750. diff = diff._getTransformedByInsertion( targetPosition, moveOp.howMany, spread );
  24751. result.push( ...diff );
  24752. }
  24753. // Common part can be simply transformed by the move operation. This is because move operation will not target to
  24754. // that common part (the operation would have to target inside its own moved range).
  24755. if ( common ) {
  24756. result.push(
  24757. common._getTransformedByMove( moveOp.sourcePosition, moveOp.targetPosition, moveOp.howMany, false )[ 0 ]
  24758. );
  24759. }
  24760. return result;
  24761. }
  24762. setTransformation( _attributeoperation__WEBPACK_IMPORTED_MODULE_1__["default"], _splitoperation__WEBPACK_IMPORTED_MODULE_7__["default"], ( a, b ) => {
  24763. // Case 1:
  24764. //
  24765. // Split node is the last node in `AttributeOperation#range`.
  24766. // `AttributeOperation#range` needs to be expanded to include the new (split) node.
  24767. //
  24768. // Attribute `type` to be changed to `numbered` but the `listItem` is split.
  24769. // <listItem type="bulleted">foobar</listItem>
  24770. //
  24771. // After split:
  24772. // <listItem type="bulleted">foo</listItem><listItem type="bulleted">bar</listItem>
  24773. //
  24774. // After attribute change:
  24775. // <listItem type="numbered">foo</listItem><listItem type="numbered">foo</listItem>
  24776. //
  24777. if ( a.range.end.isEqual( b.insertionPosition ) ) {
  24778. if ( !b.graveyardPosition ) {
  24779. a.range.end.offset++;
  24780. }
  24781. return [ a ];
  24782. }
  24783. // Case 2:
  24784. //
  24785. // Split position is inside `AttributeOperation#range`, at the same level, so the nodes to change are
  24786. // not going to make a flat range.
  24787. //
  24788. // Content with range-to-change and split position:
  24789. // <p>Fo[zb^a]r</p>
  24790. //
  24791. // After split:
  24792. // <p>Fozb</p><p>ar</p>
  24793. //
  24794. // Make two separate ranges containing all nodes to change:
  24795. // <p>Fo[zb]</p><p>[a]r</p>
  24796. //
  24797. if ( a.range.start.hasSameParentAs( b.splitPosition ) && a.range.containsPosition( b.splitPosition ) ) {
  24798. const secondPart = a.clone();
  24799. secondPart.range = new _range__WEBPACK_IMPORTED_MODULE_9__["default"](
  24800. b.moveTargetPosition.clone(),
  24801. a.range.end._getCombined( b.splitPosition, b.moveTargetPosition )
  24802. );
  24803. a.range.end = b.splitPosition.clone();
  24804. a.range.end.stickiness = 'toPrevious';
  24805. return [ a, secondPart ];
  24806. }
  24807. // The default case.
  24808. //
  24809. a.range = a.range._getTransformedBySplitOperation( b );
  24810. return [ a ];
  24811. } );
  24812. setTransformation( _insertoperation__WEBPACK_IMPORTED_MODULE_0__["default"], _attributeoperation__WEBPACK_IMPORTED_MODULE_1__["default"], ( a, b ) => {
  24813. const result = [ a ];
  24814. // Case 1:
  24815. //
  24816. // The attribute operation range includes the position where nodes were inserted.
  24817. // There are two possible scenarios: the inserted nodes were text and they should receive attributes or
  24818. // the inserted nodes were elements and they should not receive attributes.
  24819. //
  24820. // This is a mirror scenario to the one described in `AttributeOperation` x `InsertOperation` transformation,
  24821. // although this case is a little less complicated. In this case we simply need to change attributes of the
  24822. // inserted nodes and that's it.
  24823. //
  24824. if ( a.shouldReceiveAttributes && a.position.hasSameParentAs( b.range.start ) && b.range.containsPosition( a.position ) ) {
  24825. const op = _getComplementaryAttributeOperations( a, b.key, b.newValue );
  24826. if ( op ) {
  24827. result.push( op );
  24828. }
  24829. }
  24830. // The default case is: do nothing.
  24831. // `AttributeOperation` does not change the model tree structure so `InsertOperation` does not need to be changed.
  24832. //
  24833. return result;
  24834. } );
  24835. setTransformation( _insertoperation__WEBPACK_IMPORTED_MODULE_0__["default"], _insertoperation__WEBPACK_IMPORTED_MODULE_0__["default"], ( a, b, context ) => {
  24836. // Case 1:
  24837. //
  24838. // Two insert operations insert nodes at the same position. Since they are the same, it needs to be decided
  24839. // what will be the order of inserted nodes. However, there is no additional information to help in that
  24840. // decision. Also, when `b` will be transformed by `a`, the same order must be maintained.
  24841. //
  24842. // To achieve that, we will check if the operation is strong.
  24843. // If it is, it won't get transformed. If it is not, it will be moved.
  24844. //
  24845. if ( a.position.isEqual( b.position ) && context.aIsStrong ) {
  24846. return [ a ];
  24847. }
  24848. // The default case.
  24849. //
  24850. a.position = a.position._getTransformedByInsertOperation( b );
  24851. return [ a ];
  24852. } );
  24853. setTransformation( _insertoperation__WEBPACK_IMPORTED_MODULE_0__["default"], _moveoperation__WEBPACK_IMPORTED_MODULE_4__["default"], ( a, b ) => {
  24854. // The default case.
  24855. //
  24856. a.position = a.position._getTransformedByMoveOperation( b );
  24857. return [ a ];
  24858. } );
  24859. setTransformation( _insertoperation__WEBPACK_IMPORTED_MODULE_0__["default"], _splitoperation__WEBPACK_IMPORTED_MODULE_7__["default"], ( a, b ) => {
  24860. // The default case.
  24861. //
  24862. a.position = a.position._getTransformedBySplitOperation( b );
  24863. return [ a ];
  24864. } );
  24865. setTransformation( _insertoperation__WEBPACK_IMPORTED_MODULE_0__["default"], _mergeoperation__WEBPACK_IMPORTED_MODULE_6__["default"], ( a, b ) => {
  24866. a.position = a.position._getTransformedByMergeOperation( b );
  24867. return [ a ];
  24868. } );
  24869. // -----------------------
  24870. setTransformation( _markeroperation__WEBPACK_IMPORTED_MODULE_3__["default"], _insertoperation__WEBPACK_IMPORTED_MODULE_0__["default"], ( a, b ) => {
  24871. if ( a.oldRange ) {
  24872. a.oldRange = a.oldRange._getTransformedByInsertOperation( b )[ 0 ];
  24873. }
  24874. if ( a.newRange ) {
  24875. a.newRange = a.newRange._getTransformedByInsertOperation( b )[ 0 ];
  24876. }
  24877. return [ a ];
  24878. } );
  24879. setTransformation( _markeroperation__WEBPACK_IMPORTED_MODULE_3__["default"], _markeroperation__WEBPACK_IMPORTED_MODULE_3__["default"], ( a, b, context ) => {
  24880. if ( a.name == b.name ) {
  24881. if ( context.aIsStrong ) {
  24882. a.oldRange = b.newRange ? b.newRange.clone() : null;
  24883. } else {
  24884. return [ new _nooperation__WEBPACK_IMPORTED_MODULE_8__["default"]( 0 ) ];
  24885. }
  24886. }
  24887. return [ a ];
  24888. } );
  24889. setTransformation( _markeroperation__WEBPACK_IMPORTED_MODULE_3__["default"], _mergeoperation__WEBPACK_IMPORTED_MODULE_6__["default"], ( a, b ) => {
  24890. if ( a.oldRange ) {
  24891. a.oldRange = a.oldRange._getTransformedByMergeOperation( b );
  24892. }
  24893. if ( a.newRange ) {
  24894. a.newRange = a.newRange._getTransformedByMergeOperation( b );
  24895. }
  24896. return [ a ];
  24897. } );
  24898. setTransformation( _markeroperation__WEBPACK_IMPORTED_MODULE_3__["default"], _moveoperation__WEBPACK_IMPORTED_MODULE_4__["default"], ( a, b, context ) => {
  24899. if ( a.oldRange ) {
  24900. a.oldRange = _range__WEBPACK_IMPORTED_MODULE_9__["default"]._createFromRanges( a.oldRange._getTransformedByMoveOperation( b ) );
  24901. }
  24902. if ( a.newRange ) {
  24903. if ( context.abRelation ) {
  24904. const aNewRange = _range__WEBPACK_IMPORTED_MODULE_9__["default"]._createFromRanges( a.newRange._getTransformedByMoveOperation( b ) );
  24905. if ( context.abRelation.side == 'left' && b.targetPosition.isEqual( a.newRange.start ) ) {
  24906. a.newRange.start.path = context.abRelation.path;
  24907. a.newRange.end = aNewRange.end;
  24908. return [ a ];
  24909. } else if ( context.abRelation.side == 'right' && b.targetPosition.isEqual( a.newRange.end ) ) {
  24910. a.newRange.start = aNewRange.start;
  24911. a.newRange.end.path = context.abRelation.path;
  24912. return [ a ];
  24913. }
  24914. }
  24915. a.newRange = _range__WEBPACK_IMPORTED_MODULE_9__["default"]._createFromRanges( a.newRange._getTransformedByMoveOperation( b ) );
  24916. }
  24917. return [ a ];
  24918. } );
  24919. setTransformation( _markeroperation__WEBPACK_IMPORTED_MODULE_3__["default"], _splitoperation__WEBPACK_IMPORTED_MODULE_7__["default"], ( a, b, context ) => {
  24920. if ( a.oldRange ) {
  24921. a.oldRange = a.oldRange._getTransformedBySplitOperation( b );
  24922. }
  24923. if ( a.newRange ) {
  24924. if ( context.abRelation ) {
  24925. const aNewRange = a.newRange._getTransformedBySplitOperation( b );
  24926. if ( a.newRange.start.isEqual( b.splitPosition ) && context.abRelation.wasStartBeforeMergedElement ) {
  24927. a.newRange.start = _position__WEBPACK_IMPORTED_MODULE_10__["default"]._createAt( b.insertionPosition );
  24928. } else if ( a.newRange.start.isEqual( b.splitPosition ) && !context.abRelation.wasInLeftElement ) {
  24929. a.newRange.start = _position__WEBPACK_IMPORTED_MODULE_10__["default"]._createAt( b.moveTargetPosition );
  24930. }
  24931. if ( a.newRange.end.isEqual( b.splitPosition ) && context.abRelation.wasInRightElement ) {
  24932. a.newRange.end = _position__WEBPACK_IMPORTED_MODULE_10__["default"]._createAt( b.moveTargetPosition );
  24933. } else if ( a.newRange.end.isEqual( b.splitPosition ) && context.abRelation.wasEndBeforeMergedElement ) {
  24934. a.newRange.end = _position__WEBPACK_IMPORTED_MODULE_10__["default"]._createAt( b.insertionPosition );
  24935. } else {
  24936. a.newRange.end = aNewRange.end;
  24937. }
  24938. return [ a ];
  24939. }
  24940. a.newRange = a.newRange._getTransformedBySplitOperation( b );
  24941. }
  24942. return [ a ];
  24943. } );
  24944. // -----------------------
  24945. setTransformation( _mergeoperation__WEBPACK_IMPORTED_MODULE_6__["default"], _insertoperation__WEBPACK_IMPORTED_MODULE_0__["default"], ( a, b ) => {
  24946. if ( a.sourcePosition.hasSameParentAs( b.position ) ) {
  24947. a.howMany += b.howMany;
  24948. }
  24949. a.sourcePosition = a.sourcePosition._getTransformedByInsertOperation( b );
  24950. a.targetPosition = a.targetPosition._getTransformedByInsertOperation( b );
  24951. return [ a ];
  24952. } );
  24953. setTransformation( _mergeoperation__WEBPACK_IMPORTED_MODULE_6__["default"], _mergeoperation__WEBPACK_IMPORTED_MODULE_6__["default"], ( a, b, context ) => {
  24954. // Case 1:
  24955. //
  24956. // Same merge operations.
  24957. //
  24958. // Both operations have same source and target positions. So the element already got merged and there is
  24959. // theoretically nothing to do.
  24960. //
  24961. if ( a.sourcePosition.isEqual( b.sourcePosition ) && a.targetPosition.isEqual( b.targetPosition ) ) {
  24962. // There are two ways that we can provide a do-nothing operation.
  24963. //
  24964. // First is simply a NoOperation instance. We will use it if `b` operation was not undone.
  24965. //
  24966. // Second is a merge operation that has the source operation in the merged element - in the graveyard -
  24967. // same target position and `howMany` equal to `0`. So it is basically merging an empty element from graveyard
  24968. // which is almost the same as NoOperation.
  24969. //
  24970. // This way the merge operation can be later transformed by split operation
  24971. // to provide correct undo. This will be used if `b` operation was undone (only then it is correct).
  24972. //
  24973. if ( !context.bWasUndone ) {
  24974. return [ new _nooperation__WEBPACK_IMPORTED_MODULE_8__["default"]( 0 ) ];
  24975. } else {
  24976. const path = b.graveyardPosition.path.slice();
  24977. path.push( 0 );
  24978. a.sourcePosition = new _position__WEBPACK_IMPORTED_MODULE_10__["default"]( b.graveyardPosition.root, path );
  24979. a.howMany = 0;
  24980. return [ a ];
  24981. }
  24982. }
  24983. // Case 2:
  24984. //
  24985. // Same merge source position but different target position.
  24986. //
  24987. // This can happen during collaboration. For example, if one client merged a paragraph to the previous paragraph
  24988. // and the other person removed that paragraph and merged the same paragraph to something before:
  24989. //
  24990. // Client A:
  24991. // <p>Foo</p><p>Bar</p><p>[]Xyz</p>
  24992. // <p>Foo</p><p>BarXyz</p>
  24993. //
  24994. // Client B:
  24995. // <p>Foo</p>[<p>Bar</p>]<p>Xyz</p>
  24996. // <p>Foo</p><p>[]Xyz</p>
  24997. // <p>FooXyz</p>
  24998. //
  24999. // In this case we need to decide where finally "Xyz" will land:
  25000. //
  25001. // <p>FooXyz</p> graveyard: <p>Bar</p>
  25002. // <p>Foo</p> graveyard: <p>BarXyz</p>
  25003. //
  25004. // Let's move it in a way so that a merge operation that does not target to graveyard is more important so that
  25005. // nodes does not end up in the graveyard. It makes sense. Both for Client A and for Client B "Xyz" finally did not
  25006. // end up in the graveyard (see above).
  25007. //
  25008. // If neither or both operations point to graveyard, then let `aIsStrong` decide.
  25009. //
  25010. if (
  25011. a.sourcePosition.isEqual( b.sourcePosition ) && !a.targetPosition.isEqual( b.targetPosition ) &&
  25012. !context.bWasUndone && context.abRelation != 'splitAtSource'
  25013. ) {
  25014. const aToGraveyard = a.targetPosition.root.rootName == '$graveyard';
  25015. const bToGraveyard = b.targetPosition.root.rootName == '$graveyard';
  25016. // If `aIsWeak` it means that `a` points to graveyard while `b` doesn't. Don't move nodes then.
  25017. const aIsWeak = aToGraveyard && !bToGraveyard;
  25018. // If `bIsWeak` it means that `b` points to graveyard while `a` doesn't. Force moving nodes then.
  25019. const bIsWeak = bToGraveyard && !aToGraveyard;
  25020. // Force move if `b` is weak or neither operation is weak but `a` is stronger through `context.aIsStrong`.
  25021. const forceMove = bIsWeak || ( !aIsWeak && context.aIsStrong );
  25022. if ( forceMove ) {
  25023. const sourcePosition = b.targetPosition._getTransformedByMergeOperation( b );
  25024. const targetPosition = a.targetPosition._getTransformedByMergeOperation( b );
  25025. return [ new _moveoperation__WEBPACK_IMPORTED_MODULE_4__["default"]( sourcePosition, a.howMany, targetPosition, 0 ) ];
  25026. } else {
  25027. return [ new _nooperation__WEBPACK_IMPORTED_MODULE_8__["default"]( 0 ) ];
  25028. }
  25029. }
  25030. // The default case.
  25031. //
  25032. if ( a.sourcePosition.hasSameParentAs( b.targetPosition ) ) {
  25033. a.howMany += b.howMany;
  25034. }
  25035. a.sourcePosition = a.sourcePosition._getTransformedByMergeOperation( b );
  25036. a.targetPosition = a.targetPosition._getTransformedByMergeOperation( b );
  25037. // Handle positions in graveyard.
  25038. // If graveyard positions are same and `a` operation is strong - do not transform.
  25039. if ( !a.graveyardPosition.isEqual( b.graveyardPosition ) || !context.aIsStrong ) {
  25040. a.graveyardPosition = a.graveyardPosition._getTransformedByMergeOperation( b );
  25041. }
  25042. return [ a ];
  25043. } );
  25044. setTransformation( _mergeoperation__WEBPACK_IMPORTED_MODULE_6__["default"], _moveoperation__WEBPACK_IMPORTED_MODULE_4__["default"], ( a, b, context ) => {
  25045. // Case 1:
  25046. //
  25047. // The element to merge got removed.
  25048. //
  25049. // Merge operation does support merging elements which are not siblings. So it would not be a problem
  25050. // from technical point of view. However, if the element was removed, the intention of the user deleting it
  25051. // was to have it all deleted, together with its children. From user experience point of view, moving back the
  25052. // removed nodes might be unexpected. This means that in this scenario we will block the merging.
  25053. //
  25054. // The exception of this rule would be if the remove operation was later undone.
  25055. //
  25056. const removedRange = _range__WEBPACK_IMPORTED_MODULE_9__["default"]._createFromPositionAndShift( b.sourcePosition, b.howMany );
  25057. if ( b.type == 'remove' && !context.bWasUndone && !context.forceWeakRemove ) {
  25058. if ( a.deletionPosition.hasSameParentAs( b.sourcePosition ) && removedRange.containsPosition( a.sourcePosition ) ) {
  25059. return [ new _nooperation__WEBPACK_IMPORTED_MODULE_8__["default"]( 0 ) ];
  25060. }
  25061. }
  25062. // The default case.
  25063. //
  25064. if ( a.sourcePosition.hasSameParentAs( b.targetPosition ) ) {
  25065. a.howMany += b.howMany;
  25066. }
  25067. if ( a.sourcePosition.hasSameParentAs( b.sourcePosition ) ) {
  25068. a.howMany -= b.howMany;
  25069. }
  25070. a.sourcePosition = a.sourcePosition._getTransformedByMoveOperation( b );
  25071. a.targetPosition = a.targetPosition._getTransformedByMoveOperation( b );
  25072. // `MergeOperation` graveyard position is like `MoveOperation` target position. It is a position where element(s) will
  25073. // be moved. Like in other similar cases, we need to consider the scenario when those positions are same.
  25074. // Here, we will treat `MergeOperation` like it is always strong (see `InsertOperation` x `InsertOperation` for comparison).
  25075. // This means that we won't transform graveyard position if it is equal to move operation target position.
  25076. if ( !a.graveyardPosition.isEqual( b.targetPosition ) ) {
  25077. a.graveyardPosition = a.graveyardPosition._getTransformedByMoveOperation( b );
  25078. }
  25079. return [ a ];
  25080. } );
  25081. setTransformation( _mergeoperation__WEBPACK_IMPORTED_MODULE_6__["default"], _splitoperation__WEBPACK_IMPORTED_MODULE_7__["default"], ( a, b, context ) => {
  25082. if ( b.graveyardPosition ) {
  25083. // If `b` operation defines graveyard position, a node from graveyard will be moved. This means that we need to
  25084. // transform `a.graveyardPosition` accordingly.
  25085. a.graveyardPosition = a.graveyardPosition._getTransformedByDeletion( b.graveyardPosition, 1 );
  25086. // This is a scenario foreseen in `MergeOperation` x `MergeOperation`, with two identical merge operations.
  25087. //
  25088. // So, there was `MergeOperation` x `MergeOperation` transformation earlier. Now, `a` is a merge operation which
  25089. // source position is in graveyard. Interestingly, split operation wants to use the node to be merged by `a`. This
  25090. // means that `b` is undoing that merge operation from earlier, which caused `a` to be in graveyard.
  25091. //
  25092. // If that's the case, at this point, we will only "fix" `a.howMany`. It was earlier set to `0` in
  25093. // `MergeOperation` x `MergeOperation` transformation. Later transformations in this function will change other
  25094. // properties.
  25095. //
  25096. if ( a.deletionPosition.isEqual( b.graveyardPosition ) ) {
  25097. a.howMany = b.howMany;
  25098. }
  25099. }
  25100. // Case 1:
  25101. //
  25102. // Merge operation moves nodes to the place where split happens.
  25103. // This is a classic situation when there are two paragraphs, and there is a split (enter) after the first
  25104. // paragraph and there is a merge (delete) at the beginning of the second paragraph:
  25105. //
  25106. // <p>Foo{}</p><p>[]Bar</p>.
  25107. //
  25108. // Split is after `Foo`, while merge is from `Bar` to the end of `Foo`.
  25109. //
  25110. // State after split:
  25111. // <p>Foo</p><p></p><p>Bar</p>
  25112. //
  25113. // Now, `Bar` should be merged to the new paragraph:
  25114. // <p>Foo</p><p>Bar</p>
  25115. //
  25116. // Instead of merging it to the original paragraph:
  25117. // <p>FooBar</p><p></p>
  25118. //
  25119. // This means that `targetPosition` needs to be transformed. This is the default case though.
  25120. // For example, if the split would be after `F`, `targetPosition` should also be transformed.
  25121. //
  25122. // There are three exceptions, though, when we want to keep `targetPosition` as it was.
  25123. //
  25124. // First exception is when the merge target position is inside an element (not at the end, as usual). This
  25125. // happens when the merge operation earlier was transformed by "the same" merge operation. If merge operation
  25126. // targets inside the element we want to keep the original target position (and not transform it) because
  25127. // we have additional context telling us that we want to merge to the original element. We can check if the
  25128. // merge operation points inside element by checking what is `SplitOperation#howMany`. Since merge target position
  25129. // is same as split position, if `howMany` is non-zero, it means that the merge target position is inside an element.
  25130. //
  25131. // Second exception is when the element to merge is in the graveyard and split operation uses it. In that case
  25132. // if target position would be transformed, the merge operation would target at the source position:
  25133. //
  25134. // root: <p>Foo</p> graveyard: <p></p>
  25135. //
  25136. // SplitOperation: root [ 0, 3 ] using graveyard [ 0 ] (howMany = 0)
  25137. // MergeOperation: graveyard [ 0, 0 ] -> root [ 0, 3 ] (howMany = 0)
  25138. //
  25139. // Since split operation moves the graveyard node back to the root, the merge operation source position changes.
  25140. // We would like to merge from the empty <p> to the "Foo" <p>:
  25141. //
  25142. // root: <p>Foo</p><p></p> graveyard:
  25143. //
  25144. // MergeOperation#sourcePosition = root [ 1, 0 ]
  25145. //
  25146. // If `targetPosition` is transformed, it would become root [ 1, 0 ] as well. It has to be kept as it was.
  25147. //
  25148. // Third exception is connected with relations. If this happens during undo and we have explicit information
  25149. // that target position has not been affected by the operation which is undone by this split then this split should
  25150. // not move the target position either.
  25151. //
  25152. if ( a.targetPosition.isEqual( b.splitPosition ) ) {
  25153. const mergeInside = b.howMany != 0;
  25154. const mergeSplittingElement = b.graveyardPosition && a.deletionPosition.isEqual( b.graveyardPosition );
  25155. if ( mergeInside || mergeSplittingElement || context.abRelation == 'mergeTargetNotMoved' ) {
  25156. a.sourcePosition = a.sourcePosition._getTransformedBySplitOperation( b );
  25157. return [ a ];
  25158. }
  25159. }
  25160. // Case 2:
  25161. //
  25162. // Merge source is at the same position as split position. This sometimes happen, mostly during undo.
  25163. // 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
  25164. // split element) or should be move to the beginning of the new element.
  25165. //
  25166. if ( a.sourcePosition.isEqual( b.splitPosition ) ) {
  25167. // Use context to check if `SplitOperation` is not undoing a merge operation, that didn't change the `a` operation.
  25168. // This scenario happens the undone merge operation moved nodes at the source position of `a` operation.
  25169. // In that case `a` operation source position should stay where it is.
  25170. if ( context.abRelation == 'mergeSourceNotMoved' ) {
  25171. a.howMany = 0;
  25172. a.targetPosition = a.targetPosition._getTransformedBySplitOperation( b );
  25173. return [ a ];
  25174. }
  25175. // This merge operation might have been earlier transformed by a merge operation which both merged the same element.
  25176. // See that case in `MergeOperation` x `MergeOperation` transformation. In that scenario, if the merge operation has been undone,
  25177. // the special case is not applied.
  25178. //
  25179. // Now, the merge operation is transformed by the split which has undone that previous merge operation.
  25180. // So now we are fixing situation which was skipped in `MergeOperation` x `MergeOperation` case.
  25181. //
  25182. if ( context.abRelation == 'mergeSameElement' || a.sourcePosition.offset > 0 ) {
  25183. a.sourcePosition = b.moveTargetPosition.clone();
  25184. a.targetPosition = a.targetPosition._getTransformedBySplitOperation( b );
  25185. return [ a ];
  25186. }
  25187. }
  25188. // The default case.
  25189. //
  25190. if ( a.sourcePosition.hasSameParentAs( b.splitPosition ) ) {
  25191. a.howMany = b.splitPosition.offset;
  25192. }
  25193. a.sourcePosition = a.sourcePosition._getTransformedBySplitOperation( b );
  25194. a.targetPosition = a.targetPosition._getTransformedBySplitOperation( b );
  25195. return [ a ];
  25196. } );
  25197. // -----------------------
  25198. setTransformation( _moveoperation__WEBPACK_IMPORTED_MODULE_4__["default"], _insertoperation__WEBPACK_IMPORTED_MODULE_0__["default"], ( a, b ) => {
  25199. const moveRange = _range__WEBPACK_IMPORTED_MODULE_9__["default"]._createFromPositionAndShift( a.sourcePosition, a.howMany );
  25200. const transformed = moveRange._getTransformedByInsertOperation( b, false )[ 0 ];
  25201. a.sourcePosition = transformed.start;
  25202. a.howMany = transformed.end.offset - transformed.start.offset;
  25203. // See `InsertOperation` x `MoveOperation` transformation for details on this case.
  25204. //
  25205. // In summary, both operations point to the same place, so the order of nodes needs to be decided.
  25206. // `MoveOperation` is considered weaker, so it is always transformed, unless there was a certain relation
  25207. // between operations.
  25208. //
  25209. if ( !a.targetPosition.isEqual( b.position ) ) {
  25210. a.targetPosition = a.targetPosition._getTransformedByInsertOperation( b );
  25211. }
  25212. return [ a ];
  25213. } );
  25214. setTransformation( _moveoperation__WEBPACK_IMPORTED_MODULE_4__["default"], _moveoperation__WEBPACK_IMPORTED_MODULE_4__["default"], ( a, b, context ) => {
  25215. //
  25216. // Setting and evaluating some variables that will be used in special cases and default algorithm.
  25217. //
  25218. // Create ranges from `MoveOperations` properties.
  25219. const rangeA = _range__WEBPACK_IMPORTED_MODULE_9__["default"]._createFromPositionAndShift( a.sourcePosition, a.howMany );
  25220. const rangeB = _range__WEBPACK_IMPORTED_MODULE_9__["default"]._createFromPositionAndShift( b.sourcePosition, b.howMany );
  25221. // Assign `context.aIsStrong` to a different variable, because the value may change during execution of
  25222. // this algorithm and we do not want to override original `context.aIsStrong` that will be used in later transformations.
  25223. let aIsStrong = context.aIsStrong;
  25224. // This will be used to decide the order of nodes if both operations target at the same position.
  25225. // By default, use strong/weak operation mechanism.
  25226. let insertBefore = !context.aIsStrong;
  25227. // If the relation is set, then use it to decide nodes order.
  25228. if ( context.abRelation == 'insertBefore' || context.baRelation == 'insertAfter' ) {
  25229. insertBefore = true;
  25230. } else if ( context.abRelation == 'insertAfter' || context.baRelation == 'insertBefore' ) {
  25231. insertBefore = false;
  25232. }
  25233. // `a.targetPosition` could be affected by the `b` operation. We will transform it.
  25234. let newTargetPosition;
  25235. if ( a.targetPosition.isEqual( b.targetPosition ) && insertBefore ) {
  25236. newTargetPosition = a.targetPosition._getTransformedByDeletion(
  25237. b.sourcePosition,
  25238. b.howMany
  25239. );
  25240. } else {
  25241. newTargetPosition = a.targetPosition._getTransformedByMove(
  25242. b.sourcePosition,
  25243. b.targetPosition,
  25244. b.howMany
  25245. );
  25246. }
  25247. //
  25248. // Special case #1 + mirror.
  25249. //
  25250. // Special case when both move operations' target positions are inside nodes that are
  25251. // being moved by the other move operation. So in other words, we move ranges into inside of each other.
  25252. // This case can't be solved reasonably (on the other hand, it should not happen often).
  25253. if ( _moveTargetIntoMovedRange( a, b ) && _moveTargetIntoMovedRange( b, a ) ) {
  25254. // Instead of transforming operation, we return a reverse of the operation that we transform by.
  25255. // So when the results of this "transformation" will be applied, `b` MoveOperation will get reversed.
  25256. return [ b.getReversed() ];
  25257. }
  25258. //
  25259. // End of special case #1.
  25260. //
  25261. //
  25262. // Special case #2.
  25263. //
  25264. // Check if `b` operation targets inside `rangeA`.
  25265. const bTargetsToA = rangeA.containsPosition( b.targetPosition );
  25266. // If `b` targets to `rangeA` and `rangeA` contains `rangeB`, `b` operation has no influence on `a` operation.
  25267. // You might say that operation `b` is captured inside operation `a`.
  25268. if ( bTargetsToA && rangeA.containsRange( rangeB, true ) ) {
  25269. // There is a mini-special case here, where `rangeB` is on other level than `rangeA`. That's why
  25270. // we need to transform `a` operation anyway.
  25271. rangeA.start = rangeA.start._getTransformedByMove( b.sourcePosition, b.targetPosition, b.howMany );
  25272. rangeA.end = rangeA.end._getTransformedByMove( b.sourcePosition, b.targetPosition, b.howMany );
  25273. return _makeMoveOperationsFromRanges( [ rangeA ], newTargetPosition );
  25274. }
  25275. //
  25276. // Special case #2 mirror.
  25277. //
  25278. const aTargetsToB = rangeB.containsPosition( a.targetPosition );
  25279. if ( aTargetsToB && rangeB.containsRange( rangeA, true ) ) {
  25280. // `a` operation is "moved together" with `b` operation.
  25281. // Here, just move `rangeA` "inside" `rangeB`.
  25282. rangeA.start = rangeA.start._getCombined( b.sourcePosition, b.getMovedRangeStart() );
  25283. rangeA.end = rangeA.end._getCombined( b.sourcePosition, b.getMovedRangeStart() );
  25284. return _makeMoveOperationsFromRanges( [ rangeA ], newTargetPosition );
  25285. }
  25286. //
  25287. // End of special case #2.
  25288. //
  25289. //
  25290. // Special case #3 + mirror.
  25291. //
  25292. // `rangeA` has a node which is an ancestor of `rangeB`. In other words, `rangeB` is inside `rangeA`
  25293. // but not on the same tree level. In such case ranges have common part but we have to treat it
  25294. // differently, because in such case those ranges are not really conflicting and should be treated like
  25295. // two separate ranges. Also we have to discard two difference parts.
  25296. const aCompB = Object(_ckeditor_ckeditor5_utils_src_comparearrays__WEBPACK_IMPORTED_MODULE_11__["default"])( a.sourcePosition.getParentPath(), b.sourcePosition.getParentPath() );
  25297. if ( aCompB == 'prefix' || aCompB == 'extension' ) {
  25298. // Transform `rangeA` by `b` operation and make operation out of it, and that's all.
  25299. // Note that this is a simplified version of default case, but here we treat the common part (whole `rangeA`)
  25300. // like a one difference part.
  25301. rangeA.start = rangeA.start._getTransformedByMove( b.sourcePosition, b.targetPosition, b.howMany );
  25302. rangeA.end = rangeA.end._getTransformedByMove( b.sourcePosition, b.targetPosition, b.howMany );
  25303. return _makeMoveOperationsFromRanges( [ rangeA ], newTargetPosition );
  25304. }
  25305. //
  25306. // End of special case #3.
  25307. //
  25308. //
  25309. // Default case - ranges are on the same level or are not connected with each other.
  25310. //
  25311. // Modifier for default case.
  25312. // Modifies `aIsStrong` flag in certain conditions.
  25313. //
  25314. // If only one of operations is a remove operation, we force remove operation to be the "stronger" one
  25315. // to provide more expected results.
  25316. if ( a.type == 'remove' && b.type != 'remove' && !context.aWasUndone && !context.forceWeakRemove ) {
  25317. aIsStrong = true;
  25318. } else if ( a.type != 'remove' && b.type == 'remove' && !context.bWasUndone && !context.forceWeakRemove ) {
  25319. aIsStrong = false;
  25320. }
  25321. // Handle operation's source ranges - check how `rangeA` is affected by `b` operation.
  25322. // This will aggregate transformed ranges.
  25323. const ranges = [];
  25324. // Get the "difference part" of `a` operation source range.
  25325. // This is an array with one or two ranges. Two ranges if `rangeB` is inside `rangeA`.
  25326. const difference = rangeA.getDifference( rangeB );
  25327. for ( const range of difference ) {
  25328. // Transform those ranges by `b` operation. For example if `b` moved range from before those ranges, fix those ranges.
  25329. range.start = range.start._getTransformedByDeletion( b.sourcePosition, b.howMany );
  25330. range.end = range.end._getTransformedByDeletion( b.sourcePosition, b.howMany );
  25331. // If `b` operation targets into `rangeA` on the same level, spread `rangeA` into two ranges.
  25332. const shouldSpread = Object(_ckeditor_ckeditor5_utils_src_comparearrays__WEBPACK_IMPORTED_MODULE_11__["default"])( range.start.getParentPath(), b.getMovedRangeStart().getParentPath() ) == 'same';
  25333. const newRanges = range._getTransformedByInsertion( b.getMovedRangeStart(), b.howMany, shouldSpread );
  25334. ranges.push( ...newRanges );
  25335. }
  25336. // Then, we have to manage the "common part" of both move ranges.
  25337. const common = rangeA.getIntersection( rangeB );
  25338. if ( common !== null && aIsStrong ) {
  25339. // Calculate the new position of that part of original range.
  25340. common.start = common.start._getCombined( b.sourcePosition, b.getMovedRangeStart() );
  25341. common.end = common.end._getCombined( b.sourcePosition, b.getMovedRangeStart() );
  25342. // Take care of proper range order.
  25343. //
  25344. // Put `common` at appropriate place. Keep in mind that we are interested in original order.
  25345. // Basically there are only three cases: there is zero, one or two difference ranges.
  25346. //
  25347. // If there is zero difference ranges, just push `common` in the array.
  25348. if ( ranges.length === 0 ) {
  25349. ranges.push( common );
  25350. }
  25351. // If there is one difference range, we need to check whether common part was before it or after it.
  25352. else if ( ranges.length == 1 ) {
  25353. if ( rangeB.start.isBefore( rangeA.start ) || rangeB.start.isEqual( rangeA.start ) ) {
  25354. ranges.unshift( common );
  25355. } else {
  25356. ranges.push( common );
  25357. }
  25358. }
  25359. // If there are more ranges (which means two), put common part between them. This is the only scenario
  25360. // where there could be two difference ranges so we don't have to make any comparisons.
  25361. else {
  25362. ranges.splice( 1, 0, common );
  25363. }
  25364. }
  25365. if ( ranges.length === 0 ) {
  25366. // If there are no "source ranges", nothing should be changed.
  25367. // Note that this can happen only if `aIsStrong == false` and `rangeA.isEqual( rangeB )`.
  25368. return [ new _nooperation__WEBPACK_IMPORTED_MODULE_8__["default"]( a.baseVersion ) ];
  25369. }
  25370. return _makeMoveOperationsFromRanges( ranges, newTargetPosition );
  25371. } );
  25372. setTransformation( _moveoperation__WEBPACK_IMPORTED_MODULE_4__["default"], _splitoperation__WEBPACK_IMPORTED_MODULE_7__["default"], ( a, b, context ) => {
  25373. let newTargetPosition = a.targetPosition.clone();
  25374. // Do not transform if target position is same as split insertion position and this split comes from undo.
  25375. // This should be done on relations but it is too much work for now as it would require relations working in collaboration.
  25376. // We need to make a decision how we will resolve such conflict and this is less harmful way.
  25377. if ( !a.targetPosition.isEqual( b.insertionPosition ) || !b.graveyardPosition || context.abRelation == 'moveTargetAfter' ) {
  25378. newTargetPosition = a.targetPosition._getTransformedBySplitOperation( b );
  25379. }
  25380. // Case 1:
  25381. //
  25382. // Last element in the moved range got split.
  25383. //
  25384. // In this case the default range transformation will not work correctly as the element created by
  25385. // split operation would be outside the range. The range to move needs to be fixed manually.
  25386. //
  25387. const moveRange = _range__WEBPACK_IMPORTED_MODULE_9__["default"]._createFromPositionAndShift( a.sourcePosition, a.howMany );
  25388. if ( moveRange.end.isEqual( b.insertionPosition ) ) {
  25389. // Do it only if this is a "natural" split, not a one that comes from undo.
  25390. // If this is undo split, only `targetPosition` needs to be changed (if the move is a remove).
  25391. if ( !b.graveyardPosition ) {
  25392. a.howMany++;
  25393. }
  25394. a.targetPosition = newTargetPosition;
  25395. return [ a ];
  25396. }
  25397. // Case 2:
  25398. //
  25399. // Split happened between the moved nodes. In this case two ranges to move need to be generated.
  25400. //
  25401. // Characters `ozba` are moved to the end of paragraph `Xyz` but split happened.
  25402. // <p>F[oz|ba]r</p><p>Xyz</p>
  25403. //
  25404. // After split:
  25405. // <p>F[oz</p><p>ba]r</p><p>Xyz</p>
  25406. //
  25407. // Correct ranges:
  25408. // <p>F[oz]</p><p>[ba]r</p><p>Xyz</p>
  25409. //
  25410. // After move:
  25411. // <p>F</p><p>r</p><p>Xyzozba</p>
  25412. //
  25413. if ( moveRange.start.hasSameParentAs( b.splitPosition ) && moveRange.containsPosition( b.splitPosition ) ) {
  25414. let rightRange = new _range__WEBPACK_IMPORTED_MODULE_9__["default"]( b.splitPosition, moveRange.end );
  25415. rightRange = rightRange._getTransformedBySplitOperation( b );
  25416. const ranges = [
  25417. new _range__WEBPACK_IMPORTED_MODULE_9__["default"]( moveRange.start, b.splitPosition ),
  25418. rightRange
  25419. ];
  25420. return _makeMoveOperationsFromRanges( ranges, newTargetPosition );
  25421. }
  25422. // Case 3:
  25423. //
  25424. // Move operation targets at the split position. We need to decide if the nodes should be inserted
  25425. // at the end of the split element or at the beginning of the new element.
  25426. //
  25427. if ( a.targetPosition.isEqual( b.splitPosition ) && context.abRelation == 'insertAtSource' ) {
  25428. newTargetPosition = b.moveTargetPosition;
  25429. }
  25430. // Case 4:
  25431. //
  25432. // Move operation targets just after the split element. We need to decide if the nodes should be inserted
  25433. // between two parts of split element, or after the new element.
  25434. //
  25435. // Split at `|`, while move operation moves `<p>Xyz</p>` and targets at `^`:
  25436. // <p>Foo|bar</p>^<p>baz</p>
  25437. // <p>Foo</p>^<p>bar</p><p>baz</p> or <p>Foo</p><p>bar</p>^<p>baz</p>?
  25438. //
  25439. // If there is no contextual information between operations (for example, they come from collaborative
  25440. // editing), we don't want to put some unrelated content (move) between parts of related content (split parts).
  25441. // However, if the split is from undo, in the past, the moved content might be targeting between the
  25442. // split parts, meaning that was exactly user's intention:
  25443. //
  25444. // <p>Foo</p>^<p>bar</p> <--- original situation, in "past".
  25445. // <p>Foobar</p>^ <--- after merge target position is transformed.
  25446. // <p>Foo|bar</p>^ <--- then the merge is undone, and split happens, which leads us to current situation.
  25447. //
  25448. // In this case it is pretty clear that the intention was to put new paragraph between those nodes,
  25449. // so we need to transform accordingly. We can detect this scenario thanks to relations.
  25450. //
  25451. if ( a.targetPosition.isEqual( b.insertionPosition ) && context.abRelation == 'insertBetween' ) {
  25452. newTargetPosition = a.targetPosition;
  25453. }
  25454. // The default case.
  25455. //
  25456. const transformed = moveRange._getTransformedBySplitOperation( b );
  25457. const ranges = [ transformed ];
  25458. // Case 5:
  25459. //
  25460. // Moved range contains graveyard element used by split operation. Add extra move operation to the result.
  25461. //
  25462. if ( b.graveyardPosition ) {
  25463. const movesGraveyardElement = moveRange.start.isEqual( b.graveyardPosition ) || moveRange.containsPosition( b.graveyardPosition );
  25464. if ( a.howMany > 1 && movesGraveyardElement && !context.aWasUndone ) {
  25465. ranges.push( _range__WEBPACK_IMPORTED_MODULE_9__["default"]._createFromPositionAndShift( b.insertionPosition, 1 ) );
  25466. }
  25467. }
  25468. return _makeMoveOperationsFromRanges( ranges, newTargetPosition );
  25469. } );
  25470. setTransformation( _moveoperation__WEBPACK_IMPORTED_MODULE_4__["default"], _mergeoperation__WEBPACK_IMPORTED_MODULE_6__["default"], ( a, b, context ) => {
  25471. const movedRange = _range__WEBPACK_IMPORTED_MODULE_9__["default"]._createFromPositionAndShift( a.sourcePosition, a.howMany );
  25472. if ( b.deletionPosition.hasSameParentAs( a.sourcePosition ) && movedRange.containsPosition( b.sourcePosition ) ) {
  25473. if ( a.type == 'remove' && !context.forceWeakRemove ) {
  25474. // Case 1:
  25475. //
  25476. // The element to remove got merged.
  25477. //
  25478. // Merge operation does support merging elements which are not siblings. So it would not be a problem
  25479. // from technical point of view. However, if the element was removed, the intention of the user
  25480. // deleting it was to have it all deleted. From user experience point of view, moving back the
  25481. // removed nodes might be unexpected. This means that in this scenario we will reverse merging and remove the element.
  25482. //
  25483. if ( !context.aWasUndone ) {
  25484. const results = [];
  25485. let gyMoveSource = b.graveyardPosition.clone();
  25486. let splitNodesMoveSource = b.targetPosition._getTransformedByMergeOperation( b );
  25487. if ( a.howMany > 1 ) {
  25488. results.push( new _moveoperation__WEBPACK_IMPORTED_MODULE_4__["default"]( a.sourcePosition, a.howMany - 1, a.targetPosition, 0 ) );
  25489. gyMoveSource = gyMoveSource._getTransformedByMove( a.sourcePosition, a.targetPosition, a.howMany - 1 );
  25490. splitNodesMoveSource = splitNodesMoveSource._getTransformedByMove( a.sourcePosition, a.targetPosition, a.howMany - 1 );
  25491. }
  25492. const gyMoveTarget = b.deletionPosition._getCombined( a.sourcePosition, a.targetPosition );
  25493. const gyMove = new _moveoperation__WEBPACK_IMPORTED_MODULE_4__["default"]( gyMoveSource, 1, gyMoveTarget, 0 );
  25494. const splitNodesMoveTargetPath = gyMove.getMovedRangeStart().path.slice();
  25495. splitNodesMoveTargetPath.push( 0 );
  25496. const splitNodesMoveTarget = new _position__WEBPACK_IMPORTED_MODULE_10__["default"]( gyMove.targetPosition.root, splitNodesMoveTargetPath );
  25497. splitNodesMoveSource = splitNodesMoveSource._getTransformedByMove( gyMoveSource, gyMoveTarget, 1 );
  25498. const splitNodesMove = new _moveoperation__WEBPACK_IMPORTED_MODULE_4__["default"]( splitNodesMoveSource, b.howMany, splitNodesMoveTarget, 0 );
  25499. results.push( gyMove );
  25500. results.push( splitNodesMove );
  25501. return results;
  25502. }
  25503. } else {
  25504. // Case 2:
  25505. //
  25506. // The element to move got merged and it was the only element to move.
  25507. // In this case just don't do anything, leave the node in the graveyard. Without special case
  25508. // it would be a move operation that moves 0 nodes, so maybe it is better just to return no-op.
  25509. //
  25510. if ( a.howMany == 1 ) {
  25511. if ( !context.bWasUndone ) {
  25512. return [ new _nooperation__WEBPACK_IMPORTED_MODULE_8__["default"]( 0 ) ];
  25513. } else {
  25514. a.sourcePosition = b.graveyardPosition.clone();
  25515. a.targetPosition = a.targetPosition._getTransformedByMergeOperation( b );
  25516. return [ a ];
  25517. }
  25518. }
  25519. }
  25520. }
  25521. // The default case.
  25522. //
  25523. const moveRange = _range__WEBPACK_IMPORTED_MODULE_9__["default"]._createFromPositionAndShift( a.sourcePosition, a.howMany );
  25524. const transformed = moveRange._getTransformedByMergeOperation( b );
  25525. a.sourcePosition = transformed.start;
  25526. a.howMany = transformed.end.offset - transformed.start.offset;
  25527. a.targetPosition = a.targetPosition._getTransformedByMergeOperation( b );
  25528. return [ a ];
  25529. } );
  25530. // -----------------------
  25531. setTransformation( _renameoperation__WEBPACK_IMPORTED_MODULE_2__["default"], _insertoperation__WEBPACK_IMPORTED_MODULE_0__["default"], ( a, b ) => {
  25532. a.position = a.position._getTransformedByInsertOperation( b );
  25533. return [ a ];
  25534. } );
  25535. setTransformation( _renameoperation__WEBPACK_IMPORTED_MODULE_2__["default"], _mergeoperation__WEBPACK_IMPORTED_MODULE_6__["default"], ( a, b ) => {
  25536. // Case 1:
  25537. //
  25538. // Element to rename got merged, so it was moved to `b.graveyardPosition`.
  25539. //
  25540. if ( a.position.isEqual( b.deletionPosition ) ) {
  25541. a.position = b.graveyardPosition.clone();
  25542. a.position.stickiness = 'toNext';
  25543. return [ a ];
  25544. }
  25545. a.position = a.position._getTransformedByMergeOperation( b );
  25546. return [ a ];
  25547. } );
  25548. setTransformation( _renameoperation__WEBPACK_IMPORTED_MODULE_2__["default"], _moveoperation__WEBPACK_IMPORTED_MODULE_4__["default"], ( a, b ) => {
  25549. a.position = a.position._getTransformedByMoveOperation( b );
  25550. return [ a ];
  25551. } );
  25552. setTransformation( _renameoperation__WEBPACK_IMPORTED_MODULE_2__["default"], _renameoperation__WEBPACK_IMPORTED_MODULE_2__["default"], ( a, b, context ) => {
  25553. if ( a.position.isEqual( b.position ) ) {
  25554. if ( context.aIsStrong ) {
  25555. a.oldName = b.newName;
  25556. } else {
  25557. return [ new _nooperation__WEBPACK_IMPORTED_MODULE_8__["default"]( 0 ) ];
  25558. }
  25559. }
  25560. return [ a ];
  25561. } );
  25562. setTransformation( _renameoperation__WEBPACK_IMPORTED_MODULE_2__["default"], _splitoperation__WEBPACK_IMPORTED_MODULE_7__["default"], ( a, b ) => {
  25563. // Case 1:
  25564. //
  25565. // The element to rename has been split. In this case, the new element should be also renamed.
  25566. //
  25567. // User decides to change the paragraph to a list item:
  25568. // <paragraph>Foobar</paragraph>
  25569. //
  25570. // However, in meantime, split happens:
  25571. // <paragraph>Foo</paragraph><paragraph>bar</paragraph>
  25572. //
  25573. // As a result, rename both elements:
  25574. // <listItem>Foo</listItem><listItem>bar</listItem>
  25575. //
  25576. const renamePath = a.position.path;
  25577. const splitPath = b.splitPosition.getParentPath();
  25578. if ( Object(_ckeditor_ckeditor5_utils_src_comparearrays__WEBPACK_IMPORTED_MODULE_11__["default"])( renamePath, splitPath ) == 'same' && !b.graveyardPosition ) {
  25579. const extraRename = new _renameoperation__WEBPACK_IMPORTED_MODULE_2__["default"]( a.position.getShiftedBy( 1 ), a.oldName, a.newName, 0 );
  25580. return [ a, extraRename ];
  25581. }
  25582. // The default case.
  25583. //
  25584. a.position = a.position._getTransformedBySplitOperation( b );
  25585. return [ a ];
  25586. } );
  25587. // -----------------------
  25588. setTransformation( _rootattributeoperation__WEBPACK_IMPORTED_MODULE_5__["default"], _rootattributeoperation__WEBPACK_IMPORTED_MODULE_5__["default"], ( a, b, context ) => {
  25589. if ( a.root === b.root && a.key === b.key ) {
  25590. if ( !context.aIsStrong || a.newValue === b.newValue ) {
  25591. return [ new _nooperation__WEBPACK_IMPORTED_MODULE_8__["default"]( 0 ) ];
  25592. } else {
  25593. a.oldValue = b.newValue;
  25594. }
  25595. }
  25596. return [ a ];
  25597. } );
  25598. // -----------------------
  25599. setTransformation( _splitoperation__WEBPACK_IMPORTED_MODULE_7__["default"], _insertoperation__WEBPACK_IMPORTED_MODULE_0__["default"], ( a, b ) => {
  25600. // The default case.
  25601. //
  25602. if ( a.splitPosition.hasSameParentAs( b.position ) && a.splitPosition.offset < b.position.offset ) {
  25603. a.howMany += b.howMany;
  25604. }
  25605. a.splitPosition = a.splitPosition._getTransformedByInsertOperation( b );
  25606. a.insertionPosition = a.insertionPosition._getTransformedByInsertOperation( b );
  25607. return [ a ];
  25608. } );
  25609. setTransformation( _splitoperation__WEBPACK_IMPORTED_MODULE_7__["default"], _mergeoperation__WEBPACK_IMPORTED_MODULE_6__["default"], ( a, b, context ) => {
  25610. // Case 1:
  25611. //
  25612. // Split element got merged. If two different elements were merged, clients will have different content.
  25613. //
  25614. // Example. Merge at `{}`, split at `[]`:
  25615. // <heading>Foo</heading>{}<paragraph>B[]ar</paragraph>
  25616. //
  25617. // On merge side it will look like this:
  25618. // <heading>FooB[]ar</heading>
  25619. // <heading>FooB</heading><heading>ar</heading>
  25620. //
  25621. // On split side it will look like this:
  25622. // <heading>Foo</heading>{}<paragraph>B</paragraph><paragraph>ar</paragraph>
  25623. // <heading>FooB</heading><paragraph>ar</paragraph>
  25624. //
  25625. // Clearly, the second element is different for both clients.
  25626. //
  25627. // We could use the removed merge element from graveyard as a split element but then clients would have a different
  25628. // model state (in graveyard), because the split side client would still have an element in graveyard (removed by merge).
  25629. //
  25630. // To overcome this, in `SplitOperation` x `MergeOperation` transformation we will add additional `SplitOperation`
  25631. // in the graveyard, which will actually clone the merged-and-deleted element. Then, that cloned element will be
  25632. // used for splitting. Example below.
  25633. //
  25634. // Original state:
  25635. // <heading>Foo</heading>{}<paragraph>B[]ar</paragraph>
  25636. //
  25637. // Merge side client:
  25638. //
  25639. // After merge:
  25640. // <heading>FooB[]ar</heading> graveyard: <paragraph></paragraph>
  25641. //
  25642. // Extra split:
  25643. // <heading>FooB[]ar</heading> graveyard: <paragraph></paragraph><paragraph></paragraph>
  25644. //
  25645. // Use the "cloned" element from graveyard:
  25646. // <heading>FooB</heading><paragraph>ar</paragraph> graveyard: <paragraph></paragraph>
  25647. //
  25648. // Split side client:
  25649. //
  25650. // After split:
  25651. // <heading>Foo</heading>{}<paragraph>B</paragraph><paragraph>ar</paragraph>
  25652. //
  25653. // After merge:
  25654. // <heading>FooB</heading><paragraph>ar</paragraph> graveyard: <paragraph></paragraph>
  25655. //
  25656. // This special case scenario only applies if the original split operation clones the split element.
  25657. // If the original split operation has `graveyardPosition` set, it all doesn't have sense because split operation
  25658. // knows exactly which element it should use. So there would be no original problem with different contents.
  25659. //
  25660. // Additionally, the special case applies only if the merge wasn't already undone.
  25661. //
  25662. if ( !a.graveyardPosition && !context.bWasUndone && a.splitPosition.hasSameParentAs( b.sourcePosition ) ) {
  25663. const splitPath = b.graveyardPosition.path.slice();
  25664. splitPath.push( 0 );
  25665. const splitPosition = new _position__WEBPACK_IMPORTED_MODULE_10__["default"]( b.graveyardPosition.root, splitPath );
  25666. const insertionPosition = _splitoperation__WEBPACK_IMPORTED_MODULE_7__["default"].getInsertionPosition( new _position__WEBPACK_IMPORTED_MODULE_10__["default"]( b.graveyardPosition.root, splitPath ) );
  25667. const additionalSplit = new _splitoperation__WEBPACK_IMPORTED_MODULE_7__["default"]( splitPosition, 0, insertionPosition, null, 0 );
  25668. a.splitPosition = a.splitPosition._getTransformedByMergeOperation( b );
  25669. a.insertionPosition = _splitoperation__WEBPACK_IMPORTED_MODULE_7__["default"].getInsertionPosition( a.splitPosition );
  25670. a.graveyardPosition = additionalSplit.insertionPosition.clone();
  25671. a.graveyardPosition.stickiness = 'toNext';
  25672. return [ additionalSplit, a ];
  25673. }
  25674. // The default case.
  25675. //
  25676. if ( a.splitPosition.hasSameParentAs( b.deletionPosition ) && !a.splitPosition.isAfter( b.deletionPosition ) ) {
  25677. a.howMany--;
  25678. }
  25679. if ( a.splitPosition.hasSameParentAs( b.targetPosition ) ) {
  25680. a.howMany += b.howMany;
  25681. }
  25682. a.splitPosition = a.splitPosition._getTransformedByMergeOperation( b );
  25683. a.insertionPosition = _splitoperation__WEBPACK_IMPORTED_MODULE_7__["default"].getInsertionPosition( a.splitPosition );
  25684. if ( a.graveyardPosition ) {
  25685. a.graveyardPosition = a.graveyardPosition._getTransformedByMergeOperation( b );
  25686. }
  25687. return [ a ];
  25688. } );
  25689. setTransformation( _splitoperation__WEBPACK_IMPORTED_MODULE_7__["default"], _moveoperation__WEBPACK_IMPORTED_MODULE_4__["default"], ( a, b, context ) => {
  25690. const rangeToMove = _range__WEBPACK_IMPORTED_MODULE_9__["default"]._createFromPositionAndShift( b.sourcePosition, b.howMany );
  25691. if ( a.graveyardPosition ) {
  25692. // Case 1:
  25693. //
  25694. // Split operation graveyard node was moved. In this case move operation is stronger. Since graveyard element
  25695. // is already moved to the correct position, we need to only move the nodes after the split position.
  25696. // This will be done by `MoveOperation` instead of `SplitOperation`.
  25697. //
  25698. const gyElementMoved = rangeToMove.start.isEqual( a.graveyardPosition ) || rangeToMove.containsPosition( a.graveyardPosition );
  25699. if ( !context.bWasUndone && gyElementMoved ) {
  25700. const sourcePosition = a.splitPosition._getTransformedByMoveOperation( b );
  25701. const newParentPosition = a.graveyardPosition._getTransformedByMoveOperation( b );
  25702. const newTargetPath = newParentPosition.path.slice();
  25703. newTargetPath.push( 0 );
  25704. const newTargetPosition = new _position__WEBPACK_IMPORTED_MODULE_10__["default"]( newParentPosition.root, newTargetPath );
  25705. const moveOp = new _moveoperation__WEBPACK_IMPORTED_MODULE_4__["default"]( sourcePosition, a.howMany, newTargetPosition, 0 );
  25706. return [ moveOp ];
  25707. }
  25708. a.graveyardPosition = a.graveyardPosition._getTransformedByMoveOperation( b );
  25709. }
  25710. // Case 2:
  25711. //
  25712. // Split is at a position where nodes were moved.
  25713. //
  25714. // This is a scenario described in `MoveOperation` x `SplitOperation` transformation but from the
  25715. // "split operation point of view".
  25716. //
  25717. const splitAtTarget = a.splitPosition.isEqual( b.targetPosition );
  25718. if ( splitAtTarget && ( context.baRelation == 'insertAtSource' || context.abRelation == 'splitBefore' ) ) {
  25719. a.howMany += b.howMany;
  25720. a.splitPosition = a.splitPosition._getTransformedByDeletion( b.sourcePosition, b.howMany );
  25721. a.insertionPosition = _splitoperation__WEBPACK_IMPORTED_MODULE_7__["default"].getInsertionPosition( a.splitPosition );
  25722. return [ a ];
  25723. }
  25724. if ( splitAtTarget && context.abRelation && context.abRelation.howMany ) {
  25725. const { howMany, offset } = context.abRelation;
  25726. a.howMany += howMany;
  25727. a.splitPosition = a.splitPosition.getShiftedBy( offset );
  25728. return [ a ];
  25729. }
  25730. // Case 3:
  25731. //
  25732. // If the split position is inside the moved range, we need to shift the split position to a proper place.
  25733. // The position cannot be moved together with moved range because that would result in splitting of an incorrect element.
  25734. //
  25735. // Characters `bc` should be moved to the second paragraph while split position is between them:
  25736. // <paragraph>A[b|c]d</paragraph><paragraph>Xyz</paragraph>
  25737. //
  25738. // After move, new split position is incorrect:
  25739. // <paragraph>Ad</paragraph><paragraph>Xb|cyz</paragraph>
  25740. //
  25741. // Correct split position:
  25742. // <paragraph>A|d</paragraph><paragraph>Xbcyz</paragraph>
  25743. //
  25744. // After split:
  25745. // <paragraph>A</paragraph><paragraph>d</paragraph><paragraph>Xbcyz</paragraph>
  25746. //
  25747. if ( a.splitPosition.hasSameParentAs( b.sourcePosition ) && rangeToMove.containsPosition( a.splitPosition ) ) {
  25748. const howManyRemoved = b.howMany - ( a.splitPosition.offset - b.sourcePosition.offset );
  25749. a.howMany -= howManyRemoved;
  25750. if ( a.splitPosition.hasSameParentAs( b.targetPosition ) && a.splitPosition.offset < b.targetPosition.offset ) {
  25751. a.howMany += b.howMany;
  25752. }
  25753. a.splitPosition = b.sourcePosition.clone();
  25754. a.insertionPosition = _splitoperation__WEBPACK_IMPORTED_MODULE_7__["default"].getInsertionPosition( a.splitPosition );
  25755. return [ a ];
  25756. }
  25757. // The default case.
  25758. // Don't change `howMany` if move operation does not really move anything.
  25759. //
  25760. if ( !b.sourcePosition.isEqual( b.targetPosition ) ) {
  25761. if ( a.splitPosition.hasSameParentAs( b.sourcePosition ) && a.splitPosition.offset <= b.sourcePosition.offset ) {
  25762. a.howMany -= b.howMany;
  25763. }
  25764. if ( a.splitPosition.hasSameParentAs( b.targetPosition ) && a.splitPosition.offset < b.targetPosition.offset ) {
  25765. a.howMany += b.howMany;
  25766. }
  25767. }
  25768. // Change position stickiness to force a correct transformation.
  25769. a.splitPosition.stickiness = 'toNone';
  25770. a.splitPosition = a.splitPosition._getTransformedByMoveOperation( b );
  25771. a.splitPosition.stickiness = 'toNext';
  25772. if ( a.graveyardPosition ) {
  25773. a.insertionPosition = a.insertionPosition._getTransformedByMoveOperation( b );
  25774. } else {
  25775. a.insertionPosition = _splitoperation__WEBPACK_IMPORTED_MODULE_7__["default"].getInsertionPosition( a.splitPosition );
  25776. }
  25777. return [ a ];
  25778. } );
  25779. setTransformation( _splitoperation__WEBPACK_IMPORTED_MODULE_7__["default"], _splitoperation__WEBPACK_IMPORTED_MODULE_7__["default"], ( a, b, context ) => {
  25780. // Case 1:
  25781. //
  25782. // Split at the same position.
  25783. //
  25784. // If there already was a split at the same position as in `a` operation, it means that the intention
  25785. // conveyed by `a` operation has already been fulfilled and `a` should not do anything (to avoid double split).
  25786. //
  25787. // However, there is a difference if these are new splits or splits created by undo. These have different
  25788. // intentions. Also splits moving back different elements from graveyard have different intentions. They
  25789. // are just different operations.
  25790. //
  25791. // So we cancel split operation only if it was really identical.
  25792. //
  25793. // Also, there is additional case, where split operations aren't identical and should not be cancelled, however the
  25794. // default transformation is incorrect too.
  25795. //
  25796. if ( a.splitPosition.isEqual( b.splitPosition ) ) {
  25797. if ( !a.graveyardPosition && !b.graveyardPosition ) {
  25798. return [ new _nooperation__WEBPACK_IMPORTED_MODULE_8__["default"]( 0 ) ];
  25799. }
  25800. if ( a.graveyardPosition && b.graveyardPosition && a.graveyardPosition.isEqual( b.graveyardPosition ) ) {
  25801. return [ new _nooperation__WEBPACK_IMPORTED_MODULE_8__["default"]( 0 ) ];
  25802. }
  25803. // Use context to know that the `a.splitPosition` should stay where it is.
  25804. // This happens during undo when first a merge operation moved nodes to `a.splitPosition` and now `b` operation undoes that merge.
  25805. if ( context.abRelation == 'splitBefore' ) {
  25806. // Since split is at the same position, there are no nodes left to split.
  25807. a.howMany = 0;
  25808. // Note: there was `if ( a.graveyardPosition )` here but it was uncovered in tests and I couldn't find any scenarios for now.
  25809. // That would have to be a `SplitOperation` that didn't come from undo but is transformed by operations that were undone.
  25810. // It could happen if `context` is enabled in collaboration.
  25811. a.graveyardPosition = a.graveyardPosition._getTransformedBySplitOperation( b );
  25812. return [ a ];
  25813. }
  25814. }
  25815. // Case 2:
  25816. //
  25817. // Same node is using to split different elements. This happens in undo when previously same element was merged to
  25818. // two different elements. This is described in `MergeOperation` x `MergeOperation` transformation.
  25819. //
  25820. // In this case we will follow the same logic. We will assume that `insertionPosition` is same for both
  25821. // split operations. This might not always be true but in the real cases that were experienced it was. After all,
  25822. // if these splits are reverses of merge operations that were merging the same element, then the `insertionPosition`
  25823. // should be same for both of those splits.
  25824. //
  25825. // Again, we will decide which operation is stronger by checking if split happens in graveyard or in non-graveyard root.
  25826. //
  25827. if ( a.graveyardPosition && b.graveyardPosition && a.graveyardPosition.isEqual( b.graveyardPosition ) ) {
  25828. const aInGraveyard = a.splitPosition.root.rootName == '$graveyard';
  25829. const bInGraveyard = b.splitPosition.root.rootName == '$graveyard';
  25830. // If `aIsWeak` it means that `a` points to graveyard while `b` doesn't. Don't move nodes then.
  25831. const aIsWeak = aInGraveyard && !bInGraveyard;
  25832. // If `bIsWeak` it means that `b` points to graveyard while `a` doesn't. Force moving nodes then.
  25833. const bIsWeak = bInGraveyard && !aInGraveyard;
  25834. // Force move if `b` is weak or neither operation is weak but `a` is stronger through `context.aIsStrong`.
  25835. const forceMove = bIsWeak || ( !aIsWeak && context.aIsStrong );
  25836. if ( forceMove ) {
  25837. const result = [];
  25838. // First we need to move any nodes split by `b` back to where they were.
  25839. // Do it only if `b` actually moved something.
  25840. if ( b.howMany ) {
  25841. result.push( new _moveoperation__WEBPACK_IMPORTED_MODULE_4__["default"]( b.moveTargetPosition, b.howMany, b.splitPosition, 0 ) );
  25842. }
  25843. // Then we need to move nodes from `a` split position to their new element.
  25844. // Do it only if `a` actually should move something.
  25845. if ( a.howMany ) {
  25846. result.push( new _moveoperation__WEBPACK_IMPORTED_MODULE_4__["default"]( a.splitPosition, a.howMany, a.moveTargetPosition, 0 ) );
  25847. }
  25848. return result;
  25849. } else {
  25850. return [ new _nooperation__WEBPACK_IMPORTED_MODULE_8__["default"]( 0 ) ];
  25851. }
  25852. }
  25853. if ( a.graveyardPosition ) {
  25854. a.graveyardPosition = a.graveyardPosition._getTransformedBySplitOperation( b );
  25855. }
  25856. // Case 3:
  25857. //
  25858. // Position where operation `b` inserted a new node after split is the same as the operation `a` split position.
  25859. // As in similar cases, there is ambiguity if the split should be before the new node (created by `b`) or after.
  25860. //
  25861. if ( a.splitPosition.isEqual( b.insertionPosition ) && context.abRelation == 'splitBefore' ) {
  25862. a.howMany++;
  25863. return [ a ];
  25864. }
  25865. // Case 4:
  25866. //
  25867. // This is a mirror to the case 2. above.
  25868. //
  25869. if ( b.splitPosition.isEqual( a.insertionPosition ) && context.baRelation == 'splitBefore' ) {
  25870. const newPositionPath = b.insertionPosition.path.slice();
  25871. newPositionPath.push( 0 );
  25872. const newPosition = new _position__WEBPACK_IMPORTED_MODULE_10__["default"]( b.insertionPosition.root, newPositionPath );
  25873. const moveOp = new _moveoperation__WEBPACK_IMPORTED_MODULE_4__["default"]( a.insertionPosition, 1, newPosition, 0 );
  25874. return [ a, moveOp ];
  25875. }
  25876. // The default case.
  25877. //
  25878. if ( a.splitPosition.hasSameParentAs( b.splitPosition ) && a.splitPosition.offset < b.splitPosition.offset ) {
  25879. a.howMany -= b.howMany;
  25880. }
  25881. a.splitPosition = a.splitPosition._getTransformedBySplitOperation( b );
  25882. a.insertionPosition = _splitoperation__WEBPACK_IMPORTED_MODULE_7__["default"].getInsertionPosition( a.splitPosition );
  25883. return [ a ];
  25884. } );
  25885. // Checks whether `MoveOperation` `targetPosition` is inside a node from the moved range of the other `MoveOperation`.
  25886. //
  25887. // @private
  25888. // @param {module:engine/model/operation/moveoperation~MoveOperation} a
  25889. // @param {module:engine/model/operation/moveoperation~MoveOperation} b
  25890. // @returns {Boolean}
  25891. function _moveTargetIntoMovedRange( a, b ) {
  25892. return a.targetPosition._getTransformedByDeletion( b.sourcePosition, b.howMany ) === null;
  25893. }
  25894. // Helper function for `MoveOperation` x `MoveOperation` transformation. Converts given ranges and target position to
  25895. // move operations and returns them.
  25896. //
  25897. // Ranges and target position will be transformed on-the-fly when generating operations.
  25898. //
  25899. // Given `ranges` should be in the order of how they were in the original transformed operation.
  25900. //
  25901. // Given `targetPosition` is the target position of the first range from `ranges`.
  25902. //
  25903. // @private
  25904. // @param {Array.<module:engine/model/range~Range>} ranges
  25905. // @param {module:engine/model/position~Position} targetPosition
  25906. // @returns {Array.<module:engine/model/operation/moveoperation~MoveOperation>}
  25907. function _makeMoveOperationsFromRanges( ranges, targetPosition ) {
  25908. // At this moment we have some ranges and a target position, to which those ranges should be moved.
  25909. // Order in `ranges` array is the go-to order of after transformation.
  25910. //
  25911. // We are almost done. We have `ranges` and `targetPosition` to make operations from.
  25912. // Unfortunately, those operations may affect each other. Precisely, first operation after move
  25913. // may affect source range and target position of second and third operation. Same with second
  25914. // operation affecting third.
  25915. //
  25916. // We need to fix those source ranges and target positions once again, before converting `ranges` to operations.
  25917. const operations = [];
  25918. // Keep in mind that nothing will be transformed if there is just one range in `ranges`.
  25919. for ( let i = 0; i < ranges.length; i++ ) {
  25920. // Create new operation out of a range and target position.
  25921. const range = ranges[ i ];
  25922. const op = new _moveoperation__WEBPACK_IMPORTED_MODULE_4__["default"](
  25923. range.start,
  25924. range.end.offset - range.start.offset,
  25925. targetPosition,
  25926. 0
  25927. );
  25928. operations.push( op );
  25929. // Transform other ranges by the generated operation.
  25930. for ( let j = i + 1; j < ranges.length; j++ ) {
  25931. // All ranges in `ranges` array should be:
  25932. //
  25933. // * non-intersecting (these are part of original operation source range), and
  25934. // * `targetPosition` does not target into them (opposite would mean that transformed operation targets "inside itself").
  25935. //
  25936. // This means that the transformation will be "clean" and always return one result.
  25937. ranges[ j ] = ranges[ j ]._getTransformedByMove( op.sourcePosition, op.targetPosition, op.howMany )[ 0 ];
  25938. }
  25939. targetPosition = targetPosition._getTransformedByMove( op.sourcePosition, op.targetPosition, op.howMany );
  25940. }
  25941. return operations;
  25942. }
  25943. /***/ }),
  25944. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/utils.js":
  25945. /*!******************************************************************************!*\
  25946. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/utils.js ***!
  25947. \******************************************************************************/
  25948. /*! exports provided: _insert, _remove, _move, _setAttribute, _normalizeNodes */
  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__, "_insert", function() { return _insert; });
  25953. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_remove", function() { return _remove; });
  25954. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_move", function() { return _move; });
  25955. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_setAttribute", function() { return _setAttribute; });
  25956. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_normalizeNodes", function() { return _normalizeNodes; });
  25957. /* harmony import */ var _node__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../node */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/node.js");
  25958. /* harmony import */ var _text__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../text */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/text.js");
  25959. /* harmony import */ var _textproxy__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../textproxy */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/textproxy.js");
  25960. /* harmony import */ var _range__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../range */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/range.js");
  25961. /* harmony import */ var _documentfragment__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../documentfragment */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/documentfragment.js");
  25962. /* harmony import */ var _nodelist__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../nodelist */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/nodelist.js");
  25963. /* 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");
  25964. /**
  25965. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  25966. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  25967. */
  25968. /**
  25969. * @module engine/model/operation/utils
  25970. */
  25971. /**
  25972. * Contains functions used for composing model tree by {@link module:engine/model/operation/operation~Operation operations}.
  25973. * Those functions are built on top of {@link module:engine/model/node~Node node}, and it's child classes', APIs.
  25974. *
  25975. * @protected
  25976. * @namespace utils
  25977. */
  25978. /**
  25979. * Inserts given nodes at given position.
  25980. *
  25981. * @protected
  25982. * @function module:engine/model/operation/utils~utils.insert
  25983. * @param {module:engine/model/position~Position} position Position at which nodes should be inserted.
  25984. * @param {module:engine/model/node~NodeSet} nodes Nodes to insert.
  25985. * @returns {module:engine/model/range~Range} Range spanning over inserted elements.
  25986. */
  25987. function _insert( position, nodes ) {
  25988. nodes = _normalizeNodes( nodes );
  25989. // We have to count offset before inserting nodes because they can get merged and we would get wrong offsets.
  25990. const offset = nodes.reduce( ( sum, node ) => sum + node.offsetSize, 0 );
  25991. const parent = position.parent;
  25992. // Insertion might be in a text node, we should split it if that's the case.
  25993. _splitNodeAtPosition( position );
  25994. const index = position.index;
  25995. // Insert nodes at given index. After splitting we have a proper index and insertion is between nodes,
  25996. // using basic `Element` API.
  25997. parent._insertChild( index, nodes );
  25998. // Merge text nodes, if possible. Merging is needed only at points where inserted nodes "touch" "old" nodes.
  25999. _mergeNodesAtIndex( parent, index + nodes.length );
  26000. _mergeNodesAtIndex( parent, index );
  26001. return new _range__WEBPACK_IMPORTED_MODULE_3__["default"]( position, position.getShiftedBy( offset ) );
  26002. }
  26003. /**
  26004. * Removed nodes in given range. Only {@link module:engine/model/range~Range#isFlat flat} ranges are accepted.
  26005. *
  26006. * @protected
  26007. * @function module:engine/model/operation/utils~utils._remove
  26008. * @param {module:engine/model/range~Range} range Range containing nodes to remove.
  26009. * @returns {Array.<module:engine/model/node~Node>}
  26010. */
  26011. function _remove( range ) {
  26012. if ( !range.isFlat ) {
  26013. /**
  26014. * Trying to remove a range which starts and ends in different element.
  26015. *
  26016. * @error operation-utils-remove-range-not-flat
  26017. */
  26018. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_6__["default"](
  26019. 'operation-utils-remove-range-not-flat',
  26020. this
  26021. );
  26022. }
  26023. const parent = range.start.parent;
  26024. // Range may be inside text nodes, we have to split them if that's the case.
  26025. _splitNodeAtPosition( range.start );
  26026. _splitNodeAtPosition( range.end );
  26027. // Remove the text nodes using basic `Element` API.
  26028. const removed = parent._removeChildren( range.start.index, range.end.index - range.start.index );
  26029. // Merge text nodes, if possible. After some nodes were removed, node before and after removed range will be
  26030. // touching at the position equal to the removed range beginning. We check merging possibility there.
  26031. _mergeNodesAtIndex( parent, range.start.index );
  26032. return removed;
  26033. }
  26034. /**
  26035. * Moves nodes in given range to given target position. Only {@link module:engine/model/range~Range#isFlat flat} ranges are accepted.
  26036. *
  26037. * @protected
  26038. * @function module:engine/model/operation/utils~utils.move
  26039. * @param {module:engine/model/range~Range} sourceRange Range containing nodes to move.
  26040. * @param {module:engine/model/position~Position} targetPosition Position to which nodes should be moved.
  26041. * @returns {module:engine/model/range~Range} Range containing moved nodes.
  26042. */
  26043. function _move( sourceRange, targetPosition ) {
  26044. if ( !sourceRange.isFlat ) {
  26045. /**
  26046. * Trying to move a range which starts and ends in different element.
  26047. *
  26048. * @error operation-utils-move-range-not-flat
  26049. */
  26050. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_6__["default"](
  26051. 'operation-utils-move-range-not-flat',
  26052. this
  26053. );
  26054. }
  26055. const nodes = _remove( sourceRange );
  26056. // We have to fix `targetPosition` because model changed after nodes from `sourceRange` got removed and
  26057. // that change might have an impact on `targetPosition`.
  26058. targetPosition = targetPosition._getTransformedByDeletion( sourceRange.start, sourceRange.end.offset - sourceRange.start.offset );
  26059. return _insert( targetPosition, nodes );
  26060. }
  26061. /**
  26062. * Sets given attribute on nodes in given range. The attributes are only set on top-level nodes of the range, not on its children.
  26063. *
  26064. * @protected
  26065. * @function module:engine/model/operation/utils~utils._setAttribute
  26066. * @param {module:engine/model/range~Range} range Range containing nodes that should have the attribute set. Must be a flat range.
  26067. * @param {String} key Key of attribute to set.
  26068. * @param {*} value Attribute value.
  26069. */
  26070. function _setAttribute( range, key, value ) {
  26071. // Range might start or end in text nodes, so we have to split them.
  26072. _splitNodeAtPosition( range.start );
  26073. _splitNodeAtPosition( range.end );
  26074. // Iterate over all items in the range.
  26075. for ( const item of range.getItems( { shallow: true } ) ) {
  26076. // Iterator will return `TextProxy` instances but we know that those text proxies will
  26077. // always represent full text nodes (this is guaranteed thanks to splitting we did before).
  26078. // So, we can operate on those text proxies' text nodes.
  26079. const node = item.is( '$textProxy' ) ? item.textNode : item;
  26080. if ( value !== null ) {
  26081. node._setAttribute( key, value );
  26082. } else {
  26083. node._removeAttribute( key );
  26084. }
  26085. // After attributes changing it may happen that some text nodes can be merged. Try to merge with previous node.
  26086. _mergeNodesAtIndex( node.parent, node.index );
  26087. }
  26088. // Try to merge last changed node with it's previous sibling (not covered by the loop above).
  26089. _mergeNodesAtIndex( range.end.parent, range.end.index );
  26090. }
  26091. /**
  26092. * Normalizes given object or an array of objects to an array of {@link module:engine/model/node~Node nodes}. See
  26093. * {@link module:engine/model/node~NodeSet NodeSet} for details on how normalization is performed.
  26094. *
  26095. * @protected
  26096. * @function module:engine/model/operation/utils~utils.normalizeNodes
  26097. * @param {module:engine/model/node~NodeSet} nodes Objects to normalize.
  26098. * @returns {Array.<module:engine/model/node~Node>} Normalized nodes.
  26099. */
  26100. function _normalizeNodes( nodes ) {
  26101. const normalized = [];
  26102. if ( !( nodes instanceof Array ) ) {
  26103. nodes = [ nodes ];
  26104. }
  26105. // Convert instances of classes other than Node.
  26106. for ( let i = 0; i < nodes.length; i++ ) {
  26107. if ( typeof nodes[ i ] == 'string' ) {
  26108. normalized.push( new _text__WEBPACK_IMPORTED_MODULE_1__["default"]( nodes[ i ] ) );
  26109. } else if ( nodes[ i ] instanceof _textproxy__WEBPACK_IMPORTED_MODULE_2__["default"] ) {
  26110. normalized.push( new _text__WEBPACK_IMPORTED_MODULE_1__["default"]( nodes[ i ].data, nodes[ i ].getAttributes() ) );
  26111. } else if ( nodes[ i ] instanceof _documentfragment__WEBPACK_IMPORTED_MODULE_4__["default"] || nodes[ i ] instanceof _nodelist__WEBPACK_IMPORTED_MODULE_5__["default"] ) {
  26112. for ( const child of nodes[ i ] ) {
  26113. normalized.push( child );
  26114. }
  26115. } else if ( nodes[ i ] instanceof _node__WEBPACK_IMPORTED_MODULE_0__["default"] ) {
  26116. normalized.push( nodes[ i ] );
  26117. }
  26118. // Skip unrecognized type.
  26119. }
  26120. // Merge text nodes.
  26121. for ( let i = 1; i < normalized.length; i++ ) {
  26122. const node = normalized[ i ];
  26123. const prev = normalized[ i - 1 ];
  26124. if ( node instanceof _text__WEBPACK_IMPORTED_MODULE_1__["default"] && prev instanceof _text__WEBPACK_IMPORTED_MODULE_1__["default"] && _haveSameAttributes( node, prev ) ) {
  26125. // Doing this instead changing `prev.data` because `data` is readonly.
  26126. normalized.splice( i - 1, 2, new _text__WEBPACK_IMPORTED_MODULE_1__["default"]( prev.data + node.data, prev.getAttributes() ) );
  26127. i--;
  26128. }
  26129. }
  26130. return normalized;
  26131. }
  26132. // Checks if nodes before and after given index in given element are {@link module:engine/model/text~Text text nodes} and
  26133. // merges them into one node if they have same attributes.
  26134. //
  26135. // Merging is done by removing two text nodes and inserting a new text node containing data from both merged text nodes.
  26136. //
  26137. // @private
  26138. // @param {module:engine/model/element~Element} element Parent element of nodes to merge.
  26139. // @param {Number} index Index between nodes to merge.
  26140. function _mergeNodesAtIndex( element, index ) {
  26141. const nodeBefore = element.getChild( index - 1 );
  26142. const nodeAfter = element.getChild( index );
  26143. // Check if both of those nodes are text objects with same attributes.
  26144. if ( nodeBefore && nodeAfter && nodeBefore.is( '$text' ) && nodeAfter.is( '$text' ) && _haveSameAttributes( nodeBefore, nodeAfter ) ) {
  26145. // Append text of text node after index to the before one.
  26146. const mergedNode = new _text__WEBPACK_IMPORTED_MODULE_1__["default"]( nodeBefore.data + nodeAfter.data, nodeBefore.getAttributes() );
  26147. // Remove separate text nodes.
  26148. element._removeChildren( index - 1, 2 );
  26149. // Insert merged text node.
  26150. element._insertChild( index - 1, mergedNode );
  26151. }
  26152. }
  26153. // Checks if given position is in a text node, and if so, splits the text node in two text nodes, each of them
  26154. // containing a part of original text node.
  26155. //
  26156. // @private
  26157. // @param {module:engine/model/position~Position} position Position at which node should be split.
  26158. function _splitNodeAtPosition( position ) {
  26159. const textNode = position.textNode;
  26160. const element = position.parent;
  26161. if ( textNode ) {
  26162. const offsetDiff = position.offset - textNode.startOffset;
  26163. const index = textNode.index;
  26164. element._removeChildren( index, 1 );
  26165. const firstPart = new _text__WEBPACK_IMPORTED_MODULE_1__["default"]( textNode.data.substr( 0, offsetDiff ), textNode.getAttributes() );
  26166. const secondPart = new _text__WEBPACK_IMPORTED_MODULE_1__["default"]( textNode.data.substr( offsetDiff ), textNode.getAttributes() );
  26167. element._insertChild( index, [ firstPart, secondPart ] );
  26168. }
  26169. }
  26170. // Checks whether two given nodes have same attributes.
  26171. //
  26172. // @private
  26173. // @param {module:engine/model/node~Node} nodeA Node to check.
  26174. // @param {module:engine/model/node~Node} nodeB Node to check.
  26175. // @returns {Boolean} `true` if nodes have same attributes, `false` otherwise.
  26176. function _haveSameAttributes( nodeA, nodeB ) {
  26177. const iteratorA = nodeA.getAttributes();
  26178. const iteratorB = nodeB.getAttributes();
  26179. for ( const attr of iteratorA ) {
  26180. if ( attr[ 1 ] !== nodeB.getAttribute( attr[ 0 ] ) ) {
  26181. return false;
  26182. }
  26183. iteratorB.next();
  26184. }
  26185. return iteratorB.next().done;
  26186. }
  26187. /**
  26188. * Value that can be normalized to an array of {@link module:engine/model/node~Node nodes}.
  26189. *
  26190. * Non-arrays are normalized as follows:
  26191. * * {@link module:engine/model/node~Node Node} is left as is,
  26192. * * {@link module:engine/model/textproxy~TextProxy TextProxy} and `String` are normalized to {@link module:engine/model/text~Text Text},
  26193. * * {@link module:engine/model/nodelist~NodeList NodeList} is normalized to an array containing all nodes that are in that node list,
  26194. * * {@link module:engine/model/documentfragment~DocumentFragment DocumentFragment} is normalized to an array containing all of it's
  26195. * * children.
  26196. *
  26197. * Arrays are processed item by item like non-array values and flattened to one array. Normalization always results in
  26198. * a flat array of {@link module:engine/model/node~Node nodes}. Consecutive text nodes (or items normalized to text nodes) will be
  26199. * merged if they have same attributes.
  26200. *
  26201. * @typedef {module:engine/model/node~Node|module:engine/model/textproxy~TextProxy|String|
  26202. * module:engine/model/nodelist~NodeList|module:engine/model/documentfragment~DocumentFragment|Iterable}
  26203. * module:engine/model/node~NodeSet
  26204. */
  26205. /***/ }),
  26206. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/position.js":
  26207. /*!***********************************************************************!*\
  26208. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/position.js ***!
  26209. \***********************************************************************/
  26210. /*! exports provided: default, getTextNodeAtPosition, getNodeAfterPosition, getNodeBeforePosition */
  26211. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  26212. "use strict";
  26213. __webpack_require__.r(__webpack_exports__);
  26214. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Position; });
  26215. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getTextNodeAtPosition", function() { return getTextNodeAtPosition; });
  26216. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getNodeAfterPosition", function() { return getNodeAfterPosition; });
  26217. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getNodeBeforePosition", function() { return getNodeBeforePosition; });
  26218. /* harmony import */ var _treewalker__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./treewalker */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/treewalker.js");
  26219. /* 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");
  26220. /* 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");
  26221. /* 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");
  26222. /**
  26223. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  26224. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  26225. */
  26226. /**
  26227. * @module engine/model/position
  26228. */
  26229. // To check if component is loaded more than once.
  26230. /**
  26231. * Represents a position in the model tree.
  26232. *
  26233. * A position is represented by its {@link module:engine/model/position~Position#root} and
  26234. * a {@link module:engine/model/position~Position#path} in that root.
  26235. *
  26236. * You can create position instances via its constructor or the `createPosition*()` factory methods of
  26237. * {@link module:engine/model/model~Model} and {@link module:engine/model/writer~Writer}.
  26238. *
  26239. * **Note:** Position is based on offsets, not indexes. This means that a position between two text nodes
  26240. * `foo` and `bar` has offset `3`, not `1`. See {@link module:engine/model/position~Position#path} for more information.
  26241. *
  26242. * Since a position in the model is represented by a {@link module:engine/model/position~Position#root position root} and
  26243. * {@link module:engine/model/position~Position#path position path} it is possible to create positions placed in non-existing places.
  26244. * This requirement is important for operational transformation algorithms.
  26245. *
  26246. * Also, {@link module:engine/model/operation/operation~Operation operations}
  26247. * kept in the {@link module:engine/model/document~Document#history document history}
  26248. * are storing positions (and ranges) which were correct when those operations were applied, but may not be correct
  26249. * after the document has changed.
  26250. *
  26251. * When changes are applied to the model, it may also happen that {@link module:engine/model/position~Position#parent position parent}
  26252. * will change even if position path has not changed. Keep in mind, that if a position leads to non-existing element,
  26253. * {@link module:engine/model/position~Position#parent} and some other properties and methods will throw errors.
  26254. *
  26255. * In most cases, position with wrong path is caused by an error in code, but it is sometimes needed, as described above.
  26256. */
  26257. class Position {
  26258. /**
  26259. * Creates a position.
  26260. *
  26261. * @param {module:engine/model/element~Element|module:engine/model/documentfragment~DocumentFragment} root Root of the position.
  26262. * @param {Array.<Number>} path Position path. See {@link module:engine/model/position~Position#path}.
  26263. * @param {module:engine/model/position~PositionStickiness} [stickiness='toNone'] Position stickiness.
  26264. * See {@link module:engine/model/position~PositionStickiness}.
  26265. */
  26266. constructor( root, path, stickiness = 'toNone' ) {
  26267. if ( !root.is( 'element' ) && !root.is( 'documentFragment' ) ) {
  26268. /**
  26269. * Position root is invalid.
  26270. *
  26271. * Positions can only be anchored in elements or document fragments.
  26272. *
  26273. * @error model-position-root-invalid
  26274. */
  26275. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__["default"](
  26276. 'model-position-root-invalid',
  26277. root
  26278. );
  26279. }
  26280. if ( !( path instanceof Array ) || path.length === 0 ) {
  26281. /**
  26282. * Position path must be an array with at least one item.
  26283. *
  26284. * @error model-position-path-incorrect-format
  26285. * @param path
  26286. */
  26287. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__["default"](
  26288. 'model-position-path-incorrect-format',
  26289. root,
  26290. { path }
  26291. );
  26292. }
  26293. // Normalize the root and path when element (not root) is passed.
  26294. if ( root.is( 'rootElement' ) ) {
  26295. path = path.slice();
  26296. } else {
  26297. path = [ ...root.getPath(), ...path ];
  26298. root = root.root;
  26299. }
  26300. /**
  26301. * Root of the position path.
  26302. *
  26303. * @readonly
  26304. * @member {module:engine/model/element~Element|module:engine/model/documentfragment~DocumentFragment}
  26305. * module:engine/model/position~Position#root
  26306. */
  26307. this.root = root;
  26308. /**
  26309. * Position of the node in the tree. **Path contains offsets, not indexes.**
  26310. *
  26311. * Position can be placed before, after or in a {@link module:engine/model/node~Node node} if that node has
  26312. * {@link module:engine/model/node~Node#offsetSize} greater than `1`. Items in position path are
  26313. * {@link module:engine/model/node~Node#startOffset starting offsets} of position ancestors, starting from direct root children,
  26314. * down to the position offset in it's parent.
  26315. *
  26316. * ROOT
  26317. * |- P before: [ 0 ] after: [ 1 ]
  26318. * |- UL before: [ 1 ] after: [ 2 ]
  26319. * |- LI before: [ 1, 0 ] after: [ 1, 1 ]
  26320. * | |- foo before: [ 1, 0, 0 ] after: [ 1, 0, 3 ]
  26321. * |- LI before: [ 1, 1 ] after: [ 1, 2 ]
  26322. * |- bar before: [ 1, 1, 0 ] after: [ 1, 1, 3 ]
  26323. *
  26324. * `foo` and `bar` are representing {@link module:engine/model/text~Text text nodes}. Since text nodes has offset size
  26325. * greater than `1` you can place position offset between their start and end:
  26326. *
  26327. * ROOT
  26328. * |- P
  26329. * |- UL
  26330. * |- LI
  26331. * | |- f^o|o ^ has path: [ 1, 0, 1 ] | has path: [ 1, 0, 2 ]
  26332. * |- LI
  26333. * |- b^a|r ^ has path: [ 1, 1, 1 ] | has path: [ 1, 1, 2 ]
  26334. *
  26335. * @readonly
  26336. * @member {Array.<Number>} module:engine/model/position~Position#path
  26337. */
  26338. this.path = path;
  26339. /**
  26340. * Position stickiness. See {@link module:engine/model/position~PositionStickiness}.
  26341. *
  26342. * @member {module:engine/model/position~PositionStickiness} module:engine/model/position~Position#stickiness
  26343. */
  26344. this.stickiness = stickiness;
  26345. }
  26346. /**
  26347. * Offset at which this position is located in its {@link module:engine/model/position~Position#parent parent}. It is equal
  26348. * to the last item in position {@link module:engine/model/position~Position#path path}.
  26349. *
  26350. * @type {Number}
  26351. */
  26352. get offset() {
  26353. return this.path[ this.path.length - 1 ];
  26354. }
  26355. set offset( newOffset ) {
  26356. this.path[ this.path.length - 1 ] = newOffset;
  26357. }
  26358. /**
  26359. * Parent element of this position.
  26360. *
  26361. * Keep in mind that `parent` value is calculated when the property is accessed.
  26362. * If {@link module:engine/model/position~Position#path position path}
  26363. * leads to a non-existing element, `parent` property will throw error.
  26364. *
  26365. * Also it is a good idea to cache `parent` property if it is used frequently in an algorithm (i.e. in a long loop).
  26366. *
  26367. * @readonly
  26368. * @type {module:engine/model/element~Element|module:engine/model/documentfragment~DocumentFragment}
  26369. */
  26370. get parent() {
  26371. let parent = this.root;
  26372. for ( let i = 0; i < this.path.length - 1; i++ ) {
  26373. parent = parent.getChild( parent.offsetToIndex( this.path[ i ] ) );
  26374. if ( !parent ) {
  26375. /**
  26376. * The position's path is incorrect. This means that a position does not point to
  26377. * a correct place in the tree and hence, some of its methods and getters cannot work correctly.
  26378. *
  26379. * **Note**: Unlike DOM and view positions, in the model, the
  26380. * {@link module:engine/model/position~Position#parent position's parent} is always an element or a document fragment.
  26381. * The last offset in the {@link module:engine/model/position~Position#path position's path} is the point in this element
  26382. * where this position points.
  26383. *
  26384. * Read more about model positions and offsets in
  26385. * the {@glink framework/guides/architecture/editing-engine#indexes-and-offsets Editing engine architecture guide}.
  26386. *
  26387. * @error model-position-path-incorrect
  26388. * @param {module:engine/model/position~Position} position The incorrect position.
  26389. */
  26390. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__["default"]( 'model-position-path-incorrect', this, { position: this } );
  26391. }
  26392. }
  26393. if ( parent.is( '$text' ) ) {
  26394. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__["default"]( 'model-position-path-incorrect', this, { position: this } );
  26395. }
  26396. return parent;
  26397. }
  26398. /**
  26399. * Position {@link module:engine/model/position~Position#offset offset} converted to an index in position's parent node. It is
  26400. * equal to the {@link module:engine/model/node~Node#index index} of a node after this position. If position is placed
  26401. * in text node, position index is equal to the index of that text node.
  26402. *
  26403. * @readonly
  26404. * @type {Number}
  26405. */
  26406. get index() {
  26407. return this.parent.offsetToIndex( this.offset );
  26408. }
  26409. /**
  26410. * Returns {@link module:engine/model/text~Text text node} instance in which this position is placed or `null` if this
  26411. * position is not in a text node.
  26412. *
  26413. * @readonly
  26414. * @type {module:engine/model/text~Text|null}
  26415. */
  26416. get textNode() {
  26417. return getTextNodeAtPosition( this, this.parent );
  26418. }
  26419. /**
  26420. * Node directly after this position or `null` if this position is in text node.
  26421. *
  26422. * @readonly
  26423. * @type {module:engine/model/node~Node|null}
  26424. */
  26425. get nodeAfter() {
  26426. // Cache the parent and reuse for performance reasons. See #6579 and #6582.
  26427. const parent = this.parent;
  26428. return getNodeAfterPosition( this, parent, getTextNodeAtPosition( this, parent ) );
  26429. }
  26430. /**
  26431. * Node directly before this position or `null` if this position is in text node.
  26432. *
  26433. * @readonly
  26434. * @type {module:engine/model/node~Node|null}
  26435. */
  26436. get nodeBefore() {
  26437. // Cache the parent and reuse for performance reasons. See #6579 and #6582.
  26438. const parent = this.parent;
  26439. return getNodeBeforePosition( this, parent, getTextNodeAtPosition( this, parent ) );
  26440. }
  26441. /**
  26442. * Is `true` if position is at the beginning of its {@link module:engine/model/position~Position#parent parent}, `false` otherwise.
  26443. *
  26444. * @readonly
  26445. * @type {Boolean}
  26446. */
  26447. get isAtStart() {
  26448. return this.offset === 0;
  26449. }
  26450. /**
  26451. * Is `true` if position is at the end of its {@link module:engine/model/position~Position#parent parent}, `false` otherwise.
  26452. *
  26453. * @readonly
  26454. * @type {Boolean}
  26455. */
  26456. get isAtEnd() {
  26457. return this.offset == this.parent.maxOffset;
  26458. }
  26459. /**
  26460. * Checks whether this position is before or after given position.
  26461. *
  26462. * This method is safe to use it on non-existing positions (for example during operational transformation).
  26463. *
  26464. * @param {module:engine/model/position~Position} otherPosition Position to compare with.
  26465. * @returns {module:engine/model/position~PositionRelation}
  26466. */
  26467. compareWith( otherPosition ) {
  26468. if ( this.root != otherPosition.root ) {
  26469. return 'different';
  26470. }
  26471. const result = Object(_ckeditor_ckeditor5_utils_src_comparearrays__WEBPACK_IMPORTED_MODULE_1__["default"])( this.path, otherPosition.path );
  26472. switch ( result ) {
  26473. case 'same':
  26474. return 'same';
  26475. case 'prefix':
  26476. return 'before';
  26477. case 'extension':
  26478. return 'after';
  26479. default:
  26480. return this.path[ result ] < otherPosition.path[ result ] ? 'before' : 'after';
  26481. }
  26482. }
  26483. /**
  26484. * Gets the farthest position which matches the callback using
  26485. * {@link module:engine/model/treewalker~TreeWalker TreeWalker}.
  26486. *
  26487. * For example:
  26488. *
  26489. * getLastMatchingPosition( value => value.type == 'text' );
  26490. * // <paragraph>[]foo</paragraph> -> <paragraph>foo[]</paragraph>
  26491. *
  26492. * getLastMatchingPosition( value => value.type == 'text', { direction: 'backward' } );
  26493. * // <paragraph>foo[]</paragraph> -> <paragraph>[]foo</paragraph>
  26494. *
  26495. * getLastMatchingPosition( value => false );
  26496. * // Do not move the position.
  26497. *
  26498. * @param {Function} skip Callback function. Gets {@link module:engine/model/treewalker~TreeWalkerValue} and should
  26499. * return `true` if the value should be skipped or `false` if not.
  26500. * @param {Object} options Object with configuration options. See {@link module:engine/model/treewalker~TreeWalker}.
  26501. *
  26502. * @returns {module:engine/model/position~Position} The position after the last item which matches the `skip` callback test.
  26503. */
  26504. getLastMatchingPosition( skip, options = {} ) {
  26505. options.startPosition = this;
  26506. const treeWalker = new _treewalker__WEBPACK_IMPORTED_MODULE_0__["default"]( options );
  26507. treeWalker.skip( skip );
  26508. return treeWalker.position;
  26509. }
  26510. /**
  26511. * Returns a path to this position's parent. Parent path is equal to position {@link module:engine/model/position~Position#path path}
  26512. * but without the last item.
  26513. *
  26514. * This method is safe to use it on non-existing positions (for example during operational transformation).
  26515. *
  26516. * @returns {Array.<Number>} Path to the parent.
  26517. */
  26518. getParentPath() {
  26519. return this.path.slice( 0, -1 );
  26520. }
  26521. /**
  26522. * Returns ancestors array of this position, that is this position's parent and its ancestors.
  26523. *
  26524. * @returns {Array.<module:engine/model/item~Item>} Array with ancestors.
  26525. */
  26526. getAncestors() {
  26527. const parent = this.parent;
  26528. if ( parent.is( 'documentFragment' ) ) {
  26529. return [ parent ];
  26530. } else {
  26531. return parent.getAncestors( { includeSelf: true } );
  26532. }
  26533. }
  26534. /**
  26535. * Returns the parent element of the given name. Returns null if the position is not inside the desired parent.
  26536. *
  26537. * @param {String} parentName The name of the parent element to find.
  26538. * @returns {module:engine/model/element~Element|null}
  26539. */
  26540. findAncestor( parentName ) {
  26541. const parent = this.parent;
  26542. if ( parent.is( 'element' ) ) {
  26543. return parent.findAncestor( parentName, { includeSelf: true } );
  26544. }
  26545. return null;
  26546. }
  26547. /**
  26548. * Returns the slice of two position {@link #path paths} which is identical. The {@link #root roots}
  26549. * of these two paths must be identical.
  26550. *
  26551. * This method is safe to use it on non-existing positions (for example during operational transformation).
  26552. *
  26553. * @param {module:engine/model/position~Position} position The second position.
  26554. * @returns {Array.<Number>} The common path.
  26555. */
  26556. getCommonPath( position ) {
  26557. if ( this.root != position.root ) {
  26558. return [];
  26559. }
  26560. // We find on which tree-level start and end have the lowest common ancestor
  26561. const cmp = Object(_ckeditor_ckeditor5_utils_src_comparearrays__WEBPACK_IMPORTED_MODULE_1__["default"])( this.path, position.path );
  26562. // If comparison returned string it means that arrays are same.
  26563. const diffAt = ( typeof cmp == 'string' ) ? Math.min( this.path.length, position.path.length ) : cmp;
  26564. return this.path.slice( 0, diffAt );
  26565. }
  26566. /**
  26567. * Returns an {@link module:engine/model/element~Element} or {@link module:engine/model/documentfragment~DocumentFragment}
  26568. * which is a common ancestor of both positions. The {@link #root roots} of these two positions must be identical.
  26569. *
  26570. * @param {module:engine/model/position~Position} position The second position.
  26571. * @returns {module:engine/model/element~Element|module:engine/model/documentfragment~DocumentFragment|null}
  26572. */
  26573. getCommonAncestor( position ) {
  26574. const ancestorsA = this.getAncestors();
  26575. const ancestorsB = position.getAncestors();
  26576. let i = 0;
  26577. while ( ancestorsA[ i ] == ancestorsB[ i ] && ancestorsA[ i ] ) {
  26578. i++;
  26579. }
  26580. return i === 0 ? null : ancestorsA[ i - 1 ];
  26581. }
  26582. /**
  26583. * Returns a new instance of `Position`, that has same {@link #parent parent} but it's offset
  26584. * is shifted by `shift` value (can be a negative value).
  26585. *
  26586. * This method is safe to use it on non-existing positions (for example during operational transformation).
  26587. *
  26588. * @param {Number} shift Offset shift. Can be a negative value.
  26589. * @returns {module:engine/model/position~Position} Shifted position.
  26590. */
  26591. getShiftedBy( shift ) {
  26592. const shifted = this.clone();
  26593. const offset = shifted.offset + shift;
  26594. shifted.offset = offset < 0 ? 0 : offset;
  26595. return shifted;
  26596. }
  26597. /**
  26598. * Checks whether this position is after given position.
  26599. *
  26600. * This method is safe to use it on non-existing positions (for example during operational transformation).
  26601. *
  26602. * @see module:engine/model/position~Position#isBefore
  26603. * @param {module:engine/model/position~Position} otherPosition Position to compare with.
  26604. * @returns {Boolean} True if this position is after given position.
  26605. */
  26606. isAfter( otherPosition ) {
  26607. return this.compareWith( otherPosition ) == 'after';
  26608. }
  26609. /**
  26610. * Checks whether this position is before given position.
  26611. *
  26612. * **Note:** watch out when using negation of the value returned by this method, because the negation will also
  26613. * be `true` if positions are in different roots and you might not expect this. You should probably use
  26614. * `a.isAfter( b ) || a.isEqual( b )` or `!a.isBefore( p ) && a.root == b.root` in most scenarios. If your
  26615. * condition uses multiple `isAfter` and `isBefore` checks, build them so they do not use negated values, i.e.:
  26616. *
  26617. * if ( a.isBefore( b ) && c.isAfter( d ) ) {
  26618. * // do A.
  26619. * } else {
  26620. * // do B.
  26621. * }
  26622. *
  26623. * or, if you have only one if-branch:
  26624. *
  26625. * if ( !( a.isBefore( b ) && c.isAfter( d ) ) {
  26626. * // do B.
  26627. * }
  26628. *
  26629. * rather than:
  26630. *
  26631. * if ( !a.isBefore( b ) || && !c.isAfter( d ) ) {
  26632. * // do B.
  26633. * } else {
  26634. * // do A.
  26635. * }
  26636. *
  26637. * This method is safe to use it on non-existing positions (for example during operational transformation).
  26638. *
  26639. * @param {module:engine/model/position~Position} otherPosition Position to compare with.
  26640. * @returns {Boolean} True if this position is before given position.
  26641. */
  26642. isBefore( otherPosition ) {
  26643. return this.compareWith( otherPosition ) == 'before';
  26644. }
  26645. /**
  26646. * Checks whether this position is equal to given position.
  26647. *
  26648. * This method is safe to use it on non-existing positions (for example during operational transformation).
  26649. *
  26650. * @param {module:engine/model/position~Position} otherPosition Position to compare with.
  26651. * @returns {Boolean} True if positions are same.
  26652. */
  26653. isEqual( otherPosition ) {
  26654. return this.compareWith( otherPosition ) == 'same';
  26655. }
  26656. /**
  26657. * Checks whether this position is touching given position. Positions touch when there are no text nodes
  26658. * or empty nodes in a range between them. Technically, those positions are not equal but in many cases
  26659. * they are very similar or even indistinguishable.
  26660. *
  26661. * @param {module:engine/model/position~Position} otherPosition Position to compare with.
  26662. * @returns {Boolean} True if positions touch.
  26663. */
  26664. isTouching( otherPosition ) {
  26665. let left = null;
  26666. let right = null;
  26667. const compare = this.compareWith( otherPosition );
  26668. switch ( compare ) {
  26669. case 'same':
  26670. return true;
  26671. case 'before':
  26672. left = Position._createAt( this );
  26673. right = Position._createAt( otherPosition );
  26674. break;
  26675. case 'after':
  26676. left = Position._createAt( otherPosition );
  26677. right = Position._createAt( this );
  26678. break;
  26679. default:
  26680. return false;
  26681. }
  26682. // Cached for optimization purposes.
  26683. let leftParent = left.parent;
  26684. while ( left.path.length + right.path.length ) {
  26685. if ( left.isEqual( right ) ) {
  26686. return true;
  26687. }
  26688. if ( left.path.length > right.path.length ) {
  26689. if ( left.offset !== leftParent.maxOffset ) {
  26690. return false;
  26691. }
  26692. left.path = left.path.slice( 0, -1 );
  26693. leftParent = leftParent.parent;
  26694. left.offset++;
  26695. } else {
  26696. if ( right.offset !== 0 ) {
  26697. return false;
  26698. }
  26699. right.path = right.path.slice( 0, -1 );
  26700. }
  26701. }
  26702. }
  26703. /**
  26704. * Checks whether this object is of the given.
  26705. *
  26706. * position.is( 'position' ); // -> true
  26707. * position.is( 'model:position' ); // -> true
  26708. *
  26709. * position.is( 'view:position' ); // -> false
  26710. * position.is( 'documentSelection' ); // -> false
  26711. *
  26712. * {@link module:engine/model/node~Node#is Check the entire list of model objects} which implement the `is()` method.
  26713. *
  26714. * @param {String} type
  26715. * @returns {Boolean}
  26716. */
  26717. is( type ) {
  26718. return type === 'position' || type === 'model:position';
  26719. }
  26720. /**
  26721. * Checks if two positions are in the same parent.
  26722. *
  26723. * This method is safe to use it on non-existing positions (for example during operational transformation).
  26724. *
  26725. * @param {module:engine/model/position~Position} position Position to compare with.
  26726. * @returns {Boolean} `true` if positions have the same parent, `false` otherwise.
  26727. */
  26728. hasSameParentAs( position ) {
  26729. if ( this.root !== position.root ) {
  26730. return false;
  26731. }
  26732. const thisParentPath = this.getParentPath();
  26733. const posParentPath = position.getParentPath();
  26734. return Object(_ckeditor_ckeditor5_utils_src_comparearrays__WEBPACK_IMPORTED_MODULE_1__["default"])( thisParentPath, posParentPath ) == 'same';
  26735. }
  26736. /**
  26737. * Returns a copy of this position that is transformed by given `operation`.
  26738. *
  26739. * The new position's parameters are updated accordingly to the effect of the `operation`.
  26740. *
  26741. * For example, if `n` nodes are inserted before the position, the returned position {@link ~Position#offset} will be
  26742. * increased by `n`. If the position was in a merged element, it will be accordingly moved to the new element, etc.
  26743. *
  26744. * This method is safe to use it on non-existing positions (for example during operational transformation).
  26745. *
  26746. * @param {module:engine/model/operation/operation~Operation} operation Operation to transform by.
  26747. * @returns {module:engine/model/position~Position} Transformed position.
  26748. */
  26749. getTransformedByOperation( operation ) {
  26750. let result;
  26751. switch ( operation.type ) {
  26752. case 'insert':
  26753. result = this._getTransformedByInsertOperation( operation );
  26754. break;
  26755. case 'move':
  26756. case 'remove':
  26757. case 'reinsert':
  26758. result = this._getTransformedByMoveOperation( operation );
  26759. break;
  26760. case 'split':
  26761. result = this._getTransformedBySplitOperation( operation );
  26762. break;
  26763. case 'merge':
  26764. result = this._getTransformedByMergeOperation( operation );
  26765. break;
  26766. default:
  26767. result = Position._createAt( this );
  26768. break;
  26769. }
  26770. return result;
  26771. }
  26772. /**
  26773. * Returns a copy of this position transformed by an insert operation.
  26774. *
  26775. * @protected
  26776. * @param {module:engine/model/operation/insertoperation~InsertOperation} operation
  26777. * @returns {module:engine/model/position~Position}
  26778. */
  26779. _getTransformedByInsertOperation( operation ) {
  26780. return this._getTransformedByInsertion( operation.position, operation.howMany );
  26781. }
  26782. /**
  26783. * Returns a copy of this position transformed by a move operation.
  26784. *
  26785. * @protected
  26786. * @param {module:engine/model/operation/moveoperation~MoveOperation} operation
  26787. * @returns {module:engine/model/position~Position}
  26788. */
  26789. _getTransformedByMoveOperation( operation ) {
  26790. return this._getTransformedByMove( operation.sourcePosition, operation.targetPosition, operation.howMany );
  26791. }
  26792. /**
  26793. * Returns a copy of this position transformed by a split operation.
  26794. *
  26795. * @protected
  26796. * @param {module:engine/model/operation/splitoperation~SplitOperation} operation
  26797. * @returns {module:engine/model/position~Position}
  26798. */
  26799. _getTransformedBySplitOperation( operation ) {
  26800. const movedRange = operation.movedRange;
  26801. const isContained = movedRange.containsPosition( this ) ||
  26802. ( movedRange.start.isEqual( this ) && this.stickiness == 'toNext' );
  26803. if ( isContained ) {
  26804. return this._getCombined( operation.splitPosition, operation.moveTargetPosition );
  26805. } else {
  26806. if ( operation.graveyardPosition ) {
  26807. return this._getTransformedByMove( operation.graveyardPosition, operation.insertionPosition, 1 );
  26808. } else {
  26809. return this._getTransformedByInsertion( operation.insertionPosition, 1 );
  26810. }
  26811. }
  26812. }
  26813. /**
  26814. * Returns a copy of this position transformed by merge operation.
  26815. *
  26816. * @protected
  26817. * @param {module:engine/model/operation/mergeoperation~MergeOperation} operation
  26818. * @returns {module:engine/model/position~Position}
  26819. */
  26820. _getTransformedByMergeOperation( operation ) {
  26821. const movedRange = operation.movedRange;
  26822. const isContained = movedRange.containsPosition( this ) || movedRange.start.isEqual( this );
  26823. let pos;
  26824. if ( isContained ) {
  26825. pos = this._getCombined( operation.sourcePosition, operation.targetPosition );
  26826. if ( operation.sourcePosition.isBefore( operation.targetPosition ) ) {
  26827. // Above happens during OT when the merged element is moved before the merged-to element.
  26828. pos = pos._getTransformedByDeletion( operation.deletionPosition, 1 );
  26829. }
  26830. } else if ( this.isEqual( operation.deletionPosition ) ) {
  26831. pos = Position._createAt( operation.deletionPosition );
  26832. } else {
  26833. pos = this._getTransformedByMove( operation.deletionPosition, operation.graveyardPosition, 1 );
  26834. }
  26835. return pos;
  26836. }
  26837. /**
  26838. * Returns a copy of this position that is updated by removing `howMany` nodes starting from `deletePosition`.
  26839. * It may happen that this position is in a removed node. If that is the case, `null` is returned instead.
  26840. *
  26841. * @protected
  26842. * @param {module:engine/model/position~Position} deletePosition Position before the first removed node.
  26843. * @param {Number} howMany How many nodes are removed.
  26844. * @returns {module:engine/model/position~Position|null} Transformed position or `null`.
  26845. */
  26846. _getTransformedByDeletion( deletePosition, howMany ) {
  26847. const transformed = Position._createAt( this );
  26848. // This position can't be affected if deletion was in a different root.
  26849. if ( this.root != deletePosition.root ) {
  26850. return transformed;
  26851. }
  26852. if ( Object(_ckeditor_ckeditor5_utils_src_comparearrays__WEBPACK_IMPORTED_MODULE_1__["default"])( deletePosition.getParentPath(), this.getParentPath() ) == 'same' ) {
  26853. // If nodes are removed from the node that is pointed by this position...
  26854. if ( deletePosition.offset < this.offset ) {
  26855. // And are removed from before an offset of that position...
  26856. if ( deletePosition.offset + howMany > this.offset ) {
  26857. // Position is in removed range, it's no longer in the tree.
  26858. return null;
  26859. } else {
  26860. // Decrement the offset accordingly.
  26861. transformed.offset -= howMany;
  26862. }
  26863. }
  26864. } else if ( Object(_ckeditor_ckeditor5_utils_src_comparearrays__WEBPACK_IMPORTED_MODULE_1__["default"])( deletePosition.getParentPath(), this.getParentPath() ) == 'prefix' ) {
  26865. // If nodes are removed from a node that is on a path to this position...
  26866. const i = deletePosition.path.length - 1;
  26867. if ( deletePosition.offset <= this.path[ i ] ) {
  26868. // And are removed from before next node of that path...
  26869. if ( deletePosition.offset + howMany > this.path[ i ] ) {
  26870. // If the next node of that path is removed return null
  26871. // because the node containing this position got removed.
  26872. return null;
  26873. } else {
  26874. // Otherwise, decrement index on that path.
  26875. transformed.path[ i ] -= howMany;
  26876. }
  26877. }
  26878. }
  26879. return transformed;
  26880. }
  26881. /**
  26882. * Returns a copy of this position that is updated by inserting `howMany` nodes at `insertPosition`.
  26883. *
  26884. * @protected
  26885. * @param {module:engine/model/position~Position} insertPosition Position where nodes are inserted.
  26886. * @param {Number} howMany How many nodes are inserted.
  26887. * @returns {module:engine/model/position~Position} Transformed position.
  26888. */
  26889. _getTransformedByInsertion( insertPosition, howMany ) {
  26890. const transformed = Position._createAt( this );
  26891. // This position can't be affected if insertion was in a different root.
  26892. if ( this.root != insertPosition.root ) {
  26893. return transformed;
  26894. }
  26895. if ( Object(_ckeditor_ckeditor5_utils_src_comparearrays__WEBPACK_IMPORTED_MODULE_1__["default"])( insertPosition.getParentPath(), this.getParentPath() ) == 'same' ) {
  26896. // If nodes are inserted in the node that is pointed by this position...
  26897. if ( insertPosition.offset < this.offset || ( insertPosition.offset == this.offset && this.stickiness != 'toPrevious' ) ) {
  26898. // And are inserted before an offset of that position...
  26899. // "Push" this positions offset.
  26900. transformed.offset += howMany;
  26901. }
  26902. } else if ( Object(_ckeditor_ckeditor5_utils_src_comparearrays__WEBPACK_IMPORTED_MODULE_1__["default"])( insertPosition.getParentPath(), this.getParentPath() ) == 'prefix' ) {
  26903. // If nodes are inserted in a node that is on a path to this position...
  26904. const i = insertPosition.path.length - 1;
  26905. if ( insertPosition.offset <= this.path[ i ] ) {
  26906. // And are inserted before next node of that path...
  26907. // "Push" the index on that path.
  26908. transformed.path[ i ] += howMany;
  26909. }
  26910. }
  26911. return transformed;
  26912. }
  26913. /**
  26914. * Returns a copy of this position that is updated by moving `howMany` nodes from `sourcePosition` to `targetPosition`.
  26915. *
  26916. * @protected
  26917. * @param {module:engine/model/position~Position} sourcePosition Position before the first element to move.
  26918. * @param {module:engine/model/position~Position} targetPosition Position where moved elements will be inserted.
  26919. * @param {Number} howMany How many consecutive nodes to move, starting from `sourcePosition`.
  26920. * @returns {module:engine/model/position~Position} Transformed position.
  26921. */
  26922. _getTransformedByMove( sourcePosition, targetPosition, howMany ) {
  26923. // Update target position, as it could be affected by nodes removal.
  26924. targetPosition = targetPosition._getTransformedByDeletion( sourcePosition, howMany );
  26925. if ( sourcePosition.isEqual( targetPosition ) ) {
  26926. // If `targetPosition` is equal to `sourcePosition` this isn't really any move. Just return position as it is.
  26927. return Position._createAt( this );
  26928. }
  26929. // Moving a range removes nodes from their original position. We acknowledge this by proper transformation.
  26930. const transformed = this._getTransformedByDeletion( sourcePosition, howMany );
  26931. const isMoved = transformed === null ||
  26932. ( sourcePosition.isEqual( this ) && this.stickiness == 'toNext' ) ||
  26933. ( sourcePosition.getShiftedBy( howMany ).isEqual( this ) && this.stickiness == 'toPrevious' );
  26934. if ( isMoved ) {
  26935. // This position is inside moved range (or sticks to it).
  26936. // In this case, we calculate a combination of this position, move source position and target position.
  26937. return this._getCombined( sourcePosition, targetPosition );
  26938. } else {
  26939. // This position is not inside a removed range.
  26940. //
  26941. // In next step, we simply reflect inserting `howMany` nodes, which might further affect the position.
  26942. return transformed._getTransformedByInsertion( targetPosition, howMany );
  26943. }
  26944. }
  26945. /**
  26946. * Returns a new position that is a combination of this position and given positions.
  26947. *
  26948. * The combined position is a copy of this position transformed by moving a range starting at `source` position
  26949. * to the `target` position. It is expected that this position is inside the moved range.
  26950. *
  26951. * Example:
  26952. *
  26953. * let original = model.createPositionFromPath( root, [ 2, 3, 1 ] );
  26954. * let source = model.createPositionFromPath( root, [ 2, 2 ] );
  26955. * let target = model.createPositionFromPath( otherRoot, [ 1, 1, 3 ] );
  26956. * original._getCombined( source, target ); // path is [ 1, 1, 4, 1 ], root is `otherRoot`
  26957. *
  26958. * Explanation:
  26959. *
  26960. * We have a position `[ 2, 3, 1 ]` and move some nodes from `[ 2, 2 ]` to `[ 1, 1, 3 ]`. The original position
  26961. * was inside moved nodes and now should point to the new place. The moved nodes will be after
  26962. * positions `[ 1, 1, 3 ]`, `[ 1, 1, 4 ]`, `[ 1, 1, 5 ]`. Since our position was in the second moved node,
  26963. * the transformed position will be in a sub-tree of a node at `[ 1, 1, 4 ]`. Looking at original path, we
  26964. * took care of `[ 2, 3 ]` part of it. Now we have to add the rest of the original path to the transformed path.
  26965. * Finally, the transformed position will point to `[ 1, 1, 4, 1 ]`.
  26966. *
  26967. * @protected
  26968. * @param {module:engine/model/position~Position} source Beginning of the moved range.
  26969. * @param {module:engine/model/position~Position} target Position where the range is moved.
  26970. * @returns {module:engine/model/position~Position} Combined position.
  26971. */
  26972. _getCombined( source, target ) {
  26973. const i = source.path.length - 1;
  26974. // The first part of a path to combined position is a path to the place where nodes were moved.
  26975. const combined = Position._createAt( target );
  26976. combined.stickiness = this.stickiness;
  26977. // Then we have to update the rest of the path.
  26978. // Fix the offset because this position might be after `from` position and we have to reflect that.
  26979. combined.offset = combined.offset + this.path[ i ] - source.offset;
  26980. // Then, add the rest of the path.
  26981. // If this position is at the same level as `from` position nothing will get added.
  26982. combined.path = [ ...combined.path, ...this.path.slice( i + 1 ) ];
  26983. return combined;
  26984. }
  26985. /**
  26986. * @inheritDoc
  26987. */
  26988. toJSON() {
  26989. return {
  26990. root: this.root.toJSON(),
  26991. path: Array.from( this.path ),
  26992. stickiness: this.stickiness
  26993. };
  26994. }
  26995. /**
  26996. * Returns a new position that is equal to current position.
  26997. *
  26998. * @returns {module:engine/model/position~Position}
  26999. */
  27000. clone() {
  27001. return new this.constructor( this.root, this.path, this.stickiness );
  27002. }
  27003. /**
  27004. * Creates position at the given location. The location can be specified as:
  27005. *
  27006. * * a {@link module:engine/model/position~Position position},
  27007. * * parent element and offset (offset defaults to `0`),
  27008. * * parent element and `'end'` (sets position at the end of that element),
  27009. * * {@link module:engine/model/item~Item model item} and `'before'` or `'after'` (sets position before or after given model item).
  27010. *
  27011. * This method is a shortcut to other factory methods such as:
  27012. *
  27013. * * {@link module:engine/model/position~Position._createBefore},
  27014. * * {@link module:engine/model/position~Position._createAfter}.
  27015. *
  27016. * @param {module:engine/model/item~Item|module:engine/model/position~Position} itemOrPosition
  27017. * @param {Number|'end'|'before'|'after'} [offset] Offset or one of the flags. Used only when the
  27018. * first parameter is a {@link module:engine/model/item~Item model item}.
  27019. * @param {module:engine/model/position~PositionStickiness} [stickiness='toNone'] Position stickiness. Used only when the
  27020. * first parameter is a {@link module:engine/model/item~Item model item}.
  27021. * @protected
  27022. */
  27023. static _createAt( itemOrPosition, offset, stickiness = 'toNone' ) {
  27024. if ( itemOrPosition instanceof Position ) {
  27025. return new Position( itemOrPosition.root, itemOrPosition.path, itemOrPosition.stickiness );
  27026. } else {
  27027. const node = itemOrPosition;
  27028. if ( offset == 'end' ) {
  27029. offset = node.maxOffset;
  27030. } else if ( offset == 'before' ) {
  27031. return this._createBefore( node, stickiness );
  27032. } else if ( offset == 'after' ) {
  27033. return this._createAfter( node, stickiness );
  27034. } else if ( offset !== 0 && !offset ) {
  27035. /**
  27036. * {@link module:engine/model/model~Model#createPositionAt `Model#createPositionAt()`}
  27037. * requires the offset to be specified when the first parameter is a model item.
  27038. *
  27039. * @error model-createpositionat-offset-required
  27040. */
  27041. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__["default"]( 'model-createpositionat-offset-required', [ this, itemOrPosition ] );
  27042. }
  27043. if ( !node.is( 'element' ) && !node.is( 'documentFragment' ) ) {
  27044. /**
  27045. * Position parent have to be a model element or model document fragment.
  27046. *
  27047. * @error model-position-parent-incorrect
  27048. */
  27049. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__["default"](
  27050. 'model-position-parent-incorrect',
  27051. [ this, itemOrPosition ]
  27052. );
  27053. }
  27054. const path = node.getPath();
  27055. path.push( offset );
  27056. return new this( node.root, path, stickiness );
  27057. }
  27058. }
  27059. /**
  27060. * Creates a new position, after given {@link module:engine/model/item~Item model item}.
  27061. *
  27062. * @param {module:engine/model/item~Item} item Item after which the position should be placed.
  27063. * @param {module:engine/model/position~PositionStickiness} [stickiness='toNone'] Position stickiness.
  27064. * @returns {module:engine/model/position~Position}
  27065. * @protected
  27066. */
  27067. static _createAfter( item, stickiness ) {
  27068. if ( !item.parent ) {
  27069. /**
  27070. * You can not make a position after a root element.
  27071. *
  27072. * @error model-position-after-root
  27073. * @param {module:engine/model/item~Item} root
  27074. */
  27075. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__["default"](
  27076. 'model-position-after-root',
  27077. [ this, item ],
  27078. { root: item }
  27079. );
  27080. }
  27081. return this._createAt( item.parent, item.endOffset, stickiness );
  27082. }
  27083. /**
  27084. * Creates a new position, before the given {@link module:engine/model/item~Item model item}.
  27085. *
  27086. * @param {module:engine/model/item~Item} item Item before which the position should be placed.
  27087. * @param {module:engine/model/position~PositionStickiness} [stickiness='toNone'] Position stickiness.
  27088. * @returns {module:engine/model/position~Position}
  27089. * @protected
  27090. */
  27091. static _createBefore( item, stickiness ) {
  27092. if ( !item.parent ) {
  27093. /**
  27094. * You can not make a position before a root element.
  27095. *
  27096. * @error model-position-before-root
  27097. * @param {module:engine/model/item~Item} root
  27098. */
  27099. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__["default"](
  27100. 'model-position-before-root',
  27101. item,
  27102. { root: item }
  27103. );
  27104. }
  27105. return this._createAt( item.parent, item.startOffset, stickiness );
  27106. }
  27107. /**
  27108. * Creates a `Position` instance from given plain object (i.e. parsed JSON string).
  27109. *
  27110. * @param {Object} json Plain object to be converted to `Position`.
  27111. * @param {module:engine/model/document~Document} doc Document object that will be position owner.
  27112. * @returns {module:engine/model/position~Position} `Position` instance created using given plain object.
  27113. */
  27114. static fromJSON( json, doc ) {
  27115. if ( json.root === '$graveyard' ) {
  27116. const pos = new Position( doc.graveyard, json.path );
  27117. pos.stickiness = json.stickiness;
  27118. return pos;
  27119. }
  27120. if ( !doc.getRoot( json.root ) ) {
  27121. /**
  27122. * Cannot create position for document. Root with specified name does not exist.
  27123. *
  27124. * @error model-position-fromjson-no-root
  27125. * @param {String} rootName
  27126. */
  27127. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__["default"](
  27128. 'model-position-fromjson-no-root',
  27129. doc,
  27130. { rootName: json.root }
  27131. );
  27132. }
  27133. return new Position( doc.getRoot( json.root ), json.path, json.stickiness );
  27134. }
  27135. // @if CK_DEBUG_ENGINE // toString() {
  27136. // @if CK_DEBUG_ENGINE // return `${ this.root } [ ${ this.path.join( ', ' ) } ]`;
  27137. // @if CK_DEBUG_ENGINE // }
  27138. // @if CK_DEBUG_ENGINE // log() {
  27139. // @if CK_DEBUG_ENGINE // console.log( 'ModelPosition: ' + this );
  27140. // @if CK_DEBUG_ENGINE // }
  27141. }
  27142. /**
  27143. * A flag indicating whether this position is `'before'` or `'after'` or `'same'` as given position.
  27144. * If positions are in different roots `'different'` flag is returned.
  27145. *
  27146. * @typedef {String} module:engine/model/position~PositionRelation
  27147. */
  27148. /**
  27149. * Represents how position is "sticking" with neighbour nodes. Used to define how position should be transformed (moved)
  27150. * in edge cases. Possible values: `'toNone'`, `'toNext'`, `'toPrevious'`.
  27151. *
  27152. * Examples:
  27153. *
  27154. * Insert. Position is at | and nodes are inserted at the same position, marked as ^:
  27155. *
  27156. * - sticks to none: <p>f^|oo</p> -> <p>fbar|oo</p>
  27157. * - sticks to next node: <p>f^|oo</p> -> <p>fbar|oo</p>
  27158. * - sticks to previous node: <p>f|^oo</p> -> <p>f|baroo</p>
  27159. *
  27160. *
  27161. * Move. Position is at | and range [oo] is moved to position ^:
  27162. *
  27163. * - sticks to none: <p>f|[oo]</p><p>b^ar</p> -> <p>f|</p><p>booar</p>
  27164. * - sticks to none: <p>f[oo]|</p><p>b^ar</p> -> <p>f|</p><p>booar</p>
  27165. *
  27166. * - sticks to next node: <p>f|[oo]</p><p>b^ar</p> -> <p>f</p><p>b|ooar</p>
  27167. * - sticks to next node: <p>f[oo]|</p><p>b^ar</p> -> <p>f|</p><p>booar</p>
  27168. *
  27169. * - sticks to previous node: <p>f|[oo]</p><p>b^ar</p> -> <p>f|</p><p>booar</p>
  27170. * - sticks to previous node: <p>f[oo]|</p><p>b^ar</p> -> <p>f</p><p>boo|ar</p>
  27171. *
  27172. * @typedef {String} module:engine/model/position~PositionStickiness
  27173. */
  27174. /**
  27175. * Returns a text node at the given position.
  27176. *
  27177. * This is a helper function optimized to reuse the position parent instance for performance reasons.
  27178. *
  27179. * Normally, you should use {@link module:engine/model/position~Position#textNode `Position#textNode`}.
  27180. * If you start hitting performance issues with {@link module:engine/model/position~Position#parent `Position#parent`}
  27181. * check if your algorithm does not access it multiple times (which can happen directly or indirectly via other position properties).
  27182. *
  27183. * See https://github.com/ckeditor/ckeditor5/issues/6579.
  27184. *
  27185. * See also:
  27186. *
  27187. * * {@link module:engine/model/position~getNodeAfterPosition}
  27188. * * {@link module:engine/model/position~getNodeBeforePosition}
  27189. *
  27190. * @param {module:engine/model/position~Position} position
  27191. * @param {module:engine/model/element~Element|module:engine/model/documentfragment~DocumentFragment} positionParent The parent of the
  27192. * given position.
  27193. * @returns {module:engine/model/text~Text|null}
  27194. */
  27195. function getTextNodeAtPosition( position, positionParent ) {
  27196. const node = positionParent.getChild( positionParent.offsetToIndex( position.offset ) );
  27197. if ( node && node.is( '$text' ) && node.startOffset < position.offset ) {
  27198. return node;
  27199. }
  27200. return null;
  27201. }
  27202. /**
  27203. * Returns the node after the given position.
  27204. *
  27205. * This is a helper function optimized to reuse the position parent instance and the calculation of the text node at the
  27206. * specific position for performance reasons.
  27207. *
  27208. * Normally, you should use {@link module:engine/model/position~Position#nodeAfter `Position#nodeAfter`}.
  27209. * If you start hitting performance issues with {@link module:engine/model/position~Position#parent `Position#parent`} and/or
  27210. * {@link module:engine/model/position~Position#textNode `Position#textNode`}
  27211. * check if your algorithm does not access those properties multiple times
  27212. * (which can happen directly or indirectly via other position properties).
  27213. *
  27214. * See https://github.com/ckeditor/ckeditor5/issues/6579 and https://github.com/ckeditor/ckeditor5/issues/6582.
  27215. *
  27216. * See also:
  27217. *
  27218. * * {@link module:engine/model/position~getTextNodeAtPosition}
  27219. * * {@link module:engine/model/position~getNodeBeforePosition}
  27220. *
  27221. * @param {module:engine/model/position~Position} position
  27222. * @param {module:engine/model/element~Element|module:engine/model/documentfragment~DocumentFragment} positionParent The parent of the
  27223. * given position.
  27224. * @param {module:engine/model/text~Text|null} textNode Text node at the given position.
  27225. * @returns {module:engine/model/node~Node|null}
  27226. */
  27227. function getNodeAfterPosition( position, positionParent, textNode ) {
  27228. if ( textNode !== null ) {
  27229. return null;
  27230. }
  27231. return positionParent.getChild( positionParent.offsetToIndex( position.offset ) );
  27232. }
  27233. /**
  27234. * Returns the node before the given position.
  27235. *
  27236. * Refer to {@link module:engine/model/position~getNodeBeforePosition} for documentation on when to use this util method.
  27237. *
  27238. * See also:
  27239. *
  27240. * * {@link module:engine/model/position~getTextNodeAtPosition}
  27241. * * {@link module:engine/model/position~getNodeAfterPosition}
  27242. *
  27243. * @param {module:engine/model/position~Position} position
  27244. * @param {module:engine/model/element~Element|module:engine/model/documentfragment~DocumentFragment} positionParent The parent of the
  27245. * given position.
  27246. * @param {module:engine/model/text~Text|null} textNode Text node at the given position.
  27247. * @returns {module:engine/model/node~Node|null}
  27248. */
  27249. function getNodeBeforePosition( position, positionParent, textNode ) {
  27250. if ( textNode !== null ) {
  27251. return null;
  27252. }
  27253. return positionParent.getChild( positionParent.offsetToIndex( position.offset ) - 1 );
  27254. }
  27255. /***/ }),
  27256. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/range.js":
  27257. /*!********************************************************************!*\
  27258. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/range.js ***!
  27259. \********************************************************************/
  27260. /*! exports provided: default */
  27261. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  27262. "use strict";
  27263. __webpack_require__.r(__webpack_exports__);
  27264. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Range; });
  27265. /* harmony import */ var _position__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./position */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/position.js");
  27266. /* harmony import */ var _treewalker__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./treewalker */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/treewalker.js");
  27267. /* 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");
  27268. /* 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");
  27269. /**
  27270. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  27271. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  27272. */
  27273. /**
  27274. * @module engine/model/range
  27275. */
  27276. /**
  27277. * Represents a range in the model tree.
  27278. *
  27279. * A range is defined by its {@link module:engine/model/range~Range#start} and {@link module:engine/model/range~Range#end}
  27280. * positions.
  27281. *
  27282. * You can create range instances via its constructor or the `createRange*()` factory methods of
  27283. * {@link module:engine/model/model~Model} and {@link module:engine/model/writer~Writer}.
  27284. */
  27285. class Range {
  27286. /**
  27287. * Creates a range spanning from `start` position to `end` position.
  27288. *
  27289. * @param {module:engine/model/position~Position} start Start position.
  27290. * @param {module:engine/model/position~Position} [end] End position. If not set, range will be collapsed at `start` position.
  27291. */
  27292. constructor( start, end = null ) {
  27293. /**
  27294. * Start position.
  27295. *
  27296. * @readonly
  27297. * @member {module:engine/model/position~Position}
  27298. */
  27299. this.start = _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createAt( start );
  27300. /**
  27301. * End position.
  27302. *
  27303. * @readonly
  27304. * @member {module:engine/model/position~Position}
  27305. */
  27306. this.end = end ? _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createAt( end ) : _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createAt( start );
  27307. // If the range is collapsed, treat in a similar way as a position and set its boundaries stickiness to 'toNone'.
  27308. // In other case, make the boundaries stick to the "inside" of the range.
  27309. this.start.stickiness = this.isCollapsed ? 'toNone' : 'toNext';
  27310. this.end.stickiness = this.isCollapsed ? 'toNone' : 'toPrevious';
  27311. }
  27312. /**
  27313. * Iterable interface.
  27314. *
  27315. * Iterates over all {@link module:engine/model/item~Item items} that are in this range and returns
  27316. * them together with additional information like length or {@link module:engine/model/position~Position positions},
  27317. * grouped as {@link module:engine/model/treewalker~TreeWalkerValue}.
  27318. * It iterates over all {@link module:engine/model/textproxy~TextProxy text contents} that are inside the range
  27319. * and all the {@link module:engine/model/element~Element}s that are entered into when iterating over this range.
  27320. *
  27321. * This iterator uses {@link module:engine/model/treewalker~TreeWalker} with `boundaries` set to this range
  27322. * and `ignoreElementEnd` option set to `true`.
  27323. *
  27324. * @returns {Iterable.<module:engine/model/treewalker~TreeWalkerValue>}
  27325. */
  27326. * [ Symbol.iterator ]() {
  27327. yield* new _treewalker__WEBPACK_IMPORTED_MODULE_1__["default"]( { boundaries: this, ignoreElementEnd: true } );
  27328. }
  27329. /**
  27330. * Returns whether the range is collapsed, that is if {@link #start} and
  27331. * {@link #end} positions are equal.
  27332. *
  27333. * @type {Boolean}
  27334. */
  27335. get isCollapsed() {
  27336. return this.start.isEqual( this.end );
  27337. }
  27338. /**
  27339. * Returns whether this range is flat, that is if {@link #start} position and
  27340. * {@link #end} position are in the same {@link module:engine/model/position~Position#parent}.
  27341. *
  27342. * @type {Boolean}
  27343. */
  27344. get isFlat() {
  27345. const startParentPath = this.start.getParentPath();
  27346. const endParentPath = this.end.getParentPath();
  27347. return Object(_ckeditor_ckeditor5_utils_src_comparearrays__WEBPACK_IMPORTED_MODULE_3__["default"])( startParentPath, endParentPath ) == 'same';
  27348. }
  27349. /**
  27350. * Range root element.
  27351. *
  27352. * @type {module:engine/model/element~Element|module:engine/model/documentfragment~DocumentFragment}
  27353. */
  27354. get root() {
  27355. return this.start.root;
  27356. }
  27357. /**
  27358. * Checks whether this range contains given {@link module:engine/model/position~Position position}.
  27359. *
  27360. * @param {module:engine/model/position~Position} position Position to check.
  27361. * @returns {Boolean} `true` if given {@link module:engine/model/position~Position position} is contained
  27362. * in this range,`false` otherwise.
  27363. */
  27364. containsPosition( position ) {
  27365. return position.isAfter( this.start ) && position.isBefore( this.end );
  27366. }
  27367. /**
  27368. * Checks whether this range contains given {@link ~Range range}.
  27369. *
  27370. * @param {module:engine/model/range~Range} otherRange Range to check.
  27371. * @param {Boolean} [loose=false] Whether the check is loose or strict. If the check is strict (`false`), compared range cannot
  27372. * start or end at the same position as this range boundaries. If the check is loose (`true`), compared range can start, end or
  27373. * even be equal to this range. Note that collapsed ranges are always compared in strict mode.
  27374. * @returns {Boolean} `true` if given {@link ~Range range} boundaries are contained by this range, `false` otherwise.
  27375. */
  27376. containsRange( otherRange, loose = false ) {
  27377. if ( otherRange.isCollapsed ) {
  27378. loose = false;
  27379. }
  27380. const containsStart = this.containsPosition( otherRange.start ) || ( loose && this.start.isEqual( otherRange.start ) );
  27381. const containsEnd = this.containsPosition( otherRange.end ) || ( loose && this.end.isEqual( otherRange.end ) );
  27382. return containsStart && containsEnd;
  27383. }
  27384. /**
  27385. * Checks whether given {@link module:engine/model/item~Item} is inside this range.
  27386. *
  27387. * @param {module:engine/model/item~Item} item Model item to check.
  27388. */
  27389. containsItem( item ) {
  27390. const pos = _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createBefore( item );
  27391. return this.containsPosition( pos ) || this.start.isEqual( pos );
  27392. }
  27393. /**
  27394. * Checks whether this object is of the given.
  27395. *
  27396. * range.is( 'range' ); // -> true
  27397. * range.is( 'model:range' ); // -> true
  27398. *
  27399. * range.is( 'view:range' ); // -> false
  27400. * range.is( 'documentSelection' ); // -> false
  27401. *
  27402. * {@link module:engine/model/node~Node#is Check the entire list of model objects} which implement the `is()` method.
  27403. *
  27404. * @param {String} type
  27405. * @returns {Boolean}
  27406. */
  27407. is( type ) {
  27408. return type === 'range' || type === 'model:range';
  27409. }
  27410. /**
  27411. * Two ranges are equal if their {@link #start} and {@link #end} positions are equal.
  27412. *
  27413. * @param {module:engine/model/range~Range} otherRange Range to compare with.
  27414. * @returns {Boolean} `true` if ranges are equal, `false` otherwise.
  27415. */
  27416. isEqual( otherRange ) {
  27417. return this.start.isEqual( otherRange.start ) && this.end.isEqual( otherRange.end );
  27418. }
  27419. /**
  27420. * Checks and returns whether this range intersects with given range.
  27421. *
  27422. * @param {module:engine/model/range~Range} otherRange Range to compare with.
  27423. * @returns {Boolean} `true` if ranges intersect, `false` otherwise.
  27424. */
  27425. isIntersecting( otherRange ) {
  27426. return this.start.isBefore( otherRange.end ) && this.end.isAfter( otherRange.start );
  27427. }
  27428. /**
  27429. * Computes which part(s) of this {@link ~Range range} is not a part of given {@link ~Range range}.
  27430. * Returned array contains zero, one or two {@link ~Range ranges}.
  27431. *
  27432. * Examples:
  27433. *
  27434. * let range = model.createRange(
  27435. * model.createPositionFromPath( root, [ 2, 7 ] ),
  27436. * model.createPositionFromPath( root, [ 4, 0, 1 ] )
  27437. * );
  27438. * let otherRange = model.createRange( model.createPositionFromPath( root, [ 1 ] ), model.createPositionFromPath( root, [ 5 ] ) );
  27439. * let transformed = range.getDifference( otherRange );
  27440. * // transformed array has no ranges because `otherRange` contains `range`
  27441. *
  27442. * otherRange = model.createRange( model.createPositionFromPath( root, [ 1 ] ), model.createPositionFromPath( root, [ 3 ] ) );
  27443. * transformed = range.getDifference( otherRange );
  27444. * // transformed array has one range: from [ 3 ] to [ 4, 0, 1 ]
  27445. *
  27446. * otherRange = model.createRange( model.createPositionFromPath( root, [ 3 ] ), model.createPositionFromPath( root, [ 4 ] ) );
  27447. * transformed = range.getDifference( otherRange );
  27448. * // transformed array has two ranges: from [ 2, 7 ] to [ 3 ] and from [ 4 ] to [ 4, 0, 1 ]
  27449. *
  27450. * @param {module:engine/model/range~Range} otherRange Range to differentiate against.
  27451. * @returns {Array.<module:engine/model/range~Range>} The difference between ranges.
  27452. */
  27453. getDifference( otherRange ) {
  27454. const ranges = [];
  27455. if ( this.isIntersecting( otherRange ) ) {
  27456. // Ranges intersect.
  27457. if ( this.containsPosition( otherRange.start ) ) {
  27458. // Given range start is inside this range. This means that we have to
  27459. // add shrunken range - from the start to the middle of this range.
  27460. ranges.push( new Range( this.start, otherRange.start ) );
  27461. }
  27462. if ( this.containsPosition( otherRange.end ) ) {
  27463. // Given range end is inside this range. This means that we have to
  27464. // add shrunken range - from the middle of this range to the end.
  27465. ranges.push( new Range( otherRange.end, this.end ) );
  27466. }
  27467. } else {
  27468. // Ranges do not intersect, return the original range.
  27469. ranges.push( new Range( this.start, this.end ) );
  27470. }
  27471. return ranges;
  27472. }
  27473. /**
  27474. * Returns an intersection of this {@link ~Range range} and given {@link ~Range range}.
  27475. * Intersection is a common part of both of those ranges. If ranges has no common part, returns `null`.
  27476. *
  27477. * Examples:
  27478. *
  27479. * let range = model.createRange(
  27480. * model.createPositionFromPath( root, [ 2, 7 ] ),
  27481. * model.createPositionFromPath( root, [ 4, 0, 1 ] )
  27482. * );
  27483. * let otherRange = model.createRange( model.createPositionFromPath( root, [ 1 ] ), model.createPositionFromPath( root, [ 2 ] ) );
  27484. * let transformed = range.getIntersection( otherRange ); // null - ranges have no common part
  27485. *
  27486. * otherRange = model.createRange( model.createPositionFromPath( root, [ 3 ] ), model.createPositionFromPath( root, [ 5 ] ) );
  27487. * transformed = range.getIntersection( otherRange ); // range from [ 3 ] to [ 4, 0, 1 ]
  27488. *
  27489. * @param {module:engine/model/range~Range} otherRange Range to check for intersection.
  27490. * @returns {module:engine/model/range~Range|null} A common part of given ranges or `null` if ranges have no common part.
  27491. */
  27492. getIntersection( otherRange ) {
  27493. if ( this.isIntersecting( otherRange ) ) {
  27494. // Ranges intersect, so a common range will be returned.
  27495. // At most, it will be same as this range.
  27496. let commonRangeStart = this.start;
  27497. let commonRangeEnd = this.end;
  27498. if ( this.containsPosition( otherRange.start ) ) {
  27499. // Given range start is inside this range. This means thaNt we have to
  27500. // shrink common range to the given range start.
  27501. commonRangeStart = otherRange.start;
  27502. }
  27503. if ( this.containsPosition( otherRange.end ) ) {
  27504. // Given range end is inside this range. This means that we have to
  27505. // shrink common range to the given range end.
  27506. commonRangeEnd = otherRange.end;
  27507. }
  27508. return new Range( commonRangeStart, commonRangeEnd );
  27509. }
  27510. // Ranges do not intersect, so they do not have common part.
  27511. return null;
  27512. }
  27513. /**
  27514. * Returns a range created by joining this {@link ~Range range} with the given {@link ~Range range}.
  27515. * If ranges have no common part, returns `null`.
  27516. *
  27517. * Examples:
  27518. *
  27519. * let range = model.createRange(
  27520. * model.createPositionFromPath( root, [ 2, 7 ] ),
  27521. * model.createPositionFromPath( root, [ 4, 0, 1 ] )
  27522. * );
  27523. * let otherRange = model.createRange(
  27524. * model.createPositionFromPath( root, [ 1 ] ),
  27525. * model.createPositionFromPath( root, [ 2 ] )
  27526. * );
  27527. * let transformed = range.getJoined( otherRange ); // null - ranges have no common part
  27528. *
  27529. * otherRange = model.createRange(
  27530. * model.createPositionFromPath( root, [ 3 ] ),
  27531. * model.createPositionFromPath( root, [ 5 ] )
  27532. * );
  27533. * transformed = range.getJoined( otherRange ); // range from [ 2, 7 ] to [ 5 ]
  27534. *
  27535. * @param {module:engine/model/range~Range} otherRange Range to be joined.
  27536. * @param {Boolean} [loose=false] Whether the intersection check is loose or strict. If the check is strict (`false`),
  27537. * ranges are tested for intersection or whether start/end positions are equal. If the check is loose (`true`),
  27538. * compared range is also checked if it's {@link module:engine/model/position~Position#isTouching touching} current range.
  27539. * @returns {module:engine/model/range~Range|null} A sum of given ranges or `null` if ranges have no common part.
  27540. */
  27541. getJoined( otherRange, loose = false ) {
  27542. let shouldJoin = this.isIntersecting( otherRange );
  27543. if ( !shouldJoin ) {
  27544. if ( this.start.isBefore( otherRange.start ) ) {
  27545. shouldJoin = loose ? this.end.isTouching( otherRange.start ) : this.end.isEqual( otherRange.start );
  27546. } else {
  27547. shouldJoin = loose ? otherRange.end.isTouching( this.start ) : otherRange.end.isEqual( this.start );
  27548. }
  27549. }
  27550. if ( !shouldJoin ) {
  27551. return null;
  27552. }
  27553. let startPosition = this.start;
  27554. let endPosition = this.end;
  27555. if ( otherRange.start.isBefore( startPosition ) ) {
  27556. startPosition = otherRange.start;
  27557. }
  27558. if ( otherRange.end.isAfter( endPosition ) ) {
  27559. endPosition = otherRange.end;
  27560. }
  27561. return new Range( startPosition, endPosition );
  27562. }
  27563. /**
  27564. * Computes and returns the smallest set of {@link #isFlat flat} ranges, that covers this range in whole.
  27565. *
  27566. * See an example of a model structure (`[` and `]` are range boundaries):
  27567. *
  27568. * root root
  27569. * |- element DIV DIV P2 P3 DIV
  27570. * | |- element H H P1 f o o b a r H P4
  27571. * | | |- "fir[st" fir[st lorem se]cond ipsum
  27572. * | |- element P1
  27573. * | | |- "lorem" ||
  27574. * |- element P2 ||
  27575. * | |- "foo" VV
  27576. * |- element P3
  27577. * | |- "bar" root
  27578. * |- element DIV DIV [P2 P3] DIV
  27579. * | |- element H H [P1] f o o b a r H P4
  27580. * | | |- "se]cond" fir[st] lorem [se]cond ipsum
  27581. * | |- element P4
  27582. * | | |- "ipsum"
  27583. *
  27584. * As it can be seen, letters contained in the range are: `stloremfoobarse`, spread across different parents.
  27585. * We are looking for minimal set of flat ranges that contains the same nodes.
  27586. *
  27587. * Minimal flat ranges for above range `( [ 0, 0, 3 ], [ 3, 0, 2 ] )` will be:
  27588. *
  27589. * ( [ 0, 0, 3 ], [ 0, 0, 5 ] ) = "st"
  27590. * ( [ 0, 1 ], [ 0, 2 ] ) = element P1 ("lorem")
  27591. * ( [ 1 ], [ 3 ] ) = element P2, element P3 ("foobar")
  27592. * ( [ 3, 0, 0 ], [ 3, 0, 2 ] ) = "se"
  27593. *
  27594. * **Note:** if an {@link module:engine/model/element~Element element} is not wholly contained in this range, it won't be returned
  27595. * in any of the returned flat ranges. See in the example how `H` elements at the beginning and at the end of the range
  27596. * were omitted. Only their parts that were wholly in the range were returned.
  27597. *
  27598. * **Note:** this method is not returning flat ranges that contain no nodes.
  27599. *
  27600. * @returns {Array.<module:engine/model/range~Range>} Array of flat ranges covering this range.
  27601. */
  27602. getMinimalFlatRanges() {
  27603. const ranges = [];
  27604. const diffAt = this.start.getCommonPath( this.end ).length;
  27605. const pos = _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createAt( this.start );
  27606. let posParent = pos.parent;
  27607. // Go up.
  27608. while ( pos.path.length > diffAt + 1 ) {
  27609. const howMany = posParent.maxOffset - pos.offset;
  27610. if ( howMany !== 0 ) {
  27611. ranges.push( new Range( pos, pos.getShiftedBy( howMany ) ) );
  27612. }
  27613. pos.path = pos.path.slice( 0, -1 );
  27614. pos.offset++;
  27615. posParent = posParent.parent;
  27616. }
  27617. // Go down.
  27618. while ( pos.path.length <= this.end.path.length ) {
  27619. const offset = this.end.path[ pos.path.length - 1 ];
  27620. const howMany = offset - pos.offset;
  27621. if ( howMany !== 0 ) {
  27622. ranges.push( new Range( pos, pos.getShiftedBy( howMany ) ) );
  27623. }
  27624. pos.offset = offset;
  27625. pos.path.push( 0 );
  27626. }
  27627. return ranges;
  27628. }
  27629. /**
  27630. * Creates a {@link module:engine/model/treewalker~TreeWalker TreeWalker} instance with this range as a boundary.
  27631. *
  27632. * For example, to iterate over all items in the entire document root:
  27633. *
  27634. * // Create a range spanning over the entire root content:
  27635. * const range = editor.model.createRangeIn( editor.model.document.getRoot() );
  27636. *
  27637. * // Iterate over all items in this range:
  27638. * for ( const value of range.getWalker() ) {
  27639. * console.log( value.item );
  27640. * }
  27641. *
  27642. * @param {Object} options Object with configuration options. See {@link module:engine/model/treewalker~TreeWalker}.
  27643. * @param {module:engine/model/position~Position} [options.startPosition]
  27644. * @param {Boolean} [options.singleCharacters=false]
  27645. * @param {Boolean} [options.shallow=false]
  27646. * @param {Boolean} [options.ignoreElementEnd=false]
  27647. * @returns {module:engine/model/treewalker~TreeWalker}
  27648. */
  27649. getWalker( options = {} ) {
  27650. options.boundaries = this;
  27651. return new _treewalker__WEBPACK_IMPORTED_MODULE_1__["default"]( options );
  27652. }
  27653. /**
  27654. * Returns an iterator that iterates over all {@link module:engine/model/item~Item items} that are in this range and returns
  27655. * them.
  27656. *
  27657. * This method uses {@link module:engine/model/treewalker~TreeWalker} with `boundaries` set to this range and `ignoreElementEnd` option
  27658. * set to `true`. However it returns only {@link module:engine/model/item~Item model items},
  27659. * not {@link module:engine/model/treewalker~TreeWalkerValue}.
  27660. *
  27661. * You may specify additional options for the tree walker. See {@link module:engine/model/treewalker~TreeWalker} for
  27662. * a full list of available options.
  27663. *
  27664. * @param {Object} options Object with configuration options. See {@link module:engine/model/treewalker~TreeWalker}.
  27665. * @returns {Iterable.<module:engine/model/item~Item>}
  27666. */
  27667. * getItems( options = {} ) {
  27668. options.boundaries = this;
  27669. options.ignoreElementEnd = true;
  27670. const treeWalker = new _treewalker__WEBPACK_IMPORTED_MODULE_1__["default"]( options );
  27671. for ( const value of treeWalker ) {
  27672. yield value.item;
  27673. }
  27674. }
  27675. /**
  27676. * Returns an iterator that iterates over all {@link module:engine/model/position~Position positions} that are boundaries or
  27677. * contained in this range.
  27678. *
  27679. * This method uses {@link module:engine/model/treewalker~TreeWalker} with `boundaries` set to this range. However it returns only
  27680. * {@link module:engine/model/position~Position positions}, not {@link module:engine/model/treewalker~TreeWalkerValue}.
  27681. *
  27682. * You may specify additional options for the tree walker. See {@link module:engine/model/treewalker~TreeWalker} for
  27683. * a full list of available options.
  27684. *
  27685. * @param {Object} options Object with configuration options. See {@link module:engine/model/treewalker~TreeWalker}.
  27686. * @returns {Iterable.<module:engine/model/position~Position>}
  27687. */
  27688. * getPositions( options = {} ) {
  27689. options.boundaries = this;
  27690. const treeWalker = new _treewalker__WEBPACK_IMPORTED_MODULE_1__["default"]( options );
  27691. yield treeWalker.position;
  27692. for ( const value of treeWalker ) {
  27693. yield value.nextPosition;
  27694. }
  27695. }
  27696. /**
  27697. * Returns a range that is a result of transforming this range by given `operation`.
  27698. *
  27699. * **Note:** transformation may break one range into multiple ranges (for example, when a part of the range is
  27700. * moved to a different part of document tree). For this reason, an array is returned by this method and it
  27701. * may contain one or more `Range` instances.
  27702. *
  27703. * @param {module:engine/model/operation/operation~Operation} operation Operation to transform range by.
  27704. * @returns {Array.<module:engine/model/range~Range>} Range which is the result of transformation.
  27705. */
  27706. getTransformedByOperation( operation ) {
  27707. switch ( operation.type ) {
  27708. case 'insert':
  27709. return this._getTransformedByInsertOperation( operation );
  27710. case 'move':
  27711. case 'remove':
  27712. case 'reinsert':
  27713. return this._getTransformedByMoveOperation( operation );
  27714. case 'split':
  27715. return [ this._getTransformedBySplitOperation( operation ) ];
  27716. case 'merge':
  27717. return [ this._getTransformedByMergeOperation( operation ) ];
  27718. }
  27719. return [ new Range( this.start, this.end ) ];
  27720. }
  27721. /**
  27722. * Returns a range that is a result of transforming this range by multiple `operations`.
  27723. *
  27724. * @see ~Range#getTransformedByOperation
  27725. * @param {Iterable.<module:engine/model/operation/operation~Operation>} operations Operations to transform the range by.
  27726. * @returns {Array.<module:engine/model/range~Range>} Range which is the result of transformation.
  27727. */
  27728. getTransformedByOperations( operations ) {
  27729. const ranges = [ new Range( this.start, this.end ) ];
  27730. for ( const operation of operations ) {
  27731. for ( let i = 0; i < ranges.length; i++ ) {
  27732. const result = ranges[ i ].getTransformedByOperation( operation );
  27733. ranges.splice( i, 1, ...result );
  27734. i += result.length - 1;
  27735. }
  27736. }
  27737. // It may happen that a range is split into two, and then the part of second "piece" is moved into first
  27738. // "piece". In this case we will have incorrect third range, which should not be included in the result --
  27739. // because it is already included in the first "piece". In this loop we are looking for all such ranges that
  27740. // are inside other ranges and we simply remove them.
  27741. for ( let i = 0; i < ranges.length; i++ ) {
  27742. const range = ranges[ i ];
  27743. for ( let j = i + 1; j < ranges.length; j++ ) {
  27744. const next = ranges[ j ];
  27745. if ( range.containsRange( next ) || next.containsRange( range ) || range.isEqual( next ) ) {
  27746. ranges.splice( j, 1 );
  27747. }
  27748. }
  27749. }
  27750. return ranges;
  27751. }
  27752. /**
  27753. * Returns an {@link module:engine/model/element~Element} or {@link module:engine/model/documentfragment~DocumentFragment}
  27754. * which is a common ancestor of the range's both ends (in which the entire range is contained).
  27755. *
  27756. * @returns {module:engine/model/element~Element|module:engine/model/documentfragment~DocumentFragment|null}
  27757. */
  27758. getCommonAncestor() {
  27759. return this.start.getCommonAncestor( this.end );
  27760. }
  27761. /**
  27762. * Returns an {@link module:engine/model/element~Element Element} contained by the range.
  27763. * The element will be returned when it is the **only** node within the range and **fully–contained**
  27764. * at the same time.
  27765. *
  27766. * @returns {module:engine/model/element~Element|null}
  27767. */
  27768. getContainedElement() {
  27769. if ( this.isCollapsed ) {
  27770. return null;
  27771. }
  27772. const nodeAfterStart = this.start.nodeAfter;
  27773. const nodeBeforeEnd = this.end.nodeBefore;
  27774. if ( nodeAfterStart && nodeAfterStart.is( 'element' ) && nodeAfterStart === nodeBeforeEnd ) {
  27775. return nodeAfterStart;
  27776. }
  27777. return null;
  27778. }
  27779. /**
  27780. * Converts `Range` to plain object and returns it.
  27781. *
  27782. * @returns {Object} `Node` converted to plain object.
  27783. */
  27784. toJSON() {
  27785. return {
  27786. start: this.start.toJSON(),
  27787. end: this.end.toJSON()
  27788. };
  27789. }
  27790. /**
  27791. * Returns a new range that is equal to current range.
  27792. *
  27793. * @returns {module:engine/model/range~Range}
  27794. */
  27795. clone() {
  27796. return new this.constructor( this.start, this.end );
  27797. }
  27798. /**
  27799. * Returns a result of transforming a copy of this range by insert operation.
  27800. *
  27801. * One or more ranges may be returned as a result of this transformation.
  27802. *
  27803. * @protected
  27804. * @param {module:engine/model/operation/insertoperation~InsertOperation} operation
  27805. * @returns {Array.<module:engine/model/range~Range>}
  27806. */
  27807. _getTransformedByInsertOperation( operation, spread = false ) {
  27808. return this._getTransformedByInsertion( operation.position, operation.howMany, spread );
  27809. }
  27810. /**
  27811. * Returns a result of transforming a copy of this range by move operation.
  27812. *
  27813. * One or more ranges may be returned as a result of this transformation.
  27814. *
  27815. * @protected
  27816. * @param {module:engine/model/operation/moveoperation~MoveOperation} operation
  27817. * @returns {Array.<module:engine/model/range~Range>}
  27818. */
  27819. _getTransformedByMoveOperation( operation, spread = false ) {
  27820. const sourcePosition = operation.sourcePosition;
  27821. const howMany = operation.howMany;
  27822. const targetPosition = operation.targetPosition;
  27823. return this._getTransformedByMove( sourcePosition, targetPosition, howMany, spread );
  27824. }
  27825. /**
  27826. * Returns a result of transforming a copy of this range by split operation.
  27827. *
  27828. * Always one range is returned. The transformation is done in a way to not break the range.
  27829. *
  27830. * @protected
  27831. * @param {module:engine/model/operation/splitoperation~SplitOperation} operation
  27832. * @returns {module:engine/model/range~Range}
  27833. */
  27834. _getTransformedBySplitOperation( operation ) {
  27835. const start = this.start._getTransformedBySplitOperation( operation );
  27836. let end = this.end._getTransformedBySplitOperation( operation );
  27837. if ( this.end.isEqual( operation.insertionPosition ) ) {
  27838. end = this.end.getShiftedBy( 1 );
  27839. }
  27840. // Below may happen when range contains graveyard element used by split operation.
  27841. if ( start.root != end.root ) {
  27842. // End position was next to the moved graveyard element and was moved with it.
  27843. // Fix it by using old `end` which has proper `root`.
  27844. end = this.end.getShiftedBy( -1 );
  27845. }
  27846. return new Range( start, end );
  27847. }
  27848. /**
  27849. * Returns a result of transforming a copy of this range by merge operation.
  27850. *
  27851. * Always one range is returned. The transformation is done in a way to not break the range.
  27852. *
  27853. * @protected
  27854. * @param {module:engine/model/operation/mergeoperation~MergeOperation} operation
  27855. * @returns {module:engine/model/range~Range}
  27856. */
  27857. _getTransformedByMergeOperation( operation ) {
  27858. // Special case when the marker is set on "the closing tag" of an element. Marker can be set like that during
  27859. // transformations, especially when a content of a few block elements were removed. For example:
  27860. //
  27861. // {} is the transformed range, [] is the removed range.
  27862. // <p>F[o{o</p><p>B}ar</p><p>Xy]z</p>
  27863. //
  27864. // <p>Fo{o</p><p>B}ar</p><p>z</p>
  27865. // <p>F{</p><p>B}ar</p><p>z</p>
  27866. // <p>F{</p>}<p>z</p>
  27867. // <p>F{}z</p>
  27868. //
  27869. if ( this.start.isEqual( operation.targetPosition ) && this.end.isEqual( operation.deletionPosition ) ) {
  27870. return new Range( this.start );
  27871. }
  27872. let start = this.start._getTransformedByMergeOperation( operation );
  27873. let end = this.end._getTransformedByMergeOperation( operation );
  27874. if ( start.root != end.root ) {
  27875. // This happens when the end position was next to the merged (deleted) element.
  27876. // Then, the end position was moved to the graveyard root. In this case we need to fix
  27877. // the range cause its boundaries would be in different roots.
  27878. end = this.end.getShiftedBy( -1 );
  27879. }
  27880. if ( start.isAfter( end ) ) {
  27881. // This happens in three following cases:
  27882. //
  27883. // Case 1: Merge operation source position is before the target position (due to some transformations, OT, etc.)
  27884. // This means that start can be moved before the end of the range.
  27885. //
  27886. // Before: <p>a{a</p><p>b}b</p><p>cc</p>
  27887. // Merge: <p>b}b</p><p>cca{a</p>
  27888. // Fix: <p>{b}b</p><p>ccaa</p>
  27889. //
  27890. // Case 2: Range start is before merged node but not directly.
  27891. // Result should include all nodes that were in the original range.
  27892. //
  27893. // Before: <p>aa</p>{<p>cc</p><p>b}b</p>
  27894. // Merge: <p>aab}b</p>{<p>cc</p>
  27895. // Fix: <p>aa{bb</p><p>cc</p>}
  27896. //
  27897. // The range is expanded by an additional `b` letter but it is better than dropping the whole `cc` paragraph.
  27898. //
  27899. // Case 3: Range start is directly before merged node.
  27900. // Resulting range should include only nodes from the merged element:
  27901. //
  27902. // Before: <p>aa</p>{<p>b}b</p><p>cc</p>
  27903. // Merge: <p>aab}b</p>{<p>cc</p>
  27904. // Fix: <p>aa{b}b</p><p>cc</p>
  27905. //
  27906. if ( operation.sourcePosition.isBefore( operation.targetPosition ) ) {
  27907. // Case 1.
  27908. start = _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createAt( end );
  27909. start.offset = 0;
  27910. } else {
  27911. if ( !operation.deletionPosition.isEqual( start ) ) {
  27912. // Case 2.
  27913. end = operation.deletionPosition;
  27914. }
  27915. // In both case 2 and 3 start is at the end of the merge-to element.
  27916. start = operation.targetPosition;
  27917. }
  27918. return new Range( start, end );
  27919. }
  27920. return new Range( start, end );
  27921. }
  27922. /**
  27923. * Returns an array containing one or two {@link ~Range ranges} that are a result of transforming this
  27924. * {@link ~Range range} by inserting `howMany` nodes at `insertPosition`. Two {@link ~Range ranges} are
  27925. * returned if the insertion was inside this {@link ~Range range} and `spread` is set to `true`.
  27926. *
  27927. * Examples:
  27928. *
  27929. * let range = model.createRange(
  27930. * model.createPositionFromPath( root, [ 2, 7 ] ),
  27931. * model.createPositionFromPath( root, [ 4, 0, 1 ] )
  27932. * );
  27933. * let transformed = range._getTransformedByInsertion( model.createPositionFromPath( root, [ 1 ] ), 2 );
  27934. * // transformed array has one range from [ 4, 7 ] to [ 6, 0, 1 ]
  27935. *
  27936. * transformed = range._getTransformedByInsertion( model.createPositionFromPath( root, [ 4, 0, 0 ] ), 4 );
  27937. * // transformed array has one range from [ 2, 7 ] to [ 4, 0, 5 ]
  27938. *
  27939. * transformed = range._getTransformedByInsertion( model.createPositionFromPath( root, [ 3, 2 ] ), 4 );
  27940. * // transformed array has one range, which is equal to original range
  27941. *
  27942. * transformed = range._getTransformedByInsertion( model.createPositionFromPath( root, [ 3, 2 ] ), 4, true );
  27943. * // transformed array has two ranges: from [ 2, 7 ] to [ 3, 2 ] and from [ 3, 6 ] to [ 4, 0, 1 ]
  27944. *
  27945. * @protected
  27946. * @param {module:engine/model/position~Position} insertPosition Position where nodes are inserted.
  27947. * @param {Number} howMany How many nodes are inserted.
  27948. * @param {Boolean} [spread] Flag indicating whether this {~Range range} should be spread if insertion
  27949. * was inside the range. Defaults to `false`.
  27950. * @returns {Array.<module:engine/model/range~Range>} Result of the transformation.
  27951. */
  27952. _getTransformedByInsertion( insertPosition, howMany, spread = false ) {
  27953. if ( spread && this.containsPosition( insertPosition ) ) {
  27954. // Range has to be spread. The first part is from original start to the spread point.
  27955. // The other part is from spread point to the original end, but transformed by
  27956. // insertion to reflect insertion changes.
  27957. return [
  27958. new Range( this.start, insertPosition ),
  27959. new Range(
  27960. insertPosition.getShiftedBy( howMany ),
  27961. this.end._getTransformedByInsertion( insertPosition, howMany )
  27962. )
  27963. ];
  27964. } else {
  27965. const range = new Range( this.start, this.end );
  27966. range.start = range.start._getTransformedByInsertion( insertPosition, howMany );
  27967. range.end = range.end._getTransformedByInsertion( insertPosition, howMany );
  27968. return [ range ];
  27969. }
  27970. }
  27971. /**
  27972. * Returns an array containing {@link ~Range ranges} that are a result of transforming this
  27973. * {@link ~Range range} by moving `howMany` nodes from `sourcePosition` to `targetPosition`.
  27974. *
  27975. * @protected
  27976. * @param {module:engine/model/position~Position} sourcePosition Position from which nodes are moved.
  27977. * @param {module:engine/model/position~Position} targetPosition Position to where nodes are moved.
  27978. * @param {Number} howMany How many nodes are moved.
  27979. * @param {Boolean} [spread=false] Whether the range should be spread if the move points inside the range.
  27980. * @returns {Array.<module:engine/model/range~Range>} Result of the transformation.
  27981. */
  27982. _getTransformedByMove( sourcePosition, targetPosition, howMany, spread = false ) {
  27983. // Special case for transforming a collapsed range. Just transform it like a position.
  27984. if ( this.isCollapsed ) {
  27985. const newPos = this.start._getTransformedByMove( sourcePosition, targetPosition, howMany );
  27986. return [ new Range( newPos ) ];
  27987. }
  27988. // Special case for transformation when a part of the range is moved towards the range.
  27989. //
  27990. // Examples:
  27991. //
  27992. // <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>
  27993. // <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>
  27994. //
  27995. // Without this special condition, the default algorithm leaves an "artifact" range from one of `differenceSet` parts:
  27996. //
  27997. // <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>
  27998. //
  27999. // This special case is applied only if the range is to be kept together (not spread).
  28000. const moveRange = Range._createFromPositionAndShift( sourcePosition, howMany );
  28001. const insertPosition = targetPosition._getTransformedByDeletion( sourcePosition, howMany );
  28002. if ( this.containsPosition( targetPosition ) && !spread ) {
  28003. if ( moveRange.containsPosition( this.start ) || moveRange.containsPosition( this.end ) ) {
  28004. const start = this.start._getTransformedByMove( sourcePosition, targetPosition, howMany );
  28005. const end = this.end._getTransformedByMove( sourcePosition, targetPosition, howMany );
  28006. return [ new Range( start, end ) ];
  28007. }
  28008. }
  28009. // Default algorithm.
  28010. let result;
  28011. const differenceSet = this.getDifference( moveRange );
  28012. let difference = null;
  28013. const common = this.getIntersection( moveRange );
  28014. if ( differenceSet.length == 1 ) {
  28015. // `moveRange` and this range may intersect but may be separate.
  28016. difference = new Range(
  28017. differenceSet[ 0 ].start._getTransformedByDeletion( sourcePosition, howMany ),
  28018. differenceSet[ 0 ].end._getTransformedByDeletion( sourcePosition, howMany )
  28019. );
  28020. } else if ( differenceSet.length == 2 ) {
  28021. // `moveRange` is inside this range.
  28022. difference = new Range(
  28023. this.start,
  28024. this.end._getTransformedByDeletion( sourcePosition, howMany )
  28025. );
  28026. } // else, `moveRange` contains this range.
  28027. if ( difference ) {
  28028. result = difference._getTransformedByInsertion( insertPosition, howMany, common !== null || spread );
  28029. } else {
  28030. result = [];
  28031. }
  28032. if ( common ) {
  28033. const transformedCommon = new Range(
  28034. common.start._getCombined( moveRange.start, insertPosition ),
  28035. common.end._getCombined( moveRange.start, insertPosition )
  28036. );
  28037. if ( result.length == 2 ) {
  28038. result.splice( 1, 0, transformedCommon );
  28039. } else {
  28040. result.push( transformedCommon );
  28041. }
  28042. }
  28043. return result;
  28044. }
  28045. /**
  28046. * Returns a copy of this range that is transformed by deletion of `howMany` nodes from `deletePosition`.
  28047. *
  28048. * If the deleted range is intersecting with the transformed range, the transformed range will be shrank.
  28049. *
  28050. * If the deleted range contains transformed range, `null` will be returned.
  28051. *
  28052. * @protected
  28053. * @param {module:engine/model/position~Position} deletionPosition Position from which nodes are removed.
  28054. * @param {Number} howMany How many nodes are removed.
  28055. * @returns {module:engine/model/range~Range|null} Result of the transformation.
  28056. */
  28057. _getTransformedByDeletion( deletePosition, howMany ) {
  28058. let newStart = this.start._getTransformedByDeletion( deletePosition, howMany );
  28059. let newEnd = this.end._getTransformedByDeletion( deletePosition, howMany );
  28060. if ( newStart == null && newEnd == null ) {
  28061. return null;
  28062. }
  28063. if ( newStart == null ) {
  28064. newStart = deletePosition;
  28065. }
  28066. if ( newEnd == null ) {
  28067. newEnd = deletePosition;
  28068. }
  28069. return new Range( newStart, newEnd );
  28070. }
  28071. /**
  28072. * Creates a new range, spreading from specified {@link module:engine/model/position~Position position} to a position moved by
  28073. * given `shift`. If `shift` is a negative value, shifted position is treated as the beginning of the range.
  28074. *
  28075. * @protected
  28076. * @param {module:engine/model/position~Position} position Beginning of the range.
  28077. * @param {Number} shift How long the range should be.
  28078. * @returns {module:engine/model/range~Range}
  28079. */
  28080. static _createFromPositionAndShift( position, shift ) {
  28081. const start = position;
  28082. const end = position.getShiftedBy( shift );
  28083. return shift > 0 ? new this( start, end ) : new this( end, start );
  28084. }
  28085. /**
  28086. * Creates a range inside an {@link module:engine/model/element~Element element} which starts before the first child of
  28087. * that element and ends after the last child of that element.
  28088. *
  28089. * @protected
  28090. * @param {module:engine/model/element~Element} element Element which is a parent for the range.
  28091. * @returns {module:engine/model/range~Range}
  28092. */
  28093. static _createIn( element ) {
  28094. return new this( _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createAt( element, 0 ), _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createAt( element, element.maxOffset ) );
  28095. }
  28096. /**
  28097. * Creates a range that starts before given {@link module:engine/model/item~Item model item} and ends after it.
  28098. *
  28099. * @protected
  28100. * @param {module:engine/model/item~Item} item
  28101. * @returns {module:engine/model/range~Range}
  28102. */
  28103. static _createOn( item ) {
  28104. return this._createFromPositionAndShift( _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createBefore( item ), item.offsetSize );
  28105. }
  28106. /**
  28107. * Combines all ranges from the passed array into a one range. At least one range has to be passed.
  28108. * Passed ranges must not have common parts.
  28109. *
  28110. * The first range from the array is a reference range. If other ranges start or end on the exactly same position where
  28111. * the reference range, they get combined into one range.
  28112. *
  28113. * [ ][] [ ][ ][ ][ ][] [ ] // Passed ranges, shown sorted
  28114. * [ ] // The result of the function if the first range was a reference range.
  28115. * [ ] // The result of the function if the third-to-seventh range was a reference range.
  28116. * [ ] // The result of the function if the last range was a reference range.
  28117. *
  28118. * @param {Array.<module:engine/model/range~Range>} ranges Ranges to combine.
  28119. * @returns {module:engine/model/range~Range} Combined range.
  28120. */
  28121. static _createFromRanges( ranges ) {
  28122. if ( ranges.length === 0 ) {
  28123. /**
  28124. * At least one range has to be passed to
  28125. * {@link module:engine/model/range~Range._createFromRanges `Range._createFromRanges()`}.
  28126. *
  28127. * @error range-create-from-ranges-empty-array
  28128. */
  28129. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__["default"](
  28130. 'range-create-from-ranges-empty-array',
  28131. null
  28132. );
  28133. } else if ( ranges.length == 1 ) {
  28134. return ranges[ 0 ].clone();
  28135. }
  28136. // 1. Set the first range in `ranges` array as a reference range.
  28137. // If we are going to return just a one range, one of the ranges need to be the reference one.
  28138. // Other ranges will be stuck to that range, if possible.
  28139. const ref = ranges[ 0 ];
  28140. // 2. Sort all the ranges so it's easier to process them.
  28141. ranges.sort( ( a, b ) => {
  28142. return a.start.isAfter( b.start ) ? 1 : -1;
  28143. } );
  28144. // 3. Check at which index the reference range is now.
  28145. const refIndex = ranges.indexOf( ref );
  28146. // 4. At this moment we don't need the original range.
  28147. // We are going to modify the result and we need to return a new instance of Range.
  28148. // We have to create a copy of the reference range.
  28149. const result = new this( ref.start, ref.end );
  28150. // 5. Ranges should be checked and glued starting from the range that is closest to the reference range.
  28151. // Since ranges are sorted, start with the range with index that is closest to reference range index.
  28152. if ( refIndex > 0 ) {
  28153. for ( let i = refIndex - 1; true; i++ ) {
  28154. if ( ranges[ i ].end.isEqual( result.start ) ) {
  28155. result.start = _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createAt( ranges[ i ].start );
  28156. } else {
  28157. // If ranges are not starting/ending at the same position there is no point in looking further.
  28158. break;
  28159. }
  28160. }
  28161. }
  28162. // 6. Ranges should be checked and glued starting from the range that is closest to the reference range.
  28163. // Since ranges are sorted, start with the range with index that is closest to reference range index.
  28164. for ( let i = refIndex + 1; i < ranges.length; i++ ) {
  28165. if ( ranges[ i ].start.isEqual( result.end ) ) {
  28166. result.end = _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createAt( ranges[ i ].end );
  28167. } else {
  28168. // If ranges are not starting/ending at the same position there is no point in looking further.
  28169. break;
  28170. }
  28171. }
  28172. return result;
  28173. }
  28174. /**
  28175. * Creates a `Range` instance from given plain object (i.e. parsed JSON string).
  28176. *
  28177. * @param {Object} json Plain object to be converted to `Range`.
  28178. * @param {module:engine/model/document~Document} doc Document object that will be range owner.
  28179. * @returns {module:engine/model/range~Range} `Range` instance created using given plain object.
  28180. */
  28181. static fromJSON( json, doc ) {
  28182. return new this( _position__WEBPACK_IMPORTED_MODULE_0__["default"].fromJSON( json.start, doc ), _position__WEBPACK_IMPORTED_MODULE_0__["default"].fromJSON( json.end, doc ) );
  28183. }
  28184. // @if CK_DEBUG_ENGINE // toString() {
  28185. // @if CK_DEBUG_ENGINE // return `${ this.root } [ ${ this.start.path.join( ', ' ) } ] - [ ${ this.end.path.join( ', ' ) } ]`;
  28186. // @if CK_DEBUG_ENGINE // }
  28187. // @if CK_DEBUG_ENGINE // log() {
  28188. // @if CK_DEBUG_ENGINE // console.log( 'ModelPosition: ' + this );
  28189. // @if CK_DEBUG_ENGINE // }
  28190. }
  28191. /***/ }),
  28192. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/rootelement.js":
  28193. /*!**************************************************************************!*\
  28194. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/rootelement.js ***!
  28195. \**************************************************************************/
  28196. /*! exports provided: default */
  28197. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  28198. "use strict";
  28199. __webpack_require__.r(__webpack_exports__);
  28200. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return RootElement; });
  28201. /* harmony import */ var _element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./element */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/element.js");
  28202. /**
  28203. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  28204. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  28205. */
  28206. /**
  28207. * @module engine/model/rootelement
  28208. */
  28209. /**
  28210. * Type of {@link module:engine/model/element~Element} that is a root of a model tree.
  28211. * @extends module:engine/model/element~Element
  28212. */
  28213. class RootElement extends _element__WEBPACK_IMPORTED_MODULE_0__["default"] {
  28214. /**
  28215. * Creates root element.
  28216. *
  28217. * @param {module:engine/model/document~Document} document Document that is an owner of this root.
  28218. * @param {String} name Node name.
  28219. * @param {String} [rootName='main'] Unique root name used to identify this root
  28220. * element by {@link module:engine/model/document~Document}.
  28221. */
  28222. constructor( document, name, rootName = 'main' ) {
  28223. super( name );
  28224. /**
  28225. * Document that is an owner of this root.
  28226. *
  28227. * @private
  28228. * @member {module:engine/model/document~Document}
  28229. */
  28230. this._document = document;
  28231. /**
  28232. * Unique root name used to identify this root element by {@link module:engine/model/document~Document}.
  28233. *
  28234. * @readonly
  28235. * @member {String}
  28236. */
  28237. this.rootName = rootName;
  28238. }
  28239. /**
  28240. * {@link module:engine/model/document~Document Document} that owns this root element.
  28241. *
  28242. * @readonly
  28243. * @type {module:engine/model/document~Document|null}
  28244. */
  28245. get document() {
  28246. return this._document;
  28247. }
  28248. /**
  28249. * Checks whether this object is of the given.
  28250. *
  28251. * rootElement.is( 'rootElement' ); // -> true
  28252. * rootElement.is( 'element' ); // -> true
  28253. * rootElement.is( 'node' ); // -> true
  28254. * rootElement.is( 'model:rootElement' ); // -> true
  28255. * rootElement.is( 'model:element' ); // -> true
  28256. * rootElement.is( 'model:node' ); // -> true
  28257. *
  28258. * rootElement.is( 'view:element' ); // -> false
  28259. * rootElement.is( 'documentFragment' ); // -> false
  28260. *
  28261. * Assuming that the object being checked is an element, you can also check its
  28262. * {@link module:engine/model/element~Element#name name}:
  28263. *
  28264. * rootElement.is( 'rootElement', '$root' ); // -> same as above
  28265. *
  28266. * {@link module:engine/model/node~Node#is Check the entire list of model objects} which implement the `is()` method.
  28267. *
  28268. * @param {String} type Type to check.
  28269. * @param {String} [name] Element name.
  28270. * @returns {Boolean}
  28271. */
  28272. is( type, name ) {
  28273. if ( !name ) {
  28274. return type === 'rootElement' || type === 'model:rootElement' ||
  28275. // From super.is(). This is highly utilised method and cannot call super. See ckeditor/ckeditor5#6529.
  28276. type === 'element' || type === 'model:element' ||
  28277. type === 'node' || type === 'model:node';
  28278. }
  28279. return name === this.name && (
  28280. type === 'rootElement' || type === 'model:rootElement' ||
  28281. // From super.is(). This is highly utilised method and cannot call super. See ckeditor/ckeditor5#6529.
  28282. type === 'element' || type === 'model:element'
  28283. );
  28284. }
  28285. /**
  28286. * Converts `RootElement` instance to `String` containing it's name.
  28287. *
  28288. * @returns {String} `RootElement` instance converted to `String`.
  28289. */
  28290. toJSON() {
  28291. return this.rootName;
  28292. }
  28293. // @if CK_DEBUG_ENGINE // toString() {
  28294. // @if CK_DEBUG_ENGINE // return this.rootName;
  28295. // @if CK_DEBUG_ENGINE // }
  28296. // @if CK_DEBUG_ENGINE // log() {
  28297. // @if CK_DEBUG_ENGINE // console.log( 'ModelRootElement: ' + this );
  28298. // @if CK_DEBUG_ENGINE // }
  28299. }
  28300. /***/ }),
  28301. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/schema.js":
  28302. /*!*********************************************************************!*\
  28303. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/schema.js ***!
  28304. \*********************************************************************/
  28305. /*! exports provided: default, SchemaContext */
  28306. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  28307. "use strict";
  28308. __webpack_require__.r(__webpack_exports__);
  28309. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Schema; });
  28310. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SchemaContext", function() { return SchemaContext; });
  28311. /* 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");
  28312. /* 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");
  28313. /* 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");
  28314. /* harmony import */ var _range__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./range */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/range.js");
  28315. /* harmony import */ var _position__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./position */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/position.js");
  28316. /* harmony import */ var _element__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./element */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/element.js");
  28317. /* harmony import */ var _text__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./text */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/text.js");
  28318. /* harmony import */ var _treewalker__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./treewalker */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/treewalker.js");
  28319. /**
  28320. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  28321. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  28322. */
  28323. /**
  28324. * @module engine/model/schema
  28325. */
  28326. /**
  28327. * The model's schema. It defines allowed and disallowed structures of nodes as well as nodes' attributes.
  28328. * The schema is usually defined by features and based on them the editing framework and features
  28329. * make decisions how to change and process the model.
  28330. *
  28331. * The instance of schema is available in {@link module:engine/model/model~Model#schema `editor.model.schema`}.
  28332. *
  28333. * Read more about the schema in:
  28334. *
  28335. * * {@glink framework/guides/architecture/editing-engine#schema Schema} section of the
  28336. * {@glink framework/guides/architecture/editing-engine Introduction to the Editing engine architecture}.
  28337. * * {@glink framework/guides/deep-dive/schema Schema deep dive} guide.
  28338. *
  28339. * @mixes module:utils/observablemixin~ObservableMixin
  28340. */
  28341. class Schema {
  28342. /**
  28343. * Creates schema instance.
  28344. */
  28345. constructor() {
  28346. this._sourceDefinitions = {};
  28347. /**
  28348. * A dictionary containing attribute properties.
  28349. *
  28350. * @private
  28351. * @member {Object.<String,String>}
  28352. */
  28353. this._attributeProperties = {};
  28354. this.decorate( 'checkChild' );
  28355. this.decorate( 'checkAttribute' );
  28356. this.on( 'checkAttribute', ( evt, args ) => {
  28357. args[ 0 ] = new SchemaContext( args[ 0 ] );
  28358. }, { priority: 'highest' } );
  28359. this.on( 'checkChild', ( evt, args ) => {
  28360. args[ 0 ] = new SchemaContext( args[ 0 ] );
  28361. args[ 1 ] = this.getDefinition( args[ 1 ] );
  28362. }, { priority: 'highest' } );
  28363. }
  28364. /**
  28365. * Registers schema item. Can only be called once for every item name.
  28366. *
  28367. * schema.register( 'paragraph', {
  28368. * inheritAllFrom: '$block'
  28369. * } );
  28370. *
  28371. * @param {String} itemName
  28372. * @param {module:engine/model/schema~SchemaItemDefinition} definition
  28373. */
  28374. register( itemName, definition ) {
  28375. if ( this._sourceDefinitions[ itemName ] ) {
  28376. /**
  28377. * A single item cannot be registered twice in the schema.
  28378. *
  28379. * This situation may happen when:
  28380. *
  28381. * * Two or more plugins called {@link #register `register()`} with the same name. This will usually mean that
  28382. * there is a collision between plugins which try to use the same element in the model. Unfortunately,
  28383. * the only way to solve this is by modifying one of these plugins to use a unique model element name.
  28384. * * A single plugin was loaded twice. This happens when it is installed by npm/yarn in two versions
  28385. * and usually means one or more of the following issues:
  28386. * * a version mismatch (two of your dependencies require two different versions of this plugin),
  28387. * * incorrect imports (this plugin is somehow imported twice in a way which confuses webpack),
  28388. * * mess in `node_modules/` (`rm -rf node_modules/` may help).
  28389. *
  28390. * **Note:** Check the logged `itemName` to better understand which plugin was duplicated/conflicting.
  28391. *
  28392. * @param itemName The name of the model element that is being registered twice.
  28393. * @error schema-cannot-register-item-twice
  28394. */
  28395. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"](
  28396. 'schema-cannot-register-item-twice',
  28397. this,
  28398. {
  28399. itemName
  28400. }
  28401. );
  28402. }
  28403. this._sourceDefinitions[ itemName ] = [
  28404. Object.assign( {}, definition )
  28405. ];
  28406. this._clearCache();
  28407. }
  28408. /**
  28409. * Extends a {@link #register registered} item's definition.
  28410. *
  28411. * Extending properties such as `allowIn` will add more items to the existing properties,
  28412. * while redefining properties such as `isBlock` will override the previously defined ones.
  28413. *
  28414. * schema.register( 'foo', {
  28415. * allowIn: '$root',
  28416. * isBlock: true;
  28417. * } );
  28418. * schema.extend( 'foo', {
  28419. * allowIn: 'blockQuote',
  28420. * isBlock: false
  28421. * } );
  28422. *
  28423. * schema.getDefinition( 'foo' );
  28424. * // {
  28425. * // allowIn: [ '$root', 'blockQuote' ],
  28426. * // isBlock: false
  28427. * // }
  28428. *
  28429. * @param {String} itemName
  28430. * @param {module:engine/model/schema~SchemaItemDefinition} definition
  28431. */
  28432. extend( itemName, definition ) {
  28433. if ( !this._sourceDefinitions[ itemName ] ) {
  28434. /**
  28435. * Cannot extend an item which was not registered yet.
  28436. *
  28437. * This error happens when a plugin tries to extend the schema definition of an item which was not
  28438. * {@link #register registered} yet.
  28439. *
  28440. * @param itemName The name of the model element which is being extended.
  28441. * @error schema-cannot-extend-missing-item
  28442. */
  28443. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"]( 'schema-cannot-extend-missing-item', this, {
  28444. itemName
  28445. } );
  28446. }
  28447. this._sourceDefinitions[ itemName ].push( Object.assign( {}, definition ) );
  28448. this._clearCache();
  28449. }
  28450. /**
  28451. * Returns data of all registered items.
  28452. *
  28453. * This method should normally be used for reflection purposes (e.g. defining a clone of a certain element,
  28454. * checking a list of all block elements, etc).
  28455. * Use specific methods (such as {@link #checkChild `checkChild()`} or {@link #isLimit `isLimit()`})
  28456. * in other cases.
  28457. *
  28458. * @returns {Object.<String,module:engine/model/schema~SchemaCompiledItemDefinition>}
  28459. */
  28460. getDefinitions() {
  28461. if ( !this._compiledDefinitions ) {
  28462. this._compile();
  28463. }
  28464. return this._compiledDefinitions;
  28465. }
  28466. /**
  28467. * Returns a definition of the given item or `undefined` if an item is not registered.
  28468. *
  28469. * This method should normally be used for reflection purposes (e.g. defining a clone of a certain element,
  28470. * checking a list of all block elements, etc).
  28471. * Use specific methods (such as {@link #checkChild `checkChild()`} or {@link #isLimit `isLimit()`})
  28472. * in other cases.
  28473. *
  28474. * @param {module:engine/model/item~Item|module:engine/model/schema~SchemaContextItem|String} item
  28475. * @returns {module:engine/model/schema~SchemaCompiledItemDefinition}
  28476. */
  28477. getDefinition( item ) {
  28478. let itemName;
  28479. if ( typeof item == 'string' ) {
  28480. itemName = item;
  28481. } else if ( item.is && ( item.is( '$text' ) || item.is( '$textProxy' ) ) ) {
  28482. itemName = '$text';
  28483. }
  28484. // Element or module:engine/model/schema~SchemaContextItem.
  28485. else {
  28486. itemName = item.name;
  28487. }
  28488. return this.getDefinitions()[ itemName ];
  28489. }
  28490. /**
  28491. * Returns `true` if the given item is registered in the schema.
  28492. *
  28493. * schema.isRegistered( 'paragraph' ); // -> true
  28494. * schema.isRegistered( editor.model.document.getRoot() ); // -> true
  28495. * schema.isRegistered( 'foo' ); // -> false
  28496. *
  28497. * @param {module:engine/model/item~Item|module:engine/model/schema~SchemaContextItem|String} item
  28498. */
  28499. isRegistered( item ) {
  28500. return !!this.getDefinition( item );
  28501. }
  28502. /**
  28503. * Returns `true` if the given item is defined to be
  28504. * a block by the {@link module:engine/model/schema~SchemaItemDefinition}'s `isBlock` property.
  28505. *
  28506. * schema.isBlock( 'paragraph' ); // -> true
  28507. * schema.isBlock( '$root' ); // -> false
  28508. *
  28509. * const paragraphElement = writer.createElement( 'paragraph' );
  28510. * schema.isBlock( paragraphElement ); // -> true
  28511. *
  28512. * See the {@glink framework/guides/deep-dive/schema#block-elements Block elements} section of the Schema deep dive
  28513. * guide for more details.
  28514. *
  28515. * @param {module:engine/model/item~Item|module:engine/model/schema~SchemaContextItem|String} item
  28516. */
  28517. isBlock( item ) {
  28518. const def = this.getDefinition( item );
  28519. return !!( def && def.isBlock );
  28520. }
  28521. /**
  28522. * Returns `true` if the given item should be treated as a limit element.
  28523. *
  28524. * It considers an item to be a limit element if its
  28525. * {@link module:engine/model/schema~SchemaItemDefinition}'s
  28526. * {@link module:engine/model/schema~SchemaItemDefinition#isLimit `isLimit`} or
  28527. * {@link module:engine/model/schema~SchemaItemDefinition#isObject `isObject`} property
  28528. * was set to `true`.
  28529. *
  28530. * schema.isLimit( 'paragraph' ); // -> false
  28531. * schema.isLimit( '$root' ); // -> true
  28532. * schema.isLimit( editor.model.document.getRoot() ); // -> true
  28533. * schema.isLimit( 'image' ); // -> true
  28534. *
  28535. * See the {@glink framework/guides/deep-dive/schema#limit-elements Limit elements} section of the Schema deep dive
  28536. * guide for more details.
  28537. *
  28538. * @param {module:engine/model/item~Item|module:engine/model/schema~SchemaContextItem|String} item
  28539. */
  28540. isLimit( item ) {
  28541. const def = this.getDefinition( item );
  28542. if ( !def ) {
  28543. return false;
  28544. }
  28545. return !!( def.isLimit || def.isObject );
  28546. }
  28547. /**
  28548. * Returns `true` if the given item should be treated as an object element.
  28549. *
  28550. * It considers an item to be an object element if its
  28551. * {@link module:engine/model/schema~SchemaItemDefinition}'s
  28552. * {@link module:engine/model/schema~SchemaItemDefinition#isObject `isObject`} property
  28553. * was set to `true`.
  28554. *
  28555. * schema.isObject( 'paragraph' ); // -> false
  28556. * schema.isObject( 'image' ); // -> true
  28557. *
  28558. * const imageElement = writer.createElement( 'image' );
  28559. * schema.isObject( imageElement ); // -> true
  28560. *
  28561. * See the {@glink framework/guides/deep-dive/schema#object-elements Object elements} section of the Schema deep dive
  28562. * guide for more details.
  28563. *
  28564. * @param {module:engine/model/item~Item|module:engine/model/schema~SchemaContextItem|String} item
  28565. */
  28566. isObject( item ) {
  28567. const def = this.getDefinition( item );
  28568. if ( !def ) {
  28569. return false;
  28570. }
  28571. // Note: Check out the implementation of #isLimit(), #isSelectable(), and #isContent()
  28572. // to understand why these three constitute an object.
  28573. return !!( def.isObject || ( def.isLimit && def.isSelectable && def.isContent ) );
  28574. }
  28575. /**
  28576. * Returns `true` if the given item is defined to be
  28577. * an inline element by the {@link module:engine/model/schema~SchemaItemDefinition}'s `isInline` property.
  28578. *
  28579. * schema.isInline( 'paragraph' ); // -> false
  28580. * schema.isInline( 'softBreak' ); // -> true
  28581. *
  28582. * const text = writer.createText( 'foo' );
  28583. * schema.isInline( text ); // -> true
  28584. *
  28585. * See the {@glink framework/guides/deep-dive/schema#inline-elements Inline elements} section of the Schema deep dive
  28586. * guide for more details.
  28587. *
  28588. * @param {module:engine/model/item~Item|module:engine/model/schema~SchemaContextItem|String} item
  28589. */
  28590. isInline( item ) {
  28591. const def = this.getDefinition( item );
  28592. return !!( def && def.isInline );
  28593. }
  28594. /**
  28595. * Returns `true` if the given item is defined to be
  28596. * a selectable element by the {@link module:engine/model/schema~SchemaItemDefinition}'s `isSelectable` property.
  28597. *
  28598. * schema.isSelectable( 'paragraph' ); // -> false
  28599. * schema.isSelectable( 'heading1' ); // -> false
  28600. * schema.isSelectable( 'image' ); // -> true
  28601. * schema.isSelectable( 'tableCell' ); // -> true
  28602. *
  28603. * const text = writer.createText( 'foo' );
  28604. * schema.isSelectable( text ); // -> false
  28605. *
  28606. * See the {@glink framework/guides/deep-dive/schema#selectable-elements Selectable elements section} of the Schema deep dive
  28607. * guide for more details.
  28608. *
  28609. * @param {module:engine/model/item~Item|module:engine/model/schema~SchemaContextItem|String} item
  28610. */
  28611. isSelectable( item ) {
  28612. const def = this.getDefinition( item );
  28613. if ( !def ) {
  28614. return false;
  28615. }
  28616. return !!( def.isSelectable || def.isObject );
  28617. }
  28618. /**
  28619. * Returns `true` if the given item is defined to be
  28620. * a content by the {@link module:engine/model/schema~SchemaItemDefinition}'s `isContent` property.
  28621. *
  28622. * schema.isContent( 'paragraph' ); // -> false
  28623. * schema.isContent( 'heading1' ); // -> false
  28624. * schema.isContent( 'image' ); // -> true
  28625. * schema.isContent( 'horizontalLine' ); // -> true
  28626. *
  28627. * const text = writer.createText( 'foo' );
  28628. * schema.isContent( text ); // -> true
  28629. *
  28630. * See the {@glink framework/guides/deep-dive/schema#content-elements Content elements section} of the Schema deep dive
  28631. * guide for more details.
  28632. *
  28633. * @param {module:engine/model/item~Item|module:engine/model/schema~SchemaContextItem|String} item
  28634. */
  28635. isContent( item ) {
  28636. const def = this.getDefinition( item );
  28637. if ( !def ) {
  28638. return false;
  28639. }
  28640. return !!( def.isContent || def.isObject );
  28641. }
  28642. /**
  28643. * Checks whether the given node (`child`) can be a child of the given context.
  28644. *
  28645. * schema.checkChild( model.document.getRoot(), paragraph ); // -> false
  28646. *
  28647. * schema.register( 'paragraph', {
  28648. * allowIn: '$root'
  28649. * } );
  28650. * schema.checkChild( model.document.getRoot(), paragraph ); // -> true
  28651. *
  28652. * Note: When verifying whether the given node can be a child of the given context, the
  28653. * schema also verifies the entire context &mdash; from its root to its last element. Therefore, it is possible
  28654. * for `checkChild()` to return `false` even though the context's last element can contain the checked child.
  28655. * It happens if one of the context's elements does not allow its child.
  28656. *
  28657. * @fires checkChild
  28658. * @param {module:engine/model/schema~SchemaContextDefinition} context The context in which the child will be checked.
  28659. * @param {module:engine/model/node~Node|String} def The child to check.
  28660. */
  28661. checkChild( context, def ) {
  28662. // Note: context and child are already normalized here to a SchemaContext and SchemaCompiledItemDefinition.
  28663. if ( !def ) {
  28664. return false;
  28665. }
  28666. return this._checkContextMatch( def, context );
  28667. }
  28668. /**
  28669. * Checks whether the given attribute can be applied in the given context (on the last
  28670. * item of the context).
  28671. *
  28672. * schema.checkAttribute( textNode, 'bold' ); // -> false
  28673. *
  28674. * schema.extend( '$text', {
  28675. * allowAttributes: 'bold'
  28676. * } );
  28677. * schema.checkAttribute( textNode, 'bold' ); // -> true
  28678. *
  28679. * @fires checkAttribute
  28680. * @param {module:engine/model/schema~SchemaContextDefinition} context The context in which the attribute will be checked.
  28681. * @param {String} attributeName
  28682. */
  28683. checkAttribute( context, attributeName ) {
  28684. const def = this.getDefinition( context.last );
  28685. if ( !def ) {
  28686. return false;
  28687. }
  28688. return def.allowAttributes.includes( attributeName );
  28689. }
  28690. /**
  28691. * Checks whether the given element (`elementToMerge`) can be merged with the specified base element (`positionOrBaseElement`).
  28692. *
  28693. * In other words &mdash; whether `elementToMerge`'s children {@link #checkChild are allowed} in the `positionOrBaseElement`.
  28694. *
  28695. * This check ensures that elements merged with {@link module:engine/model/writer~Writer#merge `Writer#merge()`}
  28696. * will be valid.
  28697. *
  28698. * Instead of elements, you can pass the instance of the {@link module:engine/model/position~Position} class as the
  28699. * `positionOrBaseElement`. It means that the elements before and after the position will be checked whether they can be merged.
  28700. *
  28701. * @param {module:engine/model/position~Position|module:engine/model/element~Element} positionOrBaseElement The position or base
  28702. * element to which the `elementToMerge` will be merged.
  28703. * @param {module:engine/model/element~Element} elementToMerge The element to merge. Required if `positionOrBaseElement` is an element.
  28704. * @returns {Boolean}
  28705. */
  28706. checkMerge( positionOrBaseElement, elementToMerge = null ) {
  28707. if ( positionOrBaseElement instanceof _position__WEBPACK_IMPORTED_MODULE_4__["default"] ) {
  28708. const nodeBefore = positionOrBaseElement.nodeBefore;
  28709. const nodeAfter = positionOrBaseElement.nodeAfter;
  28710. if ( !( nodeBefore instanceof _element__WEBPACK_IMPORTED_MODULE_5__["default"] ) ) {
  28711. /**
  28712. * The node before the merge position must be an element.
  28713. *
  28714. * @error schema-check-merge-no-element-before
  28715. */
  28716. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"](
  28717. 'schema-check-merge-no-element-before',
  28718. this
  28719. );
  28720. }
  28721. if ( !( nodeAfter instanceof _element__WEBPACK_IMPORTED_MODULE_5__["default"] ) ) {
  28722. /**
  28723. * The node after the merge position must be an element.
  28724. *
  28725. * @error schema-check-merge-no-element-after
  28726. */
  28727. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"](
  28728. 'schema-check-merge-no-element-after',
  28729. this
  28730. );
  28731. }
  28732. return this.checkMerge( nodeBefore, nodeAfter );
  28733. }
  28734. for ( const child of elementToMerge.getChildren() ) {
  28735. if ( !this.checkChild( positionOrBaseElement, child ) ) {
  28736. return false;
  28737. }
  28738. }
  28739. return true;
  28740. }
  28741. /**
  28742. * Allows registering a callback to the {@link #checkChild} method calls.
  28743. *
  28744. * Callbacks allow you to implement rules which are not otherwise possible to achieve
  28745. * by using the declarative API of {@link module:engine/model/schema~SchemaItemDefinition}.
  28746. * For example, by using this method you can disallow elements in specific contexts.
  28747. *
  28748. * This method is a shorthand for using the {@link #event:checkChild} event. For even better control,
  28749. * you can use that event instead.
  28750. *
  28751. * Example:
  28752. *
  28753. * // Disallow heading1 directly inside a blockQuote.
  28754. * schema.addChildCheck( ( context, childDefinition ) => {
  28755. * if ( context.endsWith( 'blockQuote' ) && childDefinition.name == 'heading1' ) {
  28756. * return false;
  28757. * }
  28758. * } );
  28759. *
  28760. * Which translates to:
  28761. *
  28762. * schema.on( 'checkChild', ( evt, args ) => {
  28763. * const context = args[ 0 ];
  28764. * const childDefinition = args[ 1 ];
  28765. *
  28766. * if ( context.endsWith( 'blockQuote' ) && childDefinition && childDefinition.name == 'heading1' ) {
  28767. * // Prevent next listeners from being called.
  28768. * evt.stop();
  28769. * // Set the checkChild()'s return value.
  28770. * evt.return = false;
  28771. * }
  28772. * }, { priority: 'high' } );
  28773. *
  28774. * @param {Function} callback The callback to be called. It is called with two parameters:
  28775. * {@link module:engine/model/schema~SchemaContext} (context) instance and
  28776. * {@link module:engine/model/schema~SchemaCompiledItemDefinition} (child-to-check definition).
  28777. * The callback may return `true/false` to override `checkChild()`'s return value. If it does not return
  28778. * a boolean value, the default algorithm (or other callbacks) will define `checkChild()`'s return value.
  28779. */
  28780. addChildCheck( callback ) {
  28781. this.on( 'checkChild', ( evt, [ ctx, childDef ] ) => {
  28782. // checkChild() was called with a non-registered child.
  28783. // In 99% cases such check should return false, so not to overcomplicate all callbacks
  28784. // don't even execute them.
  28785. if ( !childDef ) {
  28786. return;
  28787. }
  28788. const retValue = callback( ctx, childDef );
  28789. if ( typeof retValue == 'boolean' ) {
  28790. evt.stop();
  28791. evt.return = retValue;
  28792. }
  28793. }, { priority: 'high' } );
  28794. }
  28795. /**
  28796. * Allows registering a callback to the {@link #checkAttribute} method calls.
  28797. *
  28798. * Callbacks allow you to implement rules which are not otherwise possible to achieve
  28799. * by using the declarative API of {@link module:engine/model/schema~SchemaItemDefinition}.
  28800. * For example, by using this method you can disallow attribute if node to which it is applied
  28801. * is contained within some other element (e.g. you want to disallow `bold` on `$text` within `heading1`).
  28802. *
  28803. * This method is a shorthand for using the {@link #event:checkAttribute} event. For even better control,
  28804. * you can use that event instead.
  28805. *
  28806. * Example:
  28807. *
  28808. * // Disallow bold on $text inside heading1.
  28809. * schema.addAttributeCheck( ( context, attributeName ) => {
  28810. * if ( context.endsWith( 'heading1 $text' ) && attributeName == 'bold' ) {
  28811. * return false;
  28812. * }
  28813. * } );
  28814. *
  28815. * Which translates to:
  28816. *
  28817. * schema.on( 'checkAttribute', ( evt, args ) => {
  28818. * const context = args[ 0 ];
  28819. * const attributeName = args[ 1 ];
  28820. *
  28821. * if ( context.endsWith( 'heading1 $text' ) && attributeName == 'bold' ) {
  28822. * // Prevent next listeners from being called.
  28823. * evt.stop();
  28824. * // Set the checkAttribute()'s return value.
  28825. * evt.return = false;
  28826. * }
  28827. * }, { priority: 'high' } );
  28828. *
  28829. * @param {Function} callback The callback to be called. It is called with two parameters:
  28830. * {@link module:engine/model/schema~SchemaContext} (context) instance and attribute name.
  28831. * The callback may return `true/false` to override `checkAttribute()`'s return value. If it does not return
  28832. * a boolean value, the default algorithm (or other callbacks) will define `checkAttribute()`'s return value.
  28833. */
  28834. addAttributeCheck( callback ) {
  28835. this.on( 'checkAttribute', ( evt, [ ctx, attributeName ] ) => {
  28836. const retValue = callback( ctx, attributeName );
  28837. if ( typeof retValue == 'boolean' ) {
  28838. evt.stop();
  28839. evt.return = retValue;
  28840. }
  28841. }, { priority: 'high' } );
  28842. }
  28843. /**
  28844. * This method allows assigning additional metadata to the model attributes. For example,
  28845. * {@link module:engine/model/schema~AttributeProperties `AttributeProperties#isFormatting` property} is
  28846. * used to mark formatting attributes (like `bold` or `italic`).
  28847. *
  28848. * // Mark bold as a formatting attribute.
  28849. * schema.setAttributeProperties( 'bold', {
  28850. * isFormatting: true
  28851. * } );
  28852. *
  28853. * // Override code not to be considered a formatting markup.
  28854. * schema.setAttributeProperties( 'code', {
  28855. * isFormatting: false
  28856. * } );
  28857. *
  28858. * Properties are not limited to members defined in the
  28859. * {@link module:engine/model/schema~AttributeProperties `AttributeProperties` type} and you can also use custom properties:
  28860. *
  28861. * schema.setAttributeProperties( 'blockQuote', {
  28862. * customProperty: 'value'
  28863. * } );
  28864. *
  28865. * Subsequent calls with the same attribute will extend its custom properties:
  28866. *
  28867. * schema.setAttributeProperties( 'blockQuote', {
  28868. * one: 1
  28869. * } );
  28870. *
  28871. * schema.setAttributeProperties( 'blockQuote', {
  28872. * two: 2
  28873. * } );
  28874. *
  28875. * console.log( schema.getAttributeProperties( 'blockQuote' ) );
  28876. * // Logs: { one: 1, two: 2 }
  28877. *
  28878. * @param {String} attributeName A name of the attribute to receive the properties.
  28879. * @param {module:engine/model/schema~AttributeProperties} properties A dictionary of properties.
  28880. */
  28881. setAttributeProperties( attributeName, properties ) {
  28882. this._attributeProperties[ attributeName ] = Object.assign( this.getAttributeProperties( attributeName ), properties );
  28883. }
  28884. /**
  28885. * Returns properties associated with a given model attribute. See {@link #setAttributeProperties `setAttributeProperties()`}.
  28886. *
  28887. * @param {String} attributeName A name of the attribute.
  28888. * @returns {module:engine/model/schema~AttributeProperties}
  28889. */
  28890. getAttributeProperties( attributeName ) {
  28891. return this._attributeProperties[ attributeName ] || {};
  28892. }
  28893. /**
  28894. * Returns the lowest {@link module:engine/model/schema~Schema#isLimit limit element} containing the entire
  28895. * selection/range/position or the root otherwise.
  28896. *
  28897. * @param {module:engine/model/selection~Selection|module:engine/model/documentselection~DocumentSelection|
  28898. * module:engine/model/range~Range|module:engine/model/position~Position} selectionOrRangeOrPosition
  28899. * The selection/range/position to check.
  28900. * @returns {module:engine/model/element~Element} The lowest limit element containing
  28901. * the entire `selectionOrRangeOrPosition`.
  28902. */
  28903. getLimitElement( selectionOrRangeOrPosition ) {
  28904. let element;
  28905. if ( selectionOrRangeOrPosition instanceof _position__WEBPACK_IMPORTED_MODULE_4__["default"] ) {
  28906. element = selectionOrRangeOrPosition.parent;
  28907. } else {
  28908. const ranges = selectionOrRangeOrPosition instanceof _range__WEBPACK_IMPORTED_MODULE_3__["default"] ?
  28909. [ selectionOrRangeOrPosition ] :
  28910. Array.from( selectionOrRangeOrPosition.getRanges() );
  28911. // Find the common ancestor for all selection's ranges.
  28912. element = ranges
  28913. .reduce( ( element, range ) => {
  28914. const rangeCommonAncestor = range.getCommonAncestor();
  28915. if ( !element ) {
  28916. return rangeCommonAncestor;
  28917. }
  28918. return element.getCommonAncestor( rangeCommonAncestor, { includeSelf: true } );
  28919. }, null );
  28920. }
  28921. while ( !this.isLimit( element ) ) {
  28922. if ( element.parent ) {
  28923. element = element.parent;
  28924. } else {
  28925. break;
  28926. }
  28927. }
  28928. return element;
  28929. }
  28930. /**
  28931. * Checks whether the attribute is allowed in selection:
  28932. *
  28933. * * if the selection is not collapsed, then checks if the attribute is allowed on any of nodes in that range,
  28934. * * if the selection is collapsed, then checks if on the selection position there's a text with the
  28935. * specified attribute allowed.
  28936. *
  28937. * @param {module:engine/model/selection~Selection|module:engine/model/documentselection~DocumentSelection} selection
  28938. * Selection which will be checked.
  28939. * @param {String} attribute The name of the attribute to check.
  28940. * @returns {Boolean}
  28941. */
  28942. checkAttributeInSelection( selection, attribute ) {
  28943. if ( selection.isCollapsed ) {
  28944. const firstPosition = selection.getFirstPosition();
  28945. const context = [
  28946. ...firstPosition.getAncestors(),
  28947. new _text__WEBPACK_IMPORTED_MODULE_6__["default"]( '', selection.getAttributes() )
  28948. ];
  28949. // Check whether schema allows for a text with the attribute in the selection.
  28950. return this.checkAttribute( context, attribute );
  28951. } else {
  28952. const ranges = selection.getRanges();
  28953. // For all ranges, check nodes in them until you find a node that is allowed to have the attribute.
  28954. for ( const range of ranges ) {
  28955. for ( const value of range ) {
  28956. if ( this.checkAttribute( value.item, attribute ) ) {
  28957. // If we found a node that is allowed to have the attribute, return true.
  28958. return true;
  28959. }
  28960. }
  28961. }
  28962. }
  28963. // If we haven't found such node, return false.
  28964. return false;
  28965. }
  28966. /**
  28967. * Transforms the given set of ranges into a set of ranges where the given attribute is allowed (and can be applied).
  28968. *
  28969. * @param {Array.<module:engine/model/range~Range>} ranges Ranges to be validated.
  28970. * @param {String} attribute The name of the attribute to check.
  28971. * @returns {Iterable.<module:engine/model/range~Range>} Ranges in which the attribute is allowed.
  28972. */
  28973. * getValidRanges( ranges, attribute ) {
  28974. ranges = convertToMinimalFlatRanges( ranges );
  28975. for ( const range of ranges ) {
  28976. yield* this._getValidRangesForRange( range, attribute );
  28977. }
  28978. }
  28979. /**
  28980. * Basing on given `position`, finds and returns a {@link module:engine/model/range~Range range} which is
  28981. * nearest to that `position` and is a correct range for selection.
  28982. *
  28983. * The correct selection range might be collapsed when it is located in a position where the text node can be placed.
  28984. * Non-collapsed range is returned when selection can be placed around element marked as an "object" in
  28985. * the {@link module:engine/model/schema~Schema schema}.
  28986. *
  28987. * Direction of searching for the nearest correct selection range can be specified as:
  28988. *
  28989. * * `both` - searching will be performed in both ways,
  28990. * * `forward` - searching will be performed only forward,
  28991. * * `backward` - searching will be performed only backward.
  28992. *
  28993. * When valid selection range cannot be found, `null` is returned.
  28994. *
  28995. * @param {module:engine/model/position~Position} position Reference position where new selection range should be looked for.
  28996. * @param {'both'|'forward'|'backward'} [direction='both'] Search direction.
  28997. * @returns {module:engine/model/range~Range|null} Nearest selection range or `null` if one cannot be found.
  28998. */
  28999. getNearestSelectionRange( position, direction = 'both' ) {
  29000. // Return collapsed range if provided position is valid.
  29001. if ( this.checkChild( position, '$text' ) ) {
  29002. return new _range__WEBPACK_IMPORTED_MODULE_3__["default"]( position );
  29003. }
  29004. let backwardWalker, forwardWalker;
  29005. // Never leave a limit element.
  29006. const limitElement = position.getAncestors().reverse().find( item => this.isLimit( item ) ) || position.root;
  29007. if ( direction == 'both' || direction == 'backward' ) {
  29008. backwardWalker = new _treewalker__WEBPACK_IMPORTED_MODULE_7__["default"]( {
  29009. boundaries: _range__WEBPACK_IMPORTED_MODULE_3__["default"]._createIn( limitElement ),
  29010. startPosition: position,
  29011. direction: 'backward'
  29012. } );
  29013. }
  29014. if ( direction == 'both' || direction == 'forward' ) {
  29015. forwardWalker = new _treewalker__WEBPACK_IMPORTED_MODULE_7__["default"]( {
  29016. boundaries: _range__WEBPACK_IMPORTED_MODULE_3__["default"]._createIn( limitElement ),
  29017. startPosition: position
  29018. } );
  29019. }
  29020. for ( const data of combineWalkers( backwardWalker, forwardWalker ) ) {
  29021. const type = ( data.walker == backwardWalker ? 'elementEnd' : 'elementStart' );
  29022. const value = data.value;
  29023. if ( value.type == type && this.isObject( value.item ) ) {
  29024. return _range__WEBPACK_IMPORTED_MODULE_3__["default"]._createOn( value.item );
  29025. }
  29026. if ( this.checkChild( value.nextPosition, '$text' ) ) {
  29027. return new _range__WEBPACK_IMPORTED_MODULE_3__["default"]( value.nextPosition );
  29028. }
  29029. }
  29030. return null;
  29031. }
  29032. /**
  29033. * Tries to find position ancestors that allow to insert a given node.
  29034. * It starts searching from the given position and goes node by node to the top of the model tree
  29035. * as long as a {@link module:engine/model/schema~Schema#isLimit limit element}, an
  29036. * {@link module:engine/model/schema~Schema#isObject object element} or a topmost ancestor is not reached.
  29037. *
  29038. * @param {module:engine/model/position~Position} position The position that the search will start from.
  29039. * @param {module:engine/model/node~Node|String} node The node for which an allowed parent should be found or its name.
  29040. * @returns {module:engine/model/element~Element|null} element Allowed parent or null if nothing was found.
  29041. */
  29042. findAllowedParent( position, node ) {
  29043. let parent = position.parent;
  29044. while ( parent ) {
  29045. if ( this.checkChild( parent, node ) ) {
  29046. return parent;
  29047. }
  29048. // Do not split limit elements.
  29049. if ( this.isLimit( parent ) ) {
  29050. return null;
  29051. }
  29052. parent = parent.parent;
  29053. }
  29054. return null;
  29055. }
  29056. /**
  29057. * Removes attributes disallowed by the schema.
  29058. *
  29059. * @param {Iterable.<module:engine/model/node~Node>} nodes Nodes that will be filtered.
  29060. * @param {module:engine/model/writer~Writer} writer
  29061. */
  29062. removeDisallowedAttributes( nodes, writer ) {
  29063. for ( const node of nodes ) {
  29064. // When node is a `Text` it has no children, so just filter it out.
  29065. if ( node.is( '$text' ) ) {
  29066. removeDisallowedAttributeFromNode( this, node, writer );
  29067. }
  29068. // In a case of `Element` iterates through positions between nodes inside this element
  29069. // and filter out node before the current position, or position parent when position
  29070. // is at start of an element. Using positions prevent from omitting merged nodes
  29071. // see https://github.com/ckeditor/ckeditor5-engine/issues/1789.
  29072. else {
  29073. const rangeInNode = _range__WEBPACK_IMPORTED_MODULE_3__["default"]._createIn( node );
  29074. const positionsInRange = rangeInNode.getPositions();
  29075. for ( const position of positionsInRange ) {
  29076. const item = position.nodeBefore || position.parent;
  29077. removeDisallowedAttributeFromNode( this, item, writer );
  29078. }
  29079. }
  29080. }
  29081. }
  29082. /**
  29083. * Creates an instance of the schema context.
  29084. *
  29085. * @param {module:engine/model/schema~SchemaContextDefinition} context
  29086. * @returns {module:engine/model/schema~SchemaContext}
  29087. */
  29088. createContext( context ) {
  29089. return new SchemaContext( context );
  29090. }
  29091. /**
  29092. * @private
  29093. */
  29094. _clearCache() {
  29095. this._compiledDefinitions = null;
  29096. }
  29097. /**
  29098. * @private
  29099. */
  29100. _compile() {
  29101. const compiledDefinitions = {};
  29102. const sourceRules = this._sourceDefinitions;
  29103. const itemNames = Object.keys( sourceRules );
  29104. for ( const itemName of itemNames ) {
  29105. compiledDefinitions[ itemName ] = compileBaseItemRule( sourceRules[ itemName ], itemName );
  29106. }
  29107. for ( const itemName of itemNames ) {
  29108. compileAllowChildren( compiledDefinitions, itemName );
  29109. }
  29110. for ( const itemName of itemNames ) {
  29111. compileAllowContentOf( compiledDefinitions, itemName );
  29112. }
  29113. for ( const itemName of itemNames ) {
  29114. compileAllowWhere( compiledDefinitions, itemName );
  29115. }
  29116. for ( const itemName of itemNames ) {
  29117. compileAllowAttributesOf( compiledDefinitions, itemName );
  29118. compileInheritPropertiesFrom( compiledDefinitions, itemName );
  29119. }
  29120. for ( const itemName of itemNames ) {
  29121. cleanUpAllowIn( compiledDefinitions, itemName );
  29122. setupAllowChildren( compiledDefinitions, itemName );
  29123. cleanUpAllowAttributes( compiledDefinitions, itemName );
  29124. }
  29125. this._compiledDefinitions = compiledDefinitions;
  29126. }
  29127. /**
  29128. * @private
  29129. * @param {module:engine/model/schema~SchemaCompiledItemDefinition} def
  29130. * @param {module:engine/model/schema~SchemaContext} context
  29131. * @param {Number} contextItemIndex
  29132. */
  29133. _checkContextMatch( def, context, contextItemIndex = context.length - 1 ) {
  29134. const contextItem = context.getItem( contextItemIndex );
  29135. if ( def.allowIn.includes( contextItem.name ) ) {
  29136. if ( contextItemIndex == 0 ) {
  29137. return true;
  29138. } else {
  29139. const parentRule = this.getDefinition( contextItem );
  29140. return this._checkContextMatch( parentRule, context, contextItemIndex - 1 );
  29141. }
  29142. } else {
  29143. return false;
  29144. }
  29145. }
  29146. /**
  29147. * Takes a flat range and an attribute name. Traverses the range recursively and deeply to find and return all ranges
  29148. * inside the given range on which the attribute can be applied.
  29149. *
  29150. * This is a helper function for {@link ~Schema#getValidRanges}.
  29151. *
  29152. * @private
  29153. * @param {module:engine/model/range~Range} range The range to process.
  29154. * @param {String} attribute The name of the attribute to check.
  29155. * @returns {Iterable.<module:engine/model/range~Range>} Ranges in which the attribute is allowed.
  29156. */
  29157. * _getValidRangesForRange( range, attribute ) {
  29158. let start = range.start;
  29159. let end = range.start;
  29160. for ( const item of range.getItems( { shallow: true } ) ) {
  29161. if ( item.is( 'element' ) ) {
  29162. yield* this._getValidRangesForRange( _range__WEBPACK_IMPORTED_MODULE_3__["default"]._createIn( item ), attribute );
  29163. }
  29164. if ( !this.checkAttribute( item, attribute ) ) {
  29165. if ( !start.isEqual( end ) ) {
  29166. yield new _range__WEBPACK_IMPORTED_MODULE_3__["default"]( start, end );
  29167. }
  29168. start = _position__WEBPACK_IMPORTED_MODULE_4__["default"]._createAfter( item );
  29169. }
  29170. end = _position__WEBPACK_IMPORTED_MODULE_4__["default"]._createAfter( item );
  29171. }
  29172. if ( !start.isEqual( end ) ) {
  29173. yield new _range__WEBPACK_IMPORTED_MODULE_3__["default"]( start, end );
  29174. }
  29175. }
  29176. }
  29177. Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_2__["default"])( Schema, _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_1__["default"] );
  29178. /**
  29179. * Event fired when the {@link #checkChild} method is called. It allows plugging in
  29180. * additional behavior, for example implementing rules which cannot be defined using the declarative
  29181. * {@link module:engine/model/schema~SchemaItemDefinition} interface.
  29182. *
  29183. * **Note:** The {@link #addChildCheck} method is a more handy way to register callbacks. Internally,
  29184. * it registers a listener to this event but comes with a simpler API and it is the recommended choice
  29185. * in most of the cases.
  29186. *
  29187. * The {@link #checkChild} method fires an event because it is
  29188. * {@link module:utils/observablemixin~ObservableMixin#decorate decorated} with it. Thanks to that you can
  29189. * use this event in various ways, but the most important use case is overriding standard behavior of the
  29190. * `checkChild()` method. Let's see a typical listener template:
  29191. *
  29192. * schema.on( 'checkChild', ( evt, args ) => {
  29193. * const context = args[ 0 ];
  29194. * const childDefinition = args[ 1 ];
  29195. * }, { priority: 'high' } );
  29196. *
  29197. * The listener is added with a `high` priority to be executed before the default method is really called. The `args` callback
  29198. * parameter contains arguments passed to `checkChild( context, child )`. However, the `context` parameter is already
  29199. * normalized to a {@link module:engine/model/schema~SchemaContext} instance and `child` to a
  29200. * {@link module:engine/model/schema~SchemaCompiledItemDefinition} instance, so you do not have to worry about
  29201. * the various ways how `context` and `child` may be passed to `checkChild()`.
  29202. *
  29203. * **Note:** `childDefinition` may be `undefined` if `checkChild()` was called with a non-registered element.
  29204. *
  29205. * So, in order to implement a rule "disallow `heading1` in `blockQuote`", you can add such a listener:
  29206. *
  29207. * schema.on( 'checkChild', ( evt, args ) => {
  29208. * const context = args[ 0 ];
  29209. * const childDefinition = args[ 1 ];
  29210. *
  29211. * if ( context.endsWith( 'blockQuote' ) && childDefinition && childDefinition.name == 'heading1' ) {
  29212. * // Prevent next listeners from being called.
  29213. * evt.stop();
  29214. * // Set the checkChild()'s return value.
  29215. * evt.return = false;
  29216. * }
  29217. * }, { priority: 'high' } );
  29218. *
  29219. * Allowing elements in specific contexts will be a far less common use case, because it is normally handled by the
  29220. * `allowIn` rule from {@link module:engine/model/schema~SchemaItemDefinition}. But if you have a complex scenario
  29221. * where `listItem` should be allowed only in element `foo` which must be in element `bar`, then this would be the way:
  29222. *
  29223. * schema.on( 'checkChild', ( evt, args ) => {
  29224. * const context = args[ 0 ];
  29225. * const childDefinition = args[ 1 ];
  29226. *
  29227. * if ( context.endsWith( 'bar foo' ) && childDefinition.name == 'listItem' ) {
  29228. * // Prevent next listeners from being called.
  29229. * evt.stop();
  29230. * // Set the checkChild()'s return value.
  29231. * evt.return = true;
  29232. * }
  29233. * }, { priority: 'high' } );
  29234. *
  29235. * @event checkChild
  29236. * @param {Array} args The `checkChild()`'s arguments.
  29237. */
  29238. /**
  29239. * Event fired when the {@link #checkAttribute} method is called. It allows plugging in
  29240. * additional behavior, for example implementing rules which cannot be defined using the declarative
  29241. * {@link module:engine/model/schema~SchemaItemDefinition} interface.
  29242. *
  29243. * **Note:** The {@link #addAttributeCheck} method is a more handy way to register callbacks. Internally,
  29244. * it registers a listener to this event but comes with a simpler API and it is the recommended choice
  29245. * in most of the cases.
  29246. *
  29247. * The {@link #checkAttribute} method fires an event because it is
  29248. * {@link module:utils/observablemixin~ObservableMixin#decorate decorated} with it. Thanks to that you can
  29249. * use this event in various ways, but the most important use case is overriding the standard behavior of the
  29250. * `checkAttribute()` method. Let's see a typical listener template:
  29251. *
  29252. * schema.on( 'checkAttribute', ( evt, args ) => {
  29253. * const context = args[ 0 ];
  29254. * const attributeName = args[ 1 ];
  29255. * }, { priority: 'high' } );
  29256. *
  29257. * The listener is added with a `high` priority to be executed before the default method is really called. The `args` callback
  29258. * parameter contains arguments passed to `checkAttribute( context, attributeName )`. However, the `context` parameter is already
  29259. * normalized to a {@link module:engine/model/schema~SchemaContext} instance, so you do not have to worry about
  29260. * the various ways how `context` may be passed to `checkAttribute()`.
  29261. *
  29262. * So, in order to implement a rule "disallow `bold` in a text which is in a `heading1`, you can add such a listener:
  29263. *
  29264. * schema.on( 'checkAttribute', ( evt, args ) => {
  29265. * const context = args[ 0 ];
  29266. * const attributeName = args[ 1 ];
  29267. *
  29268. * if ( context.endsWith( 'heading1 $text' ) && attributeName == 'bold' ) {
  29269. * // Prevent next listeners from being called.
  29270. * evt.stop();
  29271. * // Set the checkAttribute()'s return value.
  29272. * evt.return = false;
  29273. * }
  29274. * }, { priority: 'high' } );
  29275. *
  29276. * Allowing attributes in specific contexts will be a far less common use case, because it is normally handled by the
  29277. * `allowAttributes` rule from {@link module:engine/model/schema~SchemaItemDefinition}. But if you have a complex scenario
  29278. * where `bold` should be allowed only in element `foo` which must be in element `bar`, then this would be the way:
  29279. *
  29280. * schema.on( 'checkAttribute', ( evt, args ) => {
  29281. * const context = args[ 0 ];
  29282. * const attributeName = args[ 1 ];
  29283. *
  29284. * if ( context.endsWith( 'bar foo $text' ) && attributeName == 'bold' ) {
  29285. * // Prevent next listeners from being called.
  29286. * evt.stop();
  29287. * // Set the checkAttribute()'s return value.
  29288. * evt.return = true;
  29289. * }
  29290. * }, { priority: 'high' } );
  29291. *
  29292. * @event checkAttribute
  29293. * @param {Array} args The `checkAttribute()`'s arguments.
  29294. */
  29295. /**
  29296. * A definition of a {@link module:engine/model/schema~Schema schema} item.
  29297. *
  29298. * You can define the following rules:
  29299. *
  29300. * * {@link ~SchemaItemDefinition#allowIn `allowIn`} &ndash; Defines in which other items this item will be allowed.
  29301. * * {@link ~SchemaItemDefinition#allowChildren `allowChildren`} &ndash; Defines which other items are allowed inside this item.
  29302. * * {@link ~SchemaItemDefinition#allowAttributes `allowAttributes`} &ndash; Defines allowed attributes of the given item.
  29303. * * {@link ~SchemaItemDefinition#allowContentOf `allowContentOf`} &ndash; Inherits "allowed children" from other items.
  29304. * * {@link ~SchemaItemDefinition#allowWhere `allowWhere`} &ndash; Inherits "allowed in" from other items.
  29305. * * {@link ~SchemaItemDefinition#allowAttributesOf `allowAttributesOf`} &ndash; Inherits attributes from other items.
  29306. * * {@link ~SchemaItemDefinition#inheritTypesFrom `inheritTypesFrom`} &ndash; Inherits `is*` properties of other items.
  29307. * * {@link ~SchemaItemDefinition#inheritAllFrom `inheritAllFrom`} &ndash;
  29308. * A shorthand for `allowContentOf`, `allowWhere`, `allowAttributesOf`, `inheritTypesFrom`.
  29309. *
  29310. * # The `is*` properties
  29311. *
  29312. * There are a couple commonly used `is*` properties. Their role is to assign additional semantics to schema items.
  29313. * You can define more properties but you will also need to implement support for them in the existing editor features.
  29314. *
  29315. * * {@link ~SchemaItemDefinition#isBlock `isBlock`} &ndash; Whether this item is paragraph-like.
  29316. * Generally speaking, content is usually made out of blocks like paragraphs, list items, images, headings, etc.
  29317. * * {@link ~SchemaItemDefinition#isInline `isInline`} &ndash; Whether an item is "text-like" and should be treated as an inline node.
  29318. * Examples of inline elements: `$text`, `softBreak` (`<br>`), etc.
  29319. * * {@link ~SchemaItemDefinition#isLimit `isLimit`} &ndash; It can be understood as whether this element
  29320. * should not be split by <kbd>Enter</kbd>. Examples of limit elements: `$root`, table cell, image caption, etc.
  29321. * In other words, all actions that happen inside a limit element are limited to its content.
  29322. * All objects are treated as limit elements, too.
  29323. * * {@link ~SchemaItemDefinition#isObject `isObject`} &ndash; Whether an item is "self-contained" and should be treated as a whole.
  29324. * Examples of object elements: `image`, `table`, `video`, etc. An object is also a limit, so
  29325. * {@link module:engine/model/schema~Schema#isLimit `isLimit()`} returns `true` for object elements automatically.
  29326. *
  29327. * Read more about the meaning of these types in the
  29328. * {@glink framework/guides/deep-dive/schema#defining-additional-semantics dedicated section of the Schema deep dive} guide.
  29329. *
  29330. * # Generic items
  29331. *
  29332. * There are three basic generic items: `$root`, `$block` and `$text`.
  29333. * They are defined as follows:
  29334. *
  29335. * this.schema.register( '$root', {
  29336. * isLimit: true
  29337. * } );
  29338. * this.schema.register( '$block', {
  29339. * allowIn: '$root',
  29340. * isBlock: true
  29341. * } );
  29342. * this.schema.register( '$text', {
  29343. * allowIn: '$block',
  29344. * isInline: true
  29345. * } );
  29346. *
  29347. * They reflect typical editor content that is contained within one root, consists of several blocks
  29348. * (paragraphs, lists items, headings, images) which, in turn, may contain text inside.
  29349. *
  29350. * By inheriting from the generic items you can define new items which will get extended by other editor features.
  29351. * Read more about generic types in the {@glink framework/guides/deep-dive/schema Schema deep dive} guide.
  29352. *
  29353. * # Example definitions
  29354. *
  29355. * Allow `paragraph` in roots and block quotes:
  29356. *
  29357. * schema.register( 'paragraph', {
  29358. * allowIn: [ '$root', 'blockQuote' ],
  29359. * isBlock: true
  29360. * } );
  29361. *
  29362. * Allow `paragraph` everywhere where `$block` is allowed (i.e. in `$root`):
  29363. *
  29364. * schema.register( 'paragraph', {
  29365. * allowWhere: '$block',
  29366. * isBlock: true
  29367. * } );
  29368. *
  29369. * Allow `paragraph` inside a `$root` and allow `$text` as a `paragraph` child:
  29370. *
  29371. * schema.register( 'paragraph', {
  29372. * allowIn: '$root',
  29373. * allowChildren: '$text',
  29374. * isBlock: true
  29375. * } );
  29376. *
  29377. * Make `image` a block object, which is allowed everywhere where `$block` is.
  29378. * Also, allow `src` and `alt` attributes in it:
  29379. *
  29380. * schema.register( 'image', {
  29381. * allowWhere: '$block',
  29382. * allowAttributes: [ 'src', 'alt' ],
  29383. * isBlock: true,
  29384. * isObject: true
  29385. * } );
  29386. *
  29387. * Make `caption` allowed in `image` and make it allow all the content of `$block`s (usually, `$text`).
  29388. * Also, mark it as a limit element so it cannot be split:
  29389. *
  29390. * schema.register( 'caption', {
  29391. * allowIn: 'image',
  29392. * allowContentOf: '$block',
  29393. * isLimit: true
  29394. * } );
  29395. *
  29396. * Make `listItem` inherit all from `$block` but also allow additional attributes:
  29397. *
  29398. * schema.register( 'listItem', {
  29399. * inheritAllFrom: '$block',
  29400. * allowAttributes: [ 'listType', 'listIndent' ]
  29401. * } );
  29402. *
  29403. * Which translates to:
  29404. *
  29405. * schema.register( 'listItem', {
  29406. * allowWhere: '$block',
  29407. * allowContentOf: '$block',
  29408. * allowAttributesOf: '$block',
  29409. * inheritTypesFrom: '$block',
  29410. * allowAttributes: [ 'listType', 'listIndent' ]
  29411. * } );
  29412. *
  29413. * # Tips
  29414. *
  29415. * * Check schema definitions of existing features to see how they are defined.
  29416. * * If you want to publish your feature so other developers can use it, try to use
  29417. * generic items as much as possible.
  29418. * * Keep your model clean. Limit it to the actual data and store information in a normalized way.
  29419. * * Remember about defining the `is*` properties. They do not affect the allowed structures, but they can
  29420. * affect how the editor features treat your elements.
  29421. *
  29422. * @typedef {Object} module:engine/model/schema~SchemaItemDefinition
  29423. *
  29424. * @property {String|Array.<String>} allowIn Defines in which other items this item will be allowed.
  29425. * @property {String|Array.<String>} allowChildren Defines which other items are allowed inside this item.
  29426. * @property {String|Array.<String>} allowAttributes Defines allowed attributes of the given item.
  29427. * @property {String|Array.<String>} allowContentOf Inherits "allowed children" from other items.
  29428. * @property {String|Array.<String>} allowWhere Inherits "allowed in" from other items.
  29429. * @property {String|Array.<String>} allowAttributesOf Inherits attributes from other items.
  29430. * @property {String|Array.<String>} inheritTypesFrom Inherits `is*` properties of other items.
  29431. * @property {String} inheritAllFrom A shorthand for `allowContentOf`, `allowWhere`, `allowAttributesOf`, `inheritTypesFrom`.
  29432. *
  29433. * @property {Boolean} isBlock
  29434. * Whether this item is paragraph-like. Generally speaking, content is usually made out of blocks
  29435. * like paragraphs, list items, images, headings, etc. All these elements are marked as blocks. A block
  29436. * should not allow another block inside. Note: There is also the `$block` generic item which has `isBlock` set to `true`.
  29437. * Most block type items will inherit from `$block` (through `inheritAllFrom`).
  29438. *
  29439. * Read more about the block elements in the
  29440. * {@glink framework/guides/deep-dive/schema#block-elements Block elements section} of the Schema deep dive guide.
  29441. *
  29442. * @property {Boolean} isInline
  29443. * Whether an item is "text-like" and should be treated as an inline node. Examples of inline elements:
  29444. * `$text`, `softBreak` (`<br>`), etc.
  29445. *
  29446. * Read more about the inline elements in the
  29447. * {@glink framework/guides/deep-dive/schema#inline-elements Inline elements section} of the Schema deep dive guide.
  29448. *
  29449. * @property {Boolean} isLimit
  29450. * It can be understood as whether this element should not be split by <kbd>Enter</kbd>.
  29451. * Examples of limit elements: `$root`, table cell, image caption, etc. In other words, all actions that happen inside
  29452. * a limit element are limited to its content.
  29453. *
  29454. * Read more about the limit elements in the
  29455. * {@glink framework/guides/deep-dive/schema#limit-elements Limit elements section} of the Schema deep dive guide.
  29456. *
  29457. * @property {Boolean} isObject
  29458. * Whether an item is "self-contained" and should be treated as a whole. Examples of object elements:
  29459. * `image`, `table`, `video`, etc.
  29460. *
  29461. * **Note:** An object is also a limit, so
  29462. * {@link module:engine/model/schema~Schema#isLimit `isLimit()`} returns `true` for object elements automatically.
  29463. *
  29464. * Read more about the object elements in the
  29465. * {@glink framework/guides/deep-dive/schema#object-elements Object elements section} of the Schema deep dive guide.
  29466. *
  29467. * @property {Boolean} isSelectable
  29468. * `true` when an element should be selectable as a whole by the user. Examples of selectable elements: `image`, `table`, `tableCell`, etc.
  29469. *
  29470. * **Note:** An object is also a selectable element, so
  29471. * {@link module:engine/model/schema~Schema#isSelectable `isSelectable()`} returns `true` for object elements automatically.
  29472. *
  29473. * Read more about selectable elements in the
  29474. * {@glink framework/guides/deep-dive/schema#selectable-elements Selectable elements section} of the Schema deep dive guide.
  29475. *
  29476. * @property {Boolean} isContent
  29477. * 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.
  29478. * Examples of content elements: `$text`, `image`, `table`, etc. (but not `paragraph`, `heading1` or `tableCell`).
  29479. *
  29480. * **Note:** An object is also a content element, so
  29481. * {@link module:engine/model/schema~Schema#isContent `isContent()`} returns `true` for object elements automatically.
  29482. *
  29483. * Read more about content elements in the
  29484. * {@glink framework/guides/deep-dive/schema#content-elements Content elements section} of the Schema deep dive guide.
  29485. */
  29486. /**
  29487. * A simplified version of {@link module:engine/model/schema~SchemaItemDefinition} after
  29488. * compilation by the {@link module:engine/model/schema~Schema schema}.
  29489. * Rules fed to the schema by {@link module:engine/model/schema~Schema#register}
  29490. * and {@link module:engine/model/schema~Schema#extend} methods are defined in the
  29491. * {@link module:engine/model/schema~SchemaItemDefinition} format.
  29492. * Later on, they are compiled to `SchemaCompiledItemDefinition` so when you use e.g.
  29493. * the {@link module:engine/model/schema~Schema#getDefinition} method you get the compiled version.
  29494. *
  29495. * The compiled version contains only the following properties:
  29496. *
  29497. * * The `name` property,
  29498. * * The `is*` properties,
  29499. * * The `allowIn` array,
  29500. * * The `allowChildren` array,
  29501. * * The `allowAttributes` array.
  29502. *
  29503. * @typedef {Object} module:engine/model/schema~SchemaCompiledItemDefinition
  29504. */
  29505. /**
  29506. * A schema context &mdash; a list of ancestors of a given position in the document.
  29507. *
  29508. * Considering such position:
  29509. *
  29510. * <$root>
  29511. * <blockQuote>
  29512. * <paragraph>
  29513. * ^
  29514. * </paragraph>
  29515. * </blockQuote>
  29516. * </$root>
  29517. *
  29518. * The context of this position is its {@link module:engine/model/position~Position#getAncestors lists of ancestors}:
  29519. *
  29520. * [ rootElement, blockQuoteElement, paragraphElement ]
  29521. *
  29522. * Contexts are used in the {@link module:engine/model/schema~Schema#event:checkChild `Schema#checkChild`} and
  29523. * {@link module:engine/model/schema~Schema#event:checkAttribute `Schema#checkAttribute`} events as a definition
  29524. * of a place in the document where the check occurs. The context instances are created based on the first arguments
  29525. * of the {@link module:engine/model/schema~Schema#checkChild `Schema#checkChild()`} and
  29526. * {@link module:engine/model/schema~Schema#checkAttribute `Schema#checkAttribute()`} methods so when
  29527. * using these methods you need to use {@link module:engine/model/schema~SchemaContextDefinition}s.
  29528. */
  29529. class SchemaContext {
  29530. /**
  29531. * Creates an instance of the context.
  29532. *
  29533. * @param {module:engine/model/schema~SchemaContextDefinition} context
  29534. */
  29535. constructor( context ) {
  29536. if ( context instanceof SchemaContext ) {
  29537. return context;
  29538. }
  29539. if ( typeof context == 'string' ) {
  29540. context = [ context ];
  29541. } else if ( !Array.isArray( context ) ) {
  29542. // `context` is item or position.
  29543. // Position#getAncestors() doesn't accept any parameters but it works just fine here.
  29544. context = context.getAncestors( { includeSelf: true } );
  29545. }
  29546. this._items = context.map( mapContextItem );
  29547. }
  29548. /**
  29549. * The number of items.
  29550. *
  29551. * @type {Number}
  29552. */
  29553. get length() {
  29554. return this._items.length;
  29555. }
  29556. /**
  29557. * The last item (the lowest node).
  29558. *
  29559. * @type {module:engine/model/schema~SchemaContextItem}
  29560. */
  29561. get last() {
  29562. return this._items[ this._items.length - 1 ];
  29563. }
  29564. /**
  29565. * Iterable interface.
  29566. *
  29567. * Iterates over all context items.
  29568. *
  29569. * @returns {Iterable.<module:engine/model/schema~SchemaContextItem>}
  29570. */
  29571. [ Symbol.iterator ]() {
  29572. return this._items[ Symbol.iterator ]();
  29573. }
  29574. /**
  29575. * Returns a new schema context instance with an additional item.
  29576. *
  29577. * Item can be added as:
  29578. *
  29579. * const context = new SchemaContext( [ '$root' ] );
  29580. *
  29581. * // An element.
  29582. * const fooElement = writer.createElement( 'fooElement' );
  29583. * const newContext = context.push( fooElement ); // [ '$root', 'fooElement' ]
  29584. *
  29585. * // A text node.
  29586. * const text = writer.createText( 'foobar' );
  29587. * const newContext = context.push( text ); // [ '$root', '$text' ]
  29588. *
  29589. * // A string (element name).
  29590. * const newContext = context.push( 'barElement' ); // [ '$root', 'barElement' ]
  29591. *
  29592. * **Note** {@link module:engine/model/node~Node} that is already in the model tree will be added as the only item
  29593. * (without ancestors).
  29594. *
  29595. * @param {String|module:engine/model/node~Node|Array<String|module:engine/model/node~Node>} item An item that will be added
  29596. * to the current context.
  29597. * @returns {module:engine/model/schema~SchemaContext} A new schema context instance with an additional item.
  29598. */
  29599. push( item ) {
  29600. const ctx = new SchemaContext( [ item ] );
  29601. ctx._items = [ ...this._items, ...ctx._items ];
  29602. return ctx;
  29603. }
  29604. /**
  29605. * Gets an item on the given index.
  29606. *
  29607. * @returns {module:engine/model/schema~SchemaContextItem}
  29608. */
  29609. getItem( index ) {
  29610. return this._items[ index ];
  29611. }
  29612. /**
  29613. * Returns the names of items.
  29614. *
  29615. * @returns {Iterable.<String>}
  29616. */
  29617. * getNames() {
  29618. yield* this._items.map( item => item.name );
  29619. }
  29620. /**
  29621. * Checks whether the context ends with the given nodes.
  29622. *
  29623. * const ctx = new SchemaContext( [ rootElement, paragraphElement, textNode ] );
  29624. *
  29625. * ctx.endsWith( '$text' ); // -> true
  29626. * ctx.endsWith( 'paragraph $text' ); // -> true
  29627. * ctx.endsWith( '$root' ); // -> false
  29628. * ctx.endsWith( 'paragraph' ); // -> false
  29629. *
  29630. * @param {String} query
  29631. * @returns {Boolean}
  29632. */
  29633. endsWith( query ) {
  29634. return Array.from( this.getNames() ).join( ' ' ).endsWith( query );
  29635. }
  29636. /**
  29637. * Checks whether the context starts with the given nodes.
  29638. *
  29639. * const ctx = new SchemaContext( [ rootElement, paragraphElement, textNode ] );
  29640. *
  29641. * ctx.endsWith( '$root' ); // -> true
  29642. * ctx.endsWith( '$root paragraph' ); // -> true
  29643. * ctx.endsWith( '$text' ); // -> false
  29644. * ctx.endsWith( 'paragraph' ); // -> false
  29645. *
  29646. * @param {String} query
  29647. * @returns {Boolean}
  29648. */
  29649. startsWith( query ) {
  29650. return Array.from( this.getNames() ).join( ' ' ).startsWith( query );
  29651. }
  29652. }
  29653. /**
  29654. * The definition of a {@link module:engine/model/schema~SchemaContext schema context}.
  29655. *
  29656. * Contexts can be created in multiple ways:
  29657. *
  29658. * * By defining a **node** – in this cases this node and all its ancestors will be used.
  29659. * * By defining a **position** in the document – in this case all its ancestors will be used.
  29660. * * By defining an **array of nodes** – in this case this array defines the entire context.
  29661. * * By defining a **name of node** - in this case node will be "mocked". It is not recommended because context
  29662. * will be unrealistic (e.g. attributes of these nodes are not specified). However, at times this may be the only
  29663. * way to define the context (e.g. when checking some hypothetical situation).
  29664. * * By defining an **array of node names** (potentially, mixed with real nodes) – The same as **name of node**
  29665. * but it is possible to create a path.
  29666. * * By defining a {@link module:engine/model/schema~SchemaContext} instance - in this case the same instance as provided
  29667. * will be return.
  29668. *
  29669. * Examples of context definitions passed to the {@link module:engine/model/schema~Schema#checkChild `Schema#checkChild()`}
  29670. * method:
  29671. *
  29672. * // Assuming that we have a $root > blockQuote > paragraph structure, the following code
  29673. * // will check node 'foo' in the following context:
  29674. * // [ rootElement, blockQuoteElement, paragraphElement ]
  29675. * const contextDefinition = paragraphElement;
  29676. * const childToCheck = 'foo';
  29677. * schema.checkChild( contextDefinition, childToCheck );
  29678. *
  29679. * // Also check in [ rootElement, blockQuoteElement, paragraphElement ].
  29680. * schema.checkChild( model.createPositionAt( paragraphElement, 0 ), 'foo' );
  29681. *
  29682. * // Check in [ rootElement, paragraphElement ].
  29683. * schema.checkChild( [ rootElement, paragraphElement ], 'foo' );
  29684. *
  29685. * // Check only fakeParagraphElement.
  29686. * schema.checkChild( 'paragraph', 'foo' );
  29687. *
  29688. * // Check in [ fakeRootElement, fakeBarElement, paragraphElement ].
  29689. * schema.checkChild( [ '$root', 'bar', paragraphElement ], 'foo' );
  29690. *
  29691. * All these `checkChild()` calls will fire {@link module:engine/model/schema~Schema#event:checkChild `Schema#checkChild`}
  29692. * events in which `args[ 0 ]` is an instance of the context. Therefore, you can write a listener like this:
  29693. *
  29694. * schema.on( 'checkChild', ( evt, args ) => {
  29695. * const ctx = args[ 0 ];
  29696. *
  29697. * console.log( Array.from( ctx.getNames() ) );
  29698. * } );
  29699. *
  29700. * Which will log the following:
  29701. *
  29702. * [ '$root', 'blockQuote', 'paragraph' ]
  29703. * [ '$root', 'paragraph' ]
  29704. * [ '$root', 'bar', 'paragraph' ]
  29705. *
  29706. * Note: When using the {@link module:engine/model/schema~Schema#checkAttribute `Schema#checkAttribute()`} method
  29707. * you may want to check whether a text node may have an attribute. A {@link module:engine/model/text~Text} is a
  29708. * correct way to define a context so you can do this:
  29709. *
  29710. * schema.checkAttribute( textNode, 'bold' );
  29711. *
  29712. * But sometimes you want to check whether a text at a given position might've had some attribute,
  29713. * in which case you can create a context by mixing in an array of elements with a `'$text'` string:
  29714. *
  29715. * // Check in [ rootElement, paragraphElement, textNode ].
  29716. * schema.checkChild( [ ...positionInParagraph.getAncestors(), '$text' ], 'bold' );
  29717. *
  29718. * @typedef {module:engine/model/node~Node|module:engine/model/position~Position|module:engine/model/schema~SchemaContext|
  29719. * String|Array.<String|module:engine/model/node~Node>} module:engine/model/schema~SchemaContextDefinition
  29720. */
  29721. /**
  29722. * An item of the {@link module:engine/model/schema~SchemaContext schema context}.
  29723. *
  29724. * It contains 3 properties:
  29725. *
  29726. * * `name` – the name of this item,
  29727. * * `* getAttributeKeys()` – a generator of keys of item attributes,
  29728. * * `getAttribute( keyName )` – a method to get attribute values.
  29729. *
  29730. * The context item interface is a highly simplified version of {@link module:engine/model/node~Node} and its role
  29731. * is to expose only the information which schema checks are able to provide (which is the name of the node and
  29732. * node's attributes).
  29733. *
  29734. * schema.on( 'checkChild', ( evt, args ) => {
  29735. * const ctx = args[ 0 ];
  29736. * const firstItem = ctx.getItem( 0 );
  29737. *
  29738. * console.log( firstItem.name ); // -> '$root'
  29739. * console.log( firstItem.getAttribute( 'foo' ) ); // -> 'bar'
  29740. * console.log( Array.from( firstItem.getAttributeKeys() ) ); // -> [ 'foo', 'faa' ]
  29741. * } );
  29742. *
  29743. * @typedef {Object} module:engine/model/schema~SchemaContextItem
  29744. */
  29745. /**
  29746. * A structure containing additional metadata describing the attribute.
  29747. *
  29748. * See {@link module:engine/model/schema~Schema#setAttributeProperties `Schema#setAttributeProperties()`} for usage examples.
  29749. *
  29750. * @typedef {Object} module:engine/model/schema~AttributeProperties
  29751. * @property {Boolean} [isFormatting] Indicates that the attribute should be considered as a visual formatting, like `bold`, `italic` or
  29752. * `fontSize` rather than semantic attribute (such as `src`, `listType`, etc.). For example, it is used by the "Remove format" feature.
  29753. * @property {Boolean} [copyOnEnter] Indicates that given text attribute should be copied to the next block when enter is pressed.
  29754. */
  29755. function compileBaseItemRule( sourceItemRules, itemName ) {
  29756. const itemRule = {
  29757. name: itemName,
  29758. allowIn: [],
  29759. allowContentOf: [],
  29760. allowWhere: [],
  29761. allowAttributes: [],
  29762. allowAttributesOf: [],
  29763. allowChildren: [],
  29764. inheritTypesFrom: []
  29765. };
  29766. copyTypes( sourceItemRules, itemRule );
  29767. copyProperty( sourceItemRules, itemRule, 'allowIn' );
  29768. copyProperty( sourceItemRules, itemRule, 'allowContentOf' );
  29769. copyProperty( sourceItemRules, itemRule, 'allowWhere' );
  29770. copyProperty( sourceItemRules, itemRule, 'allowAttributes' );
  29771. copyProperty( sourceItemRules, itemRule, 'allowAttributesOf' );
  29772. copyProperty( sourceItemRules, itemRule, 'allowChildren' );
  29773. copyProperty( sourceItemRules, itemRule, 'inheritTypesFrom' );
  29774. makeInheritAllWork( sourceItemRules, itemRule );
  29775. return itemRule;
  29776. }
  29777. function compileAllowChildren( compiledDefinitions, itemName ) {
  29778. const item = compiledDefinitions[ itemName ];
  29779. for ( const allowChildrenItem of item.allowChildren ) {
  29780. const allowedChildren = compiledDefinitions[ allowChildrenItem ];
  29781. // The allowChildren property may point to an unregistered element.
  29782. if ( !allowedChildren ) {
  29783. continue;
  29784. }
  29785. allowedChildren.allowIn.push( itemName );
  29786. }
  29787. // The allowIn property already includes correct items, reset the allowChildren property
  29788. // to avoid duplicates later when setting up compilation results.
  29789. item.allowChildren.length = 0;
  29790. }
  29791. function compileAllowContentOf( compiledDefinitions, itemName ) {
  29792. for ( const allowContentOfItemName of compiledDefinitions[ itemName ].allowContentOf ) {
  29793. // The allowContentOf property may point to an unregistered element.
  29794. if ( compiledDefinitions[ allowContentOfItemName ] ) {
  29795. const allowedChildren = getAllowedChildren( compiledDefinitions, allowContentOfItemName );
  29796. allowedChildren.forEach( allowedItem => {
  29797. allowedItem.allowIn.push( itemName );
  29798. } );
  29799. }
  29800. }
  29801. delete compiledDefinitions[ itemName ].allowContentOf;
  29802. }
  29803. function compileAllowWhere( compiledDefinitions, itemName ) {
  29804. for ( const allowWhereItemName of compiledDefinitions[ itemName ].allowWhere ) {
  29805. const inheritFrom = compiledDefinitions[ allowWhereItemName ];
  29806. // The allowWhere property may point to an unregistered element.
  29807. if ( inheritFrom ) {
  29808. const allowedIn = inheritFrom.allowIn;
  29809. compiledDefinitions[ itemName ].allowIn.push( ...allowedIn );
  29810. }
  29811. }
  29812. delete compiledDefinitions[ itemName ].allowWhere;
  29813. }
  29814. function compileAllowAttributesOf( compiledDefinitions, itemName ) {
  29815. for ( const allowAttributeOfItem of compiledDefinitions[ itemName ].allowAttributesOf ) {
  29816. const inheritFrom = compiledDefinitions[ allowAttributeOfItem ];
  29817. if ( inheritFrom ) {
  29818. const inheritAttributes = inheritFrom.allowAttributes;
  29819. compiledDefinitions[ itemName ].allowAttributes.push( ...inheritAttributes );
  29820. }
  29821. }
  29822. delete compiledDefinitions[ itemName ].allowAttributesOf;
  29823. }
  29824. function compileInheritPropertiesFrom( compiledDefinitions, itemName ) {
  29825. const item = compiledDefinitions[ itemName ];
  29826. for ( const inheritPropertiesOfItem of item.inheritTypesFrom ) {
  29827. const inheritFrom = compiledDefinitions[ inheritPropertiesOfItem ];
  29828. if ( inheritFrom ) {
  29829. const typeNames = Object.keys( inheritFrom ).filter( name => name.startsWith( 'is' ) );
  29830. for ( const name of typeNames ) {
  29831. if ( !( name in item ) ) {
  29832. item[ name ] = inheritFrom[ name ];
  29833. }
  29834. }
  29835. }
  29836. }
  29837. delete item.inheritTypesFrom;
  29838. }
  29839. // Remove items which weren't registered (because it may break some checks or we'd need to complicate them).
  29840. // Make sure allowIn doesn't contain repeated values.
  29841. function cleanUpAllowIn( compiledDefinitions, itemName ) {
  29842. const itemRule = compiledDefinitions[ itemName ];
  29843. const existingItems = itemRule.allowIn.filter( itemToCheck => compiledDefinitions[ itemToCheck ] );
  29844. itemRule.allowIn = Array.from( new Set( existingItems ) );
  29845. }
  29846. // Setup allowChildren items based on allowIn.
  29847. function setupAllowChildren( compiledDefinitions, itemName ) {
  29848. const itemRule = compiledDefinitions[ itemName ];
  29849. for ( const allowedParentItemName of itemRule.allowIn ) {
  29850. const allowedParentItem = compiledDefinitions[ allowedParentItemName ];
  29851. allowedParentItem.allowChildren.push( itemName );
  29852. }
  29853. }
  29854. function cleanUpAllowAttributes( compiledDefinitions, itemName ) {
  29855. const itemRule = compiledDefinitions[ itemName ];
  29856. itemRule.allowAttributes = Array.from( new Set( itemRule.allowAttributes ) );
  29857. }
  29858. function copyTypes( sourceItemRules, itemRule ) {
  29859. for ( const sourceItemRule of sourceItemRules ) {
  29860. const typeNames = Object.keys( sourceItemRule ).filter( name => name.startsWith( 'is' ) );
  29861. for ( const name of typeNames ) {
  29862. itemRule[ name ] = sourceItemRule[ name ];
  29863. }
  29864. }
  29865. }
  29866. function copyProperty( sourceItemRules, itemRule, propertyName ) {
  29867. for ( const sourceItemRule of sourceItemRules ) {
  29868. if ( typeof sourceItemRule[ propertyName ] == 'string' ) {
  29869. itemRule[ propertyName ].push( sourceItemRule[ propertyName ] );
  29870. } else if ( Array.isArray( sourceItemRule[ propertyName ] ) ) {
  29871. itemRule[ propertyName ].push( ...sourceItemRule[ propertyName ] );
  29872. }
  29873. }
  29874. }
  29875. function makeInheritAllWork( sourceItemRules, itemRule ) {
  29876. for ( const sourceItemRule of sourceItemRules ) {
  29877. const inheritFrom = sourceItemRule.inheritAllFrom;
  29878. if ( inheritFrom ) {
  29879. itemRule.allowContentOf.push( inheritFrom );
  29880. itemRule.allowWhere.push( inheritFrom );
  29881. itemRule.allowAttributesOf.push( inheritFrom );
  29882. itemRule.inheritTypesFrom.push( inheritFrom );
  29883. }
  29884. }
  29885. }
  29886. function getAllowedChildren( compiledDefinitions, itemName ) {
  29887. const itemRule = compiledDefinitions[ itemName ];
  29888. return getValues( compiledDefinitions ).filter( def => def.allowIn.includes( itemRule.name ) );
  29889. }
  29890. function getValues( obj ) {
  29891. return Object.keys( obj ).map( key => obj[ key ] );
  29892. }
  29893. function mapContextItem( ctxItem ) {
  29894. if ( typeof ctxItem == 'string' || ctxItem.is( 'documentFragment' ) ) {
  29895. return {
  29896. name: typeof ctxItem == 'string' ? ctxItem : '$documentFragment',
  29897. * getAttributeKeys() {},
  29898. getAttribute() {}
  29899. };
  29900. } else {
  29901. return {
  29902. // '$text' means text nodes and text proxies.
  29903. name: ctxItem.is( 'element' ) ? ctxItem.name : '$text',
  29904. * getAttributeKeys() {
  29905. yield* ctxItem.getAttributeKeys();
  29906. },
  29907. getAttribute( key ) {
  29908. return ctxItem.getAttribute( key );
  29909. }
  29910. };
  29911. }
  29912. }
  29913. // Generator function returning values from provided walkers, switching between them at each iteration. If only one walker
  29914. // is provided it will return data only from that walker.
  29915. //
  29916. // @param {module:engine/module/treewalker~TreeWalker} [backward] Walker iterating in backward direction.
  29917. // @param {module:engine/module/treewalker~TreeWalker} [forward] Walker iterating in forward direction.
  29918. // @returns {Iterable.<Object>} Object returned at each iteration contains `value` and `walker` (informing which walker returned
  29919. // given value) fields.
  29920. function* combineWalkers( backward, forward ) {
  29921. let done = false;
  29922. while ( !done ) {
  29923. done = true;
  29924. if ( backward ) {
  29925. const step = backward.next();
  29926. if ( !step.done ) {
  29927. done = false;
  29928. yield {
  29929. walker: backward,
  29930. value: step.value
  29931. };
  29932. }
  29933. }
  29934. if ( forward ) {
  29935. const step = forward.next();
  29936. if ( !step.done ) {
  29937. done = false;
  29938. yield {
  29939. walker: forward,
  29940. value: step.value
  29941. };
  29942. }
  29943. }
  29944. }
  29945. }
  29946. // Takes an array of non-intersecting ranges. For each of them gets minimal flat ranges covering that range and returns
  29947. // all those minimal flat ranges.
  29948. //
  29949. // @param {Array.<module:engine/model/range~Range>} ranges Ranges to process.
  29950. // @returns {Iterable.<module:engine/model/range~Range>} Minimal flat ranges of given `ranges`.
  29951. function* convertToMinimalFlatRanges( ranges ) {
  29952. for ( const range of ranges ) {
  29953. yield* range.getMinimalFlatRanges();
  29954. }
  29955. }
  29956. function removeDisallowedAttributeFromNode( schema, node, writer ) {
  29957. for ( const attribute of node.getAttributeKeys() ) {
  29958. if ( !schema.checkAttribute( node, attribute ) ) {
  29959. writer.removeAttribute( attribute, node );
  29960. }
  29961. }
  29962. }
  29963. /***/ }),
  29964. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/selection.js":
  29965. /*!************************************************************************!*\
  29966. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/selection.js ***!
  29967. \************************************************************************/
  29968. /*! exports provided: default */
  29969. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  29970. "use strict";
  29971. __webpack_require__.r(__webpack_exports__);
  29972. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Selection; });
  29973. /* harmony import */ var _position__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./position */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/position.js");
  29974. /* harmony import */ var _node__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./node */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/node.js");
  29975. /* harmony import */ var _range__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./range */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/range.js");
  29976. /* 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");
  29977. /* 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");
  29978. /* 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");
  29979. /* 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");
  29980. /**
  29981. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  29982. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  29983. */
  29984. /**
  29985. * @module engine/model/selection
  29986. */
  29987. /**
  29988. * Selection is a set of {@link module:engine/model/range~Range ranges}. It has a direction specified by its
  29989. * {@link module:engine/model/selection~Selection#anchor anchor} and {@link module:engine/model/selection~Selection#focus focus}
  29990. * (it can be {@link module:engine/model/selection~Selection#isBackward forward or backward}).
  29991. * Additionally, selection may have its own attributes (think – whether text typed in in this selection
  29992. * should have those attributes – e.g. whether you type a bolded text).
  29993. *
  29994. * @mixes module:utils/emittermixin~EmitterMixin
  29995. */
  29996. class Selection {
  29997. /**
  29998. * Creates a new selection instance based on the given {@link module:engine/model/selection~Selectable selectable}
  29999. * or creates an empty selection if no arguments were passed.
  30000. *
  30001. * // Creates empty selection without ranges.
  30002. * const selection = writer.createSelection();
  30003. *
  30004. * // Creates selection at the given range.
  30005. * const range = writer.createRange( start, end );
  30006. * const selection = writer.createSelection( range );
  30007. *
  30008. * // Creates selection at the given ranges
  30009. * const ranges = [ writer.createRange( start1, end2 ), writer.createRange( star2, end2 ) ];
  30010. * const selection = writer.createSelection( ranges );
  30011. *
  30012. * // Creates selection from the other selection.
  30013. * // Note: It doesn't copies selection attributes.
  30014. * const otherSelection = writer.createSelection();
  30015. * const selection = writer.createSelection( otherSelection );
  30016. *
  30017. * // Creates selection from the given document selection.
  30018. * // Note: It doesn't copies selection attributes.
  30019. * const documentSelection = model.document.selection;
  30020. * const selection = writer.createSelection( documentSelection );
  30021. *
  30022. * // Creates selection at the given position.
  30023. * const position = writer.createPositionFromPath( root, path );
  30024. * const selection = writer.createSelection( position );
  30025. *
  30026. * // Creates selection at the given offset in the given element.
  30027. * const paragraph = writer.createElement( 'paragraph' );
  30028. * const selection = writer.createSelection( paragraph, offset );
  30029. *
  30030. * // Creates a range inside an {@link module:engine/model/element~Element element} which starts before the
  30031. * // first child of that element and ends after the last child of that element.
  30032. * const selection = writer.createSelection( paragraph, 'in' );
  30033. *
  30034. * // Creates a range on an {@link module:engine/model/item~Item item} which starts before the item and ends
  30035. * // just after the item.
  30036. * const selection = writer.createSelection( paragraph, 'on' );
  30037. *
  30038. * Selection's constructor allow passing additional options (`'backward'`) as the last argument.
  30039. *
  30040. * // Creates backward selection.
  30041. * const selection = writer.createSelection( range, { backward: true } );
  30042. *
  30043. * @param {module:engine/model/selection~Selectable} selectable
  30044. * @param {Number|'before'|'end'|'after'|'on'|'in'} [placeOrOffset] Sets place or offset of the selection.
  30045. * @param {Object} [options]
  30046. * @param {Boolean} [options.backward] Sets this selection instance to be backward.
  30047. */
  30048. constructor( selectable, placeOrOffset, options ) {
  30049. /**
  30050. * Specifies whether the last added range was added as a backward or forward range.
  30051. *
  30052. * @private
  30053. * @type {Boolean}
  30054. */
  30055. this._lastRangeBackward = false;
  30056. /**
  30057. * Stores selection ranges.
  30058. *
  30059. * @protected
  30060. * @type {Array.<module:engine/model/range~Range>}
  30061. */
  30062. this._ranges = [];
  30063. /**
  30064. * List of attributes set on current selection.
  30065. *
  30066. * @protected
  30067. * @type {Map.<String,*>}
  30068. */
  30069. this._attrs = new Map();
  30070. if ( selectable ) {
  30071. this.setTo( selectable, placeOrOffset, options );
  30072. }
  30073. }
  30074. /**
  30075. * Selection anchor. Anchor is the position from which the selection was started. If a user is making a selection
  30076. * by dragging the mouse, the anchor is where the user pressed the mouse button (the beginning of the selection).
  30077. *
  30078. * Anchor and {@link #focus} define the direction of the selection, which is important
  30079. * when expanding/shrinking selection. The focus moves, while the anchor should remain in the same place.
  30080. *
  30081. * Anchor is always set to the {@link module:engine/model/range~Range#start start} or
  30082. * {@link module:engine/model/range~Range#end end} position of the last of selection's ranges. Whether it is
  30083. * the `start` or `end` depends on the specified `options.backward`. See the {@link #setTo `setTo()`} method.
  30084. *
  30085. * May be set to `null` if there are no ranges in the selection.
  30086. *
  30087. * @see #focus
  30088. * @readonly
  30089. * @type {module:engine/model/position~Position|null}
  30090. */
  30091. get anchor() {
  30092. if ( this._ranges.length > 0 ) {
  30093. const range = this._ranges[ this._ranges.length - 1 ];
  30094. return this._lastRangeBackward ? range.end : range.start;
  30095. }
  30096. return null;
  30097. }
  30098. /**
  30099. * Selection focus. Focus is the position where the selection ends. If a user is making a selection
  30100. * by dragging the mouse, the focus is where the mouse cursor is.
  30101. *
  30102. * May be set to `null` if there are no ranges in the selection.
  30103. *
  30104. * @see #anchor
  30105. * @readonly
  30106. * @type {module:engine/model/position~Position|null}
  30107. */
  30108. get focus() {
  30109. if ( this._ranges.length > 0 ) {
  30110. const range = this._ranges[ this._ranges.length - 1 ];
  30111. return this._lastRangeBackward ? range.start : range.end;
  30112. }
  30113. return null;
  30114. }
  30115. /**
  30116. * Whether the selection is collapsed. Selection is collapsed when there is exactly one range in it
  30117. * and it is collapsed.
  30118. *
  30119. * @readonly
  30120. * @type {Boolean}
  30121. */
  30122. get isCollapsed() {
  30123. const length = this._ranges.length;
  30124. if ( length === 1 ) {
  30125. return this._ranges[ 0 ].isCollapsed;
  30126. } else {
  30127. return false;
  30128. }
  30129. }
  30130. /**
  30131. * Returns the number of ranges in the selection.
  30132. *
  30133. * @readonly
  30134. * @type {Number}
  30135. */
  30136. get rangeCount() {
  30137. return this._ranges.length;
  30138. }
  30139. /**
  30140. * Specifies whether the selection's {@link #focus} precedes the selection's {@link #anchor}.
  30141. *
  30142. * @readonly
  30143. * @type {Boolean}
  30144. */
  30145. get isBackward() {
  30146. return !this.isCollapsed && this._lastRangeBackward;
  30147. }
  30148. /**
  30149. * Checks whether this selection is equal to the given selection. Selections are equal if they have the same directions,
  30150. * the same number of ranges and all ranges from one selection equal to ranges from the another selection.
  30151. *
  30152. * @param {module:engine/model/selection~Selection|module:engine/model/documentselection~DocumentSelection} otherSelection
  30153. * Selection to compare with.
  30154. * @returns {Boolean} `true` if selections are equal, `false` otherwise.
  30155. */
  30156. isEqual( otherSelection ) {
  30157. if ( this.rangeCount != otherSelection.rangeCount ) {
  30158. return false;
  30159. } else if ( this.rangeCount === 0 ) {
  30160. return true;
  30161. }
  30162. if ( !this.anchor.isEqual( otherSelection.anchor ) || !this.focus.isEqual( otherSelection.focus ) ) {
  30163. return false;
  30164. }
  30165. for ( const thisRange of this._ranges ) {
  30166. let found = false;
  30167. for ( const otherRange of otherSelection._ranges ) {
  30168. if ( thisRange.isEqual( otherRange ) ) {
  30169. found = true;
  30170. break;
  30171. }
  30172. }
  30173. if ( !found ) {
  30174. return false;
  30175. }
  30176. }
  30177. return true;
  30178. }
  30179. /**
  30180. * Returns an iterable object that iterates over copies of selection ranges.
  30181. *
  30182. * @returns {Iterable.<module:engine/model/range~Range>}
  30183. */
  30184. * getRanges() {
  30185. for ( const range of this._ranges ) {
  30186. yield new _range__WEBPACK_IMPORTED_MODULE_2__["default"]( range.start, range.end );
  30187. }
  30188. }
  30189. /**
  30190. * Returns a copy of the first range in the selection.
  30191. * First range is the one which {@link module:engine/model/range~Range#start start} position
  30192. * {@link module:engine/model/position~Position#isBefore is before} start position of all other ranges
  30193. * (not to confuse with the first range added to the selection).
  30194. *
  30195. * Returns `null` if there are no ranges in selection.
  30196. *
  30197. * @returns {module:engine/model/range~Range|null}
  30198. */
  30199. getFirstRange() {
  30200. let first = null;
  30201. for ( const range of this._ranges ) {
  30202. if ( !first || range.start.isBefore( first.start ) ) {
  30203. first = range;
  30204. }
  30205. }
  30206. return first ? new _range__WEBPACK_IMPORTED_MODULE_2__["default"]( first.start, first.end ) : null;
  30207. }
  30208. /**
  30209. * Returns a copy of the last range in the selection.
  30210. * Last range is the one which {@link module:engine/model/range~Range#end end} position
  30211. * {@link module:engine/model/position~Position#isAfter is after} end position of all other ranges (not to confuse with the range most
  30212. * recently added to the selection).
  30213. *
  30214. * Returns `null` if there are no ranges in selection.
  30215. *
  30216. * @returns {module:engine/model/range~Range|null}
  30217. */
  30218. getLastRange() {
  30219. let last = null;
  30220. for ( const range of this._ranges ) {
  30221. if ( !last || range.end.isAfter( last.end ) ) {
  30222. last = range;
  30223. }
  30224. }
  30225. return last ? new _range__WEBPACK_IMPORTED_MODULE_2__["default"]( last.start, last.end ) : null;
  30226. }
  30227. /**
  30228. * Returns the first position in the selection.
  30229. * First position is the position that {@link module:engine/model/position~Position#isBefore is before}
  30230. * any other position in the selection.
  30231. *
  30232. * Returns `null` if there are no ranges in selection.
  30233. *
  30234. * @returns {module:engine/model/position~Position|null}
  30235. */
  30236. getFirstPosition() {
  30237. const first = this.getFirstRange();
  30238. return first ? first.start.clone() : null;
  30239. }
  30240. /**
  30241. * Returns the last position in the selection.
  30242. * Last position is the position that {@link module:engine/model/position~Position#isAfter is after}
  30243. * any other position in the selection.
  30244. *
  30245. * Returns `null` if there are no ranges in selection.
  30246. *
  30247. * @returns {module:engine/model/position~Position|null}
  30248. */
  30249. getLastPosition() {
  30250. const lastRange = this.getLastRange();
  30251. return lastRange ? lastRange.end.clone() : null;
  30252. }
  30253. /**
  30254. * Sets this selection's ranges and direction to the specified location based on the given
  30255. * {@link module:engine/model/selection~Selectable selectable}.
  30256. *
  30257. * // Removes all selection's ranges.
  30258. * selection.setTo( null );
  30259. *
  30260. * // Sets selection to the given range.
  30261. * const range = writer.createRange( start, end );
  30262. * selection.setTo( range );
  30263. *
  30264. * // Sets selection to given ranges.
  30265. * const ranges = [ writer.createRange( start1, end2 ), writer.createRange( star2, end2 ) ];
  30266. * selection.setTo( ranges );
  30267. *
  30268. * // Sets selection to other selection.
  30269. * // Note: It doesn't copies selection attributes.
  30270. * const otherSelection = writer.createSelection();
  30271. * selection.setTo( otherSelection );
  30272. *
  30273. * // Sets selection to the given document selection.
  30274. * // Note: It doesn't copies selection attributes.
  30275. * const documentSelection = new DocumentSelection( doc );
  30276. * selection.setTo( documentSelection );
  30277. *
  30278. * // Sets collapsed selection at the given position.
  30279. * const position = writer.createPositionFromPath( root, path );
  30280. * selection.setTo( position );
  30281. *
  30282. * // Sets collapsed selection at the position of the given node and an offset.
  30283. * selection.setTo( paragraph, offset );
  30284. *
  30285. * Creates a range inside an {@link module:engine/model/element~Element element} which starts before the first child of
  30286. * that element and ends after the last child of that element.
  30287. *
  30288. * selection.setTo( paragraph, 'in' );
  30289. *
  30290. * Creates a range on an {@link module:engine/model/item~Item item} which starts before the item and ends just after the item.
  30291. *
  30292. * selection.setTo( paragraph, 'on' );
  30293. *
  30294. * `Selection#setTo()`' method allow passing additional options (`backward`) as the last argument.
  30295. *
  30296. * // Sets backward selection.
  30297. * const selection = writer.createSelection( range, { backward: true } );
  30298. *
  30299. * @param {module:engine/model/selection~Selectable} selectable
  30300. * @param {Number|'before'|'end'|'after'|'on'|'in'} [placeOrOffset] Sets place or offset of the selection.
  30301. * @param {Object} [options]
  30302. * @param {Boolean} [options.backward] Sets this selection instance to be backward.
  30303. */
  30304. setTo( selectable, placeOrOffset, options ) {
  30305. if ( selectable === null ) {
  30306. this._setRanges( [] );
  30307. } else if ( selectable instanceof Selection ) {
  30308. this._setRanges( selectable.getRanges(), selectable.isBackward );
  30309. } else if ( selectable && typeof selectable.getRanges == 'function' ) {
  30310. // We assume that the selectable is a DocumentSelection.
  30311. // It can't be imported here, because it would lead to circular imports.
  30312. this._setRanges( selectable.getRanges(), selectable.isBackward );
  30313. } else if ( selectable instanceof _range__WEBPACK_IMPORTED_MODULE_2__["default"] ) {
  30314. this._setRanges( [ selectable ], !!placeOrOffset && !!placeOrOffset.backward );
  30315. } else if ( selectable instanceof _position__WEBPACK_IMPORTED_MODULE_0__["default"] ) {
  30316. this._setRanges( [ new _range__WEBPACK_IMPORTED_MODULE_2__["default"]( selectable ) ] );
  30317. } else if ( selectable instanceof _node__WEBPACK_IMPORTED_MODULE_1__["default"] ) {
  30318. const backward = !!options && !!options.backward;
  30319. let range;
  30320. if ( placeOrOffset == 'in' ) {
  30321. range = _range__WEBPACK_IMPORTED_MODULE_2__["default"]._createIn( selectable );
  30322. } else if ( placeOrOffset == 'on' ) {
  30323. range = _range__WEBPACK_IMPORTED_MODULE_2__["default"]._createOn( selectable );
  30324. } else if ( placeOrOffset !== undefined ) {
  30325. range = new _range__WEBPACK_IMPORTED_MODULE_2__["default"]( _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createAt( selectable, placeOrOffset ) );
  30326. } else {
  30327. /**
  30328. * selection.setTo requires the second parameter when the first parameter is a node.
  30329. *
  30330. * @error model-selection-setto-required-second-parameter
  30331. */
  30332. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_4__["default"]( 'model-selection-setto-required-second-parameter', [ this, selectable ] );
  30333. }
  30334. this._setRanges( [ range ], backward );
  30335. } else if ( Object(_ckeditor_ckeditor5_utils_src_isiterable__WEBPACK_IMPORTED_MODULE_6__["default"])( selectable ) ) {
  30336. // We assume that the selectable is an iterable of ranges.
  30337. this._setRanges( selectable, placeOrOffset && !!placeOrOffset.backward );
  30338. } else {
  30339. /**
  30340. * Cannot set the selection to the given place.
  30341. *
  30342. * Invalid parameters were specified when setting the selection. Common issues:
  30343. *
  30344. * * A {@link module:engine/model/textproxy~TextProxy} instance was passed instead of
  30345. * a real {@link module:engine/model/text~Text}.
  30346. * * View nodes were passed instead of model nodes.
  30347. * * `null`/`undefined` was passed.
  30348. *
  30349. * @error model-selection-setto-not-selectable
  30350. */
  30351. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_4__["default"]( 'model-selection-setto-not-selectable', [ this, selectable ] );
  30352. }
  30353. }
  30354. /**
  30355. * Replaces all ranges that were added to the selection with given array of ranges. Last range of the array
  30356. * is treated like the last added range and is used to set {@link module:engine/model/selection~Selection#anchor} and
  30357. * {@link module:engine/model/selection~Selection#focus}. Accepts a flag describing in which direction the selection is made.
  30358. *
  30359. * @protected
  30360. * @fires change:range
  30361. * @param {Iterable.<module:engine/model/range~Range>} newRanges Ranges to set.
  30362. * @param {Boolean} [isLastBackward=false] Flag describing if last added range was selected forward - from start to end (`false`)
  30363. * or backward - from end to start (`true`).
  30364. */
  30365. _setRanges( newRanges, isLastBackward = false ) {
  30366. newRanges = Array.from( newRanges );
  30367. // Check whether there is any range in new ranges set that is different than all already added ranges.
  30368. const anyNewRange = newRanges.some( newRange => {
  30369. if ( !( newRange instanceof _range__WEBPACK_IMPORTED_MODULE_2__["default"] ) ) {
  30370. /**
  30371. * Selection range set to an object that is not an instance of {@link module:engine/model/range~Range}.
  30372. *
  30373. * Only {@link module:engine/model/range~Range} instances can be used to set a selection.
  30374. * Common mistakes leading to this error are:
  30375. *
  30376. * * using DOM `Range` object,
  30377. * * incorrect CKEditor 5 installation with multiple `ckeditor5-engine` packages having different versions.
  30378. *
  30379. * @error model-selection-set-ranges-not-range
  30380. */
  30381. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_4__["default"](
  30382. 'model-selection-set-ranges-not-range',
  30383. [ this, newRanges ]
  30384. );
  30385. }
  30386. return this._ranges.every( oldRange => {
  30387. return !oldRange.isEqual( newRange );
  30388. } );
  30389. } );
  30390. // Don't do anything if nothing changed.
  30391. if ( newRanges.length === this._ranges.length && !anyNewRange ) {
  30392. return;
  30393. }
  30394. this._removeAllRanges();
  30395. for ( const range of newRanges ) {
  30396. this._pushRange( range );
  30397. }
  30398. this._lastRangeBackward = !!isLastBackward;
  30399. this.fire( 'change:range', { directChange: true } );
  30400. }
  30401. /**
  30402. * Moves {@link module:engine/model/selection~Selection#focus} to the specified location.
  30403. *
  30404. * The location can be specified in the same form as
  30405. * {@link module:engine/model/writer~Writer#createPositionAt writer.createPositionAt()} parameters.
  30406. *
  30407. * @fires change:range
  30408. * @param {module:engine/model/item~Item|module:engine/model/position~Position} itemOrPosition
  30409. * @param {Number|'end'|'before'|'after'} [offset] Offset or one of the flags. Used only when
  30410. * first parameter is a {@link module:engine/model/item~Item model item}.
  30411. */
  30412. setFocus( itemOrPosition, offset ) {
  30413. if ( this.anchor === null ) {
  30414. /**
  30415. * Cannot set selection focus if there are no ranges in selection.
  30416. *
  30417. * @error model-selection-setfocus-no-ranges
  30418. */
  30419. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_4__["default"]( 'model-selection-setfocus-no-ranges', [ this, itemOrPosition ] );
  30420. }
  30421. const newFocus = _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createAt( itemOrPosition, offset );
  30422. if ( newFocus.compareWith( this.focus ) == 'same' ) {
  30423. return;
  30424. }
  30425. const anchor = this.anchor;
  30426. if ( this._ranges.length ) {
  30427. this._popRange();
  30428. }
  30429. if ( newFocus.compareWith( anchor ) == 'before' ) {
  30430. this._pushRange( new _range__WEBPACK_IMPORTED_MODULE_2__["default"]( newFocus, anchor ) );
  30431. this._lastRangeBackward = true;
  30432. } else {
  30433. this._pushRange( new _range__WEBPACK_IMPORTED_MODULE_2__["default"]( anchor, newFocus ) );
  30434. this._lastRangeBackward = false;
  30435. }
  30436. this.fire( 'change:range', { directChange: true } );
  30437. }
  30438. /**
  30439. * Gets an attribute value for given key or `undefined` if that attribute is not set on the selection.
  30440. *
  30441. * @param {String} key Key of attribute to look for.
  30442. * @returns {*} Attribute value or `undefined`.
  30443. */
  30444. getAttribute( key ) {
  30445. return this._attrs.get( key );
  30446. }
  30447. /**
  30448. * Returns iterable that iterates over this selection's attributes.
  30449. *
  30450. * Attributes are returned as arrays containing two items. First one is attribute key and second is attribute value.
  30451. * This format is accepted by native `Map` object and also can be passed in `Node` constructor.
  30452. *
  30453. * @returns {Iterable.<*>}
  30454. */
  30455. getAttributes() {
  30456. return this._attrs.entries();
  30457. }
  30458. /**
  30459. * Returns iterable that iterates over this selection's attribute keys.
  30460. *
  30461. * @returns {Iterable.<String>}
  30462. */
  30463. getAttributeKeys() {
  30464. return this._attrs.keys();
  30465. }
  30466. /**
  30467. * Checks if the selection has an attribute for given key.
  30468. *
  30469. * @param {String} key Key of attribute to check.
  30470. * @returns {Boolean} `true` if attribute with given key is set on selection, `false` otherwise.
  30471. */
  30472. hasAttribute( key ) {
  30473. return this._attrs.has( key );
  30474. }
  30475. /**
  30476. * Removes an attribute with given key from the selection.
  30477. *
  30478. * If given attribute was set on the selection, fires the {@link #event:change:range} event with
  30479. * removed attribute key.
  30480. *
  30481. * @fires change:attribute
  30482. * @param {String} key Key of attribute to remove.
  30483. */
  30484. removeAttribute( key ) {
  30485. if ( this.hasAttribute( key ) ) {
  30486. this._attrs.delete( key );
  30487. this.fire( 'change:attribute', { attributeKeys: [ key ], directChange: true } );
  30488. }
  30489. }
  30490. /**
  30491. * Sets attribute on the selection. If attribute with the same key already is set, it's value is overwritten.
  30492. *
  30493. * If the attribute value has changed, fires the {@link #event:change:range} event with
  30494. * the attribute key.
  30495. *
  30496. * @fires change:attribute
  30497. * @param {String} key Key of attribute to set.
  30498. * @param {*} value Attribute value.
  30499. */
  30500. setAttribute( key, value ) {
  30501. if ( this.getAttribute( key ) !== value ) {
  30502. this._attrs.set( key, value );
  30503. this.fire( 'change:attribute', { attributeKeys: [ key ], directChange: true } );
  30504. }
  30505. }
  30506. /**
  30507. * Returns the selected element. {@link module:engine/model/element~Element Element} is considered as selected if there is only
  30508. * one range in the selection, and that range contains exactly one element.
  30509. * Returns `null` if there is no selected element.
  30510. *
  30511. * @returns {module:engine/model/element~Element|null}
  30512. */
  30513. getSelectedElement() {
  30514. if ( this.rangeCount !== 1 ) {
  30515. return null;
  30516. }
  30517. return this.getFirstRange().getContainedElement();
  30518. }
  30519. /**
  30520. * Checks whether this object is of the given.
  30521. *
  30522. * selection.is( 'selection' ); // -> true
  30523. * selection.is( 'model:selection' ); // -> true
  30524. *
  30525. * selection.is( 'view:selection' ); // -> false
  30526. * selection.is( 'range' ); // -> false
  30527. *
  30528. * {@link module:engine/model/node~Node#is Check the entire list of model objects} which implement the `is()` method.
  30529. *
  30530. * @param {String} type
  30531. * @returns {Boolean}
  30532. */
  30533. is( type ) {
  30534. return type === 'selection' || type === 'model:selection';
  30535. }
  30536. /**
  30537. * Gets elements of type {@link module:engine/model/schema~Schema#isBlock "block"} touched by the selection.
  30538. *
  30539. * This method's result can be used for example to apply block styling to all blocks covered by this selection.
  30540. *
  30541. * **Note:** `getSelectedBlocks()` returns blocks that are nested in other non-block elements
  30542. * but will not return blocks nested in other blocks.
  30543. *
  30544. * In this case the function will return exactly all 3 paragraphs (note: `<blockQuote>` is not a block itself):
  30545. *
  30546. * <paragraph>[a</paragraph>
  30547. * <blockQuote>
  30548. * <paragraph>b</paragraph>
  30549. * </blockQuote>
  30550. * <paragraph>c]d</paragraph>
  30551. *
  30552. * In this case the paragraph will also be returned, despite the collapsed selection:
  30553. *
  30554. * <paragraph>[]a</paragraph>
  30555. *
  30556. * In such a scenario, however, only blocks A, B & E will be returned as blocks C & D are nested in block B:
  30557. *
  30558. * [<blockA></blockA>
  30559. * <blockB>
  30560. * <blockC></blockC>
  30561. * <blockD></blockD>
  30562. * </blockB>
  30563. * <blockE></blockE>]
  30564. *
  30565. * If the selection is inside a block all the inner blocks (A & B) are returned:
  30566. *
  30567. * <block>
  30568. * <blockA>[a</blockA>
  30569. * <blockB>b]</blockB>
  30570. * </block>
  30571. *
  30572. * **Special case**: If a selection ends at the beginning of a block, that block is not returned as from user perspective
  30573. * this block wasn't selected. See [#984](https://github.com/ckeditor/ckeditor5-engine/issues/984) for more details.
  30574. *
  30575. * <paragraph>[a</paragraph>
  30576. * <paragraph>b</paragraph>
  30577. * <paragraph>]c</paragraph> // this block will not be returned
  30578. *
  30579. * @returns {Iterable.<module:engine/model/element~Element>}
  30580. */
  30581. * getSelectedBlocks() {
  30582. const visited = new WeakSet();
  30583. for ( const range of this.getRanges() ) {
  30584. // Get start block of range in case of a collapsed range.
  30585. const startBlock = getParentBlock( range.start, visited );
  30586. if ( startBlock && isTopBlockInRange( startBlock, range ) ) {
  30587. yield startBlock;
  30588. }
  30589. for ( const value of range.getWalker() ) {
  30590. const block = value.item;
  30591. if ( value.type == 'elementEnd' && isUnvisitedTopBlock( block, visited, range ) ) {
  30592. yield block;
  30593. }
  30594. }
  30595. const endBlock = getParentBlock( range.end, visited );
  30596. // #984. Don't return the end block if the range ends right at its beginning.
  30597. if ( endBlock && !range.end.isTouching( _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createAt( endBlock, 0 ) ) && isTopBlockInRange( endBlock, range ) ) {
  30598. yield endBlock;
  30599. }
  30600. }
  30601. }
  30602. /**
  30603. * Checks whether the selection contains the entire content of the given element. This means that selection must start
  30604. * at a position {@link module:engine/model/position~Position#isTouching touching} the element's start and ends at position
  30605. * touching the element's end.
  30606. *
  30607. * By default, this method will check whether the entire content of the selection's current root is selected.
  30608. * Useful to check if e.g. the user has just pressed <kbd>Ctrl</kbd> + <kbd>A</kbd>.
  30609. *
  30610. * @param {module:engine/model/element~Element} [element=this.anchor.root]
  30611. * @returns {Boolean}
  30612. */
  30613. containsEntireContent( element = this.anchor.root ) {
  30614. const limitStartPosition = _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createAt( element, 0 );
  30615. const limitEndPosition = _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createAt( element, 'end' );
  30616. return limitStartPosition.isTouching( this.getFirstPosition() ) &&
  30617. limitEndPosition.isTouching( this.getLastPosition() );
  30618. }
  30619. /**
  30620. * Adds given range to internal {@link #_ranges ranges array}. Throws an error
  30621. * if given range is intersecting with any range that is already stored in this selection.
  30622. *
  30623. * @protected
  30624. * @param {module:engine/model/range~Range} range Range to add.
  30625. */
  30626. _pushRange( range ) {
  30627. this._checkRange( range );
  30628. this._ranges.push( new _range__WEBPACK_IMPORTED_MODULE_2__["default"]( range.start, range.end ) );
  30629. }
  30630. /**
  30631. * Checks if given range intersects with ranges that are already in the selection. Throws an error if it does.
  30632. *
  30633. * @protected
  30634. * @param {module:engine/model/range~Range} range Range to check.
  30635. */
  30636. _checkRange( range ) {
  30637. for ( let i = 0; i < this._ranges.length; i++ ) {
  30638. if ( range.isIntersecting( this._ranges[ i ] ) ) {
  30639. /**
  30640. * Trying to add a range that intersects with another range in the selection.
  30641. *
  30642. * @error model-selection-range-intersects
  30643. * @param {module:engine/model/range~Range} addedRange Range that was added to the selection.
  30644. * @param {module:engine/model/range~Range} intersectingRange Range in the selection that intersects with `addedRange`.
  30645. */
  30646. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_4__["default"](
  30647. 'model-selection-range-intersects',
  30648. [ this, range ],
  30649. { addedRange: range, intersectingRange: this._ranges[ i ] }
  30650. );
  30651. }
  30652. }
  30653. }
  30654. /**
  30655. * Deletes ranges from internal range array. Uses {@link #_popRange _popRange} to
  30656. * ensure proper ranges removal.
  30657. *
  30658. * @protected
  30659. */
  30660. _removeAllRanges() {
  30661. while ( this._ranges.length > 0 ) {
  30662. this._popRange();
  30663. }
  30664. }
  30665. /**
  30666. * Removes most recently added range from the selection.
  30667. *
  30668. * @protected
  30669. */
  30670. _popRange() {
  30671. this._ranges.pop();
  30672. }
  30673. /**
  30674. * Fired when selection range(s) changed.
  30675. *
  30676. * @event change:range
  30677. * @param {Boolean} directChange In case of {@link module:engine/model/selection~Selection} class it is always set
  30678. * to `true` which indicates that the selection change was caused by a direct use of selection's API.
  30679. * The {@link module:engine/model/documentselection~DocumentSelection}, however, may change because its position
  30680. * was directly changed through the {@link module:engine/model/writer~Writer writer} or because its position was
  30681. * changed because the structure of the model has been changed (which means an indirect change).
  30682. * The indirect change does not occur in case of normal (detached) selections because they are "static" (as "not live")
  30683. * which mean that they are not updated once the document changes.
  30684. */
  30685. /**
  30686. * Fired when selection attribute changed.
  30687. *
  30688. * @event change:attribute
  30689. * @param {Boolean} directChange In case of {@link module:engine/model/selection~Selection} class it is always set
  30690. * to `true` which indicates that the selection change was caused by a direct use of selection's API.
  30691. * The {@link module:engine/model/documentselection~DocumentSelection}, however, may change because its attributes
  30692. * were directly changed through the {@link module:engine/model/writer~Writer writer} or because its position was
  30693. * changed in the model and its attributes were refreshed (which means an indirect change).
  30694. * The indirect change does not occur in case of normal (detached) selections because they are "static" (as "not live")
  30695. * which mean that they are not updated once the document changes.
  30696. * @param {Array.<String>} attributeKeys Array containing keys of attributes that changed.
  30697. */
  30698. }
  30699. Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_5__["default"])( Selection, _ckeditor_ckeditor5_utils_src_emittermixin__WEBPACK_IMPORTED_MODULE_3__["default"] );
  30700. // Checks whether the given element extends $block in the schema and has a parent (is not a root).
  30701. // Marks it as already visited.
  30702. function isUnvisitedBlock( element, visited ) {
  30703. if ( visited.has( element ) ) {
  30704. return false;
  30705. }
  30706. visited.add( element );
  30707. return element.root.document.model.schema.isBlock( element ) && element.parent;
  30708. }
  30709. // Checks if the given element is a $block was not previously visited and is a top block in a range.
  30710. function isUnvisitedTopBlock( element, visited, range ) {
  30711. return isUnvisitedBlock( element, visited ) && isTopBlockInRange( element, range );
  30712. }
  30713. // Finds the lowest element in position's ancestors which is a block.
  30714. // It will search until first ancestor that is a limit element.
  30715. // Marks all ancestors as already visited to not include any of them later on.
  30716. function getParentBlock( position, visited ) {
  30717. const element = position.parent;
  30718. const schema = element.root.document.model.schema;
  30719. const ancestors = position.parent.getAncestors( { parentFirst: true, includeSelf: true } );
  30720. let hasParentLimit = false;
  30721. const block = ancestors.find( element => {
  30722. // Stop searching after first parent node that is limit element.
  30723. if ( hasParentLimit ) {
  30724. return false;
  30725. }
  30726. hasParentLimit = schema.isLimit( element );
  30727. return !hasParentLimit && isUnvisitedBlock( element, visited );
  30728. } );
  30729. // Mark all ancestors of this position's parent, because find() might've stopped early and
  30730. // the found block may be a child of another block.
  30731. ancestors.forEach( element => visited.add( element ) );
  30732. return block;
  30733. }
  30734. // Checks if the blocks is not nested in other block inside a range.
  30735. //
  30736. // @param {module:engine/model/element~Element} block Block to check.
  30737. // @param {module:engine/model/range~Range} range Range to check.
  30738. function isTopBlockInRange( block, range ) {
  30739. const parentBlock = findAncestorBlock( block );
  30740. if ( !parentBlock ) {
  30741. return true;
  30742. }
  30743. // Add loose flag to check as parentRange can be equal to range.
  30744. const isParentInRange = range.containsRange( _range__WEBPACK_IMPORTED_MODULE_2__["default"]._createOn( parentBlock ), true );
  30745. return !isParentInRange;
  30746. }
  30747. // Returns first ancestor block of a node.
  30748. //
  30749. // @param {module:engine/model/node~Node} node
  30750. // @returns {module:engine/model/node~Node|undefined}
  30751. function findAncestorBlock( node ) {
  30752. const schema = node.root.document.model.schema;
  30753. let parent = node.parent;
  30754. while ( parent ) {
  30755. if ( schema.isBlock( parent ) ) {
  30756. return parent;
  30757. }
  30758. parent = parent.parent;
  30759. }
  30760. }
  30761. /**
  30762. * An entity that is used to set selection.
  30763. *
  30764. * See also {@link module:engine/model/selection~Selection#setTo}
  30765. *
  30766. * @typedef {
  30767. * module:engine/model/selection~Selection|
  30768. * module:engine/model/documentselection~DocumentSelection|
  30769. * module:engine/model/position~Position|
  30770. * module:engine/model/range~Range|
  30771. * module:engine/model/node~Node|
  30772. * Iterable.<module:engine/model/range~Range>|
  30773. * null
  30774. * } module:engine/model/selection~Selectable
  30775. */
  30776. /***/ }),
  30777. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/text.js":
  30778. /*!*******************************************************************!*\
  30779. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/text.js ***!
  30780. \*******************************************************************/
  30781. /*! exports provided: default */
  30782. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  30783. "use strict";
  30784. __webpack_require__.r(__webpack_exports__);
  30785. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Text; });
  30786. /* harmony import */ var _node__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/node.js");
  30787. /**
  30788. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  30789. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  30790. */
  30791. /**
  30792. * @module engine/model/text
  30793. */
  30794. // @if CK_DEBUG_ENGINE // const { convertMapToStringifiedObject } = require( '../dev-utils/utils' );
  30795. /**
  30796. * Model text node. Type of {@link module:engine/model/node~Node node} that contains {@link module:engine/model/text~Text#data text data}.
  30797. *
  30798. * **Important:** see {@link module:engine/model/node~Node} to read about restrictions using `Text` and `Node` API.
  30799. *
  30800. * **Note:** keep in mind that `Text` instances might indirectly got removed from model tree when model is changed.
  30801. * This happens when {@link module:engine/model/writer~Writer model writer} is used to change model and the text node is merged with
  30802. * another text node. Then, both text nodes are removed and a new text node is inserted into the model. Because of
  30803. * this behavior, keeping references to `Text` is not recommended. Instead, consider creating
  30804. * {@link module:engine/model/liveposition~LivePosition live position} placed before the text node.
  30805. *
  30806. * @extends module:engine/model/node~Node
  30807. */
  30808. class Text extends _node__WEBPACK_IMPORTED_MODULE_0__["default"] {
  30809. /**
  30810. * Creates a text node.
  30811. *
  30812. * **Note:** Constructor of this class shouldn't be used directly in the code.
  30813. * Use the {@link module:engine/model/writer~Writer#createText} method instead.
  30814. *
  30815. * @protected
  30816. * @param {String} data Node's text.
  30817. * @param {Object} [attrs] Node's attributes. See {@link module:utils/tomap~toMap} for a list of accepted values.
  30818. */
  30819. constructor( data, attrs ) {
  30820. super( attrs );
  30821. /**
  30822. * Text data contained in this text node.
  30823. *
  30824. * @protected
  30825. * @type {String}
  30826. */
  30827. this._data = data || '';
  30828. }
  30829. /**
  30830. * @inheritDoc
  30831. */
  30832. get offsetSize() {
  30833. return this.data.length;
  30834. }
  30835. /**
  30836. * Returns a text data contained in the node.
  30837. *
  30838. * @readonly
  30839. * @type {String}
  30840. */
  30841. get data() {
  30842. return this._data;
  30843. }
  30844. /**
  30845. * Checks whether this object is of the given.
  30846. *
  30847. * text.is( '$text' ); // -> true
  30848. * text.is( 'node' ); // -> true
  30849. * text.is( 'model:$text' ); // -> true
  30850. * text.is( 'model:node' ); // -> true
  30851. *
  30852. * text.is( 'view:$text' ); // -> false
  30853. * text.is( 'documentSelection' ); // -> false
  30854. *
  30855. * {@link module:engine/model/node~Node#is Check the entire list of model objects} which implement the `is()` method.
  30856. *
  30857. * **Note:** Until version 20.0.0 this method wasn't accepting `'$text'` type. The legacy `'text'` type is still
  30858. * accepted for backward compatibility.
  30859. *
  30860. * @param {String} type Type to check.
  30861. * @returns {Boolean}
  30862. */
  30863. is( type ) {
  30864. return type === '$text' || type === 'model:$text' ||
  30865. // This are legacy values kept for backward compatibility.
  30866. type === 'text' || type === 'model:text' ||
  30867. // From super.is(). This is highly utilised method and cannot call super. See ckeditor/ckeditor5#6529.
  30868. type === 'node' || type === 'model:node';
  30869. }
  30870. /**
  30871. * Converts `Text` instance to plain object and returns it.
  30872. *
  30873. * @returns {Object} `Text` instance converted to plain object.
  30874. */
  30875. toJSON() {
  30876. const json = super.toJSON();
  30877. json.data = this.data;
  30878. return json;
  30879. }
  30880. /**
  30881. * Creates a copy of this text node and returns it. Created text node has same text data and attributes as original text node.
  30882. *
  30883. * @protected
  30884. * @returns {module:engine/model/text~Text} `Text` instance created using given plain object.
  30885. */
  30886. _clone() {
  30887. return new Text( this.data, this.getAttributes() );
  30888. }
  30889. /**
  30890. * Creates a `Text` instance from given plain object (i.e. parsed JSON string).
  30891. *
  30892. * @param {Object} json Plain object to be converted to `Text`.
  30893. * @returns {module:engine/model/text~Text} `Text` instance created using given plain object.
  30894. */
  30895. static fromJSON( json ) {
  30896. return new Text( json.data, json.attributes );
  30897. }
  30898. // @if CK_DEBUG_ENGINE // toString() {
  30899. // @if CK_DEBUG_ENGINE // return `#${ this.data }`;
  30900. // @if CK_DEBUG_ENGINE // }
  30901. // @if CK_DEBUG_ENGINE // logExtended() {
  30902. // @if CK_DEBUG_ENGINE // console.log( `ModelText: ${ this }, attrs: ${ convertMapToStringifiedObject( this.getAttributes() ) }` );
  30903. // @if CK_DEBUG_ENGINE // }
  30904. // @if CK_DEBUG_ENGINE // log() {
  30905. // @if CK_DEBUG_ENGINE // console.log( 'ModelText: ' + this );
  30906. // @if CK_DEBUG_ENGINE // }
  30907. }
  30908. /***/ }),
  30909. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/textproxy.js":
  30910. /*!************************************************************************!*\
  30911. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/textproxy.js ***!
  30912. \************************************************************************/
  30913. /*! exports provided: default */
  30914. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  30915. "use strict";
  30916. __webpack_require__.r(__webpack_exports__);
  30917. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return TextProxy; });
  30918. /* 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");
  30919. /**
  30920. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  30921. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  30922. */
  30923. /**
  30924. * @module engine/model/textproxy
  30925. */
  30926. // @if CK_DEBUG_ENGINE // const { convertMapToStringifiedObject } = require( '../dev-utils/utils' );
  30927. /**
  30928. * `TextProxy` represents a part of {@link module:engine/model/text~Text text node}.
  30929. *
  30930. * Since {@link module:engine/model/position~Position positions} can be placed between characters of a text node,
  30931. * {@link module:engine/model/range~Range ranges} may contain only parts of text nodes. When {@link module:engine/model/range~Range#getItems
  30932. * getting items}
  30933. * contained in such range, we need to represent a part of that text node, since returning the whole text node would be incorrect.
  30934. * `TextProxy` solves this issue.
  30935. *
  30936. * `TextProxy` has an API similar to {@link module:engine/model/text~Text Text} and allows to do most of the common tasks performed
  30937. * on model nodes.
  30938. *
  30939. * **Note:** Some `TextProxy` instances may represent whole text node, not just a part of it.
  30940. * See {@link module:engine/model/textproxy~TextProxy#isPartial}.
  30941. *
  30942. * **Note:** `TextProxy` is not an instance of {@link module:engine/model/node~Node node}. Keep this in mind when using it as a
  30943. * parameter of methods.
  30944. *
  30945. * **Note:** `TextProxy` is a readonly interface. If you want to perform changes on model data represented by a `TextProxy`
  30946. * use {@link module:engine/model/writer~Writer model writer API}.
  30947. *
  30948. * **Note:** `TextProxy` instances are created on the fly, basing on the current state of model. Because of this, it is
  30949. * highly unrecommended to store references to `TextProxy` instances. `TextProxy` instances are not refreshed when
  30950. * model changes, so they might get invalidated. Instead, consider creating {@link module:engine/model/liveposition~LivePosition live
  30951. * position}.
  30952. *
  30953. * `TextProxy` instances are created by {@link module:engine/model/treewalker~TreeWalker model tree walker}. You should not need to create
  30954. * an instance of this class by your own.
  30955. */
  30956. class TextProxy {
  30957. /**
  30958. * Creates a text proxy.
  30959. *
  30960. * @protected
  30961. * @param {module:engine/model/text~Text} textNode Text node which part is represented by this text proxy.
  30962. * @param {Number} offsetInText Offset in {@link module:engine/model/textproxy~TextProxy#textNode text node} from which the text proxy
  30963. * starts.
  30964. * @param {Number} length Text proxy length, that is how many text node's characters, starting from `offsetInText` it represents.
  30965. * @constructor
  30966. */
  30967. constructor( textNode, offsetInText, length ) {
  30968. /**
  30969. * Text node which part is represented by this text proxy.
  30970. *
  30971. * @readonly
  30972. * @member {module:engine/model/text~Text}
  30973. */
  30974. this.textNode = textNode;
  30975. if ( offsetInText < 0 || offsetInText > textNode.offsetSize ) {
  30976. /**
  30977. * Given `offsetInText` value is incorrect.
  30978. *
  30979. * @error model-textproxy-wrong-offsetintext
  30980. */
  30981. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"]( 'model-textproxy-wrong-offsetintext', this );
  30982. }
  30983. if ( length < 0 || offsetInText + length > textNode.offsetSize ) {
  30984. /**
  30985. * Given `length` value is incorrect.
  30986. *
  30987. * @error model-textproxy-wrong-length
  30988. */
  30989. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"]( 'model-textproxy-wrong-length', this );
  30990. }
  30991. /**
  30992. * Text data represented by this text proxy.
  30993. *
  30994. * @readonly
  30995. * @member {String}
  30996. */
  30997. this.data = textNode.data.substring( offsetInText, offsetInText + length );
  30998. /**
  30999. * Offset in {@link module:engine/model/textproxy~TextProxy#textNode text node} from which the text proxy starts.
  31000. *
  31001. * @readonly
  31002. * @member {Number}
  31003. */
  31004. this.offsetInText = offsetInText;
  31005. }
  31006. /**
  31007. * Offset at which this text proxy starts in it's parent.
  31008. *
  31009. * @see module:engine/model/node~Node#startOffset
  31010. * @readonly
  31011. * @type {Number}
  31012. */
  31013. get startOffset() {
  31014. return this.textNode.startOffset !== null ? this.textNode.startOffset + this.offsetInText : null;
  31015. }
  31016. /**
  31017. * Offset size of this text proxy. Equal to the number of characters represented by the text proxy.
  31018. *
  31019. * @see module:engine/model/node~Node#offsetSize
  31020. * @readonly
  31021. * @type {Number}
  31022. */
  31023. get offsetSize() {
  31024. return this.data.length;
  31025. }
  31026. /**
  31027. * Offset at which this text proxy ends in it's parent.
  31028. *
  31029. * @see module:engine/model/node~Node#endOffset
  31030. * @readonly
  31031. * @type {Number}
  31032. */
  31033. get endOffset() {
  31034. return this.startOffset !== null ? this.startOffset + this.offsetSize : null;
  31035. }
  31036. /**
  31037. * Flag indicating whether `TextProxy` instance covers only part of the original {@link module:engine/model/text~Text text node}
  31038. * (`true`) or the whole text node (`false`).
  31039. *
  31040. * This is `false` when text proxy starts at the very beginning of {@link module:engine/model/textproxy~TextProxy#textNode textNode}
  31041. * ({@link module:engine/model/textproxy~TextProxy#offsetInText offsetInText} equals `0`) and text proxy sizes is equal to
  31042. * text node size.
  31043. *
  31044. * @readonly
  31045. * @type {Boolean}
  31046. */
  31047. get isPartial() {
  31048. return this.offsetSize !== this.textNode.offsetSize;
  31049. }
  31050. /**
  31051. * Parent of this text proxy, which is same as parent of text node represented by this text proxy.
  31052. *
  31053. * @readonly
  31054. * @type {module:engine/model/element~Element|module:engine/model/documentfragment~DocumentFragment|null}
  31055. */
  31056. get parent() {
  31057. return this.textNode.parent;
  31058. }
  31059. /**
  31060. * Root of this text proxy, which is same as root of text node represented by this text proxy.
  31061. *
  31062. * @readonly
  31063. * @type {module:engine/model/node~Node|module:engine/model/documentfragment~DocumentFragment}
  31064. */
  31065. get root() {
  31066. return this.textNode.root;
  31067. }
  31068. /**
  31069. * Checks whether this object is of the given.
  31070. *
  31071. * textProxy.is( '$textProxy' ); // -> true
  31072. * textProxy.is( 'model:$textProxy' ); // -> true
  31073. *
  31074. * textProxy.is( 'view:$textProxy' ); // -> false
  31075. * textProxy.is( 'range' ); // -> false
  31076. *
  31077. * {@link module:engine/model/node~Node#is Check the entire list of model objects} which implement the `is()` method.
  31078. *
  31079. * **Note:** Until version 20.0.0 this method wasn't accepting `'$textProxy'` type. The legacy `'textProxt'` type is still
  31080. * accepted for backward compatibility.
  31081. *
  31082. * @param {String} type Type to check.
  31083. * @returns {Boolean}
  31084. */
  31085. is( type ) {
  31086. return type === '$textProxy' || type === 'model:$textProxy' ||
  31087. // This are legacy values kept for backward compatibility.
  31088. type === 'textProxy' || type === 'model:textProxy';
  31089. }
  31090. /**
  31091. * Gets path to this text proxy.
  31092. *
  31093. * @see module:engine/model/node~Node#getPath
  31094. * @returns {Array.<Number>}
  31095. */
  31096. getPath() {
  31097. const path = this.textNode.getPath();
  31098. if ( path.length > 0 ) {
  31099. path[ path.length - 1 ] += this.offsetInText;
  31100. }
  31101. return path;
  31102. }
  31103. /**
  31104. * Returns ancestors array of this text proxy.
  31105. *
  31106. * @param {Object} options Options object.
  31107. * @param {Boolean} [options.includeSelf=false] When set to `true` this text proxy will be also included in parent's array.
  31108. * @param {Boolean} [options.parentFirst=false] When set to `true`, array will be sorted from text proxy parent to root element,
  31109. * otherwise root element will be the first item in the array.
  31110. * @returns {Array} Array with ancestors.
  31111. */
  31112. getAncestors( options = { includeSelf: false, parentFirst: false } ) {
  31113. const ancestors = [];
  31114. let parent = options.includeSelf ? this : this.parent;
  31115. while ( parent ) {
  31116. ancestors[ options.parentFirst ? 'push' : 'unshift' ]( parent );
  31117. parent = parent.parent;
  31118. }
  31119. return ancestors;
  31120. }
  31121. /**
  31122. * Checks if this text proxy has an attribute for given key.
  31123. *
  31124. * @param {String} key Key of attribute to check.
  31125. * @returns {Boolean} `true` if attribute with given key is set on text proxy, `false` otherwise.
  31126. */
  31127. hasAttribute( key ) {
  31128. return this.textNode.hasAttribute( key );
  31129. }
  31130. /**
  31131. * Gets an attribute value for given key or `undefined` if that attribute is not set on text proxy.
  31132. *
  31133. * @param {String} key Key of attribute to look for.
  31134. * @returns {*} Attribute value or `undefined`.
  31135. */
  31136. getAttribute( key ) {
  31137. return this.textNode.getAttribute( key );
  31138. }
  31139. /**
  31140. * Returns iterator that iterates over this node's attributes. Attributes are returned as arrays containing two
  31141. * items. First one is attribute key and second is attribute value.
  31142. *
  31143. * This format is accepted by native `Map` object and also can be passed in `Node` constructor.
  31144. *
  31145. * @returns {Iterable.<*>}
  31146. */
  31147. getAttributes() {
  31148. return this.textNode.getAttributes();
  31149. }
  31150. /**
  31151. * Returns iterator that iterates over this node's attribute keys.
  31152. *
  31153. * @returns {Iterable.<String>}
  31154. */
  31155. getAttributeKeys() {
  31156. return this.textNode.getAttributeKeys();
  31157. }
  31158. // @if CK_DEBUG_ENGINE // toString() {
  31159. // @if CK_DEBUG_ENGINE // return `#${ this.data }`;
  31160. // @if CK_DEBUG_ENGINE // }
  31161. // @if CK_DEBUG_ENGINE // log() {
  31162. // @if CK_DEBUG_ENGINE // console.log( 'ModelTextProxy: ' + this );
  31163. // @if CK_DEBUG_ENGINE // }
  31164. // @if CK_DEBUG_ENGINE // logExtended() {
  31165. // @if CK_DEBUG_ENGINE // console.log( `ModelTextProxy: ${ this }, ` +
  31166. // @if CK_DEBUG_ENGINE // `attrs: ${ convertMapToStringifiedObject( this.getAttributes() ) }` );
  31167. // @if CK_DEBUG_ENGINE // }
  31168. }
  31169. /***/ }),
  31170. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/treewalker.js":
  31171. /*!*************************************************************************!*\
  31172. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/treewalker.js ***!
  31173. \*************************************************************************/
  31174. /*! exports provided: default */
  31175. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  31176. "use strict";
  31177. __webpack_require__.r(__webpack_exports__);
  31178. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return TreeWalker; });
  31179. /* harmony import */ var _text__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./text */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/text.js");
  31180. /* harmony import */ var _textproxy__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./textproxy */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/textproxy.js");
  31181. /* harmony import */ var _element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./element */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/element.js");
  31182. /* harmony import */ var _position__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./position */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/position.js");
  31183. /* 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");
  31184. /**
  31185. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  31186. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  31187. */
  31188. /**
  31189. * @module engine/model/treewalker
  31190. */
  31191. /**
  31192. * Position iterator class. It allows to iterate forward and backward over the document.
  31193. */
  31194. class TreeWalker {
  31195. /**
  31196. * Creates a range iterator. All parameters are optional, but you have to specify either `boundaries` or `startPosition`.
  31197. *
  31198. * @constructor
  31199. * @param {Object} [options={}] Object with configuration.
  31200. * @param {'forward'|'backward'} [options.direction='forward'] Walking direction.
  31201. * @param {module:engine/model/range~Range} [options.boundaries=null] Range to define boundaries of the iterator.
  31202. * @param {module:engine/model/position~Position} [options.startPosition] Starting position.
  31203. * @param {Boolean} [options.singleCharacters=false] Flag indicating whether all consecutive characters with the same attributes
  31204. * should be returned one by one as multiple {@link module:engine/model/textproxy~TextProxy} (`true`) objects or as one
  31205. * {@link module:engine/model/textproxy~TextProxy} (`false`).
  31206. * @param {Boolean} [options.shallow=false] Flag indicating whether iterator should enter elements or not. If the
  31207. * iterator is shallow child nodes of any iterated node will not be returned along with `elementEnd` tag.
  31208. * @param {Boolean} [options.ignoreElementEnd=false] Flag indicating whether iterator should ignore `elementEnd`
  31209. * tags. If the option is true walker will not return a parent node of start position. If this option is `true`
  31210. * each {@link module:engine/model/element~Element} will be returned once, while if the option is `false` they might be returned
  31211. * twice: for `'elementStart'` and `'elementEnd'`.
  31212. */
  31213. constructor( options = {} ) {
  31214. if ( !options.boundaries && !options.startPosition ) {
  31215. /**
  31216. * Neither boundaries nor starting position of a `TreeWalker` have been defined.
  31217. *
  31218. * @error model-tree-walker-no-start-position
  31219. */
  31220. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_4__["default"](
  31221. 'model-tree-walker-no-start-position',
  31222. null
  31223. );
  31224. }
  31225. const direction = options.direction || 'forward';
  31226. if ( direction != 'forward' && direction != 'backward' ) {
  31227. /**
  31228. * Only `backward` and `forward` direction allowed.
  31229. *
  31230. * @error model-tree-walker-unknown-direction
  31231. */
  31232. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_4__["default"]( 'model-tree-walker-unknown-direction', options, { direction } );
  31233. }
  31234. /**
  31235. * Walking direction. Defaults `'forward'`.
  31236. *
  31237. * @readonly
  31238. * @member {'backward'|'forward'} module:engine/model/treewalker~TreeWalker#direction
  31239. */
  31240. this.direction = direction;
  31241. /**
  31242. * Iterator boundaries.
  31243. *
  31244. * When the iterator is walking `'forward'` on the end of boundary or is walking `'backward'`
  31245. * on the start of boundary, then `{ done: true }` is returned.
  31246. *
  31247. * If boundaries are not defined they are set before first and after last child of the root node.
  31248. *
  31249. * @readonly
  31250. * @member {module:engine/model/range~Range} module:engine/model/treewalker~TreeWalker#boundaries
  31251. */
  31252. this.boundaries = options.boundaries || null;
  31253. /**
  31254. * Iterator position. This is always static position, even if the initial position was a
  31255. * {@link module:engine/model/liveposition~LivePosition live position}. If start position is not defined then position depends
  31256. * on {@link #direction}. If direction is `'forward'` position starts form the beginning, when direction
  31257. * is `'backward'` position starts from the end.
  31258. *
  31259. * @readonly
  31260. * @member {module:engine/model/position~Position} module:engine/model/treewalker~TreeWalker#position
  31261. */
  31262. if ( options.startPosition ) {
  31263. this.position = options.startPosition.clone();
  31264. } else {
  31265. this.position = _position__WEBPACK_IMPORTED_MODULE_3__["default"]._createAt( this.boundaries[ this.direction == 'backward' ? 'end' : 'start' ] );
  31266. }
  31267. // Reset position stickiness in case it was set to other value, as the stickiness is kept after cloning.
  31268. this.position.stickiness = 'toNone';
  31269. /**
  31270. * Flag indicating whether all consecutive characters with the same attributes should be
  31271. * returned as one {@link module:engine/model/textproxy~TextProxy} (`true`) or one by one (`false`).
  31272. *
  31273. * @readonly
  31274. * @member {Boolean} module:engine/model/treewalker~TreeWalker#singleCharacters
  31275. */
  31276. this.singleCharacters = !!options.singleCharacters;
  31277. /**
  31278. * Flag indicating whether iterator should enter elements or not. If the iterator is shallow child nodes of any
  31279. * iterated node will not be returned along with `elementEnd` tag.
  31280. *
  31281. * @readonly
  31282. * @member {Boolean} module:engine/model/treewalker~TreeWalker#shallow
  31283. */
  31284. this.shallow = !!options.shallow;
  31285. /**
  31286. * Flag indicating whether iterator should ignore `elementEnd` tags. If the option is true walker will not
  31287. * return a parent node of the start position. If this option is `true` each {@link module:engine/model/element~Element} will
  31288. * be returned once, while if the option is `false` they might be returned twice:
  31289. * for `'elementStart'` and `'elementEnd'`.
  31290. *
  31291. * @readonly
  31292. * @member {Boolean} module:engine/model/treewalker~TreeWalker#ignoreElementEnd
  31293. */
  31294. this.ignoreElementEnd = !!options.ignoreElementEnd;
  31295. /**
  31296. * Start boundary cached for optimization purposes.
  31297. *
  31298. * @private
  31299. * @member {module:engine/model/element~Element} module:engine/model/treewalker~TreeWalker#_boundaryStartParent
  31300. */
  31301. this._boundaryStartParent = this.boundaries ? this.boundaries.start.parent : null;
  31302. /**
  31303. * End boundary cached for optimization purposes.
  31304. *
  31305. * @private
  31306. * @member {module:engine/model/element~Element} module:engine/model/treewalker~TreeWalker#_boundaryEndParent
  31307. */
  31308. this._boundaryEndParent = this.boundaries ? this.boundaries.end.parent : null;
  31309. /**
  31310. * Parent of the most recently visited node. Cached for optimization purposes.
  31311. *
  31312. * @private
  31313. * @member {module:engine/model/element~Element|module:engine/model/documentfragment~DocumentFragment}
  31314. * module:engine/model/treewalker~TreeWalker#_visitedParent
  31315. */
  31316. this._visitedParent = this.position.parent;
  31317. }
  31318. /**
  31319. * Iterable interface.
  31320. *
  31321. * @returns {Iterable.<module:engine/model/treewalker~TreeWalkerValue>}
  31322. */
  31323. [ Symbol.iterator ]() {
  31324. return this;
  31325. }
  31326. /**
  31327. * Moves {@link #position} in the {@link #direction} skipping values as long as the callback function returns `true`.
  31328. *
  31329. * For example:
  31330. *
  31331. * walker.skip( value => value.type == 'text' ); // <paragraph>[]foo</paragraph> -> <paragraph>foo[]</paragraph>
  31332. * walker.skip( () => true ); // Move the position to the end: <paragraph>[]foo</paragraph> -> <paragraph>foo</paragraph>[]
  31333. * walker.skip( () => false ); // Do not move the position.
  31334. *
  31335. * @param {Function} skip Callback function. Gets {@link module:engine/model/treewalker~TreeWalkerValue} and should
  31336. * return `true` if the value should be skipped or `false` if not.
  31337. */
  31338. skip( skip ) {
  31339. let done, value, prevPosition, prevVisitedParent;
  31340. do {
  31341. prevPosition = this.position;
  31342. prevVisitedParent = this._visitedParent;
  31343. ( { done, value } = this.next() );
  31344. } while ( !done && skip( value ) );
  31345. if ( !done ) {
  31346. this.position = prevPosition;
  31347. this._visitedParent = prevVisitedParent;
  31348. }
  31349. }
  31350. /**
  31351. * Gets the next tree walker's value.
  31352. *
  31353. * @returns {module:engine/model/treewalker~TreeWalkerValue} Next tree walker's value.
  31354. */
  31355. next() {
  31356. if ( this.direction == 'forward' ) {
  31357. return this._next();
  31358. } else {
  31359. return this._previous();
  31360. }
  31361. }
  31362. /**
  31363. * Makes a step forward in model. Moves the {@link #position} to the next position and returns the encountered value.
  31364. *
  31365. * @private
  31366. * @returns {Object}
  31367. * @returns {Boolean} return.done True if iterator is done.
  31368. * @returns {module:engine/model/treewalker~TreeWalkerValue} return.value Information about taken step.
  31369. */
  31370. _next() {
  31371. const previousPosition = this.position;
  31372. const position = this.position.clone();
  31373. const parent = this._visitedParent;
  31374. // We are at the end of the root.
  31375. if ( parent.parent === null && position.offset === parent.maxOffset ) {
  31376. return { done: true };
  31377. }
  31378. // We reached the walker boundary.
  31379. if ( parent === this._boundaryEndParent && position.offset == this.boundaries.end.offset ) {
  31380. return { done: true };
  31381. }
  31382. // Get node just after the current position.
  31383. // Use a highly optimized version instead of checking the text node first and then getting the node after. See #6582.
  31384. const positionParent = position.parent;
  31385. const textNodeAtPosition = Object(_position__WEBPACK_IMPORTED_MODULE_3__["getTextNodeAtPosition"])( position, positionParent );
  31386. const node = textNodeAtPosition ? textNodeAtPosition : Object(_position__WEBPACK_IMPORTED_MODULE_3__["getNodeAfterPosition"])( position, positionParent, textNodeAtPosition );
  31387. if ( node instanceof _element__WEBPACK_IMPORTED_MODULE_2__["default"] ) {
  31388. if ( !this.shallow ) {
  31389. // Manual operations on path internals for optimization purposes. Here and in the rest of the method.
  31390. position.path.push( 0 );
  31391. this._visitedParent = node;
  31392. } else {
  31393. position.offset++;
  31394. }
  31395. this.position = position;
  31396. return formatReturnValue( 'elementStart', node, previousPosition, position, 1 );
  31397. } else if ( node instanceof _text__WEBPACK_IMPORTED_MODULE_0__["default"] ) {
  31398. let charactersCount;
  31399. if ( this.singleCharacters ) {
  31400. charactersCount = 1;
  31401. } else {
  31402. let offset = node.endOffset;
  31403. if ( this._boundaryEndParent == parent && this.boundaries.end.offset < offset ) {
  31404. offset = this.boundaries.end.offset;
  31405. }
  31406. charactersCount = offset - position.offset;
  31407. }
  31408. const offsetInTextNode = position.offset - node.startOffset;
  31409. const item = new _textproxy__WEBPACK_IMPORTED_MODULE_1__["default"]( node, offsetInTextNode, charactersCount );
  31410. position.offset += charactersCount;
  31411. this.position = position;
  31412. return formatReturnValue( 'text', item, previousPosition, position, charactersCount );
  31413. } else {
  31414. // `node` is not set, we reached the end of current `parent`.
  31415. position.path.pop();
  31416. position.offset++;
  31417. this.position = position;
  31418. this._visitedParent = parent.parent;
  31419. if ( this.ignoreElementEnd ) {
  31420. return this._next();
  31421. } else {
  31422. return formatReturnValue( 'elementEnd', parent, previousPosition, position );
  31423. }
  31424. }
  31425. }
  31426. /**
  31427. * Makes a step backward in model. Moves the {@link #position} to the previous position and returns the encountered value.
  31428. *
  31429. * @private
  31430. * @returns {Object}
  31431. * @returns {Boolean} return.done True if iterator is done.
  31432. * @returns {module:engine/model/treewalker~TreeWalkerValue} return.value Information about taken step.
  31433. */
  31434. _previous() {
  31435. const previousPosition = this.position;
  31436. const position = this.position.clone();
  31437. const parent = this._visitedParent;
  31438. // We are at the beginning of the root.
  31439. if ( parent.parent === null && position.offset === 0 ) {
  31440. return { done: true };
  31441. }
  31442. // We reached the walker boundary.
  31443. if ( parent == this._boundaryStartParent && position.offset == this.boundaries.start.offset ) {
  31444. return { done: true };
  31445. }
  31446. // Get node just before the current position.
  31447. // Use a highly optimized version instead of checking the text node first and then getting the node before. See #6582.
  31448. const positionParent = position.parent;
  31449. const textNodeAtPosition = Object(_position__WEBPACK_IMPORTED_MODULE_3__["getTextNodeAtPosition"])( position, positionParent );
  31450. const node = textNodeAtPosition ? textNodeAtPosition : Object(_position__WEBPACK_IMPORTED_MODULE_3__["getNodeBeforePosition"])( position, positionParent, textNodeAtPosition );
  31451. if ( node instanceof _element__WEBPACK_IMPORTED_MODULE_2__["default"] ) {
  31452. position.offset--;
  31453. if ( !this.shallow ) {
  31454. position.path.push( node.maxOffset );
  31455. this.position = position;
  31456. this._visitedParent = node;
  31457. if ( this.ignoreElementEnd ) {
  31458. return this._previous();
  31459. } else {
  31460. return formatReturnValue( 'elementEnd', node, previousPosition, position );
  31461. }
  31462. } else {
  31463. this.position = position;
  31464. return formatReturnValue( 'elementStart', node, previousPosition, position, 1 );
  31465. }
  31466. } else if ( node instanceof _text__WEBPACK_IMPORTED_MODULE_0__["default"] ) {
  31467. let charactersCount;
  31468. if ( this.singleCharacters ) {
  31469. charactersCount = 1;
  31470. } else {
  31471. let offset = node.startOffset;
  31472. if ( this._boundaryStartParent == parent && this.boundaries.start.offset > offset ) {
  31473. offset = this.boundaries.start.offset;
  31474. }
  31475. charactersCount = position.offset - offset;
  31476. }
  31477. const offsetInTextNode = position.offset - node.startOffset;
  31478. const item = new _textproxy__WEBPACK_IMPORTED_MODULE_1__["default"]( node, offsetInTextNode - charactersCount, charactersCount );
  31479. position.offset -= charactersCount;
  31480. this.position = position;
  31481. return formatReturnValue( 'text', item, previousPosition, position, charactersCount );
  31482. } else {
  31483. // `node` is not set, we reached the beginning of current `parent`.
  31484. position.path.pop();
  31485. this.position = position;
  31486. this._visitedParent = parent.parent;
  31487. return formatReturnValue( 'elementStart', parent, previousPosition, position, 1 );
  31488. }
  31489. }
  31490. }
  31491. function formatReturnValue( type, item, previousPosition, nextPosition, length ) {
  31492. return {
  31493. done: false,
  31494. value: {
  31495. type,
  31496. item,
  31497. previousPosition,
  31498. nextPosition,
  31499. length
  31500. }
  31501. };
  31502. }
  31503. /**
  31504. * Type of the step made by {@link module:engine/model/treewalker~TreeWalker}.
  31505. * Possible values: `'elementStart'` if walker is at the beginning of a node, `'elementEnd'` if walker is at the end of node,
  31506. * or `'text'` if walker traversed over text.
  31507. *
  31508. * @typedef {'elementStart'|'elementEnd'|'text'} module:engine/model/treewalker~TreeWalkerValueType
  31509. */
  31510. /**
  31511. * Object returned by {@link module:engine/model/treewalker~TreeWalker} when traversing tree model.
  31512. *
  31513. * @typedef {Object} module:engine/model/treewalker~TreeWalkerValue
  31514. * @property {module:engine/model/treewalker~TreeWalkerValueType} type
  31515. * @property {module:engine/model/item~Item} item Item between old and new positions of {@link module:engine/model/treewalker~TreeWalker}.
  31516. * @property {module:engine/model/position~Position} previousPosition Previous position of the iterator.
  31517. * * Forward iteration: For `'elementEnd'` it is the last position inside the element. For all other types it is the
  31518. * position before the item.
  31519. * * Backward iteration: For `'elementStart'` it is the first position inside the element. For all other types it is
  31520. * the position after item.
  31521. * @property {module:engine/model/position~Position} nextPosition Next position of the iterator.
  31522. * * Forward iteration: For `'elementStart'` it is the first position inside the element. For all other types it is
  31523. * the position after the item.
  31524. * * Backward iteration: For `'elementEnd'` it is last position inside element. For all other types it is the position
  31525. * before the item.
  31526. * @property {Number} [length] Length of the item. For `'elementStart'` it is 1. For `'text'` it is
  31527. * the length of the text. For `'elementEnd'` it is `undefined`.
  31528. */
  31529. /**
  31530. * Tree walking directions.
  31531. *
  31532. * @typedef {'forward'|'backward'} module:engine/model/treewalker~TreeWalkerDirection
  31533. */
  31534. /***/ }),
  31535. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/utils/autoparagraphing.js":
  31536. /*!*************************************************************************************!*\
  31537. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/utils/autoparagraphing.js ***!
  31538. \*************************************************************************************/
  31539. /*! exports provided: autoParagraphEmptyRoots, isParagraphable, wrapInParagraph */
  31540. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  31541. "use strict";
  31542. __webpack_require__.r(__webpack_exports__);
  31543. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "autoParagraphEmptyRoots", function() { return autoParagraphEmptyRoots; });
  31544. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isParagraphable", function() { return isParagraphable; });
  31545. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "wrapInParagraph", function() { return wrapInParagraph; });
  31546. /**
  31547. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  31548. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  31549. */
  31550. /**
  31551. * @module engine/model/utils/autoparagraphing
  31552. */
  31553. /**
  31554. * Fixes all empty roots.
  31555. *
  31556. * @protected
  31557. * @param {module:engine/model/writer~Writer} writer The model writer.
  31558. * @returns {Boolean} `true` if any change has been applied, `false` otherwise.
  31559. */
  31560. function autoParagraphEmptyRoots( writer ) {
  31561. const { schema, document } = writer.model;
  31562. for ( const rootName of document.getRootNames() ) {
  31563. const root = document.getRoot( rootName );
  31564. if ( root.isEmpty && !schema.checkChild( root, '$text' ) ) {
  31565. // If paragraph element is allowed in the root, create paragraph element.
  31566. if ( schema.checkChild( root, 'paragraph' ) ) {
  31567. writer.insertElement( 'paragraph', root );
  31568. // Other roots will get fixed in the next post-fixer round. Those will be triggered
  31569. // in the same batch no matter if this method was triggered by the post-fixing or not
  31570. // (the above insertElement call will trigger the post-fixers).
  31571. return true;
  31572. }
  31573. }
  31574. }
  31575. return false;
  31576. }
  31577. /**
  31578. * Checks if the given node wrapped with a paragraph would be accepted by the schema in the given position.
  31579. *
  31580. * @protected
  31581. * @param {module:engine/model/position~Position} position The position at which to check.
  31582. * @param {module:engine/model/node~Node|String} nodeOrType The child node or child type to check.
  31583. * @param {module:engine/model/schema~Schema} schema A schema instance used for element validation.
  31584. */
  31585. function isParagraphable( position, nodeOrType, schema ) {
  31586. const context = schema.createContext( position );
  31587. // When paragraph is allowed in this context...
  31588. if ( !schema.checkChild( context, 'paragraph' ) ) {
  31589. return false;
  31590. }
  31591. // And a node would be allowed in this paragraph...
  31592. if ( !schema.checkChild( context.push( 'paragraph' ), nodeOrType ) ) {
  31593. return false;
  31594. }
  31595. return true;
  31596. }
  31597. /**
  31598. * Inserts a new paragraph at the given position and returns a position inside that paragraph.
  31599. *
  31600. * @protected
  31601. * @param {module:engine/model/position~Position} position The position where a paragraph should be inserted.
  31602. * @param {module:engine/model/writer~Writer} writer The model writer.
  31603. * @returns {module:engine/model/position~Position} Position inside the created paragraph.
  31604. */
  31605. function wrapInParagraph( position, writer ) {
  31606. const paragraph = writer.createElement( 'paragraph' );
  31607. writer.insert( paragraph, position );
  31608. return writer.createPositionAt( paragraph, 0 );
  31609. }
  31610. /***/ }),
  31611. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/utils/deletecontent.js":
  31612. /*!**********************************************************************************!*\
  31613. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/utils/deletecontent.js ***!
  31614. \**********************************************************************************/
  31615. /*! exports provided: default */
  31616. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  31617. "use strict";
  31618. __webpack_require__.r(__webpack_exports__);
  31619. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return deleteContent; });
  31620. /* harmony import */ var _liveposition__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../liveposition */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/liveposition.js");
  31621. /* harmony import */ var _range__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../range */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/range.js");
  31622. /* harmony import */ var _documentselection__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../documentselection */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/documentselection.js");
  31623. /**
  31624. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  31625. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  31626. */
  31627. /**
  31628. * @module engine/model/utils/deletecontent
  31629. */
  31630. /**
  31631. * Deletes content of the selection and merge siblings. The resulting selection is always collapsed.
  31632. *
  31633. * **Note:** Use {@link module:engine/model/model~Model#deleteContent} instead of this function.
  31634. * This function is only exposed to be reusable in algorithms
  31635. * which change the {@link module:engine/model/model~Model#deleteContent}
  31636. * method's behavior.
  31637. *
  31638. * @param {module:engine/model/model~Model} model The model in context of which the insertion
  31639. * should be performed.
  31640. * @param {module:engine/model/selection~Selection|module:engine/model/documentselection~DocumentSelection} selection
  31641. * Selection of which the content should be deleted.
  31642. * @param {Object} [options]
  31643. * @param {Boolean} [options.leaveUnmerged=false] Whether to merge elements after removing the content of the selection.
  31644. *
  31645. * For example `<heading>x[x</heading><paragraph>y]y</paragraph>` will become:
  31646. *
  31647. * * `<heading>x^y</heading>` with the option disabled (`leaveUnmerged == false`)
  31648. * * `<heading>x^</heading><paragraph>y</paragraph>` with enabled (`leaveUnmerged == true`).
  31649. *
  31650. * Note: {@link module:engine/model/schema~Schema#isObject object} and {@link module:engine/model/schema~Schema#isLimit limit}
  31651. * elements will not be merged.
  31652. *
  31653. * @param {Boolean} [options.doNotResetEntireContent=false] Whether to skip replacing the entire content with a
  31654. * paragraph when the entire content was selected.
  31655. *
  31656. * For example `<heading>[x</heading><paragraph>y]</paragraph>` will become:
  31657. *
  31658. * * `<paragraph>^</paragraph>` with the option disabled (`doNotResetEntireContent == false`)
  31659. * * `<heading>^</heading>` with enabled (`doNotResetEntireContent == true`).
  31660. *
  31661. * @param {Boolean} [options.doNotAutoparagraph=false] Whether to create a paragraph if after content deletion selection is moved
  31662. * to a place where text cannot be inserted.
  31663. *
  31664. * For example `<paragraph>x</paragraph>[<image src="foo.jpg"></image>]` will become:
  31665. *
  31666. * * `<paragraph>x</paragraph><paragraph>[]</paragraph>` with the option disabled (`doNotAutoparagraph == false`)
  31667. * * `<paragraph>x</paragraph>[]` with the option enabled (`doNotAutoparagraph == true`).
  31668. *
  31669. * If you use this option you need to make sure to handle invalid selections yourself or leave
  31670. * them to the selection post-fixer (may not always work).
  31671. *
  31672. * **Note:** if there is no valid position for the selection, the paragraph will always be created:
  31673. *
  31674. * `[<image src="foo.jpg"></image>]` -> `<paragraph>[]</paragraph>`.
  31675. */
  31676. function deleteContent( model, selection, options = {} ) {
  31677. if ( selection.isCollapsed ) {
  31678. return;
  31679. }
  31680. const selRange = selection.getFirstRange();
  31681. // If the selection is already removed, don't do anything.
  31682. if ( selRange.root.rootName == '$graveyard' ) {
  31683. return;
  31684. }
  31685. const schema = model.schema;
  31686. model.change( writer => {
  31687. // 1. Replace the entire content with paragraph.
  31688. // See: https://github.com/ckeditor/ckeditor5-engine/issues/1012#issuecomment-315017594.
  31689. if ( !options.doNotResetEntireContent && shouldEntireContentBeReplacedWithParagraph( schema, selection ) ) {
  31690. replaceEntireContentWithParagraph( writer, selection, schema );
  31691. return;
  31692. }
  31693. // Get the live positions for the range adjusted to span only blocks selected from the user perspective.
  31694. const [ startPosition, endPosition ] = getLivePositionsForSelectedBlocks( selRange );
  31695. // 2. Remove the content if there is any.
  31696. if ( !startPosition.isTouching( endPosition ) ) {
  31697. writer.remove( writer.createRange( startPosition, endPosition ) );
  31698. }
  31699. // 3. Merge elements in the right branch to the elements in the left branch.
  31700. // The only reasonable (in terms of data and selection correctness) case in which we need to do that is:
  31701. //
  31702. // <heading type=1>Fo[</heading><paragraph>]ar</paragraph> => <heading type=1>Fo^ar</heading>
  31703. //
  31704. // However, the algorithm supports also merging deeper structures (up to the depth of the shallower branch),
  31705. // as it's hard to imagine what should actually be the default behavior. Usually, specific features will
  31706. // want to override that behavior anyway.
  31707. if ( !options.leaveUnmerged ) {
  31708. mergeBranches( writer, startPosition, endPosition );
  31709. // TMP this will be replaced with a postfixer.
  31710. // We need to check and strip disallowed attributes in all nested nodes because after merge
  31711. // some attributes could end up in a path where are disallowed.
  31712. //
  31713. // e.g. bold is disallowed for <H1>
  31714. // <h1>Fo{o</h1><p>b}a<b>r</b><p> -> <h1>Fo{}a<b>r</b><h1> -> <h1>Fo{}ar<h1>.
  31715. schema.removeDisallowedAttributes( startPosition.parent.getChildren(), writer );
  31716. }
  31717. collapseSelectionAt( writer, selection, startPosition );
  31718. // 4. Add a paragraph to set selection in it.
  31719. // Check if a text is allowed in the new container. If not, try to create a new paragraph (if it's allowed here).
  31720. // If autoparagraphing is off, we assume that you know what you do so we leave the selection wherever it was.
  31721. if ( !options.doNotAutoparagraph && shouldAutoparagraph( schema, startPosition ) ) {
  31722. insertParagraph( writer, startPosition, selection );
  31723. }
  31724. startPosition.detach();
  31725. endPosition.detach();
  31726. } );
  31727. }
  31728. // Returns the live positions for the range adjusted to span only blocks selected from the user perspective. Example:
  31729. //
  31730. // <heading1>[foo</heading1>
  31731. // <paragraph>bar</paragraph>
  31732. // <heading1>]abc</heading1> <-- this block is not considered as selected
  31733. //
  31734. // This is the same behavior as in Selection#getSelectedBlocks() "special case".
  31735. function getLivePositionsForSelectedBlocks( range ) {
  31736. const model = range.root.document.model;
  31737. const startPosition = range.start;
  31738. let endPosition = range.end;
  31739. // If the end of selection is at the start position of last block in the selection, then
  31740. // shrink it to not include that trailing block. Note that this should happen only for not empty selection.
  31741. if ( model.hasContent( range, { ignoreMarkers: true } ) ) {
  31742. const endBlock = getParentBlock( endPosition );
  31743. if ( endBlock && endPosition.isTouching( model.createPositionAt( endBlock, 0 ) ) ) {
  31744. // Create forward selection as a probe to find a valid position after excluding last block from the range.
  31745. const selection = model.createSelection( range );
  31746. // Modify the forward selection in backward direction to shrink it and remove first position of following block from it.
  31747. // This is how modifySelection works and here we are making use of it.
  31748. model.modifySelection( selection, { direction: 'backward' } );
  31749. const newEndPosition = selection.getLastPosition();
  31750. // For such model and selection:
  31751. // <paragraph>A[</paragraph><image></image><paragraph>]B</paragraph>
  31752. //
  31753. // After modifySelection() we would end up with this:
  31754. // <paragraph>A[</paragraph>]<image></image><paragraph>B</paragraph>
  31755. //
  31756. // So we need to check if there is no content in the skipped range (because we want to include the <image>).
  31757. const skippedRange = model.createRange( newEndPosition, endPosition );
  31758. if ( !model.hasContent( skippedRange, { ignoreMarkers: true } ) ) {
  31759. endPosition = newEndPosition;
  31760. }
  31761. }
  31762. }
  31763. return [
  31764. _liveposition__WEBPACK_IMPORTED_MODULE_0__["default"].fromPosition( startPosition, 'toPrevious' ),
  31765. _liveposition__WEBPACK_IMPORTED_MODULE_0__["default"].fromPosition( endPosition, 'toNext' )
  31766. ];
  31767. }
  31768. // Finds the lowest element in position's ancestors which is a block.
  31769. // Returns null if a limit element is encountered before reaching a block element.
  31770. function getParentBlock( position ) {
  31771. const element = position.parent;
  31772. const schema = element.root.document.model.schema;
  31773. const ancestors = element.getAncestors( { parentFirst: true, includeSelf: true } );
  31774. for ( const element of ancestors ) {
  31775. if ( schema.isLimit( element ) ) {
  31776. return null;
  31777. }
  31778. if ( schema.isBlock( element ) ) {
  31779. return element;
  31780. }
  31781. }
  31782. }
  31783. // This function is a result of reaching the Ballmer's peak for just the right amount of time.
  31784. // Even I had troubles documenting it after a while and after reading it again I couldn't believe that it really works.
  31785. function mergeBranches( writer, startPosition, endPosition ) {
  31786. const model = writer.model;
  31787. // Verify if there is a need and possibility to merge.
  31788. if ( !checkShouldMerge( writer.model.schema, startPosition, endPosition ) ) {
  31789. return;
  31790. }
  31791. // If the start element on the common ancestor level is empty, and the end element on the same level is not empty
  31792. // then merge those to the right element so that it's properties are preserved (name, attributes).
  31793. // Because of OT merging is used instead of removing elements.
  31794. //
  31795. // Merge left:
  31796. // <heading1>foo[</heading1> -> <heading1>foo[]bar</heading1>
  31797. // <paragraph>]bar</paragraph> -> --^
  31798. //
  31799. // Merge right:
  31800. // <heading1>[</heading1> ->
  31801. // <paragraph>]bar</paragraph> -> <paragraph>[]bar</paragraph>
  31802. //
  31803. // Merge left:
  31804. // <blockQuote> -> <blockQuote>
  31805. // <heading1>foo[</heading1> -> <heading1>foo[]bar</heading1>
  31806. // <paragraph>]bar</paragraph> -> --^
  31807. // </blockQuote> -> </blockQuote>
  31808. //
  31809. // Merge right:
  31810. // <blockQuote> -> <blockQuote>
  31811. // <heading1>[</heading1> ->
  31812. // <paragraph>]bar</paragraph> -> <paragraph>[]bar</paragraph>
  31813. // </blockQuote> -> </blockQuote>
  31814. // Merging should not go deeper than common ancestor.
  31815. const [ startAncestor, endAncestor ] = getAncestorsJustBelowCommonAncestor( startPosition, endPosition );
  31816. // Branches can't be merged if one of the positions is directly inside a common ancestor.
  31817. //
  31818. // Example:
  31819. // <blockQuote>
  31820. // <paragraph>[foo</paragraph>]
  31821. // <table> ... </table>
  31822. // <blockQuote>
  31823. //
  31824. if ( !startAncestor || !endAncestor ) {
  31825. return;
  31826. }
  31827. if ( !model.hasContent( startAncestor, { ignoreMarkers: true } ) && model.hasContent( endAncestor, { ignoreMarkers: true } ) ) {
  31828. mergeBranchesRight( writer, startPosition, endPosition, startAncestor.parent );
  31829. } else {
  31830. mergeBranchesLeft( writer, startPosition, endPosition, startAncestor.parent );
  31831. }
  31832. }
  31833. // Merging blocks to the left (properties of the left block are preserved).
  31834. // Simple example:
  31835. // <heading1>foo[</heading1> -> <heading1>foo[bar</heading1>]
  31836. // <paragraph>]bar</paragraph> -> --^
  31837. //
  31838. // Nested example:
  31839. // <blockQuote> -> <blockQuote>
  31840. // <heading1>foo[</heading1> -> <heading1>foo[bar</heading1>
  31841. // </blockQuote> -> </blockQuote>] ^
  31842. // <blockBlock> -> |
  31843. // <paragraph>]bar</paragraph> -> ---
  31844. // </blockBlock> ->
  31845. //
  31846. function mergeBranchesLeft( writer, startPosition, endPosition, commonAncestor ) {
  31847. const startElement = startPosition.parent;
  31848. const endElement = endPosition.parent;
  31849. // Merging reached the common ancestor element, stop here.
  31850. if ( startElement == commonAncestor || endElement == commonAncestor ) {
  31851. return;
  31852. }
  31853. // Remember next positions to merge in next recursive step (also used as modification points pointers).
  31854. startPosition = writer.createPositionAfter( startElement );
  31855. endPosition = writer.createPositionBefore( endElement );
  31856. // Move endElement just after startElement if they aren't siblings.
  31857. if ( !endPosition.isEqual( startPosition ) ) {
  31858. //
  31859. // <blockQuote> -> <blockQuote>
  31860. // <heading1>foo[</heading1> -> <heading1>foo</heading1>[<paragraph>bar</paragraph>
  31861. // </blockQuote> -> </blockQuote> ^
  31862. // <blockBlock> -> <blockBlock> |
  31863. // <paragraph>]bar</paragraph> -> ] ---
  31864. // </blockBlock> -> </blockBlock>
  31865. //
  31866. writer.insert( endElement, startPosition );
  31867. }
  31868. // Merge two siblings (nodes on sides of startPosition):
  31869. //
  31870. // <blockQuote> -> <blockQuote>
  31871. // <heading1>foo</heading1>[<paragraph>bar</paragraph> -> <heading1>foo[bar</heading1>
  31872. // </blockQuote> -> </blockQuote>
  31873. // <blockBlock> -> <blockBlock>
  31874. // ] -> ]
  31875. // </blockBlock> -> </blockBlock>
  31876. //
  31877. // Or in simple case (without moving elements in above if):
  31878. // <heading1>foo</heading1>[<paragraph>bar</paragraph>] -> <heading1>foo[bar</heading1>]
  31879. //
  31880. writer.merge( startPosition );
  31881. // Remove empty end ancestors:
  31882. //
  31883. // <blockQuote> -> <blockQuote>
  31884. // <heading1>foo[bar</heading1> -> <heading1>foo[bar</heading1>
  31885. // </blockQuote> -> </blockQuote>
  31886. // <blockBlock> ->
  31887. // ] -> ]
  31888. // </blockBlock> ->
  31889. //
  31890. while ( endPosition.parent.isEmpty ) {
  31891. const parentToRemove = endPosition.parent;
  31892. endPosition = writer.createPositionBefore( parentToRemove );
  31893. writer.remove( parentToRemove );
  31894. }
  31895. // Verify if there is a need and possibility to merge next level.
  31896. if ( !checkShouldMerge( writer.model.schema, startPosition, endPosition ) ) {
  31897. return;
  31898. }
  31899. // Continue merging next level (blockQuote with blockBlock in the examples above if it would not be empty and got removed).
  31900. mergeBranchesLeft( writer, startPosition, endPosition, commonAncestor );
  31901. }
  31902. // Merging blocks to the right (properties of the right block are preserved).
  31903. // Simple example:
  31904. // <heading1>foo[</heading1> -> --v
  31905. // <paragraph>]bar</paragraph> -> [<paragraph>foo]bar</paragraph>
  31906. //
  31907. // Nested example:
  31908. // <blockQuote> ->
  31909. // <heading1>foo[</heading1> -> ---
  31910. // </blockQuote> -> |
  31911. // <blockBlock> -> [<blockBlock> v
  31912. // <paragraph>]bar</paragraph> -> <paragraph>foo]bar</paragraph>
  31913. // </blockBlock> -> </blockBlock>
  31914. //
  31915. function mergeBranchesRight( writer, startPosition, endPosition, commonAncestor ) {
  31916. const startElement = startPosition.parent;
  31917. const endElement = endPosition.parent;
  31918. // Merging reached the common ancestor element, stop here.
  31919. if ( startElement == commonAncestor || endElement == commonAncestor ) {
  31920. return;
  31921. }
  31922. // Remember next positions to merge in next recursive step (also used as modification points pointers).
  31923. startPosition = writer.createPositionAfter( startElement );
  31924. endPosition = writer.createPositionBefore( endElement );
  31925. // Move startElement just before endElement if they aren't siblings.
  31926. if ( !endPosition.isEqual( startPosition ) ) {
  31927. //
  31928. // <blockQuote> -> <blockQuote>
  31929. // <heading1>foo[</heading1> -> [ ---
  31930. // </blockQuote> -> </blockQuote> |
  31931. // <blockBlock> -> <blockBlock> v
  31932. // <paragraph>]bar</paragraph> -> <heading1>foo</heading1>]<paragraph>bar</paragraph>
  31933. // </blockBlock> -> </blockBlock>
  31934. //
  31935. writer.insert( startElement, endPosition );
  31936. }
  31937. // Remove empty end ancestors:
  31938. //
  31939. // <blockQuote> ->
  31940. // [ -> [
  31941. // </blockQuote> ->
  31942. // <blockBlock> -> <blockBlock>
  31943. // <heading1>foo</heading1>]<paragraph>bar</paragraph> -> <heading1>foo</heading1>]<paragraph>bar</paragraph>
  31944. // </blockBlock> -> </blockBlock>
  31945. //
  31946. while ( startPosition.parent.isEmpty ) {
  31947. const parentToRemove = startPosition.parent;
  31948. startPosition = writer.createPositionBefore( parentToRemove );
  31949. writer.remove( parentToRemove );
  31950. }
  31951. // Update endPosition after inserting and removing elements.
  31952. endPosition = writer.createPositionBefore( endElement );
  31953. // Merge right two siblings (nodes on sides of endPosition):
  31954. // ->
  31955. // [ -> [
  31956. // ->
  31957. // <blockBlock> -> <blockBlock>
  31958. // <heading1>foo</heading1>]<paragraph>bar</paragraph> -> <paragraph>foo]bar</paragraph>
  31959. // </blockBlock> -> </blockBlock>
  31960. //
  31961. // Or in simple case (without moving elements in above if):
  31962. // [<heading1>foo</heading1>]<paragraph>bar</paragraph> -> [<heading1>foo]bar</heading1>
  31963. //
  31964. mergeRight( writer, endPosition );
  31965. // Verify if there is a need and possibility to merge next level.
  31966. if ( !checkShouldMerge( writer.model.schema, startPosition, endPosition ) ) {
  31967. return;
  31968. }
  31969. // Continue merging next level (blockQuote with blockBlock in the examples above if it would not be empty and got removed).
  31970. mergeBranchesRight( writer, startPosition, endPosition, commonAncestor );
  31971. }
  31972. // There is no right merge operation so we need to simulate it.
  31973. function mergeRight( writer, position ) {
  31974. const startElement = position.nodeBefore;
  31975. const endElement = position.nodeAfter;
  31976. if ( startElement.name != endElement.name ) {
  31977. writer.rename( startElement, endElement.name );
  31978. }
  31979. writer.clearAttributes( startElement );
  31980. writer.setAttributes( Object.fromEntries( endElement.getAttributes() ), startElement );
  31981. writer.merge( position );
  31982. }
  31983. // Verifies if merging is needed and possible. It's not needed if both positions are in the same element
  31984. // and it's not possible if some element is a limit or the range crosses a limit element.
  31985. function checkShouldMerge( schema, startPosition, endPosition ) {
  31986. const startElement = startPosition.parent;
  31987. const endElement = endPosition.parent;
  31988. // If both positions ended up in the same parent, then there's nothing more to merge:
  31989. // <$root><p>x[</p><p>]y</p></$root> => <$root><p>xy</p>[]</$root>
  31990. if ( startElement == endElement ) {
  31991. return false;
  31992. }
  31993. // 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.
  31994. if ( schema.isLimit( startElement ) || schema.isLimit( endElement ) ) {
  31995. return false;
  31996. }
  31997. // Check if operations we'll need to do won't need to cross object or limit boundaries.
  31998. // E.g., we can't merge endElement into startElement in this case:
  31999. // <limit><startElement>x[</startElement></limit><endElement>]</endElement>
  32000. return isCrossingLimitElement( startPosition, endPosition, schema );
  32001. }
  32002. // Returns the elements that are the ancestors of the provided positions that are direct children of the common ancestor.
  32003. function getAncestorsJustBelowCommonAncestor( positionA, positionB ) {
  32004. const ancestorsA = positionA.getAncestors();
  32005. const ancestorsB = positionB.getAncestors();
  32006. let i = 0;
  32007. while ( ancestorsA[ i ] && ancestorsA[ i ] == ancestorsB[ i ] ) {
  32008. i++;
  32009. }
  32010. return [ ancestorsA[ i ], ancestorsB[ i ] ];
  32011. }
  32012. function shouldAutoparagraph( schema, position ) {
  32013. const isTextAllowed = schema.checkChild( position, '$text' );
  32014. const isParagraphAllowed = schema.checkChild( position, 'paragraph' );
  32015. return !isTextAllowed && isParagraphAllowed;
  32016. }
  32017. // Check if parents of two positions can be merged by checking if there are no limit/object
  32018. // boundaries between those two positions.
  32019. //
  32020. // E.g. in <bQ><p>x[]</p></bQ><widget><caption>{}</caption></widget>
  32021. // we'll check <p>, <bQ>, <widget> and <caption>.
  32022. // Usually, widget and caption are marked as objects/limits in the schema, so in this case merging will be blocked.
  32023. function isCrossingLimitElement( leftPos, rightPos, schema ) {
  32024. const rangeToCheck = new _range__WEBPACK_IMPORTED_MODULE_1__["default"]( leftPos, rightPos );
  32025. for ( const value of rangeToCheck.getWalker() ) {
  32026. if ( schema.isLimit( value.item ) ) {
  32027. return false;
  32028. }
  32029. }
  32030. return true;
  32031. }
  32032. function insertParagraph( writer, position, selection ) {
  32033. const paragraph = writer.createElement( 'paragraph' );
  32034. writer.insert( paragraph, position );
  32035. collapseSelectionAt( writer, selection, writer.createPositionAt( paragraph, 0 ) );
  32036. }
  32037. function replaceEntireContentWithParagraph( writer, selection ) {
  32038. const limitElement = writer.model.schema.getLimitElement( selection );
  32039. writer.remove( writer.createRangeIn( limitElement ) );
  32040. insertParagraph( writer, writer.createPositionAt( limitElement, 0 ), selection );
  32041. }
  32042. // We want to replace the entire content with a paragraph when:
  32043. // * the entire content is selected,
  32044. // * selection contains at least two elements,
  32045. // * whether the paragraph is allowed in schema in the common ancestor.
  32046. function shouldEntireContentBeReplacedWithParagraph( schema, selection ) {
  32047. const limitElement = schema.getLimitElement( selection );
  32048. if ( !selection.containsEntireContent( limitElement ) ) {
  32049. return false;
  32050. }
  32051. const range = selection.getFirstRange();
  32052. if ( range.start.parent == range.end.parent ) {
  32053. return false;
  32054. }
  32055. return schema.checkChild( limitElement, 'paragraph' );
  32056. }
  32057. // Helper function that sets the selection. Depending whether given `selection` is a document selection or not,
  32058. // uses a different method to set it.
  32059. function collapseSelectionAt( writer, selection, positionOrRange ) {
  32060. if ( selection instanceof _documentselection__WEBPACK_IMPORTED_MODULE_2__["default"] ) {
  32061. writer.setSelection( positionOrRange );
  32062. } else {
  32063. selection.setTo( positionOrRange );
  32064. }
  32065. }
  32066. /***/ }),
  32067. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/utils/getselectedcontent.js":
  32068. /*!***************************************************************************************!*\
  32069. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/utils/getselectedcontent.js ***!
  32070. \***************************************************************************************/
  32071. /*! exports provided: default */
  32072. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  32073. "use strict";
  32074. __webpack_require__.r(__webpack_exports__);
  32075. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return getSelectedContent; });
  32076. /**
  32077. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  32078. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  32079. */
  32080. /**
  32081. * @module engine/model/utils/getselectedcontent
  32082. */
  32083. /**
  32084. * Gets a clone of the selected content.
  32085. *
  32086. * For example, for the following selection:
  32087. *
  32088. * ```html
  32089. * <p>x</p><quote><p>y</p><h>fir[st</h></quote><p>se]cond</p><p>z</p>
  32090. * ```
  32091. *
  32092. * It will return a document fragment with such a content:
  32093. *
  32094. * ```html
  32095. * <quote><h>st</h></quote><p>se</p>
  32096. * ```
  32097. *
  32098. * @param {module:engine/model/model~Model} model The model in context of which
  32099. * the selection modification should be performed.
  32100. * @param {module:engine/model/selection~Selection|module:engine/model/documentselection~DocumentSelection} selection
  32101. * The selection of which content will be returned.
  32102. * @returns {module:engine/model/documentfragment~DocumentFragment}
  32103. */
  32104. function getSelectedContent( model, selection ) {
  32105. return model.change( writer => {
  32106. const frag = writer.createDocumentFragment();
  32107. const range = selection.getFirstRange();
  32108. if ( !range || range.isCollapsed ) {
  32109. return frag;
  32110. }
  32111. const root = range.start.root;
  32112. const commonPath = range.start.getCommonPath( range.end );
  32113. const commonParent = root.getNodeByPath( commonPath );
  32114. // ## 1st step
  32115. //
  32116. // First, we'll clone a fragment represented by a minimal flat range
  32117. // containing the original range to be cloned.
  32118. // E.g. let's consider such a range:
  32119. //
  32120. // <p>x</p><quote><p>y</p><h>fir[st</h></quote><p>se]cond</p><p>z</p>
  32121. //
  32122. // A minimal flat range containing this one is:
  32123. //
  32124. // <p>x</p>[<quote><p>y</p><h>first</h></quote><p>second</p>]<p>z</p>
  32125. //
  32126. // We can easily clone this structure, preserving e.g. the <quote> element.
  32127. let flatSubtreeRange;
  32128. if ( range.start.parent == range.end.parent ) {
  32129. // The original range is flat, so take it.
  32130. flatSubtreeRange = range;
  32131. } else {
  32132. flatSubtreeRange = writer.createRange(
  32133. writer.createPositionAt( commonParent, range.start.path[ commonPath.length ] ),
  32134. writer.createPositionAt( commonParent, range.end.path[ commonPath.length ] + 1 )
  32135. );
  32136. }
  32137. const howMany = flatSubtreeRange.end.offset - flatSubtreeRange.start.offset;
  32138. // Clone the whole contents.
  32139. for ( const item of flatSubtreeRange.getItems( { shallow: true } ) ) {
  32140. if ( item.is( '$textProxy' ) ) {
  32141. writer.appendText( item.data, item.getAttributes(), frag );
  32142. } else {
  32143. writer.append( writer.cloneElement( item, true ), frag );
  32144. }
  32145. }
  32146. // ## 2nd step
  32147. //
  32148. // If the original range wasn't flat, then we need to remove the excess nodes from the both ends of the cloned fragment.
  32149. //
  32150. // For example, for the range shown in the 1st step comment, we need to remove these pieces:
  32151. //
  32152. // <quote>[<p>y</p>]<h>[fir]st</h></quote><p>se[cond]</p>
  32153. //
  32154. // So this will be the final copied content:
  32155. //
  32156. // <quote><h>st</h></quote><p>se</p>
  32157. //
  32158. // In order to do that, we remove content from these two ranges:
  32159. //
  32160. // [<quote><p>y</p><h>fir]st</h></quote><p>se[cond</p>]
  32161. if ( flatSubtreeRange != range ) {
  32162. // Find the position of the original range in the cloned fragment.
  32163. const newRange = range._getTransformedByMove( flatSubtreeRange.start, writer.createPositionAt( frag, 0 ), howMany )[ 0 ];
  32164. const leftExcessRange = writer.createRange( writer.createPositionAt( frag, 0 ), newRange.start );
  32165. const rightExcessRange = writer.createRange( newRange.end, writer.createPositionAt( frag, 'end' ) );
  32166. removeRangeContent( rightExcessRange, writer );
  32167. removeRangeContent( leftExcessRange, writer );
  32168. }
  32169. return frag;
  32170. } );
  32171. }
  32172. // After https://github.com/ckeditor/ckeditor5-engine/issues/690 is fixed,
  32173. // this function will, most likely, be able to rewritten using getMinimalFlatRanges().
  32174. function removeRangeContent( range, writer ) {
  32175. const parentsToCheck = [];
  32176. Array.from( range.getItems( { direction: 'backward' } ) )
  32177. // We should better store ranges because text proxies will lose integrity
  32178. // with the text nodes when we'll start removing content.
  32179. .map( item => writer.createRangeOn( item ) )
  32180. // Filter only these items which are fully contained in the passed range.
  32181. //
  32182. // E.g. for the following range: [<quote><p>y</p><h>fir]st</h>
  32183. // the walker will return the entire <h> element, when only the "fir" item inside it is fully contained.
  32184. .filter( itemRange => {
  32185. // We should be able to use Range.containsRange, but https://github.com/ckeditor/ckeditor5-engine/issues/691.
  32186. const contained =
  32187. ( itemRange.start.isAfter( range.start ) || itemRange.start.isEqual( range.start ) ) &&
  32188. ( itemRange.end.isBefore( range.end ) || itemRange.end.isEqual( range.end ) );
  32189. return contained;
  32190. } )
  32191. .forEach( itemRange => {
  32192. parentsToCheck.push( itemRange.start.parent );
  32193. writer.remove( itemRange );
  32194. } );
  32195. // Remove ancestors of the removed items if they turned to be empty now
  32196. // (their whole content was contained in the range).
  32197. parentsToCheck.forEach( parentToCheck => {
  32198. let parent = parentToCheck;
  32199. while ( parent.parent && parent.isEmpty ) {
  32200. const removeRange = writer.createRangeOn( parent );
  32201. parent = parent.parent;
  32202. writer.remove( removeRange );
  32203. }
  32204. } );
  32205. }
  32206. /***/ }),
  32207. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/utils/insertcontent.js":
  32208. /*!**********************************************************************************!*\
  32209. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/utils/insertcontent.js ***!
  32210. \**********************************************************************************/
  32211. /*! exports provided: default */
  32212. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  32213. "use strict";
  32214. __webpack_require__.r(__webpack_exports__);
  32215. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return insertContent; });
  32216. /* harmony import */ var _position__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../position */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/position.js");
  32217. /* harmony import */ var _liveposition__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../liveposition */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/liveposition.js");
  32218. /* harmony import */ var _element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../element */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/element.js");
  32219. /* harmony import */ var _range__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../range */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/range.js");
  32220. /* harmony import */ var _documentselection__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../documentselection */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/documentselection.js");
  32221. /* harmony import */ var _selection__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../selection */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/selection.js");
  32222. /* 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");
  32223. /**
  32224. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  32225. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  32226. */
  32227. /**
  32228. * @module engine/model/utils/insertcontent
  32229. */
  32230. /**
  32231. * Inserts content into the editor (specified selection) as one would expect the paste functionality to work.
  32232. *
  32233. * It takes care of removing the selected content, splitting elements (if needed), inserting elements and merging elements appropriately.
  32234. *
  32235. * Some examples:
  32236. *
  32237. * <p>x^</p> + <p>y</p> => <p>x</p><p>y</p> => <p>xy[]</p>
  32238. * <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>
  32239. * <p>x^y</p> + <img /> => <p>x</p>^<p>y</p> + <img /> => <p>x</p><img /><p>y</p>
  32240. * <p>x</p><p>^</p><p>z</p> + <p>y</p> => <p>x</p><p>y[]</p><p>z</p> (no merging)
  32241. * <p>x</p>[<img />]<p>z</p> + <p>y</p> => <p>x</p>^<p>z</p> + <p>y</p> => <p>x</p><p>y[]</p><p>z</p>
  32242. *
  32243. * If an instance of {@link module:engine/model/selection~Selection} is passed as `selectable` it will be modified
  32244. * to the insertion selection (equal to a range to be selected after insertion).
  32245. *
  32246. * If `selectable` is not passed, the content will be inserted using the current selection of the model document.
  32247. *
  32248. * **Note:** Use {@link module:engine/model/model~Model#insertContent} instead of this function.
  32249. * This function is only exposed to be reusable in algorithms which change the {@link module:engine/model/model~Model#insertContent}
  32250. * method's behavior.
  32251. *
  32252. * @param {module:engine/model/model~Model} model The model in context of which the insertion
  32253. * should be performed.
  32254. * @param {module:engine/model/documentfragment~DocumentFragment|module:engine/model/item~Item} content The content to insert.
  32255. * @param {module:engine/model/selection~Selectable} [selectable=model.document.selection]
  32256. * Selection into which the content should be inserted.
  32257. * @param {Number|'before'|'end'|'after'|'on'|'in'} [placeOrOffset] Sets place or offset of the selection.
  32258. * @returns {module:engine/model/range~Range} Range which contains all the performed changes. This is a range that, if removed,
  32259. * would return the model to the state before the insertion. If no changes were preformed by `insertContent`, returns a range collapsed
  32260. * at the insertion position.
  32261. */
  32262. function insertContent( model, content, selectable, placeOrOffset ) {
  32263. return model.change( writer => {
  32264. let selection;
  32265. if ( !selectable ) {
  32266. selection = model.document.selection;
  32267. } else if ( selectable instanceof _selection__WEBPACK_IMPORTED_MODULE_5__["default"] || selectable instanceof _documentselection__WEBPACK_IMPORTED_MODULE_4__["default"] ) {
  32268. selection = selectable;
  32269. } else {
  32270. selection = writer.createSelection( selectable, placeOrOffset );
  32271. }
  32272. if ( !selection.isCollapsed ) {
  32273. model.deleteContent( selection, { doNotAutoparagraph: true } );
  32274. }
  32275. const insertion = new Insertion( model, writer, selection.anchor );
  32276. let nodesToInsert;
  32277. if ( content.is( 'documentFragment' ) ) {
  32278. nodesToInsert = content.getChildren();
  32279. } else {
  32280. nodesToInsert = [ content ];
  32281. }
  32282. insertion.handleNodes( nodesToInsert );
  32283. const newRange = insertion.getSelectionRange();
  32284. /* istanbul ignore else */
  32285. if ( newRange ) {
  32286. if ( selection instanceof _documentselection__WEBPACK_IMPORTED_MODULE_4__["default"] ) {
  32287. writer.setSelection( newRange );
  32288. } else {
  32289. selection.setTo( newRange );
  32290. }
  32291. } else {
  32292. // We are not testing else because it's a safe check for unpredictable edge cases:
  32293. // an insertion without proper range to select.
  32294. //
  32295. // @if CK_DEBUG // console.warn( 'Cannot determine a proper selection range after insertion.' );
  32296. }
  32297. const affectedRange = insertion.getAffectedRange() || model.createRange( selection.anchor );
  32298. insertion.destroy();
  32299. return affectedRange;
  32300. } );
  32301. }
  32302. /**
  32303. * Utility class for performing content insertion.
  32304. *
  32305. * @private
  32306. */
  32307. class Insertion {
  32308. constructor( model, writer, position ) {
  32309. /**
  32310. * The model in context of which the insertion should be performed.
  32311. *
  32312. * @member {module:engine/model~Model} #model
  32313. */
  32314. this.model = model;
  32315. /**
  32316. * Batch to which operations will be added.
  32317. *
  32318. * @member {module:engine/controller/writer~Batch} #writer
  32319. */
  32320. this.writer = writer;
  32321. /**
  32322. * The position at which (or near which) the next node will be inserted.
  32323. *
  32324. * @member {module:engine/model/position~Position} #position
  32325. */
  32326. this.position = position;
  32327. /**
  32328. * Elements with which the inserted elements can be merged.
  32329. *
  32330. * <p>x^</p><p>y</p> + <p>z</p> (can merge to <p>x</p>)
  32331. * <p>x</p><p>^y</p> + <p>z</p> (can merge to <p>y</p>)
  32332. * <p>x^y</p> + <p>z</p> (can merge to <p>xy</p> which will be split during the action,
  32333. * so both its pieces will be added to this set)
  32334. *
  32335. *
  32336. * @member {Set} #canMergeWith
  32337. */
  32338. this.canMergeWith = new Set( [ this.position.parent ] );
  32339. /**
  32340. * Schema of the model.
  32341. *
  32342. * @member {module:engine/model/schema~Schema} #schema
  32343. */
  32344. this.schema = model.schema;
  32345. /**
  32346. * The temporary DocumentFragment used for grouping multiple nodes for single insert operation.
  32347. *
  32348. * @private
  32349. * @type {module:engine/model/documentfragment~DocumentFragment}
  32350. */
  32351. this._documentFragment = writer.createDocumentFragment();
  32352. /**
  32353. * The current position in the temporary DocumentFragment.
  32354. *
  32355. * @private
  32356. * @type {module:engine/model/position~Position}
  32357. */
  32358. this._documentFragmentPosition = writer.createPositionAt( this._documentFragment, 0 );
  32359. /**
  32360. * The reference to the first inserted node.
  32361. *
  32362. * @private
  32363. * @type {module:engine/model/node~Node}
  32364. */
  32365. this._firstNode = null;
  32366. /**
  32367. * The reference to the last inserted node.
  32368. *
  32369. * @private
  32370. * @type {module:engine/model/node~Node}
  32371. */
  32372. this._lastNode = null;
  32373. /**
  32374. * The reference to the last auto paragraph node.
  32375. *
  32376. * @private
  32377. * @type {module:engine/model/node~Node}
  32378. */
  32379. this._lastAutoParagraph = null;
  32380. /**
  32381. * The array of nodes that should be cleaned of not allowed attributes.
  32382. *
  32383. * @private
  32384. * @type {Array.<module:engine/model/node~Node>}
  32385. */
  32386. this._filterAttributesOf = [];
  32387. /**
  32388. * Beginning of the affected range. See {@link module:engine/model/utils/insertcontent~Insertion#getAffectedRange}.
  32389. *
  32390. * @private
  32391. * @member {module:engine/model/liveposition~LivePosition|null} #_affectedStart
  32392. */
  32393. this._affectedStart = null;
  32394. /**
  32395. * End of the affected range. See {@link module:engine/model/utils/insertcontent~Insertion#getAffectedRange}.
  32396. *
  32397. * @private
  32398. * @member {module:engine/model/liveposition~LivePosition|null} #_affectedEnd
  32399. */
  32400. this._affectedEnd = null;
  32401. }
  32402. /**
  32403. * Handles insertion of a set of nodes.
  32404. *
  32405. * @param {Iterable.<module:engine/model/node~Node>} nodes Nodes to insert.
  32406. */
  32407. handleNodes( nodes ) {
  32408. for ( const node of Array.from( nodes ) ) {
  32409. this._handleNode( node );
  32410. }
  32411. // Insert nodes collected in temporary DocumentFragment.
  32412. this._insertPartialFragment();
  32413. // If there was an auto paragraph then we might need to adjust the end of insertion.
  32414. if ( this._lastAutoParagraph ) {
  32415. this._updateLastNodeFromAutoParagraph( this._lastAutoParagraph );
  32416. }
  32417. // After the content was inserted we may try to merge it with its next sibling if the selection was in it initially.
  32418. // Merging with the previous sibling was performed just after inserting the first node to the document.
  32419. this._mergeOnRight();
  32420. // TMP this will become a post-fixer.
  32421. this.schema.removeDisallowedAttributes( this._filterAttributesOf, this.writer );
  32422. this._filterAttributesOf = [];
  32423. }
  32424. /**
  32425. * Updates the last node after the auto paragraphing.
  32426. *
  32427. * @private
  32428. * @param {module:engine/model/node~Node} node The last auto paragraphing node.
  32429. */
  32430. _updateLastNodeFromAutoParagraph( node ) {
  32431. const positionAfterLastNode = this.writer.createPositionAfter( this._lastNode );
  32432. const positionAfterNode = this.writer.createPositionAfter( node );
  32433. // If the real end was after the last auto paragraph then update relevant properties.
  32434. if ( positionAfterNode.isAfter( positionAfterLastNode ) ) {
  32435. this._lastNode = node;
  32436. /* istanbul ignore if */
  32437. if ( this.position.parent != node || !this.position.isAtEnd ) {
  32438. // Algorithm's correctness check. We should never end up here but it's good to know that we did.
  32439. // At this point the insertion position should be at the end of the last auto paragraph.
  32440. // Note: This error is documented in other place in this file.
  32441. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_6__["default"]( 'insertcontent-invalid-insertion-position', this );
  32442. }
  32443. this.position = positionAfterNode;
  32444. this._setAffectedBoundaries( this.position );
  32445. }
  32446. }
  32447. /**
  32448. * Returns range to be selected after insertion.
  32449. * Returns `null` if there is no valid range to select after insertion.
  32450. *
  32451. * @returns {module:engine/model/range~Range|null}
  32452. */
  32453. getSelectionRange() {
  32454. if ( this.nodeToSelect ) {
  32455. return _range__WEBPACK_IMPORTED_MODULE_3__["default"]._createOn( this.nodeToSelect );
  32456. }
  32457. return this.model.schema.getNearestSelectionRange( this.position );
  32458. }
  32459. /**
  32460. * Returns a range which contains all the performed changes. This is a range that, if removed, would return the model to the state
  32461. * before the insertion. Returns `null` if no changes were done.
  32462. *
  32463. * @returns {module:engine/model/range~Range|null}
  32464. */
  32465. getAffectedRange() {
  32466. if ( !this._affectedStart ) {
  32467. return null;
  32468. }
  32469. return new _range__WEBPACK_IMPORTED_MODULE_3__["default"]( this._affectedStart, this._affectedEnd );
  32470. }
  32471. /**
  32472. * Destroys `Insertion` instance.
  32473. */
  32474. destroy() {
  32475. if ( this._affectedStart ) {
  32476. this._affectedStart.detach();
  32477. }
  32478. if ( this._affectedEnd ) {
  32479. this._affectedEnd.detach();
  32480. }
  32481. }
  32482. /**
  32483. * Handles insertion of a single node.
  32484. *
  32485. * @private
  32486. * @param {module:engine/model/node~Node} node
  32487. */
  32488. _handleNode( node ) {
  32489. // Let's handle object in a special way.
  32490. // * They should never be merged with other elements.
  32491. // * If they are not allowed in any of the selection ancestors, they could be either autoparagraphed or totally removed.
  32492. if ( this.schema.isObject( node ) ) {
  32493. this._handleObject( node );
  32494. return;
  32495. }
  32496. // Try to find a place for the given node.
  32497. // Check if a node can be inserted in the given position or it would be accepted if a paragraph would be inserted.
  32498. // Inserts the auto paragraph if it would allow for insertion.
  32499. let isAllowed = this._checkAndAutoParagraphToAllowedPosition( node );
  32500. if ( !isAllowed ) {
  32501. // Split the position.parent's branch up to a point where the node can be inserted.
  32502. // If it isn't allowed in the whole branch, then of course don't split anything.
  32503. isAllowed = this._checkAndSplitToAllowedPosition( node );
  32504. if ( !isAllowed ) {
  32505. this._handleDisallowedNode( node );
  32506. return;
  32507. }
  32508. }
  32509. // Add node to the current temporary DocumentFragment.
  32510. this._appendToFragment( node );
  32511. // Store the first and last nodes for easy access for merging with sibling nodes.
  32512. if ( !this._firstNode ) {
  32513. this._firstNode = node;
  32514. }
  32515. this._lastNode = node;
  32516. }
  32517. /**
  32518. * Inserts the temporary DocumentFragment into the model.
  32519. *
  32520. * @private
  32521. */
  32522. _insertPartialFragment() {
  32523. if ( this._documentFragment.isEmpty ) {
  32524. return;
  32525. }
  32526. const livePosition = _liveposition__WEBPACK_IMPORTED_MODULE_1__["default"].fromPosition( this.position, 'toNext' );
  32527. this._setAffectedBoundaries( this.position );
  32528. // If the very first node of the whole insertion process is inserted, insert it separately for OT reasons (undo).
  32529. // Note: there can be multiple calls to `_insertPartialFragment()` during one insertion process.
  32530. // Note: only the very first node can be merged so we have to do separate operation only for it.
  32531. if ( this._documentFragment.getChild( 0 ) == this._firstNode ) {
  32532. this.writer.insert( this._firstNode, this.position );
  32533. // We must merge the first node just after inserting it to avoid problems with OT.
  32534. // (See: https://github.com/ckeditor/ckeditor5/pull/8773#issuecomment-760945652).
  32535. this._mergeOnLeft();
  32536. this.position = livePosition.toPosition();
  32537. }
  32538. // Insert the remaining nodes from document fragment.
  32539. if ( !this._documentFragment.isEmpty ) {
  32540. this.writer.insert( this._documentFragment, this.position );
  32541. }
  32542. this._documentFragmentPosition = this.writer.createPositionAt( this._documentFragment, 0 );
  32543. this.position = livePosition.toPosition();
  32544. livePosition.detach();
  32545. }
  32546. /**
  32547. * @private
  32548. * @param {module:engine/model/element~Element} node The object element.
  32549. */
  32550. _handleObject( node ) {
  32551. // Try finding it a place in the tree.
  32552. if ( this._checkAndSplitToAllowedPosition( node ) ) {
  32553. this._appendToFragment( node );
  32554. }
  32555. // Try autoparagraphing.
  32556. else {
  32557. this._tryAutoparagraphing( node );
  32558. }
  32559. }
  32560. /**
  32561. * @private
  32562. * @param {module:engine/model/node~Node} node The disallowed node which needs to be handled.
  32563. */
  32564. _handleDisallowedNode( node ) {
  32565. // If the node is an element, try inserting its children (strip the parent).
  32566. if ( node.is( 'element' ) ) {
  32567. this.handleNodes( node.getChildren() );
  32568. }
  32569. // If text is not allowed, try autoparagraphing it.
  32570. else {
  32571. this._tryAutoparagraphing( node );
  32572. }
  32573. }
  32574. /**
  32575. * Append a node to the temporary DocumentFragment.
  32576. *
  32577. * @private
  32578. * @param {module:engine/model/node~Node} node The node to insert.
  32579. */
  32580. _appendToFragment( node ) {
  32581. /* istanbul ignore if */
  32582. if ( !this.schema.checkChild( this.position, node ) ) {
  32583. // Algorithm's correctness check. We should never end up here but it's good to know that we did.
  32584. // Note that it would often be a silent issue if we insert node in a place where it's not allowed.
  32585. /**
  32586. * Given node cannot be inserted on the given position.
  32587. *
  32588. * @error insertcontent-wrong-position
  32589. * @param {module:engine/model/node~Node} node Node to insert.
  32590. * @param {module:engine/model/position~Position} position Position to insert the node at.
  32591. */
  32592. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_6__["default"](
  32593. 'insertcontent-wrong-position',
  32594. this,
  32595. { node, position: this.position }
  32596. );
  32597. }
  32598. this.writer.insert( node, this._documentFragmentPosition );
  32599. this._documentFragmentPosition = this._documentFragmentPosition.getShiftedBy( node.offsetSize );
  32600. // The last inserted object should be selected because we can't put a collapsed selection after it.
  32601. if ( this.schema.isObject( node ) && !this.schema.checkChild( this.position, '$text' ) ) {
  32602. this.nodeToSelect = node;
  32603. } else {
  32604. this.nodeToSelect = null;
  32605. }
  32606. this._filterAttributesOf.push( node );
  32607. }
  32608. /**
  32609. * Sets `_affectedStart` and `_affectedEnd` to the given `position`. Should be used before a change is done during insertion process to
  32610. * mark the affected range.
  32611. *
  32612. * This method is used before inserting a node or splitting a parent node. `_affectedStart` and `_affectedEnd` are also changed
  32613. * during merging, but the logic there is more complicated so it is left out of this function.
  32614. *
  32615. * @private
  32616. * @param {module:engine/model/position~Position} position
  32617. */
  32618. _setAffectedBoundaries( position ) {
  32619. // Set affected boundaries stickiness so that those position will "expand" when something is inserted in between them:
  32620. // <paragraph>Foo][bar</paragraph> -> <paragraph>Foo]xx[bar</paragraph>
  32621. // This is why it cannot be a range but two separate positions.
  32622. if ( !this._affectedStart ) {
  32623. this._affectedStart = _liveposition__WEBPACK_IMPORTED_MODULE_1__["default"].fromPosition( position, 'toPrevious' );
  32624. }
  32625. // If `_affectedEnd` is before the new boundary position, expand `_affectedEnd`. This can happen if first inserted node was
  32626. // inserted into the parent but the next node is moved-out of that parent:
  32627. // (1) <paragraph>Foo][</paragraph> -> <paragraph>Foo]xx[</paragraph>
  32628. // (2) <paragraph>Foo]xx[</paragraph> -> <paragraph>Foo]xx</paragraph><widget></widget>[
  32629. if ( !this._affectedEnd || this._affectedEnd.isBefore( position ) ) {
  32630. if ( this._affectedEnd ) {
  32631. this._affectedEnd.detach();
  32632. }
  32633. this._affectedEnd = _liveposition__WEBPACK_IMPORTED_MODULE_1__["default"].fromPosition( position, 'toNext' );
  32634. }
  32635. }
  32636. /**
  32637. * Merges the previous sibling of the first node if it should be merged.
  32638. *
  32639. * After the content was inserted we may try to merge it with its siblings.
  32640. * This should happen only if the selection was in those elements initially.
  32641. *
  32642. * @private
  32643. */
  32644. _mergeOnLeft() {
  32645. const node = this._firstNode;
  32646. if ( !( node instanceof _element__WEBPACK_IMPORTED_MODULE_2__["default"] ) ) {
  32647. return;
  32648. }
  32649. if ( !this._canMergeLeft( node ) ) {
  32650. return;
  32651. }
  32652. const mergePosLeft = _liveposition__WEBPACK_IMPORTED_MODULE_1__["default"]._createBefore( node );
  32653. mergePosLeft.stickiness = 'toNext';
  32654. const livePosition = _liveposition__WEBPACK_IMPORTED_MODULE_1__["default"].fromPosition( this.position, 'toNext' );
  32655. // If `_affectedStart` is sames as merge position, it means that the element "marked" by `_affectedStart` is going to be
  32656. // removed and its contents will be moved. This won't transform `LivePosition` so `_affectedStart` needs to be moved
  32657. // by hand to properly reflect affected range. (Due to `_affectedStart` and `_affectedEnd` stickiness, the "range" is
  32658. // shown as `][`).
  32659. //
  32660. // Example - insert `<paragraph>Abc</paragraph><paragraph>Xyz</paragraph>` at the end of `<paragraph>Foo^</paragraph>`:
  32661. //
  32662. // <paragraph>Foo</paragraph><paragraph>Bar</paragraph> -->
  32663. // <paragraph>Foo</paragraph>]<paragraph>Abc</paragraph><paragraph>Xyz</paragraph>[<paragraph>Bar</paragraph> -->
  32664. // <paragraph>Foo]Abc</paragraph><paragraph>Xyz</paragraph>[<paragraph>Bar</paragraph>
  32665. //
  32666. // Note, that if we are here then something must have been inserted, so `_affectedStart` and `_affectedEnd` have to be set.
  32667. if ( this._affectedStart.isEqual( mergePosLeft ) ) {
  32668. this._affectedStart.detach();
  32669. this._affectedStart = _liveposition__WEBPACK_IMPORTED_MODULE_1__["default"]._createAt( mergePosLeft.nodeBefore, 'end', 'toPrevious' );
  32670. }
  32671. // We need to update the references to the first and last nodes if they will be merged into the previous sibling node
  32672. // because the reference would point to the removed node.
  32673. //
  32674. // <p>A^A</p> + <p>X</p>
  32675. //
  32676. // <p>A</p>^<p>A</p>
  32677. // <p>A</p><p>X</p><p>A</p>
  32678. // <p>AX</p><p>A</p>
  32679. // <p>AXA</p>
  32680. if ( this._firstNode === this._lastNode ) {
  32681. this._firstNode = mergePosLeft.nodeBefore;
  32682. this._lastNode = mergePosLeft.nodeBefore;
  32683. }
  32684. this.writer.merge( mergePosLeft );
  32685. // If only one element (the merged one) is in the "affected range", also move the affected range end appropriately.
  32686. //
  32687. // Example - insert `<paragraph>Abc</paragraph>` at the of `<paragraph>Foo^</paragraph>`:
  32688. //
  32689. // <paragraph>Foo</paragraph><paragraph>Bar</paragraph> -->
  32690. // <paragraph>Foo</paragraph>]<paragraph>Abc</paragraph>[<paragraph>Bar</paragraph> -->
  32691. // <paragraph>Foo]Abc</paragraph>[<paragraph>Bar</paragraph> -->
  32692. // <paragraph>Foo]Abc[</paragraph><paragraph>Bar</paragraph>
  32693. if ( mergePosLeft.isEqual( this._affectedEnd ) && this._firstNode === this._lastNode ) {
  32694. this._affectedEnd.detach();
  32695. this._affectedEnd = _liveposition__WEBPACK_IMPORTED_MODULE_1__["default"]._createAt( mergePosLeft.nodeBefore, 'end', 'toNext' );
  32696. }
  32697. this.position = livePosition.toPosition();
  32698. livePosition.detach();
  32699. // After merge elements that were marked by _insert() to be filtered might be gone so
  32700. // we need to mark the new container.
  32701. this._filterAttributesOf.push( this.position.parent );
  32702. mergePosLeft.detach();
  32703. }
  32704. /**
  32705. * Merges the next sibling of the last node if it should be merged.
  32706. *
  32707. * After the content was inserted we may try to merge it with its siblings.
  32708. * This should happen only if the selection was in those elements initially.
  32709. *
  32710. * @private
  32711. */
  32712. _mergeOnRight() {
  32713. const node = this._lastNode;
  32714. if ( !( node instanceof _element__WEBPACK_IMPORTED_MODULE_2__["default"] ) ) {
  32715. return;
  32716. }
  32717. if ( !this._canMergeRight( node ) ) {
  32718. return;
  32719. }
  32720. const mergePosRight = _liveposition__WEBPACK_IMPORTED_MODULE_1__["default"]._createAfter( node );
  32721. mergePosRight.stickiness = 'toNext';
  32722. /* istanbul ignore if */
  32723. if ( !this.position.isEqual( mergePosRight ) ) {
  32724. // Algorithm's correctness check. We should never end up here but it's good to know that we did.
  32725. // At this point the insertion position should be after the node we'll merge. If it isn't,
  32726. // it should need to be secured as in the left merge case.
  32727. /**
  32728. * An internal error occurred when merging inserted content with its siblings.
  32729. * The insertion position should equal the merge position.
  32730. *
  32731. * If you encountered this error, report it back to the CKEditor 5 team
  32732. * with as many details as possible regarding the content being inserted and the insertion position.
  32733. *
  32734. * @error insertcontent-invalid-insertion-position
  32735. */
  32736. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_6__["default"]( 'insertcontent-invalid-insertion-position', this );
  32737. }
  32738. // Move the position to the previous node, so it isn't moved to the graveyard on merge.
  32739. // <p>x</p>[]<p>y</p> => <p>x[]</p><p>y</p>
  32740. this.position = _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createAt( mergePosRight.nodeBefore, 'end' );
  32741. // Explanation of setting position stickiness to `'toPrevious'`:
  32742. // OK: <p>xx[]</p> + <p>yy</p> => <p>xx[]yy</p> (when sticks to previous)
  32743. // NOK: <p>xx[]</p> + <p>yy</p> => <p>xxyy[]</p> (when sticks to next)
  32744. const livePosition = _liveposition__WEBPACK_IMPORTED_MODULE_1__["default"].fromPosition( this.position, 'toPrevious' );
  32745. // See comment in `_mergeOnLeft()` on moving `_affectedStart`.
  32746. if ( this._affectedEnd.isEqual( mergePosRight ) ) {
  32747. this._affectedEnd.detach();
  32748. this._affectedEnd = _liveposition__WEBPACK_IMPORTED_MODULE_1__["default"]._createAt( mergePosRight.nodeBefore, 'end', 'toNext' );
  32749. }
  32750. // We need to update the references to the first and last nodes if they will be merged into the previous sibling node
  32751. // because the reference would point to the removed node.
  32752. //
  32753. // <p>A^A</p> + <p>X</p>
  32754. //
  32755. // <p>A</p>^<p>A</p>
  32756. // <p>A</p><p>X</p><p>A</p>
  32757. // <p>AX</p><p>A</p>
  32758. // <p>AXA</p>
  32759. if ( this._firstNode === this._lastNode ) {
  32760. this._firstNode = mergePosRight.nodeBefore;
  32761. this._lastNode = mergePosRight.nodeBefore;
  32762. }
  32763. this.writer.merge( mergePosRight );
  32764. // See comment in `_mergeOnLeft()` on moving `_affectedStart`.
  32765. if ( mergePosRight.getShiftedBy( -1 ).isEqual( this._affectedStart ) && this._firstNode === this._lastNode ) {
  32766. this._affectedStart.detach();
  32767. this._affectedStart = _liveposition__WEBPACK_IMPORTED_MODULE_1__["default"]._createAt( mergePosRight.nodeBefore, 0, 'toPrevious' );
  32768. }
  32769. this.position = livePosition.toPosition();
  32770. livePosition.detach();
  32771. // After merge elements that were marked by _insert() to be filtered might be gone so
  32772. // we need to mark the new container.
  32773. this._filterAttributesOf.push( this.position.parent );
  32774. mergePosRight.detach();
  32775. }
  32776. /**
  32777. * Checks whether specified node can be merged with previous sibling element.
  32778. *
  32779. * @private
  32780. * @param {module:engine/model/node~Node} node The node which could potentially be merged.
  32781. * @returns {Boolean}
  32782. */
  32783. _canMergeLeft( node ) {
  32784. const previousSibling = node.previousSibling;
  32785. return ( previousSibling instanceof _element__WEBPACK_IMPORTED_MODULE_2__["default"] ) &&
  32786. this.canMergeWith.has( previousSibling ) &&
  32787. this.model.schema.checkMerge( previousSibling, node );
  32788. }
  32789. /**
  32790. * Checks whether specified node can be merged with next sibling element.
  32791. *
  32792. * @private
  32793. * @param {module:engine/model/node~Node} node The node which could potentially be merged.
  32794. * @returns {Boolean}
  32795. */
  32796. _canMergeRight( node ) {
  32797. const nextSibling = node.nextSibling;
  32798. return ( nextSibling instanceof _element__WEBPACK_IMPORTED_MODULE_2__["default"] ) &&
  32799. this.canMergeWith.has( nextSibling ) &&
  32800. this.model.schema.checkMerge( node, nextSibling );
  32801. }
  32802. /**
  32803. * Tries wrapping the node in a new paragraph and inserting it this way.
  32804. *
  32805. * @private
  32806. * @param {module:engine/model/node~Node} node The node which needs to be autoparagraphed.
  32807. */
  32808. _tryAutoparagraphing( node ) {
  32809. const paragraph = this.writer.createElement( 'paragraph' );
  32810. // Do not autoparagraph if the paragraph won't be allowed there,
  32811. // cause that would lead to an infinite loop. The paragraph would be rejected in
  32812. // the next _handleNode() call and we'd be here again.
  32813. if ( this._getAllowedIn( paragraph, this.position.parent ) && this.schema.checkChild( paragraph, node ) ) {
  32814. paragraph._appendChild( node );
  32815. this._handleNode( paragraph );
  32816. }
  32817. }
  32818. /**
  32819. * Checks if a node can be inserted in the given position or it would be accepted if a paragraph would be inserted.
  32820. * It also handles inserting the paragraph.
  32821. *
  32822. * @private
  32823. * @param {module:engine/model/node~Node} node The node.
  32824. * @returns {Boolean} Whether an allowed position was found.
  32825. * `false` is returned if the node isn't allowed at the current position or in auto paragraph, `true` if was.
  32826. */
  32827. _checkAndAutoParagraphToAllowedPosition( node ) {
  32828. if ( this.schema.checkChild( this.position.parent, node ) ) {
  32829. return true;
  32830. }
  32831. // Do not auto paragraph if the paragraph won't be allowed there,
  32832. // cause that would lead to an infinite loop. The paragraph would be rejected in
  32833. // the next _handleNode() call and we'd be here again.
  32834. if ( !this.schema.checkChild( this.position.parent, 'paragraph' ) || !this.schema.checkChild( 'paragraph', node ) ) {
  32835. return false;
  32836. }
  32837. // Insert nodes collected in temporary DocumentFragment if the position parent needs change to process further nodes.
  32838. this._insertPartialFragment();
  32839. // Insert a paragraph and move insertion position to it.
  32840. const paragraph = this.writer.createElement( 'paragraph' );
  32841. this.writer.insert( paragraph, this.position );
  32842. this._setAffectedBoundaries( this.position );
  32843. this._lastAutoParagraph = paragraph;
  32844. this.position = this.writer.createPositionAt( paragraph, 0 );
  32845. return true;
  32846. }
  32847. /**
  32848. * @private
  32849. * @param {module:engine/model/node~Node} node
  32850. * @returns {Boolean} Whether an allowed position was found.
  32851. * `false` is returned if the node isn't allowed at any position up in the tree, `true` if was.
  32852. */
  32853. _checkAndSplitToAllowedPosition( node ) {
  32854. const allowedIn = this._getAllowedIn( node, this.position.parent );
  32855. if ( !allowedIn ) {
  32856. return false;
  32857. }
  32858. // Insert nodes collected in temporary DocumentFragment if the position parent needs change to process further nodes.
  32859. if ( allowedIn != this.position.parent ) {
  32860. this._insertPartialFragment();
  32861. }
  32862. while ( allowedIn != this.position.parent ) {
  32863. // If a parent which we'd need to leave is a limit element, break.
  32864. if ( this.schema.isLimit( this.position.parent ) ) {
  32865. return false;
  32866. }
  32867. if ( this.position.isAtStart ) {
  32868. // If insertion position is at the beginning of the parent, move it out instead of splitting.
  32869. // <p>^Foo</p> -> ^<p>Foo</p>
  32870. const parent = this.position.parent;
  32871. this.position = this.writer.createPositionBefore( parent );
  32872. // Special case – parent is empty (<p>^</p>).
  32873. //
  32874. // 1. parent.isEmpty
  32875. // We can remove the element after moving insertion position out of it.
  32876. //
  32877. // 2. parent.parent === allowedIn
  32878. // However parent should remain in place when allowed element is above limit element in document tree.
  32879. // For example there shouldn't be allowed to remove empty paragraph from tableCell, when is pasted
  32880. // content allowed in $root.
  32881. if ( parent.isEmpty && parent.parent === allowedIn ) {
  32882. this.writer.remove( parent );
  32883. }
  32884. } else if ( this.position.isAtEnd ) {
  32885. // If insertion position is at the end of the parent, move it out instead of splitting.
  32886. // <p>Foo^</p> -> <p>Foo</p>^
  32887. this.position = this.writer.createPositionAfter( this.position.parent );
  32888. } else {
  32889. const tempPos = this.writer.createPositionAfter( this.position.parent );
  32890. this._setAffectedBoundaries( this.position );
  32891. this.writer.split( this.position );
  32892. this.position = tempPos;
  32893. this.canMergeWith.add( this.position.nodeAfter );
  32894. }
  32895. }
  32896. return true;
  32897. }
  32898. /**
  32899. * Gets the element in which the given node is allowed. It checks the passed element and all its ancestors.
  32900. *
  32901. * @private
  32902. * @param {module:engine/model/node~Node} node The node to check.
  32903. * @param {module:engine/model/element~Element} element The element in which the node's correctness should be checked.
  32904. * @returns {module:engine/model/element~Element|null}
  32905. */
  32906. _getAllowedIn( node, element ) {
  32907. if ( this.schema.checkChild( element, node ) ) {
  32908. return element;
  32909. }
  32910. if ( element.parent ) {
  32911. return this._getAllowedIn( node, element.parent );
  32912. }
  32913. return null;
  32914. }
  32915. }
  32916. /***/ }),
  32917. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/utils/modifyselection.js":
  32918. /*!************************************************************************************!*\
  32919. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/utils/modifyselection.js ***!
  32920. \************************************************************************************/
  32921. /*! exports provided: default */
  32922. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  32923. "use strict";
  32924. __webpack_require__.r(__webpack_exports__);
  32925. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return modifySelection; });
  32926. /* harmony import */ var _position__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../position */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/position.js");
  32927. /* harmony import */ var _treewalker__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../treewalker */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/treewalker.js");
  32928. /* harmony import */ var _range__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../range */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/range.js");
  32929. /* 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");
  32930. /* harmony import */ var _documentselection__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../documentselection */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/documentselection.js");
  32931. /**
  32932. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  32933. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  32934. */
  32935. /**
  32936. * @module engine/model/utils/modifyselection
  32937. */
  32938. const wordBoundaryCharacters = ' ,.?!:;"-()';
  32939. /**
  32940. * Modifies the selection. Currently, the supported modifications are:
  32941. *
  32942. * * Extending. The selection focus is moved in the specified `options.direction` with a step specified in `options.unit`.
  32943. * Possible values for `unit` are:
  32944. * * `'character'` (default) - moves selection by one user-perceived character. In most cases this means moving by one
  32945. * character in `String` sense. However, unicode also defines "combing marks". These are special symbols, that combines
  32946. * with a symbol before it ("base character") to create one user-perceived character. For example, `q̣̇` is a normal
  32947. * letter `q` with two "combining marks": upper dot (`Ux0307`) and lower dot (`Ux0323`). For most actions, i.e. extending
  32948. * selection by one position, it is correct to include both "base character" and all of it's "combining marks". That is
  32949. * why `'character'` value is most natural and common method of modifying selection.
  32950. * * `'codePoint'` - moves selection by one unicode code point. In contrary to, `'character'` unit, this will insert
  32951. * selection between "base character" and "combining mark", because "combining marks" have their own unicode code points.
  32952. * However, for technical reasons, unicode code points with values above `UxFFFF` are represented in native `String` by
  32953. * two characters, called "surrogate pairs". Halves of "surrogate pairs" have a meaning only when placed next to each other.
  32954. * For example `𨭎` is represented in `String` by `\uD862\uDF4E`. Both `\uD862` and `\uDF4E` do not have any meaning
  32955. * outside the pair (are rendered as ? when alone). Position between them would be incorrect. In this case, selection
  32956. * extension will include whole "surrogate pair".
  32957. * * `'word'` - moves selection by a whole word.
  32958. *
  32959. * **Note:** if you extend a forward selection in a backward direction you will in fact shrink it.
  32960. *
  32961. * **Note:** Use {@link module:engine/model/model~Model#modifySelection} instead of this function.
  32962. * This function is only exposed to be reusable in algorithms
  32963. * which change the {@link module:engine/model/model~Model#modifySelection}
  32964. * method's behavior.
  32965. *
  32966. * @param {module:engine/model/model~Model} model The model in context of which
  32967. * the selection modification should be performed.
  32968. * @param {module:engine/model/selection~Selection|module:engine/model/documentselection~DocumentSelection} selection
  32969. * The selection to modify.
  32970. * @param {Object} [options]
  32971. * @param {'forward'|'backward'} [options.direction='forward'] The direction in which the selection should be modified.
  32972. * @param {'character'|'codePoint'|'word'} [options.unit='character'] The unit by which selection should be modified.
  32973. */
  32974. function modifySelection( model, selection, options = {} ) {
  32975. const schema = model.schema;
  32976. const isForward = options.direction != 'backward';
  32977. const unit = options.unit ? options.unit : 'character';
  32978. const focus = selection.focus;
  32979. const walker = new _treewalker__WEBPACK_IMPORTED_MODULE_1__["default"]( {
  32980. boundaries: getSearchRange( focus, isForward ),
  32981. singleCharacters: true,
  32982. direction: isForward ? 'forward' : 'backward'
  32983. } );
  32984. const data = { walker, schema, isForward, unit };
  32985. let next;
  32986. while ( ( next = walker.next() ) ) {
  32987. if ( next.done ) {
  32988. return;
  32989. }
  32990. const position = tryExtendingTo( data, next.value );
  32991. if ( position ) {
  32992. if ( selection instanceof _documentselection__WEBPACK_IMPORTED_MODULE_4__["default"] ) {
  32993. model.change( writer => {
  32994. writer.setSelectionFocus( position );
  32995. } );
  32996. } else {
  32997. selection.setFocus( position );
  32998. }
  32999. return;
  33000. }
  33001. }
  33002. }
  33003. // Checks whether the selection can be extended to the the walker's next value (next position).
  33004. // @param {{ walker, unit, isForward, schema }} data
  33005. // @param {module:engine/view/treewalker~TreeWalkerValue} value
  33006. function tryExtendingTo( data, value ) {
  33007. const { isForward, walker, unit, schema } = data;
  33008. const { type, item, nextPosition } = value;
  33009. // If found text, we can certainly put the focus in it. Let's just find a correct position
  33010. // based on the unit.
  33011. if ( type == 'text' ) {
  33012. if ( data.unit === 'word' ) {
  33013. return getCorrectWordBreakPosition( walker, isForward );
  33014. }
  33015. return getCorrectPosition( walker, unit, isForward );
  33016. }
  33017. // Entering an element.
  33018. if ( type == ( isForward ? 'elementStart' : 'elementEnd' ) ) {
  33019. // If it's a selectable, we can select it now.
  33020. if ( schema.isSelectable( item ) ) {
  33021. return _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createAt( item, isForward ? 'after' : 'before' );
  33022. }
  33023. // If text allowed on this position, extend to this place.
  33024. if ( schema.checkChild( nextPosition, '$text' ) ) {
  33025. return nextPosition;
  33026. }
  33027. }
  33028. // Leaving an element.
  33029. else {
  33030. // If leaving a limit element, stop.
  33031. if ( schema.isLimit( item ) ) {
  33032. // NOTE: Fast-forward the walker until the end.
  33033. walker.skip( () => true );
  33034. return;
  33035. }
  33036. // If text allowed on this position, extend to this place.
  33037. if ( schema.checkChild( nextPosition, '$text' ) ) {
  33038. return nextPosition;
  33039. }
  33040. }
  33041. }
  33042. // Finds a correct position by walking in a text node and checking whether selection can be extended to given position
  33043. // or should be extended further.
  33044. //
  33045. // @param {module:engine/model/treewalker~TreeWalker} walker
  33046. // @param {String} unit The unit by which selection should be modified.
  33047. function getCorrectPosition( walker, unit ) {
  33048. const textNode = walker.position.textNode;
  33049. if ( textNode ) {
  33050. const data = textNode.data;
  33051. let offset = walker.position.offset - textNode.startOffset;
  33052. 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 ) ) ) {
  33053. walker.next();
  33054. offset = walker.position.offset - textNode.startOffset;
  33055. }
  33056. }
  33057. return walker.position;
  33058. }
  33059. // Finds a correct position of a word break by walking in a text node and checking whether selection can be extended to given position
  33060. // or should be extended further.
  33061. //
  33062. // @param {module:engine/model/treewalker~TreeWalker} walker
  33063. // @param {Boolean} isForward Is the direction in which the selection should be modified is forward.
  33064. function getCorrectWordBreakPosition( walker, isForward ) {
  33065. let textNode = walker.position.textNode;
  33066. if ( textNode ) {
  33067. let offset = walker.position.offset - textNode.startOffset;
  33068. while ( !isAtWordBoundary( textNode.data, offset, isForward ) && !isAtNodeBoundary( textNode, offset, isForward ) ) {
  33069. walker.next();
  33070. // Check of adjacent text nodes with different attributes (like BOLD).
  33071. // Example : 'foofoo []bar<$text bold="true">bar</$text> bazbaz'
  33072. // should expand to : 'foofoo [bar<$text bold="true">bar</$text>] bazbaz'.
  33073. const nextNode = isForward ? walker.position.nodeAfter : walker.position.nodeBefore;
  33074. // Scan only text nodes. Ignore inline elements (like `<softBreak>`).
  33075. if ( nextNode && nextNode.is( '$text' ) ) {
  33076. // Check boundary char of an adjacent text node.
  33077. const boundaryChar = nextNode.data.charAt( isForward ? 0 : nextNode.data.length - 1 );
  33078. // Go to the next node if the character at the boundary of that node belongs to the same word.
  33079. if ( !wordBoundaryCharacters.includes( boundaryChar ) ) {
  33080. // If adjacent text node belongs to the same word go to it & reset values.
  33081. walker.next();
  33082. textNode = walker.position.textNode;
  33083. }
  33084. }
  33085. offset = walker.position.offset - textNode.startOffset;
  33086. }
  33087. }
  33088. return walker.position;
  33089. }
  33090. function getSearchRange( start, isForward ) {
  33091. const root = start.root;
  33092. const searchEnd = _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createAt( root, isForward ? 'end' : 0 );
  33093. if ( isForward ) {
  33094. return new _range__WEBPACK_IMPORTED_MODULE_2__["default"]( start, searchEnd );
  33095. } else {
  33096. return new _range__WEBPACK_IMPORTED_MODULE_2__["default"]( searchEnd, start );
  33097. }
  33098. }
  33099. // Checks if selection is on word boundary.
  33100. //
  33101. // @param {String} data The text node value to investigate.
  33102. // @param {Number} offset Position offset.
  33103. // @param {Boolean} isForward Is the direction in which the selection should be modified is forward.
  33104. function isAtWordBoundary( data, offset, isForward ) {
  33105. // The offset to check depends on direction.
  33106. const offsetToCheck = offset + ( isForward ? 0 : -1 );
  33107. return wordBoundaryCharacters.includes( data.charAt( offsetToCheck ) );
  33108. }
  33109. // Checks if selection is on node boundary.
  33110. //
  33111. // @param {module:engine/model/text~Text} textNode The text node to investigate.
  33112. // @param {Number} offset Position offset.
  33113. // @param {Boolean} isForward Is the direction in which the selection should be modified is forward.
  33114. function isAtNodeBoundary( textNode, offset, isForward ) {
  33115. return offset === ( isForward ? textNode.endOffset : 0 );
  33116. }
  33117. /***/ }),
  33118. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/utils/selection-post-fixer.js":
  33119. /*!*****************************************************************************************!*\
  33120. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/utils/selection-post-fixer.js ***!
  33121. \*****************************************************************************************/
  33122. /*! exports provided: injectSelectionPostFixer */
  33123. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  33124. "use strict";
  33125. __webpack_require__.r(__webpack_exports__);
  33126. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "injectSelectionPostFixer", function() { return injectSelectionPostFixer; });
  33127. /* harmony import */ var _range__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../range */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/range.js");
  33128. /* harmony import */ var _position__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../position */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/position.js");
  33129. /**
  33130. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  33131. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  33132. */
  33133. /**
  33134. * @module engine/model/utils/selection-post-fixer
  33135. */
  33136. /**
  33137. * Injects selection post-fixer to the model.
  33138. *
  33139. * The role of the selection post-fixer is to ensure that the selection is in a correct place
  33140. * after a {@link module:engine/model/model~Model#change `change()`} block was executed.
  33141. *
  33142. * The correct position means that:
  33143. *
  33144. * * All collapsed selection ranges are in a place where the {@link module:engine/model/schema~Schema}
  33145. * allows a `$text`.
  33146. * * None of the selection's non-collapsed ranges crosses a {@link module:engine/model/schema~Schema#isLimit limit element}
  33147. * boundary (a range must be rooted within one limit element).
  33148. * * Only {@link module:engine/model/schema~Schema#isSelectable selectable elements} can be selected from the outside
  33149. * (e.g. `[<paragraph>foo</paragraph>]` is invalid). This rule applies independently to both selection ends, so this
  33150. * selection is correct: `<paragraph>f[oo</paragraph><image></image>]`.
  33151. *
  33152. * If the position is not correct, the post-fixer will automatically correct it.
  33153. *
  33154. * ## Fixing a non-collapsed selection
  33155. *
  33156. * See as an example a selection that starts in a P1 element and ends inside the text of a TD element
  33157. * (`[` and `]` are range boundaries and `(l)` denotes an element defined as `isLimit=true`):
  33158. *
  33159. * root
  33160. * |- element P1
  33161. * | |- "foo" root
  33162. * |- element TABLE (l) P1 TABLE P2
  33163. * | |- element TR (l) f o[o TR TR b a r
  33164. * | | |- element TD (l) TD TD
  33165. * | | |- "aaa" a]a a b b b
  33166. * | |- element TR (l)
  33167. * | | |- element TD (l) ||
  33168. * | | |- "bbb" ||
  33169. * |- element P2 VV
  33170. * | |- "bar"
  33171. * root
  33172. * P1 TABLE] P2
  33173. * f o[o TR TR b a r
  33174. * TD TD
  33175. * a a a b b b
  33176. *
  33177. * In the example above, the TABLE, TR and TD are defined as `isLimit=true` in the schema. The range which is not contained within
  33178. * 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.
  33179. * 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
  33180. * expanded to select the whole TABLE element.
  33181. *
  33182. * **Note** If the selection contains multiple ranges, the method returns a minimal set of ranges that are not intersecting after expanding
  33183. * them to select `isLimit=true` elements.
  33184. *
  33185. * @param {module:engine/model/model~Model} model
  33186. */
  33187. function injectSelectionPostFixer( model ) {
  33188. model.document.registerPostFixer( writer => selectionPostFixer( writer, model ) );
  33189. }
  33190. // The selection post-fixer.
  33191. //
  33192. // @param {module:engine/model/writer~Writer} writer
  33193. // @param {module:engine/model/model~Model} model
  33194. function selectionPostFixer( writer, model ) {
  33195. const selection = model.document.selection;
  33196. const schema = model.schema;
  33197. const ranges = [];
  33198. let wasFixed = false;
  33199. for ( const modelRange of selection.getRanges() ) {
  33200. // Go through all ranges in selection and try fixing each of them.
  33201. // Those ranges might overlap but will be corrected later.
  33202. const correctedRange = tryFixingRange( modelRange, schema );
  33203. // "Selection fixing" algorithms sometimes get lost. In consequence, it may happen
  33204. // that a new range is returned but, in fact, it has the same positions as the original
  33205. // range anyway. If this range is not discarded, a new selection will be set and that,
  33206. // for instance, would destroy the selection attributes. Let's make sure that the post-fixer
  33207. // actually worked first before setting a new selection.
  33208. //
  33209. // https://github.com/ckeditor/ckeditor5/issues/6693
  33210. if ( correctedRange && !correctedRange.isEqual( modelRange ) ) {
  33211. ranges.push( correctedRange );
  33212. wasFixed = true;
  33213. } else {
  33214. ranges.push( modelRange );
  33215. }
  33216. }
  33217. // If any of ranges were corrected update the selection.
  33218. if ( wasFixed ) {
  33219. writer.setSelection( mergeIntersectingRanges( ranges ), { backward: selection.isBackward } );
  33220. }
  33221. }
  33222. // Tries fixing a range if it's incorrect.
  33223. //
  33224. // @param {module:engine/model/range~Range} range
  33225. // @param {module:engine/model/schema~Schema} schema
  33226. // @returns {module:engine/model/range~Range|null} Returns fixed range or null if range is valid.
  33227. function tryFixingRange( range, schema ) {
  33228. if ( range.isCollapsed ) {
  33229. return tryFixingCollapsedRange( range, schema );
  33230. }
  33231. return tryFixingNonCollapsedRage( range, schema );
  33232. }
  33233. // Tries to fix collapsed ranges.
  33234. //
  33235. // * Fixes situation when a range is in a place where $text is not allowed
  33236. //
  33237. // @param {module:engine/model/range~Range} range Collapsed range to fix.
  33238. // @param {module:engine/model/schema~Schema} schema
  33239. // @returns {module:engine/model/range~Range|null} Returns fixed range or null if range is valid.
  33240. function tryFixingCollapsedRange( range, schema ) {
  33241. const originalPosition = range.start;
  33242. const nearestSelectionRange = schema.getNearestSelectionRange( originalPosition );
  33243. // This might be null ie when editor data is empty.
  33244. // In such cases there is no need to fix the selection range.
  33245. if ( !nearestSelectionRange ) {
  33246. return null;
  33247. }
  33248. if ( !nearestSelectionRange.isCollapsed ) {
  33249. return nearestSelectionRange;
  33250. }
  33251. const fixedPosition = nearestSelectionRange.start;
  33252. // Fixed position is the same as original - no need to return corrected range.
  33253. if ( originalPosition.isEqual( fixedPosition ) ) {
  33254. return null;
  33255. }
  33256. return new _range__WEBPACK_IMPORTED_MODULE_0__["default"]( fixedPosition );
  33257. }
  33258. // Tries to fix an expanded range.
  33259. //
  33260. // @param {module:engine/model/range~Range} range Expanded range to fix.
  33261. // @param {module:engine/model/schema~Schema} schema
  33262. // @returns {module:engine/model/range~Range|null} Returns fixed range or null if range is valid.
  33263. function tryFixingNonCollapsedRage( range, schema ) {
  33264. const { start, end } = range;
  33265. const isTextAllowedOnStart = schema.checkChild( start, '$text' );
  33266. const isTextAllowedOnEnd = schema.checkChild( end, '$text' );
  33267. const startLimitElement = schema.getLimitElement( start );
  33268. const endLimitElement = schema.getLimitElement( end );
  33269. // Ranges which both end are inside the same limit element (or root) might needs only minor fix.
  33270. if ( startLimitElement === endLimitElement ) {
  33271. // Range is valid when both position allows to place a text:
  33272. // - <block>f[oobarba]z</block>
  33273. // 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.
  33274. if ( isTextAllowedOnStart && isTextAllowedOnEnd ) {
  33275. return null;
  33276. }
  33277. // Range that is on non-limit element (or is partially) must be fixed so it is placed inside the block around $text:
  33278. // - [<block>foo</block>] -> <block>[foo]</block>
  33279. // - [<block>foo]</block> -> <block>[foo]</block>
  33280. // - <block>f[oo</block>] -> <block>f[oo]</block>
  33281. // - [<block>foo</block><selectable></selectable>] -> <block>[foo</block><selectable></selectable>]
  33282. if ( checkSelectionOnNonLimitElements( start, end, schema ) ) {
  33283. const isStartBeforeSelectable = start.nodeAfter && schema.isSelectable( start.nodeAfter );
  33284. const fixedStart = isStartBeforeSelectable ? null : schema.getNearestSelectionRange( start, 'forward' );
  33285. const isEndAfterSelectable = end.nodeBefore && schema.isSelectable( end.nodeBefore );
  33286. const fixedEnd = isEndAfterSelectable ? null : schema.getNearestSelectionRange( end, 'backward' );
  33287. // The schema.getNearestSelectionRange might return null - if that happens use original position.
  33288. const rangeStart = fixedStart ? fixedStart.start : start;
  33289. const rangeEnd = fixedEnd ? fixedEnd.end : end;
  33290. return new _range__WEBPACK_IMPORTED_MODULE_0__["default"]( rangeStart, rangeEnd );
  33291. }
  33292. }
  33293. const isStartInLimit = startLimitElement && !startLimitElement.is( 'rootElement' );
  33294. const isEndInLimit = endLimitElement && !endLimitElement.is( 'rootElement' );
  33295. // At this point we eliminated valid positions on text nodes so if one of range positions is placed inside a limit element
  33296. // then the range crossed limit element boundaries and needs to be fixed.
  33297. if ( isStartInLimit || isEndInLimit ) {
  33298. const bothInSameParent = ( start.nodeAfter && end.nodeBefore ) && start.nodeAfter.parent === end.nodeBefore.parent;
  33299. const expandStart = isStartInLimit && ( !bothInSameParent || !isSelectable( start.nodeAfter, schema ) );
  33300. const expandEnd = isEndInLimit && ( !bothInSameParent || !isSelectable( end.nodeBefore, schema ) );
  33301. // Although we've already found limit element on start/end positions we must find the outer-most limit element.
  33302. // as limit elements might be nested directly inside (ie table > tableRow > tableCell).
  33303. let fixedStart = start;
  33304. let fixedEnd = end;
  33305. if ( expandStart ) {
  33306. fixedStart = _position__WEBPACK_IMPORTED_MODULE_1__["default"]._createBefore( findOutermostLimitAncestor( startLimitElement, schema ) );
  33307. }
  33308. if ( expandEnd ) {
  33309. fixedEnd = _position__WEBPACK_IMPORTED_MODULE_1__["default"]._createAfter( findOutermostLimitAncestor( endLimitElement, schema ) );
  33310. }
  33311. return new _range__WEBPACK_IMPORTED_MODULE_0__["default"]( fixedStart, fixedEnd );
  33312. }
  33313. // Range was not fixed at this point so it is valid - ie it was placed around limit element already.
  33314. return null;
  33315. }
  33316. // Finds the outer-most ancestor.
  33317. //
  33318. // @param {module:engine/model/node~Node} startingNode
  33319. // @param {module:engine/model/schema~Schema} schema
  33320. // @param {String} expandToDirection Direction of expansion - either 'start' or 'end' of the range.
  33321. // @returns {module:engine/model/node~Node}
  33322. function findOutermostLimitAncestor( startingNode, schema ) {
  33323. let isLimitNode = startingNode;
  33324. let parent = isLimitNode;
  33325. // Find outer most isLimit block as such blocks might be nested (ie. in tables).
  33326. while ( schema.isLimit( parent ) && parent.parent ) {
  33327. isLimitNode = parent;
  33328. parent = parent.parent;
  33329. }
  33330. return isLimitNode;
  33331. }
  33332. // Checks whether any of range boundaries is placed around non-limit elements.
  33333. //
  33334. // @param {module:engine/model/position~Position} start
  33335. // @param {module:engine/model/position~Position} end
  33336. // @param {module:engine/model/schema~Schema} schema
  33337. // @returns {Boolean}
  33338. function checkSelectionOnNonLimitElements( start, end, schema ) {
  33339. const startIsOnBlock = ( start.nodeAfter && !schema.isLimit( start.nodeAfter ) ) || schema.checkChild( start, '$text' );
  33340. const endIsOnBlock = ( end.nodeBefore && !schema.isLimit( end.nodeBefore ) ) || schema.checkChild( end, '$text' );
  33341. // We should fix such selection when one of those nodes needs fixing.
  33342. return startIsOnBlock || endIsOnBlock;
  33343. }
  33344. // Returns a minimal non-intersecting array of ranges.
  33345. //
  33346. // @param {Array.<module:engine/model/range~Range>} ranges
  33347. // @returns {Array.<module:engine/model/range~Range>}
  33348. function mergeIntersectingRanges( ranges ) {
  33349. const nonIntersectingRanges = [];
  33350. // First range will always be fine.
  33351. nonIntersectingRanges.push( ranges.shift() );
  33352. for ( const range of ranges ) {
  33353. const previousRange = nonIntersectingRanges.pop();
  33354. if ( range.isEqual( previousRange ) ) {
  33355. // Use only one of two identical ranges.
  33356. nonIntersectingRanges.push( previousRange );
  33357. } else if ( range.isIntersecting( previousRange ) ) {
  33358. // Get the sum of two ranges.
  33359. const start = previousRange.start.isAfter( range.start ) ? range.start : previousRange.start;
  33360. const end = previousRange.end.isAfter( range.end ) ? previousRange.end : range.end;
  33361. const merged = new _range__WEBPACK_IMPORTED_MODULE_0__["default"]( start, end );
  33362. nonIntersectingRanges.push( merged );
  33363. } else {
  33364. nonIntersectingRanges.push( previousRange );
  33365. nonIntersectingRanges.push( range );
  33366. }
  33367. }
  33368. return nonIntersectingRanges;
  33369. }
  33370. // Checks if node exists and if it's a selectable.
  33371. //
  33372. // @param {module:engine/model/node~Node} node
  33373. // @param {module:engine/model/schema~Schema} schema
  33374. // @returns {Boolean}
  33375. function isSelectable( node, schema ) {
  33376. return node && schema.isSelectable( node );
  33377. }
  33378. /***/ }),
  33379. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/writer.js":
  33380. /*!*********************************************************************!*\
  33381. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/writer.js ***!
  33382. \*********************************************************************/
  33383. /*! exports provided: default */
  33384. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  33385. "use strict";
  33386. __webpack_require__.r(__webpack_exports__);
  33387. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Writer; });
  33388. /* harmony import */ var _operation_attributeoperation__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./operation/attributeoperation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/attributeoperation.js");
  33389. /* harmony import */ var _operation_detachoperation__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./operation/detachoperation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/detachoperation.js");
  33390. /* harmony import */ var _operation_insertoperation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./operation/insertoperation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/insertoperation.js");
  33391. /* harmony import */ var _operation_markeroperation__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./operation/markeroperation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/markeroperation.js");
  33392. /* harmony import */ var _operation_moveoperation__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./operation/moveoperation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/moveoperation.js");
  33393. /* harmony import */ var _operation_renameoperation__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./operation/renameoperation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/renameoperation.js");
  33394. /* harmony import */ var _operation_rootattributeoperation__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./operation/rootattributeoperation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/rootattributeoperation.js");
  33395. /* harmony import */ var _operation_splitoperation__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./operation/splitoperation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/splitoperation.js");
  33396. /* harmony import */ var _operation_mergeoperation__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./operation/mergeoperation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/mergeoperation.js");
  33397. /* harmony import */ var _documentfragment__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./documentfragment */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/documentfragment.js");
  33398. /* harmony import */ var _text__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./text */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/text.js");
  33399. /* harmony import */ var _element__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./element */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/element.js");
  33400. /* harmony import */ var _rootelement__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./rootelement */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/rootelement.js");
  33401. /* harmony import */ var _position__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./position */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/position.js");
  33402. /* harmony import */ var _range_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./range.js */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/range.js");
  33403. /* harmony import */ var _documentselection__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./documentselection */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/documentselection.js");
  33404. /* 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");
  33405. /* 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");
  33406. /**
  33407. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  33408. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  33409. */
  33410. /**
  33411. * @module engine/model/writer
  33412. */
  33413. /**
  33414. * The model can only be modified by using the writer. It should be used whenever you want to create a node, modify
  33415. * child nodes, attributes or text, set the selection's position and its attributes.
  33416. *
  33417. * The instance of the writer is only available in the {@link module:engine/model/model~Model#change `change()`} or
  33418. * {@link module:engine/model/model~Model#enqueueChange `enqueueChange()`}.
  33419. *
  33420. * model.change( writer => {
  33421. * writer.insertText( 'foo', paragraph, 'end' );
  33422. * } );
  33423. *
  33424. * Note that the writer should never be stored and used outside of the `change()` and
  33425. * `enqueueChange()` blocks.
  33426. *
  33427. * Note that writer's methods do not check the {@link module:engine/model/schema~Schema}. It is possible
  33428. * to create incorrect model structures by using the writer. Read more about in
  33429. * {@glink framework/guides/deep-dive/schema#who-checks-the-schema "Who checks the schema?"}.
  33430. *
  33431. * @see module:engine/model/model~Model#change
  33432. * @see module:engine/model/model~Model#enqueueChange
  33433. */
  33434. class Writer {
  33435. /**
  33436. * Creates a writer instance.
  33437. *
  33438. * **Note:** It is not recommended to use it directly. Use {@link module:engine/model/model~Model#change `Model#change()`} or
  33439. * {@link module:engine/model/model~Model#enqueueChange `Model#enqueueChange()`} instead.
  33440. *
  33441. * @protected
  33442. * @param {module:engine/model/model~Model} model
  33443. * @param {module:engine/model/batch~Batch} batch
  33444. */
  33445. constructor( model, batch ) {
  33446. /**
  33447. * Instance of the model on which this writer operates.
  33448. *
  33449. * @readonly
  33450. * @type {module:engine/model/model~Model}
  33451. */
  33452. this.model = model;
  33453. /**
  33454. * The batch to which this writer will add changes.
  33455. *
  33456. * @readonly
  33457. * @type {module:engine/model/batch~Batch}
  33458. */
  33459. this.batch = batch;
  33460. }
  33461. /**
  33462. * Creates a new {@link module:engine/model/text~Text text node}.
  33463. *
  33464. * writer.createText( 'foo' );
  33465. * writer.createText( 'foo', { bold: true } );
  33466. *
  33467. * @param {String} data Text data.
  33468. * @param {Object} [attributes] Text attributes.
  33469. * @returns {module:engine/model/text~Text} Created text node.
  33470. */
  33471. createText( data, attributes ) {
  33472. return new _text__WEBPACK_IMPORTED_MODULE_10__["default"]( data, attributes );
  33473. }
  33474. /**
  33475. * Creates a new {@link module:engine/model/element~Element element}.
  33476. *
  33477. * writer.createElement( 'paragraph' );
  33478. * writer.createElement( 'paragraph', { alignment: 'center' } );
  33479. *
  33480. * @param {String} name Name of the element.
  33481. * @param {Object} [attributes] Elements attributes.
  33482. * @returns {module:engine/model/element~Element} Created element.
  33483. */
  33484. createElement( name, attributes ) {
  33485. return new _element__WEBPACK_IMPORTED_MODULE_11__["default"]( name, attributes );
  33486. }
  33487. /**
  33488. * Creates a new {@link module:engine/model/documentfragment~DocumentFragment document fragment}.
  33489. *
  33490. * @returns {module:engine/model/documentfragment~DocumentFragment} Created document fragment.
  33491. */
  33492. createDocumentFragment() {
  33493. return new _documentfragment__WEBPACK_IMPORTED_MODULE_9__["default"]();
  33494. }
  33495. /**
  33496. * Creates a copy of the element and returns it. Created element has the same name and attributes as the original element.
  33497. * If clone is deep, the original element's children are also cloned. If not, then empty element is returned.
  33498. *
  33499. * @param {module:engine/model/element~Element} element The element to clone.
  33500. * @param {Boolean} [deep=true] If set to `true` clones element and all its children recursively. When set to `false`,
  33501. * element will be cloned without any child.
  33502. */
  33503. cloneElement( element, deep = true ) {
  33504. return element._clone( deep );
  33505. }
  33506. /**
  33507. * Inserts item on given position.
  33508. *
  33509. * const paragraph = writer.createElement( 'paragraph' );
  33510. * writer.insert( paragraph, position );
  33511. *
  33512. * Instead of using position you can use parent and offset:
  33513. *
  33514. * const text = writer.createText( 'foo' );
  33515. * writer.insert( text, paragraph, 5 );
  33516. *
  33517. * You can also use `end` instead of the offset to insert at the end:
  33518. *
  33519. * const text = writer.createText( 'foo' );
  33520. * writer.insert( text, paragraph, 'end' );
  33521. *
  33522. * Or insert before or after another element:
  33523. *
  33524. * const paragraph = writer.createElement( 'paragraph' );
  33525. * writer.insert( paragraph, anotherParagraph, 'after' );
  33526. *
  33527. * These parameters works the same way as {@link #createPositionAt `writer.createPositionAt()`}.
  33528. *
  33529. * Note that if the item already has parent it will be removed from the previous parent.
  33530. *
  33531. * Note that you cannot re-insert a node from a document to a different document or a document fragment. In this case,
  33532. * `model-writer-insert-forbidden-move` is thrown.
  33533. *
  33534. * If you want to move {@link module:engine/model/range~Range range} instead of an
  33535. * {@link module:engine/model/item~Item item} use {@link module:engine/model/writer~Writer#move `Writer#move()`}.
  33536. *
  33537. * **Note:** For a paste-like content insertion mechanism see
  33538. * {@link module:engine/model/model~Model#insertContent `model.insertContent()`}.
  33539. *
  33540. * @param {module:engine/model/item~Item|module:engine/model/documentfragment~DocumentFragment} item Item or document
  33541. * fragment to insert.
  33542. * @param {module:engine/model/item~Item|module:engine/model/position~Position} itemOrPosition
  33543. * @param {Number|'end'|'before'|'after'} [offset] Offset or one of the flags. Used only when
  33544. * second parameter is a {@link module:engine/model/item~Item model item}.
  33545. */
  33546. insert( item, itemOrPosition, offset = 0 ) {
  33547. this._assertWriterUsedCorrectly();
  33548. if ( item instanceof _text__WEBPACK_IMPORTED_MODULE_10__["default"] && item.data == '' ) {
  33549. return;
  33550. }
  33551. const position = _position__WEBPACK_IMPORTED_MODULE_13__["default"]._createAt( itemOrPosition, offset );
  33552. // If item has a parent already.
  33553. if ( item.parent ) {
  33554. // We need to check if item is going to be inserted within the same document.
  33555. if ( isSameTree( item.root, position.root ) ) {
  33556. // If it's we just need to move it.
  33557. this.move( _range_js__WEBPACK_IMPORTED_MODULE_14__["default"]._createOn( item ), position );
  33558. return;
  33559. }
  33560. // If it isn't the same root.
  33561. else {
  33562. if ( item.root.document ) {
  33563. /**
  33564. * Cannot move a node from a document to a different tree.
  33565. * It is forbidden to move a node that was already in a document outside of it.
  33566. *
  33567. * @error model-writer-insert-forbidden-move
  33568. */
  33569. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_17__["default"](
  33570. 'model-writer-insert-forbidden-move',
  33571. this
  33572. );
  33573. } else {
  33574. // Move between two different document fragments or from document fragment to a document is possible.
  33575. // In that case, remove the item from it's original parent.
  33576. this.remove( item );
  33577. }
  33578. }
  33579. }
  33580. const version = position.root.document ? position.root.document.version : null;
  33581. const insert = new _operation_insertoperation__WEBPACK_IMPORTED_MODULE_2__["default"]( position, item, version );
  33582. if ( item instanceof _text__WEBPACK_IMPORTED_MODULE_10__["default"] ) {
  33583. insert.shouldReceiveAttributes = true;
  33584. }
  33585. this.batch.addOperation( insert );
  33586. this.model.applyOperation( insert );
  33587. // When element is a DocumentFragment we need to move its markers to Document#markers.
  33588. if ( item instanceof _documentfragment__WEBPACK_IMPORTED_MODULE_9__["default"] ) {
  33589. for ( const [ markerName, markerRange ] of item.markers ) {
  33590. // We need to migrate marker range from DocumentFragment to Document.
  33591. const rangeRootPosition = _position__WEBPACK_IMPORTED_MODULE_13__["default"]._createAt( markerRange.root, 0 );
  33592. const range = new _range_js__WEBPACK_IMPORTED_MODULE_14__["default"](
  33593. markerRange.start._getCombined( rangeRootPosition, position ),
  33594. markerRange.end._getCombined( rangeRootPosition, position )
  33595. );
  33596. const options = { range, usingOperation: true, affectsData: true };
  33597. if ( this.model.markers.has( markerName ) ) {
  33598. this.updateMarker( markerName, options );
  33599. } else {
  33600. this.addMarker( markerName, options );
  33601. }
  33602. }
  33603. }
  33604. }
  33605. /**
  33606. * Creates and inserts text on given position. You can optionally set text attributes:
  33607. *
  33608. * writer.insertText( 'foo', position );
  33609. * writer.insertText( 'foo', { bold: true }, position );
  33610. *
  33611. * Instead of using position you can use parent and offset or define that text should be inserted at the end
  33612. * or before or after other node:
  33613. *
  33614. * // Inserts 'foo' in paragraph, at offset 5:
  33615. * writer.insertText( 'foo', paragraph, 5 );
  33616. * // Inserts 'foo' at the end of a paragraph:
  33617. * writer.insertText( 'foo', paragraph, 'end' );
  33618. * // Inserts 'foo' after an image:
  33619. * writer.insertText( 'foo', image, 'after' );
  33620. *
  33621. * These parameters work in the same way as {@link #createPositionAt `writer.createPositionAt()`}.
  33622. *
  33623. * @param {String} data Text data.
  33624. * @param {Object} [attributes] Text attributes.
  33625. * @param {module:engine/model/item~Item|module:engine/model/position~Position} itemOrPosition
  33626. * @param {Number|'end'|'before'|'after'} [offset] Offset or one of the flags. Used only when
  33627. * third parameter is a {@link module:engine/model/item~Item model item}.
  33628. */
  33629. insertText( text, attributes, itemOrPosition, offset ) {
  33630. 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"] ) {
  33631. this.insert( this.createText( text ), attributes, itemOrPosition );
  33632. } else {
  33633. this.insert( this.createText( text, attributes ), itemOrPosition, offset );
  33634. }
  33635. }
  33636. /**
  33637. * Creates and inserts element on given position. You can optionally set attributes:
  33638. *
  33639. * writer.insertElement( 'paragraph', position );
  33640. * writer.insertElement( 'paragraph', { alignment: 'center' }, position );
  33641. *
  33642. * Instead of using position you can use parent and offset or define that text should be inserted at the end
  33643. * or before or after other node:
  33644. *
  33645. * // Inserts paragraph in the root at offset 5:
  33646. * writer.insertElement( 'paragraph', root, 5 );
  33647. * // Inserts paragraph at the end of a blockquote:
  33648. * writer.insertElement( 'paragraph', blockquote, 'end' );
  33649. * // Inserts after an image:
  33650. * writer.insertElement( 'paragraph', image, 'after' );
  33651. *
  33652. * These parameters works the same way as {@link #createPositionAt `writer.createPositionAt()`}.
  33653. *
  33654. * @param {String} name Name of the element.
  33655. * @param {Object} [attributes] Elements attributes.
  33656. * @param {module:engine/model/item~Item|module:engine/model/position~Position} itemOrPosition
  33657. * @param {Number|'end'|'before'|'after'} [offset] Offset or one of the flags. Used only when
  33658. * third parameter is a {@link module:engine/model/item~Item model item}.
  33659. */
  33660. insertElement( name, attributes, itemOrPosition, offset ) {
  33661. 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"] ) {
  33662. this.insert( this.createElement( name ), attributes, itemOrPosition );
  33663. } else {
  33664. this.insert( this.createElement( name, attributes ), itemOrPosition, offset );
  33665. }
  33666. }
  33667. /**
  33668. * Inserts item at the end of the given parent.
  33669. *
  33670. * const paragraph = writer.createElement( 'paragraph' );
  33671. * writer.append( paragraph, root );
  33672. *
  33673. * Note that if the item already has parent it will be removed from the previous parent.
  33674. *
  33675. * If you want to move {@link module:engine/model/range~Range range} instead of an
  33676. * {@link module:engine/model/item~Item item} use {@link module:engine/model/writer~Writer#move `Writer#move()`}.
  33677. *
  33678. * @param {module:engine/model/item~Item|module:engine/model/documentfragment~DocumentFragment}
  33679. * item Item or document fragment to insert.
  33680. * @param {module:engine/model/element~Element|module:engine/model/documentfragment~DocumentFragment} parent
  33681. */
  33682. append( item, parent ) {
  33683. this.insert( item, parent, 'end' );
  33684. }
  33685. /**
  33686. * Creates text node and inserts it at the end of the parent. You can optionally set text attributes:
  33687. *
  33688. * writer.appendText( 'foo', paragraph );
  33689. * writer.appendText( 'foo', { bold: true }, paragraph );
  33690. *
  33691. * @param {String} text Text data.
  33692. * @param {Object} [attributes] Text attributes.
  33693. * @param {module:engine/model/element~Element|module:engine/model/documentfragment~DocumentFragment} parent
  33694. */
  33695. appendText( text, attributes, parent ) {
  33696. if ( attributes instanceof _documentfragment__WEBPACK_IMPORTED_MODULE_9__["default"] || attributes instanceof _element__WEBPACK_IMPORTED_MODULE_11__["default"] ) {
  33697. this.insert( this.createText( text ), attributes, 'end' );
  33698. } else {
  33699. this.insert( this.createText( text, attributes ), parent, 'end' );
  33700. }
  33701. }
  33702. /**
  33703. * Creates element and inserts it at the end of the parent. You can optionally set attributes:
  33704. *
  33705. * writer.appendElement( 'paragraph', root );
  33706. * writer.appendElement( 'paragraph', { alignment: 'center' }, root );
  33707. *
  33708. * @param {String} name Name of the element.
  33709. * @param {Object} [attributes] Elements attributes.
  33710. * @param {module:engine/model/element~Element|module:engine/model/documentfragment~DocumentFragment} parent
  33711. */
  33712. appendElement( name, attributes, parent ) {
  33713. if ( attributes instanceof _documentfragment__WEBPACK_IMPORTED_MODULE_9__["default"] || attributes instanceof _element__WEBPACK_IMPORTED_MODULE_11__["default"] ) {
  33714. this.insert( this.createElement( name ), attributes, 'end' );
  33715. } else {
  33716. this.insert( this.createElement( name, attributes ), parent, 'end' );
  33717. }
  33718. }
  33719. /**
  33720. * Sets value of the attribute with given key on a {@link module:engine/model/item~Item model item}
  33721. * or on a {@link module:engine/model/range~Range range}.
  33722. *
  33723. * @param {String} key Attribute key.
  33724. * @param {*} value Attribute new value.
  33725. * @param {module:engine/model/item~Item|module:engine/model/range~Range} itemOrRange
  33726. * Model item or range on which the attribute will be set.
  33727. */
  33728. setAttribute( key, value, itemOrRange ) {
  33729. this._assertWriterUsedCorrectly();
  33730. if ( itemOrRange instanceof _range_js__WEBPACK_IMPORTED_MODULE_14__["default"] ) {
  33731. const ranges = itemOrRange.getMinimalFlatRanges();
  33732. for ( const range of ranges ) {
  33733. setAttributeOnRange( this, key, value, range );
  33734. }
  33735. } else {
  33736. setAttributeOnItem( this, key, value, itemOrRange );
  33737. }
  33738. }
  33739. /**
  33740. * Sets values of attributes on a {@link module:engine/model/item~Item model item}
  33741. * or on a {@link module:engine/model/range~Range range}.
  33742. *
  33743. * writer.setAttributes( {
  33744. * bold: true,
  33745. * italic: true
  33746. * }, range );
  33747. *
  33748. * @param {Object} attributes Attributes keys and values.
  33749. * @param {module:engine/model/item~Item|module:engine/model/range~Range} itemOrRange
  33750. * Model item or range on which the attributes will be set.
  33751. */
  33752. setAttributes( attributes, itemOrRange ) {
  33753. for ( const [ key, val ] of Object(_ckeditor_ckeditor5_utils_src_tomap__WEBPACK_IMPORTED_MODULE_16__["default"])( attributes ) ) {
  33754. this.setAttribute( key, val, itemOrRange );
  33755. }
  33756. }
  33757. /**
  33758. * Removes an attribute with given key from a {@link module:engine/model/item~Item model item}
  33759. * or from a {@link module:engine/model/range~Range range}.
  33760. *
  33761. * @param {String} key Attribute key.
  33762. * @param {module:engine/model/item~Item|module:engine/model/range~Range} itemOrRange
  33763. * Model item or range from which the attribute will be removed.
  33764. */
  33765. removeAttribute( key, itemOrRange ) {
  33766. this._assertWriterUsedCorrectly();
  33767. if ( itemOrRange instanceof _range_js__WEBPACK_IMPORTED_MODULE_14__["default"] ) {
  33768. const ranges = itemOrRange.getMinimalFlatRanges();
  33769. for ( const range of ranges ) {
  33770. setAttributeOnRange( this, key, null, range );
  33771. }
  33772. } else {
  33773. setAttributeOnItem( this, key, null, itemOrRange );
  33774. }
  33775. }
  33776. /**
  33777. * Removes all attributes from all elements in the range or from the given item.
  33778. *
  33779. * @param {module:engine/model/item~Item|module:engine/model/range~Range} itemOrRange
  33780. * Model item or range from which all attributes will be removed.
  33781. */
  33782. clearAttributes( itemOrRange ) {
  33783. this._assertWriterUsedCorrectly();
  33784. const removeAttributesFromItem = item => {
  33785. for ( const attribute of item.getAttributeKeys() ) {
  33786. this.removeAttribute( attribute, item );
  33787. }
  33788. };
  33789. if ( !( itemOrRange instanceof _range_js__WEBPACK_IMPORTED_MODULE_14__["default"] ) ) {
  33790. removeAttributesFromItem( itemOrRange );
  33791. } else {
  33792. for ( const item of itemOrRange.getItems() ) {
  33793. removeAttributesFromItem( item );
  33794. }
  33795. }
  33796. }
  33797. /**
  33798. * Moves all items in the source range to the target position.
  33799. *
  33800. * writer.move( sourceRange, targetPosition );
  33801. *
  33802. * Instead of the target position you can use parent and offset or define that range should be moved to the end
  33803. * or before or after chosen item:
  33804. *
  33805. * // Moves all items in the range to the paragraph at offset 5:
  33806. * writer.move( sourceRange, paragraph, 5 );
  33807. * // Moves all items in the range to the end of a blockquote:
  33808. * writer.move( sourceRange, blockquote, 'end' );
  33809. * // Moves all items in the range to a position after an image:
  33810. * writer.move( sourceRange, image, 'after' );
  33811. *
  33812. * These parameters works the same way as {@link #createPositionAt `writer.createPositionAt()`}.
  33813. *
  33814. * Note that items can be moved only within the same tree. It means that you can move items within the same root
  33815. * (element or document fragment) or between {@link module:engine/model/document~Document#roots documents roots},
  33816. * but you can not move items from document fragment to the document or from one detached element to another. Use
  33817. * {@link module:engine/model/writer~Writer#insert} in such cases.
  33818. *
  33819. * @param {module:engine/model/range~Range} range Source range.
  33820. * @param {module:engine/model/item~Item|module:engine/model/position~Position} itemOrPosition
  33821. * @param {Number|'end'|'before'|'after'} [offset] Offset or one of the flags. Used only when
  33822. * second parameter is a {@link module:engine/model/item~Item model item}.
  33823. */
  33824. move( range, itemOrPosition, offset ) {
  33825. this._assertWriterUsedCorrectly();
  33826. if ( !( range instanceof _range_js__WEBPACK_IMPORTED_MODULE_14__["default"] ) ) {
  33827. /**
  33828. * Invalid range to move.
  33829. *
  33830. * @error writer-move-invalid-range
  33831. */
  33832. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_17__["default"]( 'writer-move-invalid-range', this );
  33833. }
  33834. if ( !range.isFlat ) {
  33835. /**
  33836. * Range to move is not flat.
  33837. *
  33838. * @error writer-move-range-not-flat
  33839. */
  33840. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_17__["default"]( 'writer-move-range-not-flat', this );
  33841. }
  33842. const position = _position__WEBPACK_IMPORTED_MODULE_13__["default"]._createAt( itemOrPosition, offset );
  33843. // Do not move anything if the move target is same as moved range start.
  33844. if ( position.isEqual( range.start ) ) {
  33845. return;
  33846. }
  33847. // If part of the marker is removed, create additional marker operation for undo purposes.
  33848. this._addOperationForAffectedMarkers( 'move', range );
  33849. if ( !isSameTree( range.root, position.root ) ) {
  33850. /**
  33851. * Range is going to be moved within not the same document. Please use
  33852. * {@link module:engine/model/writer~Writer#insert insert} instead.
  33853. *
  33854. * @error writer-move-different-document
  33855. */
  33856. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_17__["default"]( 'writer-move-different-document', this );
  33857. }
  33858. const version = range.root.document ? range.root.document.version : null;
  33859. const operation = new _operation_moveoperation__WEBPACK_IMPORTED_MODULE_4__["default"]( range.start, range.end.offset - range.start.offset, position, version );
  33860. this.batch.addOperation( operation );
  33861. this.model.applyOperation( operation );
  33862. }
  33863. /**
  33864. * Removes given model {@link module:engine/model/item~Item item} or {@link module:engine/model/range~Range range}.
  33865. *
  33866. * @param {module:engine/model/item~Item|module:engine/model/range~Range} itemOrRange Model item or range to remove.
  33867. */
  33868. remove( itemOrRange ) {
  33869. this._assertWriterUsedCorrectly();
  33870. const rangeToRemove = itemOrRange instanceof _range_js__WEBPACK_IMPORTED_MODULE_14__["default"] ? itemOrRange : _range_js__WEBPACK_IMPORTED_MODULE_14__["default"]._createOn( itemOrRange );
  33871. const ranges = rangeToRemove.getMinimalFlatRanges().reverse();
  33872. for ( const flat of ranges ) {
  33873. // If part of the marker is removed, create additional marker operation for undo purposes.
  33874. this._addOperationForAffectedMarkers( 'move', flat );
  33875. applyRemoveOperation( flat.start, flat.end.offset - flat.start.offset, this.batch, this.model );
  33876. }
  33877. }
  33878. /**
  33879. * Merges two siblings at the given position.
  33880. *
  33881. * Node before and after the position have to be an element. Otherwise `writer-merge-no-element-before` or
  33882. * `writer-merge-no-element-after` error will be thrown.
  33883. *
  33884. * @param {module:engine/model/position~Position} position Position between merged elements.
  33885. */
  33886. merge( position ) {
  33887. this._assertWriterUsedCorrectly();
  33888. const nodeBefore = position.nodeBefore;
  33889. const nodeAfter = position.nodeAfter;
  33890. // If part of the marker is removed, create additional marker operation for undo purposes.
  33891. this._addOperationForAffectedMarkers( 'merge', position );
  33892. if ( !( nodeBefore instanceof _element__WEBPACK_IMPORTED_MODULE_11__["default"] ) ) {
  33893. /**
  33894. * Node before merge position must be an element.
  33895. *
  33896. * @error writer-merge-no-element-before
  33897. */
  33898. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_17__["default"]( 'writer-merge-no-element-before', this );
  33899. }
  33900. if ( !( nodeAfter instanceof _element__WEBPACK_IMPORTED_MODULE_11__["default"] ) ) {
  33901. /**
  33902. * Node after merge position must be an element.
  33903. *
  33904. * @error writer-merge-no-element-after
  33905. */
  33906. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_17__["default"]( 'writer-merge-no-element-after', this );
  33907. }
  33908. if ( !position.root.document ) {
  33909. this._mergeDetached( position );
  33910. } else {
  33911. this._merge( position );
  33912. }
  33913. }
  33914. /**
  33915. * Shortcut for {@link module:engine/model/model~Model#createPositionFromPath `Model#createPositionFromPath()`}.
  33916. *
  33917. * @param {module:engine/model/element~Element|module:engine/model/documentfragment~DocumentFragment} root Root of the position.
  33918. * @param {Array.<Number>} path Position path. See {@link module:engine/model/position~Position#path}.
  33919. * @param {module:engine/model/position~PositionStickiness} [stickiness='toNone'] Position stickiness.
  33920. * See {@link module:engine/model/position~PositionStickiness}.
  33921. * @returns {module:engine/model/position~Position}
  33922. */
  33923. createPositionFromPath( root, path, stickiness ) {
  33924. return this.model.createPositionFromPath( root, path, stickiness );
  33925. }
  33926. /**
  33927. * Shortcut for {@link module:engine/model/model~Model#createPositionAt `Model#createPositionAt()`}.
  33928. *
  33929. * @param {module:engine/model/item~Item|module:engine/model/position~Position} itemOrPosition
  33930. * @param {Number|'end'|'before'|'after'} [offset] Offset or one of the flags. Used only when
  33931. * first parameter is a {@link module:engine/model/item~Item model item}.
  33932. * @returns {module:engine/model/position~Position}
  33933. */
  33934. createPositionAt( itemOrPosition, offset ) {
  33935. return this.model.createPositionAt( itemOrPosition, offset );
  33936. }
  33937. /**
  33938. * Shortcut for {@link module:engine/model/model~Model#createPositionAfter `Model#createPositionAfter()`}.
  33939. *
  33940. * @param {module:engine/model/item~Item} item Item after which the position should be placed.
  33941. * @returns {module:engine/model/position~Position}
  33942. */
  33943. createPositionAfter( item ) {
  33944. return this.model.createPositionAfter( item );
  33945. }
  33946. /**
  33947. * Shortcut for {@link module:engine/model/model~Model#createPositionBefore `Model#createPositionBefore()`}.
  33948. *
  33949. * @param {module:engine/model/item~Item} item Item after which the position should be placed.
  33950. * @returns {module:engine/model/position~Position}
  33951. */
  33952. createPositionBefore( item ) {
  33953. return this.model.createPositionBefore( item );
  33954. }
  33955. /**
  33956. * Shortcut for {@link module:engine/model/model~Model#createRange `Model#createRange()`}.
  33957. *
  33958. * @param {module:engine/model/position~Position} start Start position.
  33959. * @param {module:engine/model/position~Position} [end] End position. If not set, range will be collapsed at `start` position.
  33960. * @returns {module:engine/model/range~Range}
  33961. */
  33962. createRange( start, end ) {
  33963. return this.model.createRange( start, end );
  33964. }
  33965. /**
  33966. * Shortcut for {@link module:engine/model/model~Model#createRangeIn `Model#createRangeIn()`}.
  33967. *
  33968. * @param {module:engine/model/element~Element} element Element which is a parent for the range.
  33969. * @returns {module:engine/model/range~Range}
  33970. */
  33971. createRangeIn( element ) {
  33972. return this.model.createRangeIn( element );
  33973. }
  33974. /**
  33975. * Shortcut for {@link module:engine/model/model~Model#createRangeOn `Model#createRangeOn()`}.
  33976. *
  33977. * @param {module:engine/model/element~Element} element Element which is a parent for the range.
  33978. * @returns {module:engine/model/range~Range}
  33979. */
  33980. createRangeOn( element ) {
  33981. return this.model.createRangeOn( element );
  33982. }
  33983. /**
  33984. * Shortcut for {@link module:engine/model/model~Model#createSelection `Model#createSelection()`}.
  33985. *
  33986. * @param {module:engine/model/selection~Selectable} selectable
  33987. * @param {Number|'before'|'end'|'after'|'on'|'in'} [placeOrOffset] Sets place or offset of the selection.
  33988. * @param {Object} [options]
  33989. * @param {Boolean} [options.backward] Sets this selection instance to be backward.
  33990. * @returns {module:engine/model/selection~Selection}
  33991. */
  33992. createSelection( selectable, placeOrOffset, options ) {
  33993. return this.model.createSelection( selectable, placeOrOffset, options );
  33994. }
  33995. /**
  33996. * Performs merge action in a detached tree.
  33997. *
  33998. * @private
  33999. * @param {module:engine/model/position~Position} position Position between merged elements.
  34000. */
  34001. _mergeDetached( position ) {
  34002. const nodeBefore = position.nodeBefore;
  34003. const nodeAfter = position.nodeAfter;
  34004. this.move( _range_js__WEBPACK_IMPORTED_MODULE_14__["default"]._createIn( nodeAfter ), _position__WEBPACK_IMPORTED_MODULE_13__["default"]._createAt( nodeBefore, 'end' ) );
  34005. this.remove( nodeAfter );
  34006. }
  34007. /**
  34008. * Performs merge action in a non-detached tree.
  34009. *
  34010. * @private
  34011. * @param {module:engine/model/position~Position} position Position between merged elements.
  34012. */
  34013. _merge( position ) {
  34014. const targetPosition = _position__WEBPACK_IMPORTED_MODULE_13__["default"]._createAt( position.nodeBefore, 'end' );
  34015. const sourcePosition = _position__WEBPACK_IMPORTED_MODULE_13__["default"]._createAt( position.nodeAfter, 0 );
  34016. const graveyard = position.root.document.graveyard;
  34017. const graveyardPosition = new _position__WEBPACK_IMPORTED_MODULE_13__["default"]( graveyard, [ 0 ] );
  34018. const version = position.root.document.version;
  34019. const merge = new _operation_mergeoperation__WEBPACK_IMPORTED_MODULE_8__["default"]( sourcePosition, position.nodeAfter.maxOffset, targetPosition, graveyardPosition, version );
  34020. this.batch.addOperation( merge );
  34021. this.model.applyOperation( merge );
  34022. }
  34023. /**
  34024. * Renames the given element.
  34025. *
  34026. * @param {module:engine/model/element~Element} element The element to rename.
  34027. * @param {String} newName New element name.
  34028. */
  34029. rename( element, newName ) {
  34030. this._assertWriterUsedCorrectly();
  34031. if ( !( element instanceof _element__WEBPACK_IMPORTED_MODULE_11__["default"] ) ) {
  34032. /**
  34033. * Trying to rename an object which is not an instance of Element.
  34034. *
  34035. * @error writer-rename-not-element-instance
  34036. */
  34037. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_17__["default"](
  34038. 'writer-rename-not-element-instance',
  34039. this
  34040. );
  34041. }
  34042. const version = element.root.document ? element.root.document.version : null;
  34043. const renameOperation = new _operation_renameoperation__WEBPACK_IMPORTED_MODULE_5__["default"]( _position__WEBPACK_IMPORTED_MODULE_13__["default"]._createBefore( element ), element.name, newName, version );
  34044. this.batch.addOperation( renameOperation );
  34045. this.model.applyOperation( renameOperation );
  34046. }
  34047. /**
  34048. * Splits elements starting from the given position and going to the top of the model tree as long as given
  34049. * `limitElement` is reached. When `limitElement` is not defined then only the parent of the given position will be split.
  34050. *
  34051. * The element needs to have a parent. It cannot be a root element nor a document fragment.
  34052. * The `writer-split-element-no-parent` error will be thrown if you try to split an element with no parent.
  34053. *
  34054. * @param {module:engine/model/position~Position} position Position of split.
  34055. * @param {module:engine/model/node~Node} [limitElement] Stop splitting when this element will be reached.
  34056. * @returns {Object} result Split result.
  34057. * @returns {module:engine/model/position~Position} result.position Position between split elements.
  34058. * @returns {module:engine/model/range~Range} result.range Range that stars from the end of the first split element and ends
  34059. * at the beginning of the first copy element.
  34060. */
  34061. split( position, limitElement ) {
  34062. this._assertWriterUsedCorrectly();
  34063. let splitElement = position.parent;
  34064. if ( !splitElement.parent ) {
  34065. /**
  34066. * Element with no parent can not be split.
  34067. *
  34068. * @error writer-split-element-no-parent
  34069. */
  34070. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_17__["default"]( 'writer-split-element-no-parent', this );
  34071. }
  34072. // When limit element is not defined lets set splitElement parent as limit.
  34073. if ( !limitElement ) {
  34074. limitElement = splitElement.parent;
  34075. }
  34076. if ( !position.parent.getAncestors( { includeSelf: true } ).includes( limitElement ) ) {
  34077. /**
  34078. * Limit element is not a position ancestor.
  34079. *
  34080. * @error writer-split-invalid-limit-element
  34081. */
  34082. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_17__["default"]( 'writer-split-invalid-limit-element', this );
  34083. }
  34084. // We need to cache elements that will be created as a result of the first split because
  34085. // we need to create a range from the end of the first split element to the beginning of the
  34086. // first copy element. This should be handled by LiveRange but it doesn't work on detached nodes.
  34087. let firstSplitElement, firstCopyElement;
  34088. do {
  34089. const version = splitElement.root.document ? splitElement.root.document.version : null;
  34090. const howMany = splitElement.maxOffset - position.offset;
  34091. const insertionPosition = _operation_splitoperation__WEBPACK_IMPORTED_MODULE_7__["default"].getInsertionPosition( position );
  34092. const split = new _operation_splitoperation__WEBPACK_IMPORTED_MODULE_7__["default"]( position, howMany, insertionPosition, null, version );
  34093. this.batch.addOperation( split );
  34094. this.model.applyOperation( split );
  34095. // Cache result of the first split.
  34096. if ( !firstSplitElement && !firstCopyElement ) {
  34097. firstSplitElement = splitElement;
  34098. firstCopyElement = position.parent.nextSibling;
  34099. }
  34100. position = this.createPositionAfter( position.parent );
  34101. splitElement = position.parent;
  34102. } while ( splitElement !== limitElement );
  34103. return {
  34104. position,
  34105. 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 ) )
  34106. };
  34107. }
  34108. /**
  34109. * Wraps the given range with the given element or with a new element (if a string was passed).
  34110. *
  34111. * **Note:** range to wrap should be a "flat range" (see {@link module:engine/model/range~Range#isFlat `Range#isFlat`}).
  34112. * If not, an error will be thrown.
  34113. *
  34114. * @param {module:engine/model/range~Range} range Range to wrap.
  34115. * @param {module:engine/model/element~Element|String} elementOrString Element or name of element to wrap the range with.
  34116. */
  34117. wrap( range, elementOrString ) {
  34118. this._assertWriterUsedCorrectly();
  34119. if ( !range.isFlat ) {
  34120. /**
  34121. * Range to wrap is not flat.
  34122. *
  34123. * @error writer-wrap-range-not-flat
  34124. */
  34125. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_17__["default"]( 'writer-wrap-range-not-flat', this );
  34126. }
  34127. const element = elementOrString instanceof _element__WEBPACK_IMPORTED_MODULE_11__["default"] ? elementOrString : new _element__WEBPACK_IMPORTED_MODULE_11__["default"]( elementOrString );
  34128. if ( element.childCount > 0 ) {
  34129. /**
  34130. * Element to wrap with is not empty.
  34131. *
  34132. * @error writer-wrap-element-not-empty
  34133. */
  34134. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_17__["default"]( 'writer-wrap-element-not-empty', this );
  34135. }
  34136. if ( element.parent !== null ) {
  34137. /**
  34138. * Element to wrap with is already attached to a tree model.
  34139. *
  34140. * @error writer-wrap-element-attached
  34141. */
  34142. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_17__["default"]( 'writer-wrap-element-attached', this );
  34143. }
  34144. this.insert( element, range.start );
  34145. // Shift the range-to-wrap because we just inserted an element before that range.
  34146. const shiftedRange = new _range_js__WEBPACK_IMPORTED_MODULE_14__["default"]( range.start.getShiftedBy( 1 ), range.end.getShiftedBy( 1 ) );
  34147. this.move( shiftedRange, _position__WEBPACK_IMPORTED_MODULE_13__["default"]._createAt( element, 0 ) );
  34148. }
  34149. /**
  34150. * Unwraps children of the given element – all its children are moved before it and then the element is removed.
  34151. * Throws error if you try to unwrap an element which does not have a parent.
  34152. *
  34153. * @param {module:engine/model/element~Element} element Element to unwrap.
  34154. */
  34155. unwrap( element ) {
  34156. this._assertWriterUsedCorrectly();
  34157. if ( element.parent === null ) {
  34158. /**
  34159. * Trying to unwrap an element which has no parent.
  34160. *
  34161. * @error writer-unwrap-element-no-parent
  34162. */
  34163. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_17__["default"]( 'writer-unwrap-element-no-parent', this );
  34164. }
  34165. this.move( _range_js__WEBPACK_IMPORTED_MODULE_14__["default"]._createIn( element ), this.createPositionAfter( element ) );
  34166. this.remove( element );
  34167. }
  34168. /**
  34169. * Adds a {@link module:engine/model/markercollection~Marker marker}. Marker is a named range, which tracks
  34170. * changes in the document and updates its range automatically, when model tree changes.
  34171. *
  34172. * As the first parameter you can set marker name.
  34173. *
  34174. * The required `options.usingOperation` parameter lets you decide if the marker should be managed by operations or not. See
  34175. * {@link module:engine/model/markercollection~Marker marker class description} to learn about the difference between
  34176. * markers managed by operations and not-managed by operations.
  34177. *
  34178. * The `options.affectsData` parameter, which defaults to `false`, allows you to define if a marker affects the data. It should be
  34179. * `true` when the marker change changes the data returned by the
  34180. * {@link module:core/editor/utils/dataapimixin~DataApi#getData `editor.getData()`} method.
  34181. * When set to `true` it fires the {@link module:engine/model/document~Document#event:change:data `change:data`} event.
  34182. * When set to `false` it fires the {@link module:engine/model/document~Document#event:change `change`} event.
  34183. *
  34184. * Create marker directly base on marker's name:
  34185. *
  34186. * addMarker( markerName, { range, usingOperation: false } );
  34187. *
  34188. * Create marker using operation:
  34189. *
  34190. * addMarker( markerName, { range, usingOperation: true } );
  34191. *
  34192. * Create marker that affects the editor data:
  34193. *
  34194. * addMarker( markerName, { range, usingOperation: false, affectsData: true } );
  34195. *
  34196. * Note: For efficiency reasons, it's best to create and keep as little markers as possible.
  34197. *
  34198. * @see module:engine/model/markercollection~Marker
  34199. * @param {String} name Name of a marker to create - must be unique.
  34200. * @param {Object} options
  34201. * @param {Boolean} options.usingOperation Flag indicating that the marker should be added by MarkerOperation.
  34202. * See {@link module:engine/model/markercollection~Marker#managedUsingOperations}.
  34203. * @param {module:engine/model/range~Range} options.range Marker range.
  34204. * @param {Boolean} [options.affectsData=false] Flag indicating that the marker changes the editor data.
  34205. * @returns {module:engine/model/markercollection~Marker} Marker that was set.
  34206. */
  34207. addMarker( name, options ) {
  34208. this._assertWriterUsedCorrectly();
  34209. if ( !options || typeof options.usingOperation != 'boolean' ) {
  34210. /**
  34211. * The `options.usingOperation` parameter is required when adding a new marker.
  34212. *
  34213. * @error writer-addmarker-no-usingoperation
  34214. */
  34215. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_17__["default"]( 'writer-addmarker-no-usingoperation', this );
  34216. }
  34217. const usingOperation = options.usingOperation;
  34218. const range = options.range;
  34219. const affectsData = options.affectsData === undefined ? false : options.affectsData;
  34220. if ( this.model.markers.has( name ) ) {
  34221. /**
  34222. * Marker with provided name already exists.
  34223. *
  34224. * @error writer-addmarker-marker-exists
  34225. */
  34226. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_17__["default"]( 'writer-addmarker-marker-exists', this );
  34227. }
  34228. if ( !range ) {
  34229. /**
  34230. * Range parameter is required when adding a new marker.
  34231. *
  34232. * @error writer-addmarker-no-range
  34233. */
  34234. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_17__["default"]( 'writer-addmarker-no-range', this );
  34235. }
  34236. if ( !usingOperation ) {
  34237. return this.model.markers._set( name, range, usingOperation, affectsData );
  34238. }
  34239. applyMarkerOperation( this, name, null, range, affectsData );
  34240. return this.model.markers.get( name );
  34241. }
  34242. /**
  34243. * Adds, updates or refreshes a {@link module:engine/model/markercollection~Marker marker}. Marker is a named range, which tracks
  34244. * changes in the document and updates its range automatically, when model tree changes. Still, it is possible to change the
  34245. * marker's range directly using this method.
  34246. *
  34247. * As the first parameter you can set marker name or instance. If none of them is provided, new marker, with a unique
  34248. * name is created and returned.
  34249. *
  34250. * As the second parameter you can set the new marker data or leave this parameter as empty which will just refresh
  34251. * the marker by triggering downcast conversion for it. Refreshing the marker is useful when you want to change
  34252. * the marker {@link module:engine/view/element~Element view element} without changing any marker data.
  34253. *
  34254. * let isCommentActive = false;
  34255. *
  34256. * model.conversion.markerToHighlight( {
  34257. * model: 'comment',
  34258. * view: data => {
  34259. * const classes = [ 'comment-marker' ];
  34260. *
  34261. * if ( isCommentActive ) {
  34262. * classes.push( 'comment-marker--active' );
  34263. * }
  34264. *
  34265. * return { classes };
  34266. * }
  34267. * } );
  34268. *
  34269. * // Change the property that indicates if marker is displayed as active or not.
  34270. * isCommentActive = true;
  34271. *
  34272. * // And refresh the marker to convert it with additional class.
  34273. * model.change( writer => writer.updateMarker( 'comment' ) );
  34274. *
  34275. * The `options.usingOperation` parameter lets you change if the marker should be managed by operations or not. See
  34276. * {@link module:engine/model/markercollection~Marker marker class description} to learn about the difference between
  34277. * markers managed by operations and not-managed by operations. It is possible to change this option for an existing marker.
  34278. *
  34279. * The `options.affectsData` parameter, which defaults to `false`, allows you to define if a marker affects the data. It should be
  34280. * `true` when the marker change changes the data returned by
  34281. * the {@link module:core/editor/utils/dataapimixin~DataApi#getData `editor.getData()`} method.
  34282. * When set to `true` it fires the {@link module:engine/model/document~Document#event:change:data `change:data`} event.
  34283. * When set to `false` it fires the {@link module:engine/model/document~Document#event:change `change`} event.
  34284. *
  34285. * Update marker directly base on marker's name:
  34286. *
  34287. * updateMarker( markerName, { range } );
  34288. *
  34289. * Update marker using operation:
  34290. *
  34291. * updateMarker( marker, { range, usingOperation: true } );
  34292. * updateMarker( markerName, { range, usingOperation: true } );
  34293. *
  34294. * Change marker's option (start using operations to manage it):
  34295. *
  34296. * updateMarker( marker, { usingOperation: true } );
  34297. *
  34298. * Change marker's option (inform the engine, that the marker does not affect the data anymore):
  34299. *
  34300. * updateMarker( markerName, { affectsData: false } );
  34301. *
  34302. * @see module:engine/model/markercollection~Marker
  34303. * @param {String|module:engine/model/markercollection~Marker} markerOrName Name of a marker to update, or a marker instance.
  34304. * @param {Object} [options] If options object is not defined then marker will be refreshed by triggering
  34305. * downcast conversion for this marker with the same data.
  34306. * @param {module:engine/model/range~Range} [options.range] Marker range to update.
  34307. * @param {Boolean} [options.usingOperation] Flag indicated whether the marker should be added by MarkerOperation.
  34308. * See {@link module:engine/model/markercollection~Marker#managedUsingOperations}.
  34309. * @param {Boolean} [options.affectsData] Flag indicating that the marker changes the editor data.
  34310. */
  34311. updateMarker( markerOrName, options ) {
  34312. this._assertWriterUsedCorrectly();
  34313. const markerName = typeof markerOrName == 'string' ? markerOrName : markerOrName.name;
  34314. const currentMarker = this.model.markers.get( markerName );
  34315. if ( !currentMarker ) {
  34316. /**
  34317. * Marker with provided name does not exists.
  34318. *
  34319. * @error writer-updatemarker-marker-not-exists
  34320. */
  34321. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_17__["default"]( 'writer-updatemarker-marker-not-exists', this );
  34322. }
  34323. if ( !options ) {
  34324. this.model.markers._refresh( currentMarker );
  34325. return;
  34326. }
  34327. const hasUsingOperationDefined = typeof options.usingOperation == 'boolean';
  34328. const affectsDataDefined = typeof options.affectsData == 'boolean';
  34329. // Use previously defined marker's affectsData if the property is not provided.
  34330. const affectsData = affectsDataDefined ? options.affectsData : currentMarker.affectsData;
  34331. if ( !hasUsingOperationDefined && !options.range && !affectsDataDefined ) {
  34332. /**
  34333. * One of the options is required - provide range, usingOperations or affectsData.
  34334. *
  34335. * @error writer-updatemarker-wrong-options
  34336. */
  34337. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_17__["default"]( 'writer-updatemarker-wrong-options', this );
  34338. }
  34339. const currentRange = currentMarker.getRange();
  34340. const updatedRange = options.range ? options.range : currentRange;
  34341. if ( hasUsingOperationDefined && options.usingOperation !== currentMarker.managedUsingOperations ) {
  34342. // The marker type is changed so it's necessary to create proper operations.
  34343. if ( options.usingOperation ) {
  34344. // If marker changes to a managed one treat this as synchronizing existing marker.
  34345. // Create `MarkerOperation` with `oldRange` set to `null`, so reverse operation will remove the marker.
  34346. applyMarkerOperation( this, markerName, null, updatedRange, affectsData );
  34347. } else {
  34348. // If marker changes to a marker that do not use operations then we need to create additional operation
  34349. // that removes that marker first.
  34350. applyMarkerOperation( this, markerName, currentRange, null, affectsData );
  34351. // Although not managed the marker itself should stay in model and its range should be preserver or changed to passed range.
  34352. this.model.markers._set( markerName, updatedRange, undefined, affectsData );
  34353. }
  34354. return;
  34355. }
  34356. // Marker's type doesn't change so update it accordingly.
  34357. if ( currentMarker.managedUsingOperations ) {
  34358. applyMarkerOperation( this, markerName, currentRange, updatedRange, affectsData );
  34359. } else {
  34360. this.model.markers._set( markerName, updatedRange, undefined, affectsData );
  34361. }
  34362. }
  34363. /**
  34364. * Removes given {@link module:engine/model/markercollection~Marker marker} or marker with given name.
  34365. * The marker is removed accordingly to how it has been created, so if the marker was created using operation,
  34366. * it will be destroyed using operation.
  34367. *
  34368. * @param {module:engine/model/markercollection~Marker|String} markerOrName Marker or marker name to remove.
  34369. */
  34370. removeMarker( markerOrName ) {
  34371. this._assertWriterUsedCorrectly();
  34372. const name = typeof markerOrName == 'string' ? markerOrName : markerOrName.name;
  34373. if ( !this.model.markers.has( name ) ) {
  34374. /**
  34375. * Trying to remove marker which does not exist.
  34376. *
  34377. * @error writer-removemarker-no-marker
  34378. */
  34379. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_17__["default"]( 'writer-removemarker-no-marker', this );
  34380. }
  34381. const marker = this.model.markers.get( name );
  34382. if ( !marker.managedUsingOperations ) {
  34383. this.model.markers._remove( name );
  34384. return;
  34385. }
  34386. const oldRange = marker.getRange();
  34387. applyMarkerOperation( this, name, oldRange, null, marker.affectsData );
  34388. }
  34389. /**
  34390. * Sets the document's selection (ranges and direction) to the specified location based on the given
  34391. * {@link module:engine/model/selection~Selectable selectable} or creates an empty selection if no arguments were passed.
  34392. *
  34393. * // Sets selection to the given range.
  34394. * const range = writer.createRange( start, end );
  34395. * writer.setSelection( range );
  34396. *
  34397. * // Sets selection to given ranges.
  34398. * const ranges = [ writer.createRange( start1, end2 ), writer.createRange( star2, end2 ) ];
  34399. * writer.setSelection( ranges );
  34400. *
  34401. * // Sets selection to other selection.
  34402. * const otherSelection = writer.createSelection();
  34403. * writer.setSelection( otherSelection );
  34404. *
  34405. * // Sets selection to the given document selection.
  34406. * const documentSelection = model.document.selection;
  34407. * writer.setSelection( documentSelection );
  34408. *
  34409. * // Sets collapsed selection at the given position.
  34410. * const position = writer.createPosition( root, path );
  34411. * writer.setSelection( position );
  34412. *
  34413. * // Sets collapsed selection at the position of the given node and an offset.
  34414. * writer.setSelection( paragraph, offset );
  34415. *
  34416. * Creates a range inside an {@link module:engine/model/element~Element element} which starts before the first child of
  34417. * that element and ends after the last child of that element.
  34418. *
  34419. * writer.setSelection( paragraph, 'in' );
  34420. *
  34421. * Creates a range on an {@link module:engine/model/item~Item item} which starts before the item and ends just after the item.
  34422. *
  34423. * writer.setSelection( paragraph, 'on' );
  34424. *
  34425. * // Removes all selection's ranges.
  34426. * writer.setSelection( null );
  34427. *
  34428. * `Writer#setSelection()` allow passing additional options (`backward`) as the last argument.
  34429. *
  34430. * // Sets selection as backward.
  34431. * writer.setSelection( range, { backward: true } );
  34432. *
  34433. * Throws `writer-incorrect-use` error when the writer is used outside the `change()` block.
  34434. *
  34435. * @param {module:engine/model/selection~Selectable} selectable
  34436. * @param {Number|'before'|'end'|'after'|'on'|'in'} [placeOrOffset] Sets place or offset of the selection.
  34437. * @param {Object} [options]
  34438. * @param {Boolean} [options.backward] Sets this selection instance to be backward.
  34439. */
  34440. setSelection( selectable, placeOrOffset, options ) {
  34441. this._assertWriterUsedCorrectly();
  34442. this.model.document.selection._setTo( selectable, placeOrOffset, options );
  34443. }
  34444. /**
  34445. * Moves {@link module:engine/model/documentselection~DocumentSelection#focus} to the specified location.
  34446. *
  34447. * The location can be specified in the same form as
  34448. * {@link #createPositionAt `writer.createPositionAt()`} parameters.
  34449. *
  34450. * @param {module:engine/model/item~Item|module:engine/model/position~Position} itemOrPosition
  34451. * @param {Number|'end'|'before'|'after'} [offset=0] Offset or one of the flags. Used only when
  34452. * first parameter is a {@link module:engine/model/item~Item model item}.
  34453. */
  34454. setSelectionFocus( itemOrPosition, offset ) {
  34455. this._assertWriterUsedCorrectly();
  34456. this.model.document.selection._setFocus( itemOrPosition, offset );
  34457. }
  34458. /**
  34459. * Sets attribute(s) on the selection. If attribute with the same key already is set, it's value is overwritten.
  34460. *
  34461. * Using key and value pair:
  34462. *
  34463. * writer.setSelectionAttribute( 'italic', true );
  34464. *
  34465. * Using key-value object:
  34466. *
  34467. * writer.setSelectionAttribute( { italic: true, bold: false } );
  34468. *
  34469. * Using iterable object:
  34470. *
  34471. * writer.setSelectionAttribute( new Map( [ [ 'italic', true ] ] ) );
  34472. *
  34473. * @param {String|Object|Iterable.<*>} keyOrObjectOrIterable Key of the attribute to set
  34474. * or object / iterable of key => value attribute pairs.
  34475. * @param {*} [value] Attribute value.
  34476. */
  34477. setSelectionAttribute( keyOrObjectOrIterable, value ) {
  34478. this._assertWriterUsedCorrectly();
  34479. if ( typeof keyOrObjectOrIterable === 'string' ) {
  34480. this._setSelectionAttribute( keyOrObjectOrIterable, value );
  34481. } else {
  34482. for ( const [ key, value ] of Object(_ckeditor_ckeditor5_utils_src_tomap__WEBPACK_IMPORTED_MODULE_16__["default"])( keyOrObjectOrIterable ) ) {
  34483. this._setSelectionAttribute( key, value );
  34484. }
  34485. }
  34486. }
  34487. /**
  34488. * Removes attribute(s) with given key(s) from the selection.
  34489. *
  34490. * Remove one attribute:
  34491. *
  34492. * writer.removeSelectionAttribute( 'italic' );
  34493. *
  34494. * Remove multiple attributes:
  34495. *
  34496. * writer.removeSelectionAttribute( [ 'italic', 'bold' ] );
  34497. *
  34498. * @param {String|Iterable.<String>} keyOrIterableOfKeys Key of the attribute to remove or an iterable of attribute keys to remove.
  34499. */
  34500. removeSelectionAttribute( keyOrIterableOfKeys ) {
  34501. this._assertWriterUsedCorrectly();
  34502. if ( typeof keyOrIterableOfKeys === 'string' ) {
  34503. this._removeSelectionAttribute( keyOrIterableOfKeys );
  34504. } else {
  34505. for ( const key of keyOrIterableOfKeys ) {
  34506. this._removeSelectionAttribute( key );
  34507. }
  34508. }
  34509. }
  34510. /**
  34511. * Temporarily changes the {@link module:engine/model/documentselection~DocumentSelection#isGravityOverridden gravity}
  34512. * of the selection from left to right.
  34513. *
  34514. * The gravity defines from which direction the selection inherits its attributes. If it's the default left gravity,
  34515. * then the selection (after being moved by the user) inherits attributes from its left-hand side.
  34516. * This method allows to temporarily override this behavior by forcing the gravity to the right.
  34517. *
  34518. * For the following model fragment:
  34519. *
  34520. * <$text bold="true" linkHref="url">bar[]</$text><$text bold="true">biz</$text>
  34521. *
  34522. * * Default gravity: selection will have the `bold` and `linkHref` attributes.
  34523. * * Overridden gravity: selection will have `bold` attribute.
  34524. *
  34525. * **Note**: It returns an unique identifier which is required to restore the gravity. It guarantees the symmetry
  34526. * of the process.
  34527. *
  34528. * @returns {String} The unique id which allows restoring the gravity.
  34529. */
  34530. overrideSelectionGravity() {
  34531. return this.model.document.selection._overrideGravity();
  34532. }
  34533. /**
  34534. * Restores {@link ~Writer#overrideSelectionGravity} gravity to default.
  34535. *
  34536. * Restoring the gravity is only possible using the unique identifier returned by
  34537. * {@link ~Writer#overrideSelectionGravity}. Note that the gravity remains overridden as long as won't be restored
  34538. * the same number of times it was overridden.
  34539. *
  34540. * @param {String} uid The unique id returned by {@link ~Writer#overrideSelectionGravity}.
  34541. */
  34542. restoreSelectionGravity( uid ) {
  34543. this.model.document.selection._restoreGravity( uid );
  34544. }
  34545. /**
  34546. * @private
  34547. * @param {String} key Key of the attribute to remove.
  34548. * @param {*} value Attribute value.
  34549. */
  34550. _setSelectionAttribute( key, value ) {
  34551. const selection = this.model.document.selection;
  34552. // Store attribute in parent element if the selection is collapsed in an empty node.
  34553. if ( selection.isCollapsed && selection.anchor.parent.isEmpty ) {
  34554. const storeKey = _documentselection__WEBPACK_IMPORTED_MODULE_15__["default"]._getStoreAttributeKey( key );
  34555. this.setAttribute( storeKey, value, selection.anchor.parent );
  34556. }
  34557. selection._setAttribute( key, value );
  34558. }
  34559. /**
  34560. * @private
  34561. * @param {String} key Key of the attribute to remove.
  34562. */
  34563. _removeSelectionAttribute( key ) {
  34564. const selection = this.model.document.selection;
  34565. // Remove stored attribute from parent element if the selection is collapsed in an empty node.
  34566. if ( selection.isCollapsed && selection.anchor.parent.isEmpty ) {
  34567. const storeKey = _documentselection__WEBPACK_IMPORTED_MODULE_15__["default"]._getStoreAttributeKey( key );
  34568. this.removeAttribute( storeKey, selection.anchor.parent );
  34569. }
  34570. selection._removeAttribute( key );
  34571. }
  34572. /**
  34573. * Throws `writer-detached-writer-tries-to-modify-model` error when the writer is used outside of the `change()` block.
  34574. *
  34575. * @private
  34576. */
  34577. _assertWriterUsedCorrectly() {
  34578. /**
  34579. * Trying to use a writer outside a {@link module:engine/model/model~Model#change `change()`} or
  34580. * {@link module:engine/model/model~Model#enqueueChange `enqueueChange()`} blocks.
  34581. *
  34582. * The writer can only be used inside these blocks which ensures that the model
  34583. * can only be changed during such "sessions".
  34584. *
  34585. * @error writer-incorrect-use
  34586. */
  34587. if ( this.model._currentWriter !== this ) {
  34588. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_17__["default"]( 'writer-incorrect-use', this );
  34589. }
  34590. }
  34591. /**
  34592. * For given action `type` and `positionOrRange` where the action happens, this function finds all affected markers
  34593. * and applies a marker operation with the new marker range equal to the current range. Thanks to this, the marker range
  34594. * can be later correctly processed during undo.
  34595. *
  34596. * @private
  34597. * @param {'move'|'merge'} type Writer action type.
  34598. * @param {module:engine/model/position~Position|module:engine/model/range~Range} positionOrRange Position or range
  34599. * where the writer action happens.
  34600. */
  34601. _addOperationForAffectedMarkers( type, positionOrRange ) {
  34602. for ( const marker of this.model.markers ) {
  34603. if ( !marker.managedUsingOperations ) {
  34604. continue;
  34605. }
  34606. const markerRange = marker.getRange();
  34607. let isAffected = false;
  34608. if ( type === 'move' ) {
  34609. isAffected =
  34610. positionOrRange.containsPosition( markerRange.start ) ||
  34611. positionOrRange.start.isEqual( markerRange.start ) ||
  34612. positionOrRange.containsPosition( markerRange.end ) ||
  34613. positionOrRange.end.isEqual( markerRange.end );
  34614. } else {
  34615. // if type === 'merge'.
  34616. const elementBefore = positionOrRange.nodeBefore;
  34617. const elementAfter = positionOrRange.nodeAfter;
  34618. // Start: <p>Foo[</p><p>Bar]</p>
  34619. // After merge: <p>Foo[Bar]</p>
  34620. // After undoing split: <p>Foo</p><p>[Bar]</p> <-- incorrect, needs remembering for undo.
  34621. //
  34622. const affectedInLeftElement = markerRange.start.parent == elementBefore && markerRange.start.isAtEnd;
  34623. // Start: <p>[Foo</p><p>]Bar</p>
  34624. // After merge: <p>[Foo]Bar</p>
  34625. // After undoing split: <p>[Foo]</p><p>Bar</p> <-- incorrect, needs remembering for undo.
  34626. //
  34627. const affectedInRightElement = markerRange.end.parent == elementAfter && markerRange.end.offset == 0;
  34628. // Start: <p>[Foo</p>]<p>Bar</p>
  34629. // After merge: <p>[Foo]Bar</p>
  34630. // After undoing split: <p>[Foo]</p><p>Bar</p> <-- incorrect, needs remembering for undo.
  34631. //
  34632. const affectedAfterLeftElement = markerRange.end.nodeAfter == elementAfter;
  34633. // Start: <p>Foo</p>[<p>Bar]</p>
  34634. // After merge: <p>Foo[Bar]</p>
  34635. // After undoing split: <p>Foo</p><p>[Bar]</p> <-- incorrect, needs remembering for undo.
  34636. //
  34637. const affectedBeforeRightElement = markerRange.start.nodeAfter == elementAfter;
  34638. isAffected = affectedInLeftElement || affectedInRightElement || affectedAfterLeftElement || affectedBeforeRightElement;
  34639. }
  34640. if ( isAffected ) {
  34641. this.updateMarker( marker.name, { range: markerRange } );
  34642. }
  34643. }
  34644. }
  34645. }
  34646. // Sets given attribute to each node in given range. When attribute value is null then attribute will be removed.
  34647. //
  34648. // Because attribute operation needs to have the same attribute value on the whole range, this function splits
  34649. // the range into smaller parts.
  34650. //
  34651. // Given `range` must be flat.
  34652. //
  34653. // @private
  34654. // @param {module:engine/model/writer~Writer} writer
  34655. // @param {String} key Attribute key.
  34656. // @param {*} value Attribute new value.
  34657. // @param {module:engine/model/range~Range} range Model range on which the attribute will be set.
  34658. function setAttributeOnRange( writer, key, value, range ) {
  34659. const model = writer.model;
  34660. const doc = model.document;
  34661. // Position of the last split, the beginning of the new range.
  34662. let lastSplitPosition = range.start;
  34663. // Currently position in the scanning range. Because we need value after the position, it is not a current
  34664. // position of the iterator but the previous one (we need to iterate one more time to get the value after).
  34665. let position;
  34666. // Value before the currently position.
  34667. let valueBefore;
  34668. // Value after the currently position.
  34669. let valueAfter;
  34670. for ( const val of range.getWalker( { shallow: true } ) ) {
  34671. valueAfter = val.item.getAttribute( key );
  34672. // At the first run of the iterator the position in undefined. We also do not have a valueBefore, but
  34673. // because valueAfter may be null, valueBefore may be equal valueAfter ( undefined == null ).
  34674. if ( position && valueBefore != valueAfter ) {
  34675. // if valueBefore == value there is nothing to change, so we add operation only if these values are different.
  34676. if ( valueBefore != value ) {
  34677. addOperation();
  34678. }
  34679. lastSplitPosition = position;
  34680. }
  34681. position = val.nextPosition;
  34682. valueBefore = valueAfter;
  34683. }
  34684. // Because position in the loop is not the iterator position (see let position comment), the last position in
  34685. // the while loop will be last but one position in the range. We need to check the last position manually.
  34686. if ( position instanceof _position__WEBPACK_IMPORTED_MODULE_13__["default"] && position != lastSplitPosition && valueBefore != value ) {
  34687. addOperation();
  34688. }
  34689. function addOperation() {
  34690. const range = new _range_js__WEBPACK_IMPORTED_MODULE_14__["default"]( lastSplitPosition, position );
  34691. const version = range.root.document ? doc.version : null;
  34692. const operation = new _operation_attributeoperation__WEBPACK_IMPORTED_MODULE_0__["default"]( range, key, valueBefore, value, version );
  34693. writer.batch.addOperation( operation );
  34694. model.applyOperation( operation );
  34695. }
  34696. }
  34697. // Sets given attribute to the given node. When attribute value is null then attribute will be removed.
  34698. //
  34699. // @private
  34700. // @param {module:engine/model/writer~Writer} writer
  34701. // @param {String} key Attribute key.
  34702. // @param {*} value Attribute new value.
  34703. // @param {module:engine/model/item~Item} item Model item on which the attribute will be set.
  34704. function setAttributeOnItem( writer, key, value, item ) {
  34705. const model = writer.model;
  34706. const doc = model.document;
  34707. const previousValue = item.getAttribute( key );
  34708. let range, operation;
  34709. if ( previousValue != value ) {
  34710. const isRootChanged = item.root === item;
  34711. if ( isRootChanged ) {
  34712. // If we change attributes of root element, we have to use `RootAttributeOperation`.
  34713. const version = item.document ? doc.version : null;
  34714. operation = new _operation_rootattributeoperation__WEBPACK_IMPORTED_MODULE_6__["default"]( item, key, previousValue, value, version );
  34715. } else {
  34716. range = new _range_js__WEBPACK_IMPORTED_MODULE_14__["default"]( _position__WEBPACK_IMPORTED_MODULE_13__["default"]._createBefore( item ), writer.createPositionAfter( item ) );
  34717. const version = range.root.document ? doc.version : null;
  34718. operation = new _operation_attributeoperation__WEBPACK_IMPORTED_MODULE_0__["default"]( range, key, previousValue, value, version );
  34719. }
  34720. writer.batch.addOperation( operation );
  34721. model.applyOperation( operation );
  34722. }
  34723. }
  34724. // Creates and applies marker operation to {@link module:engine/model/operation/operation~Operation operation}.
  34725. //
  34726. // @private
  34727. // @param {module:engine/model/writer~Writer} writer
  34728. // @param {String} name Marker name.
  34729. // @param {module:engine/model/range~Range} oldRange Marker range before the change.
  34730. // @param {module:engine/model/range~Range} newRange Marker range after the change.
  34731. // @param {Boolean} affectsData
  34732. function applyMarkerOperation( writer, name, oldRange, newRange, affectsData ) {
  34733. const model = writer.model;
  34734. const doc = model.document;
  34735. const operation = new _operation_markeroperation__WEBPACK_IMPORTED_MODULE_3__["default"]( name, oldRange, newRange, model.markers, affectsData, doc.version );
  34736. writer.batch.addOperation( operation );
  34737. model.applyOperation( operation );
  34738. }
  34739. // Creates `MoveOperation` or `DetachOperation` that removes `howMany` nodes starting from `position`.
  34740. // The operation will be applied on given model instance and added to given operation instance.
  34741. //
  34742. // @private
  34743. // @param {module:engine/model/position~Position} position Position from which nodes are removed.
  34744. // @param {Number} howMany Number of nodes to remove.
  34745. // @param {Batch} batch Batch to which the operation will be added.
  34746. // @param {module:engine/model/model~Model} model Model instance on which operation will be applied.
  34747. function applyRemoveOperation( position, howMany, batch, model ) {
  34748. let operation;
  34749. if ( position.root.document ) {
  34750. const doc = model.document;
  34751. const graveyardPosition = new _position__WEBPACK_IMPORTED_MODULE_13__["default"]( doc.graveyard, [ 0 ] );
  34752. operation = new _operation_moveoperation__WEBPACK_IMPORTED_MODULE_4__["default"]( position, howMany, graveyardPosition, doc.version );
  34753. } else {
  34754. operation = new _operation_detachoperation__WEBPACK_IMPORTED_MODULE_1__["default"]( position, howMany );
  34755. }
  34756. batch.addOperation( operation );
  34757. model.applyOperation( operation );
  34758. }
  34759. // Returns `true` if both root elements are the same element or both are documents root elements.
  34760. //
  34761. // Elements in the same tree can be moved (for instance you can move element form one documents root to another, or
  34762. // within the same document fragment), but when element supposed to be moved from document fragment to the document, or
  34763. // to another document it should be removed and inserted to avoid problems with OT. This is because features like undo or
  34764. // collaboration may track changes on the document but ignore changes on detached fragments and should not get
  34765. // unexpected `move` operation.
  34766. function isSameTree( rootA, rootB ) {
  34767. // If it is the same root this is the same tree.
  34768. if ( rootA === rootB ) {
  34769. return true;
  34770. }
  34771. // If both roots are documents root it is operation within the document what we still treat as the same tree.
  34772. if ( rootA instanceof _rootelement__WEBPACK_IMPORTED_MODULE_12__["default"] && rootB instanceof _rootelement__WEBPACK_IMPORTED_MODULE_12__["default"] ) {
  34773. return true;
  34774. }
  34775. return false;
  34776. }
  34777. /***/ }),
  34778. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/attributeelement.js":
  34779. /*!******************************************************************************!*\
  34780. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/attributeelement.js ***!
  34781. \******************************************************************************/
  34782. /*! exports provided: default */
  34783. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  34784. "use strict";
  34785. __webpack_require__.r(__webpack_exports__);
  34786. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return AttributeElement; });
  34787. /* harmony import */ var _element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./element */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/element.js");
  34788. /* 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");
  34789. /**
  34790. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  34791. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  34792. */
  34793. /**
  34794. * @module engine/view/attributeelement
  34795. */
  34796. // Default attribute priority.
  34797. const DEFAULT_PRIORITY = 10;
  34798. /**
  34799. * Attribute elements are used to represent formatting elements in the view (think – `<b>`, `<span style="font-size: 2em">`, etc.).
  34800. * Most often they are created when downcasting model text attributes.
  34801. *
  34802. * Editing engine does not define a fixed HTML DTD. This is why a feature developer needs to choose between various
  34803. * types (container element, {@link module:engine/view/attributeelement~AttributeElement attribute element},
  34804. * {@link module:engine/view/emptyelement~EmptyElement empty element}, etc) when developing a feature.
  34805. *
  34806. * To create a new attribute element instance use the
  34807. * {@link module:engine/view/downcastwriter~DowncastWriter#createAttributeElement `DowncastWriter#createAttributeElement()`} method.
  34808. *
  34809. * **Note:** Attribute elements by default can wrap {@link module:engine/view/text~Text},
  34810. * {@link module:engine/view/emptyelement~EmptyElement}, {@link module:engine/view/uielement~UIElement},
  34811. * {@link module:engine/view/rawelement~RawElement} and other attribute elements with higher priority. Other elements while placed inside
  34812. * an attribute element will split it (or nest in case of an `AttributeElement`). This behavior can be modified by changing
  34813. * the `isAllowedInsideAttributeElement` option while creating
  34814. * {@link module:engine/view/downcastwriter~DowncastWriter#createContainerElement},
  34815. * {@link module:engine/view/downcastwriter~DowncastWriter#createEmptyElement},
  34816. * {@link module:engine/view/downcastwriter~DowncastWriter#createUIElement} or
  34817. * {@link module:engine/view/downcastwriter~DowncastWriter#createRawElement}.
  34818. *
  34819. * @extends module:engine/view/element~Element
  34820. */
  34821. class AttributeElement extends _element__WEBPACK_IMPORTED_MODULE_0__["default"] {
  34822. /**
  34823. * Creates an attribute element.
  34824. *
  34825. * @see module:engine/view/downcastwriter~DowncastWriter#createAttributeElement
  34826. * @see module:engine/view/element~Element
  34827. * @protected
  34828. * @param {module:engine/view/document~Document} document The document instance to which this element belongs.
  34829. * @param {String} name Node name.
  34830. * @param {Object|Iterable} [attrs] Collection of attributes.
  34831. * @param {module:engine/view/node~Node|Iterable.<module:engine/view/node~Node>} [children]
  34832. * A list of nodes to be inserted into created element.
  34833. */
  34834. constructor( document, name, attrs, children ) {
  34835. super( document, name, attrs, children );
  34836. /**
  34837. * Returns block {@link module:engine/view/filler filler} offset or `null` if block filler is not needed.
  34838. *
  34839. * @method #getFillerOffset
  34840. * @returns {Number|null} Block filler offset or `null` if block filler is not needed.
  34841. */
  34842. this.getFillerOffset = getFillerOffset;
  34843. /**
  34844. * Element priority. Decides in what order elements are wrapped by {@link module:engine/view/downcastwriter~DowncastWriter}.
  34845. *
  34846. * @protected
  34847. * @member {Number}
  34848. */
  34849. this._priority = DEFAULT_PRIORITY;
  34850. /**
  34851. * Element identifier. If set, it is used by {@link module:engine/view/element~Element#isSimilar},
  34852. * and then two elements are considered similar if, and only if they have the same `_id`.
  34853. *
  34854. * @protected
  34855. * @member {String|Number}
  34856. */
  34857. this._id = null;
  34858. /**
  34859. * Keeps all the attribute elements that have the same {@link module:engine/view/attributeelement~AttributeElement#id ids}
  34860. * and still exist in the view tree.
  34861. *
  34862. * This property is managed by {@link module:engine/view/downcastwriter~DowncastWriter}.
  34863. *
  34864. * @protected
  34865. * @member {Set.<module:engine/view/attributeelement~AttributeElement>|null}
  34866. */
  34867. this._clonesGroup = null;
  34868. }
  34869. /**
  34870. * Element priority. Decides in what order elements are wrapped by {@link module:engine/view/downcastwriter~DowncastWriter}.
  34871. *
  34872. * @readonly
  34873. * @type {Number}
  34874. */
  34875. get priority() {
  34876. return this._priority;
  34877. }
  34878. /**
  34879. * Element identifier. If set, it is used by {@link module:engine/view/element~Element#isSimilar},
  34880. * and then two elements are considered similar if, and only if they have the same `id`.
  34881. *
  34882. * @readonly
  34883. * @type {String|Number}
  34884. */
  34885. get id() {
  34886. return this._id;
  34887. }
  34888. /**
  34889. * Returns all {@link module:engine/view/attributeelement~AttributeElement attribute elements} that has the
  34890. * same {@link module:engine/view/attributeelement~AttributeElement#id id} and are in the view tree (were not removed).
  34891. *
  34892. * Note: If this element has been removed from the tree, returned set will not include it.
  34893. *
  34894. * Throws {@link module:utils/ckeditorerror~CKEditorError attribute-element-get-elements-with-same-id-no-id}
  34895. * if this element has no `id`.
  34896. *
  34897. * @returns {Set.<module:engine/view/attributeelement~AttributeElement>} Set containing all the attribute elements
  34898. * with the same `id` that were added and not removed from the view tree.
  34899. */
  34900. getElementsWithSameId() {
  34901. if ( this.id === null ) {
  34902. /**
  34903. * Cannot get elements with the same id for an attribute element without id.
  34904. *
  34905. * @error attribute-element-get-elements-with-same-id-no-id
  34906. */
  34907. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_1__["default"](
  34908. 'attribute-element-get-elements-with-same-id-no-id',
  34909. this
  34910. );
  34911. }
  34912. return new Set( this._clonesGroup );
  34913. }
  34914. /**
  34915. * Checks whether this object is of the given.
  34916. *
  34917. * attributeElement.is( 'attributeElement' ); // -> true
  34918. * attributeElement.is( 'element' ); // -> true
  34919. * attributeElement.is( 'node' ); // -> true
  34920. * attributeElement.is( 'view:attributeElement' ); // -> true
  34921. * attributeElement.is( 'view:element' ); // -> true
  34922. * attributeElement.is( 'view:node' ); // -> true
  34923. *
  34924. * attributeElement.is( 'model:element' ); // -> false
  34925. * attributeElement.is( 'documentFragment' ); // -> false
  34926. *
  34927. * Assuming that the object being checked is an attribute element, you can also check its
  34928. * {@link module:engine/view/attributeelement~AttributeElement#name name}:
  34929. *
  34930. * attributeElement.is( 'element', 'b' ); // -> true if this is a bold element
  34931. * attributeElement.is( 'attributeElement', 'b' ); // -> same as above
  34932. * text.is( 'element', 'b' ); -> false
  34933. *
  34934. * {@link module:engine/view/node~Node#is Check the entire list of view objects} which implement the `is()` method.
  34935. *
  34936. * @param {String} type Type to check.
  34937. * @param {String} [name] Element name.
  34938. * @returns {Boolean}
  34939. */
  34940. is( type, name = null ) {
  34941. if ( !name ) {
  34942. return type === 'attributeElement' || type === 'view:attributeElement' ||
  34943. // From super.is(). This is highly utilised method and cannot call super. See ckeditor/ckeditor5#6529.
  34944. type === 'element' || type === 'view:element' ||
  34945. type === 'node' || type === 'view:node';
  34946. } else {
  34947. return name === this.name && (
  34948. type === 'attributeElement' || type === 'view:attributeElement' ||
  34949. // From super.is(). This is highly utilised method and cannot call super. See ckeditor/ckeditor5#6529.
  34950. type === 'element' || type === 'view:element'
  34951. );
  34952. }
  34953. }
  34954. /**
  34955. * Checks if this element is similar to other element.
  34956. *
  34957. * If none of elements has set {@link module:engine/view/attributeelement~AttributeElement#id}, then both elements
  34958. * should have the same name, attributes and priority to be considered as similar. Two similar elements can contain
  34959. * different set of children nodes.
  34960. *
  34961. * If at least one element has {@link module:engine/view/attributeelement~AttributeElement#id} set, then both
  34962. * elements have to have the same {@link module:engine/view/attributeelement~AttributeElement#id} value to be
  34963. * considered similar.
  34964. *
  34965. * Similarity is important for {@link module:engine/view/downcastwriter~DowncastWriter}. For example:
  34966. *
  34967. * * two following similar elements can be merged together into one, longer element,
  34968. * * {@link module:engine/view/downcastwriter~DowncastWriter#unwrap} checks similarity of passed element and processed element to
  34969. * decide whether processed element should be unwrapped,
  34970. * * etc.
  34971. *
  34972. * @param {module:engine/view/element~Element} otherElement
  34973. * @returns {Boolean}
  34974. */
  34975. isSimilar( otherElement ) {
  34976. // If any element has an `id` set, just compare the ids.
  34977. if ( this.id !== null || otherElement.id !== null ) {
  34978. return this.id === otherElement.id;
  34979. }
  34980. return super.isSimilar( otherElement ) && this.priority == otherElement.priority;
  34981. }
  34982. /**
  34983. * Clones provided element with priority.
  34984. *
  34985. * @protected
  34986. * @param {Boolean} deep If set to `true` clones element and all its children recursively. When set to `false`,
  34987. * element will be cloned without any children.
  34988. * @returns {module:engine/view/attributeelement~AttributeElement} Clone of this element.
  34989. */
  34990. _clone( deep ) {
  34991. const cloned = super._clone( deep );
  34992. // Clone priority too.
  34993. cloned._priority = this._priority;
  34994. // And id too.
  34995. cloned._id = this._id;
  34996. return cloned;
  34997. }
  34998. }
  34999. /**
  35000. * Default attribute priority.
  35001. *
  35002. * @member {Number} module:engine/view/attributeelement~AttributeElement.DEFAULT_PRIORITY
  35003. */
  35004. AttributeElement.DEFAULT_PRIORITY = DEFAULT_PRIORITY;
  35005. // Returns block {@link module:engine/view/filler~Filler filler} offset or `null` if block filler is not needed.
  35006. //
  35007. // @returns {Number|null} Block filler offset or `null` if block filler is not needed.
  35008. function getFillerOffset() {
  35009. // <b>foo</b> does not need filler.
  35010. if ( nonUiChildrenCount( this ) ) {
  35011. return null;
  35012. }
  35013. let element = this.parent;
  35014. // <p><b></b></p> needs filler -> <p><b><br></b></p>
  35015. while ( element && element.is( 'attributeElement' ) ) {
  35016. if ( nonUiChildrenCount( element ) > 1 ) {
  35017. return null;
  35018. }
  35019. element = element.parent;
  35020. }
  35021. if ( !element || nonUiChildrenCount( element ) > 1 ) {
  35022. return null;
  35023. }
  35024. // Render block filler at the end of element (after all ui elements).
  35025. return this.childCount;
  35026. }
  35027. // Returns total count of children that are not {@link module:engine/view/uielement~UIElement UIElements}.
  35028. //
  35029. // @param {module:engine/view/element~Element} element
  35030. // @returns {Number}
  35031. function nonUiChildrenCount( element ) {
  35032. return Array.from( element.getChildren() ).filter( element => !element.is( 'uiElement' ) ).length;
  35033. }
  35034. /***/ }),
  35035. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/containerelement.js":
  35036. /*!******************************************************************************!*\
  35037. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/containerelement.js ***!
  35038. \******************************************************************************/
  35039. /*! exports provided: default, getFillerOffset */
  35040. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  35041. "use strict";
  35042. __webpack_require__.r(__webpack_exports__);
  35043. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ContainerElement; });
  35044. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getFillerOffset", function() { return getFillerOffset; });
  35045. /* harmony import */ var _element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./element */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/element.js");
  35046. /**
  35047. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  35048. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  35049. */
  35050. /**
  35051. * @module engine/view/containerelement
  35052. */
  35053. /**
  35054. * Containers are elements which define document structure. They define boundaries for
  35055. * {@link module:engine/view/attributeelement~AttributeElement attributes}. They are mostly used for block elements like `<p>` or `<div>`.
  35056. *
  35057. * Editing engine does not define a fixed HTML DTD. This is why a feature developer needs to choose between various
  35058. * types (container element, {@link module:engine/view/attributeelement~AttributeElement attribute element},
  35059. * {@link module:engine/view/emptyelement~EmptyElement empty element}, etc) when developing a feature.
  35060. *
  35061. * The container element should be your default choice when writing a converter, unless:
  35062. *
  35063. * * this element represents a model text attribute (then use {@link module:engine/view/attributeelement~AttributeElement}),
  35064. * * this is an empty element like `<img>` (then use {@link module:engine/view/emptyelement~EmptyElement}),
  35065. * * this is a root element,
  35066. * * this is a nested editable element (then use {@link module:engine/view/editableelement~EditableElement}).
  35067. *
  35068. * To create a new container element instance use the
  35069. * {@link module:engine/view/downcastwriter~DowncastWriter#createContainerElement `DowncastWriter#createContainerElement()`}
  35070. * method.
  35071. *
  35072. * @extends module:engine/view/element~Element
  35073. */
  35074. class ContainerElement extends _element__WEBPACK_IMPORTED_MODULE_0__["default"] {
  35075. /**
  35076. * Creates a container element.
  35077. *
  35078. * @see module:engine/view/downcastwriter~DowncastWriter#createContainerElement
  35079. * @see module:engine/view/element~Element
  35080. * @protected
  35081. * @param {module:engine/view/document~Document} document The document instance to which this element belongs.
  35082. * @param {String} name Node name.
  35083. * @param {Object|Iterable} [attrs] Collection of attributes.
  35084. * @param {module:engine/view/node~Node|Iterable.<module:engine/view/node~Node>} [children]
  35085. * A list of nodes to be inserted into created element.
  35086. */
  35087. constructor( document, name, attrs, children ) {
  35088. super( document, name, attrs, children );
  35089. /**
  35090. * Returns block {@link module:engine/view/filler filler} offset or `null` if block filler is not needed.
  35091. *
  35092. * @method #getFillerOffset
  35093. * @returns {Number|null} Block filler offset or `null` if block filler is not needed.
  35094. */
  35095. this.getFillerOffset = getFillerOffset;
  35096. }
  35097. /**
  35098. * Checks whether this object is of the given.
  35099. *
  35100. * containerElement.is( 'containerElement' ); // -> true
  35101. * containerElement.is( 'element' ); // -> true
  35102. * containerElement.is( 'node' ); // -> true
  35103. * containerElement.is( 'view:containerElement' ); // -> true
  35104. * containerElement.is( 'view:element' ); // -> true
  35105. * containerElement.is( 'view:node' ); // -> true
  35106. *
  35107. * containerElement.is( 'model:element' ); // -> false
  35108. * containerElement.is( 'documentFragment' ); // -> false
  35109. *
  35110. * Assuming that the object being checked is a container element, you can also check its
  35111. * {@link module:engine/view/containerelement~ContainerElement#name name}:
  35112. *
  35113. * containerElement.is( 'element', 'div' ); // -> true if this is a div container element
  35114. * containerElement.is( 'contaienrElement', 'div' ); // -> same as above
  35115. * text.is( 'element', 'div' ); -> false
  35116. *
  35117. * {@link module:engine/view/node~Node#is Check the entire list of view objects} which implement the `is()` method.
  35118. *
  35119. * @param {String} type Type to check.
  35120. * @param {String} [name] Element name.
  35121. * @returns {Boolean}
  35122. */
  35123. is( type, name = null ) {
  35124. if ( !name ) {
  35125. return type === 'containerElement' || type === 'view:containerElement' ||
  35126. // From super.is(). This is highly utilised method and cannot call super. See ckeditor/ckeditor5#6529.
  35127. type === 'element' || type === 'view:element' ||
  35128. type === 'node' || type === 'view:node';
  35129. } else {
  35130. return name === this.name && (
  35131. type === 'containerElement' || type === 'view:containerElement' ||
  35132. // From super.is(). This is highly utilised method and cannot call super. See ckeditor/ckeditor5#6529.
  35133. type === 'element' || type === 'view:element'
  35134. );
  35135. }
  35136. }
  35137. }
  35138. /**
  35139. * Returns block {@link module:engine/view/filler filler} offset or `null` if block filler is not needed.
  35140. *
  35141. * @returns {Number|null} Block filler offset or `null` if block filler is not needed.
  35142. */
  35143. function getFillerOffset() {
  35144. const children = [ ...this.getChildren() ];
  35145. const lastChild = children[ this.childCount - 1 ];
  35146. // Block filler is required after a `<br>` if it's the last element in its container. See #1422.
  35147. if ( lastChild && lastChild.is( 'element', 'br' ) ) {
  35148. return this.childCount;
  35149. }
  35150. for ( const child of children ) {
  35151. // If there's any non-UI element – don't render the bogus.
  35152. if ( !child.is( 'uiElement' ) ) {
  35153. return null;
  35154. }
  35155. }
  35156. // If there are only UI elements – render the bogus at the end of the element.
  35157. return this.childCount;
  35158. }
  35159. /***/ }),
  35160. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/document.js":
  35161. /*!**********************************************************************!*\
  35162. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/document.js ***!
  35163. \**********************************************************************/
  35164. /*! exports provided: default */
  35165. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  35166. "use strict";
  35167. __webpack_require__.r(__webpack_exports__);
  35168. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Document; });
  35169. /* harmony import */ var _documentselection__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./documentselection */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/documentselection.js");
  35170. /* 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");
  35171. /* 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");
  35172. /* harmony import */ var _observer_bubblingemittermixin__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./observer/bubblingemittermixin */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/bubblingemittermixin.js");
  35173. /* 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");
  35174. /**
  35175. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  35176. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  35177. */
  35178. /**
  35179. * @module engine/view/document
  35180. */
  35181. // @if CK_DEBUG_ENGINE // const { logDocument } = require( '../dev-utils/utils' );
  35182. /**
  35183. * Document class creates an abstract layer over the content editable area, contains a tree of view elements and
  35184. * {@link module:engine/view/documentselection~DocumentSelection view selection} associated with this document.
  35185. *
  35186. * @mixes module:engine/view/observer/bubblingemittermixin~BubblingEmitterMixin
  35187. * @mixes module:utils/observablemixin~ObservableMixin
  35188. */
  35189. class Document {
  35190. /**
  35191. * Creates a Document instance.
  35192. *
  35193. * @param {module:engine/view/stylesmap~StylesProcessor} stylesProcessor The styles processor instance.
  35194. */
  35195. constructor( stylesProcessor ) {
  35196. /**
  35197. * Selection done on this document.
  35198. *
  35199. * @readonly
  35200. * @member {module:engine/view/documentselection~DocumentSelection} module:engine/view/document~Document#selection
  35201. */
  35202. this.selection = new _documentselection__WEBPACK_IMPORTED_MODULE_0__["default"]();
  35203. /**
  35204. * Roots of the view tree. Collection of the {@link module:engine/view/element~Element view elements}.
  35205. *
  35206. * View roots are created as a result of binding between {@link module:engine/view/document~Document#roots} and
  35207. * {@link module:engine/model/document~Document#roots} and this is handled by
  35208. * {@link module:engine/controller/editingcontroller~EditingController}, so to create view root we need to create
  35209. * model root using {@link module:engine/model/document~Document#createRoot}.
  35210. *
  35211. * @readonly
  35212. * @member {module:utils/collection~Collection} module:engine/view/document~Document#roots
  35213. */
  35214. this.roots = new _ckeditor_ckeditor5_utils_src_collection__WEBPACK_IMPORTED_MODULE_1__["default"]( { idProperty: 'rootName' } );
  35215. /**
  35216. * The styles processor instance used by this document when normalizing styles.
  35217. *
  35218. * @readonly
  35219. * @member {module:engine/view/stylesmap~StylesProcessor}
  35220. */
  35221. this.stylesProcessor = stylesProcessor;
  35222. /**
  35223. * Defines whether document is in read-only mode.
  35224. *
  35225. * When document is read-ony then all roots are read-only as well and caret placed inside this root is hidden.
  35226. *
  35227. * @observable
  35228. * @member {Boolean} #isReadOnly
  35229. */
  35230. this.set( 'isReadOnly', false );
  35231. /**
  35232. * True if document is focused.
  35233. *
  35234. * This property is updated by the {@link module:engine/view/observer/focusobserver~FocusObserver}.
  35235. * If the {@link module:engine/view/observer/focusobserver~FocusObserver} is disabled this property will not change.
  35236. *
  35237. * @readonly
  35238. * @observable
  35239. * @member {Boolean} module:engine/view/document~Document#isFocused
  35240. */
  35241. this.set( 'isFocused', false );
  35242. /**
  35243. * True if composition is in progress inside the document.
  35244. *
  35245. * This property is updated by the {@link module:engine/view/observer/compositionobserver~CompositionObserver}.
  35246. * If the {@link module:engine/view/observer/compositionobserver~CompositionObserver} is disabled this property will not change.
  35247. *
  35248. * @readonly
  35249. * @observable
  35250. * @member {Boolean} module:engine/view/document~Document#isComposing
  35251. */
  35252. this.set( 'isComposing', false );
  35253. /**
  35254. * Post-fixer callbacks registered to the view document.
  35255. *
  35256. * @private
  35257. * @member {Set}
  35258. */
  35259. this._postFixers = new Set();
  35260. }
  35261. /**
  35262. * Gets a {@link module:engine/view/document~Document#roots view root element} with the specified name. If the name is not
  35263. * specific "main" root is returned.
  35264. *
  35265. * @param {String} [name='main'] Name of the root.
  35266. * @returns {module:engine/view/rooteditableelement~RootEditableElement|null} The view root element with the specified name
  35267. * or null when there is no root of given name.
  35268. */
  35269. getRoot( name = 'main' ) {
  35270. return this.roots.get( name );
  35271. }
  35272. /**
  35273. * Allows registering post-fixer callbacks. A post-fixers mechanism allows to update the view tree just before it is rendered
  35274. * to the DOM.
  35275. *
  35276. * Post-fixers are executed right after all changes from the outermost change block were applied but
  35277. * before the {@link module:engine/view/view~View#event:render render event} is fired. If a post-fixer callback made
  35278. * a change, it should return `true`. When this happens, all post-fixers are fired again to check if something else should
  35279. * not be fixed in the new document tree state.
  35280. *
  35281. * View post-fixers are useful when you want to apply some fixes whenever the view structure changes. Keep in mind that
  35282. * changes executed in a view post-fixer should not break model-view mapping.
  35283. *
  35284. * The types of changes which should be safe:
  35285. *
  35286. * * adding or removing attribute from elements,
  35287. * * changes inside of {@link module:engine/view/uielement~UIElement UI elements},
  35288. * * {@link module:engine/model/differ~Differ#refreshItem marking some of the model elements to be re-converted}.
  35289. *
  35290. * Try to avoid changes which touch view structure:
  35291. *
  35292. * * you should not add or remove nor wrap or unwrap any view elements,
  35293. * * you should not change the editor data model in a view post-fixer.
  35294. *
  35295. * As a parameter, a post-fixer callback receives a {@link module:engine/view/downcastwriter~DowncastWriter downcast writer}.
  35296. *
  35297. * Typically, a post-fixer will look like this:
  35298. *
  35299. * editor.editing.view.document.registerPostFixer( writer => {
  35300. * if ( checkSomeCondition() ) {
  35301. * writer.doSomething();
  35302. *
  35303. * // Let other post-fixers know that something changed.
  35304. * return true;
  35305. * }
  35306. * } );
  35307. *
  35308. * Note that nothing happens right after you register a post-fixer (e.g. execute such a code in the console).
  35309. * That is because adding a post-fixer does not execute it.
  35310. * The post-fixer will be executed as soon as any change in the document needs to cause its rendering.
  35311. * If you want to re-render the editor's view after registering the post-fixer then you should do it manually by calling
  35312. * {@link module:engine/view/view~View#forceRender `view.forceRender()`}.
  35313. *
  35314. * If you need to register a callback which is executed when DOM elements are already updated,
  35315. * use {@link module:engine/view/view~View#event:render render event}.
  35316. *
  35317. * @param {Function} postFixer
  35318. */
  35319. registerPostFixer( postFixer ) {
  35320. this._postFixers.add( postFixer );
  35321. }
  35322. /**
  35323. * Destroys this instance. Makes sure that all observers are destroyed and listeners removed.
  35324. */
  35325. destroy() {
  35326. this.roots.map( root => root.destroy() );
  35327. this.stopListening();
  35328. }
  35329. /**
  35330. * Performs post-fixer loops. Executes post-fixer callbacks as long as none of them has done any changes to the model.
  35331. *
  35332. * @protected
  35333. * @param {module:engine/view/downcastwriter~DowncastWriter} writer
  35334. */
  35335. _callPostFixers( writer ) {
  35336. let wasFixed = false;
  35337. do {
  35338. for ( const callback of this._postFixers ) {
  35339. wasFixed = callback( writer );
  35340. if ( wasFixed ) {
  35341. break;
  35342. }
  35343. }
  35344. } while ( wasFixed );
  35345. }
  35346. /**
  35347. * Event fired whenever document content layout changes. It is fired whenever content is
  35348. * {@link module:engine/view/view~View#event:render rendered}, but should be also fired by observers in case of
  35349. * other actions which may change layout, for instance when image loads.
  35350. *
  35351. * @event layoutChanged
  35352. */
  35353. // @if CK_DEBUG_ENGINE // log( version ) {
  35354. // @if CK_DEBUG_ENGINE // logDocument( this, version );
  35355. // @if CK_DEBUG_ENGINE // }
  35356. }
  35357. Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_2__["default"])( Document, _observer_bubblingemittermixin__WEBPACK_IMPORTED_MODULE_3__["default"] );
  35358. Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_2__["default"])( Document, _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_4__["default"] );
  35359. /**
  35360. * Enum representing type of the change.
  35361. *
  35362. * Possible values:
  35363. *
  35364. * * `children` - for child list changes,
  35365. * * `attributes` - for element attributes changes,
  35366. * * `text` - for text nodes changes.
  35367. *
  35368. * @typedef {String} module:engine/view/document~ChangeType
  35369. */
  35370. /***/ }),
  35371. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/documentfragment.js":
  35372. /*!******************************************************************************!*\
  35373. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/documentfragment.js ***!
  35374. \******************************************************************************/
  35375. /*! exports provided: default */
  35376. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  35377. "use strict";
  35378. __webpack_require__.r(__webpack_exports__);
  35379. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return DocumentFragment; });
  35380. /* harmony import */ var _text__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./text */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/text.js");
  35381. /* harmony import */ var _textproxy__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./textproxy */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/textproxy.js");
  35382. /* 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");
  35383. /* 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");
  35384. /* 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");
  35385. /**
  35386. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  35387. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  35388. */
  35389. /**
  35390. * @module engine/view/documentfragment
  35391. */
  35392. /**
  35393. * Document fragment.
  35394. *
  35395. * To create a new document fragment instance use the
  35396. * {@link module:engine/view/upcastwriter~UpcastWriter#createDocumentFragment `UpcastWriter#createDocumentFragment()`}
  35397. * method.
  35398. */
  35399. class DocumentFragment {
  35400. /**
  35401. * Creates new DocumentFragment instance.
  35402. *
  35403. * @protected
  35404. * @param {module:engine/view/document~Document} document The document to which this document fragment belongs.
  35405. * @param {module:engine/view/node~Node|Iterable.<module:engine/view/node~Node>} [children]
  35406. * A list of nodes to be inserted into the created document fragment.
  35407. */
  35408. constructor( document, children ) {
  35409. /**
  35410. * The document to which this document fragment belongs.
  35411. *
  35412. * @readonly
  35413. * @member {module:engine/view/document~Document}
  35414. */
  35415. this.document = document;
  35416. /**
  35417. * Array of child nodes.
  35418. *
  35419. * @protected
  35420. * @member {Array.<module:engine/view/element~Element>} module:engine/view/documentfragment~DocumentFragment#_children
  35421. */
  35422. this._children = [];
  35423. if ( children ) {
  35424. this._insertChild( 0, children );
  35425. }
  35426. }
  35427. /**
  35428. * Iterable interface.
  35429. *
  35430. * Iterates over nodes added to this document fragment.
  35431. *
  35432. * @returns {Iterable.<module:engine/view/node~Node>}
  35433. */
  35434. [ Symbol.iterator ]() {
  35435. return this._children[ Symbol.iterator ]();
  35436. }
  35437. /**
  35438. * Number of child nodes in this document fragment.
  35439. *
  35440. * @readonly
  35441. * @type {Number}
  35442. */
  35443. get childCount() {
  35444. return this._children.length;
  35445. }
  35446. /**
  35447. * Is `true` if there are no nodes inside this document fragment, `false` otherwise.
  35448. *
  35449. * @readonly
  35450. * @type {Boolean}
  35451. */
  35452. get isEmpty() {
  35453. return this.childCount === 0;
  35454. }
  35455. /**
  35456. * Artificial root of `DocumentFragment`. Returns itself. Added for compatibility reasons.
  35457. *
  35458. * @readonly
  35459. * @type {module:engine/model/documentfragment~DocumentFragment}
  35460. */
  35461. get root() {
  35462. return this;
  35463. }
  35464. /**
  35465. * Artificial parent of `DocumentFragment`. Returns `null`. Added for compatibility reasons.
  35466. *
  35467. * @readonly
  35468. * @type {null}
  35469. */
  35470. get parent() {
  35471. return null;
  35472. }
  35473. /**
  35474. * Checks whether this object is of the given type.
  35475. *
  35476. * docFrag.is( 'documentFragment' ); // -> true
  35477. * docFrag.is( 'view:documentFragment' ); // -> true
  35478. *
  35479. * docFrag.is( 'model:documentFragment' ); // -> false
  35480. * docFrag.is( 'element' ); // -> false
  35481. * docFrag.is( 'node' ); // -> false
  35482. *
  35483. * {@link module:engine/view/node~Node#is Check the entire list of view objects} which implement the `is()` method.
  35484. *
  35485. * @param {String} type
  35486. * @returns {Boolean}
  35487. */
  35488. is( type ) {
  35489. return type === 'documentFragment' || type === 'view:documentFragment';
  35490. }
  35491. /**
  35492. * {@link module:engine/view/documentfragment~DocumentFragment#_insertChild Insert} a child node or a list of child nodes at the end
  35493. * and sets the parent of these nodes to this fragment.
  35494. *
  35495. * @param {module:engine/view/item~Item|Iterable.<module:engine/view/item~Item>} items Items to be inserted.
  35496. * @returns {Number} Number of appended nodes.
  35497. */
  35498. _appendChild( items ) {
  35499. return this._insertChild( this.childCount, items );
  35500. }
  35501. /**
  35502. * Gets child at the given index.
  35503. *
  35504. * @param {Number} index Index of child.
  35505. * @returns {module:engine/view/node~Node} Child node.
  35506. */
  35507. getChild( index ) {
  35508. return this._children[ index ];
  35509. }
  35510. /**
  35511. * Gets index of the given child node. Returns `-1` if child node is not found.
  35512. *
  35513. * @param {module:engine/view/node~Node} node Child node.
  35514. * @returns {Number} Index of the child node.
  35515. */
  35516. getChildIndex( node ) {
  35517. return this._children.indexOf( node );
  35518. }
  35519. /**
  35520. * Gets child nodes iterator.
  35521. *
  35522. * @returns {Iterable.<module:engine/view/node~Node>} Child nodes iterator.
  35523. */
  35524. getChildren() {
  35525. return this._children[ Symbol.iterator ]();
  35526. }
  35527. /**
  35528. * Inserts a child node or a list of child nodes on the given index and sets the parent of these nodes to
  35529. * this fragment.
  35530. *
  35531. * @param {Number} index Position where nodes should be inserted.
  35532. * @param {module:engine/view/item~Item|Iterable.<module:engine/view/item~Item>} items Items to be inserted.
  35533. * @returns {Number} Number of inserted nodes.
  35534. */
  35535. _insertChild( index, items ) {
  35536. this._fireChange( 'children', this );
  35537. let count = 0;
  35538. const nodes = normalize( this.document, items );
  35539. for ( const node of nodes ) {
  35540. // If node that is being added to this element is already inside another element, first remove it from the old parent.
  35541. if ( node.parent !== null ) {
  35542. node._remove();
  35543. }
  35544. node.parent = this;
  35545. this._children.splice( index, 0, node );
  35546. index++;
  35547. count++;
  35548. }
  35549. return count;
  35550. }
  35551. /**
  35552. * Removes number of child nodes starting at the given index and set the parent of these nodes to `null`.
  35553. *
  35554. * @param {Number} index Number of the first node to remove.
  35555. * @param {Number} [howMany=1] Number of nodes to remove.
  35556. * @returns {Array.<module:engine/view/node~Node>} The array of removed nodes.
  35557. */
  35558. _removeChildren( index, howMany = 1 ) {
  35559. this._fireChange( 'children', this );
  35560. for ( let i = index; i < index + howMany; i++ ) {
  35561. this._children[ i ].parent = null;
  35562. }
  35563. return this._children.splice( index, howMany );
  35564. }
  35565. /**
  35566. * Fires `change` event with given type of the change.
  35567. *
  35568. * @private
  35569. * @param {module:engine/view/document~ChangeType} type Type of the change.
  35570. * @param {module:engine/view/node~Node} node Changed node.
  35571. * @fires module:engine/view/node~Node#change
  35572. */
  35573. _fireChange( type, node ) {
  35574. this.fire( 'change:' + type, node );
  35575. }
  35576. // @if CK_DEBUG_ENGINE // printTree() {
  35577. // @if CK_DEBUG_ENGINE // let string = 'ViewDocumentFragment: [';
  35578. // @if CK_DEBUG_ENGINE // for ( const child of this.getChildren() ) {
  35579. // @if CK_DEBUG_ENGINE // if ( child.is( '$text' ) ) {
  35580. // @if CK_DEBUG_ENGINE // string += '\n' + '\t'.repeat( 1 ) + child.data;
  35581. // @if CK_DEBUG_ENGINE // } else {
  35582. // @if CK_DEBUG_ENGINE // string += '\n' + child.printTree( 1 );
  35583. // @if CK_DEBUG_ENGINE // }
  35584. // @if CK_DEBUG_ENGINE // }
  35585. // @if CK_DEBUG_ENGINE // string += '\n]';
  35586. // @if CK_DEBUG_ENGINE // return string;
  35587. // @if CK_DEBUG_ENGINE // }
  35588. // @if CK_DEBUG_ENGINE // logTree() {
  35589. // @if CK_DEBUG_ENGINE // console.log( this.printTree() );
  35590. // @if CK_DEBUG_ENGINE // }
  35591. }
  35592. Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_2__["default"])( DocumentFragment, _ckeditor_ckeditor5_utils_src_emittermixin__WEBPACK_IMPORTED_MODULE_4__["default"] );
  35593. // Converts strings to Text and non-iterables to arrays.
  35594. //
  35595. // @param {String|module:engine/view/item~Item|Iterable.<String|module:engine/view/item~Item>}
  35596. // @returns {Iterable.<module:engine/view/node~Node>}
  35597. function normalize( document, nodes ) {
  35598. // Separate condition because string is iterable.
  35599. if ( typeof nodes == 'string' ) {
  35600. return [ new _text__WEBPACK_IMPORTED_MODULE_0__["default"]( document, nodes ) ];
  35601. }
  35602. if ( !Object(_ckeditor_ckeditor5_utils_src_isiterable__WEBPACK_IMPORTED_MODULE_3__["default"])( nodes ) ) {
  35603. nodes = [ nodes ];
  35604. }
  35605. // Array.from to enable .map() on non-arrays.
  35606. return Array.from( nodes )
  35607. .map( node => {
  35608. if ( typeof node == 'string' ) {
  35609. return new _text__WEBPACK_IMPORTED_MODULE_0__["default"]( document, node );
  35610. }
  35611. if ( node instanceof _textproxy__WEBPACK_IMPORTED_MODULE_1__["default"] ) {
  35612. return new _text__WEBPACK_IMPORTED_MODULE_0__["default"]( document, node.data );
  35613. }
  35614. return node;
  35615. } );
  35616. }
  35617. /***/ }),
  35618. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/documentselection.js":
  35619. /*!*******************************************************************************!*\
  35620. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/documentselection.js ***!
  35621. \*******************************************************************************/
  35622. /*! exports provided: default */
  35623. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  35624. "use strict";
  35625. __webpack_require__.r(__webpack_exports__);
  35626. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return DocumentSelection; });
  35627. /* harmony import */ var _selection__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./selection */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/selection.js");
  35628. /* 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");
  35629. /* 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");
  35630. /**
  35631. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  35632. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  35633. */
  35634. /**
  35635. * @module engine/view/documentselection
  35636. */
  35637. /**
  35638. * Class representing the document selection in the view.
  35639. *
  35640. * Its instance is available in {@link module:engine/view/document~Document#selection `Document#selection`}.
  35641. *
  35642. * It is similar to {@link module:engine/view/selection~Selection} but
  35643. * it has a read-only API and can be modified only by the writer available in
  35644. * the {@link module:engine/view/view~View#change `View#change()`} block
  35645. * (so via {@link module:engine/view/downcastwriter~DowncastWriter#setSelection `DowncastWriter#setSelection()`}).
  35646. */
  35647. class DocumentSelection {
  35648. /**
  35649. * Creates new DocumentSelection instance.
  35650. *
  35651. * // Creates empty selection without ranges.
  35652. * const selection = new DocumentSelection();
  35653. *
  35654. * // Creates selection at the given range.
  35655. * const range = writer.createRange( start, end );
  35656. * const selection = new DocumentSelection( range );
  35657. *
  35658. * // Creates selection at the given ranges
  35659. * const ranges = [ writer.createRange( start1, end2 ), writer.createRange( start2, end2 ) ];
  35660. * const selection = new DocumentSelection( ranges );
  35661. *
  35662. * // Creates selection from the other selection.
  35663. * const otherSelection = writer.createSelection();
  35664. * const selection = new DocumentSelection( otherSelection );
  35665. *
  35666. * // Creates selection at the given position.
  35667. * const position = writer.createPositionAt( root, offset );
  35668. * const selection = new DocumentSelection( position );
  35669. *
  35670. * // Creates collapsed selection at the position of given item and offset.
  35671. * const paragraph = writer.createContainerElement( 'paragraph' );
  35672. * const selection = new DocumentSelection( paragraph, offset );
  35673. *
  35674. * // Creates a range inside an {@link module:engine/view/element~Element element} which starts before the
  35675. * // first child of that element and ends after the last child of that element.
  35676. * const selection = new DocumentSelection( paragraph, 'in' );
  35677. *
  35678. * // Creates a range on an {@link module:engine/view/item~Item item} which starts before the item and ends
  35679. * // just after the item.
  35680. * const selection = new DocumentSelection( paragraph, 'on' );
  35681. *
  35682. * `Selection`'s constructor allow passing additional options (`backward`, `fake` and `label`) as the last argument.
  35683. *
  35684. * // Creates backward selection.
  35685. * const selection = new DocumentSelection( range, { backward: true } );
  35686. *
  35687. * Fake selection does not render as browser native selection over selected elements and is hidden to the user.
  35688. * This way, no native selection UI artifacts are displayed to the user and selection over elements can be
  35689. * represented in other way, for example by applying proper CSS class.
  35690. *
  35691. * Additionally fake's selection label can be provided. It will be used to describe fake selection in DOM
  35692. * (and be properly handled by screen readers).
  35693. *
  35694. * // Creates fake selection with label.
  35695. * const selection = new DocumentSelection( range, { fake: true, label: 'foo' } );
  35696. *
  35697. * @param {module:engine/view/selection~Selectable} [selectable=null]
  35698. * @param {Number|'before'|'end'|'after'|'on'|'in'} [placeOrOffset] Offset or place when selectable is an `Item`.
  35699. * @param {Object} [options]
  35700. * @param {Boolean} [options.backward] Sets this selection instance to be backward.
  35701. * @param {Boolean} [options.fake] Sets this selection instance to be marked as `fake`.
  35702. * @param {String} [options.label] Label for the fake selection.
  35703. */
  35704. constructor( selectable = null, placeOrOffset, options ) {
  35705. /**
  35706. * Selection is used internally (`DocumentSelection` is a proxy to that selection).
  35707. *
  35708. * @private
  35709. * @member {module:engine/view/selection~Selection}
  35710. */
  35711. this._selection = new _selection__WEBPACK_IMPORTED_MODULE_0__["default"]();
  35712. // Delegate change event to be fired on DocumentSelection instance.
  35713. this._selection.delegate( 'change' ).to( this );
  35714. // Set selection data.
  35715. this._selection.setTo( selectable, placeOrOffset, options );
  35716. }
  35717. /**
  35718. * Returns true if selection instance is marked as `fake`.
  35719. *
  35720. * @see #_setTo
  35721. * @type {Boolean}
  35722. */
  35723. get isFake() {
  35724. return this._selection.isFake;
  35725. }
  35726. /**
  35727. * Returns fake selection label.
  35728. *
  35729. * @see #_setTo
  35730. * @type {String}
  35731. */
  35732. get fakeSelectionLabel() {
  35733. return this._selection.fakeSelectionLabel;
  35734. }
  35735. /**
  35736. * Selection anchor. Anchor may be described as a position where the selection starts. Together with
  35737. * {@link #focus focus} they define the direction of selection, which is important
  35738. * when expanding/shrinking selection. Anchor is always the start or end of the most recent added range.
  35739. * It may be a bit unintuitive when there are multiple ranges in selection.
  35740. *
  35741. * @see #focus
  35742. * @type {module:engine/view/position~Position}
  35743. */
  35744. get anchor() {
  35745. return this._selection.anchor;
  35746. }
  35747. /**
  35748. * Selection focus. Focus is a position where the selection ends.
  35749. *
  35750. * @see #anchor
  35751. * @type {module:engine/view/position~Position}
  35752. */
  35753. get focus() {
  35754. return this._selection.focus;
  35755. }
  35756. /**
  35757. * Returns whether the selection is collapsed. Selection is collapsed when there is exactly one range which is
  35758. * collapsed.
  35759. *
  35760. * @type {Boolean}
  35761. */
  35762. get isCollapsed() {
  35763. return this._selection.isCollapsed;
  35764. }
  35765. /**
  35766. * Returns number of ranges in selection.
  35767. *
  35768. * @type {Number}
  35769. */
  35770. get rangeCount() {
  35771. return this._selection.rangeCount;
  35772. }
  35773. /**
  35774. * Specifies whether the {@link #focus} precedes {@link #anchor}.
  35775. *
  35776. * @type {Boolean}
  35777. */
  35778. get isBackward() {
  35779. return this._selection.isBackward;
  35780. }
  35781. /**
  35782. * {@link module:engine/view/editableelement~EditableElement EditableElement} instance that contains this selection, or `null`
  35783. * if the selection is not inside an editable element.
  35784. *
  35785. * @type {module:engine/view/editableelement~EditableElement|null}
  35786. */
  35787. get editableElement() {
  35788. return this._selection.editableElement;
  35789. }
  35790. /**
  35791. * Used for the compatibility with the {@link module:engine/view/selection~Selection#isEqual} method.
  35792. *
  35793. * @protected
  35794. */
  35795. get _ranges() {
  35796. return this._selection._ranges;
  35797. }
  35798. /**
  35799. * Returns an iterable that contains copies of all ranges added to the selection.
  35800. *
  35801. * @returns {Iterable.<module:engine/view/range~Range>}
  35802. */
  35803. * getRanges() {
  35804. yield* this._selection.getRanges();
  35805. }
  35806. /**
  35807. * Returns copy of the first range in the selection. First range is the one which
  35808. * {@link module:engine/view/range~Range#start start} position {@link module:engine/view/position~Position#isBefore is before} start
  35809. * position of all other ranges (not to confuse with the first range added to the selection).
  35810. * Returns `null` if no ranges are added to selection.
  35811. *
  35812. * @returns {module:engine/view/range~Range|null}
  35813. */
  35814. getFirstRange() {
  35815. return this._selection.getFirstRange();
  35816. }
  35817. /**
  35818. * Returns copy of the last range in the selection. Last range is the one which {@link module:engine/view/range~Range#end end}
  35819. * position {@link module:engine/view/position~Position#isAfter is after} end position of all other ranges (not to confuse
  35820. * with the last range added to the selection). Returns `null` if no ranges are added to selection.
  35821. *
  35822. * @returns {module:engine/view/range~Range|null}
  35823. */
  35824. getLastRange() {
  35825. return this._selection.getLastRange();
  35826. }
  35827. /**
  35828. * Returns copy of the first position in the selection. First position is the position that
  35829. * {@link module:engine/view/position~Position#isBefore is before} any other position in the selection ranges.
  35830. * Returns `null` if no ranges are added to selection.
  35831. *
  35832. * @returns {module:engine/view/position~Position|null}
  35833. */
  35834. getFirstPosition() {
  35835. return this._selection.getFirstPosition();
  35836. }
  35837. /**
  35838. * Returns copy of the last position in the selection. Last position is the position that
  35839. * {@link module:engine/view/position~Position#isAfter is after} any other position in the selection ranges.
  35840. * Returns `null` if no ranges are added to selection.
  35841. *
  35842. * @returns {module:engine/view/position~Position|null}
  35843. */
  35844. getLastPosition() {
  35845. return this._selection.getLastPosition();
  35846. }
  35847. /**
  35848. * Returns the selected element. {@link module:engine/view/element~Element Element} is considered as selected if there is only
  35849. * one range in the selection, and that range contains exactly one element.
  35850. * Returns `null` if there is no selected element.
  35851. *
  35852. * @returns {module:engine/view/element~Element|null}
  35853. */
  35854. getSelectedElement() {
  35855. return this._selection.getSelectedElement();
  35856. }
  35857. /**
  35858. * Checks whether, this selection is equal to given selection. Selections are equal if they have same directions,
  35859. * same number of ranges and all ranges from one selection equal to a range from other selection.
  35860. *
  35861. * @param {module:engine/view/selection~Selection|module:engine/view/documentselection~DocumentSelection} otherSelection
  35862. * Selection to compare with.
  35863. * @returns {Boolean} `true` if selections are equal, `false` otherwise.
  35864. */
  35865. isEqual( otherSelection ) {
  35866. return this._selection.isEqual( otherSelection );
  35867. }
  35868. /**
  35869. * Checks whether this selection is similar to given selection. Selections are similar if they have same directions, same
  35870. * number of ranges, and all {@link module:engine/view/range~Range#getTrimmed trimmed} ranges from one selection are
  35871. * equal to any trimmed range from other selection.
  35872. *
  35873. * @param {module:engine/view/selection~Selection|module:engine/view/documentselection~DocumentSelection} otherSelection
  35874. * Selection to compare with.
  35875. * @returns {Boolean} `true` if selections are similar, `false` otherwise.
  35876. */
  35877. isSimilar( otherSelection ) {
  35878. return this._selection.isSimilar( otherSelection );
  35879. }
  35880. /**
  35881. * Checks whether this object is of the given type.
  35882. *
  35883. * docSelection.is( 'selection' ); // -> true
  35884. * docSelection.is( 'documentSelection' ); // -> true
  35885. * docSelection.is( 'view:selection' ); // -> true
  35886. * docSelection.is( 'view:documentSelection' ); // -> true
  35887. *
  35888. * docSelection.is( 'model:documentSelection' ); // -> false
  35889. * docSelection.is( 'element' ); // -> false
  35890. * docSelection.is( 'node' ); // -> false
  35891. *
  35892. * {@link module:engine/view/node~Node#is Check the entire list of view objects} which implement the `is()` method.
  35893. *
  35894. * @param {String} type
  35895. * @returns {Boolean}
  35896. */
  35897. is( type ) {
  35898. return type === 'selection' ||
  35899. type == 'documentSelection' ||
  35900. type == 'view:selection' ||
  35901. type == 'view:documentSelection';
  35902. }
  35903. /**
  35904. * Sets this selection's ranges and direction to the specified location based on the given
  35905. * {@link module:engine/view/selection~Selectable selectable}.
  35906. *
  35907. * // Sets selection to the given range.
  35908. * const range = writer.createRange( start, end );
  35909. * documentSelection._setTo( range );
  35910. *
  35911. * // Sets selection to given ranges.
  35912. * const ranges = [ writer.createRange( start1, end2 ), writer.createRange( start2, end2 ) ];
  35913. * documentSelection._setTo( range );
  35914. *
  35915. * // Sets selection to the other selection.
  35916. * const otherSelection = writer.createSelection();
  35917. * documentSelection._setTo( otherSelection );
  35918. *
  35919. * // Sets collapsed selection at the given position.
  35920. * const position = writer.createPositionAt( root, offset );
  35921. * documentSelection._setTo( position );
  35922. *
  35923. * // Sets collapsed selection at the position of given item and offset.
  35924. * documentSelection._setTo( paragraph, offset );
  35925. *
  35926. * Creates a range inside an {@link module:engine/view/element~Element element} which starts before the first child of
  35927. * that element and ends after the last child of that element.
  35928. *
  35929. * documentSelection._setTo( paragraph, 'in' );
  35930. *
  35931. * Creates a range on an {@link module:engine/view/item~Item item} which starts before the item and ends just after the item.
  35932. *
  35933. * documentSelection._setTo( paragraph, 'on' );
  35934. *
  35935. * // Clears selection. Removes all ranges.
  35936. * documentSelection._setTo( null );
  35937. *
  35938. * `Selection#_setTo()` method allow passing additional options (`backward`, `fake` and `label`) as the last argument.
  35939. *
  35940. * // Sets selection as backward.
  35941. * documentSelection._setTo( range, { backward: true } );
  35942. *
  35943. * Fake selection does not render as browser native selection over selected elements and is hidden to the user.
  35944. * This way, no native selection UI artifacts are displayed to the user and selection over elements can be
  35945. * represented in other way, for example by applying proper CSS class.
  35946. *
  35947. * Additionally fake's selection label can be provided. It will be used to des cribe fake selection in DOM
  35948. * (and be properly handled by screen readers).
  35949. *
  35950. * // Creates fake selection with label.
  35951. * documentSelection._setTo( range, { fake: true, label: 'foo' } );
  35952. *
  35953. * @protected
  35954. * @fires change
  35955. * @param {module:engine/view/selection~Selectable} selectable
  35956. * @param {Number|'before'|'end'|'after'|'on'|'in'} [placeOrOffset] Sets place or offset of the selection.
  35957. * @param {Object} [options]
  35958. * @param {Boolean} [options.backward] Sets this selection instance to be backward.
  35959. * @param {Boolean} [options.fake] Sets this selection instance to be marked as `fake`.
  35960. * @param {String} [options.label] Label for the fake selection.
  35961. */
  35962. _setTo( selectable, placeOrOffset, options ) {
  35963. this._selection.setTo( selectable, placeOrOffset, options );
  35964. }
  35965. /**
  35966. * Moves {@link #focus} to the specified location.
  35967. *
  35968. * The location can be specified in the same form as {@link module:engine/view/view~View#createPositionAt view.createPositionAt()}
  35969. * parameters.
  35970. *
  35971. * @protected
  35972. * @fires change
  35973. * @param {module:engine/view/item~Item|module:engine/view/position~Position} itemOrPosition
  35974. * @param {Number|'end'|'before'|'after'} [offset] Offset or one of the flags. Used only when
  35975. * first parameter is a {@link module:engine/view/item~Item view item}.
  35976. */
  35977. _setFocus( itemOrPosition, offset ) {
  35978. this._selection.setFocus( itemOrPosition, offset );
  35979. }
  35980. /**
  35981. * Fired whenever selection ranges are changed through {@link ~DocumentSelection Selection API}.
  35982. *
  35983. * @event change
  35984. */
  35985. }
  35986. Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_1__["default"])( DocumentSelection, _ckeditor_ckeditor5_utils_src_emittermixin__WEBPACK_IMPORTED_MODULE_2__["default"] );
  35987. /***/ }),
  35988. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/domconverter.js":
  35989. /*!**************************************************************************!*\
  35990. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/domconverter.js ***!
  35991. \**************************************************************************/
  35992. /*! exports provided: default */
  35993. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  35994. "use strict";
  35995. __webpack_require__.r(__webpack_exports__);
  35996. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return DomConverter; });
  35997. /* harmony import */ var _text__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./text */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/text.js");
  35998. /* harmony import */ var _element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./element */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/element.js");
  35999. /* harmony import */ var _position__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./position */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/position.js");
  36000. /* harmony import */ var _range__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./range */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/range.js");
  36001. /* harmony import */ var _selection__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./selection */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/selection.js");
  36002. /* harmony import */ var _documentfragment__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./documentfragment */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/documentfragment.js");
  36003. /* harmony import */ var _treewalker__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./treewalker */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/treewalker.js");
  36004. /* harmony import */ var _matcher__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./matcher */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/matcher.js");
  36005. /* harmony import */ var _filler__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./filler */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/filler.js");
  36006. /* harmony import */ var _ckeditor_ckeditor5_utils_src_dom_global__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/dom/global */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/global.js");
  36007. /* harmony import */ var _ckeditor_ckeditor5_utils_src_dom_indexof__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/dom/indexof */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/indexof.js");
  36008. /* harmony import */ var _ckeditor_ckeditor5_utils_src_dom_getancestors__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/dom/getancestors */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/getancestors.js");
  36009. /* harmony import */ var _ckeditor_ckeditor5_utils_src_dom_getcommonancestor__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/dom/getcommonancestor */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/getcommonancestor.js");
  36010. /* harmony import */ var _ckeditor_ckeditor5_utils_src_dom_istext__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/dom/istext */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/istext.js");
  36011. /* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! lodash-es */ "./node_modules/lodash-es/lodash.js");
  36012. /**
  36013. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  36014. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  36015. */
  36016. /**
  36017. * @module engine/view/domconverter
  36018. */
  36019. /* globals document, Node, NodeFilter, Text */
  36020. const BR_FILLER_REF = Object(_filler__WEBPACK_IMPORTED_MODULE_8__["BR_FILLER"])( document ); // eslint-disable-line new-cap
  36021. const NBSP_FILLER_REF = Object(_filler__WEBPACK_IMPORTED_MODULE_8__["NBSP_FILLER"])( document ); // eslint-disable-line new-cap
  36022. const MARKED_NBSP_FILLER_REF = Object(_filler__WEBPACK_IMPORTED_MODULE_8__["MARKED_NBSP_FILLER"])( document ); // eslint-disable-line new-cap
  36023. /**
  36024. * `DomConverter` is a set of tools to do transformations between DOM nodes and view nodes. It also handles
  36025. * {@link module:engine/view/domconverter~DomConverter#bindElements bindings} between these nodes.
  36026. *
  36027. * An instance of the DOM converter is available under
  36028. * {@link module:engine/view/view~View#domConverter `editor.editing.view.domConverter`}.
  36029. *
  36030. * The DOM converter does not check which nodes should be rendered (use {@link module:engine/view/renderer~Renderer}), does not keep the
  36031. * state of a tree nor keeps the synchronization between the tree view and the DOM tree (use {@link module:engine/view/document~Document}).
  36032. *
  36033. * The DOM converter keeps DOM elements to view element bindings, so when the converter gets destroyed, the bindings are lost.
  36034. * Two converters will keep separate binding maps, so one tree view can be bound with two DOM trees.
  36035. */
  36036. class DomConverter {
  36037. /**
  36038. * Creates a DOM converter.
  36039. *
  36040. * @param {module:engine/view/document~Document} document The view document instance.
  36041. * @param {Object} options An object with configuration options.
  36042. * @param {module:engine/view/filler~BlockFillerMode} [options.blockFillerMode='br'] The type of the block filler to use.
  36043. */
  36044. constructor( document, options = {} ) {
  36045. /**
  36046. * @readonly
  36047. * @type {module:engine/view/document~Document}
  36048. */
  36049. this.document = document;
  36050. /**
  36051. * The mode of a block filler used by the DOM converter.
  36052. *
  36053. * @member {'br'|'nbsp'|'markedNbsp'} module:engine/view/domconverter~DomConverter#blockFillerMode
  36054. */
  36055. this.blockFillerMode = options.blockFillerMode || 'br';
  36056. /**
  36057. * Elements which are considered pre-formatted elements.
  36058. *
  36059. * @readonly
  36060. * @member {Array.<String>} module:engine/view/domconverter~DomConverter#preElements
  36061. */
  36062. this.preElements = [ 'pre' ];
  36063. /**
  36064. * Elements which are considered block elements (and hence should be filled with a
  36065. * {@link #isBlockFiller block filler}).
  36066. *
  36067. * Whether an element is considered a block element also affects handling of trailing whitespaces.
  36068. *
  36069. * You can extend this array if you introduce support for block elements which are not yet recognized here.
  36070. *
  36071. * @readonly
  36072. * @member {Array.<String>} module:engine/view/domconverter~DomConverter#blockElements
  36073. */
  36074. this.blockElements = [ 'p', 'div', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'li', 'dd', 'dt', 'figcaption', 'td', 'th' ];
  36075. /**
  36076. * The DOM-to-view mapping.
  36077. *
  36078. * @private
  36079. * @member {WeakMap} module:engine/view/domconverter~DomConverter#_domToViewMapping
  36080. */
  36081. this._domToViewMapping = new WeakMap();
  36082. /**
  36083. * The view-to-DOM mapping.
  36084. *
  36085. * @private
  36086. * @member {WeakMap} module:engine/view/domconverter~DomConverter#_viewToDomMapping
  36087. */
  36088. this._viewToDomMapping = new WeakMap();
  36089. /**
  36090. * Holds the mapping between fake selection containers and corresponding view selections.
  36091. *
  36092. * @private
  36093. * @member {WeakMap} module:engine/view/domconverter~DomConverter#_fakeSelectionMapping
  36094. */
  36095. this._fakeSelectionMapping = new WeakMap();
  36096. /**
  36097. * Matcher for view elements whose content should be treated as raw data
  36098. * and not processed during the conversion from DOM nodes to view elements.
  36099. *
  36100. * @private
  36101. * @type {module:engine/view/matcher~Matcher}
  36102. */
  36103. this._rawContentElementMatcher = new _matcher__WEBPACK_IMPORTED_MODULE_7__["default"]();
  36104. /**
  36105. * A set of encountered raw content DOM nodes. It is used for preventing left trimming of the following text node.
  36106. *
  36107. * @private
  36108. * @type {WeakSet.<Node>}
  36109. */
  36110. this._encounteredRawContentDomNodes = new WeakSet();
  36111. }
  36112. /**
  36113. * Binds a given DOM element that represents fake selection to a **position** of a
  36114. * {@link module:engine/view/documentselection~DocumentSelection document selection}.
  36115. * Document selection copy is stored and can be retrieved by the
  36116. * {@link module:engine/view/domconverter~DomConverter#fakeSelectionToView} method.
  36117. *
  36118. * @param {HTMLElement} domElement
  36119. * @param {module:engine/view/documentselection~DocumentSelection} viewDocumentSelection
  36120. */
  36121. bindFakeSelection( domElement, viewDocumentSelection ) {
  36122. this._fakeSelectionMapping.set( domElement, new _selection__WEBPACK_IMPORTED_MODULE_4__["default"]( viewDocumentSelection ) );
  36123. }
  36124. /**
  36125. * Returns a {@link module:engine/view/selection~Selection view selection} instance corresponding to a given
  36126. * DOM element that represents fake selection. Returns `undefined` if binding to the given DOM element does not exist.
  36127. *
  36128. * @param {HTMLElement} domElement
  36129. * @returns {module:engine/view/selection~Selection|undefined}
  36130. */
  36131. fakeSelectionToView( domElement ) {
  36132. return this._fakeSelectionMapping.get( domElement );
  36133. }
  36134. /**
  36135. * Binds DOM and view elements, so it will be possible to get corresponding elements using
  36136. * {@link module:engine/view/domconverter~DomConverter#mapDomToView} and
  36137. * {@link module:engine/view/domconverter~DomConverter#mapViewToDom}.
  36138. *
  36139. * @param {HTMLElement} domElement The DOM element to bind.
  36140. * @param {module:engine/view/element~Element} viewElement The view element to bind.
  36141. */
  36142. bindElements( domElement, viewElement ) {
  36143. this._domToViewMapping.set( domElement, viewElement );
  36144. this._viewToDomMapping.set( viewElement, domElement );
  36145. }
  36146. /**
  36147. * Unbinds a given DOM element from the view element it was bound to. Unbinding is deep, meaning that all children of
  36148. * the DOM element will be unbound too.
  36149. *
  36150. * @param {HTMLElement} domElement The DOM element to unbind.
  36151. */
  36152. unbindDomElement( domElement ) {
  36153. const viewElement = this._domToViewMapping.get( domElement );
  36154. if ( viewElement ) {
  36155. this._domToViewMapping.delete( domElement );
  36156. this._viewToDomMapping.delete( viewElement );
  36157. for ( const child of domElement.childNodes ) {
  36158. this.unbindDomElement( child );
  36159. }
  36160. }
  36161. }
  36162. /**
  36163. * Binds DOM and view document fragments, so it will be possible to get corresponding document fragments using
  36164. * {@link module:engine/view/domconverter~DomConverter#mapDomToView} and
  36165. * {@link module:engine/view/domconverter~DomConverter#mapViewToDom}.
  36166. *
  36167. * @param {DocumentFragment} domFragment The DOM document fragment to bind.
  36168. * @param {module:engine/view/documentfragment~DocumentFragment} viewFragment The view document fragment to bind.
  36169. */
  36170. bindDocumentFragments( domFragment, viewFragment ) {
  36171. this._domToViewMapping.set( domFragment, viewFragment );
  36172. this._viewToDomMapping.set( viewFragment, domFragment );
  36173. }
  36174. /**
  36175. * Converts the view to the DOM. For all text nodes, not bound elements and document fragments new items will
  36176. * be created. For bound elements and document fragments the method will return corresponding items.
  36177. *
  36178. * @param {module:engine/view/node~Node|module:engine/view/documentfragment~DocumentFragment} viewNode
  36179. * View node or document fragment to transform.
  36180. * @param {Document} domDocument Document which will be used to create DOM nodes.
  36181. * @param {Object} [options] Conversion options.
  36182. * @param {Boolean} [options.bind=false] Determines whether new elements will be bound.
  36183. * @param {Boolean} [options.withChildren=true] If `true`, node's and document fragment's children will be converted too.
  36184. * @returns {Node|DocumentFragment} Converted node or DocumentFragment.
  36185. */
  36186. viewToDom( viewNode, domDocument, options = {} ) {
  36187. if ( viewNode.is( '$text' ) ) {
  36188. const textData = this._processDataFromViewText( viewNode );
  36189. return domDocument.createTextNode( textData );
  36190. } else {
  36191. if ( this.mapViewToDom( viewNode ) ) {
  36192. return this.mapViewToDom( viewNode );
  36193. }
  36194. let domElement;
  36195. if ( viewNode.is( 'documentFragment' ) ) {
  36196. // Create DOM document fragment.
  36197. domElement = domDocument.createDocumentFragment();
  36198. if ( options.bind ) {
  36199. this.bindDocumentFragments( domElement, viewNode );
  36200. }
  36201. } else if ( viewNode.is( 'uiElement' ) ) {
  36202. // UIElement has its own render() method (see #799).
  36203. domElement = viewNode.render( domDocument );
  36204. if ( options.bind ) {
  36205. this.bindElements( domElement, viewNode );
  36206. }
  36207. return domElement;
  36208. } else {
  36209. // Create DOM element.
  36210. if ( viewNode.hasAttribute( 'xmlns' ) ) {
  36211. domElement = domDocument.createElementNS( viewNode.getAttribute( 'xmlns' ), viewNode.name );
  36212. } else {
  36213. domElement = domDocument.createElement( viewNode.name );
  36214. }
  36215. // RawElement take care of their children in RawElement#render() method which can be customized
  36216. // (see https://github.com/ckeditor/ckeditor5/issues/4469).
  36217. if ( viewNode.is( 'rawElement' ) ) {
  36218. viewNode.render( domElement );
  36219. }
  36220. if ( options.bind ) {
  36221. this.bindElements( domElement, viewNode );
  36222. }
  36223. // Copy element's attributes.
  36224. for ( const key of viewNode.getAttributeKeys() ) {
  36225. domElement.setAttribute( key, viewNode.getAttribute( key ) );
  36226. }
  36227. }
  36228. if ( options.withChildren !== false ) {
  36229. for ( const child of this.viewChildrenToDom( viewNode, domDocument, options ) ) {
  36230. domElement.appendChild( child );
  36231. }
  36232. }
  36233. return domElement;
  36234. }
  36235. }
  36236. /**
  36237. * Converts children of the view element to DOM using the
  36238. * {@link module:engine/view/domconverter~DomConverter#viewToDom} method.
  36239. * Additionally, this method adds block {@link module:engine/view/filler filler} to the list of children, if needed.
  36240. *
  36241. * @param {module:engine/view/element~Element|module:engine/view/documentfragment~DocumentFragment} viewElement Parent view element.
  36242. * @param {Document} domDocument Document which will be used to create DOM nodes.
  36243. * @param {Object} options See {@link module:engine/view/domconverter~DomConverter#viewToDom} options parameter.
  36244. * @returns {Iterable.<Node>} DOM nodes.
  36245. */
  36246. * viewChildrenToDom( viewElement, domDocument, options = {} ) {
  36247. const fillerPositionOffset = viewElement.getFillerOffset && viewElement.getFillerOffset();
  36248. let offset = 0;
  36249. for ( const childView of viewElement.getChildren() ) {
  36250. if ( fillerPositionOffset === offset ) {
  36251. yield this._getBlockFiller( domDocument );
  36252. }
  36253. yield this.viewToDom( childView, domDocument, options );
  36254. offset++;
  36255. }
  36256. if ( fillerPositionOffset === offset ) {
  36257. yield this._getBlockFiller( domDocument );
  36258. }
  36259. }
  36260. /**
  36261. * Converts view {@link module:engine/view/range~Range} to DOM range.
  36262. * Inline and block {@link module:engine/view/filler fillers} are handled during the conversion.
  36263. *
  36264. * @param {module:engine/view/range~Range} viewRange View range.
  36265. * @returns {Range} DOM range.
  36266. */
  36267. viewRangeToDom( viewRange ) {
  36268. const domStart = this.viewPositionToDom( viewRange.start );
  36269. const domEnd = this.viewPositionToDom( viewRange.end );
  36270. const domRange = document.createRange();
  36271. domRange.setStart( domStart.parent, domStart.offset );
  36272. domRange.setEnd( domEnd.parent, domEnd.offset );
  36273. return domRange;
  36274. }
  36275. /**
  36276. * Converts view {@link module:engine/view/position~Position} to DOM parent and offset.
  36277. *
  36278. * Inline and block {@link module:engine/view/filler fillers} are handled during the conversion.
  36279. * If the converted position is directly before inline filler it is moved inside the filler.
  36280. *
  36281. * @param {module:engine/view/position~Position} viewPosition View position.
  36282. * @returns {Object|null} position DOM position or `null` if view position could not be converted to DOM.
  36283. * @returns {Node} position.parent DOM position parent.
  36284. * @returns {Number} position.offset DOM position offset.
  36285. */
  36286. viewPositionToDom( viewPosition ) {
  36287. const viewParent = viewPosition.parent;
  36288. if ( viewParent.is( '$text' ) ) {
  36289. const domParent = this.findCorrespondingDomText( viewParent );
  36290. if ( !domParent ) {
  36291. // Position is in a view text node that has not been rendered to DOM yet.
  36292. return null;
  36293. }
  36294. let offset = viewPosition.offset;
  36295. if ( Object(_filler__WEBPACK_IMPORTED_MODULE_8__["startsWithFiller"])( domParent ) ) {
  36296. offset += _filler__WEBPACK_IMPORTED_MODULE_8__["INLINE_FILLER_LENGTH"];
  36297. }
  36298. return { parent: domParent, offset };
  36299. } else {
  36300. // viewParent is instance of ViewElement.
  36301. let domParent, domBefore, domAfter;
  36302. if ( viewPosition.offset === 0 ) {
  36303. domParent = this.mapViewToDom( viewParent );
  36304. if ( !domParent ) {
  36305. // Position is in a view element that has not been rendered to DOM yet.
  36306. return null;
  36307. }
  36308. domAfter = domParent.childNodes[ 0 ];
  36309. } else {
  36310. const nodeBefore = viewPosition.nodeBefore;
  36311. domBefore = nodeBefore.is( '$text' ) ?
  36312. this.findCorrespondingDomText( nodeBefore ) :
  36313. this.mapViewToDom( viewPosition.nodeBefore );
  36314. if ( !domBefore ) {
  36315. // Position is after a view element that has not been rendered to DOM yet.
  36316. return null;
  36317. }
  36318. domParent = domBefore.parentNode;
  36319. domAfter = domBefore.nextSibling;
  36320. }
  36321. // If there is an inline filler at position return position inside the filler. We should never return
  36322. // the position before the inline filler.
  36323. if ( Object(_ckeditor_ckeditor5_utils_src_dom_istext__WEBPACK_IMPORTED_MODULE_13__["default"])( domAfter ) && Object(_filler__WEBPACK_IMPORTED_MODULE_8__["startsWithFiller"])( domAfter ) ) {
  36324. return { parent: domAfter, offset: _filler__WEBPACK_IMPORTED_MODULE_8__["INLINE_FILLER_LENGTH"] };
  36325. }
  36326. const offset = domBefore ? Object(_ckeditor_ckeditor5_utils_src_dom_indexof__WEBPACK_IMPORTED_MODULE_10__["default"])( domBefore ) + 1 : 0;
  36327. return { parent: domParent, offset };
  36328. }
  36329. }
  36330. /**
  36331. * Converts DOM to view. For all text nodes, not bound elements and document fragments new items will
  36332. * be created. For bound elements and document fragments function will return corresponding items. For
  36333. * {@link module:engine/view/filler fillers} `null` will be returned.
  36334. * For all DOM elements rendered by {@link module:engine/view/uielement~UIElement} that UIElement will be returned.
  36335. *
  36336. * @param {Node|DocumentFragment} domNode DOM node or document fragment to transform.
  36337. * @param {Object} [options] Conversion options.
  36338. * @param {Boolean} [options.bind=false] Determines whether new elements will be bound.
  36339. * @param {Boolean} [options.withChildren=true] If `true`, node's and document fragment's children will be converted too.
  36340. * @param {Boolean} [options.keepOriginalCase=false] If `false`, node's tag name will be converter to lower case.
  36341. * @returns {module:engine/view/node~Node|module:engine/view/documentfragment~DocumentFragment|null} Converted node or document fragment
  36342. * or `null` if DOM node is a {@link module:engine/view/filler filler} or the given node is an empty text node.
  36343. */
  36344. domToView( domNode, options = {} ) {
  36345. if ( this.isBlockFiller( domNode ) ) {
  36346. return null;
  36347. }
  36348. // When node is inside a UIElement or a RawElement return that parent as it's view representation.
  36349. const hostElement = this.getHostViewElement( domNode );
  36350. if ( hostElement ) {
  36351. return hostElement;
  36352. }
  36353. if ( Object(_ckeditor_ckeditor5_utils_src_dom_istext__WEBPACK_IMPORTED_MODULE_13__["default"])( domNode ) ) {
  36354. if ( Object(_filler__WEBPACK_IMPORTED_MODULE_8__["isInlineFiller"])( domNode ) ) {
  36355. return null;
  36356. } else {
  36357. const textData = this._processDataFromDomText( domNode );
  36358. return textData === '' ? null : new _text__WEBPACK_IMPORTED_MODULE_0__["default"]( this.document, textData );
  36359. }
  36360. } else if ( this.isComment( domNode ) ) {
  36361. return null;
  36362. } else {
  36363. if ( this.mapDomToView( domNode ) ) {
  36364. return this.mapDomToView( domNode );
  36365. }
  36366. let viewElement;
  36367. if ( this.isDocumentFragment( domNode ) ) {
  36368. // Create view document fragment.
  36369. viewElement = new _documentfragment__WEBPACK_IMPORTED_MODULE_5__["default"]( this.document );
  36370. if ( options.bind ) {
  36371. this.bindDocumentFragments( domNode, viewElement );
  36372. }
  36373. } else {
  36374. // Create view element.
  36375. const viewName = options.keepOriginalCase ? domNode.tagName : domNode.tagName.toLowerCase();
  36376. viewElement = new _element__WEBPACK_IMPORTED_MODULE_1__["default"]( this.document, viewName );
  36377. if ( options.bind ) {
  36378. this.bindElements( domNode, viewElement );
  36379. }
  36380. // Copy element's attributes.
  36381. const attrs = domNode.attributes;
  36382. for ( let i = attrs.length - 1; i >= 0; i-- ) {
  36383. viewElement._setAttribute( attrs[ i ].name, attrs[ i ].value );
  36384. }
  36385. // Treat this element's content as a raw data if it was registered as such.
  36386. if ( options.withChildren !== false && this._rawContentElementMatcher.match( viewElement ) ) {
  36387. viewElement._setCustomProperty( '$rawContent', domNode.innerHTML );
  36388. // Store a DOM node to prevent left trimming of the following text node.
  36389. this._encounteredRawContentDomNodes.add( domNode );
  36390. return viewElement;
  36391. }
  36392. }
  36393. if ( options.withChildren !== false ) {
  36394. for ( const child of this.domChildrenToView( domNode, options ) ) {
  36395. viewElement._appendChild( child );
  36396. }
  36397. }
  36398. return viewElement;
  36399. }
  36400. }
  36401. /**
  36402. * Converts children of the DOM element to view nodes using
  36403. * the {@link module:engine/view/domconverter~DomConverter#domToView} method.
  36404. * Additionally this method omits block {@link module:engine/view/filler filler}, if it exists in the DOM parent.
  36405. *
  36406. * @param {HTMLElement} domElement Parent DOM element.
  36407. * @param {Object} options See {@link module:engine/view/domconverter~DomConverter#domToView} options parameter.
  36408. * @returns {Iterable.<module:engine/view/node~Node>} View nodes.
  36409. */
  36410. * domChildrenToView( domElement, options = {} ) {
  36411. for ( let i = 0; i < domElement.childNodes.length; i++ ) {
  36412. const domChild = domElement.childNodes[ i ];
  36413. const viewChild = this.domToView( domChild, options );
  36414. if ( viewChild !== null ) {
  36415. yield viewChild;
  36416. }
  36417. }
  36418. }
  36419. /**
  36420. * Converts DOM selection to view {@link module:engine/view/selection~Selection}.
  36421. * Ranges which cannot be converted will be omitted.
  36422. *
  36423. * @param {Selection} domSelection DOM selection.
  36424. * @returns {module:engine/view/selection~Selection} View selection.
  36425. */
  36426. domSelectionToView( domSelection ) {
  36427. // DOM selection might be placed in fake selection container.
  36428. // If container contains fake selection - return corresponding view selection.
  36429. if ( domSelection.rangeCount === 1 ) {
  36430. let container = domSelection.getRangeAt( 0 ).startContainer;
  36431. // The DOM selection might be moved to the text node inside the fake selection container.
  36432. if ( Object(_ckeditor_ckeditor5_utils_src_dom_istext__WEBPACK_IMPORTED_MODULE_13__["default"])( container ) ) {
  36433. container = container.parentNode;
  36434. }
  36435. const viewSelection = this.fakeSelectionToView( container );
  36436. if ( viewSelection ) {
  36437. return viewSelection;
  36438. }
  36439. }
  36440. const isBackward = this.isDomSelectionBackward( domSelection );
  36441. const viewRanges = [];
  36442. for ( let i = 0; i < domSelection.rangeCount; i++ ) {
  36443. // DOM Range have correct start and end, no matter what is the DOM Selection direction. So we don't have to fix anything.
  36444. const domRange = domSelection.getRangeAt( i );
  36445. const viewRange = this.domRangeToView( domRange );
  36446. if ( viewRange ) {
  36447. viewRanges.push( viewRange );
  36448. }
  36449. }
  36450. return new _selection__WEBPACK_IMPORTED_MODULE_4__["default"]( viewRanges, { backward: isBackward } );
  36451. }
  36452. /**
  36453. * Converts DOM Range to view {@link module:engine/view/range~Range}.
  36454. * If the start or end position can not be converted `null` is returned.
  36455. *
  36456. * @param {Range} domRange DOM range.
  36457. * @returns {module:engine/view/range~Range|null} View range.
  36458. */
  36459. domRangeToView( domRange ) {
  36460. const viewStart = this.domPositionToView( domRange.startContainer, domRange.startOffset );
  36461. const viewEnd = this.domPositionToView( domRange.endContainer, domRange.endOffset );
  36462. if ( viewStart && viewEnd ) {
  36463. return new _range__WEBPACK_IMPORTED_MODULE_3__["default"]( viewStart, viewEnd );
  36464. }
  36465. return null;
  36466. }
  36467. /**
  36468. * Converts DOM parent and offset to view {@link module:engine/view/position~Position}.
  36469. *
  36470. * If the position is inside a {@link module:engine/view/filler filler} which has no corresponding view node,
  36471. * position of the filler will be converted and returned.
  36472. *
  36473. * If the position is inside DOM element rendered by {@link module:engine/view/uielement~UIElement}
  36474. * that position will be converted to view position before that UIElement.
  36475. *
  36476. * If structures are too different and it is not possible to find corresponding position then `null` will be returned.
  36477. *
  36478. * @param {Node} domParent DOM position parent.
  36479. * @param {Number} domOffset DOM position offset.
  36480. * @returns {module:engine/view/position~Position} viewPosition View position.
  36481. */
  36482. domPositionToView( domParent, domOffset ) {
  36483. if ( this.isBlockFiller( domParent ) ) {
  36484. return this.domPositionToView( domParent.parentNode, Object(_ckeditor_ckeditor5_utils_src_dom_indexof__WEBPACK_IMPORTED_MODULE_10__["default"])( domParent ) );
  36485. }
  36486. // If position is somewhere inside UIElement or a RawElement - return position before that element.
  36487. const viewElement = this.mapDomToView( domParent );
  36488. if ( viewElement && ( viewElement.is( 'uiElement' ) || viewElement.is( 'rawElement' ) ) ) {
  36489. return _position__WEBPACK_IMPORTED_MODULE_2__["default"]._createBefore( viewElement );
  36490. }
  36491. if ( Object(_ckeditor_ckeditor5_utils_src_dom_istext__WEBPACK_IMPORTED_MODULE_13__["default"])( domParent ) ) {
  36492. if ( Object(_filler__WEBPACK_IMPORTED_MODULE_8__["isInlineFiller"])( domParent ) ) {
  36493. return this.domPositionToView( domParent.parentNode, Object(_ckeditor_ckeditor5_utils_src_dom_indexof__WEBPACK_IMPORTED_MODULE_10__["default"])( domParent ) );
  36494. }
  36495. const viewParent = this.findCorrespondingViewText( domParent );
  36496. let offset = domOffset;
  36497. if ( !viewParent ) {
  36498. return null;
  36499. }
  36500. if ( Object(_filler__WEBPACK_IMPORTED_MODULE_8__["startsWithFiller"])( domParent ) ) {
  36501. offset -= _filler__WEBPACK_IMPORTED_MODULE_8__["INLINE_FILLER_LENGTH"];
  36502. offset = offset < 0 ? 0 : offset;
  36503. }
  36504. return new _position__WEBPACK_IMPORTED_MODULE_2__["default"]( viewParent, offset );
  36505. }
  36506. // domParent instanceof HTMLElement.
  36507. else {
  36508. if ( domOffset === 0 ) {
  36509. const viewParent = this.mapDomToView( domParent );
  36510. if ( viewParent ) {
  36511. return new _position__WEBPACK_IMPORTED_MODULE_2__["default"]( viewParent, 0 );
  36512. }
  36513. } else {
  36514. const domBefore = domParent.childNodes[ domOffset - 1 ];
  36515. const viewBefore = Object(_ckeditor_ckeditor5_utils_src_dom_istext__WEBPACK_IMPORTED_MODULE_13__["default"])( domBefore ) ?
  36516. this.findCorrespondingViewText( domBefore ) :
  36517. this.mapDomToView( domBefore );
  36518. // TODO #663
  36519. if ( viewBefore && viewBefore.parent ) {
  36520. return new _position__WEBPACK_IMPORTED_MODULE_2__["default"]( viewBefore.parent, viewBefore.index + 1 );
  36521. }
  36522. }
  36523. return null;
  36524. }
  36525. }
  36526. /**
  36527. * Returns corresponding view {@link module:engine/view/element~Element Element} or
  36528. * {@link module:engine/view/documentfragment~DocumentFragment} for provided DOM element or
  36529. * document fragment. If there is no view item {@link module:engine/view/domconverter~DomConverter#bindElements bound}
  36530. * to the given DOM - `undefined` is returned.
  36531. *
  36532. * For all DOM elements rendered by a {@link module:engine/view/uielement~UIElement} or
  36533. * a {@link module:engine/view/rawelement~RawElement}, the parent `UIElement` or `RawElement` will be returned.
  36534. *
  36535. * @param {DocumentFragment|Element} domElementOrDocumentFragment DOM element or document fragment.
  36536. * @returns {module:engine/view/element~Element|module:engine/view/documentfragment~DocumentFragment|undefined}
  36537. * Corresponding view element, document fragment or `undefined` if no element was bound.
  36538. */
  36539. mapDomToView( domElementOrDocumentFragment ) {
  36540. const hostElement = this.getHostViewElement( domElementOrDocumentFragment );
  36541. return hostElement || this._domToViewMapping.get( domElementOrDocumentFragment );
  36542. }
  36543. /**
  36544. * Finds corresponding text node. Text nodes are not {@link module:engine/view/domconverter~DomConverter#bindElements bound},
  36545. * corresponding text node is returned based on the sibling or parent.
  36546. *
  36547. * If the directly previous sibling is a {@link module:engine/view/domconverter~DomConverter#bindElements bound} element, it is used
  36548. * to find the corresponding text node.
  36549. *
  36550. * If this is a first child in the parent and the parent is a {@link module:engine/view/domconverter~DomConverter#bindElements bound}
  36551. * element, it is used to find the corresponding text node.
  36552. *
  36553. * For all text nodes rendered by a {@link module:engine/view/uielement~UIElement} or
  36554. * a {@link module:engine/view/rawelement~RawElement}, the parent `UIElement` or `RawElement` will be returned.
  36555. *
  36556. * Otherwise `null` is returned.
  36557. *
  36558. * Note that for the block or inline {@link module:engine/view/filler filler} this method returns `null`.
  36559. *
  36560. * @param {Text} domText DOM text node.
  36561. * @returns {module:engine/view/text~Text|null} Corresponding view text node or `null`, if it was not possible to find a
  36562. * corresponding node.
  36563. */
  36564. findCorrespondingViewText( domText ) {
  36565. if ( Object(_filler__WEBPACK_IMPORTED_MODULE_8__["isInlineFiller"])( domText ) ) {
  36566. return null;
  36567. }
  36568. // If DOM text was rendered by a UIElement or a RawElement - return this parent element.
  36569. const hostElement = this.getHostViewElement( domText );
  36570. if ( hostElement ) {
  36571. return hostElement;
  36572. }
  36573. const previousSibling = domText.previousSibling;
  36574. // Try to use previous sibling to find the corresponding text node.
  36575. if ( previousSibling ) {
  36576. if ( !( this.isElement( previousSibling ) ) ) {
  36577. // The previous is text or comment.
  36578. return null;
  36579. }
  36580. const viewElement = this.mapDomToView( previousSibling );
  36581. if ( viewElement ) {
  36582. const nextSibling = viewElement.nextSibling;
  36583. // It might be filler which has no corresponding view node.
  36584. if ( nextSibling instanceof _text__WEBPACK_IMPORTED_MODULE_0__["default"] ) {
  36585. return viewElement.nextSibling;
  36586. } else {
  36587. return null;
  36588. }
  36589. }
  36590. }
  36591. // Try to use parent to find the corresponding text node.
  36592. else {
  36593. const viewElement = this.mapDomToView( domText.parentNode );
  36594. if ( viewElement ) {
  36595. const firstChild = viewElement.getChild( 0 );
  36596. // It might be filler which has no corresponding view node.
  36597. if ( firstChild instanceof _text__WEBPACK_IMPORTED_MODULE_0__["default"] ) {
  36598. return firstChild;
  36599. } else {
  36600. return null;
  36601. }
  36602. }
  36603. }
  36604. return null;
  36605. }
  36606. /**
  36607. * Returns corresponding DOM item for provided {@link module:engine/view/element~Element Element} or
  36608. * {@link module:engine/view/documentfragment~DocumentFragment DocumentFragment}.
  36609. * To find a corresponding text for {@link module:engine/view/text~Text view Text instance}
  36610. * use {@link #findCorrespondingDomText}.
  36611. *
  36612. * @param {module:engine/view/element~Element|module:engine/view/documentfragment~DocumentFragment} viewNode
  36613. * View element or document fragment.
  36614. * @returns {Node|DocumentFragment|undefined} Corresponding DOM node or document fragment.
  36615. */
  36616. mapViewToDom( documentFragmentOrElement ) {
  36617. return this._viewToDomMapping.get( documentFragmentOrElement );
  36618. }
  36619. /**
  36620. * Finds corresponding text node. Text nodes are not {@link module:engine/view/domconverter~DomConverter#bindElements bound},
  36621. * corresponding text node is returned based on the sibling or parent.
  36622. *
  36623. * If the directly previous sibling is a {@link module:engine/view/domconverter~DomConverter#bindElements bound} element, it is used
  36624. * to find the corresponding text node.
  36625. *
  36626. * If this is a first child in the parent and the parent is a {@link module:engine/view/domconverter~DomConverter#bindElements bound}
  36627. * element, it is used to find the corresponding text node.
  36628. *
  36629. * Otherwise `null` is returned.
  36630. *
  36631. * @param {module:engine/view/text~Text} viewText View text node.
  36632. * @returns {Text|null} Corresponding DOM text node or `null`, if it was not possible to find a corresponding node.
  36633. */
  36634. findCorrespondingDomText( viewText ) {
  36635. const previousSibling = viewText.previousSibling;
  36636. // Try to use previous sibling to find the corresponding text node.
  36637. if ( previousSibling && this.mapViewToDom( previousSibling ) ) {
  36638. return this.mapViewToDom( previousSibling ).nextSibling;
  36639. }
  36640. // If this is a first node, try to use parent to find the corresponding text node.
  36641. if ( !previousSibling && viewText.parent && this.mapViewToDom( viewText.parent ) ) {
  36642. return this.mapViewToDom( viewText.parent ).childNodes[ 0 ];
  36643. }
  36644. return null;
  36645. }
  36646. /**
  36647. * Focuses DOM editable that is corresponding to provided {@link module:engine/view/editableelement~EditableElement}.
  36648. *
  36649. * @param {module:engine/view/editableelement~EditableElement} viewEditable
  36650. */
  36651. focus( viewEditable ) {
  36652. const domEditable = this.mapViewToDom( viewEditable );
  36653. if ( domEditable && domEditable.ownerDocument.activeElement !== domEditable ) {
  36654. // Save the scrollX and scrollY positions before the focus.
  36655. const { scrollX, scrollY } = _ckeditor_ckeditor5_utils_src_dom_global__WEBPACK_IMPORTED_MODULE_9__["default"].window;
  36656. const scrollPositions = [];
  36657. // Save all scrollLeft and scrollTop values starting from domEditable up to
  36658. // document#documentElement.
  36659. forEachDomNodeAncestor( domEditable, node => {
  36660. const { scrollLeft, scrollTop } = node;
  36661. scrollPositions.push( [ scrollLeft, scrollTop ] );
  36662. } );
  36663. domEditable.focus();
  36664. // Restore scrollLeft and scrollTop values starting from domEditable up to
  36665. // document#documentElement.
  36666. // https://github.com/ckeditor/ckeditor5-engine/issues/951
  36667. // https://github.com/ckeditor/ckeditor5-engine/issues/957
  36668. forEachDomNodeAncestor( domEditable, node => {
  36669. const [ scrollLeft, scrollTop ] = scrollPositions.shift();
  36670. node.scrollLeft = scrollLeft;
  36671. node.scrollTop = scrollTop;
  36672. } );
  36673. // Restore the scrollX and scrollY positions after the focus.
  36674. // https://github.com/ckeditor/ckeditor5-engine/issues/951
  36675. _ckeditor_ckeditor5_utils_src_dom_global__WEBPACK_IMPORTED_MODULE_9__["default"].window.scrollTo( scrollX, scrollY );
  36676. }
  36677. }
  36678. /**
  36679. * Returns `true` when `node.nodeType` equals `Node.ELEMENT_NODE`.
  36680. *
  36681. * @param {Node} node Node to check.
  36682. * @returns {Boolean}
  36683. */
  36684. isElement( node ) {
  36685. return node && node.nodeType == Node.ELEMENT_NODE;
  36686. }
  36687. /**
  36688. * Returns `true` when `node.nodeType` equals `Node.DOCUMENT_FRAGMENT_NODE`.
  36689. *
  36690. * @param {Node} node Node to check.
  36691. * @returns {Boolean}
  36692. */
  36693. isDocumentFragment( node ) {
  36694. return node && node.nodeType == Node.DOCUMENT_FRAGMENT_NODE;
  36695. }
  36696. /**
  36697. * Returns `true` when `node.nodeType` equals `Node.COMMENT_NODE`.
  36698. *
  36699. * @param {Node} node Node to check.
  36700. * @returns {Boolean}
  36701. */
  36702. isComment( node ) {
  36703. return node && node.nodeType == Node.COMMENT_NODE;
  36704. }
  36705. /**
  36706. * Checks if the node is an instance of the block filler for this DOM converter.
  36707. *
  36708. * const converter = new DomConverter( viewDocument, { blockFillerMode: 'br' } );
  36709. *
  36710. * converter.isBlockFiller( BR_FILLER( document ) ); // true
  36711. * converter.isBlockFiller( NBSP_FILLER( document ) ); // false
  36712. *
  36713. * **Note:**: For the `'nbsp'` mode the method also checks context of a node so it cannot be a detached node.
  36714. *
  36715. * **Note:** A special case in the `'nbsp'` mode exists where the `<br>` in `<p><br></p>` is treated as a block filler.
  36716. *
  36717. * @param {Node} domNode DOM node to check.
  36718. * @returns {Boolean} True if a node is considered a block filler for given mode.
  36719. */
  36720. isBlockFiller( domNode ) {
  36721. if ( this.blockFillerMode == 'br' ) {
  36722. return domNode.isEqualNode( BR_FILLER_REF );
  36723. }
  36724. // Special case for <p><br></p> in which <br> should be treated as filler even when we are not in the 'br' mode. See ckeditor5#5564.
  36725. if ( domNode.tagName === 'BR' && hasBlockParent( domNode, this.blockElements ) && domNode.parentNode.childNodes.length === 1 ) {
  36726. return true;
  36727. }
  36728. // If not in 'br' mode, try recognizing both marked and regular nbsp block fillers.
  36729. return domNode.isEqualNode( MARKED_NBSP_FILLER_REF ) || isNbspBlockFiller( domNode, this.blockElements );
  36730. }
  36731. /**
  36732. * Returns `true` if given selection is a backward selection, that is, if it's `focus` is before `anchor`.
  36733. *
  36734. * @param {Selection} DOM Selection instance to check.
  36735. * @returns {Boolean}
  36736. */
  36737. isDomSelectionBackward( selection ) {
  36738. if ( selection.isCollapsed ) {
  36739. return false;
  36740. }
  36741. // Since it takes multiple lines of code to check whether a "DOM Position" is before/after another "DOM Position",
  36742. // we will use the fact that range will collapse if it's end is before it's start.
  36743. const range = document.createRange();
  36744. range.setStart( selection.anchorNode, selection.anchorOffset );
  36745. range.setEnd( selection.focusNode, selection.focusOffset );
  36746. const backward = range.collapsed;
  36747. range.detach();
  36748. return backward;
  36749. }
  36750. /**
  36751. * Returns a parent {@link module:engine/view/uielement~UIElement} or {@link module:engine/view/rawelement~RawElement}
  36752. * that hosts the provided DOM node. Returns `null` if there is no such parent.
  36753. *
  36754. * @param {Node} domNode
  36755. * @returns {module:engine/view/uielement~UIElement|module:engine/view/rawelement~RawElement|null}
  36756. */
  36757. getHostViewElement( domNode ) {
  36758. const ancestors = Object(_ckeditor_ckeditor5_utils_src_dom_getancestors__WEBPACK_IMPORTED_MODULE_11__["default"])( domNode );
  36759. // Remove domNode from the list.
  36760. ancestors.pop();
  36761. while ( ancestors.length ) {
  36762. const domNode = ancestors.pop();
  36763. const viewNode = this._domToViewMapping.get( domNode );
  36764. if ( viewNode && ( viewNode.is( 'uiElement' ) || viewNode.is( 'rawElement' ) ) ) {
  36765. return viewNode;
  36766. }
  36767. }
  36768. return null;
  36769. }
  36770. /**
  36771. * Checks if the given selection's boundaries are at correct places.
  36772. *
  36773. * The following places are considered as incorrect for selection boundaries:
  36774. *
  36775. * * before or in the middle of an inline filler sequence,
  36776. * * inside a DOM element which represents {@link module:engine/view/uielement~UIElement a view UI element},
  36777. * * inside a DOM element which represents {@link module:engine/view/rawelement~RawElement a view raw element}.
  36778. *
  36779. * @param {Selection} domSelection The DOM selection object to be checked.
  36780. * @returns {Boolean} `true` if the given selection is at a correct place, `false` otherwise.
  36781. */
  36782. isDomSelectionCorrect( domSelection ) {
  36783. return this._isDomSelectionPositionCorrect( domSelection.anchorNode, domSelection.anchorOffset ) &&
  36784. this._isDomSelectionPositionCorrect( domSelection.focusNode, domSelection.focusOffset );
  36785. }
  36786. /**
  36787. * Registers a {@link module:engine/view/matcher~MatcherPattern} for view elements whose content should be treated as raw data
  36788. * and not processed during the conversion from DOM nodes to view elements.
  36789. *
  36790. * This is affecting how {@link module:engine/view/domconverter~DomConverter#domToView} and
  36791. * {@link module:engine/view/domconverter~DomConverter#domChildrenToView} process DOM nodes.
  36792. *
  36793. * The raw data can be later accessed by a
  36794. * {@link module:engine/view/element~Element#getCustomProperty custom property of a view element} called `"$rawContent"`.
  36795. *
  36796. * @param {module:engine/view/matcher~MatcherPattern} pattern Pattern matching a view element whose content should
  36797. * be treated as raw data.
  36798. */
  36799. registerRawContentMatcher( pattern ) {
  36800. this._rawContentElementMatcher.add( pattern );
  36801. }
  36802. /**
  36803. * Returns the block {@link module:engine/view/filler filler} node based on the current {@link #blockFillerMode} setting.
  36804. *
  36805. * @private
  36806. * @params {Document} domDocument
  36807. * @returns {Node} filler
  36808. */
  36809. _getBlockFiller( domDocument ) {
  36810. switch ( this.blockFillerMode ) {
  36811. case 'nbsp':
  36812. return Object(_filler__WEBPACK_IMPORTED_MODULE_8__["NBSP_FILLER"])( domDocument ); // eslint-disable-line new-cap
  36813. case 'markedNbsp':
  36814. return Object(_filler__WEBPACK_IMPORTED_MODULE_8__["MARKED_NBSP_FILLER"])( domDocument ); // eslint-disable-line new-cap
  36815. case 'br':
  36816. return Object(_filler__WEBPACK_IMPORTED_MODULE_8__["BR_FILLER"])( domDocument ); // eslint-disable-line new-cap
  36817. }
  36818. }
  36819. /**
  36820. * Checks if the given DOM position is a correct place for selection boundary. See {@link #isDomSelectionCorrect}.
  36821. *
  36822. * @private
  36823. * @param {Element} domParent Position parent.
  36824. * @param {Number} offset Position offset.
  36825. * @returns {Boolean} `true` if given position is at a correct place for selection boundary, `false` otherwise.
  36826. */
  36827. _isDomSelectionPositionCorrect( domParent, offset ) {
  36828. // If selection is before or in the middle of inline filler string, it is incorrect.
  36829. if ( Object(_ckeditor_ckeditor5_utils_src_dom_istext__WEBPACK_IMPORTED_MODULE_13__["default"])( domParent ) && Object(_filler__WEBPACK_IMPORTED_MODULE_8__["startsWithFiller"])( domParent ) && offset < _filler__WEBPACK_IMPORTED_MODULE_8__["INLINE_FILLER_LENGTH"] ) {
  36830. // Selection in a text node, at wrong position (before or in the middle of filler).
  36831. return false;
  36832. }
  36833. if ( this.isElement( domParent ) && Object(_filler__WEBPACK_IMPORTED_MODULE_8__["startsWithFiller"])( domParent.childNodes[ offset ] ) ) {
  36834. // Selection in an element node, before filler text node.
  36835. return false;
  36836. }
  36837. const viewParent = this.mapDomToView( domParent );
  36838. // The position is incorrect when anchored inside a UIElement or a RawElement.
  36839. // Note: In case of UIElement and RawElement, mapDomToView() returns a parent element for any DOM child
  36840. // so there's no need to perform any additional checks.
  36841. if ( viewParent && ( viewParent.is( 'uiElement' ) || viewParent.is( 'rawElement' ) ) ) {
  36842. return false;
  36843. }
  36844. return true;
  36845. }
  36846. /**
  36847. * Takes text data from a given {@link module:engine/view/text~Text#data} and processes it so
  36848. * it is correctly displayed in the DOM.
  36849. *
  36850. * Following changes are done:
  36851. *
  36852. * * a space at the beginning is changed to `&nbsp;` if this is the first text node in its container
  36853. * element or if a previous text node ends with a space character,
  36854. * * 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
  36855. * starts with a space or if it is the last text node in its container,
  36856. * * remaining spaces are replaced to a chain of spaces and `&nbsp;` (e.g. `'x x'` becomes `'x &nbsp; x'`).
  36857. *
  36858. * Content of {@link #preElements} is not processed.
  36859. *
  36860. * @private
  36861. * @param {module:engine/view/text~Text} node View text node to process.
  36862. * @returns {String} Processed text data.
  36863. */
  36864. _processDataFromViewText( node ) {
  36865. let data = node.data;
  36866. // If any of node ancestors has a name which is in `preElements` array, then currently processed
  36867. // view text node is (will be) in preformatted element. We should not change whitespaces then.
  36868. if ( node.getAncestors().some( parent => this.preElements.includes( parent.name ) ) ) {
  36869. return data;
  36870. }
  36871. // 1. Replace the first space with a nbsp if the previous node ends with a space or there is no previous node
  36872. // (container element boundary).
  36873. if ( data.charAt( 0 ) == ' ' ) {
  36874. const prevNode = this._getTouchingViewTextNode( node, false );
  36875. const prevEndsWithSpace = prevNode && this._nodeEndsWithSpace( prevNode );
  36876. if ( prevEndsWithSpace || !prevNode ) {
  36877. data = '\u00A0' + data.substr( 1 );
  36878. }
  36879. }
  36880. // 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
  36881. // next node (container element boundary).
  36882. //
  36883. // Keep in mind that Firefox prefers $nbsp; before tag, not inside it:
  36884. //
  36885. // Foo <span>&nbsp;bar</span> <-- bad.
  36886. // Foo&nbsp;<span> bar</span> <-- good.
  36887. //
  36888. // More here: https://github.com/ckeditor/ckeditor5-engine/issues/1747.
  36889. if ( data.charAt( data.length - 1 ) == ' ' ) {
  36890. const nextNode = this._getTouchingViewTextNode( node, true );
  36891. if ( data.charAt( data.length - 2 ) == ' ' || !nextNode || nextNode.data.charAt( 0 ) == ' ' ) {
  36892. data = data.substr( 0, data.length - 1 ) + '\u00A0';
  36893. }
  36894. }
  36895. // 3. Create space+nbsp pairs.
  36896. return data.replace( / {2}/g, ' \u00A0' );
  36897. }
  36898. /**
  36899. * Checks whether given node ends with a space character after changing appropriate space characters to `&nbsp;`s.
  36900. *
  36901. * @private
  36902. * @param {module:engine/view/text~Text} node Node to check.
  36903. * @returns {Boolean} `true` if given `node` ends with space, `false` otherwise.
  36904. */
  36905. _nodeEndsWithSpace( node ) {
  36906. if ( node.getAncestors().some( parent => this.preElements.includes( parent.name ) ) ) {
  36907. return false;
  36908. }
  36909. const data = this._processDataFromViewText( node );
  36910. return data.charAt( data.length - 1 ) == ' ';
  36911. }
  36912. /**
  36913. * Takes text data from native `Text` node and processes it to a correct {@link module:engine/view/text~Text view text node} data.
  36914. *
  36915. * Following changes are done:
  36916. *
  36917. * * multiple whitespaces are replaced to a single space,
  36918. * * space at the beginning of a text node is removed if it is the first text node in its container
  36919. * element or if the previous text node ends with a space character,
  36920. * * 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
  36921. * starts with a space or if it is the last text node in its container
  36922. * * nbsps are converted to spaces.
  36923. *
  36924. * @param {Node} node DOM text node to process.
  36925. * @returns {String} Processed data.
  36926. * @private
  36927. */
  36928. _processDataFromDomText( node ) {
  36929. let data = node.data;
  36930. if ( _hasDomParentOfType( node, this.preElements ) ) {
  36931. return Object(_filler__WEBPACK_IMPORTED_MODULE_8__["getDataWithoutFiller"])( node );
  36932. }
  36933. // Change all consecutive whitespace characters (from the [ \n\t\r] set –
  36934. // see https://github.com/ckeditor/ckeditor5-engine/issues/822#issuecomment-311670249) to a single space character.
  36935. // That's how multiple whitespaces are treated when rendered, so we normalize those whitespaces.
  36936. // We're replacing 1+ (and not 2+) to also normalize singular \n\t\r characters (#822).
  36937. data = data.replace( /[ \n\t\r]{1,}/g, ' ' );
  36938. const prevNode = this._getTouchingInlineDomNode( node, false );
  36939. const nextNode = this._getTouchingInlineDomNode( node, true );
  36940. const shouldLeftTrim = this._checkShouldLeftTrimDomText( node, prevNode );
  36941. const shouldRightTrim = this._checkShouldRightTrimDomText( node, nextNode );
  36942. // If the previous dom text node does not exist or it ends by whitespace character, remove space character from the beginning
  36943. // of this text node. Such space character is treated as a whitespace.
  36944. if ( shouldLeftTrim ) {
  36945. data = data.replace( /^ /, '' );
  36946. }
  36947. // If the next text node does not exist remove space character from the end of this text node.
  36948. if ( shouldRightTrim ) {
  36949. data = data.replace( / $/, '' );
  36950. }
  36951. // At the beginning and end of a block element, Firefox inserts normal space + <br> instead of non-breaking space.
  36952. // This means that the text node starts/end with normal space instead of non-breaking space.
  36953. // This causes a problem because the normal space would be removed in `.replace` calls above. To prevent that,
  36954. // the inline filler is removed only after the data is initially processed (by the `.replace` above). See ckeditor5#692.
  36955. data = Object(_filler__WEBPACK_IMPORTED_MODULE_8__["getDataWithoutFiller"])( new Text( data ) );
  36956. // At this point we should have removed all whitespaces from DOM text data.
  36957. //
  36958. // Now, We will reverse the process that happens in `_processDataFromViewText`.
  36959. //
  36960. // We have to change &nbsp; chars, that were in DOM text data because of rendering reasons, to spaces.
  36961. // First, change all ` \u00A0` pairs (space + &nbsp;) to two spaces. DOM converter changes two spaces from model/view to
  36962. // ` \u00A0` to ensure proper rendering. Since here we convert back, we recognize those pairs and change them back to ` `.
  36963. data = data.replace( / \u00A0/g, ' ' );
  36964. // Then, let's change the last nbsp to a space.
  36965. if ( /( |\u00A0)\u00A0$/.test( data ) || !nextNode || ( nextNode.data && nextNode.data.charAt( 0 ) == ' ' ) ) {
  36966. data = data.replace( /\u00A0$/, ' ' );
  36967. }
  36968. // Then, change &nbsp; character that is at the beginning of the text node to space character.
  36969. // We do that replacement only if this is the first node or the previous node ends on whitespace character.
  36970. if ( shouldLeftTrim ) {
  36971. data = data.replace( /^\u00A0/, ' ' );
  36972. }
  36973. // At this point, all whitespaces should be removed and all &nbsp; created for rendering reasons should be
  36974. // changed to normal space. All left &nbsp; are &nbsp; inserted intentionally.
  36975. return data;
  36976. }
  36977. /**
  36978. * Helper function which checks if a DOM text node, preceded by the given `prevNode` should
  36979. * be trimmed from the left side.
  36980. *
  36981. * @private
  36982. * @param {Node} node
  36983. * @param {Node} prevNode
  36984. */
  36985. _checkShouldLeftTrimDomText( node, prevNode ) {
  36986. if ( !prevNode ) {
  36987. return true;
  36988. }
  36989. if ( Object(lodash_es__WEBPACK_IMPORTED_MODULE_14__["isElement"])( prevNode ) ) {
  36990. return true;
  36991. }
  36992. // Shouldn't left trim if previous node is a node that was encountered as a raw content node.
  36993. if ( this._encounteredRawContentDomNodes.has( node.previousSibling ) ) {
  36994. return false;
  36995. }
  36996. return /[^\S\u00A0]/.test( prevNode.data.charAt( prevNode.data.length - 1 ) );
  36997. }
  36998. /**
  36999. * Helper function which checks if a DOM text node, succeeded by the given `nextNode` should
  37000. * be trimmed from the right side.
  37001. *
  37002. * @private
  37003. * @param {Node} node
  37004. * @param {Node} nextNode
  37005. */
  37006. _checkShouldRightTrimDomText( node, nextNode ) {
  37007. if ( nextNode ) {
  37008. return false;
  37009. }
  37010. return !Object(_filler__WEBPACK_IMPORTED_MODULE_8__["startsWithFiller"])( node );
  37011. }
  37012. /**
  37013. * Helper function. For given {@link module:engine/view/text~Text view text node}, it finds previous or next sibling
  37014. * that is contained in the same container element. If there is no such sibling, `null` is returned.
  37015. *
  37016. * @private
  37017. * @param {module:engine/view/text~Text} node Reference node.
  37018. * @param {Boolean} getNext
  37019. * @returns {module:engine/view/text~Text|null} Touching text node or `null` if there is no next or previous touching text node.
  37020. */
  37021. _getTouchingViewTextNode( node, getNext ) {
  37022. const treeWalker = new _treewalker__WEBPACK_IMPORTED_MODULE_6__["default"]( {
  37023. startPosition: getNext ? _position__WEBPACK_IMPORTED_MODULE_2__["default"]._createAfter( node ) : _position__WEBPACK_IMPORTED_MODULE_2__["default"]._createBefore( node ),
  37024. direction: getNext ? 'forward' : 'backward'
  37025. } );
  37026. for ( const value of treeWalker ) {
  37027. // ViewContainerElement is found on a way to next ViewText node, so given `node` was first/last
  37028. // text node in its container element.
  37029. if ( value.item.is( 'containerElement' ) ) {
  37030. return null;
  37031. }
  37032. // <br> found – it works like a block boundary, so do not scan further.
  37033. else if ( value.item.is( 'element', 'br' ) ) {
  37034. return null;
  37035. }
  37036. // Found a text node in the same container element.
  37037. else if ( value.item.is( '$textProxy' ) ) {
  37038. return value.item;
  37039. }
  37040. }
  37041. return null;
  37042. }
  37043. /**
  37044. * Helper function. For the given text node, it finds the closest touching node which is either
  37045. * a text node or a `<br>`. The search is terminated at block element boundaries and if a matching node
  37046. * wasn't found so far, `null` is returned.
  37047. *
  37048. * In the following DOM structure:
  37049. *
  37050. * <p>foo<b>bar</b><br>bom</p>
  37051. *
  37052. * * `foo` doesn't have its previous touching inline node (`null` is returned),
  37053. * * `foo`'s next touching inline node is `bar`
  37054. * * `bar`'s next touching inline node is `<br>`
  37055. *
  37056. * This method returns text nodes and `<br>` elements because these types of nodes affect how
  37057. * spaces in the given text node need to be converted.
  37058. *
  37059. * @private
  37060. * @param {Text} node
  37061. * @param {Boolean} getNext
  37062. * @returns {Text|Element|null}
  37063. */
  37064. _getTouchingInlineDomNode( node, getNext ) {
  37065. if ( !node.parentNode ) {
  37066. return null;
  37067. }
  37068. const direction = getNext ? 'nextNode' : 'previousNode';
  37069. const document = node.ownerDocument;
  37070. const topmostParent = Object(_ckeditor_ckeditor5_utils_src_dom_getancestors__WEBPACK_IMPORTED_MODULE_11__["default"])( node )[ 0 ];
  37071. const treeWalker = document.createTreeWalker( topmostParent, NodeFilter.SHOW_TEXT | NodeFilter.SHOW_ELEMENT, {
  37072. acceptNode( node ) {
  37073. if ( Object(_ckeditor_ckeditor5_utils_src_dom_istext__WEBPACK_IMPORTED_MODULE_13__["default"])( node ) ) {
  37074. return NodeFilter.FILTER_ACCEPT;
  37075. }
  37076. if ( node.tagName == 'BR' ) {
  37077. return NodeFilter.FILTER_ACCEPT;
  37078. }
  37079. return NodeFilter.FILTER_SKIP;
  37080. }
  37081. } );
  37082. treeWalker.currentNode = node;
  37083. const touchingNode = treeWalker[ direction ]();
  37084. if ( touchingNode !== null ) {
  37085. const lca = Object(_ckeditor_ckeditor5_utils_src_dom_getcommonancestor__WEBPACK_IMPORTED_MODULE_12__["default"])( node, touchingNode );
  37086. // If there is common ancestor between the text node and next/prev text node,
  37087. // and there are no block elements on a way from the text node to that ancestor,
  37088. // and there are no block elements on a way from next/prev text node to that ancestor...
  37089. if (
  37090. lca &&
  37091. !_hasDomParentOfType( node, this.blockElements, lca ) &&
  37092. !_hasDomParentOfType( touchingNode, this.blockElements, lca )
  37093. ) {
  37094. // Then they are in the same container element.
  37095. return touchingNode;
  37096. }
  37097. }
  37098. return null;
  37099. }
  37100. }
  37101. // Helper function.
  37102. // Used to check if given native `Element` or `Text` node has parent with tag name from `types` array.
  37103. //
  37104. // @param {Node} node
  37105. // @param {Array.<String>} types
  37106. // @param {Boolean} [boundaryParent] Can be given if parents should be checked up to a given element (excluding that element).
  37107. // @returns {Boolean} `true` if such parent exists or `false` if it does not.
  37108. function _hasDomParentOfType( node, types, boundaryParent ) {
  37109. let parents = Object(_ckeditor_ckeditor5_utils_src_dom_getancestors__WEBPACK_IMPORTED_MODULE_11__["default"])( node );
  37110. if ( boundaryParent ) {
  37111. parents = parents.slice( parents.indexOf( boundaryParent ) + 1 );
  37112. }
  37113. return parents.some( parent => parent.tagName && types.includes( parent.tagName.toLowerCase() ) );
  37114. }
  37115. // A helper that executes given callback for each DOM node's ancestor, starting from the given node
  37116. // and ending in document#documentElement.
  37117. //
  37118. // @param {Node} node
  37119. // @param {Function} callback A callback to be executed for each ancestor.
  37120. function forEachDomNodeAncestor( node, callback ) {
  37121. while ( node && node != _ckeditor_ckeditor5_utils_src_dom_global__WEBPACK_IMPORTED_MODULE_9__["default"].document ) {
  37122. callback( node );
  37123. node = node.parentNode;
  37124. }
  37125. }
  37126. // Checks if given node is a nbsp block filler.
  37127. //
  37128. // A &nbsp; is a block filler only if it is a single child of a block element.
  37129. //
  37130. // @param {Node} domNode DOM node.
  37131. // @returns {Boolean}
  37132. function isNbspBlockFiller( domNode, blockElements ) {
  37133. const isNBSP = domNode.isEqualNode( NBSP_FILLER_REF );
  37134. return isNBSP && hasBlockParent( domNode, blockElements ) && domNode.parentNode.childNodes.length === 1;
  37135. }
  37136. // Checks if domNode has block parent.
  37137. //
  37138. // @param {Node} domNode DOM node.
  37139. // @returns {Boolean}
  37140. function hasBlockParent( domNode, blockElements ) {
  37141. const parent = domNode.parentNode;
  37142. return parent && parent.tagName && blockElements.includes( parent.tagName.toLowerCase() );
  37143. }
  37144. /**
  37145. * Enum representing the type of the block filler.
  37146. *
  37147. * Possible values:
  37148. *
  37149. * * `br` &ndash; For the `<br data-cke-filler="true">` block filler used in the editing view.
  37150. * * `nbsp` &ndash; For the `&nbsp;` block fillers used in the data.
  37151. * * `markedNbsp` &ndash; For the `&nbsp;` block fillers wrapped in a `<span>` element: `<span data-cke-filler="true">&nbsp;</span>`
  37152. * used in the data.
  37153. *
  37154. * @typedef {String} module:engine/view/filler~BlockFillerMode
  37155. */
  37156. /***/ }),
  37157. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/downcastwriter.js":
  37158. /*!****************************************************************************!*\
  37159. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/downcastwriter.js ***!
  37160. \****************************************************************************/
  37161. /*! exports provided: default */
  37162. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  37163. "use strict";
  37164. __webpack_require__.r(__webpack_exports__);
  37165. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return DowncastWriter; });
  37166. /* harmony import */ var _position__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./position */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/position.js");
  37167. /* harmony import */ var _range__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./range */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/range.js");
  37168. /* harmony import */ var _selection__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./selection */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/selection.js");
  37169. /* harmony import */ var _containerelement__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./containerelement */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/containerelement.js");
  37170. /* harmony import */ var _attributeelement__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./attributeelement */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/attributeelement.js");
  37171. /* harmony import */ var _emptyelement__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./emptyelement */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/emptyelement.js");
  37172. /* harmony import */ var _uielement__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./uielement */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/uielement.js");
  37173. /* harmony import */ var _rawelement__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./rawelement */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/rawelement.js");
  37174. /* 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");
  37175. /* harmony import */ var _documentfragment__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./documentfragment */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/documentfragment.js");
  37176. /* 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");
  37177. /* harmony import */ var _text__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./text */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/text.js");
  37178. /* harmony import */ var _editableelement__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./editableelement */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/editableelement.js");
  37179. /* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! lodash-es */ "./node_modules/lodash-es/lodash.js");
  37180. /**
  37181. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  37182. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  37183. */
  37184. /**
  37185. * @module module:engine/view/downcastwriter
  37186. */
  37187. /**
  37188. * View downcast writer.
  37189. *
  37190. * It provides a set of methods used to manipulate view nodes.
  37191. *
  37192. * Do not create an instance of this writer manually. To modify a view structure, use
  37193. * the {@link module:engine/view/view~View#change `View#change()`} block.
  37194. *
  37195. * The `DowncastWriter` is designed to work with semantic views which are the views that were/are being downcasted from the model.
  37196. * To work with ordinary views (e.g. parsed from a pasted content) use the
  37197. * {@link module:engine/view/upcastwriter~UpcastWriter upcast writer}.
  37198. *
  37199. * Read more about changing the view in the {@glink framework/guides/architecture/editing-engine#changing-the-view Changing the view}
  37200. * section of the {@glink framework/guides/architecture/editing-engine Editing engine architecture} guide.
  37201. */
  37202. class DowncastWriter {
  37203. /**
  37204. * @param {module:engine/view/document~Document} document The view document instance.
  37205. */
  37206. constructor( document ) {
  37207. /**
  37208. * The view document instance in which this writer operates.
  37209. *
  37210. * @readonly
  37211. * @type {module:engine/view/document~Document}
  37212. */
  37213. this.document = document;
  37214. /**
  37215. * Holds references to the attribute groups that share the same {@link module:engine/view/attributeelement~AttributeElement#id id}.
  37216. * The keys are `id`s, the values are `Set`s holding {@link module:engine/view/attributeelement~AttributeElement}s.
  37217. *
  37218. * @private
  37219. * @type {Map.<String,Set>}
  37220. */
  37221. this._cloneGroups = new Map();
  37222. }
  37223. /**
  37224. * Sets {@link module:engine/view/documentselection~DocumentSelection selection's} ranges and direction to the
  37225. * specified location based on the given {@link module:engine/view/selection~Selectable selectable}.
  37226. *
  37227. * Usage:
  37228. *
  37229. * // Sets selection to the given range.
  37230. * const range = writer.createRange( start, end );
  37231. * writer.setSelection( range );
  37232. *
  37233. * // Sets backward selection to the given range.
  37234. * const range = writer.createRange( start, end );
  37235. * writer.setSelection( range );
  37236. *
  37237. * // Sets selection to given ranges.
  37238. * const ranges = [ writer.createRange( start1, end2 ), writer.createRange( start2, end2 ) ];
  37239. * writer.setSelection( range );
  37240. *
  37241. * // Sets selection to the other selection.
  37242. * const otherSelection = writer.createSelection();
  37243. * writer.setSelection( otherSelection );
  37244. *
  37245. * // Sets collapsed selection at the given position.
  37246. * const position = writer.createPositionFromPath( root, path );
  37247. * writer.setSelection( position );
  37248. *
  37249. * // Sets collapsed selection at the position of given item and offset.
  37250. * const paragraph = writer.createContainerElement( 'p' );
  37251. * writer.setSelection( paragraph, offset );
  37252. *
  37253. * Creates a range inside an {@link module:engine/view/element~Element element} which starts before the first child of
  37254. * that element and ends after the last child of that element.
  37255. *
  37256. * writer.setSelection( paragraph, 'in' );
  37257. *
  37258. * Creates a range on the {@link module:engine/view/item~Item item} which starts before the item and ends just after the item.
  37259. *
  37260. * writer.setSelection( paragraph, 'on' );
  37261. *
  37262. * // Removes all ranges.
  37263. * writer.setSelection( null );
  37264. *
  37265. * `DowncastWriter#setSelection()` allow passing additional options (`backward`, `fake` and `label`) as the last argument.
  37266. *
  37267. * // Sets selection as backward.
  37268. * writer.setSelection( range, { backward: true } );
  37269. *
  37270. * // Sets selection as fake.
  37271. * // Fake selection does not render as browser native selection over selected elements and is hidden to the user.
  37272. * // This way, no native selection UI artifacts are displayed to the user and selection over elements can be
  37273. * // represented in other way, for example by applying proper CSS class.
  37274. * writer.setSelection( range, { fake: true } );
  37275. *
  37276. * // Additionally fake's selection label can be provided. It will be used to describe fake selection in DOM
  37277. * // (and be properly handled by screen readers).
  37278. * writer.setSelection( range, { fake: true, label: 'foo' } );
  37279. *
  37280. * @param {module:engine/view/selection~Selectable} selectable
  37281. * @param {Number|'before'|'end'|'after'|'on'|'in'} [placeOrOffset] Sets place or offset of the selection.
  37282. * @param {Object} [options]
  37283. * @param {Boolean} [options.backward] Sets this selection instance to be backward.
  37284. * @param {Boolean} [options.fake] Sets this selection instance to be marked as `fake`.
  37285. * @param {String} [options.label] Label for the fake selection.
  37286. */
  37287. setSelection( selectable, placeOrOffset, options ) {
  37288. this.document.selection._setTo( selectable, placeOrOffset, options );
  37289. }
  37290. /**
  37291. * Moves {@link module:engine/view/documentselection~DocumentSelection#focus selection's focus} to the specified location.
  37292. *
  37293. * The location can be specified in the same form as {@link module:engine/view/view~View#createPositionAt view.createPositionAt()}
  37294. * parameters.
  37295. *
  37296. * @param {module:engine/view/item~Item|module:engine/view/position~Position} itemOrPosition
  37297. * @param {Number|'end'|'before'|'after'} [offset] Offset or one of the flags. Used only when
  37298. * first parameter is a {@link module:engine/view/item~Item view item}.
  37299. */
  37300. setSelectionFocus( itemOrPosition, offset ) {
  37301. this.document.selection._setFocus( itemOrPosition, offset );
  37302. }
  37303. /**
  37304. * Creates a new {@link module:engine/view/documentfragment~DocumentFragment} instance.
  37305. *
  37306. * @param {module:engine/view/node~Node|Iterable.<module:engine/view/node~Node>} [children]
  37307. * A list of nodes to be inserted into the created document fragment.
  37308. * @returns {module:engine/view/documentfragment~DocumentFragment} The created document fragment.
  37309. */
  37310. createDocumentFragment( children ) {
  37311. return new _documentfragment__WEBPACK_IMPORTED_MODULE_9__["default"]( this.document, children );
  37312. }
  37313. /**
  37314. * Creates a new {@link module:engine/view/text~Text text node}.
  37315. *
  37316. * writer.createText( 'foo' );
  37317. *
  37318. * @param {String} data The text's data.
  37319. * @returns {module:engine/view/text~Text} The created text node.
  37320. */
  37321. createText( data ) {
  37322. return new _text__WEBPACK_IMPORTED_MODULE_11__["default"]( this.document, data );
  37323. }
  37324. /**
  37325. * Creates a new {@link module:engine/view/attributeelement~AttributeElement}.
  37326. *
  37327. * writer.createAttributeElement( 'strong' );
  37328. * writer.createAttributeElement( 'a', { href: 'foo.bar' } );
  37329. *
  37330. * // Make `<a>` element contain other attributes element so the `<a>` element is not broken.
  37331. * writer.createAttributeElement( 'a', { href: 'foo.bar' }, { priority: 5 } );
  37332. *
  37333. * // Set `id` of a marker element so it is not joined or merged with "normal" elements.
  37334. * writer.createAttributeElement( 'span', { class: 'my-marker' }, { id: 'marker:my' } );
  37335. *
  37336. * **Note:** By default an `AttributeElement` is split by a
  37337. * {@link module:engine/view/containerelement~ContainerElement `ContainerElement`} but this behavior can be modified
  37338. * with `isAllowedInsideAttributeElement` option set while {@link #createContainerElement creating the element}.
  37339. *
  37340. * @param {String} name Name of the element.
  37341. * @param {Object} [attributes] Element's attributes.
  37342. * @param {Object} [options] Element's options.
  37343. * @param {Number} [options.priority] Element's {@link module:engine/view/attributeelement~AttributeElement#priority priority}.
  37344. * @param {Number|String} [options.id] Element's {@link module:engine/view/attributeelement~AttributeElement#id id}.
  37345. * @returns {module:engine/view/attributeelement~AttributeElement} Created element.
  37346. */
  37347. createAttributeElement( name, attributes, options = {} ) {
  37348. const attributeElement = new _attributeelement__WEBPACK_IMPORTED_MODULE_4__["default"]( this.document, name, attributes );
  37349. if ( typeof options.priority === 'number' ) {
  37350. attributeElement._priority = options.priority;
  37351. }
  37352. if ( options.id ) {
  37353. attributeElement._id = options.id;
  37354. }
  37355. return attributeElement;
  37356. }
  37357. /**
  37358. * Creates a new {@link module:engine/view/containerelement~ContainerElement}.
  37359. *
  37360. * writer.createContainerElement( 'p' );
  37361. *
  37362. * // Create element with custom attributes.
  37363. * writer.createContainerElement( 'div', { id: 'foo-bar', 'data-baz': '123' } );
  37364. *
  37365. * // Create element with custom styles.
  37366. * writer.createContainerElement( 'p', { style: 'font-weight: bold; padding-bottom: 10px' } );
  37367. *
  37368. * // Create element with custom classes.
  37369. * writer.createContainerElement( 'p', { class: 'foo bar baz' } );
  37370. *
  37371. * @param {String} name Name of the element.
  37372. * @param {Object} [attributes] Elements attributes.
  37373. * @param {Object} [options] Element's options.
  37374. * @param {Boolean} [options.isAllowedInsideAttributeElement=false] Whether an element is
  37375. * {@link module:engine/view/element~Element#isAllowedInsideAttributeElement allowed inside an AttributeElement} and can be wrapped
  37376. * with {@link module:engine/view/attributeelement~AttributeElement} by {@link module:engine/view/downcastwriter~DowncastWriter}.
  37377. * @returns {module:engine/view/containerelement~ContainerElement} Created element.
  37378. */
  37379. createContainerElement( name, attributes, options = {} ) {
  37380. const containerElement = new _containerelement__WEBPACK_IMPORTED_MODULE_3__["default"]( this.document, name, attributes );
  37381. if ( options.isAllowedInsideAttributeElement !== undefined ) {
  37382. containerElement._isAllowedInsideAttributeElement = options.isAllowedInsideAttributeElement;
  37383. }
  37384. return containerElement;
  37385. }
  37386. /**
  37387. * Creates a new {@link module:engine/view/editableelement~EditableElement}.
  37388. *
  37389. * writer.createEditableElement( 'div' );
  37390. * writer.createEditableElement( 'div', { id: 'foo-1234' } );
  37391. *
  37392. * Note: The editable element is to be used in the editing pipeline. Usually, together with
  37393. * {@link module:widget/utils~toWidgetEditable `toWidgetEditable()`}.
  37394. *
  37395. * @param {String} name Name of the element.
  37396. * @param {Object} [attributes] Elements attributes.
  37397. * @returns {module:engine/view/editableelement~EditableElement} Created element.
  37398. */
  37399. createEditableElement( name, attributes ) {
  37400. const editableElement = new _editableelement__WEBPACK_IMPORTED_MODULE_12__["default"]( this.document, name, attributes );
  37401. editableElement._document = this.document;
  37402. return editableElement;
  37403. }
  37404. /**
  37405. * Creates a new {@link module:engine/view/emptyelement~EmptyElement}.
  37406. *
  37407. * writer.createEmptyElement( 'img' );
  37408. * writer.createEmptyElement( 'img', { id: 'foo-1234' } );
  37409. *
  37410. * @param {String} name Name of the element.
  37411. * @param {Object} [attributes] Elements attributes.
  37412. * @param {Object} [options] Element's options.
  37413. * @param {Boolean} [options.isAllowedInsideAttributeElement=true] Whether an element is
  37414. * {@link module:engine/view/element~Element#isAllowedInsideAttributeElement allowed inside an AttributeElement} and can be wrapped
  37415. * with {@link module:engine/view/attributeelement~AttributeElement} by {@link module:engine/view/downcastwriter~DowncastWriter}.
  37416. * @returns {module:engine/view/emptyelement~EmptyElement} Created element.
  37417. */
  37418. createEmptyElement( name, attributes, options = {} ) {
  37419. const emptyElement = new _emptyelement__WEBPACK_IMPORTED_MODULE_5__["default"]( this.document, name, attributes );
  37420. if ( options.isAllowedInsideAttributeElement !== undefined ) {
  37421. emptyElement._isAllowedInsideAttributeElement = options.isAllowedInsideAttributeElement;
  37422. }
  37423. return emptyElement;
  37424. }
  37425. /**
  37426. * Creates a new {@link module:engine/view/uielement~UIElement}.
  37427. *
  37428. * writer.createUIElement( 'span' );
  37429. * writer.createUIElement( 'span', { id: 'foo-1234' } );
  37430. *
  37431. * A custom render function can be provided as the third parameter:
  37432. *
  37433. * writer.createUIElement( 'span', null, function( domDocument ) {
  37434. * const domElement = this.toDomElement( domDocument );
  37435. * domElement.innerHTML = '<b>this is ui element</b>';
  37436. *
  37437. * return domElement;
  37438. * } );
  37439. *
  37440. * Unlike {@link #createRawElement raw elements}, UI elements are by no means editor content, for instance,
  37441. * they are ignored by the editor selection system.
  37442. *
  37443. * You should not use UI elements as data containers. Check out {@link #createRawElement} instead.
  37444. *
  37445. * @param {String} name The name of the element.
  37446. * @param {Object} [attributes] Element attributes.
  37447. * @param {Function} [renderFunction] A custom render function.
  37448. * @param {Object} [options] Element's options.
  37449. * @param {Boolean} [options.isAllowedInsideAttributeElement=true] Whether an element is
  37450. * {@link module:engine/view/element~Element#isAllowedInsideAttributeElement allowed inside an AttributeElement} and can be wrapped
  37451. * with {@link module:engine/view/attributeelement~AttributeElement} by {@link module:engine/view/downcastwriter~DowncastWriter}.
  37452. * @returns {module:engine/view/uielement~UIElement} The created element.
  37453. */
  37454. createUIElement( name, attributes, renderFunction, options = {} ) {
  37455. const uiElement = new _uielement__WEBPACK_IMPORTED_MODULE_6__["default"]( this.document, name, attributes );
  37456. if ( renderFunction ) {
  37457. uiElement.render = renderFunction;
  37458. }
  37459. if ( options.isAllowedInsideAttributeElement !== undefined ) {
  37460. uiElement._isAllowedInsideAttributeElement = options.isAllowedInsideAttributeElement;
  37461. }
  37462. return uiElement;
  37463. }
  37464. /**
  37465. * Creates a new {@link module:engine/view/rawelement~RawElement}.
  37466. *
  37467. * writer.createRawElement( 'span', { id: 'foo-1234' }, function( domElement ) {
  37468. * domElement.innerHTML = '<b>This is the raw content of the raw element.</b>';
  37469. * } );
  37470. *
  37471. * Raw elements work as data containers ("wrappers", "sandboxes") but their children are not managed or
  37472. * even recognized by the editor. This encapsulation allows integrations to maintain custom DOM structures
  37473. * in the editor content without, for instance, worrying about compatibility with other editor features.
  37474. * Raw elements are a perfect tool for integration with external frameworks and data sources.
  37475. *
  37476. * Unlike {@link #createUIElement UI elements}, raw elements act like "real" editor content (similar to
  37477. * {@link module:engine/view/containerelement~ContainerElement} or {@link module:engine/view/emptyelement~EmptyElement}),
  37478. * and they are considered by the editor selection.
  37479. *
  37480. * You should not use raw elements to render the UI in the editor content. Check out {@link #createUIElement `#createUIElement()`}
  37481. * instead.
  37482. *
  37483. * @param {String} name The name of the element.
  37484. * @param {Object} [attributes] Element attributes.
  37485. * @param {Function} [renderFunction] A custom render function.
  37486. * @param {Object} [options] Element's options.
  37487. * @param {Boolean} [options.isAllowedInsideAttributeElement=true] Whether an element is
  37488. * {@link module:engine/view/element~Element#isAllowedInsideAttributeElement allowed inside an AttributeElement} and can be wrapped
  37489. * with {@link module:engine/view/attributeelement~AttributeElement} by {@link module:engine/view/downcastwriter~DowncastWriter}.
  37490. * @returns {module:engine/view/rawelement~RawElement} The created element.
  37491. */
  37492. createRawElement( name, attributes, renderFunction, options = {} ) {
  37493. const rawElement = new _rawelement__WEBPACK_IMPORTED_MODULE_7__["default"]( this.document, name, attributes );
  37494. rawElement.render = renderFunction || ( () => {} );
  37495. if ( options.isAllowedInsideAttributeElement !== undefined ) {
  37496. rawElement._isAllowedInsideAttributeElement = options.isAllowedInsideAttributeElement;
  37497. }
  37498. return rawElement;
  37499. }
  37500. /**
  37501. * Adds or overwrites the element's attribute with a specified key and value.
  37502. *
  37503. * writer.setAttribute( 'href', 'http://ckeditor.com', linkElement );
  37504. *
  37505. * @param {String} key The attribute key.
  37506. * @param {String} value The attribute value.
  37507. * @param {module:engine/view/element~Element} element
  37508. */
  37509. setAttribute( key, value, element ) {
  37510. element._setAttribute( key, value );
  37511. }
  37512. /**
  37513. * Removes attribute from the element.
  37514. *
  37515. * writer.removeAttribute( 'href', linkElement );
  37516. *
  37517. * @param {String} key Attribute key.
  37518. * @param {module:engine/view/element~Element} element
  37519. */
  37520. removeAttribute( key, element ) {
  37521. element._removeAttribute( key );
  37522. }
  37523. /**
  37524. * Adds specified class to the element.
  37525. *
  37526. * writer.addClass( 'foo', linkElement );
  37527. * writer.addClass( [ 'foo', 'bar' ], linkElement );
  37528. *
  37529. * @param {Array.<String>|String} className
  37530. * @param {module:engine/view/element~Element} element
  37531. */
  37532. addClass( className, element ) {
  37533. element._addClass( className );
  37534. }
  37535. /**
  37536. * Removes specified class from the element.
  37537. *
  37538. * writer.removeClass( 'foo', linkElement );
  37539. * writer.removeClass( [ 'foo', 'bar' ], linkElement );
  37540. *
  37541. * @param {Array.<String>|String} className
  37542. * @param {module:engine/view/element~Element} element
  37543. */
  37544. removeClass( className, element ) {
  37545. element._removeClass( className );
  37546. }
  37547. /**
  37548. * Adds style to the element.
  37549. *
  37550. * writer.setStyle( 'color', 'red', element );
  37551. * writer.setStyle( {
  37552. * color: 'red',
  37553. * position: 'fixed'
  37554. * }, element );
  37555. *
  37556. * **Note**: The passed style can be normalized if
  37557. * {@link module:engine/controller/datacontroller~DataController#addStyleProcessorRules a particular style processor rule is enabled}.
  37558. * See {@link module:engine/view/stylesmap~StylesMap#set `StylesMap#set()`} for details.
  37559. *
  37560. * @param {String|Object} property Property name or object with key - value pairs.
  37561. * @param {String} [value] Value to set. This parameter is ignored if object is provided as the first parameter.
  37562. * @param {module:engine/view/element~Element} element Element to set styles on.
  37563. */
  37564. setStyle( property, value, element ) {
  37565. if ( Object(lodash_es__WEBPACK_IMPORTED_MODULE_13__["isPlainObject"])( property ) && element === undefined ) {
  37566. element = value;
  37567. }
  37568. element._setStyle( property, value );
  37569. }
  37570. /**
  37571. * Removes specified style from the element.
  37572. *
  37573. * writer.removeStyle( 'color', element ); // Removes 'color' style.
  37574. * writer.removeStyle( [ 'color', 'border-top' ], element ); // Removes both 'color' and 'border-top' styles.
  37575. *
  37576. * **Note**: This method can work with normalized style names if
  37577. * {@link module:engine/controller/datacontroller~DataController#addStyleProcessorRules a particular style processor rule is enabled}.
  37578. * See {@link module:engine/view/stylesmap~StylesMap#remove `StylesMap#remove()`} for details.
  37579. *
  37580. * @param {Array.<String>|String} property
  37581. * @param {module:engine/view/element~Element} element
  37582. */
  37583. removeStyle( property, element ) {
  37584. element._removeStyle( property );
  37585. }
  37586. /**
  37587. * Sets a custom property on element. Unlike attributes, custom properties are not rendered to the DOM,
  37588. * so they can be used to add special data to elements.
  37589. *
  37590. * @param {String|Symbol} key
  37591. * @param {*} value
  37592. * @param {module:engine/view/element~Element} element
  37593. */
  37594. setCustomProperty( key, value, element ) {
  37595. element._setCustomProperty( key, value );
  37596. }
  37597. /**
  37598. * Removes a custom property stored under the given key.
  37599. *
  37600. * @param {String|Symbol} key
  37601. * @param {module:engine/view/element~Element} element
  37602. * @returns {Boolean} Returns true if property was removed.
  37603. */
  37604. removeCustomProperty( key, element ) {
  37605. return element._removeCustomProperty( key );
  37606. }
  37607. /**
  37608. * Breaks attribute elements at the provided position or at the boundaries of a provided range. It breaks attribute elements
  37609. * up to their first ancestor that is a container element.
  37610. *
  37611. * In following examples `<p>` is a container, `<b>` and `<u>` are attribute elements:
  37612. *
  37613. * <p>foo<b><u>bar{}</u></b></p> -> <p>foo<b><u>bar</u></b>[]</p>
  37614. * <p>foo<b><u>{}bar</u></b></p> -> <p>foo{}<b><u>bar</u></b></p>
  37615. * <p>foo<b><u>b{}ar</u></b></p> -> <p>foo<b><u>b</u></b>[]<b><u>ar</u></b></p>
  37616. * <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>
  37617. *
  37618. * **Note:** {@link module:engine/view/documentfragment~DocumentFragment DocumentFragment} is treated like a container.
  37619. *
  37620. * **Note:** The difference between {@link module:engine/view/downcastwriter~DowncastWriter#breakAttributes breakAttributes()} and
  37621. * {@link module:engine/view/downcastwriter~DowncastWriter#breakContainer breakContainer()} is that `breakAttributes()` breaks all
  37622. * {@link module:engine/view/attributeelement~AttributeElement attribute elements} that are ancestors of a given `position`,
  37623. * up to the first encountered {@link module:engine/view/containerelement~ContainerElement container element}.
  37624. * `breakContainer()` assumes that a given `position` is directly in the container element and breaks that container element.
  37625. *
  37626. * Throws the `view-writer-invalid-range-container` {@link module:utils/ckeditorerror~CKEditorError CKEditorError}
  37627. * when the {@link module:engine/view/range~Range#start start}
  37628. * and {@link module:engine/view/range~Range#end end} positions of a passed range are not placed inside same parent container.
  37629. *
  37630. * Throws the `view-writer-cannot-break-empty-element` {@link module:utils/ckeditorerror~CKEditorError CKEditorError}
  37631. * when trying to break attributes inside an {@link module:engine/view/emptyelement~EmptyElement EmptyElement}.
  37632. *
  37633. * Throws the `view-writer-cannot-break-ui-element` {@link module:utils/ckeditorerror~CKEditorError CKEditorError}
  37634. * when trying to break attributes inside a {@link module:engine/view/uielement~UIElement UIElement}.
  37635. *
  37636. * @see module:engine/view/attributeelement~AttributeElement
  37637. * @see module:engine/view/containerelement~ContainerElement
  37638. * @see module:engine/view/downcastwriter~DowncastWriter#breakContainer
  37639. * @param {module:engine/view/position~Position|module:engine/view/range~Range} positionOrRange The position where
  37640. * to break attribute elements.
  37641. * @returns {module:engine/view/position~Position|module:engine/view/range~Range} The new position or range, after breaking the
  37642. * attribute elements.
  37643. */
  37644. breakAttributes( positionOrRange ) {
  37645. if ( positionOrRange instanceof _position__WEBPACK_IMPORTED_MODULE_0__["default"] ) {
  37646. return this._breakAttributes( positionOrRange );
  37647. } else {
  37648. return this._breakAttributesRange( positionOrRange );
  37649. }
  37650. }
  37651. /**
  37652. * Breaks a {@link module:engine/view/containerelement~ContainerElement container view element} into two, at the given position.
  37653. * The position has to be directly inside the container element and cannot be in the root. It does not break the conrainer view element
  37654. * if the position is at the beginning or at the end of its parent element.
  37655. *
  37656. * <p>foo^bar</p> -> <p>foo</p><p>bar</p>
  37657. * <div><p>foo</p>^<p>bar</p></div> -> <div><p>foo</p></div><div><p>bar</p></div>
  37658. * <p>^foobar</p> -> ^<p>foobar</p>
  37659. * <p>foobar^</p> -> <p>foobar</p>^
  37660. *
  37661. * **Note:** The difference between {@link module:engine/view/downcastwriter~DowncastWriter#breakAttributes breakAttributes()} and
  37662. * {@link module:engine/view/downcastwriter~DowncastWriter#breakContainer breakContainer()} is that `breakAttributes()` breaks all
  37663. * {@link module:engine/view/attributeelement~AttributeElement attribute elements} that are ancestors of a given `position`,
  37664. * up to the first encountered {@link module:engine/view/containerelement~ContainerElement container element}.
  37665. * `breakContainer()` assumes that the given `position` is directly in the container element and breaks that container element.
  37666. *
  37667. * @see module:engine/view/attributeelement~AttributeElement
  37668. * @see module:engine/view/containerelement~ContainerElement
  37669. * @see module:engine/view/downcastwriter~DowncastWriter#breakAttributes
  37670. * @param {module:engine/view/position~Position} position The position where to break the element.
  37671. * @returns {module:engine/view/position~Position} The position between broken elements. If an element has not been broken,
  37672. * the returned position is placed either before or after it.
  37673. */
  37674. breakContainer( position ) {
  37675. const element = position.parent;
  37676. if ( !( element.is( 'containerElement' ) ) ) {
  37677. /**
  37678. * Trying to break an element which is not a container element.
  37679. *
  37680. * @error view-writer-break-non-container-element
  37681. */
  37682. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_8__["default"]( 'view-writer-break-non-container-element', this.document );
  37683. }
  37684. if ( !element.parent ) {
  37685. /**
  37686. * Trying to break root element.
  37687. *
  37688. * @error view-writer-break-root
  37689. */
  37690. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_8__["default"]( 'view-writer-break-root', this.document );
  37691. }
  37692. if ( position.isAtStart ) {
  37693. return _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createBefore( element );
  37694. } else if ( !position.isAtEnd ) {
  37695. const newElement = element._clone( false );
  37696. this.insert( _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createAfter( element ), newElement );
  37697. const sourceRange = new _range__WEBPACK_IMPORTED_MODULE_1__["default"]( position, _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createAt( element, 'end' ) );
  37698. const targetPosition = new _position__WEBPACK_IMPORTED_MODULE_0__["default"]( newElement, 0 );
  37699. this.move( sourceRange, targetPosition );
  37700. }
  37701. return _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createAfter( element );
  37702. }
  37703. /**
  37704. * Merges {@link module:engine/view/attributeelement~AttributeElement attribute elements}. It also merges text nodes if needed.
  37705. * Only {@link module:engine/view/attributeelement~AttributeElement#isSimilar similar} attribute elements can be merged.
  37706. *
  37707. * In following examples `<p>` is a container and `<b>` is an attribute element:
  37708. *
  37709. * <p>foo[]bar</p> -> <p>foo{}bar</p>
  37710. * <p><b>foo</b>[]<b>bar</b></p> -> <p><b>foo{}bar</b></p>
  37711. * <p><b foo="bar">a</b>[]<b foo="baz">b</b></p> -> <p><b foo="bar">a</b>[]<b foo="baz">b</b></p>
  37712. *
  37713. * It will also take care about empty attributes when merging:
  37714. *
  37715. * <p><b>[]</b></p> -> <p>[]</p>
  37716. * <p><b>foo</b><i>[]</i><b>bar</b></p> -> <p><b>foo{}bar</b></p>
  37717. *
  37718. * **Note:** Difference between {@link module:engine/view/downcastwriter~DowncastWriter#mergeAttributes mergeAttributes} and
  37719. * {@link module:engine/view/downcastwriter~DowncastWriter#mergeContainers mergeContainers} is that `mergeAttributes` merges two
  37720. * {@link module:engine/view/attributeelement~AttributeElement attribute elements} or {@link module:engine/view/text~Text text nodes}
  37721. * while `mergeContainer` merges two {@link module:engine/view/containerelement~ContainerElement container elements}.
  37722. *
  37723. * @see module:engine/view/attributeelement~AttributeElement
  37724. * @see module:engine/view/containerelement~ContainerElement
  37725. * @see module:engine/view/downcastwriter~DowncastWriter#mergeContainers
  37726. * @param {module:engine/view/position~Position} position Merge position.
  37727. * @returns {module:engine/view/position~Position} Position after merge.
  37728. */
  37729. mergeAttributes( position ) {
  37730. const positionOffset = position.offset;
  37731. const positionParent = position.parent;
  37732. // When inside text node - nothing to merge.
  37733. if ( positionParent.is( '$text' ) ) {
  37734. return position;
  37735. }
  37736. // When inside empty attribute - remove it.
  37737. if ( positionParent.is( 'attributeElement' ) && positionParent.childCount === 0 ) {
  37738. const parent = positionParent.parent;
  37739. const offset = positionParent.index;
  37740. positionParent._remove();
  37741. this._removeFromClonedElementsGroup( positionParent );
  37742. return this.mergeAttributes( new _position__WEBPACK_IMPORTED_MODULE_0__["default"]( parent, offset ) );
  37743. }
  37744. const nodeBefore = positionParent.getChild( positionOffset - 1 );
  37745. const nodeAfter = positionParent.getChild( positionOffset );
  37746. // Position should be placed between two nodes.
  37747. if ( !nodeBefore || !nodeAfter ) {
  37748. return position;
  37749. }
  37750. // When position is between two text nodes.
  37751. if ( nodeBefore.is( '$text' ) && nodeAfter.is( '$text' ) ) {
  37752. return mergeTextNodes( nodeBefore, nodeAfter );
  37753. }
  37754. // When position is between two same attribute elements.
  37755. else if ( nodeBefore.is( 'attributeElement' ) && nodeAfter.is( 'attributeElement' ) && nodeBefore.isSimilar( nodeAfter ) ) {
  37756. // Move all children nodes from node placed after selection and remove that node.
  37757. const count = nodeBefore.childCount;
  37758. nodeBefore._appendChild( nodeAfter.getChildren() );
  37759. nodeAfter._remove();
  37760. this._removeFromClonedElementsGroup( nodeAfter );
  37761. // New position is located inside the first node, before new nodes.
  37762. // Call this method recursively to merge again if needed.
  37763. return this.mergeAttributes( new _position__WEBPACK_IMPORTED_MODULE_0__["default"]( nodeBefore, count ) );
  37764. }
  37765. return position;
  37766. }
  37767. /**
  37768. * Merges two {@link module:engine/view/containerelement~ContainerElement container elements} that are before and after given position.
  37769. * Precisely, the element after the position is removed and it's contents are moved to element before the position.
  37770. *
  37771. * <p>foo</p>^<p>bar</p> -> <p>foo^bar</p>
  37772. * <div>foo</div>^<p>bar</p> -> <div>foo^bar</div>
  37773. *
  37774. * **Note:** Difference between {@link module:engine/view/downcastwriter~DowncastWriter#mergeAttributes mergeAttributes} and
  37775. * {@link module:engine/view/downcastwriter~DowncastWriter#mergeContainers mergeContainers} is that `mergeAttributes` merges two
  37776. * {@link module:engine/view/attributeelement~AttributeElement attribute elements} or {@link module:engine/view/text~Text text nodes}
  37777. * while `mergeContainer` merges two {@link module:engine/view/containerelement~ContainerElement container elements}.
  37778. *
  37779. * @see module:engine/view/attributeelement~AttributeElement
  37780. * @see module:engine/view/containerelement~ContainerElement
  37781. * @see module:engine/view/downcastwriter~DowncastWriter#mergeAttributes
  37782. * @param {module:engine/view/position~Position} position Merge position.
  37783. * @returns {module:engine/view/position~Position} Position after merge.
  37784. */
  37785. mergeContainers( position ) {
  37786. const prev = position.nodeBefore;
  37787. const next = position.nodeAfter;
  37788. if ( !prev || !next || !prev.is( 'containerElement' ) || !next.is( 'containerElement' ) ) {
  37789. /**
  37790. * Element before and after given position cannot be merged.
  37791. *
  37792. * @error view-writer-merge-containers-invalid-position
  37793. */
  37794. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_8__["default"]( 'view-writer-merge-containers-invalid-position', this.document );
  37795. }
  37796. const lastChild = prev.getChild( prev.childCount - 1 );
  37797. 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' );
  37798. this.move( _range__WEBPACK_IMPORTED_MODULE_1__["default"]._createIn( next ), _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createAt( prev, 'end' ) );
  37799. this.remove( _range__WEBPACK_IMPORTED_MODULE_1__["default"]._createOn( next ) );
  37800. return newPosition;
  37801. }
  37802. /**
  37803. * Inserts a node or nodes at specified position. Takes care about breaking attributes before insertion
  37804. * and merging them afterwards.
  37805. *
  37806. * Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `view-writer-insert-invalid-node` when nodes to insert
  37807. * contains instances that are not {@link module:engine/view/text~Text Texts},
  37808. * {@link module:engine/view/attributeelement~AttributeElement AttributeElements},
  37809. * {@link module:engine/view/containerelement~ContainerElement ContainerElements},
  37810. * {@link module:engine/view/emptyelement~EmptyElement EmptyElements},
  37811. * {@link module:engine/view/rawelement~RawElement RawElements} or
  37812. * {@link module:engine/view/uielement~UIElement UIElements}.
  37813. *
  37814. * @param {module:engine/view/position~Position} position Insertion position.
  37815. * @param {module:engine/view/text~Text|module:engine/view/attributeelement~AttributeElement|
  37816. * module:engine/view/containerelement~ContainerElement|module:engine/view/emptyelement~EmptyElement|
  37817. * module:engine/view/rawelement~RawElement|module:engine/view/uielement~UIElement|
  37818. * Iterable.<module:engine/view/text~Text|
  37819. * module:engine/view/attributeelement~AttributeElement|module:engine/view/containerelement~ContainerElement|
  37820. * module:engine/view/emptyelement~EmptyElement|module:engine/view/rawelement~RawElement|
  37821. * module:engine/view/uielement~UIElement>} nodes Node or nodes to insert.
  37822. * @returns {module:engine/view/range~Range} Range around inserted nodes.
  37823. */
  37824. insert( position, nodes ) {
  37825. nodes = Object(_ckeditor_ckeditor5_utils_src_isiterable__WEBPACK_IMPORTED_MODULE_10__["default"])( nodes ) ? [ ...nodes ] : [ nodes ];
  37826. // Check if nodes to insert are instances of AttributeElements, ContainerElements, EmptyElements, UIElements or Text.
  37827. validateNodesToInsert( nodes, this.document );
  37828. // Group nodes in batches of nodes that require or do not require breaking an AttributeElements.
  37829. const nodeGroups = nodes.reduce( ( groups, node ) => {
  37830. const lastGroup = groups[ groups.length - 1 ];
  37831. // Break attributes on nodes that do exist in the model tree so they can have attributes, other elements
  37832. // can't have an attribute in model and won't get wrapped with an AttributeElement while down-casted.
  37833. const breakAttributes = !( node.is( 'uiElement' ) && node.isAllowedInsideAttributeElement );
  37834. if ( !lastGroup || lastGroup.breakAttributes != breakAttributes ) {
  37835. groups.push( {
  37836. breakAttributes,
  37837. nodes: [ node ]
  37838. } );
  37839. } else {
  37840. lastGroup.nodes.push( node );
  37841. }
  37842. return groups;
  37843. }, [] );
  37844. // Insert nodes in batches.
  37845. let start = null;
  37846. let end = position;
  37847. for ( const { nodes, breakAttributes } of nodeGroups ) {
  37848. const range = this._insertNodes( end, nodes, breakAttributes );
  37849. if ( !start ) {
  37850. start = range.start;
  37851. }
  37852. end = range.end;
  37853. }
  37854. // When no nodes were inserted - return collapsed range.
  37855. if ( !start ) {
  37856. return new _range__WEBPACK_IMPORTED_MODULE_1__["default"]( position );
  37857. }
  37858. return new _range__WEBPACK_IMPORTED_MODULE_1__["default"]( start, end );
  37859. }
  37860. /**
  37861. * Removes provided range from the container.
  37862. *
  37863. * Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `view-writer-invalid-range-container` when
  37864. * {@link module:engine/view/range~Range#start start} and {@link module:engine/view/range~Range#end end} positions are not placed inside
  37865. * same parent container.
  37866. *
  37867. * @param {module:engine/view/range~Range|module:engine/view/item~Item} rangeOrItem Range to remove from container
  37868. * or an {@link module:engine/view/item~Item item} to remove. If range is provided, after removing, it will be updated
  37869. * to a collapsed range showing the new position.
  37870. * @returns {module:engine/view/documentfragment~DocumentFragment} Document fragment containing removed nodes.
  37871. */
  37872. remove( rangeOrItem ) {
  37873. const range = rangeOrItem instanceof _range__WEBPACK_IMPORTED_MODULE_1__["default"] ? rangeOrItem : _range__WEBPACK_IMPORTED_MODULE_1__["default"]._createOn( rangeOrItem );
  37874. validateRangeContainer( range, this.document );
  37875. // If range is collapsed - nothing to remove.
  37876. if ( range.isCollapsed ) {
  37877. return new _documentfragment__WEBPACK_IMPORTED_MODULE_9__["default"]( this.document );
  37878. }
  37879. // Break attributes at range start and end.
  37880. const { start: breakStart, end: breakEnd } = this._breakAttributesRange( range, true );
  37881. const parentContainer = breakStart.parent;
  37882. const count = breakEnd.offset - breakStart.offset;
  37883. // Remove nodes in range.
  37884. const removed = parentContainer._removeChildren( breakStart.offset, count );
  37885. for ( const node of removed ) {
  37886. this._removeFromClonedElementsGroup( node );
  37887. }
  37888. // Merge after removing.
  37889. const mergePosition = this.mergeAttributes( breakStart );
  37890. range.start = mergePosition;
  37891. range.end = mergePosition.clone();
  37892. // Return removed nodes.
  37893. return new _documentfragment__WEBPACK_IMPORTED_MODULE_9__["default"]( this.document, removed );
  37894. }
  37895. /**
  37896. * Removes matching elements from given range.
  37897. *
  37898. * Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `view-writer-invalid-range-container` when
  37899. * {@link module:engine/view/range~Range#start start} and {@link module:engine/view/range~Range#end end} positions are not placed inside
  37900. * same parent container.
  37901. *
  37902. * @param {module:engine/view/range~Range} range Range to clear.
  37903. * @param {module:engine/view/element~Element} element Element to remove.
  37904. */
  37905. clear( range, element ) {
  37906. validateRangeContainer( range, this.document );
  37907. // Create walker on given range.
  37908. // We walk backward because when we remove element during walk it modifies range end position.
  37909. const walker = range.getWalker( {
  37910. direction: 'backward',
  37911. ignoreElementEnd: true
  37912. } );
  37913. // Let's walk.
  37914. for ( const current of walker ) {
  37915. const item = current.item;
  37916. let rangeToRemove;
  37917. // When current item matches to the given element.
  37918. if ( item.is( 'element' ) && element.isSimilar( item ) ) {
  37919. // Create range on this element.
  37920. rangeToRemove = _range__WEBPACK_IMPORTED_MODULE_1__["default"]._createOn( item );
  37921. // When range starts inside Text or TextProxy element.
  37922. } else if ( !current.nextPosition.isAfter( range.start ) && item.is( '$textProxy' ) ) {
  37923. // We need to check if parent of this text matches to given element.
  37924. const parentElement = item.getAncestors().find( ancestor => {
  37925. return ancestor.is( 'element' ) && element.isSimilar( ancestor );
  37926. } );
  37927. // If it is then create range inside this element.
  37928. if ( parentElement ) {
  37929. rangeToRemove = _range__WEBPACK_IMPORTED_MODULE_1__["default"]._createIn( parentElement );
  37930. }
  37931. }
  37932. // If we have found element to remove.
  37933. if ( rangeToRemove ) {
  37934. // We need to check if element range stick out of the given range and truncate if it is.
  37935. if ( rangeToRemove.end.isAfter( range.end ) ) {
  37936. rangeToRemove.end = range.end;
  37937. }
  37938. if ( rangeToRemove.start.isBefore( range.start ) ) {
  37939. rangeToRemove.start = range.start;
  37940. }
  37941. // At the end we remove range with found element.
  37942. this.remove( rangeToRemove );
  37943. }
  37944. }
  37945. }
  37946. /**
  37947. * Moves nodes from provided range to target position.
  37948. *
  37949. * Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `view-writer-invalid-range-container` when
  37950. * {@link module:engine/view/range~Range#start start} and {@link module:engine/view/range~Range#end end} positions are not placed inside
  37951. * same parent container.
  37952. *
  37953. * @param {module:engine/view/range~Range} sourceRange Range containing nodes to move.
  37954. * @param {module:engine/view/position~Position} targetPosition Position to insert.
  37955. * @returns {module:engine/view/range~Range} Range in target container. Inserted nodes are placed between
  37956. * {@link module:engine/view/range~Range#start start} and {@link module:engine/view/range~Range#end end} positions.
  37957. */
  37958. move( sourceRange, targetPosition ) {
  37959. let nodes;
  37960. if ( targetPosition.isAfter( sourceRange.end ) ) {
  37961. targetPosition = this._breakAttributes( targetPosition, true );
  37962. const parent = targetPosition.parent;
  37963. const countBefore = parent.childCount;
  37964. sourceRange = this._breakAttributesRange( sourceRange, true );
  37965. nodes = this.remove( sourceRange );
  37966. targetPosition.offset += ( parent.childCount - countBefore );
  37967. } else {
  37968. nodes = this.remove( sourceRange );
  37969. }
  37970. return this.insert( targetPosition, nodes );
  37971. }
  37972. /**
  37973. * Wraps elements within range with provided {@link module:engine/view/attributeelement~AttributeElement AttributeElement}.
  37974. * If a collapsed range is provided, it will be wrapped only if it is equal to view selection.
  37975. *
  37976. * If a collapsed range was passed and is same as selection, the selection
  37977. * will be moved to the inside of the wrapped attribute element.
  37978. *
  37979. * Throws {@link module:utils/ckeditorerror~CKEditorError} `view-writer-invalid-range-container`
  37980. * when {@link module:engine/view/range~Range#start}
  37981. * and {@link module:engine/view/range~Range#end} positions are not placed inside same parent container.
  37982. *
  37983. * Throws {@link module:utils/ckeditorerror~CKEditorError} `view-writer-wrap-invalid-attribute` when passed attribute element is not
  37984. * an instance of {@link module:engine/view/attributeelement~AttributeElement AttributeElement}.
  37985. *
  37986. * Throws {@link module:utils/ckeditorerror~CKEditorError} `view-writer-wrap-nonselection-collapsed-range` when passed range
  37987. * is collapsed and different than view selection.
  37988. *
  37989. * **Note:** Attribute elements by default can wrap {@link module:engine/view/text~Text},
  37990. * {@link module:engine/view/emptyelement~EmptyElement}, {@link module:engine/view/uielement~UIElement},
  37991. * {@link module:engine/view/rawelement~RawElement} and other attribute elements with higher priority. Other elements while placed
  37992. * inside an attribute element will split it (or nest it in case of an `AttributeElement`). This behavior can be modified by changing
  37993. * the `isAllowedInsideAttributeElement` option while using
  37994. * {@link module:engine/view/downcastwriter~DowncastWriter#createContainerElement},
  37995. * {@link module:engine/view/downcastwriter~DowncastWriter#createEmptyElement},
  37996. * {@link module:engine/view/downcastwriter~DowncastWriter#createUIElement} or
  37997. * {@link module:engine/view/downcastwriter~DowncastWriter#createRawElement}.
  37998. *
  37999. * @param {module:engine/view/range~Range} range Range to wrap.
  38000. * @param {module:engine/view/attributeelement~AttributeElement} attribute Attribute element to use as wrapper.
  38001. * @returns {module:engine/view/range~Range} range Range after wrapping, spanning over wrapping attribute element.
  38002. */
  38003. wrap( range, attribute ) {
  38004. if ( !( attribute instanceof _attributeelement__WEBPACK_IMPORTED_MODULE_4__["default"] ) ) {
  38005. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_8__["default"](
  38006. 'view-writer-wrap-invalid-attribute',
  38007. this.document
  38008. );
  38009. }
  38010. validateRangeContainer( range, this.document );
  38011. if ( !range.isCollapsed ) {
  38012. // Non-collapsed range. Wrap it with the attribute element.
  38013. return this._wrapRange( range, attribute );
  38014. } else {
  38015. // Collapsed range. Wrap position.
  38016. let position = range.start;
  38017. if ( position.parent.is( 'element' ) && !_hasNonUiChildren( position.parent ) ) {
  38018. position = position.getLastMatchingPosition( value => value.item.is( 'uiElement' ) );
  38019. }
  38020. position = this._wrapPosition( position, attribute );
  38021. const viewSelection = this.document.selection;
  38022. // If wrapping position is equal to view selection, move view selection inside wrapping attribute element.
  38023. if ( viewSelection.isCollapsed && viewSelection.getFirstPosition().isEqual( range.start ) ) {
  38024. this.setSelection( position );
  38025. }
  38026. return new _range__WEBPACK_IMPORTED_MODULE_1__["default"]( position );
  38027. }
  38028. }
  38029. /**
  38030. * Unwraps nodes within provided range from attribute element.
  38031. *
  38032. * Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `view-writer-invalid-range-container` when
  38033. * {@link module:engine/view/range~Range#start start} and {@link module:engine/view/range~Range#end end} positions are not placed inside
  38034. * same parent container.
  38035. *
  38036. * @param {module:engine/view/range~Range} range
  38037. * @param {module:engine/view/attributeelement~AttributeElement} attribute
  38038. */
  38039. unwrap( range, attribute ) {
  38040. if ( !( attribute instanceof _attributeelement__WEBPACK_IMPORTED_MODULE_4__["default"] ) ) {
  38041. /**
  38042. * The `attribute` passed to {@link module:engine/view/downcastwriter~DowncastWriter#unwrap `DowncastWriter#unwrap()`}
  38043. * must be an instance of {@link module:engine/view/attributeelement~AttributeElement `AttributeElement`}.
  38044. *
  38045. * @error view-writer-unwrap-invalid-attribute
  38046. */
  38047. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_8__["default"](
  38048. 'view-writer-unwrap-invalid-attribute',
  38049. this.document
  38050. );
  38051. }
  38052. validateRangeContainer( range, this.document );
  38053. // If range is collapsed - nothing to unwrap.
  38054. if ( range.isCollapsed ) {
  38055. return range;
  38056. }
  38057. // Break attributes at range start and end.
  38058. const { start: breakStart, end: breakEnd } = this._breakAttributesRange( range, true );
  38059. const parentContainer = breakStart.parent;
  38060. // Unwrap children located between break points.
  38061. const newRange = this._unwrapChildren( parentContainer, breakStart.offset, breakEnd.offset, attribute );
  38062. // Merge attributes at the both ends and return a new range.
  38063. const start = this.mergeAttributes( newRange.start );
  38064. // If start position was merged - move end position back.
  38065. if ( !start.isEqual( newRange.start ) ) {
  38066. newRange.end.offset--;
  38067. }
  38068. const end = this.mergeAttributes( newRange.end );
  38069. return new _range__WEBPACK_IMPORTED_MODULE_1__["default"]( start, end );
  38070. }
  38071. /**
  38072. * Renames element by creating a copy of renamed element but with changed name and then moving contents of the
  38073. * old element to the new one. Keep in mind that this will invalidate all {@link module:engine/view/position~Position positions} which
  38074. * has renamed element as {@link module:engine/view/position~Position#parent a parent}.
  38075. *
  38076. * New element has to be created because `Element#tagName` property in DOM is readonly.
  38077. *
  38078. * Since this function creates a new element and removes the given one, the new element is returned to keep reference.
  38079. *
  38080. * @param {String} newName New name for element.
  38081. * @param {module:engine/view/containerelement~ContainerElement} viewElement Element to be renamed.
  38082. * @returns {module:engine/view/containerelement~ContainerElement} Element created due to rename.
  38083. */
  38084. rename( newName, viewElement ) {
  38085. const newElement = new _containerelement__WEBPACK_IMPORTED_MODULE_3__["default"]( this.document, newName, viewElement.getAttributes() );
  38086. this.insert( _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createAfter( viewElement ), newElement );
  38087. this.move( _range__WEBPACK_IMPORTED_MODULE_1__["default"]._createIn( viewElement ), _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createAt( newElement, 0 ) );
  38088. this.remove( _range__WEBPACK_IMPORTED_MODULE_1__["default"]._createOn( viewElement ) );
  38089. return newElement;
  38090. }
  38091. /**
  38092. * Cleans up memory by removing obsolete cloned elements group from the writer.
  38093. *
  38094. * Should be used whenever all {@link module:engine/view/attributeelement~AttributeElement attribute elements}
  38095. * with the same {@link module:engine/view/attributeelement~AttributeElement#id id} are going to be removed from the view and
  38096. * the group will no longer be needed.
  38097. *
  38098. * Cloned elements group are not removed automatically in case if the group is still needed after all its elements
  38099. * were removed from the view.
  38100. *
  38101. * Keep in mind that group names are equal to the `id` property of the attribute element.
  38102. *
  38103. * @param {String} groupName Name of the group to clear.
  38104. */
  38105. clearClonedElementsGroup( groupName ) {
  38106. this._cloneGroups.delete( groupName );
  38107. }
  38108. /**
  38109. * Creates position at the given location. The location can be specified as:
  38110. *
  38111. * * a {@link module:engine/view/position~Position position},
  38112. * * parent element and offset (offset defaults to `0`),
  38113. * * parent element and `'end'` (sets position at the end of that element),
  38114. * * {@link module:engine/view/item~Item view item} and `'before'` or `'after'` (sets position before or after given view item).
  38115. *
  38116. * This method is a shortcut to other constructors such as:
  38117. *
  38118. * * {@link #createPositionBefore},
  38119. * * {@link #createPositionAfter},
  38120. *
  38121. * @param {module:engine/view/item~Item|module:engine/model/position~Position} itemOrPosition
  38122. * @param {Number|'end'|'before'|'after'} [offset] Offset or one of the flags. Used only when
  38123. * first parameter is a {@link module:engine/view/item~Item view item}.
  38124. * @returns {module:engine/view/position~Position}
  38125. */
  38126. createPositionAt( itemOrPosition, offset ) {
  38127. return _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createAt( itemOrPosition, offset );
  38128. }
  38129. /**
  38130. * Creates a new position after given view item.
  38131. *
  38132. * @param {module:engine/view/item~Item} item View item after which the position should be located.
  38133. * @returns {module:engine/view/position~Position}
  38134. */
  38135. createPositionAfter( item ) {
  38136. return _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createAfter( item );
  38137. }
  38138. /**
  38139. * Creates a new position before given view item.
  38140. *
  38141. * @param {module:engine/view/item~Item} item View item before which the position should be located.
  38142. * @returns {module:engine/view/position~Position}
  38143. */
  38144. createPositionBefore( item ) {
  38145. return _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createBefore( item );
  38146. }
  38147. /**
  38148. * Creates a range spanning from `start` position to `end` position.
  38149. *
  38150. * **Note:** This factory method creates its own {@link module:engine/view/position~Position} instances basing on passed values.
  38151. *
  38152. * @param {module:engine/view/position~Position} start Start position.
  38153. * @param {module:engine/view/position~Position} [end] End position. If not set, range will be collapsed at `start` position.
  38154. * @returns {module:engine/view/range~Range}
  38155. */
  38156. createRange( start, end ) {
  38157. return new _range__WEBPACK_IMPORTED_MODULE_1__["default"]( start, end );
  38158. }
  38159. /**
  38160. * Creates a range that starts before given {@link module:engine/view/item~Item view item} and ends after it.
  38161. *
  38162. * @param {module:engine/view/item~Item} item
  38163. * @returns {module:engine/view/range~Range}
  38164. */
  38165. createRangeOn( item ) {
  38166. return _range__WEBPACK_IMPORTED_MODULE_1__["default"]._createOn( item );
  38167. }
  38168. /**
  38169. * Creates a range inside an {@link module:engine/view/element~Element element} which starts before the first child of
  38170. * that element and ends after the last child of that element.
  38171. *
  38172. * @param {module:engine/view/element~Element} element Element which is a parent for the range.
  38173. * @returns {module:engine/view/range~Range}
  38174. */
  38175. createRangeIn( element ) {
  38176. return _range__WEBPACK_IMPORTED_MODULE_1__["default"]._createIn( element );
  38177. }
  38178. /**
  38179. Creates new {@link module:engine/view/selection~Selection} instance.
  38180. *
  38181. * // Creates empty selection without ranges.
  38182. * const selection = writer.createSelection();
  38183. *
  38184. * // Creates selection at the given range.
  38185. * const range = writer.createRange( start, end );
  38186. * const selection = writer.createSelection( range );
  38187. *
  38188. * // Creates selection at the given ranges
  38189. * const ranges = [ writer.createRange( start1, end2 ), writer.createRange( star2, end2 ) ];
  38190. * const selection = writer.createSelection( ranges );
  38191. *
  38192. * // Creates selection from the other selection.
  38193. * const otherSelection = writer.createSelection();
  38194. * const selection = writer.createSelection( otherSelection );
  38195. *
  38196. * // Creates selection from the document selection.
  38197. * const selection = writer.createSelection( editor.editing.view.document.selection );
  38198. *
  38199. * // Creates selection at the given position.
  38200. * const position = writer.createPositionFromPath( root, path );
  38201. * const selection = writer.createSelection( position );
  38202. *
  38203. * // Creates collapsed selection at the position of given item and offset.
  38204. * const paragraph = writer.createContainerElement( 'p' );
  38205. * const selection = writer.createSelection( paragraph, offset );
  38206. *
  38207. * // Creates a range inside an {@link module:engine/view/element~Element element} which starts before the
  38208. * // first child of that element and ends after the last child of that element.
  38209. * const selection = writer.createSelection( paragraph, 'in' );
  38210. *
  38211. * // Creates a range on an {@link module:engine/view/item~Item item} which starts before the item and ends
  38212. * // just after the item.
  38213. * const selection = writer.createSelection( paragraph, 'on' );
  38214. *
  38215. * `Selection`'s constructor allow passing additional options (`backward`, `fake` and `label`) as the last argument.
  38216. *
  38217. * // Creates backward selection.
  38218. * const selection = writer.createSelection( range, { backward: true } );
  38219. *
  38220. * Fake selection does not render as browser native selection over selected elements and is hidden to the user.
  38221. * This way, no native selection UI artifacts are displayed to the user and selection over elements can be
  38222. * represented in other way, for example by applying proper CSS class.
  38223. *
  38224. * Additionally fake's selection label can be provided. It will be used to describe fake selection in DOM
  38225. * (and be properly handled by screen readers).
  38226. *
  38227. * // Creates fake selection with label.
  38228. * const selection = writer.createSelection( range, { fake: true, label: 'foo' } );
  38229. *
  38230. * @param {module:engine/view/selection~Selectable} [selectable=null]
  38231. * @param {Number|'before'|'end'|'after'|'on'|'in'} [placeOrOffset] Offset or place when selectable is an `Item`.
  38232. * @param {Object} [options]
  38233. * @param {Boolean} [options.backward] Sets this selection instance to be backward.
  38234. * @param {Boolean} [options.fake] Sets this selection instance to be marked as `fake`.
  38235. * @param {String} [options.label] Label for the fake selection.
  38236. * @returns {module:engine/view/selection~Selection}
  38237. */
  38238. createSelection( selectable, placeOrOffset, options ) {
  38239. return new _selection__WEBPACK_IMPORTED_MODULE_2__["default"]( selectable, placeOrOffset, options );
  38240. }
  38241. /**
  38242. * Inserts a node or nodes at the specified position. Takes care of breaking attributes before insertion
  38243. * and merging them afterwards if requested by the breakAttributes param.
  38244. *
  38245. * @private
  38246. * @param {module:engine/view/position~Position} position Insertion position.
  38247. * @param {module:engine/view/text~Text|module:engine/view/attributeelement~AttributeElement|
  38248. * module:engine/view/containerelement~ContainerElement|module:engine/view/emptyelement~EmptyElement|
  38249. * module:engine/view/rawelement~RawElement|module:engine/view/uielement~UIElement|
  38250. * Iterable.<module:engine/view/text~Text|
  38251. * module:engine/view/attributeelement~AttributeElement|module:engine/view/containerelement~ContainerElement|
  38252. * module:engine/view/emptyelement~EmptyElement|module:engine/view/rawelement~RawElement|
  38253. * module:engine/view/uielement~UIElement>} nodes Node or nodes to insert.
  38254. * @param {Boolean} breakAttributes Whether attributes should be broken.
  38255. * @returns {module:engine/view/range~Range} Range around inserted nodes.
  38256. */
  38257. _insertNodes( position, nodes, breakAttributes ) {
  38258. let parentElement;
  38259. // Break attributes on nodes that do exist in the model tree so they can have attributes, other elements
  38260. // can't have an attribute in model and won't get wrapped with an AttributeElement while down-casted.
  38261. if ( breakAttributes ) {
  38262. parentElement = getParentContainer( position );
  38263. } else {
  38264. parentElement = position.parent.is( '$text' ) ? position.parent.parent : position.parent;
  38265. }
  38266. if ( !parentElement ) {
  38267. /**
  38268. * Position's parent container cannot be found.
  38269. *
  38270. * @error view-writer-invalid-position-container
  38271. */
  38272. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_8__["default"](
  38273. 'view-writer-invalid-position-container',
  38274. this.document
  38275. );
  38276. }
  38277. let insertionPosition;
  38278. if ( breakAttributes ) {
  38279. insertionPosition = this._breakAttributes( position, true );
  38280. } else {
  38281. insertionPosition = position.parent.is( '$text' ) ? breakTextNode( position ) : position;
  38282. }
  38283. const length = parentElement._insertChild( insertionPosition.offset, nodes );
  38284. for ( const node of nodes ) {
  38285. this._addToClonedElementsGroup( node );
  38286. }
  38287. const endPosition = insertionPosition.getShiftedBy( length );
  38288. const start = this.mergeAttributes( insertionPosition );
  38289. // If start position was merged - move end position.
  38290. if ( !start.isEqual( insertionPosition ) ) {
  38291. endPosition.offset--;
  38292. }
  38293. const end = this.mergeAttributes( endPosition );
  38294. return new _range__WEBPACK_IMPORTED_MODULE_1__["default"]( start, end );
  38295. }
  38296. /**
  38297. * Wraps children with provided `wrapElement`. Only children contained in `parent` element between
  38298. * `startOffset` and `endOffset` will be wrapped.
  38299. *
  38300. * @private
  38301. * @param {module:engine/view/element~Element} parent
  38302. * @param {Number} startOffset
  38303. * @param {Number} endOffset
  38304. * @param {module:engine/view/element~Element} wrapElement
  38305. */
  38306. _wrapChildren( parent, startOffset, endOffset, wrapElement ) {
  38307. let i = startOffset;
  38308. const wrapPositions = [];
  38309. while ( i < endOffset ) {
  38310. const child = parent.getChild( i );
  38311. const isText = child.is( '$text' );
  38312. const isAttribute = child.is( 'attributeElement' );
  38313. const isAllowedInsideAttributeElement = child.isAllowedInsideAttributeElement;
  38314. //
  38315. // (In all examples, assume that `wrapElement` is `<span class="foo">` element.)
  38316. //
  38317. // Check if `wrapElement` can be joined with the wrapped element. One of requirements is having same name.
  38318. // If possible, join elements.
  38319. //
  38320. // <p><span class="bar">abc</span></p> --> <p><span class="foo bar">abc</span></p>
  38321. //
  38322. if ( isAttribute && this._wrapAttributeElement( wrapElement, child ) ) {
  38323. wrapPositions.push( new _position__WEBPACK_IMPORTED_MODULE_0__["default"]( parent, i ) );
  38324. }
  38325. //
  38326. // Wrap the child if it is not an attribute element or if it is an attribute element that should be inside
  38327. // `wrapElement` (due to priority).
  38328. //
  38329. // <p>abc</p> --> <p><span class="foo">abc</span></p>
  38330. // <p><strong>abc</strong></p> --> <p><span class="foo"><strong>abc</strong></span></p>
  38331. else if ( isText || isAllowedInsideAttributeElement || ( isAttribute && shouldABeOutsideB( wrapElement, child ) ) ) {
  38332. // Clone attribute.
  38333. const newAttribute = wrapElement._clone();
  38334. // Wrap current node with new attribute.
  38335. child._remove();
  38336. newAttribute._appendChild( child );
  38337. parent._insertChild( i, newAttribute );
  38338. this._addToClonedElementsGroup( newAttribute );
  38339. wrapPositions.push( new _position__WEBPACK_IMPORTED_MODULE_0__["default"]( parent, i ) );
  38340. }
  38341. //
  38342. // If other nested attribute is found and it wasn't wrapped (see above), continue wrapping inside it.
  38343. //
  38344. // <p><a href="foo.html">abc</a></p> --> <p><a href="foo.html"><span class="foo">abc</span></a></p>
  38345. //
  38346. else if ( isAttribute ) {
  38347. this._wrapChildren( child, 0, child.childCount, wrapElement );
  38348. }
  38349. i++;
  38350. }
  38351. // Merge at each wrap.
  38352. let offsetChange = 0;
  38353. for ( const position of wrapPositions ) {
  38354. position.offset -= offsetChange;
  38355. // Do not merge with elements outside selected children.
  38356. if ( position.offset == startOffset ) {
  38357. continue;
  38358. }
  38359. const newPosition = this.mergeAttributes( position );
  38360. // If nodes were merged - other merge offsets will change.
  38361. if ( !newPosition.isEqual( position ) ) {
  38362. offsetChange++;
  38363. endOffset--;
  38364. }
  38365. }
  38366. return _range__WEBPACK_IMPORTED_MODULE_1__["default"]._createFromParentsAndOffsets( parent, startOffset, parent, endOffset );
  38367. }
  38368. /**
  38369. * Unwraps children from provided `unwrapElement`. Only children contained in `parent` element between
  38370. * `startOffset` and `endOffset` will be unwrapped.
  38371. *
  38372. * @private
  38373. * @param {module:engine/view/element~Element} parent
  38374. * @param {Number} startOffset
  38375. * @param {Number} endOffset
  38376. * @param {module:engine/view/element~Element} unwrapElement
  38377. */
  38378. _unwrapChildren( parent, startOffset, endOffset, unwrapElement ) {
  38379. let i = startOffset;
  38380. const unwrapPositions = [];
  38381. // Iterate over each element between provided offsets inside parent.
  38382. // We don't use tree walker or range iterator because we will be removing and merging potentially multiple nodes,
  38383. // so it could get messy. It is safer to it manually in this case.
  38384. while ( i < endOffset ) {
  38385. const child = parent.getChild( i );
  38386. // Skip all text nodes. There should be no container element's here either.
  38387. if ( !child.is( 'attributeElement' ) ) {
  38388. i++;
  38389. continue;
  38390. }
  38391. //
  38392. // (In all examples, assume that `unwrapElement` is `<span class="foo">` element.)
  38393. //
  38394. // If the child is similar to the given attribute element, unwrap it - it will be completely removed.
  38395. //
  38396. // <p><span class="foo">abc</span>xyz</p> --> <p>abcxyz</p>
  38397. //
  38398. if ( child.isSimilar( unwrapElement ) ) {
  38399. const unwrapped = child.getChildren();
  38400. const count = child.childCount;
  38401. // Replace wrapper element with its children
  38402. child._remove();
  38403. parent._insertChild( i, unwrapped );
  38404. this._removeFromClonedElementsGroup( child );
  38405. // Save start and end position of moved items.
  38406. unwrapPositions.push(
  38407. new _position__WEBPACK_IMPORTED_MODULE_0__["default"]( parent, i ),
  38408. new _position__WEBPACK_IMPORTED_MODULE_0__["default"]( parent, i + count )
  38409. );
  38410. // Skip elements that were unwrapped. Assuming there won't be another element to unwrap in child elements.
  38411. i += count;
  38412. endOffset += count - 1;
  38413. continue;
  38414. }
  38415. //
  38416. // If the child is not similar but is an attribute element, try partial unwrapping - remove the same attributes/styles/classes.
  38417. // Partial unwrapping will happen only if the elements have the same name.
  38418. //
  38419. // <p><span class="foo bar">abc</span>xyz</p> --> <p><span class="bar">abc</span>xyz</p>
  38420. // <p><i class="foo">abc</i>xyz</p> --> <p><i class="foo">abc</i>xyz</p>
  38421. //
  38422. if ( this._unwrapAttributeElement( unwrapElement, child ) ) {
  38423. unwrapPositions.push(
  38424. new _position__WEBPACK_IMPORTED_MODULE_0__["default"]( parent, i ),
  38425. new _position__WEBPACK_IMPORTED_MODULE_0__["default"]( parent, i + 1 )
  38426. );
  38427. i++;
  38428. continue;
  38429. }
  38430. //
  38431. // If other nested attribute is found, look through it's children for elements to unwrap.
  38432. //
  38433. // <p><i><span class="foo">abc</span></i><p> --> <p><i>abc</i><p>
  38434. //
  38435. this._unwrapChildren( child, 0, child.childCount, unwrapElement );
  38436. i++;
  38437. }
  38438. // Merge at each unwrap.
  38439. let offsetChange = 0;
  38440. for ( const position of unwrapPositions ) {
  38441. position.offset -= offsetChange;
  38442. // Do not merge with elements outside selected children.
  38443. if ( position.offset == startOffset || position.offset == endOffset ) {
  38444. continue;
  38445. }
  38446. const newPosition = this.mergeAttributes( position );
  38447. // If nodes were merged - other merge offsets will change.
  38448. if ( !newPosition.isEqual( position ) ) {
  38449. offsetChange++;
  38450. endOffset--;
  38451. }
  38452. }
  38453. return _range__WEBPACK_IMPORTED_MODULE_1__["default"]._createFromParentsAndOffsets( parent, startOffset, parent, endOffset );
  38454. }
  38455. /**
  38456. * Helper function for `view.writer.wrap`. Wraps range with provided attribute element.
  38457. * This method will also merge newly added attribute element with its siblings whenever possible.
  38458. *
  38459. * Throws {@link module:utils/ckeditorerror~CKEditorError} `view-writer-wrap-invalid-attribute` when passed attribute element is not
  38460. * an instance of {@link module:engine/view/attributeelement~AttributeElement AttributeElement}.
  38461. *
  38462. * @private
  38463. * @param {module:engine/view/range~Range} range
  38464. * @param {module:engine/view/attributeelement~AttributeElement} attribute
  38465. * @returns {module:engine/view/range~Range} New range after wrapping, spanning over wrapping attribute element.
  38466. */
  38467. _wrapRange( range, attribute ) {
  38468. // Break attributes at range start and end.
  38469. const { start: breakStart, end: breakEnd } = this._breakAttributesRange( range, true );
  38470. const parentContainer = breakStart.parent;
  38471. // Wrap all children with attribute.
  38472. const newRange = this._wrapChildren( parentContainer, breakStart.offset, breakEnd.offset, attribute );
  38473. // Merge attributes at the both ends and return a new range.
  38474. const start = this.mergeAttributes( newRange.start );
  38475. // If start position was merged - move end position back.
  38476. if ( !start.isEqual( newRange.start ) ) {
  38477. newRange.end.offset--;
  38478. }
  38479. const end = this.mergeAttributes( newRange.end );
  38480. return new _range__WEBPACK_IMPORTED_MODULE_1__["default"]( start, end );
  38481. }
  38482. /**
  38483. * Helper function for {@link #wrap}. Wraps position with provided attribute element.
  38484. * This method will also merge newly added attribute element with its siblings whenever possible.
  38485. *
  38486. * Throws {@link module:utils/ckeditorerror~CKEditorError} `view-writer-wrap-invalid-attribute` when passed attribute element is not
  38487. * an instance of {@link module:engine/view/attributeelement~AttributeElement AttributeElement}.
  38488. *
  38489. * @private
  38490. * @param {module:engine/view/position~Position} position
  38491. * @param {module:engine/view/attributeelement~AttributeElement} attribute
  38492. * @returns {module:engine/view/position~Position} New position after wrapping.
  38493. */
  38494. _wrapPosition( position, attribute ) {
  38495. // Return same position when trying to wrap with attribute similar to position parent.
  38496. if ( attribute.isSimilar( position.parent ) ) {
  38497. return movePositionToTextNode( position.clone() );
  38498. }
  38499. // When position is inside text node - break it and place new position between two text nodes.
  38500. if ( position.parent.is( '$text' ) ) {
  38501. position = breakTextNode( position );
  38502. }
  38503. // Create fake element that will represent position, and will not be merged with other attributes.
  38504. const fakePosition = this.createAttributeElement();
  38505. fakePosition._priority = Number.POSITIVE_INFINITY;
  38506. fakePosition.isSimilar = () => false;
  38507. // Insert fake element in position location.
  38508. position.parent._insertChild( position.offset, fakePosition );
  38509. // Range around inserted fake attribute element.
  38510. const wrapRange = new _range__WEBPACK_IMPORTED_MODULE_1__["default"]( position, position.getShiftedBy( 1 ) );
  38511. // Wrap fake element with attribute (it will also merge if possible).
  38512. this.wrap( wrapRange, attribute );
  38513. // Remove fake element and place new position there.
  38514. const newPosition = new _position__WEBPACK_IMPORTED_MODULE_0__["default"]( fakePosition.parent, fakePosition.index );
  38515. fakePosition._remove();
  38516. // If position is placed between text nodes - merge them and return position inside.
  38517. const nodeBefore = newPosition.nodeBefore;
  38518. const nodeAfter = newPosition.nodeAfter;
  38519. if ( nodeBefore instanceof _text__WEBPACK_IMPORTED_MODULE_11__["default"] && nodeAfter instanceof _text__WEBPACK_IMPORTED_MODULE_11__["default"] ) {
  38520. return mergeTextNodes( nodeBefore, nodeAfter );
  38521. }
  38522. // If position is next to text node - move position inside.
  38523. return movePositionToTextNode( newPosition );
  38524. }
  38525. /**
  38526. * Wraps one {@link module:engine/view/attributeelement~AttributeElement AttributeElement} into another by
  38527. * merging them if possible. When merging is possible - all attributes, styles and classes are moved from wrapper
  38528. * element to element being wrapped.
  38529. *
  38530. * @private
  38531. * @param {module:engine/view/attributeelement~AttributeElement} wrapper Wrapper AttributeElement.
  38532. * @param {module:engine/view/attributeelement~AttributeElement} toWrap AttributeElement to wrap using wrapper element.
  38533. * @returns {Boolean} Returns `true` if elements are merged.
  38534. */
  38535. _wrapAttributeElement( wrapper, toWrap ) {
  38536. if ( !canBeJoined( wrapper, toWrap ) ) {
  38537. return false;
  38538. }
  38539. // Can't merge if name or priority differs.
  38540. if ( wrapper.name !== toWrap.name || wrapper.priority !== toWrap.priority ) {
  38541. return false;
  38542. }
  38543. // Check if attributes can be merged.
  38544. for ( const key of wrapper.getAttributeKeys() ) {
  38545. // Classes and styles should be checked separately.
  38546. if ( key === 'class' || key === 'style' ) {
  38547. continue;
  38548. }
  38549. // If some attributes are different we cannot wrap.
  38550. if ( toWrap.hasAttribute( key ) && toWrap.getAttribute( key ) !== wrapper.getAttribute( key ) ) {
  38551. return false;
  38552. }
  38553. }
  38554. // Check if styles can be merged.
  38555. for ( const key of wrapper.getStyleNames() ) {
  38556. if ( toWrap.hasStyle( key ) && toWrap.getStyle( key ) !== wrapper.getStyle( key ) ) {
  38557. return false;
  38558. }
  38559. }
  38560. // Move all attributes/classes/styles from wrapper to wrapped AttributeElement.
  38561. for ( const key of wrapper.getAttributeKeys() ) {
  38562. // Classes and styles should be checked separately.
  38563. if ( key === 'class' || key === 'style' ) {
  38564. continue;
  38565. }
  38566. // Move only these attributes that are not present - other are similar.
  38567. if ( !toWrap.hasAttribute( key ) ) {
  38568. this.setAttribute( key, wrapper.getAttribute( key ), toWrap );
  38569. }
  38570. }
  38571. for ( const key of wrapper.getStyleNames() ) {
  38572. if ( !toWrap.hasStyle( key ) ) {
  38573. this.setStyle( key, wrapper.getStyle( key ), toWrap );
  38574. }
  38575. }
  38576. for ( const key of wrapper.getClassNames() ) {
  38577. if ( !toWrap.hasClass( key ) ) {
  38578. this.addClass( key, toWrap );
  38579. }
  38580. }
  38581. return true;
  38582. }
  38583. /**
  38584. * Unwraps {@link module:engine/view/attributeelement~AttributeElement AttributeElement} from another by removing
  38585. * corresponding attributes, classes and styles. All attributes, classes and styles from wrapper should be present
  38586. * inside element being unwrapped.
  38587. *
  38588. * @private
  38589. * @param {module:engine/view/attributeelement~AttributeElement} wrapper Wrapper AttributeElement.
  38590. * @param {module:engine/view/attributeelement~AttributeElement} toUnwrap AttributeElement to unwrap using wrapper element.
  38591. * @returns {Boolean} Returns `true` if elements are unwrapped.
  38592. **/
  38593. _unwrapAttributeElement( wrapper, toUnwrap ) {
  38594. if ( !canBeJoined( wrapper, toUnwrap ) ) {
  38595. return false;
  38596. }
  38597. // Can't unwrap if name or priority differs.
  38598. if ( wrapper.name !== toUnwrap.name || wrapper.priority !== toUnwrap.priority ) {
  38599. return false;
  38600. }
  38601. // Check if AttributeElement has all wrapper attributes.
  38602. for ( const key of wrapper.getAttributeKeys() ) {
  38603. // Classes and styles should be checked separately.
  38604. if ( key === 'class' || key === 'style' ) {
  38605. continue;
  38606. }
  38607. // If some attributes are missing or different we cannot unwrap.
  38608. if ( !toUnwrap.hasAttribute( key ) || toUnwrap.getAttribute( key ) !== wrapper.getAttribute( key ) ) {
  38609. return false;
  38610. }
  38611. }
  38612. // Check if AttributeElement has all wrapper classes.
  38613. if ( !toUnwrap.hasClass( ...wrapper.getClassNames() ) ) {
  38614. return false;
  38615. }
  38616. // Check if AttributeElement has all wrapper styles.
  38617. for ( const key of wrapper.getStyleNames() ) {
  38618. // If some styles are missing or different we cannot unwrap.
  38619. if ( !toUnwrap.hasStyle( key ) || toUnwrap.getStyle( key ) !== wrapper.getStyle( key ) ) {
  38620. return false;
  38621. }
  38622. }
  38623. // Remove all wrapper's attributes from unwrapped element.
  38624. for ( const key of wrapper.getAttributeKeys() ) {
  38625. // Classes and styles should be checked separately.
  38626. if ( key === 'class' || key === 'style' ) {
  38627. continue;
  38628. }
  38629. this.removeAttribute( key, toUnwrap );
  38630. }
  38631. // Remove all wrapper's classes from unwrapped element.
  38632. this.removeClass( Array.from( wrapper.getClassNames() ), toUnwrap );
  38633. // Remove all wrapper's styles from unwrapped element.
  38634. this.removeStyle( Array.from( wrapper.getStyleNames() ), toUnwrap );
  38635. return true;
  38636. }
  38637. /**
  38638. * Helper function used by other `DowncastWriter` methods. Breaks attribute elements at the boundaries of given range.
  38639. *
  38640. * @private
  38641. * @param {module:engine/view/range~Range} range Range which `start` and `end` positions will be used to break attributes.
  38642. * @param {Boolean} [forceSplitText=false] If set to `true`, will break text nodes even if they are directly in container element.
  38643. * This behavior will result in incorrect view state, but is needed by other view writing methods which then fixes view state.
  38644. * @returns {module:engine/view/range~Range} New range with located at break positions.
  38645. */
  38646. _breakAttributesRange( range, forceSplitText = false ) {
  38647. const rangeStart = range.start;
  38648. const rangeEnd = range.end;
  38649. validateRangeContainer( range, this.document );
  38650. // Break at the collapsed position. Return new collapsed range.
  38651. if ( range.isCollapsed ) {
  38652. const position = this._breakAttributes( range.start, forceSplitText );
  38653. return new _range__WEBPACK_IMPORTED_MODULE_1__["default"]( position, position );
  38654. }
  38655. const breakEnd = this._breakAttributes( rangeEnd, forceSplitText );
  38656. const count = breakEnd.parent.childCount;
  38657. const breakStart = this._breakAttributes( rangeStart, forceSplitText );
  38658. // Calculate new break end offset.
  38659. breakEnd.offset += breakEnd.parent.childCount - count;
  38660. return new _range__WEBPACK_IMPORTED_MODULE_1__["default"]( breakStart, breakEnd );
  38661. }
  38662. /**
  38663. * Helper function used by other `DowncastWriter` methods. Breaks attribute elements at given position.
  38664. *
  38665. * Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `view-writer-cannot-break-empty-element` when break position
  38666. * is placed inside {@link module:engine/view/emptyelement~EmptyElement EmptyElement}.
  38667. *
  38668. * Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `view-writer-cannot-break-ui-element` when break position
  38669. * is placed inside {@link module:engine/view/uielement~UIElement UIElement}.
  38670. *
  38671. * @private
  38672. * @param {module:engine/view/position~Position} position Position where to break attributes.
  38673. * @param {Boolean} [forceSplitText=false] If set to `true`, will break text nodes even if they are directly in container element.
  38674. * This behavior will result in incorrect view state, but is needed by other view writing methods which then fixes view state.
  38675. * @returns {module:engine/view/position~Position} New position after breaking the attributes.
  38676. */
  38677. _breakAttributes( position, forceSplitText = false ) {
  38678. const positionOffset = position.offset;
  38679. const positionParent = position.parent;
  38680. // If position is placed inside EmptyElement - throw an exception as we cannot break inside.
  38681. if ( position.parent.is( 'emptyElement' ) ) {
  38682. /**
  38683. * Cannot break an `EmptyElement` instance.
  38684. *
  38685. * This error is thrown if
  38686. * {@link module:engine/view/downcastwriter~DowncastWriter#breakAttributes `DowncastWriter#breakAttributes()`}
  38687. * was executed in an incorrect position.
  38688. *
  38689. * @error view-writer-cannot-break-empty-element
  38690. */
  38691. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_8__["default"]( 'view-writer-cannot-break-empty-element', this.document );
  38692. }
  38693. // If position is placed inside UIElement - throw an exception as we cannot break inside.
  38694. if ( position.parent.is( 'uiElement' ) ) {
  38695. /**
  38696. * Cannot break a `UIElement` instance.
  38697. *
  38698. * This error is thrown if
  38699. * {@link module:engine/view/downcastwriter~DowncastWriter#breakAttributes `DowncastWriter#breakAttributes()`}
  38700. * was executed in an incorrect position.
  38701. *
  38702. * @error view-writer-cannot-break-ui-element
  38703. */
  38704. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_8__["default"]( 'view-writer-cannot-break-ui-element', this.document );
  38705. }
  38706. // If position is placed inside RawElement - throw an exception as we cannot break inside.
  38707. if ( position.parent.is( 'rawElement' ) ) {
  38708. /**
  38709. * Cannot break a `RawElement` instance.
  38710. *
  38711. * This error is thrown if
  38712. * {@link module:engine/view/downcastwriter~DowncastWriter#breakAttributes `DowncastWriter#breakAttributes()`}
  38713. * was executed in an incorrect position.
  38714. *
  38715. * @error view-writer-cannot-break-raw-element
  38716. */
  38717. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_8__["default"]( 'view-writer-cannot-break-raw-element', this.document );
  38718. }
  38719. // There are no attributes to break and text nodes breaking is not forced.
  38720. if ( !forceSplitText && positionParent.is( '$text' ) && isContainerOrFragment( positionParent.parent ) ) {
  38721. return position.clone();
  38722. }
  38723. // Position's parent is container, so no attributes to break.
  38724. if ( isContainerOrFragment( positionParent ) ) {
  38725. return position.clone();
  38726. }
  38727. // Break text and start again in new position.
  38728. if ( positionParent.is( '$text' ) ) {
  38729. return this._breakAttributes( breakTextNode( position ), forceSplitText );
  38730. }
  38731. const length = positionParent.childCount;
  38732. // <p>foo<b><u>bar{}</u></b></p>
  38733. // <p>foo<b><u>bar</u>[]</b></p>
  38734. // <p>foo<b><u>bar</u></b>[]</p>
  38735. if ( positionOffset == length ) {
  38736. const newPosition = new _position__WEBPACK_IMPORTED_MODULE_0__["default"]( positionParent.parent, positionParent.index + 1 );
  38737. return this._breakAttributes( newPosition, forceSplitText );
  38738. } else {
  38739. // <p>foo<b><u>{}bar</u></b></p>
  38740. // <p>foo<b>[]<u>bar</u></b></p>
  38741. // <p>foo{}<b><u>bar</u></b></p>
  38742. if ( positionOffset === 0 ) {
  38743. const newPosition = new _position__WEBPACK_IMPORTED_MODULE_0__["default"]( positionParent.parent, positionParent.index );
  38744. return this._breakAttributes( newPosition, forceSplitText );
  38745. }
  38746. // <p>foo<b><u>b{}ar</u></b></p>
  38747. // <p>foo<b><u>b[]ar</u></b></p>
  38748. // <p>foo<b><u>b</u>[]<u>ar</u></b></p>
  38749. // <p>foo<b><u>b</u></b>[]<b><u>ar</u></b></p>
  38750. else {
  38751. const offsetAfter = positionParent.index + 1;
  38752. // Break element.
  38753. const clonedNode = positionParent._clone();
  38754. // Insert cloned node to position's parent node.
  38755. positionParent.parent._insertChild( offsetAfter, clonedNode );
  38756. this._addToClonedElementsGroup( clonedNode );
  38757. // Get nodes to move.
  38758. const count = positionParent.childCount - positionOffset;
  38759. const nodesToMove = positionParent._removeChildren( positionOffset, count );
  38760. // Move nodes to cloned node.
  38761. clonedNode._appendChild( nodesToMove );
  38762. // Create new position to work on.
  38763. const newPosition = new _position__WEBPACK_IMPORTED_MODULE_0__["default"]( positionParent.parent, offsetAfter );
  38764. return this._breakAttributes( newPosition, forceSplitText );
  38765. }
  38766. }
  38767. }
  38768. /**
  38769. * Stores the information that an {@link module:engine/view/attributeelement~AttributeElement attribute element} was
  38770. * added to the tree. Saves the reference to the group in the given element and updates the group, so other elements
  38771. * from the group now keep a reference to the given attribute element.
  38772. *
  38773. * The clones group can be obtained using {@link module:engine/view/attributeelement~AttributeElement#getElementsWithSameId}.
  38774. *
  38775. * Does nothing if added element has no {@link module:engine/view/attributeelement~AttributeElement#id id}.
  38776. *
  38777. * @private
  38778. * @param {module:engine/view/attributeelement~AttributeElement} element Attribute element to save.
  38779. */
  38780. _addToClonedElementsGroup( element ) {
  38781. // Add only if the element is in document tree.
  38782. if ( !element.root.is( 'rootElement' ) ) {
  38783. return;
  38784. }
  38785. // Traverse the element's children recursively to find other attribute elements that also might got inserted.
  38786. // The loop is at the beginning so we can make fast returns later in the code.
  38787. if ( element.is( 'element' ) ) {
  38788. for ( const child of element.getChildren() ) {
  38789. this._addToClonedElementsGroup( child );
  38790. }
  38791. }
  38792. const id = element.id;
  38793. if ( !id ) {
  38794. return;
  38795. }
  38796. let group = this._cloneGroups.get( id );
  38797. if ( !group ) {
  38798. group = new Set();
  38799. this._cloneGroups.set( id, group );
  38800. }
  38801. group.add( element );
  38802. element._clonesGroup = group;
  38803. }
  38804. /**
  38805. * Removes all the information about the given {@link module:engine/view/attributeelement~AttributeElement attribute element}
  38806. * from its clones group.
  38807. *
  38808. * Keep in mind, that the element will still keep a reference to the group (but the group will not keep a reference to it).
  38809. * This allows to reference the whole group even if the element was already removed from the tree.
  38810. *
  38811. * Does nothing if the element has no {@link module:engine/view/attributeelement~AttributeElement#id id}.
  38812. *
  38813. * @private
  38814. * @param {module:engine/view/attributeelement~AttributeElement} element Attribute element to remove.
  38815. */
  38816. _removeFromClonedElementsGroup( element ) {
  38817. // Traverse the element's children recursively to find other attribute elements that also got removed.
  38818. // The loop is at the beginning so we can make fast returns later in the code.
  38819. if ( element.is( 'element' ) ) {
  38820. for ( const child of element.getChildren() ) {
  38821. this._removeFromClonedElementsGroup( child );
  38822. }
  38823. }
  38824. const id = element.id;
  38825. if ( !id ) {
  38826. return;
  38827. }
  38828. const group = this._cloneGroups.get( id );
  38829. if ( !group ) {
  38830. return;
  38831. }
  38832. group.delete( element );
  38833. // Not removing group from element on purpose!
  38834. // If other parts of code have reference to this element, they will be able to get references to other elements from the group.
  38835. }
  38836. }
  38837. // Helper function for `view.writer.wrap`. Checks if given element has any children that are not ui elements.
  38838. function _hasNonUiChildren( parent ) {
  38839. return Array.from( parent.getChildren() ).some( child => !child.is( 'uiElement' ) );
  38840. }
  38841. /**
  38842. * The `attribute` passed to {@link module:engine/view/downcastwriter~DowncastWriter#wrap `DowncastWriter#wrap()`}
  38843. * must be an instance of {@link module:engine/view/attributeelement~AttributeElement `AttributeElement`}.
  38844. *
  38845. * @error view-writer-wrap-invalid-attribute
  38846. */
  38847. // Returns first parent container of specified {@link module:engine/view/position~Position Position}.
  38848. // Position's parent node is checked as first, then next parents are checked.
  38849. // Note that {@link module:engine/view/documentfragment~DocumentFragment DocumentFragment} is treated like a container.
  38850. //
  38851. // @param {module:engine/view/position~Position} position Position used as a start point to locate parent container.
  38852. // @returns {module:engine/view/containerelement~ContainerElement|module:engine/view/documentfragment~DocumentFragment|undefined}
  38853. // Parent container element or `undefined` if container is not found.
  38854. function getParentContainer( position ) {
  38855. let parent = position.parent;
  38856. while ( !isContainerOrFragment( parent ) ) {
  38857. if ( !parent ) {
  38858. return undefined;
  38859. }
  38860. parent = parent.parent;
  38861. }
  38862. return parent;
  38863. }
  38864. // Checks if first {@link module:engine/view/attributeelement~AttributeElement AttributeElement} provided to the function
  38865. // can be wrapped outside second element. It is done by comparing elements'
  38866. // {@link module:engine/view/attributeelement~AttributeElement#priority priorities}, if both have same priority
  38867. // {@link module:engine/view/element~Element#getIdentity identities} are compared.
  38868. //
  38869. // @param {module:engine/view/attributeelement~AttributeElement} a
  38870. // @param {module:engine/view/attributeelement~AttributeElement} b
  38871. // @returns {Boolean}
  38872. function shouldABeOutsideB( a, b ) {
  38873. if ( a.priority < b.priority ) {
  38874. return true;
  38875. } else if ( a.priority > b.priority ) {
  38876. return false;
  38877. }
  38878. // When priorities are equal and names are different - use identities.
  38879. return a.getIdentity() < b.getIdentity();
  38880. }
  38881. // Returns new position that is moved to near text node. Returns same position if there is no text node before of after
  38882. // specified position.
  38883. //
  38884. // <p>foo[]</p> -> <p>foo{}</p>
  38885. // <p>[]foo</p> -> <p>{}foo</p>
  38886. //
  38887. // @param {module:engine/view/position~Position} position
  38888. // @returns {module:engine/view/position~Position} Position located inside text node or same position if there is no text nodes
  38889. // before or after position location.
  38890. function movePositionToTextNode( position ) {
  38891. const nodeBefore = position.nodeBefore;
  38892. if ( nodeBefore && nodeBefore.is( '$text' ) ) {
  38893. return new _position__WEBPACK_IMPORTED_MODULE_0__["default"]( nodeBefore, nodeBefore.data.length );
  38894. }
  38895. const nodeAfter = position.nodeAfter;
  38896. if ( nodeAfter && nodeAfter.is( '$text' ) ) {
  38897. return new _position__WEBPACK_IMPORTED_MODULE_0__["default"]( nodeAfter, 0 );
  38898. }
  38899. return position;
  38900. }
  38901. // Breaks text node into two text nodes when possible.
  38902. //
  38903. // <p>foo{}bar</p> -> <p>foo[]bar</p>
  38904. // <p>{}foobar</p> -> <p>[]foobar</p>
  38905. // <p>foobar{}</p> -> <p>foobar[]</p>
  38906. //
  38907. // @param {module:engine/view/position~Position} position Position that need to be placed inside text node.
  38908. // @returns {module:engine/view/position~Position} New position after breaking text node.
  38909. function breakTextNode( position ) {
  38910. if ( position.offset == position.parent.data.length ) {
  38911. return new _position__WEBPACK_IMPORTED_MODULE_0__["default"]( position.parent.parent, position.parent.index + 1 );
  38912. }
  38913. if ( position.offset === 0 ) {
  38914. return new _position__WEBPACK_IMPORTED_MODULE_0__["default"]( position.parent.parent, position.parent.index );
  38915. }
  38916. // Get part of the text that need to be moved.
  38917. const textToMove = position.parent.data.slice( position.offset );
  38918. // Leave rest of the text in position's parent.
  38919. position.parent._data = position.parent.data.slice( 0, position.offset );
  38920. // Insert new text node after position's parent text node.
  38921. position.parent.parent._insertChild( position.parent.index + 1, new _text__WEBPACK_IMPORTED_MODULE_11__["default"]( position.root.document, textToMove ) );
  38922. // Return new position between two newly created text nodes.
  38923. return new _position__WEBPACK_IMPORTED_MODULE_0__["default"]( position.parent.parent, position.parent.index + 1 );
  38924. }
  38925. // Merges two text nodes into first node. Removes second node and returns merge position.
  38926. //
  38927. // @param {module:engine/view/text~Text} t1 First text node to merge. Data from second text node will be moved at the end of
  38928. // this text node.
  38929. // @param {module:engine/view/text~Text} t2 Second text node to merge. This node will be removed after merging.
  38930. // @returns {module:engine/view/position~Position} Position after merging text nodes.
  38931. function mergeTextNodes( t1, t2 ) {
  38932. // Merge text data into first text node and remove second one.
  38933. const nodeBeforeLength = t1.data.length;
  38934. t1._data += t2.data;
  38935. t2._remove();
  38936. return new _position__WEBPACK_IMPORTED_MODULE_0__["default"]( t1, nodeBeforeLength );
  38937. }
  38938. // Checks if provided nodes are valid to insert.
  38939. //
  38940. // Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `view-writer-insert-invalid-node` when nodes to insert
  38941. // contains instances that are not supported ones (see error description for valid ones.
  38942. //
  38943. // @param Iterable.<module:engine/view/text~Text|module:engine/view/element~Element> nodes
  38944. // @param {Object} errorContext
  38945. function validateNodesToInsert( nodes, errorContext ) {
  38946. for ( const node of nodes ) {
  38947. if ( !validNodesToInsert.some( ( validNode => node instanceof validNode ) ) ) { // eslint-disable-line no-use-before-define
  38948. /**
  38949. * One of the nodes to be inserted is of an invalid type.
  38950. *
  38951. * Nodes to be inserted with {@link module:engine/view/downcastwriter~DowncastWriter#insert `DowncastWriter#insert()`} should be
  38952. * of the following types:
  38953. *
  38954. * * {@link module:engine/view/attributeelement~AttributeElement AttributeElement},
  38955. * * {@link module:engine/view/containerelement~ContainerElement ContainerElement},
  38956. * * {@link module:engine/view/emptyelement~EmptyElement EmptyElement},
  38957. * * {@link module:engine/view/uielement~UIElement UIElement},
  38958. * * {@link module:engine/view/rawelement~RawElement RawElement},
  38959. * * {@link module:engine/view/text~Text Text}.
  38960. *
  38961. * @error view-writer-insert-invalid-node-type
  38962. */
  38963. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_8__["default"]( 'view-writer-insert-invalid-node-type', errorContext );
  38964. }
  38965. if ( !node.is( '$text' ) ) {
  38966. validateNodesToInsert( node.getChildren(), errorContext );
  38967. }
  38968. }
  38969. }
  38970. 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"] ];
  38971. // Checks if node is ContainerElement or DocumentFragment, because in most cases they should be treated the same way.
  38972. //
  38973. // @param {module:engine/view/node~Node} node
  38974. // @returns {Boolean} Returns `true` if node is instance of ContainerElement or DocumentFragment.
  38975. function isContainerOrFragment( node ) {
  38976. return node && ( node.is( 'containerElement' ) || node.is( 'documentFragment' ) );
  38977. }
  38978. // Checks if {@link module:engine/view/range~Range#start range start} and {@link module:engine/view/range~Range#end range end} are placed
  38979. // inside same {@link module:engine/view/containerelement~ContainerElement container element}.
  38980. // Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `view-writer-invalid-range-container` when validation fails.
  38981. //
  38982. // @param {module:engine/view/range~Range} range
  38983. // @param {Object} errorContext
  38984. function validateRangeContainer( range, errorContext ) {
  38985. const startContainer = getParentContainer( range.start );
  38986. const endContainer = getParentContainer( range.end );
  38987. if ( !startContainer || !endContainer || startContainer !== endContainer ) {
  38988. /**
  38989. * The container of the given range is invalid.
  38990. *
  38991. * This may happen if {@link module:engine/view/range~Range#start range start} and
  38992. * {@link module:engine/view/range~Range#end range end} positions are not placed inside the same container element or
  38993. * a parent container for these positions cannot be found.
  38994. *
  38995. * Methods like {@link module:engine/view/downcastwriter~DowncastWriter#wrap `DowncastWriter#remove()`},
  38996. * {@link module:engine/view/downcastwriter~DowncastWriter#wrap `DowncastWriter#clean()`},
  38997. * {@link module:engine/view/downcastwriter~DowncastWriter#wrap `DowncastWriter#wrap()`},
  38998. * {@link module:engine/view/downcastwriter~DowncastWriter#wrap `DowncastWriter#unwrap()`} need to be called
  38999. * on a range that has its start and end positions located in the same container element. Both positions can be
  39000. * nested within other elements (e.g. an attribute element) but the closest container ancestor must be the same.
  39001. *
  39002. * @error view-writer-invalid-range-container
  39003. */
  39004. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_8__["default"]( 'view-writer-invalid-range-container', errorContext );
  39005. }
  39006. }
  39007. // Checks if two attribute elements can be joined together. Elements can be joined together if, and only if
  39008. // they do not have ids specified.
  39009. //
  39010. // @private
  39011. // @param {module:engine/view/element~Element} a
  39012. // @param {module:engine/view/element~Element} b
  39013. // @returns {Boolean}
  39014. function canBeJoined( a, b ) {
  39015. return a.id === null && b.id === null;
  39016. }
  39017. /***/ }),
  39018. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/editableelement.js":
  39019. /*!*****************************************************************************!*\
  39020. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/editableelement.js ***!
  39021. \*****************************************************************************/
  39022. /*! exports provided: default */
  39023. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  39024. "use strict";
  39025. __webpack_require__.r(__webpack_exports__);
  39026. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return EditableElement; });
  39027. /* harmony import */ var _containerelement__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./containerelement */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/containerelement.js");
  39028. /* 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");
  39029. /* 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");
  39030. /**
  39031. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  39032. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  39033. */
  39034. /**
  39035. * @module engine/view/editableelement
  39036. */
  39037. /**
  39038. * Editable element which can be a {@link module:engine/view/rooteditableelement~RootEditableElement root}
  39039. * or nested editable area in the editor.
  39040. *
  39041. * Editable is automatically read-only when its {@link module:engine/view/document~Document Document} is read-only.
  39042. *
  39043. * The constructor of this class shouldn't be used directly. To create new `EditableElement` use the
  39044. * {@link module:engine/view/downcastwriter~DowncastWriter#createEditableElement `downcastWriter#createEditableElement()`} method.
  39045. *
  39046. * @extends module:engine/view/containerelement~ContainerElement
  39047. * @mixes module:utils/observablemixin~ObservableMixin
  39048. */
  39049. class EditableElement extends _containerelement__WEBPACK_IMPORTED_MODULE_0__["default"] {
  39050. /**
  39051. * Creates an editable element.
  39052. *
  39053. * @see module:engine/view/downcastwriter~DowncastWriter#createEditableElement
  39054. * @protected
  39055. */
  39056. constructor( document, name, attrs, children ) {
  39057. super( document, name, attrs, children );
  39058. /**
  39059. * Whether the editable is in read-write or read-only mode.
  39060. *
  39061. * @observable
  39062. * @member {Boolean} module:engine/view/editableelement~EditableElement#isReadOnly
  39063. */
  39064. this.set( 'isReadOnly', false );
  39065. /**
  39066. * Whether the editable is focused.
  39067. *
  39068. * This property updates when {@link module:engine/view/document~Document#isFocused document.isFocused} or view
  39069. * selection is changed.
  39070. *
  39071. * @readonly
  39072. * @observable
  39073. * @member {Boolean} module:engine/view/editableelement~EditableElement#isFocused
  39074. */
  39075. this.set( 'isFocused', false );
  39076. this.bind( 'isReadOnly' ).to( document );
  39077. this.bind( 'isFocused' ).to(
  39078. document,
  39079. 'isFocused',
  39080. isFocused => isFocused && document.selection.editableElement == this
  39081. );
  39082. // Update focus state based on selection changes.
  39083. this.listenTo( document.selection, 'change', () => {
  39084. this.isFocused = document.isFocused && document.selection.editableElement == this;
  39085. } );
  39086. }
  39087. /**
  39088. * Checks whether this object is of the given.
  39089. *
  39090. * editableElement.is( 'editableElement' ); // -> true
  39091. * editableElement.is( 'element' ); // -> true
  39092. * editableElement.is( 'node' ); // -> true
  39093. * editableElement.is( 'view:editableElement' ); // -> true
  39094. * editableElement.is( 'view:element' ); // -> true
  39095. * editableElement.is( 'view:node' ); // -> true
  39096. *
  39097. * editableElement.is( 'model:element' ); // -> false
  39098. * editableElement.is( 'documentFragment' ); // -> false
  39099. *
  39100. * Assuming that the object being checked is an editbale element, you can also check its
  39101. * {@link module:engine/view/editableelement~EditableElement#name name}:
  39102. *
  39103. * editableElement.is( 'element', 'div' ); // -> true if this is a div element
  39104. * editableElement.is( 'editableElement', 'div' ); // -> same as above
  39105. * text.is( 'element', 'div' ); -> false
  39106. *
  39107. * {@link module:engine/view/node~Node#is Check the entire list of view objects} which implement the `is()` method.
  39108. *
  39109. * @param {String} type Type to check.
  39110. * @param {String} [name] Element name.
  39111. * @returns {Boolean}
  39112. */
  39113. is( type, name = null ) {
  39114. if ( !name ) {
  39115. return type === 'editableElement' || type === 'view:editableElement' ||
  39116. // From super.is(). This is highly utilised method and cannot call super. See ckeditor/ckeditor5#6529.
  39117. type === 'containerElement' || type === 'view:containerElement' ||
  39118. type === 'element' || type === 'view:element' ||
  39119. type === 'node' || type === 'view:node';
  39120. } else {
  39121. return name === this.name && (
  39122. type === 'editableElement' || type === 'view:editableElement' ||
  39123. // From super.is(). This is highly utilised method and cannot call super. See ckeditor/ckeditor5#6529.
  39124. type === 'containerElement' || type === 'view:containerElement' ||
  39125. type === 'element' || type === 'view:element'
  39126. );
  39127. }
  39128. }
  39129. destroy() {
  39130. this.stopListening();
  39131. }
  39132. }
  39133. Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_1__["default"])( EditableElement, _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_2__["default"] );
  39134. /***/ }),
  39135. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/element.js":
  39136. /*!*********************************************************************!*\
  39137. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/element.js ***!
  39138. \*********************************************************************/
  39139. /*! exports provided: default */
  39140. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  39141. "use strict";
  39142. __webpack_require__.r(__webpack_exports__);
  39143. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Element; });
  39144. /* harmony import */ var _node__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/node.js");
  39145. /* harmony import */ var _text__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./text */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/text.js");
  39146. /* harmony import */ var _textproxy__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./textproxy */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/textproxy.js");
  39147. /* 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");
  39148. /* harmony import */ var _ckeditor_ckeditor5_utils_src_toarray__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/toarray */ "./node_modules/@ckeditor/ckeditor5-utils/src/toarray.js");
  39149. /* harmony import */ var _ckeditor_ckeditor5_utils_src_isiterable__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/isiterable */ "./node_modules/@ckeditor/ckeditor5-utils/src/isiterable.js");
  39150. /* harmony import */ var _matcher__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./matcher */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/matcher.js");
  39151. /* harmony import */ var _stylesmap__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./stylesmap */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/stylesmap.js");
  39152. /**
  39153. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  39154. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  39155. */
  39156. /**
  39157. * @module engine/view/element
  39158. */
  39159. // @if CK_DEBUG_ENGINE // const { convertMapToTags } = require( '../dev-utils/utils' );
  39160. /**
  39161. * View element.
  39162. *
  39163. * The editing engine does not define a fixed semantics of its elements (it is "DTD-free").
  39164. * This is why the type of the {@link module:engine/view/element~Element} need to
  39165. * be defined by the feature developer. When creating an element you should use one of the following methods:
  39166. *
  39167. * * {@link module:engine/view/downcastwriter~DowncastWriter#createContainerElement `downcastWriter#createContainerElement()`}
  39168. * in order to create a {@link module:engine/view/containerelement~ContainerElement},
  39169. * * {@link module:engine/view/downcastwriter~DowncastWriter#createAttributeElement `downcastWriter#createAttributeElement()`}
  39170. * in order to create a {@link module:engine/view/attributeelement~AttributeElement},
  39171. * * {@link module:engine/view/downcastwriter~DowncastWriter#createEmptyElement `downcastWriter#createEmptyElement()`}
  39172. * in order to create a {@link module:engine/view/emptyelement~EmptyElement}.
  39173. * * {@link module:engine/view/downcastwriter~DowncastWriter#createUIElement `downcastWriter#createUIElement()`}
  39174. * in order to create a {@link module:engine/view/uielement~UIElement}.
  39175. * * {@link module:engine/view/downcastwriter~DowncastWriter#createEditableElement `downcastWriter#createEditableElement()`}
  39176. * in order to create a {@link module:engine/view/editableelement~EditableElement}.
  39177. *
  39178. * Note that for view elements which are not created from the model, like elements from mutations, paste or
  39179. * {@link module:engine/controller/datacontroller~DataController#set data.set} it is not possible to define the type of the element.
  39180. * In such cases the {@link module:engine/view/upcastwriter~UpcastWriter#createElement `UpcastWriter#createElement()`} method
  39181. * should be used to create generic view elements.
  39182. *
  39183. * @extends module:engine/view/node~Node
  39184. */
  39185. class Element extends _node__WEBPACK_IMPORTED_MODULE_0__["default"] {
  39186. /**
  39187. * Creates a view element.
  39188. *
  39189. * Attributes can be passed in various formats:
  39190. *
  39191. * new Element( viewDocument, 'div', { class: 'editor', contentEditable: 'true' } ); // object
  39192. * new Element( viewDocument, 'div', [ [ 'class', 'editor' ], [ 'contentEditable', 'true' ] ] ); // map-like iterator
  39193. * new Element( viewDocument, 'div', mapOfAttributes ); // map
  39194. *
  39195. * @protected
  39196. * @param {module:engine/view/document~Document} document The document instance to which this element belongs.
  39197. * @param {String} name Node name.
  39198. * @param {Object|Iterable} [attrs] Collection of attributes.
  39199. * @param {module:engine/view/node~Node|Iterable.<module:engine/view/node~Node>} [children]
  39200. * A list of nodes to be inserted into created element.
  39201. */
  39202. constructor( document, name, attrs, children ) {
  39203. super( document );
  39204. /**
  39205. * Name of the element.
  39206. *
  39207. * @readonly
  39208. * @member {String}
  39209. */
  39210. this.name = name;
  39211. /**
  39212. * Map of attributes, where attributes names are keys and attributes values are values.
  39213. *
  39214. * @protected
  39215. * @member {Map} #_attrs
  39216. */
  39217. this._attrs = parseAttributes( attrs );
  39218. /**
  39219. * Array of child nodes.
  39220. *
  39221. * @protected
  39222. * @member {Array.<module:engine/view/node~Node>}
  39223. */
  39224. this._children = [];
  39225. if ( children ) {
  39226. this._insertChild( 0, children );
  39227. }
  39228. /**
  39229. * Set of classes associated with element instance.
  39230. *
  39231. * @protected
  39232. * @member {Set}
  39233. */
  39234. this._classes = new Set();
  39235. if ( this._attrs.has( 'class' ) ) {
  39236. // Remove class attribute and handle it by class set.
  39237. const classString = this._attrs.get( 'class' );
  39238. parseClasses( this._classes, classString );
  39239. this._attrs.delete( 'class' );
  39240. }
  39241. /**
  39242. * Normalized styles.
  39243. *
  39244. * @protected
  39245. * @member {module:engine/view/stylesmap~StylesMap} module:engine/view/element~Element#_styles
  39246. */
  39247. this._styles = new _stylesmap__WEBPACK_IMPORTED_MODULE_7__["default"]( this.document.stylesProcessor );
  39248. if ( this._attrs.has( 'style' ) ) {
  39249. // Remove style attribute and handle it by styles map.
  39250. this._styles.setTo( this._attrs.get( 'style' ) );
  39251. this._attrs.delete( 'style' );
  39252. }
  39253. /**
  39254. * Map of custom properties.
  39255. * Custom properties can be added to element instance, will be cloned but not rendered into DOM.
  39256. *
  39257. * @protected
  39258. * @member {Map}
  39259. */
  39260. this._customProperties = new Map();
  39261. /**
  39262. * Whether an element is allowed inside an AttributeElement and can be wrapped with
  39263. * {@link module:engine/view/attributeelement~AttributeElement} by {@link module:engine/view/downcastwriter~DowncastWriter}.
  39264. *
  39265. * @protected
  39266. * @member {Boolean}
  39267. */
  39268. this._isAllowedInsideAttributeElement = false;
  39269. }
  39270. /**
  39271. * Number of element's children.
  39272. *
  39273. * @readonly
  39274. * @type {Number}
  39275. */
  39276. get childCount() {
  39277. return this._children.length;
  39278. }
  39279. /**
  39280. * Is `true` if there are no nodes inside this element, `false` otherwise.
  39281. *
  39282. * @readonly
  39283. * @type {Boolean}
  39284. */
  39285. get isEmpty() {
  39286. return this._children.length === 0;
  39287. }
  39288. /**
  39289. * Whether the element is allowed inside an AttributeElement and can be wrapped with
  39290. * {@link module:engine/view/attributeelement~AttributeElement} by {@link module:engine/view/downcastwriter~DowncastWriter}.
  39291. *
  39292. * @readonly
  39293. * @type {Boolean}
  39294. */
  39295. get isAllowedInsideAttributeElement() {
  39296. return this._isAllowedInsideAttributeElement;
  39297. }
  39298. /**
  39299. * Checks whether this object is of the given.
  39300. *
  39301. * element.is( 'element' ); // -> true
  39302. * element.is( 'node' ); // -> true
  39303. * element.is( 'view:element' ); // -> true
  39304. * element.is( 'view:node' ); // -> true
  39305. *
  39306. * element.is( 'model:element' ); // -> false
  39307. * element.is( 'documentSelection' ); // -> false
  39308. *
  39309. * Assuming that the object being checked is an element, you can also check its
  39310. * {@link module:engine/view/element~Element#name name}:
  39311. *
  39312. * element.is( 'element', 'img' ); // -> true if this is an <img> element
  39313. * text.is( 'element', 'img' ); -> false
  39314. *
  39315. * {@link module:engine/view/node~Node#is Check the entire list of view objects} which implement the `is()` method.
  39316. *
  39317. * @param {String} type Type to check.
  39318. * @param {String} [name] Element name.
  39319. * @returns {Boolean}
  39320. */
  39321. is( type, name = null ) {
  39322. if ( !name ) {
  39323. return type === 'element' || type === 'view:element' ||
  39324. // From super.is(). This is highly utilised method and cannot call super. See ckeditor/ckeditor5#6529.
  39325. type === 'node' || type === 'view:node';
  39326. } else {
  39327. return name === this.name && ( type === 'element' || type === 'view:element' );
  39328. }
  39329. }
  39330. /**
  39331. * Gets child at the given index.
  39332. *
  39333. * @param {Number} index Index of child.
  39334. * @returns {module:engine/view/node~Node} Child node.
  39335. */
  39336. getChild( index ) {
  39337. return this._children[ index ];
  39338. }
  39339. /**
  39340. * Gets index of the given child node. Returns `-1` if child node is not found.
  39341. *
  39342. * @param {module:engine/view/node~Node} node Child node.
  39343. * @returns {Number} Index of the child node.
  39344. */
  39345. getChildIndex( node ) {
  39346. return this._children.indexOf( node );
  39347. }
  39348. /**
  39349. * Gets child nodes iterator.
  39350. *
  39351. * @returns {Iterable.<module:engine/view/node~Node>} Child nodes iterator.
  39352. */
  39353. getChildren() {
  39354. return this._children[ Symbol.iterator ]();
  39355. }
  39356. /**
  39357. * Returns an iterator that contains the keys for attributes. Order of inserting attributes is not preserved.
  39358. *
  39359. * @returns {Iterable.<String>} Keys for attributes.
  39360. */
  39361. * getAttributeKeys() {
  39362. if ( this._classes.size > 0 ) {
  39363. yield 'class';
  39364. }
  39365. if ( !this._styles.isEmpty ) {
  39366. yield 'style';
  39367. }
  39368. yield* this._attrs.keys();
  39369. }
  39370. /**
  39371. * Returns iterator that iterates over this element's attributes.
  39372. *
  39373. * Attributes are returned as arrays containing two items. First one is attribute key and second is attribute value.
  39374. * This format is accepted by native `Map` object and also can be passed in `Node` constructor.
  39375. *
  39376. * @returns {Iterable.<*>}
  39377. */
  39378. * getAttributes() {
  39379. yield* this._attrs.entries();
  39380. if ( this._classes.size > 0 ) {
  39381. yield [ 'class', this.getAttribute( 'class' ) ];
  39382. }
  39383. if ( !this._styles.isEmpty ) {
  39384. yield [ 'style', this.getAttribute( 'style' ) ];
  39385. }
  39386. }
  39387. /**
  39388. * Gets attribute by key. If attribute is not present - returns undefined.
  39389. *
  39390. * @param {String} key Attribute key.
  39391. * @returns {String|undefined} Attribute value.
  39392. */
  39393. getAttribute( key ) {
  39394. if ( key == 'class' ) {
  39395. if ( this._classes.size > 0 ) {
  39396. return [ ...this._classes ].join( ' ' );
  39397. }
  39398. return undefined;
  39399. }
  39400. if ( key == 'style' ) {
  39401. const inlineStyle = this._styles.toString();
  39402. return inlineStyle == '' ? undefined : inlineStyle;
  39403. }
  39404. return this._attrs.get( key );
  39405. }
  39406. /**
  39407. * Returns a boolean indicating whether an attribute with the specified key exists in the element.
  39408. *
  39409. * @param {String} key Attribute key.
  39410. * @returns {Boolean} `true` if attribute with the specified key exists in the element, false otherwise.
  39411. */
  39412. hasAttribute( key ) {
  39413. if ( key == 'class' ) {
  39414. return this._classes.size > 0;
  39415. }
  39416. if ( key == 'style' ) {
  39417. return !this._styles.isEmpty;
  39418. }
  39419. return this._attrs.has( key );
  39420. }
  39421. /**
  39422. * Checks if this element is similar to other element.
  39423. * Both elements should have the same name and attributes to be considered as similar. Two similar elements
  39424. * can contain different set of children nodes.
  39425. *
  39426. * @param {module:engine/view/element~Element} otherElement
  39427. * @returns {Boolean}
  39428. */
  39429. isSimilar( otherElement ) {
  39430. if ( !( otherElement instanceof Element ) ) {
  39431. return false;
  39432. }
  39433. // If exactly the same Element is provided - return true immediately.
  39434. if ( this === otherElement ) {
  39435. return true;
  39436. }
  39437. // Check element name.
  39438. if ( this.name != otherElement.name ) {
  39439. return false;
  39440. }
  39441. // Check isAllowedInsideAttributeElement property.
  39442. if ( this.isAllowedInsideAttributeElement != otherElement.isAllowedInsideAttributeElement ) {
  39443. return false;
  39444. }
  39445. // Check number of attributes, classes and styles.
  39446. if ( this._attrs.size !== otherElement._attrs.size || this._classes.size !== otherElement._classes.size ||
  39447. this._styles.size !== otherElement._styles.size ) {
  39448. return false;
  39449. }
  39450. // Check if attributes are the same.
  39451. for ( const [ key, value ] of this._attrs ) {
  39452. if ( !otherElement._attrs.has( key ) || otherElement._attrs.get( key ) !== value ) {
  39453. return false;
  39454. }
  39455. }
  39456. // Check if classes are the same.
  39457. for ( const className of this._classes ) {
  39458. if ( !otherElement._classes.has( className ) ) {
  39459. return false;
  39460. }
  39461. }
  39462. // Check if styles are the same.
  39463. for ( const property of this._styles.getStyleNames() ) {
  39464. if (
  39465. !otherElement._styles.has( property ) ||
  39466. otherElement._styles.getAsString( property ) !== this._styles.getAsString( property )
  39467. ) {
  39468. return false;
  39469. }
  39470. }
  39471. return true;
  39472. }
  39473. /**
  39474. * Returns true if class is present.
  39475. * If more then one class is provided - returns true only when all classes are present.
  39476. *
  39477. * element.hasClass( 'foo' ); // Returns true if 'foo' class is present.
  39478. * element.hasClass( 'foo', 'bar' ); // Returns true if 'foo' and 'bar' classes are both present.
  39479. *
  39480. * @param {...String} className
  39481. */
  39482. hasClass( ...className ) {
  39483. for ( const name of className ) {
  39484. if ( !this._classes.has( name ) ) {
  39485. return false;
  39486. }
  39487. }
  39488. return true;
  39489. }
  39490. /**
  39491. * Returns iterator that contains all class names.
  39492. *
  39493. * @returns {Iterable.<String>}
  39494. */
  39495. getClassNames() {
  39496. return this._classes.keys();
  39497. }
  39498. /**
  39499. * Returns style value for the given property mae.
  39500. * If the style does not exist `undefined` is returned.
  39501. *
  39502. * **Note**: This method can work with normalized style names if
  39503. * {@link module:engine/controller/datacontroller~DataController#addStyleProcessorRules a particular style processor rule is enabled}.
  39504. * See {@link module:engine/view/stylesmap~StylesMap#getAsString `StylesMap#getAsString()`} for details.
  39505. *
  39506. * For an element with style set to `'margin:1px'`:
  39507. *
  39508. * // Enable 'margin' shorthand processing:
  39509. * editor.data.addStyleProcessorRules( addMarginRules );
  39510. *
  39511. * const element = view.change( writer => {
  39512. * const element = writer.createElement();
  39513. * writer.setStyle( 'margin', '1px' );
  39514. * writer.setStyle( 'margin-bottom', '3em' );
  39515. *
  39516. * return element;
  39517. * } );
  39518. *
  39519. * element.getStyle( 'margin' ); // -> 'margin: 1px 1px 3em;'
  39520. *
  39521. * @param {String} property
  39522. * @returns {String|undefined}
  39523. */
  39524. getStyle( property ) {
  39525. return this._styles.getAsString( property );
  39526. }
  39527. /**
  39528. * Returns a normalized style object or single style value.
  39529. *
  39530. * For an element with style set to: margin:1px 2px 3em;
  39531. *
  39532. * element.getNormalizedStyle( 'margin' ) );
  39533. *
  39534. * will return:
  39535. *
  39536. * {
  39537. * top: '1px',
  39538. * right: '2px',
  39539. * bottom: '3em',
  39540. * left: '2px' // a normalized value from margin shorthand
  39541. * }
  39542. *
  39543. * and reading for single style value:
  39544. *
  39545. * styles.getNormalizedStyle( 'margin-left' );
  39546. *
  39547. * Will return a `2px` string.
  39548. *
  39549. * **Note**: This method will return normalized values only if
  39550. * {@link module:engine/controller/datacontroller~DataController#addStyleProcessorRules a particular style processor rule is enabled}.
  39551. * See {@link module:engine/view/stylesmap~StylesMap#getNormalized `StylesMap#getNormalized()`} for details.
  39552. *
  39553. *
  39554. * @param {String} property Name of CSS property
  39555. * @returns {Object|String|undefined}
  39556. */
  39557. getNormalizedStyle( property ) {
  39558. return this._styles.getNormalized( property );
  39559. }
  39560. /**
  39561. * Returns iterator that contains all style names.
  39562. *
  39563. * @returns {Iterable.<String>}
  39564. */
  39565. getStyleNames() {
  39566. return this._styles.getStyleNames();
  39567. }
  39568. /**
  39569. * Returns true if style keys are present.
  39570. * If more then one style property is provided - returns true only when all properties are present.
  39571. *
  39572. * element.hasStyle( 'color' ); // Returns true if 'border-top' style is present.
  39573. * element.hasStyle( 'color', 'border-top' ); // Returns true if 'color' and 'border-top' styles are both present.
  39574. *
  39575. * @param {...String} property
  39576. */
  39577. hasStyle( ...property ) {
  39578. for ( const name of property ) {
  39579. if ( !this._styles.has( name ) ) {
  39580. return false;
  39581. }
  39582. }
  39583. return true;
  39584. }
  39585. /**
  39586. * Returns ancestor element that match specified pattern.
  39587. * Provided patterns should be compatible with {@link module:engine/view/matcher~Matcher Matcher} as it is used internally.
  39588. *
  39589. * @see module:engine/view/matcher~Matcher
  39590. * @param {Object|String|RegExp|Function} patterns Patterns used to match correct ancestor.
  39591. * See {@link module:engine/view/matcher~Matcher}.
  39592. * @returns {module:engine/view/element~Element|null} Found element or `null` if no matching ancestor was found.
  39593. */
  39594. findAncestor( ...patterns ) {
  39595. const matcher = new _matcher__WEBPACK_IMPORTED_MODULE_6__["default"]( ...patterns );
  39596. let parent = this.parent;
  39597. while ( parent ) {
  39598. if ( matcher.match( parent ) ) {
  39599. return parent;
  39600. }
  39601. parent = parent.parent;
  39602. }
  39603. return null;
  39604. }
  39605. /**
  39606. * Returns the custom property value for the given key.
  39607. *
  39608. * @param {String|Symbol} key
  39609. * @returns {*}
  39610. */
  39611. getCustomProperty( key ) {
  39612. return this._customProperties.get( key );
  39613. }
  39614. /**
  39615. * Returns an iterator which iterates over this element's custom properties.
  39616. * Iterator provides `[ key, value ]` pairs for each stored property.
  39617. *
  39618. * @returns {Iterable.<*>}
  39619. */
  39620. * getCustomProperties() {
  39621. yield* this._customProperties.entries();
  39622. }
  39623. /**
  39624. * Returns identity string based on element's name, styles, classes and other attributes.
  39625. * Two elements that {@link #isSimilar are similar} will have same identity string.
  39626. * It has the following format:
  39627. *
  39628. * 'name class="class1,class2" style="style1:value1;style2:value2" attr1="val1" attr2="val2"'
  39629. *
  39630. * For example:
  39631. *
  39632. * const element = writer.createContainerElement( 'foo', {
  39633. * banana: '10',
  39634. * apple: '20',
  39635. * style: 'color: red; border-color: white;',
  39636. * class: 'baz'
  39637. * } );
  39638. *
  39639. * // returns 'foo class="baz" style="border-color:white;color:red" apple="20" banana="10"'
  39640. * element.getIdentity();
  39641. *
  39642. * **Note**: Classes, styles and other attributes are sorted alphabetically.
  39643. *
  39644. * @returns {String}
  39645. */
  39646. getIdentity() {
  39647. const classes = Array.from( this._classes ).sort().join( ',' );
  39648. const styles = this._styles.toString();
  39649. const attributes = Array.from( this._attrs ).map( i => `${ i[ 0 ] }="${ i[ 1 ] }"` ).sort().join( ' ' );
  39650. return this.name +
  39651. ( classes == '' ? '' : ` class="${ classes }"` ) +
  39652. ( !styles ? '' : ` style="${ styles }"` ) +
  39653. ( attributes == '' ? '' : ` ${ attributes }` );
  39654. }
  39655. /**
  39656. * Clones provided element.
  39657. *
  39658. * @protected
  39659. * @param {Boolean} [deep=false] If set to `true` clones element and all its children recursively. When set to `false`,
  39660. * element will be cloned without any children.
  39661. * @returns {module:engine/view/element~Element} Clone of this element.
  39662. */
  39663. _clone( deep = false ) {
  39664. const childrenClone = [];
  39665. if ( deep ) {
  39666. for ( const child of this.getChildren() ) {
  39667. childrenClone.push( child._clone( deep ) );
  39668. }
  39669. }
  39670. // ContainerElement and AttributeElement should be also cloned properly.
  39671. const cloned = new this.constructor( this.document, this.name, this._attrs, childrenClone );
  39672. // Classes and styles are cloned separately - this solution is faster than adding them back to attributes and
  39673. // parse once again in constructor.
  39674. cloned._classes = new Set( this._classes );
  39675. cloned._styles.set( this._styles.getNormalized() );
  39676. // Clone custom properties.
  39677. cloned._customProperties = new Map( this._customProperties );
  39678. // Clone filler offset method.
  39679. // We can't define this method in a prototype because it's behavior which
  39680. // is changed by e.g. toWidget() function from ckeditor5-widget. Perhaps this should be one of custom props.
  39681. cloned.getFillerOffset = this.getFillerOffset;
  39682. cloned._isAllowedInsideAttributeElement = this.isAllowedInsideAttributeElement;
  39683. return cloned;
  39684. }
  39685. /**
  39686. * {@link module:engine/view/element~Element#_insertChild Insert} a child node or a list of child nodes at the end of this node
  39687. * and sets the parent of these nodes to this element.
  39688. *
  39689. * @see module:engine/view/downcastwriter~DowncastWriter#insert
  39690. * @protected
  39691. * @param {module:engine/view/item~Item|Iterable.<module:engine/view/item~Item>} items Items to be inserted.
  39692. * @fires module:engine/view/node~Node#change
  39693. * @returns {Number} Number of appended nodes.
  39694. */
  39695. _appendChild( items ) {
  39696. return this._insertChild( this.childCount, items );
  39697. }
  39698. /**
  39699. * Inserts a child node or a list of child nodes on the given index and sets the parent of these nodes to
  39700. * this element.
  39701. *
  39702. * @see module:engine/view/downcastwriter~DowncastWriter#insert
  39703. * @protected
  39704. * @param {Number} index Position where nodes should be inserted.
  39705. * @param {module:engine/view/item~Item|Iterable.<module:engine/view/item~Item>} items Items to be inserted.
  39706. * @fires module:engine/view/node~Node#change
  39707. * @returns {Number} Number of inserted nodes.
  39708. */
  39709. _insertChild( index, items ) {
  39710. this._fireChange( 'children', this );
  39711. let count = 0;
  39712. const nodes = normalize( this.document, items );
  39713. for ( const node of nodes ) {
  39714. // If node that is being added to this element is already inside another element, first remove it from the old parent.
  39715. if ( node.parent !== null ) {
  39716. node._remove();
  39717. }
  39718. node.parent = this;
  39719. node.document = this.document;
  39720. this._children.splice( index, 0, node );
  39721. index++;
  39722. count++;
  39723. }
  39724. return count;
  39725. }
  39726. /**
  39727. * Removes number of child nodes starting at the given index and set the parent of these nodes to `null`.
  39728. *
  39729. * @see module:engine/view/downcastwriter~DowncastWriter#remove
  39730. * @protected
  39731. * @param {Number} index Number of the first node to remove.
  39732. * @param {Number} [howMany=1] Number of nodes to remove.
  39733. * @fires module:engine/view/node~Node#change
  39734. * @returns {Array.<module:engine/view/node~Node>} The array of removed nodes.
  39735. */
  39736. _removeChildren( index, howMany = 1 ) {
  39737. this._fireChange( 'children', this );
  39738. for ( let i = index; i < index + howMany; i++ ) {
  39739. this._children[ i ].parent = null;
  39740. }
  39741. return this._children.splice( index, howMany );
  39742. }
  39743. /**
  39744. * Adds or overwrite attribute with a specified key and value.
  39745. *
  39746. * @see module:engine/view/downcastwriter~DowncastWriter#setAttribute
  39747. * @protected
  39748. * @param {String} key Attribute key.
  39749. * @param {String} value Attribute value.
  39750. * @fires module:engine/view/node~Node#change
  39751. */
  39752. _setAttribute( key, value ) {
  39753. value = String( value );
  39754. this._fireChange( 'attributes', this );
  39755. if ( key == 'class' ) {
  39756. parseClasses( this._classes, value );
  39757. } else if ( key == 'style' ) {
  39758. this._styles.setTo( value );
  39759. } else {
  39760. this._attrs.set( key, value );
  39761. }
  39762. }
  39763. /**
  39764. * Removes attribute from the element.
  39765. *
  39766. * @see module:engine/view/downcastwriter~DowncastWriter#removeAttribute
  39767. * @protected
  39768. * @param {String} key Attribute key.
  39769. * @returns {Boolean} Returns true if an attribute existed and has been removed.
  39770. * @fires module:engine/view/node~Node#change
  39771. */
  39772. _removeAttribute( key ) {
  39773. this._fireChange( 'attributes', this );
  39774. // Remove class attribute.
  39775. if ( key == 'class' ) {
  39776. if ( this._classes.size > 0 ) {
  39777. this._classes.clear();
  39778. return true;
  39779. }
  39780. return false;
  39781. }
  39782. // Remove style attribute.
  39783. if ( key == 'style' ) {
  39784. if ( !this._styles.isEmpty ) {
  39785. this._styles.clear();
  39786. return true;
  39787. }
  39788. return false;
  39789. }
  39790. // Remove other attributes.
  39791. return this._attrs.delete( key );
  39792. }
  39793. /**
  39794. * Adds specified class.
  39795. *
  39796. * element._addClass( 'foo' ); // Adds 'foo' class.
  39797. * element._addClass( [ 'foo', 'bar' ] ); // Adds 'foo' and 'bar' classes.
  39798. *
  39799. * @see module:engine/view/downcastwriter~DowncastWriter#addClass
  39800. * @protected
  39801. * @param {Array.<String>|String} className
  39802. * @fires module:engine/view/node~Node#change
  39803. */
  39804. _addClass( className ) {
  39805. this._fireChange( 'attributes', this );
  39806. for ( const name of Object(_ckeditor_ckeditor5_utils_src_toarray__WEBPACK_IMPORTED_MODULE_4__["default"])( className ) ) {
  39807. this._classes.add( name );
  39808. }
  39809. }
  39810. /**
  39811. * Removes specified class.
  39812. *
  39813. * element._removeClass( 'foo' ); // Removes 'foo' class.
  39814. * element._removeClass( [ 'foo', 'bar' ] ); // Removes both 'foo' and 'bar' classes.
  39815. *
  39816. * @see module:engine/view/downcastwriter~DowncastWriter#removeClass
  39817. * @protected
  39818. * @param {Array.<String>|String} className
  39819. * @fires module:engine/view/node~Node#change
  39820. */
  39821. _removeClass( className ) {
  39822. this._fireChange( 'attributes', this );
  39823. for ( const name of Object(_ckeditor_ckeditor5_utils_src_toarray__WEBPACK_IMPORTED_MODULE_4__["default"])( className ) ) {
  39824. this._classes.delete( name );
  39825. }
  39826. }
  39827. /**
  39828. * Adds style to the element.
  39829. *
  39830. * element._setStyle( 'color', 'red' );
  39831. * element._setStyle( {
  39832. * color: 'red',
  39833. * position: 'fixed'
  39834. * } );
  39835. *
  39836. * **Note**: This method can work with normalized style names if
  39837. * {@link module:engine/controller/datacontroller~DataController#addStyleProcessorRules a particular style processor rule is enabled}.
  39838. * See {@link module:engine/view/stylesmap~StylesMap#set `StylesMap#set()`} for details.
  39839. *
  39840. * @see module:engine/view/downcastwriter~DowncastWriter#setStyle
  39841. * @protected
  39842. * @param {String|Object} property Property name or object with key - value pairs.
  39843. * @param {String} [value] Value to set. This parameter is ignored if object is provided as the first parameter.
  39844. * @fires module:engine/view/node~Node#change
  39845. */
  39846. _setStyle( property, value ) {
  39847. this._fireChange( 'attributes', this );
  39848. this._styles.set( property, value );
  39849. }
  39850. /**
  39851. * Removes specified style.
  39852. *
  39853. * element._removeStyle( 'color' ); // Removes 'color' style.
  39854. * element._removeStyle( [ 'color', 'border-top' ] ); // Removes both 'color' and 'border-top' styles.
  39855. *
  39856. * **Note**: This method can work with normalized style names if
  39857. * {@link module:engine/controller/datacontroller~DataController#addStyleProcessorRules a particular style processor rule is enabled}.
  39858. * See {@link module:engine/view/stylesmap~StylesMap#remove `StylesMap#remove()`} for details.
  39859. *
  39860. * @see module:engine/view/downcastwriter~DowncastWriter#removeStyle
  39861. * @protected
  39862. * @param {Array.<String>|String} property
  39863. * @fires module:engine/view/node~Node#change
  39864. */
  39865. _removeStyle( property ) {
  39866. this._fireChange( 'attributes', this );
  39867. for ( const name of Object(_ckeditor_ckeditor5_utils_src_toarray__WEBPACK_IMPORTED_MODULE_4__["default"])( property ) ) {
  39868. this._styles.remove( name );
  39869. }
  39870. }
  39871. /**
  39872. * Sets a custom property. Unlike attributes, custom properties are not rendered to the DOM,
  39873. * so they can be used to add special data to elements.
  39874. *
  39875. * @see module:engine/view/downcastwriter~DowncastWriter#setCustomProperty
  39876. * @protected
  39877. * @param {String|Symbol} key
  39878. * @param {*} value
  39879. */
  39880. _setCustomProperty( key, value ) {
  39881. this._customProperties.set( key, value );
  39882. }
  39883. /**
  39884. * Removes the custom property stored under the given key.
  39885. *
  39886. * @see module:engine/view/downcastwriter~DowncastWriter#removeCustomProperty
  39887. * @protected
  39888. * @param {String|Symbol} key
  39889. * @returns {Boolean} Returns true if property was removed.
  39890. */
  39891. _removeCustomProperty( key ) {
  39892. return this._customProperties.delete( key );
  39893. }
  39894. /**
  39895. * Returns block {@link module:engine/view/filler filler} offset or `null` if block filler is not needed.
  39896. *
  39897. * @abstract
  39898. * @method module:engine/view/element~Element#getFillerOffset
  39899. */
  39900. // @if CK_DEBUG_ENGINE // printTree( level = 0) {
  39901. // @if CK_DEBUG_ENGINE // let string = '';
  39902. // @if CK_DEBUG_ENGINE // string += '\t'.repeat( level ) + `<${ this.name }${ convertMapToTags( this.getAttributes() ) }>`;
  39903. // @if CK_DEBUG_ENGINE // for ( const child of this.getChildren() ) {
  39904. // @if CK_DEBUG_ENGINE // if ( child.is( '$text' ) ) {
  39905. // @if CK_DEBUG_ENGINE // string += '\n' + '\t'.repeat( level + 1 ) + child.data;
  39906. // @if CK_DEBUG_ENGINE // } else {
  39907. // @if CK_DEBUG_ENGINE // string += '\n' + child.printTree( level + 1 );
  39908. // @if CK_DEBUG_ENGINE // }
  39909. // @if CK_DEBUG_ENGINE // }
  39910. // @if CK_DEBUG_ENGINE // if ( this.childCount ) {
  39911. // @if CK_DEBUG_ENGINE // string += '\n' + '\t'.repeat( level );
  39912. // @if CK_DEBUG_ENGINE // }
  39913. // @if CK_DEBUG_ENGINE // string += `</${ this.name }>`;
  39914. // @if CK_DEBUG_ENGINE // return string;
  39915. // @if CK_DEBUG_ENGINE // }
  39916. // @if CK_DEBUG_ENGINE // logTree() {
  39917. // @if CK_DEBUG_ENGINE // console.log( this.printTree() );
  39918. // @if CK_DEBUG_ENGINE // }
  39919. }
  39920. // Parses attributes provided to the element constructor before they are applied to an element. If attributes are passed
  39921. // as an object (instead of `Iterable`), the object is transformed to the map. Attributes with `null` value are removed.
  39922. // Attributes with non-`String` value are converted to `String`.
  39923. //
  39924. // @param {Object|Iterable} attrs Attributes to parse.
  39925. // @returns {Map} Parsed attributes.
  39926. function parseAttributes( attrs ) {
  39927. attrs = Object(_ckeditor_ckeditor5_utils_src_tomap__WEBPACK_IMPORTED_MODULE_3__["default"])( attrs );
  39928. for ( const [ key, value ] of attrs ) {
  39929. if ( value === null ) {
  39930. attrs.delete( key );
  39931. } else if ( typeof value != 'string' ) {
  39932. attrs.set( key, String( value ) );
  39933. }
  39934. }
  39935. return attrs;
  39936. }
  39937. // Parses class attribute and puts all classes into classes set.
  39938. // Classes set s cleared before insertion.
  39939. //
  39940. // @param {Set.<String>} classesSet Set to insert parsed classes.
  39941. // @param {String} classesString String with classes to parse.
  39942. function parseClasses( classesSet, classesString ) {
  39943. const classArray = classesString.split( /\s+/ );
  39944. classesSet.clear();
  39945. classArray.forEach( name => classesSet.add( name ) );
  39946. }
  39947. // Converts strings to Text and non-iterables to arrays.
  39948. //
  39949. // @param {String|module:engine/view/item~Item|Iterable.<String|module:engine/view/item~Item>}
  39950. // @returns {Iterable.<module:engine/view/node~Node>}
  39951. function normalize( document, nodes ) {
  39952. // Separate condition because string is iterable.
  39953. if ( typeof nodes == 'string' ) {
  39954. return [ new _text__WEBPACK_IMPORTED_MODULE_1__["default"]( document, nodes ) ];
  39955. }
  39956. if ( !Object(_ckeditor_ckeditor5_utils_src_isiterable__WEBPACK_IMPORTED_MODULE_5__["default"])( nodes ) ) {
  39957. nodes = [ nodes ];
  39958. }
  39959. // Array.from to enable .map() on non-arrays.
  39960. return Array.from( nodes )
  39961. .map( node => {
  39962. if ( typeof node == 'string' ) {
  39963. return new _text__WEBPACK_IMPORTED_MODULE_1__["default"]( document, node );
  39964. }
  39965. if ( node instanceof _textproxy__WEBPACK_IMPORTED_MODULE_2__["default"] ) {
  39966. return new _text__WEBPACK_IMPORTED_MODULE_1__["default"]( document, node.data );
  39967. }
  39968. return node;
  39969. } );
  39970. }
  39971. /***/ }),
  39972. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/emptyelement.js":
  39973. /*!**************************************************************************!*\
  39974. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/emptyelement.js ***!
  39975. \**************************************************************************/
  39976. /*! exports provided: default */
  39977. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  39978. "use strict";
  39979. __webpack_require__.r(__webpack_exports__);
  39980. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return EmptyElement; });
  39981. /* harmony import */ var _element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./element */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/element.js");
  39982. /* 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");
  39983. /* harmony import */ var _node__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/node.js");
  39984. /**
  39985. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  39986. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  39987. */
  39988. /**
  39989. * @module engine/view/emptyelement
  39990. */
  39991. /**
  39992. * Empty element class. It is used to represent elements that cannot contain any child nodes (for example `<img>` elements).
  39993. *
  39994. * To create a new empty element use the
  39995. * {@link module:engine/view/downcastwriter~DowncastWriter#createEmptyElement `downcastWriter#createEmptyElement()`} method.
  39996. *
  39997. * @extends module:engine/view/element~Element
  39998. */
  39999. class EmptyElement extends _element__WEBPACK_IMPORTED_MODULE_0__["default"] {
  40000. /**
  40001. * Creates new instance of EmptyElement.
  40002. *
  40003. * Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `view-emptyelement-cannot-add` when third parameter is passed,
  40004. * to inform that usage of EmptyElement is incorrect (adding child nodes to EmptyElement is forbidden).
  40005. *
  40006. * @see module:engine/view/downcastwriter~DowncastWriter#createEmptyElement
  40007. * @protected
  40008. * @param {module:engine/view/document~Document} document The document instance to which this element belongs.
  40009. * @param {String} name Node name.
  40010. * @param {Object|Iterable} [attrs] Collection of attributes.
  40011. * @param {module:engine/view/node~Node|Iterable.<module:engine/view/node~Node>} [children]
  40012. * A list of nodes to be inserted into created element.
  40013. */
  40014. constructor( document, name, attrs, children ) {
  40015. super( document, name, attrs, children );
  40016. // Override the default of the base class.
  40017. this._isAllowedInsideAttributeElement = true;
  40018. /**
  40019. * Returns `null` because filler is not needed for EmptyElements.
  40020. *
  40021. * @method #getFillerOffset
  40022. * @returns {null} Always returns null.
  40023. */
  40024. this.getFillerOffset = getFillerOffset;
  40025. }
  40026. /**
  40027. * Checks whether this object is of the given.
  40028. *
  40029. * emptyElement.is( 'emptyElement' ); // -> true
  40030. * emptyElement.is( 'element' ); // -> true
  40031. * emptyElement.is( 'node' ); // -> true
  40032. * emptyElement.is( 'view:emptyElement' ); // -> true
  40033. * emptyElement.is( 'view:element' ); // -> true
  40034. * emptyElement.is( 'view:node' ); // -> true
  40035. *
  40036. * emptyElement.is( 'model:element' ); // -> false
  40037. * emptyElement.is( 'documentFragment' ); // -> false
  40038. *
  40039. * Assuming that the object being checked is an empty element, you can also check its
  40040. * {@link module:engine/view/emptyelement~EmptyElement#name name}:
  40041. *
  40042. * emptyElement.is( 'element', 'img' ); // -> true if this is a img element
  40043. * emptyElement.is( 'emptyElement', 'img' ); // -> same as above
  40044. * text.is( 'element', 'img' ); -> false
  40045. *
  40046. * {@link module:engine/view/node~Node#is Check the entire list of view objects} which implement the `is()` method.
  40047. *
  40048. * @param {String} type Type to check.
  40049. * @param {String} [name] Element name.
  40050. * @returns {Boolean}
  40051. */
  40052. is( type, name = null ) {
  40053. if ( !name ) {
  40054. return type === 'emptyElement' || type === 'view:emptyElement' ||
  40055. // From super.is(). This is highly utilised method and cannot call super. See ckeditor/ckeditor5#6529.
  40056. type === 'element' || type === 'view:element' ||
  40057. type === 'node' || type === 'view:node';
  40058. } else {
  40059. return name === this.name && (
  40060. type === 'emptyElement' || type === 'view:emptyElement' ||
  40061. type === 'element' || type === 'view:element'
  40062. );
  40063. }
  40064. }
  40065. /**
  40066. * Overrides {@link module:engine/view/element~Element#_insertChild} method.
  40067. * Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `view-emptyelement-cannot-add` to prevent
  40068. * adding any child nodes to EmptyElement.
  40069. *
  40070. * @protected
  40071. */
  40072. _insertChild( index, nodes ) {
  40073. if ( nodes && ( nodes instanceof _node__WEBPACK_IMPORTED_MODULE_2__["default"] || Array.from( nodes ).length > 0 ) ) {
  40074. /**
  40075. * Cannot add children to {@link module:engine/view/emptyelement~EmptyElement}.
  40076. *
  40077. * @error view-emptyelement-cannot-add
  40078. */
  40079. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_1__["default"](
  40080. 'view-emptyelement-cannot-add',
  40081. [ this, nodes ]
  40082. );
  40083. }
  40084. }
  40085. }
  40086. // Returns `null` because block filler is not needed for EmptyElements.
  40087. //
  40088. // @returns {null}
  40089. function getFillerOffset() {
  40090. return null;
  40091. }
  40092. /***/ }),
  40093. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/filler.js":
  40094. /*!********************************************************************!*\
  40095. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/filler.js ***!
  40096. \********************************************************************/
  40097. /*! exports provided: NBSP_FILLER, MARKED_NBSP_FILLER, BR_FILLER, INLINE_FILLER_LENGTH, INLINE_FILLER, startsWithFiller, isInlineFiller, getDataWithoutFiller, injectQuirksHandling */
  40098. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  40099. "use strict";
  40100. __webpack_require__.r(__webpack_exports__);
  40101. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NBSP_FILLER", function() { return NBSP_FILLER; });
  40102. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MARKED_NBSP_FILLER", function() { return MARKED_NBSP_FILLER; });
  40103. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BR_FILLER", function() { return BR_FILLER; });
  40104. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "INLINE_FILLER_LENGTH", function() { return INLINE_FILLER_LENGTH; });
  40105. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "INLINE_FILLER", function() { return INLINE_FILLER; });
  40106. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "startsWithFiller", function() { return startsWithFiller; });
  40107. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isInlineFiller", function() { return isInlineFiller; });
  40108. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getDataWithoutFiller", function() { return getDataWithoutFiller; });
  40109. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "injectQuirksHandling", function() { return injectQuirksHandling; });
  40110. /* 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");
  40111. /* 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");
  40112. /**
  40113. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  40114. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  40115. */
  40116. /**
  40117. * Set of utilities related to handling block and inline fillers.
  40118. *
  40119. * Browsers do not allow to put caret in elements which does not have height. Because of it, we need to fill all
  40120. * empty elements which should be selectable with elements or characters called "fillers". Unfortunately there is no one
  40121. * universal filler, this is why two types are uses:
  40122. *
  40123. * * Block filler is an element which fill block elements, like `<p>`. CKEditor uses `<br>` as a block filler during the editing,
  40124. * as browsers do natively. So instead of an empty `<p>` there will be `<p><br></p>`. The advantage of block filler is that
  40125. * it is transparent for the selection, so when the caret is before the `<br>` and user presses right arrow he will be
  40126. * moved to the next paragraph, not after the `<br>`. The disadvantage is that it breaks a block, so it can not be used
  40127. * in the middle of a line of text. The {@link module:engine/view/filler~BR_FILLER `<br>` filler} can be replaced with any other
  40128. * character in the data output, for instance {@link module:engine/view/filler~NBSP_FILLER non-breaking space} or
  40129. * {@link module:engine/view/filler~MARKED_NBSP_FILLER marked non-breaking space}.
  40130. *
  40131. * * 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
  40132. * `<b>` surrendered by text: `foo<b></b>bar`, if we want to put the caret there. CKEditor uses a sequence of the zero-width
  40133. * spaces as an {@link module:engine/view/filler~INLINE_FILLER inline filler} having the predetermined
  40134. * {@link module:engine/view/filler~INLINE_FILLER_LENGTH length}. A sequence is used, instead of a single character to
  40135. * avoid treating random zero-width spaces as the inline filler. Disadvantage of the inline filler is that it is not
  40136. * transparent for the selection. The arrow key moves the caret between zero-width spaces characters, so the additional
  40137. * code is needed to handle the caret.
  40138. *
  40139. * Both inline and block fillers are handled by the {@link module:engine/view/renderer~Renderer renderer} and are not present in the
  40140. * view.
  40141. *
  40142. * @module engine/view/filler
  40143. */
  40144. /**
  40145. * Non-breaking space filler creator. This function creates the `&nbsp;` text node.
  40146. * It defines how the filler is created.
  40147. *
  40148. * @see module:engine/view/filler~MARKED_NBSP_FILLER
  40149. * @see module:engine/view/filler~BR_FILLER
  40150. * @function
  40151. */
  40152. const NBSP_FILLER = domDocument => domDocument.createTextNode( '\u00A0' );
  40153. /**
  40154. * Marked non-breaking space filler creator. This function creates the `<span data-cke-filler="true">&nbsp;</span>` element.
  40155. * It defines how the filler is created.
  40156. *
  40157. * @see module:engine/view/filler~NBSP_FILLER
  40158. * @see module:engine/view/filler~BR_FILLER
  40159. * @function
  40160. */
  40161. const MARKED_NBSP_FILLER = domDocument => {
  40162. const span = domDocument.createElement( 'span' );
  40163. span.dataset.ckeFiller = true;
  40164. span.innerHTML = '\u00A0';
  40165. return span;
  40166. };
  40167. /**
  40168. * `<br>` filler creator. This function creates the `<br data-cke-filler="true">` element.
  40169. * It defines how the filler is created.
  40170. *
  40171. * @see module:engine/view/filler~NBSP_FILLER
  40172. * @see module:engine/view/filler~MARKED_NBSP_FILLER
  40173. * @function
  40174. */
  40175. const BR_FILLER = domDocument => {
  40176. const fillerBr = domDocument.createElement( 'br' );
  40177. fillerBr.dataset.ckeFiller = true;
  40178. return fillerBr;
  40179. };
  40180. /**
  40181. * Length of the {@link module:engine/view/filler~INLINE_FILLER INLINE_FILLER}.
  40182. */
  40183. const INLINE_FILLER_LENGTH = 7;
  40184. /**
  40185. * Inline filler which is a sequence of the word joiners.
  40186. *
  40187. * @type {String}
  40188. */
  40189. const INLINE_FILLER = '\u2060'.repeat( INLINE_FILLER_LENGTH );
  40190. /**
  40191. * Checks if the node is a text node which starts with the {@link module:engine/view/filler~INLINE_FILLER inline filler}.
  40192. *
  40193. * startsWithFiller( document.createTextNode( INLINE_FILLER ) ); // true
  40194. * startsWithFiller( document.createTextNode( INLINE_FILLER + 'foo' ) ); // true
  40195. * startsWithFiller( document.createTextNode( 'foo' ) ); // false
  40196. * startsWithFiller( document.createElement( 'p' ) ); // false
  40197. *
  40198. * @param {Node} domNode DOM node.
  40199. * @returns {Boolean} True if the text node starts with the {@link module:engine/view/filler~INLINE_FILLER inline filler}.
  40200. */
  40201. function startsWithFiller( domNode ) {
  40202. return Object(_ckeditor_ckeditor5_utils_src_dom_istext__WEBPACK_IMPORTED_MODULE_1__["default"])( domNode ) && ( domNode.data.substr( 0, INLINE_FILLER_LENGTH ) === INLINE_FILLER );
  40203. }
  40204. /**
  40205. * Checks if the text node contains only the {@link module:engine/view/filler~INLINE_FILLER inline filler}.
  40206. *
  40207. * isInlineFiller( document.createTextNode( INLINE_FILLER ) ); // true
  40208. * isInlineFiller( document.createTextNode( INLINE_FILLER + 'foo' ) ); // false
  40209. *
  40210. * @param {Text} domText DOM text node.
  40211. * @returns {Boolean} True if the text node contains only the {@link module:engine/view/filler~INLINE_FILLER inline filler}.
  40212. */
  40213. function isInlineFiller( domText ) {
  40214. return domText.data.length == INLINE_FILLER_LENGTH && startsWithFiller( domText );
  40215. }
  40216. /**
  40217. * Get string data from the text node, removing an {@link module:engine/view/filler~INLINE_FILLER inline filler} from it,
  40218. * if text node contains it.
  40219. *
  40220. * getDataWithoutFiller( document.createTextNode( INLINE_FILLER + 'foo' ) ) == 'foo' // true
  40221. * getDataWithoutFiller( document.createTextNode( 'foo' ) ) == 'foo' // true
  40222. *
  40223. * @param {Text} domText DOM text node, possible with inline filler.
  40224. * @returns {String} Data without filler.
  40225. */
  40226. function getDataWithoutFiller( domText ) {
  40227. if ( startsWithFiller( domText ) ) {
  40228. return domText.data.slice( INLINE_FILLER_LENGTH );
  40229. } else {
  40230. return domText.data;
  40231. }
  40232. }
  40233. /**
  40234. * Assign key observer which move cursor from the end of the inline filler to the beginning of it when
  40235. * the left arrow is pressed, so the filler does not break navigation.
  40236. *
  40237. * @param {module:engine/view/view~View} view View controller instance we should inject quirks handling on.
  40238. */
  40239. function injectQuirksHandling( view ) {
  40240. view.document.on( 'arrowKey', jumpOverInlineFiller, { priority: 'low' } );
  40241. }
  40242. // Move cursor from the end of the inline filler to the beginning of it when, so the filler does not break navigation.
  40243. function jumpOverInlineFiller( evt, data ) {
  40244. if ( data.keyCode == _ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_0__["keyCodes"].arrowleft ) {
  40245. const domSelection = data.domTarget.ownerDocument.defaultView.getSelection();
  40246. if ( domSelection.rangeCount == 1 && domSelection.getRangeAt( 0 ).collapsed ) {
  40247. const domParent = domSelection.getRangeAt( 0 ).startContainer;
  40248. const domOffset = domSelection.getRangeAt( 0 ).startOffset;
  40249. if ( startsWithFiller( domParent ) && domOffset <= INLINE_FILLER_LENGTH ) {
  40250. domSelection.collapse( domParent, 0 );
  40251. }
  40252. }
  40253. }
  40254. }
  40255. /***/ }),
  40256. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/matcher.js":
  40257. /*!*********************************************************************!*\
  40258. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/matcher.js ***!
  40259. \*********************************************************************/
  40260. /*! exports provided: default */
  40261. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  40262. "use strict";
  40263. __webpack_require__.r(__webpack_exports__);
  40264. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Matcher; });
  40265. /**
  40266. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  40267. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  40268. */
  40269. /**
  40270. * @module engine/view/matcher
  40271. */
  40272. /**
  40273. * View matcher class.
  40274. * Instance of this class can be used to find {@link module:engine/view/element~Element elements} that match given pattern.
  40275. */
  40276. class Matcher {
  40277. /**
  40278. * Creates new instance of Matcher.
  40279. *
  40280. * @param {String|RegExp|Object} [pattern] Match patterns. See {@link module:engine/view/matcher~Matcher#add add method} for
  40281. * more information.
  40282. */
  40283. constructor( ...pattern ) {
  40284. /**
  40285. * @private
  40286. * @type {Array<String|RegExp|Object>}
  40287. */
  40288. this._patterns = [];
  40289. this.add( ...pattern );
  40290. }
  40291. /**
  40292. * Adds pattern or patterns to matcher instance.
  40293. *
  40294. * // String.
  40295. * matcher.add( 'div' );
  40296. *
  40297. * // Regular expression.
  40298. * matcher.add( /^\w/ );
  40299. *
  40300. * // Single class.
  40301. * matcher.add( {
  40302. * classes: 'foobar'
  40303. * } );
  40304. *
  40305. * See {@link module:engine/view/matcher~MatcherPattern} for more examples.
  40306. *
  40307. * Multiple patterns can be added in one call:
  40308. *
  40309. * matcher.add( 'div', { classes: 'foobar' } );
  40310. *
  40311. * @param {Object|String|RegExp|Function} pattern Object describing pattern details. If string or regular expression
  40312. * is provided it will be used to match element's name. Pattern can be also provided in a form
  40313. * of a function - then this function will be called with each {@link module:engine/view/element~Element element} as a parameter.
  40314. * Function's return value will be stored under `match` key of the object returned from
  40315. * {@link module:engine/view/matcher~Matcher#match match} or {@link module:engine/view/matcher~Matcher#matchAll matchAll} methods.
  40316. * @param {String|RegExp} [pattern.name] Name or regular expression to match element's name.
  40317. * @param {Object} [pattern.attributes] Object with key-value pairs representing attributes to match. Each object key
  40318. * represents attribute name. Value under that key can be either:
  40319. * * `true` - then attribute is just required (can be empty),
  40320. * * a string - then attribute has to be equal, or
  40321. * * a regular expression - then attribute has to match the expression.
  40322. * @param {String|RegExp|Array} [pattern.classes] Class name or array of class names to match. Each name can be
  40323. * provided in a form of string or regular expression.
  40324. * @param {Object} [pattern.styles] Object with key-value pairs representing styles to match. Each object key
  40325. * represents style name. Value under that key can be either a string or a regular expression and it will be used
  40326. * to match style value.
  40327. */
  40328. add( ...pattern ) {
  40329. for ( let item of pattern ) {
  40330. // String or RegExp pattern is used as element's name.
  40331. if ( typeof item == 'string' || item instanceof RegExp ) {
  40332. item = { name: item };
  40333. }
  40334. // Single class name/RegExp can be provided.
  40335. if ( item.classes && ( typeof item.classes == 'string' || item.classes instanceof RegExp ) ) {
  40336. item.classes = [ item.classes ];
  40337. }
  40338. this._patterns.push( item );
  40339. }
  40340. }
  40341. /**
  40342. * Matches elements for currently stored patterns. Returns match information about first found
  40343. * {@link module:engine/view/element~Element element}, otherwise returns `null`.
  40344. *
  40345. * Example of returned object:
  40346. *
  40347. * {
  40348. * element: <instance of found element>,
  40349. * pattern: <pattern used to match found element>,
  40350. * match: {
  40351. * name: true,
  40352. * attributes: [ 'title', 'href' ],
  40353. * classes: [ 'foo' ],
  40354. * styles: [ 'color', 'position' ]
  40355. * }
  40356. * }
  40357. *
  40358. * @see module:engine/view/matcher~Matcher#add
  40359. * @see module:engine/view/matcher~Matcher#matchAll
  40360. * @param {...module:engine/view/element~Element} element View element to match against stored patterns.
  40361. * @returns {Object|null} result
  40362. * @returns {module:engine/view/element~Element} result.element Matched view element.
  40363. * @returns {Object|String|RegExp|Function} result.pattern Pattern that was used to find matched element.
  40364. * @returns {Object} result.match Object representing matched element parts.
  40365. * @returns {Boolean} [result.match.name] True if name of the element was matched.
  40366. * @returns {Array} [result.match.attributes] Array with matched attribute names.
  40367. * @returns {Array} [result.match.classes] Array with matched class names.
  40368. * @returns {Array} [result.match.styles] Array with matched style names.
  40369. */
  40370. match( ...element ) {
  40371. for ( const singleElement of element ) {
  40372. for ( const pattern of this._patterns ) {
  40373. const match = isElementMatching( singleElement, pattern );
  40374. if ( match ) {
  40375. return {
  40376. element: singleElement,
  40377. pattern,
  40378. match
  40379. };
  40380. }
  40381. }
  40382. }
  40383. return null;
  40384. }
  40385. /**
  40386. * Matches elements for currently stored patterns. Returns array of match information with all found
  40387. * {@link module:engine/view/element~Element elements}. If no element is found - returns `null`.
  40388. *
  40389. * @see module:engine/view/matcher~Matcher#add
  40390. * @see module:engine/view/matcher~Matcher#match
  40391. * @param {...module:engine/view/element~Element} element View element to match against stored patterns.
  40392. * @returns {Array.<Object>|null} Array with match information about found elements or `null`. For more information
  40393. * see {@link module:engine/view/matcher~Matcher#match match method} description.
  40394. */
  40395. matchAll( ...element ) {
  40396. const results = [];
  40397. for ( const singleElement of element ) {
  40398. for ( const pattern of this._patterns ) {
  40399. const match = isElementMatching( singleElement, pattern );
  40400. if ( match ) {
  40401. results.push( {
  40402. element: singleElement,
  40403. pattern,
  40404. match
  40405. } );
  40406. }
  40407. }
  40408. }
  40409. return results.length > 0 ? results : null;
  40410. }
  40411. /**
  40412. * Returns the name of the element to match if there is exactly one pattern added to the matcher instance
  40413. * and it matches element name defined by `string` (not `RegExp`). Otherwise, returns `null`.
  40414. *
  40415. * @returns {String|null} Element name trying to match.
  40416. */
  40417. getElementName() {
  40418. if ( this._patterns.length !== 1 ) {
  40419. return null;
  40420. }
  40421. const pattern = this._patterns[ 0 ];
  40422. const name = pattern.name;
  40423. return ( typeof pattern != 'function' && name && !( name instanceof RegExp ) ) ? name : null;
  40424. }
  40425. }
  40426. // Returns match information if {@link module:engine/view/element~Element element} is matching provided pattern.
  40427. // If element cannot be matched to provided pattern - returns `null`.
  40428. //
  40429. // @param {module:engine/view/element~Element} element
  40430. // @param {Object|String|RegExp|Function} pattern
  40431. // @returns {Object|null} Returns object with match information or null if element is not matching.
  40432. function isElementMatching( element, pattern ) {
  40433. // If pattern is provided as function - return result of that function;
  40434. if ( typeof pattern == 'function' ) {
  40435. return pattern( element );
  40436. }
  40437. const match = {};
  40438. // Check element's name.
  40439. if ( pattern.name ) {
  40440. match.name = matchName( pattern.name, element.name );
  40441. if ( !match.name ) {
  40442. return null;
  40443. }
  40444. }
  40445. // Check element's attributes.
  40446. if ( pattern.attributes ) {
  40447. match.attributes = matchAttributes( pattern.attributes, element );
  40448. if ( !match.attributes ) {
  40449. return null;
  40450. }
  40451. }
  40452. // Check element's classes.
  40453. if ( pattern.classes ) {
  40454. match.classes = matchClasses( pattern.classes, element );
  40455. if ( !match.classes ) {
  40456. return false;
  40457. }
  40458. }
  40459. // Check element's styles.
  40460. if ( pattern.styles ) {
  40461. match.styles = matchStyles( pattern.styles, element );
  40462. if ( !match.styles ) {
  40463. return false;
  40464. }
  40465. }
  40466. return match;
  40467. }
  40468. // Checks if name can be matched by provided pattern.
  40469. //
  40470. // @param {String|RegExp} pattern
  40471. // @param {String} name
  40472. // @returns {Boolean} Returns `true` if name can be matched, `false` otherwise.
  40473. function matchName( pattern, name ) {
  40474. // If pattern is provided as RegExp - test against this regexp.
  40475. if ( pattern instanceof RegExp ) {
  40476. return pattern.test( name );
  40477. }
  40478. return pattern === name;
  40479. }
  40480. // Checks if attributes of provided element can be matched against provided patterns.
  40481. //
  40482. // @param {Object} patterns Object with information about attributes to match. Each key of the object will be
  40483. // used as attribute name. Value of each key can be a string or regular expression to match against attribute value.
  40484. // @param {module:engine/view/element~Element} element Element which attributes will be tested.
  40485. // @returns {Array|null} Returns array with matched attribute names or `null` if no attributes were matched.
  40486. function matchAttributes( patterns, element ) {
  40487. const match = [];
  40488. for ( const name in patterns ) {
  40489. const pattern = patterns[ name ];
  40490. if ( element.hasAttribute( name ) ) {
  40491. const attribute = element.getAttribute( name );
  40492. if ( pattern === true ) {
  40493. match.push( name );
  40494. } else if ( pattern instanceof RegExp ) {
  40495. if ( pattern.test( attribute ) ) {
  40496. match.push( name );
  40497. } else {
  40498. return null;
  40499. }
  40500. } else if ( attribute === pattern ) {
  40501. match.push( name );
  40502. } else {
  40503. return null;
  40504. }
  40505. } else {
  40506. return null;
  40507. }
  40508. }
  40509. return match;
  40510. }
  40511. // Checks if classes of provided element can be matched against provided patterns.
  40512. //
  40513. // @param {Array.<String|RegExp>} patterns Array of strings or regular expressions to match against element's classes.
  40514. // @param {module:engine/view/element~Element} element Element which classes will be tested.
  40515. // @returns {Array|null} Returns array with matched class names or `null` if no classes were matched.
  40516. function matchClasses( patterns, element ) {
  40517. const match = [];
  40518. for ( const pattern of patterns ) {
  40519. if ( pattern instanceof RegExp ) {
  40520. const classes = element.getClassNames();
  40521. for ( const name of classes ) {
  40522. if ( pattern.test( name ) ) {
  40523. match.push( name );
  40524. }
  40525. }
  40526. if ( match.length === 0 ) {
  40527. return null;
  40528. }
  40529. } else if ( element.hasClass( pattern ) ) {
  40530. match.push( pattern );
  40531. } else {
  40532. return null;
  40533. }
  40534. }
  40535. return match;
  40536. }
  40537. // Checks if styles of provided element can be matched against provided patterns.
  40538. //
  40539. // @param {Object} patterns Object with information about styles to match. Each key of the object will be
  40540. // used as style name. Value of each key can be a string or regular expression to match against style value.
  40541. // @param {module:engine/view/element~Element} element Element which styles will be tested.
  40542. // @returns {Array|null} Returns array with matched style names or `null` if no styles were matched.
  40543. function matchStyles( patterns, element ) {
  40544. const match = [];
  40545. for ( const name in patterns ) {
  40546. const pattern = patterns[ name ];
  40547. if ( element.hasStyle( name ) ) {
  40548. const style = element.getStyle( name );
  40549. if ( pattern instanceof RegExp ) {
  40550. if ( pattern.test( style ) ) {
  40551. match.push( name );
  40552. } else {
  40553. return null;
  40554. }
  40555. } else if ( style === pattern ) {
  40556. match.push( name );
  40557. } else {
  40558. return null;
  40559. }
  40560. } else {
  40561. return null;
  40562. }
  40563. }
  40564. return match;
  40565. }
  40566. /**
  40567. * An entity that is a valid pattern recognized by a matcher. `MatcherPattern` is used by {@link ~Matcher} to recognize
  40568. * if a view element fits in a group of view elements described by the pattern.
  40569. *
  40570. * `MatcherPattern` can be given as a `String`, a `RegExp`, an `Object` or a `Function`.
  40571. *
  40572. * If `MatcherPattern` is given as a `String` or `RegExp`, it will match any view element that has a matching name:
  40573. *
  40574. * // Match any element with name equal to 'div'.
  40575. * const pattern = 'div';
  40576. *
  40577. * // Match any element which name starts on 'p'.
  40578. * const pattern = /^p/;
  40579. *
  40580. * If `MatcherPattern` is given as an `Object`, all the object's properties will be matched with view element properties.
  40581. *
  40582. * // Match view element's name.
  40583. * const pattern = { name: /^p/ };
  40584. *
  40585. * // Match view element which has matching attributes.
  40586. * const pattern = {
  40587. * attributes: {
  40588. * title: 'foobar', // Attribute title should equal 'foobar'.
  40589. * foo: /^\w+/, // Attribute foo should match /^\w+/ regexp.
  40590. * bar: true // Attribute bar should be set (can be empty).
  40591. * }
  40592. * };
  40593. *
  40594. * // Match view element which has given class.
  40595. * const pattern = {
  40596. * classes: 'foobar'
  40597. * };
  40598. *
  40599. * // Match view element class using regular expression.
  40600. * const pattern = {
  40601. * classes: /foo.../
  40602. * };
  40603. *
  40604. * // Multiple classes to match.
  40605. * const pattern = {
  40606. * classes: [ 'baz', 'bar', /foo.../ ]
  40607. * };
  40608. *
  40609. * // Match view element which has given styles.
  40610. * const pattern = {
  40611. * styles: {
  40612. * position: 'absolute',
  40613. * color: /^\w*blue$/
  40614. * }
  40615. * };
  40616. *
  40617. * // Pattern with multiple properties.
  40618. * const pattern = {
  40619. * name: 'span',
  40620. * styles: {
  40621. * 'font-weight': 'bold'
  40622. * },
  40623. * classes: 'highlighted'
  40624. * };
  40625. *
  40626. * If `MatcherPattern` is given as a `Function`, the function takes a view element as a first and only parameter and
  40627. * the function should decide whether that element matches. If so, it should return what part of the view element has been matched.
  40628. * Otherwise, the function should return `null`. The returned result will be included in `match` property of the object
  40629. * returned by {@link ~Matcher#match} call.
  40630. *
  40631. * // Match an empty <div> element.
  40632. * const pattern = element => {
  40633. * if ( element.name == 'div' && element.childCount > 0 ) {
  40634. * // Return which part of the element was matched.
  40635. * return { name: true };
  40636. * }
  40637. *
  40638. * return null;
  40639. * };
  40640. *
  40641. * // Match a <p> element with big font ("heading-like" element).
  40642. * const pattern = element => {
  40643. * if ( element.name == 'p' ) {
  40644. * const fontSize = element.getStyle( 'font-size' );
  40645. * const size = fontSize.match( /(\d+)/px );
  40646. *
  40647. * if ( size && Number( size[ 1 ] ) > 26 ) {
  40648. * return { name: true, attribute: [ 'font-size' ] };
  40649. * }
  40650. * }
  40651. *
  40652. * return null;
  40653. * };
  40654. *
  40655. * `MatcherPattern` is defined in a way that it is a superset of {@link module:engine/view/elementdefinition~ElementDefinition},
  40656. * that is, every `ElementDefinition` also can be used as a `MatcherPattern`.
  40657. *
  40658. * @typedef {String|RegExp|Object|Function} module:engine/view/matcher~MatcherPattern
  40659. *
  40660. * @property {String|RegExp} [name] View element name to match.
  40661. * @property {String|RegExp|Array.<String|RegExp>} [classes] View element's class name(s) to match.
  40662. * @property {Object} [styles] Object with key-value pairs representing styles to match.
  40663. * Each object key represents style name. Value can be given as `String` or `RegExp`.
  40664. * @property {Object} [attributes] Object with key-value pairs representing attributes to match.
  40665. * Each object key represents attribute name. Value can be given as `String` or `RegExp`.
  40666. */
  40667. /***/ }),
  40668. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/node.js":
  40669. /*!******************************************************************!*\
  40670. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/node.js ***!
  40671. \******************************************************************/
  40672. /*! exports provided: default */
  40673. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  40674. "use strict";
  40675. __webpack_require__.r(__webpack_exports__);
  40676. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Node; });
  40677. /* 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");
  40678. /* 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");
  40679. /* 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");
  40680. /* 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");
  40681. /* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! lodash-es */ "./node_modules/lodash-es/lodash.js");
  40682. /* 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");
  40683. /**
  40684. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  40685. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  40686. */
  40687. /**
  40688. * @module engine/view/node
  40689. */
  40690. // To check if component is loaded more than once.
  40691. /**
  40692. * Abstract view node class.
  40693. *
  40694. * This is an abstract class. Its constructor should not be used directly.
  40695. * Use the {@link module:engine/view/downcastwriter~DowncastWriter} or {@link module:engine/view/upcastwriter~UpcastWriter}
  40696. * to create new instances of view nodes.
  40697. *
  40698. * @abstract
  40699. */
  40700. class Node {
  40701. /**
  40702. * Creates a tree view node.
  40703. *
  40704. * @protected
  40705. * @param {module:engine/view/document~Document} document The document instance to which this node belongs.
  40706. */
  40707. constructor( document ) {
  40708. /**
  40709. * The document instance to which this node belongs.
  40710. *
  40711. * @readonly
  40712. * @member {module:engine/view/document~Document}
  40713. */
  40714. this.document = document;
  40715. /**
  40716. * Parent element. Null by default. Set by {@link module:engine/view/element~Element#_insertChild}.
  40717. *
  40718. * @readonly
  40719. * @member {module:engine/view/element~Element|module:engine/view/documentfragment~DocumentFragment|null}
  40720. */
  40721. this.parent = null;
  40722. }
  40723. /**
  40724. * Index of the node in the parent element or null if the node has no parent.
  40725. *
  40726. * Accessing this property throws an error if this node's parent element does not contain it.
  40727. * This means that view tree got broken.
  40728. *
  40729. * @readonly
  40730. * @type {Number|null}
  40731. */
  40732. get index() {
  40733. let pos;
  40734. if ( !this.parent ) {
  40735. return null;
  40736. }
  40737. // No parent or child doesn't exist in parent's children.
  40738. if ( ( pos = this.parent.getChildIndex( this ) ) == -1 ) {
  40739. /**
  40740. * The node's parent does not contain this node. It means that the document tree is corrupted.
  40741. *
  40742. * @error view-node-not-found-in-parent
  40743. */
  40744. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"]( 'view-node-not-found-in-parent', this );
  40745. }
  40746. return pos;
  40747. }
  40748. /**
  40749. * Node's next sibling, or `null` if it is the last child.
  40750. *
  40751. * @readonly
  40752. * @type {module:engine/view/node~Node|null}
  40753. */
  40754. get nextSibling() {
  40755. const index = this.index;
  40756. return ( index !== null && this.parent.getChild( index + 1 ) ) || null;
  40757. }
  40758. /**
  40759. * Node's previous sibling, or `null` if it is the first child.
  40760. *
  40761. * @readonly
  40762. * @type {module:engine/view/node~Node|null}
  40763. */
  40764. get previousSibling() {
  40765. const index = this.index;
  40766. return ( index !== null && this.parent.getChild( index - 1 ) ) || null;
  40767. }
  40768. /**
  40769. * Top-most ancestor of the node. If the node has no parent it is the root itself.
  40770. *
  40771. * @readonly
  40772. * @type {module:engine/view/node~Node|module:engine/view/documentfragment~DocumentFragment}
  40773. */
  40774. get root() {
  40775. let root = this; // eslint-disable-line consistent-this
  40776. while ( root.parent ) {
  40777. root = root.parent;
  40778. }
  40779. return root;
  40780. }
  40781. /**
  40782. * Returns true if the node is in a tree rooted in the document (is a descendant of one of its roots).
  40783. *
  40784. * @returns {Boolean}
  40785. */
  40786. isAttached() {
  40787. return this.root.is( 'rootElement' );
  40788. }
  40789. /**
  40790. * Gets a path to the node. The path is an array containing indices of consecutive ancestors of this node,
  40791. * beginning from {@link module:engine/view/node~Node#root root}, down to this node's index.
  40792. *
  40793. * const abc = downcastWriter.createText( 'abc' );
  40794. * const foo = downcastWriter.createText( 'foo' );
  40795. * const h1 = downcastWriter.createElement( 'h1', null, downcastWriter.createText( 'header' ) );
  40796. * const p = downcastWriter.createElement( 'p', null, [ abc, foo ] );
  40797. * const div = downcastWriter.createElement( 'div', null, [ h1, p ] );
  40798. * foo.getPath(); // Returns [ 1, 3 ]. `foo` is in `p` which is in `div`. `p` starts at offset 1, while `foo` at 3.
  40799. * h1.getPath(); // Returns [ 0 ].
  40800. * div.getPath(); // Returns [].
  40801. *
  40802. * @returns {Array.<Number>} The path.
  40803. */
  40804. getPath() {
  40805. const path = [];
  40806. let node = this; // eslint-disable-line consistent-this
  40807. while ( node.parent ) {
  40808. path.unshift( node.index );
  40809. node = node.parent;
  40810. }
  40811. return path;
  40812. }
  40813. /**
  40814. * Returns ancestors array of this node.
  40815. *
  40816. * @param {Object} options Options object.
  40817. * @param {Boolean} [options.includeSelf=false] When set to `true` this node will be also included in parent's array.
  40818. * @param {Boolean} [options.parentFirst=false] When set to `true`, array will be sorted from node's parent to root element,
  40819. * otherwise root element will be the first item in the array.
  40820. * @returns {Array} Array with ancestors.
  40821. */
  40822. getAncestors( options = { includeSelf: false, parentFirst: false } ) {
  40823. const ancestors = [];
  40824. let parent = options.includeSelf ? this : this.parent;
  40825. while ( parent ) {
  40826. ancestors[ options.parentFirst ? 'push' : 'unshift' ]( parent );
  40827. parent = parent.parent;
  40828. }
  40829. return ancestors;
  40830. }
  40831. /**
  40832. * Returns a {@link module:engine/view/element~Element} or {@link module:engine/view/documentfragment~DocumentFragment}
  40833. * which is a common ancestor of both nodes.
  40834. *
  40835. * @param {module:engine/view/node~Node} node The second node.
  40836. * @param {Object} options Options object.
  40837. * @param {Boolean} [options.includeSelf=false] When set to `true` both nodes will be considered "ancestors" too.
  40838. * Which means that if e.g. node A is inside B, then their common ancestor will be B.
  40839. * @returns {module:engine/view/element~Element|module:engine/view/documentfragment~DocumentFragment|null}
  40840. */
  40841. getCommonAncestor( node, options = {} ) {
  40842. const ancestorsA = this.getAncestors( options );
  40843. const ancestorsB = node.getAncestors( options );
  40844. let i = 0;
  40845. while ( ancestorsA[ i ] == ancestorsB[ i ] && ancestorsA[ i ] ) {
  40846. i++;
  40847. }
  40848. return i === 0 ? null : ancestorsA[ i - 1 ];
  40849. }
  40850. /**
  40851. * Returns whether this node is before given node. `false` is returned if nodes are in different trees (for example,
  40852. * in different {@link module:engine/view/documentfragment~DocumentFragment}s).
  40853. *
  40854. * @param {module:engine/view/node~Node} node Node to compare with.
  40855. * @returns {Boolean}
  40856. */
  40857. isBefore( node ) {
  40858. // Given node is not before this node if they are same.
  40859. if ( this == node ) {
  40860. return false;
  40861. }
  40862. // Return `false` if it is impossible to compare nodes.
  40863. if ( this.root !== node.root ) {
  40864. return false;
  40865. }
  40866. const thisPath = this.getPath();
  40867. const nodePath = node.getPath();
  40868. const result = Object(_ckeditor_ckeditor5_utils_src_comparearrays__WEBPACK_IMPORTED_MODULE_3__["default"])( thisPath, nodePath );
  40869. switch ( result ) {
  40870. case 'prefix':
  40871. return true;
  40872. case 'extension':
  40873. return false;
  40874. default:
  40875. return thisPath[ result ] < nodePath[ result ];
  40876. }
  40877. }
  40878. /**
  40879. * Returns whether this node is after given node. `false` is returned if nodes are in different trees (for example,
  40880. * in different {@link module:engine/view/documentfragment~DocumentFragment}s).
  40881. *
  40882. * @param {module:engine/view/node~Node} node Node to compare with.
  40883. * @returns {Boolean}
  40884. */
  40885. isAfter( node ) {
  40886. // Given node is not before this node if they are same.
  40887. if ( this == node ) {
  40888. return false;
  40889. }
  40890. // Return `false` if it is impossible to compare nodes.
  40891. if ( this.root !== node.root ) {
  40892. return false;
  40893. }
  40894. // In other cases, just check if the `node` is before, and return the opposite.
  40895. return !this.isBefore( node );
  40896. }
  40897. /**
  40898. * Removes node from parent.
  40899. *
  40900. * @protected
  40901. */
  40902. _remove() {
  40903. this.parent._removeChildren( this.index );
  40904. }
  40905. /**
  40906. * @protected
  40907. * @param {module:engine/view/document~ChangeType} type Type of the change.
  40908. * @param {module:engine/view/node~Node} node Changed node.
  40909. * @fires change
  40910. */
  40911. _fireChange( type, node ) {
  40912. this.fire( 'change:' + type, node );
  40913. if ( this.parent ) {
  40914. this.parent._fireChange( type, node );
  40915. }
  40916. }
  40917. /**
  40918. * Custom toJSON method to solve child-parent circular dependencies.
  40919. *
  40920. * @returns {Object} Clone of this object with the parent property removed.
  40921. */
  40922. toJSON() {
  40923. const json = Object(lodash_es__WEBPACK_IMPORTED_MODULE_4__["clone"])( this );
  40924. // Due to circular references we need to remove parent reference.
  40925. delete json.parent;
  40926. return json;
  40927. }
  40928. /**
  40929. * Checks whether this object is of the given type.
  40930. *
  40931. * This method is useful when processing view objects that are of unknown type. For example, a function
  40932. * may return a {@link module:engine/view/documentfragment~DocumentFragment} or a {@link module:engine/view/node~Node}
  40933. * that can be either a text node or an element. This method can be used to check what kind of object is returned.
  40934. *
  40935. * someObject.is( 'element' ); // -> true if this is an element
  40936. * someObject.is( 'node' ); // -> true if this is a node (a text node or an element)
  40937. * someObject.is( 'documentFragment' ); // -> true if this is a document fragment
  40938. *
  40939. * Since this method is also available on a range of model objects, you can prefix the type of the object with
  40940. * `model:` or `view:` to check, for example, if this is the model's or view's element:
  40941. *
  40942. * viewElement.is( 'view:element' ); // -> true
  40943. * viewElement.is( 'model:element' ); // -> false
  40944. *
  40945. * By using this method it is also possible to check a name of an element:
  40946. *
  40947. * imgElement.is( 'element', 'img' ); // -> true
  40948. * imgElement.is( 'view:element', 'img' ); // -> same as above, but more precise
  40949. *
  40950. * The list of view objects which implement the `is()` method:
  40951. *
  40952. * * {@link module:engine/view/attributeelement~AttributeElement#is `AttributeElement#is()`}
  40953. * * {@link module:engine/view/containerelement~ContainerElement#is `ContainerElement#is()`}
  40954. * * {@link module:engine/view/documentfragment~DocumentFragment#is `DocumentFragment#is()`}
  40955. * * {@link module:engine/view/documentselection~DocumentSelection#is `DocumentSelection#is()`}
  40956. * * {@link module:engine/view/editableelement~EditableElement#is `EditableElement#is()`}
  40957. * * {@link module:engine/view/element~Element#is `Element#is()`}
  40958. * * {@link module:engine/view/emptyelement~EmptyElement#is `EmptyElement#is()`}
  40959. * * {@link module:engine/view/node~Node#is `Node#is()`}
  40960. * * {@link module:engine/view/position~Position#is `Position#is()`}
  40961. * * {@link module:engine/view/range~Range#is `Range#is()`}
  40962. * * {@link module:engine/view/rooteditableelement~RootEditableElement#is `RootEditableElement#is()`}
  40963. * * {@link module:engine/view/selection~Selection#is `Selection#is()`}
  40964. * * {@link module:engine/view/text~Text#is `Text#is()`}
  40965. * * {@link module:engine/view/textproxy~TextProxy#is `TextProxy#is()`}
  40966. * * {@link module:engine/view/uielement~UIElement#is `UIElement#is()`}
  40967. *
  40968. * @method #is
  40969. * @param {String} type Type to check.
  40970. * @returns {Boolean}
  40971. */
  40972. is( type ) {
  40973. return type === 'node' || type === 'view:node';
  40974. }
  40975. /**
  40976. * Clones this node.
  40977. *
  40978. * @protected
  40979. * @method #_clone
  40980. * @returns {module:engine/view/node~Node} Clone of this node.
  40981. */
  40982. /**
  40983. * Checks if provided node is similar to this node.
  40984. *
  40985. * @method #isSimilar
  40986. * @returns {Boolean} True if nodes are similar.
  40987. */
  40988. }
  40989. /**
  40990. * Fired when list of {@link module:engine/view/element~Element elements} children changes.
  40991. *
  40992. * Change event is bubbled – it is fired on all ancestors.
  40993. *
  40994. * @event change:children
  40995. * @param {module:engine/view/node~Node} changedNode
  40996. */
  40997. /**
  40998. * Fired when list of {@link module:engine/view/element~Element elements} attributes changes.
  40999. *
  41000. * Change event is bubbled – it is fired on all ancestors.
  41001. *
  41002. * @event change:attributes
  41003. * @param {module:engine/view/node~Node} changedNode
  41004. */
  41005. /**
  41006. * Fired when {@link module:engine/view/text~Text text nodes} data changes.
  41007. *
  41008. * Change event is bubbled – it is fired on all ancestors.
  41009. *
  41010. * @event change:text
  41011. * @param {module:engine/view/node~Node} changedNode
  41012. */
  41013. /**
  41014. * @event change
  41015. */
  41016. Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_2__["default"])( Node, _ckeditor_ckeditor5_utils_src_emittermixin__WEBPACK_IMPORTED_MODULE_1__["default"] );
  41017. /***/ }),
  41018. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/arrowkeysobserver.js":
  41019. /*!****************************************************************************************!*\
  41020. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/arrowkeysobserver.js ***!
  41021. \****************************************************************************************/
  41022. /*! exports provided: default */
  41023. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  41024. "use strict";
  41025. __webpack_require__.r(__webpack_exports__);
  41026. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ArrowKeysObserver; });
  41027. /* harmony import */ var _observer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./observer */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/observer.js");
  41028. /* harmony import */ var _bubblingeventinfo__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./bubblingeventinfo */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/bubblingeventinfo.js");
  41029. /* harmony import */ var _ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils */ "./node_modules/@ckeditor/ckeditor5-utils/src/index.js");
  41030. /**
  41031. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  41032. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  41033. */
  41034. /**
  41035. * @module engine/view/observer/arrowkeysobserver
  41036. */
  41037. /**
  41038. * Arrow keys observer introduces the {@link module:engine/view/document~Document#event:arrowKey `Document#arrowKey`} event.
  41039. *
  41040. * Note that this observer is attached by the {@link module:engine/view/view~View} and is available by default.
  41041. *
  41042. * @extends module:engine/view/observer/observer~Observer
  41043. */
  41044. class ArrowKeysObserver extends _observer__WEBPACK_IMPORTED_MODULE_0__["default"] {
  41045. /**
  41046. * @inheritDoc
  41047. */
  41048. constructor( view ) {
  41049. super( view );
  41050. this.document.on( 'keydown', ( event, data ) => {
  41051. if ( this.isEnabled && Object(_ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_2__["isArrowKeyCode"])( data.keyCode ) ) {
  41052. const eventInfo = new _bubblingeventinfo__WEBPACK_IMPORTED_MODULE_1__["default"]( this.document, 'arrowKey', this.document.selection.getFirstRange() );
  41053. this.document.fire( eventInfo, data );
  41054. if ( eventInfo.stop.called ) {
  41055. event.stop();
  41056. }
  41057. }
  41058. } );
  41059. }
  41060. /**
  41061. * @inheritDoc
  41062. */
  41063. observe() {}
  41064. }
  41065. /**
  41066. * Event fired when the user presses an arrow keys.
  41067. *
  41068. * Introduced by {@link module:engine/view/observer/arrowkeysobserver~ArrowKeysObserver}.
  41069. *
  41070. * Note that because {@link module:engine/view/observer/arrowkeysobserver~ArrowKeysObserver} is attached by the
  41071. * {@link module:engine/view/view~View} this event is available by default.
  41072. *
  41073. * @event module:engine/view/document~Document#event:arrowKey
  41074. * @param {module:engine/view/observer/domeventdata~DomEventData} data
  41075. */
  41076. /***/ }),
  41077. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/bubblingemittermixin.js":
  41078. /*!*******************************************************************************************!*\
  41079. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/bubblingemittermixin.js ***!
  41080. \*******************************************************************************************/
  41081. /*! exports provided: default */
  41082. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  41083. "use strict";
  41084. __webpack_require__.r(__webpack_exports__);
  41085. /* harmony import */ var _ckeditor_ckeditor5_utils_src_eventinfo__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/eventinfo */ "./node_modules/@ckeditor/ckeditor5-utils/src/eventinfo.js");
  41086. /* 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");
  41087. /* 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");
  41088. /* harmony import */ var _ckeditor_ckeditor5_utils_src_toarray__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/toarray */ "./node_modules/@ckeditor/ckeditor5-utils/src/toarray.js");
  41089. /* harmony import */ var _bubblingeventinfo__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./bubblingeventinfo */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/bubblingeventinfo.js");
  41090. /**
  41091. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  41092. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  41093. */
  41094. /**
  41095. * @module engine/view/observer/bubblingemittermixin
  41096. */
  41097. const contextsSymbol = Symbol( 'bubbling contexts' );
  41098. /**
  41099. * Bubbling emitter mixin for the view document as described in the
  41100. * {@link ~BubblingEmitter} interface.
  41101. *
  41102. * @mixin BubblingEmitterMixin
  41103. * @implements module:engine/view/observer/bubblingemittermixin~BubblingEmitter
  41104. */
  41105. const BubblingEmitterMixin = {
  41106. /**
  41107. * @inheritDoc
  41108. */
  41109. fire( eventOrInfo, ...eventArgs ) {
  41110. try {
  41111. const eventInfo = eventOrInfo instanceof _ckeditor_ckeditor5_utils_src_eventinfo__WEBPACK_IMPORTED_MODULE_0__["default"] ? eventOrInfo : new _ckeditor_ckeditor5_utils_src_eventinfo__WEBPACK_IMPORTED_MODULE_0__["default"]( this, eventOrInfo );
  41112. const eventContexts = getBubblingContexts( this );
  41113. if ( !eventContexts.size ) {
  41114. return;
  41115. }
  41116. updateEventInfo( eventInfo, 'capturing', this );
  41117. // The capture phase of the event.
  41118. if ( fireListenerFor( eventContexts, '$capture', eventInfo, ...eventArgs ) ) {
  41119. return eventInfo.return;
  41120. }
  41121. const startRange = eventInfo.startRange || this.selection.getFirstRange();
  41122. const selectedElement = startRange ? startRange.getContainedElement() : null;
  41123. const isCustomContext = selectedElement ? Boolean( getCustomContext( eventContexts, selectedElement ) ) : false;
  41124. let node = selectedElement || getDeeperRangeParent( startRange );
  41125. updateEventInfo( eventInfo, 'atTarget', node );
  41126. // For the not yet bubbling event trigger for $text node if selection can be there and it's not a custom context selected.
  41127. if ( !isCustomContext ) {
  41128. if ( fireListenerFor( eventContexts, '$text', eventInfo, ...eventArgs ) ) {
  41129. return eventInfo.return;
  41130. }
  41131. updateEventInfo( eventInfo, 'bubbling', node );
  41132. }
  41133. while ( node ) {
  41134. // Root node handling.
  41135. if ( node.is( 'rootElement' ) ) {
  41136. if ( fireListenerFor( eventContexts, '$root', eventInfo, ...eventArgs ) ) {
  41137. return eventInfo.return;
  41138. }
  41139. }
  41140. // Element node handling.
  41141. else if ( node.is( 'element' ) ) {
  41142. if ( fireListenerFor( eventContexts, node.name, eventInfo, ...eventArgs ) ) {
  41143. return eventInfo.return;
  41144. }
  41145. }
  41146. // Check custom contexts (i.e., a widget).
  41147. if ( fireListenerFor( eventContexts, node, eventInfo, ...eventArgs ) ) {
  41148. return eventInfo.return;
  41149. }
  41150. node = node.parent;
  41151. updateEventInfo( eventInfo, 'bubbling', node );
  41152. }
  41153. updateEventInfo( eventInfo, 'bubbling', this );
  41154. // Document context.
  41155. fireListenerFor( eventContexts, '$document', eventInfo, ...eventArgs );
  41156. return eventInfo.return;
  41157. } catch ( err ) {
  41158. // @if CK_DEBUG // throw err;
  41159. /* istanbul ignore next */
  41160. _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_1__["default"].rethrowUnexpectedError( err, this );
  41161. }
  41162. },
  41163. /**
  41164. * @inheritDoc
  41165. */
  41166. _addEventListener( event, callback, options ) {
  41167. const contexts = Object(_ckeditor_ckeditor5_utils_src_toarray__WEBPACK_IMPORTED_MODULE_3__["default"])( options.context || '$document' );
  41168. const eventContexts = getBubblingContexts( this );
  41169. for ( const context of contexts ) {
  41170. let emitter = eventContexts.get( context );
  41171. if ( !emitter ) {
  41172. emitter = Object.create( _ckeditor_ckeditor5_utils_src_emittermixin__WEBPACK_IMPORTED_MODULE_2__["default"] );
  41173. eventContexts.set( context, emitter );
  41174. }
  41175. this.listenTo( emitter, event, callback, options );
  41176. }
  41177. },
  41178. /**
  41179. * @inheritDoc
  41180. */
  41181. _removeEventListener( event, callback ) {
  41182. const eventContexts = getBubblingContexts( this );
  41183. for ( const emitter of eventContexts.values() ) {
  41184. this.stopListening( emitter, event, callback );
  41185. }
  41186. }
  41187. };
  41188. /* harmony default export */ __webpack_exports__["default"] = (BubblingEmitterMixin);
  41189. // Update the event info bubbling fields.
  41190. //
  41191. // @param {module:utils/eventinfo~EventInfo} eventInfo The event info object to update.
  41192. // @param {'none'|'capturing'|'atTarget'|'bubbling'} eventPhase The current event phase.
  41193. // @param {module:engine/view/document~Document|module:engine/view/node~Node} currentTarget The current bubbling target.
  41194. function updateEventInfo( eventInfo, eventPhase, currentTarget ) {
  41195. if ( eventInfo instanceof _bubblingeventinfo__WEBPACK_IMPORTED_MODULE_4__["default"] ) {
  41196. eventInfo._eventPhase = eventPhase;
  41197. eventInfo._currentTarget = currentTarget;
  41198. }
  41199. }
  41200. // Fires the listener for the specified context. Returns `true` if event was stopped.
  41201. //
  41202. // @private
  41203. // @param {Map.<String|Function, module:utils/emittermixin~Emitter>} eventContexts
  41204. // @param {String|module:engine/view/node~Node} context
  41205. // @param {module:utils/eventinfo~EventInfo} eventInfo The `EventInfo` object.
  41206. // @param {...*} [eventArgs] Additional arguments to be passed to the callbacks.
  41207. // @returns {Boolean} True if event stop was called.
  41208. function fireListenerFor( eventContexts, context, eventInfo, ...eventArgs ) {
  41209. const emitter = typeof context == 'string' ? eventContexts.get( context ) : getCustomContext( eventContexts, context );
  41210. if ( !emitter ) {
  41211. return false;
  41212. }
  41213. emitter.fire( eventInfo, ...eventArgs );
  41214. return eventInfo.stop.called;
  41215. }
  41216. // Returns an emitter for a specified view node.
  41217. //
  41218. // @private
  41219. // @param {Map.<String|Function, module:utils/emittermixin~Emitter>} eventContexts
  41220. // @param {module:engine/view/node~Node} node
  41221. // @returns {module:utils/emittermixin~Emitter|null}
  41222. function getCustomContext( eventContexts, node ) {
  41223. for ( const [ context, emitter ] of eventContexts ) {
  41224. if ( typeof context == 'function' && context( node ) ) {
  41225. return emitter;
  41226. }
  41227. }
  41228. return null;
  41229. }
  41230. // Returns bubbling contexts map for the source (emitter).
  41231. function getBubblingContexts( source ) {
  41232. if ( !source[ contextsSymbol ] ) {
  41233. source[ contextsSymbol ] = new Map();
  41234. }
  41235. return source[ contextsSymbol ];
  41236. }
  41237. // Returns the deeper parent element for the range.
  41238. function getDeeperRangeParent( range ) {
  41239. if ( !range ) {
  41240. return null;
  41241. }
  41242. const startParent = range.start.parent;
  41243. const endParent = range.end.parent;
  41244. const startPath = startParent.getPath();
  41245. const endPath = endParent.getPath();
  41246. return startPath.length > endPath.length ? startParent : endParent;
  41247. }
  41248. /**
  41249. * Bubbling emitter for the view document.
  41250. *
  41251. * Bubbling emitter is triggering events in the context of specified {@link module:engine/view/element~Element view element} name,
  41252. * predefined `'$text'`, `'$root'`, `'$document'` and `'$capture'` contexts, and context matchers provided as a function.
  41253. *
  41254. * Before bubbling starts, listeners for `'$capture'` context are triggered. Then the bubbling starts from the deeper selection
  41255. * position (by firing event on the `'$text'` context) and propagates the view document tree up to the `'$root'` and finally
  41256. * the listeners at `'$document'` context are fired (this is the default context).
  41257. *
  41258. * Examples:
  41259. *
  41260. * // Listeners registered in the context of the view element names:
  41261. * this.listenTo( viewDocument, 'enter', ( evt, data ) => {
  41262. * // ...
  41263. * }, { context: 'blockquote' } );
  41264. *
  41265. * this.listenTo( viewDocument, 'enter', ( evt, data ) => {
  41266. * // ...
  41267. * }, { context: 'li' } );
  41268. *
  41269. * // Listeners registered in the context of the '$text' and '$root' nodes.
  41270. * this.listenTo( view.document, 'arrowKey', ( evt, data ) => {
  41271. * // ...
  41272. * }, { context: '$text', priority: 'high' } );
  41273. *
  41274. * this.listenTo( view.document, 'arrowKey', ( evt, data ) => {
  41275. * // ...
  41276. * }, { context: '$root' } );
  41277. *
  41278. * // Listeners registered in the context of custom callback function.
  41279. * this.listenTo( view.document, 'arrowKey', ( evt, data ) => {
  41280. * // ...
  41281. * }, { context: isWidget } );
  41282. *
  41283. * this.listenTo( view.document, 'arrowKey', ( evt, data ) => {
  41284. * // ...
  41285. * }, { context: isWidget, priority: 'high' } );
  41286. *
  41287. * Example flow for selection in text:
  41288. *
  41289. * <blockquote><p>Foo[]bar</p></blockquote>
  41290. *
  41291. * Fired events on contexts:
  41292. * 1. `'$capture'`
  41293. * 2. `'$text'`
  41294. * 3. `'p'`
  41295. * 4. `'blockquote'`
  41296. * 5. `'$root'`
  41297. * 6. `'$document'`
  41298. *
  41299. * Example flow for selection on element (i.e., Widget):
  41300. *
  41301. * <blockquote><p>Foo[<widget/>]bar</p></blockquote>
  41302. *
  41303. * Fired events on contexts:
  41304. * 1. `'$capture'`
  41305. * 2. *widget* (custom matcher)
  41306. * 3. `'p'`
  41307. * 4. `'blockquote'`
  41308. * 5. `'$root'`
  41309. * 6. `'$document'`
  41310. *
  41311. * There could be multiple listeners registered for the same context and at different priority levels:
  41312. *
  41313. * <p>Foo[]bar</p>
  41314. *
  41315. * 1. `'$capture'` at priorities:
  41316. * 1. `'highest'`
  41317. * 2. `'high'`
  41318. * 3. `'normal'`
  41319. * 4. `'low'`
  41320. * 5. `'lowest'`
  41321. * 2. `'$text'` at priorities:
  41322. * 1. `'highest'`
  41323. * 2. `'high'`
  41324. * 3. `'normal'`
  41325. * 4. `'low'`
  41326. * 5. `'lowest'`
  41327. * 3. `'p'` at priorities:
  41328. * 1. `'highest'`
  41329. * 2. `'high'`
  41330. * 3. `'normal'`
  41331. * 4. `'low'`
  41332. * 5. `'lowest'`
  41333. * 4. `'$root'` at priorities:
  41334. * 1. `'highest'`
  41335. * 2. `'high'`
  41336. * 3. `'normal'`
  41337. * 4. `'low'`
  41338. * 5. `'lowest'`
  41339. * 5. `'$document'` at priorities:
  41340. * 1. `'highest'`
  41341. * 2. `'high'`
  41342. * 3. `'normal'`
  41343. * 4. `'low'`
  41344. * 5. `'lowest'`
  41345. *
  41346. * @interface BubblingEmitter
  41347. * @extends module:utils/emittermixin~Emitter
  41348. */
  41349. /***/ }),
  41350. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/bubblingeventinfo.js":
  41351. /*!****************************************************************************************!*\
  41352. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/bubblingeventinfo.js ***!
  41353. \****************************************************************************************/
  41354. /*! exports provided: default */
  41355. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  41356. "use strict";
  41357. __webpack_require__.r(__webpack_exports__);
  41358. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return BubblingEventInfo; });
  41359. /* harmony import */ var _ckeditor_ckeditor5_utils_src_eventinfo__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/eventinfo */ "./node_modules/@ckeditor/ckeditor5-utils/src/eventinfo.js");
  41360. /**
  41361. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  41362. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  41363. */
  41364. /**
  41365. * @module engine/view/observer/bubblingeventinfo
  41366. */
  41367. /**
  41368. * The event object passed to bubbling event callbacks. It is used to provide information about the event as well as a tool to
  41369. * manipulate it.
  41370. *
  41371. * @extends module:utils/eventinfo~EventInfo
  41372. */
  41373. class BubblingEventInfo extends _ckeditor_ckeditor5_utils_src_eventinfo__WEBPACK_IMPORTED_MODULE_0__["default"] {
  41374. /**
  41375. * @param {Object} source The emitter.
  41376. * @param {String} name The event name.
  41377. * @param {module:engine/view/range~Range} startRange The view range that the bubbling should start from.
  41378. */
  41379. constructor( source, name, startRange ) {
  41380. super( source, name );
  41381. /**
  41382. * The view range that the bubbling should start from.
  41383. *
  41384. * @readonly
  41385. * @member {module:engine/view/range~Range}
  41386. */
  41387. this.startRange = startRange;
  41388. /**
  41389. * The current event phase.
  41390. *
  41391. * @protected
  41392. * @member {'none'|'capturing'|'atTarget'|'bubbling'}
  41393. */
  41394. this._eventPhase = 'none';
  41395. /**
  41396. * The current bubbling target.
  41397. *
  41398. * @protected
  41399. * @member {module:engine/view/document~Document|module:engine/view/node~Node|null}
  41400. */
  41401. this._currentTarget = null;
  41402. }
  41403. /**
  41404. * The current event phase.
  41405. *
  41406. * @readonly
  41407. * @member {'none'|'capturing'|'atTarget'|'bubbling'}
  41408. */
  41409. get eventPhase() {
  41410. return this._eventPhase;
  41411. }
  41412. /**
  41413. * The current bubbling target.
  41414. *
  41415. * @readonly
  41416. * @member {module:engine/view/document~Document|module:engine/view/node~Node|null}
  41417. */
  41418. get currentTarget() {
  41419. return this._currentTarget;
  41420. }
  41421. }
  41422. /***/ }),
  41423. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/clickobserver.js":
  41424. /*!************************************************************************************!*\
  41425. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/clickobserver.js ***!
  41426. \************************************************************************************/
  41427. /*! exports provided: default */
  41428. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  41429. "use strict";
  41430. __webpack_require__.r(__webpack_exports__);
  41431. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ClickObserver; });
  41432. /* harmony import */ var _domeventobserver__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./domeventobserver */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/domeventobserver.js");
  41433. /**
  41434. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  41435. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  41436. */
  41437. /**
  41438. * @module engine/view/observer/clickobserver
  41439. */
  41440. /**
  41441. * {@link module:engine/view/document~Document#event:click Click} event observer.
  41442. *
  41443. * Note that this observer is not available by default. To make it available it needs to be added to
  41444. * {@link module:engine/view/view~View view controller}
  41445. * by a {@link module:engine/view/view~View#addObserver} method.
  41446. *
  41447. * @extends module:engine/view/observer/domeventobserver~DomEventObserver
  41448. */
  41449. class ClickObserver extends _domeventobserver__WEBPACK_IMPORTED_MODULE_0__["default"] {
  41450. constructor( view ) {
  41451. super( view );
  41452. this.domEventType = 'click';
  41453. }
  41454. onDomEvent( domEvent ) {
  41455. this.fire( domEvent.type, domEvent );
  41456. }
  41457. }
  41458. /**
  41459. * Fired when one of the editables has been clicked.
  41460. *
  41461. * Introduced by {@link module:engine/view/observer/clickobserver~ClickObserver}.
  41462. *
  41463. * Note that this event is not available by default. To make it available
  41464. * {@link module:engine/view/observer/clickobserver~ClickObserver} needs to be added
  41465. * to {@link module:engine/view/view~View} by a {@link module:engine/view/view~View#addObserver} method.
  41466. *
  41467. * @see module:engine/view/observer/clickobserver~ClickObserver
  41468. * @event module:engine/view/document~Document#event:click
  41469. * @param {module:engine/view/observer/domeventdata~DomEventData} data Event data.
  41470. */
  41471. /***/ }),
  41472. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/compositionobserver.js":
  41473. /*!******************************************************************************************!*\
  41474. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/compositionobserver.js ***!
  41475. \******************************************************************************************/
  41476. /*! exports provided: default */
  41477. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  41478. "use strict";
  41479. __webpack_require__.r(__webpack_exports__);
  41480. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return CompositionObserver; });
  41481. /* harmony import */ var _domeventobserver__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./domeventobserver */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/domeventobserver.js");
  41482. /**
  41483. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  41484. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  41485. */
  41486. /**
  41487. * @module engine/view/observer/compositionobserver
  41488. */
  41489. /**
  41490. * {@link module:engine/view/document~Document#event:compositionstart Compositionstart},
  41491. * {@link module:engine/view/document~Document#event:compositionupdate compositionupdate} and
  41492. * {@link module:engine/view/document~Document#event:compositionend compositionend} events observer.
  41493. *
  41494. * Note that this observer is attached by the {@link module:engine/view/view~View} and is available by default.
  41495. *
  41496. * @extends module:engine/view/observer/domeventobserver~DomEventObserver
  41497. */
  41498. class CompositionObserver extends _domeventobserver__WEBPACK_IMPORTED_MODULE_0__["default"] {
  41499. constructor( view ) {
  41500. super( view );
  41501. this.domEventType = [ 'compositionstart', 'compositionupdate', 'compositionend' ];
  41502. const document = this.document;
  41503. document.on( 'compositionstart', () => {
  41504. document.isComposing = true;
  41505. } );
  41506. document.on( 'compositionend', () => {
  41507. document.isComposing = false;
  41508. } );
  41509. }
  41510. onDomEvent( domEvent ) {
  41511. this.fire( domEvent.type, domEvent );
  41512. }
  41513. }
  41514. /**
  41515. * Fired when composition starts inside one of the editables.
  41516. *
  41517. * Introduced by {@link module:engine/view/observer/compositionobserver~CompositionObserver}.
  41518. *
  41519. * Note that because {@link module:engine/view/observer/compositionobserver~CompositionObserver} is attached by the
  41520. * {@link module:engine/view/view~View} this event is available by default.
  41521. *
  41522. * @see module:engine/view/observer/compositionobserver~CompositionObserver
  41523. * @event module:engine/view/document~Document#event:compositionstart
  41524. * @param {module:engine/view/observer/domeventdata~DomEventData} data Event data.
  41525. */
  41526. /**
  41527. * Fired when composition is updated inside one of the editables.
  41528. *
  41529. * Introduced by {@link module:engine/view/observer/compositionobserver~CompositionObserver}.
  41530. *
  41531. * Note that because {@link module:engine/view/observer/compositionobserver~CompositionObserver} is attached by the
  41532. * {@link module:engine/view/view~View} this event is available by default.
  41533. *
  41534. * @see module:engine/view/observer/compositionobserver~CompositionObserver
  41535. * @event module:engine/view/document~Document#event:compositionupdate
  41536. * @param {module:engine/view/observer/domeventdata~DomEventData} data Event data.
  41537. */
  41538. /**
  41539. * Fired when composition ends inside one of the editables.
  41540. *
  41541. * Introduced by {@link module:engine/view/observer/compositionobserver~CompositionObserver}.
  41542. *
  41543. * Note that because {@link module:engine/view/observer/compositionobserver~CompositionObserver} is attached by the
  41544. * {@link module:engine/view/view~View} this event is available by default.
  41545. *
  41546. * @see module:engine/view/observer/compositionobserver~CompositionObserver
  41547. * @event module:engine/view/document~Document#event:compositionend
  41548. * @param {module:engine/view/observer/domeventdata~DomEventData} data Event data.
  41549. */
  41550. /***/ }),
  41551. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/domeventdata.js":
  41552. /*!***********************************************************************************!*\
  41553. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/domeventdata.js ***!
  41554. \***********************************************************************************/
  41555. /*! exports provided: default */
  41556. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  41557. "use strict";
  41558. __webpack_require__.r(__webpack_exports__);
  41559. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return DomEventData; });
  41560. /* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash-es */ "./node_modules/lodash-es/lodash.js");
  41561. /**
  41562. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  41563. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  41564. */
  41565. /**
  41566. * @module engine/view/observer/domeventdata
  41567. */
  41568. /**
  41569. * Information about a DOM event in context of the {@link module:engine/view/document~Document}.
  41570. * It wraps the native event, which usually should not be used as the wrapper contains
  41571. * additional data (like key code for keyboard events).
  41572. */
  41573. class DomEventData {
  41574. /**
  41575. * @param {module:engine/view/view~View} view The instance of the view controller.
  41576. * @param {Event} domEvent The DOM event.
  41577. * @param {Object} [additionalData] Additional properties that the instance should contain.
  41578. */
  41579. constructor( view, domEvent, additionalData ) {
  41580. /**
  41581. * Instance of the view controller.
  41582. *
  41583. * @readonly
  41584. * @member {module:engine/view/view~View} module:engine/view/observer/observer~Observer.DomEvent#view
  41585. */
  41586. this.view = view;
  41587. /**
  41588. * The instance of the document.
  41589. *
  41590. * @readonly
  41591. * @member {module:engine/view/document~Document} module:engine/view/observer/observer~Observer.DomEvent#document
  41592. */
  41593. this.document = view.document;
  41594. /**
  41595. * The DOM event.
  41596. *
  41597. * @readonly
  41598. * @member {Event} module:engine/view/observer/observer~Observer.DomEvent#domEvent
  41599. */
  41600. this.domEvent = domEvent;
  41601. /**
  41602. * The DOM target.
  41603. *
  41604. * @readonly
  41605. * @member {HTMLElement} module:engine/view/observer/observer~Observer.DomEvent#target
  41606. */
  41607. this.domTarget = domEvent.target;
  41608. Object(lodash_es__WEBPACK_IMPORTED_MODULE_0__["extend"])( this, additionalData );
  41609. }
  41610. /**
  41611. * The tree view element representing the target.
  41612. *
  41613. * @readonly
  41614. * @type module:engine/view/element~Element
  41615. */
  41616. get target() {
  41617. return this.view.domConverter.mapDomToView( this.domTarget );
  41618. }
  41619. /**
  41620. * Prevents the native's event default action.
  41621. */
  41622. preventDefault() {
  41623. this.domEvent.preventDefault();
  41624. }
  41625. /**
  41626. * Stops native event propagation.
  41627. */
  41628. stopPropagation() {
  41629. this.domEvent.stopPropagation();
  41630. }
  41631. }
  41632. /***/ }),
  41633. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/domeventobserver.js":
  41634. /*!***************************************************************************************!*\
  41635. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/domeventobserver.js ***!
  41636. \***************************************************************************************/
  41637. /*! exports provided: default */
  41638. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  41639. "use strict";
  41640. __webpack_require__.r(__webpack_exports__);
  41641. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return DomEventObserver; });
  41642. /* harmony import */ var _observer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./observer */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/observer.js");
  41643. /* harmony import */ var _domeventdata__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./domeventdata */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/domeventdata.js");
  41644. /**
  41645. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  41646. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  41647. */
  41648. /**
  41649. * @module engine/view/observer/domeventobserver
  41650. */
  41651. /**
  41652. * Base class for DOM event observers. This class handles
  41653. * {@link module:engine/view/observer/observer~Observer#observe adding} listeners to DOM elements,
  41654. * {@link module:engine/view/observer/observer~Observer#disable disabling} and
  41655. * {@link module:engine/view/observer/observer~Observer#enable re-enabling} events.
  41656. * Child class needs to define
  41657. * {@link module:engine/view/observer/domeventobserver~DomEventObserver#domEventType DOM event type} and
  41658. * {@link module:engine/view/observer/domeventobserver~DomEventObserver#onDomEvent callback}.
  41659. *
  41660. * For instance:
  41661. *
  41662. * class ClickObserver extends DomEventObserver {
  41663. * // It can also be defined as a normal property in the constructor.
  41664. * get domEventType() {
  41665. * return 'click';
  41666. * }
  41667. *
  41668. * onDomEvent( domEvent ) {
  41669. * this.fire( 'click', domEvent );
  41670. * }
  41671. * }
  41672. *
  41673. * @extends module:engine/view/observer/observer~Observer
  41674. */
  41675. class DomEventObserver extends _observer__WEBPACK_IMPORTED_MODULE_0__["default"] {
  41676. /**
  41677. * Type of the DOM event the observer should listen to. Array of types can be defined
  41678. * if the observer should listen to multiple DOM events.
  41679. *
  41680. * @readonly
  41681. * @member {String|Array.<String>} #domEventType
  41682. */
  41683. /**
  41684. * Callback which should be called when the DOM event occurred. Note that the callback will not be called if
  41685. * observer {@link #isEnabled is not enabled}.
  41686. *
  41687. * @see #domEventType
  41688. * @abstract
  41689. * @method #onDomEvent
  41690. */
  41691. /**
  41692. * @inheritDoc
  41693. */
  41694. constructor( view ) {
  41695. super( view );
  41696. /**
  41697. * If set to `true` DOM events will be listened on the capturing phase.
  41698. * Default value is `false`.
  41699. *
  41700. * @member {Boolean}
  41701. */
  41702. this.useCapture = false;
  41703. }
  41704. /**
  41705. * @inheritDoc
  41706. */
  41707. observe( domElement ) {
  41708. const types = typeof this.domEventType == 'string' ? [ this.domEventType ] : this.domEventType;
  41709. types.forEach( type => {
  41710. this.listenTo( domElement, type, ( eventInfo, domEvent ) => {
  41711. if ( this.isEnabled && !this.checkShouldIgnoreEventFromTarget( domEvent.target ) ) {
  41712. this.onDomEvent( domEvent );
  41713. }
  41714. }, { useCapture: this.useCapture } );
  41715. } );
  41716. }
  41717. /**
  41718. * Calls `Document#fire()` if observer {@link #isEnabled is enabled}.
  41719. *
  41720. * @see module:utils/emittermixin~EmitterMixin#fire
  41721. * @param {String} eventType The event type (name).
  41722. * @param {Event} domEvent The DOM event.
  41723. * @param {Object} [additionalData] The additional data which should extend the
  41724. * {@link module:engine/view/observer/domeventdata~DomEventData event data} object.
  41725. */
  41726. fire( eventType, domEvent, additionalData ) {
  41727. if ( this.isEnabled ) {
  41728. this.document.fire( eventType, new _domeventdata__WEBPACK_IMPORTED_MODULE_1__["default"]( this.view, domEvent, additionalData ) );
  41729. }
  41730. }
  41731. }
  41732. /***/ }),
  41733. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/fakeselectionobserver.js":
  41734. /*!********************************************************************************************!*\
  41735. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/fakeselectionobserver.js ***!
  41736. \********************************************************************************************/
  41737. /*! exports provided: default */
  41738. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  41739. "use strict";
  41740. __webpack_require__.r(__webpack_exports__);
  41741. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return FakeSelectionObserver; });
  41742. /* harmony import */ var _observer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./observer */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/observer.js");
  41743. /* harmony import */ var _selection__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../selection */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/selection.js");
  41744. /* 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");
  41745. /* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! lodash-es */ "./node_modules/lodash-es/lodash.js");
  41746. /**
  41747. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  41748. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  41749. */
  41750. /**
  41751. * @module engine/view/observer/fakeselectionobserver
  41752. */
  41753. /**
  41754. * Fake selection observer class. If view selection is fake it is placed in dummy DOM container. This observer listens
  41755. * on {@link module:engine/view/document~Document#event:keydown keydown} events and handles moving fake view selection to the correct place
  41756. * if arrow keys are pressed.
  41757. * Fires {@link module:engine/view/document~Document#event:selectionChange selectionChange event} simulating natural behaviour of
  41758. * {@link module:engine/view/observer/selectionobserver~SelectionObserver SelectionObserver}.
  41759. *
  41760. * @extends module:engine/view/observer/observer~Observer
  41761. */
  41762. class FakeSelectionObserver extends _observer__WEBPACK_IMPORTED_MODULE_0__["default"] {
  41763. /**
  41764. * Creates new FakeSelectionObserver instance.
  41765. *
  41766. * @param {module:engine/view/view~View} view
  41767. */
  41768. constructor( view ) {
  41769. super( view );
  41770. /**
  41771. * Fires debounced event `selectionChangeDone`. It uses `lodash#debounce` method to delay function call.
  41772. *
  41773. * @private
  41774. * @param {Object} data Selection change data.
  41775. * @method #_fireSelectionChangeDoneDebounced
  41776. */
  41777. this._fireSelectionChangeDoneDebounced = Object(lodash_es__WEBPACK_IMPORTED_MODULE_3__["debounce"])( data => this.document.fire( 'selectionChangeDone', data ), 200 );
  41778. }
  41779. /**
  41780. * @inheritDoc
  41781. */
  41782. observe() {
  41783. const document = this.document;
  41784. document.on( 'arrowKey', ( eventInfo, data ) => {
  41785. const selection = document.selection;
  41786. if ( selection.isFake && this.isEnabled ) {
  41787. // Prevents default key down handling - no selection change will occur.
  41788. data.preventDefault();
  41789. }
  41790. }, { context: '$capture' } );
  41791. document.on( 'arrowKey', ( eventInfo, data ) => {
  41792. const selection = document.selection;
  41793. if ( selection.isFake && this.isEnabled ) {
  41794. this._handleSelectionMove( data.keyCode );
  41795. }
  41796. }, { priority: 'lowest' } );
  41797. }
  41798. /**
  41799. * @inheritDoc
  41800. */
  41801. destroy() {
  41802. super.destroy();
  41803. this._fireSelectionChangeDoneDebounced.cancel();
  41804. }
  41805. /**
  41806. * Handles collapsing view selection according to given key code. If left or up key is provided - new selection will be
  41807. * collapsed to left. If right or down key is pressed - new selection will be collapsed to right.
  41808. *
  41809. * This method fires {@link module:engine/view/document~Document#event:selectionChange} and
  41810. * {@link module:engine/view/document~Document#event:selectionChangeDone} events imitating behaviour of
  41811. * {@link module:engine/view/observer/selectionobserver~SelectionObserver}.
  41812. *
  41813. * @private
  41814. * @param {Number} keyCode
  41815. * @fires module:engine/view/document~Document#event:selectionChange
  41816. * @fires module:engine/view/document~Document#event:selectionChangeDone
  41817. */
  41818. _handleSelectionMove( keyCode ) {
  41819. const selection = this.document.selection;
  41820. const newSelection = new _selection__WEBPACK_IMPORTED_MODULE_1__["default"]( selection.getRanges(), { backward: selection.isBackward, fake: false } );
  41821. // Left or up arrow pressed - move selection to start.
  41822. 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 ) {
  41823. newSelection.setTo( newSelection.getFirstPosition() );
  41824. }
  41825. // Right or down arrow pressed - move selection to end.
  41826. 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 ) {
  41827. newSelection.setTo( newSelection.getLastPosition() );
  41828. }
  41829. const data = {
  41830. oldSelection: selection,
  41831. newSelection,
  41832. domSelection: null
  41833. };
  41834. // Fire dummy selection change event.
  41835. this.document.fire( 'selectionChange', data );
  41836. // Call` #_fireSelectionChangeDoneDebounced` every time when `selectionChange` event is fired.
  41837. // This function is debounced what means that `selectionChangeDone` event will be fired only when
  41838. // defined int the function time will elapse since the last time the function was called.
  41839. // So `selectionChangeDone` will be fired when selection will stop changing.
  41840. this._fireSelectionChangeDoneDebounced( data );
  41841. }
  41842. }
  41843. /***/ }),
  41844. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/focusobserver.js":
  41845. /*!************************************************************************************!*\
  41846. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/focusobserver.js ***!
  41847. \************************************************************************************/
  41848. /*! exports provided: default */
  41849. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  41850. "use strict";
  41851. __webpack_require__.r(__webpack_exports__);
  41852. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return FocusObserver; });
  41853. /* harmony import */ var _domeventobserver__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./domeventobserver */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/domeventobserver.js");
  41854. /**
  41855. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  41856. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  41857. */
  41858. /**
  41859. * @module engine/view/observer/focusobserver
  41860. */
  41861. /* globals setTimeout, clearTimeout */
  41862. /**
  41863. * {@link module:engine/view/document~Document#event:focus Focus}
  41864. * and {@link module:engine/view/document~Document#event:blur blur} events observer.
  41865. * Focus observer handle also {@link module:engine/view/rooteditableelement~RootEditableElement#isFocused isFocused} property of the
  41866. * {@link module:engine/view/rooteditableelement~RootEditableElement root elements}.
  41867. *
  41868. * Note that this observer is attached by the {@link module:engine/view/view~View} and is available by default.
  41869. *
  41870. * @extends module:engine/view/observer/domeventobserver~DomEventObserver
  41871. */
  41872. class FocusObserver extends _domeventobserver__WEBPACK_IMPORTED_MODULE_0__["default"] {
  41873. constructor( view ) {
  41874. super( view );
  41875. this.domEventType = [ 'focus', 'blur' ];
  41876. this.useCapture = true;
  41877. const document = this.document;
  41878. document.on( 'focus', () => {
  41879. document.isFocused = true;
  41880. // Unfortunately native `selectionchange` event is fired asynchronously.
  41881. // We need to wait until `SelectionObserver` handle the event and then render. Otherwise rendering will
  41882. // overwrite new DOM selection with selection from the view.
  41883. // See https://github.com/ckeditor/ckeditor5-engine/issues/795 for more details.
  41884. // Long timeout is needed to solve #676 and https://github.com/ckeditor/ckeditor5-engine/issues/1157 issues.
  41885. this._renderTimeoutId = setTimeout( () => view.forceRender(), 50 );
  41886. } );
  41887. document.on( 'blur', ( evt, data ) => {
  41888. const selectedEditable = document.selection.editableElement;
  41889. if ( selectedEditable === null || selectedEditable === data.target ) {
  41890. document.isFocused = false;
  41891. // Re-render the document to update view elements.
  41892. view.forceRender();
  41893. }
  41894. } );
  41895. /**
  41896. * Identifier of the timeout currently used by focus listener to delay rendering execution.
  41897. *
  41898. * @private
  41899. * @member {Number} #_renderTimeoutId
  41900. */
  41901. }
  41902. onDomEvent( domEvent ) {
  41903. this.fire( domEvent.type, domEvent );
  41904. }
  41905. /**
  41906. * @inheritDoc
  41907. */
  41908. destroy() {
  41909. if ( this._renderTimeoutId ) {
  41910. clearTimeout( this._renderTimeoutId );
  41911. }
  41912. super.destroy();
  41913. }
  41914. }
  41915. /**
  41916. * Fired when one of the editables gets focus.
  41917. *
  41918. * Introduced by {@link module:engine/view/observer/focusobserver~FocusObserver}.
  41919. *
  41920. * Note that because {@link module:engine/view/observer/focusobserver~FocusObserver} is attached by the
  41921. * {@link module:engine/view/view~View} this event is available by default.
  41922. *
  41923. * @see module:engine/view/observer/focusobserver~FocusObserver
  41924. * @event module:engine/view/document~Document#event:focus
  41925. * @param {module:engine/view/observer/domeventdata~DomEventData} data Event data.
  41926. */
  41927. /**
  41928. * Fired when one of the editables loses focus.
  41929. *
  41930. * Introduced by {@link module:engine/view/observer/focusobserver~FocusObserver}.
  41931. *
  41932. * Note that because {@link module:engine/view/observer/focusobserver~FocusObserver} is attached by the
  41933. * {@link module:engine/view/view~View} this event is available by default.
  41934. *
  41935. * @see module:engine/view/observer/focusobserver~FocusObserver
  41936. * @event module:engine/view/document~Document#event:blur
  41937. * @param {module:engine/view/observer/domeventdata~DomEventData} data Event data.
  41938. */
  41939. /***/ }),
  41940. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/inputobserver.js":
  41941. /*!************************************************************************************!*\
  41942. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/inputobserver.js ***!
  41943. \************************************************************************************/
  41944. /*! exports provided: default */
  41945. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  41946. "use strict";
  41947. __webpack_require__.r(__webpack_exports__);
  41948. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return InputObserver; });
  41949. /* harmony import */ var _domeventobserver__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./domeventobserver */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/domeventobserver.js");
  41950. /**
  41951. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  41952. * For licensing, see LICENSE.md.
  41953. */
  41954. /**
  41955. * @module engine/view/observer/inputobserver
  41956. */
  41957. /**
  41958. * Observer for events connected with data input.
  41959. *
  41960. * Note that this observer is attached by the {@link module:engine/view/view~View} and is available by default.
  41961. *
  41962. * @extends module:engine/view/observer/domeventobserver~DomEventObserver
  41963. */
  41964. class InputObserver extends _domeventobserver__WEBPACK_IMPORTED_MODULE_0__["default"] {
  41965. constructor( view ) {
  41966. super( view );
  41967. this.domEventType = [ 'beforeinput' ];
  41968. }
  41969. onDomEvent( domEvent ) {
  41970. this.fire( domEvent.type, domEvent );
  41971. }
  41972. }
  41973. /**
  41974. * Fired before browser inputs (or deletes) some data.
  41975. *
  41976. * This event is available only on browsers which support DOM `beforeinput` event.
  41977. *
  41978. * Introduced by {@link module:engine/view/observer/inputobserver~InputObserver}.
  41979. *
  41980. * Note that because {@link module:engine/view/observer/inputobserver~InputObserver} is attached by the
  41981. * {@link module:engine/view/view~View} this event is available by default.
  41982. *
  41983. * @see module:engine/view/observer/inputobserver~InputObserver
  41984. * @event module:engine/view/document~Document#event:beforeinput
  41985. * @param {module:engine/view/observer/domeventdata~DomEventData} data Event data.
  41986. */
  41987. /***/ }),
  41988. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/keyobserver.js":
  41989. /*!**********************************************************************************!*\
  41990. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/keyobserver.js ***!
  41991. \**********************************************************************************/
  41992. /*! exports provided: default */
  41993. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  41994. "use strict";
  41995. __webpack_require__.r(__webpack_exports__);
  41996. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return KeyObserver; });
  41997. /* harmony import */ var _domeventobserver__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./domeventobserver */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/domeventobserver.js");
  41998. /* 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");
  41999. /**
  42000. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  42001. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  42002. */
  42003. /**
  42004. * @module engine/view/observer/keyobserver
  42005. */
  42006. /**
  42007. * Observer for events connected with pressing keyboard keys.
  42008. *
  42009. * Note that this observer is attached by the {@link module:engine/view/view~View} and is available by default.
  42010. *
  42011. * @extends module:engine/view/observer/domeventobserver~DomEventObserver
  42012. */
  42013. class KeyObserver extends _domeventobserver__WEBPACK_IMPORTED_MODULE_0__["default"] {
  42014. constructor( view ) {
  42015. super( view );
  42016. this.domEventType = [ 'keydown', 'keyup' ];
  42017. }
  42018. onDomEvent( domEvt ) {
  42019. this.fire( domEvt.type, domEvt, {
  42020. keyCode: domEvt.keyCode,
  42021. altKey: domEvt.altKey,
  42022. ctrlKey: domEvt.ctrlKey,
  42023. shiftKey: domEvt.shiftKey,
  42024. metaKey: domEvt.metaKey,
  42025. get keystroke() {
  42026. return Object(_ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_1__["getCode"])( this );
  42027. }
  42028. } );
  42029. }
  42030. }
  42031. /**
  42032. * Fired when a key has been pressed.
  42033. *
  42034. * Introduced by {@link module:engine/view/observer/keyobserver~KeyObserver}.
  42035. *
  42036. * Note that because {@link module:engine/view/observer/keyobserver~KeyObserver} is attached by the
  42037. * {@link module:engine/view/view~View} this event is available by default.
  42038. *
  42039. * @see module:engine/view/observer/keyobserver~KeyObserver
  42040. * @event module:engine/view/document~Document#event:keydown
  42041. * @param {module:engine/view/observer/keyobserver~KeyEventData} keyEventData
  42042. */
  42043. /**
  42044. * Fired when a key has been released.
  42045. *
  42046. * Introduced by {@link module:engine/view/observer/keyobserver~KeyObserver}.
  42047. *
  42048. * Note that because {@link module:engine/view/observer/keyobserver~KeyObserver} is attached by the
  42049. * {@link module:engine/view/view~View} this event is available by default.
  42050. *
  42051. * @see module:engine/view/observer/keyobserver~KeyObserver
  42052. * @event module:engine/view/document~Document#event:keyup
  42053. * @param {module:engine/view/observer/keyobserver~KeyEventData} keyEventData
  42054. */
  42055. /**
  42056. * The value of both events - {@link module:engine/view/document~Document#event:keydown} and
  42057. * {@link module:engine/view/document~Document#event:keyup}.
  42058. *
  42059. * @class module:engine/view/observer/keyobserver~KeyEventData
  42060. * @extends module:engine/view/observer/domeventdata~DomEventData
  42061. * @implements module:utils/keyboard~KeystrokeInfo
  42062. */
  42063. /**
  42064. * Code of the whole keystroke. See {@link module:utils/keyboard~getCode}.
  42065. *
  42066. * @readonly
  42067. * @member {Number} module:engine/view/observer/keyobserver~KeyEventData#keystroke
  42068. */
  42069. /***/ }),
  42070. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/mouseobserver.js":
  42071. /*!************************************************************************************!*\
  42072. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/mouseobserver.js ***!
  42073. \************************************************************************************/
  42074. /*! exports provided: default */
  42075. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  42076. "use strict";
  42077. __webpack_require__.r(__webpack_exports__);
  42078. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return MouseObserver; });
  42079. /* harmony import */ var _domeventobserver__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./domeventobserver */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/domeventobserver.js");
  42080. /**
  42081. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  42082. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  42083. */
  42084. /**
  42085. * @module engine/view/observer/mouseobserver
  42086. */
  42087. /**
  42088. * Mouse events observer.
  42089. *
  42090. * Note that this observer is not available by default. To make it available it needs to be added to
  42091. * {@link module:engine/view/view~View} by {@link module:engine/view/view~View#addObserver} method.
  42092. *
  42093. * @extends module:engine/view/observer/domeventobserver~DomEventObserver
  42094. */
  42095. class MouseObserver extends _domeventobserver__WEBPACK_IMPORTED_MODULE_0__["default"] {
  42096. constructor( view ) {
  42097. super( view );
  42098. this.domEventType = [ 'mousedown', 'mouseup', 'mouseover', 'mouseout' ];
  42099. }
  42100. onDomEvent( domEvent ) {
  42101. this.fire( domEvent.type, domEvent );
  42102. }
  42103. }
  42104. /**
  42105. * Fired when the mouse button is pressed down on one of the editing roots of the editor.
  42106. *
  42107. * Introduced by {@link module:engine/view/observer/mouseobserver~MouseObserver}.
  42108. *
  42109. * Note that this event is not available by default. To make it available, {@link module:engine/view/observer/mouseobserver~MouseObserver}
  42110. * needs to be added to {@link module:engine/view/view~View} by the {@link module:engine/view/view~View#addObserver} method.
  42111. *
  42112. * @see module:engine/view/observer/mouseobserver~MouseObserver
  42113. * @event module:engine/view/document~Document#event:mousedown
  42114. * @param {module:engine/view/observer/domeventdata~DomEventData} data The event data.
  42115. */
  42116. /**
  42117. * Fired when the mouse button is released over one of the editing roots of the editor.
  42118. *
  42119. * Introduced by {@link module:engine/view/observer/mouseobserver~MouseObserver}.
  42120. *
  42121. * Note that this event is not available by default. To make it available, {@link module:engine/view/observer/mouseobserver~MouseObserver}
  42122. * needs to be added to {@link module:engine/view/view~View} by the {@link module:engine/view/view~View#addObserver} method.
  42123. *
  42124. * @see module:engine/view/observer/mouseobserver~MouseObserver
  42125. * @event module:engine/view/document~Document#event:mouseup
  42126. * @param {module:engine/view/observer/domeventdata~DomEventData} data The event data.
  42127. */
  42128. /***/ }),
  42129. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/mutationobserver.js":
  42130. /*!***************************************************************************************!*\
  42131. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/mutationobserver.js ***!
  42132. \***************************************************************************************/
  42133. /*! exports provided: default */
  42134. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  42135. "use strict";
  42136. __webpack_require__.r(__webpack_exports__);
  42137. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return MutationObserver; });
  42138. /* harmony import */ var _observer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./observer */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/observer.js");
  42139. /* harmony import */ var _selection__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../selection */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/selection.js");
  42140. /* harmony import */ var _filler__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../filler */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/filler.js");
  42141. /* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! lodash-es */ "./node_modules/lodash-es/lodash.js");
  42142. /**
  42143. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  42144. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  42145. */
  42146. /**
  42147. * @module engine/view/observer/mutationobserver
  42148. */
  42149. /* globals window */
  42150. /**
  42151. * Mutation observer class observes changes in the DOM, fires {@link module:engine/view/document~Document#event:mutations} event, mark view
  42152. * elements as changed and call {@link module:engine/view/renderer~Renderer#render}.
  42153. * Because all mutated nodes are marked as "to be rendered" and the
  42154. * {@link module:engine/view/renderer~Renderer#render} is called, all changes will be reverted, unless the mutation will be handled by the
  42155. * {@link module:engine/view/document~Document#event:mutations} event listener. It means user will see only handled changes, and the editor
  42156. * will block all changes which are not handled.
  42157. *
  42158. * Mutation Observer also take care of reducing number of mutations which are fired. It removes duplicates and
  42159. * mutations on elements which do not have corresponding view elements. Also
  42160. * {@link module:engine/view/observer/mutationobserver~MutatedText text mutation} is fired only if parent element do not change child list.
  42161. *
  42162. * Note that this observer is attached by the {@link module:engine/view/view~View} and is available by default.
  42163. *
  42164. * @extends module:engine/view/observer/observer~Observer
  42165. */
  42166. class MutationObserver extends _observer__WEBPACK_IMPORTED_MODULE_0__["default"] {
  42167. constructor( view ) {
  42168. super( view );
  42169. /**
  42170. * Native mutation observer config.
  42171. *
  42172. * @private
  42173. * @member {Object}
  42174. */
  42175. this._config = {
  42176. childList: true,
  42177. characterData: true,
  42178. characterDataOldValue: true,
  42179. subtree: true
  42180. };
  42181. /**
  42182. * Reference to the {@link module:engine/view/view~View#domConverter}.
  42183. *
  42184. * @member {module:engine/view/domconverter~DomConverter}
  42185. */
  42186. this.domConverter = view.domConverter;
  42187. /**
  42188. * Reference to the {@link module:engine/view/view~View#_renderer}.
  42189. *
  42190. * @member {module:engine/view/renderer~Renderer}
  42191. */
  42192. this.renderer = view._renderer;
  42193. /**
  42194. * Observed DOM elements.
  42195. *
  42196. * @private
  42197. * @member {Array.<HTMLElement>}
  42198. */
  42199. this._domElements = [];
  42200. /**
  42201. * Native mutation observer.
  42202. *
  42203. * @private
  42204. * @member {MutationObserver}
  42205. */
  42206. this._mutationObserver = new window.MutationObserver( this._onMutations.bind( this ) );
  42207. }
  42208. /**
  42209. * Synchronously fires {@link module:engine/view/document~Document#event:mutations} event with all mutations in record queue.
  42210. * At the same time empties the queue so mutations will not be fired twice.
  42211. */
  42212. flush() {
  42213. this._onMutations( this._mutationObserver.takeRecords() );
  42214. }
  42215. /**
  42216. * @inheritDoc
  42217. */
  42218. observe( domElement ) {
  42219. this._domElements.push( domElement );
  42220. if ( this.isEnabled ) {
  42221. this._mutationObserver.observe( domElement, this._config );
  42222. }
  42223. }
  42224. /**
  42225. * @inheritDoc
  42226. */
  42227. enable() {
  42228. super.enable();
  42229. for ( const domElement of this._domElements ) {
  42230. this._mutationObserver.observe( domElement, this._config );
  42231. }
  42232. }
  42233. /**
  42234. * @inheritDoc
  42235. */
  42236. disable() {
  42237. super.disable();
  42238. this._mutationObserver.disconnect();
  42239. }
  42240. /**
  42241. * @inheritDoc
  42242. */
  42243. destroy() {
  42244. super.destroy();
  42245. this._mutationObserver.disconnect();
  42246. }
  42247. /**
  42248. * Handles mutations. Deduplicates, mark view elements to sync, fire event and call render.
  42249. *
  42250. * @private
  42251. * @param {Array.<Object>} domMutations Array of native mutations.
  42252. */
  42253. _onMutations( domMutations ) {
  42254. // As a result of this.flush() we can have an empty collection.
  42255. if ( domMutations.length === 0 ) {
  42256. return;
  42257. }
  42258. const domConverter = this.domConverter;
  42259. // Use map and set for deduplication.
  42260. const mutatedTexts = new Map();
  42261. const mutatedElements = new Set();
  42262. // Handle `childList` mutations first, so we will be able to check if the `characterData` mutation is in the
  42263. // element with changed structure anyway.
  42264. for ( const mutation of domMutations ) {
  42265. if ( mutation.type === 'childList' ) {
  42266. const element = domConverter.mapDomToView( mutation.target );
  42267. // Do not collect mutations from UIElements and RawElements.
  42268. if ( element && ( element.is( 'uiElement' ) || element.is( 'rawElement' ) ) ) {
  42269. continue;
  42270. }
  42271. if ( element && !this._isBogusBrMutation( mutation ) ) {
  42272. mutatedElements.add( element );
  42273. }
  42274. }
  42275. }
  42276. // Handle `characterData` mutations later, when we have the full list of nodes which changed structure.
  42277. for ( const mutation of domMutations ) {
  42278. const element = domConverter.mapDomToView( mutation.target );
  42279. // Do not collect mutations from UIElements and RawElements.
  42280. if ( element && ( element.is( 'uiElement' ) || element.is( 'rawElement' ) ) ) {
  42281. continue;
  42282. }
  42283. if ( mutation.type === 'characterData' ) {
  42284. const text = domConverter.findCorrespondingViewText( mutation.target );
  42285. if ( text && !mutatedElements.has( text.parent ) ) {
  42286. // Use text as a key, for deduplication. If there will be another mutation on the same text element
  42287. // we will have only one in the map.
  42288. mutatedTexts.set( text, {
  42289. type: 'text',
  42290. oldText: text.data,
  42291. newText: Object(_filler__WEBPACK_IMPORTED_MODULE_2__["getDataWithoutFiller"])( mutation.target ),
  42292. node: text
  42293. } );
  42294. }
  42295. // When we added first letter to the text node which had only inline filler, for the DOM it is mutation
  42296. // on text, but for the view, where filler text node did not existed, new text node was created, so we
  42297. // need to fire 'children' mutation instead of 'text'.
  42298. else if ( !text && Object(_filler__WEBPACK_IMPORTED_MODULE_2__["startsWithFiller"])( mutation.target ) ) {
  42299. mutatedElements.add( domConverter.mapDomToView( mutation.target.parentNode ) );
  42300. }
  42301. }
  42302. }
  42303. // Now we build the list of mutations to fire and mark elements. We did not do it earlier to avoid marking the
  42304. // same node multiple times in case of duplication.
  42305. // List of mutations we will fire.
  42306. const viewMutations = [];
  42307. for ( const mutatedText of mutatedTexts.values() ) {
  42308. this.renderer.markToSync( 'text', mutatedText.node );
  42309. viewMutations.push( mutatedText );
  42310. }
  42311. for ( const viewElement of mutatedElements ) {
  42312. const domElement = domConverter.mapViewToDom( viewElement );
  42313. const viewChildren = Array.from( viewElement.getChildren() );
  42314. const newViewChildren = Array.from( domConverter.domChildrenToView( domElement, { withChildren: false } ) );
  42315. // It may happen that as a result of many changes (sth was inserted and then removed),
  42316. // both elements haven't really changed. #1031
  42317. if ( !Object(lodash_es__WEBPACK_IMPORTED_MODULE_3__["isEqualWith"])( viewChildren, newViewChildren, sameNodes ) ) {
  42318. this.renderer.markToSync( 'children', viewElement );
  42319. viewMutations.push( {
  42320. type: 'children',
  42321. oldChildren: viewChildren,
  42322. newChildren: newViewChildren,
  42323. node: viewElement
  42324. } );
  42325. }
  42326. }
  42327. // Retrieve `domSelection` using `ownerDocument` of one of mutated nodes.
  42328. // There should not be simultaneous mutation in multiple documents, so it's fine.
  42329. const domSelection = domMutations[ 0 ].target.ownerDocument.getSelection();
  42330. let viewSelection = null;
  42331. if ( domSelection && domSelection.anchorNode ) {
  42332. // If `domSelection` is inside a dom node that is already bound to a view node from view tree, get
  42333. // corresponding selection in the view and pass it together with `viewMutations`. The `viewSelection` may
  42334. // be used by features handling mutations.
  42335. // Only one range is supported.
  42336. const viewSelectionAnchor = domConverter.domPositionToView( domSelection.anchorNode, domSelection.anchorOffset );
  42337. const viewSelectionFocus = domConverter.domPositionToView( domSelection.focusNode, domSelection.focusOffset );
  42338. // Anchor and focus has to be properly mapped to view.
  42339. if ( viewSelectionAnchor && viewSelectionFocus ) {
  42340. viewSelection = new _selection__WEBPACK_IMPORTED_MODULE_1__["default"]( viewSelectionAnchor );
  42341. viewSelection.setFocus( viewSelectionFocus );
  42342. }
  42343. }
  42344. // In case only non-relevant mutations were recorded it skips the event and force render (#5600).
  42345. if ( viewMutations.length ) {
  42346. this.document.fire( 'mutations', viewMutations, viewSelection );
  42347. // If nothing changes on `mutations` event, at this point we have "dirty DOM" (changed) and de-synched
  42348. // view (which has not been changed). In order to "reset DOM" we render the view again.
  42349. this.view.forceRender();
  42350. }
  42351. function sameNodes( child1, child2 ) {
  42352. // First level of comparison (array of children vs array of children) – use the Lodash's default behavior.
  42353. if ( Array.isArray( child1 ) ) {
  42354. return;
  42355. }
  42356. // Elements.
  42357. if ( child1 === child2 ) {
  42358. return true;
  42359. }
  42360. // Texts.
  42361. else if ( child1.is( '$text' ) && child2.is( '$text' ) ) {
  42362. return child1.data === child2.data;
  42363. }
  42364. // Not matching types.
  42365. return false;
  42366. }
  42367. }
  42368. /**
  42369. * Checks if mutation was generated by the browser inserting bogus br on the end of the block element.
  42370. * Such mutations are generated while pressing space or performing native spellchecker correction
  42371. * on the end of the block element in Firefox browser.
  42372. *
  42373. * @private
  42374. * @param {Object} mutation Native mutation object.
  42375. * @returns {Boolean}
  42376. */
  42377. _isBogusBrMutation( mutation ) {
  42378. let addedNode = null;
  42379. // Check if mutation added only one node on the end of its parent.
  42380. if ( mutation.nextSibling === null && mutation.removedNodes.length === 0 && mutation.addedNodes.length == 1 ) {
  42381. addedNode = this.domConverter.domToView( mutation.addedNodes[ 0 ], {
  42382. withChildren: false
  42383. } );
  42384. }
  42385. return addedNode && addedNode.is( 'element', 'br' );
  42386. }
  42387. }
  42388. /**
  42389. * Fired when mutation occurred. If tree view is not changed on this event, DOM will be reverted to the state before
  42390. * mutation, so all changes which should be applied, should be handled on this event.
  42391. *
  42392. * Introduced by {@link module:engine/view/observer/mutationobserver~MutationObserver}.
  42393. *
  42394. * Note that because {@link module:engine/view/observer/mutationobserver~MutationObserver} is attached by the
  42395. * {@link module:engine/view/view~View} this event is available by default.
  42396. *
  42397. * @see module:engine/view/observer/mutationobserver~MutationObserver
  42398. * @event module:engine/view/document~Document#event:mutations
  42399. * @param {Array.<module:engine/view/observer/mutationobserver~MutatedText|module:engine/view/observer/mutationobserver~MutatedChildren>}
  42400. * viewMutations Array of mutations.
  42401. * For mutated texts it will be {@link module:engine/view/observer/mutationobserver~MutatedText} and for mutated elements it will be
  42402. * {@link module:engine/view/observer/mutationobserver~MutatedChildren}. You can recognize the type based on the `type` property.
  42403. * @param {module:engine/view/selection~Selection|null} viewSelection View selection that is a result of converting DOM selection to view.
  42404. * Keep in
  42405. * mind that the DOM selection is already "updated", meaning that it already acknowledges changes done in mutation.
  42406. */
  42407. /**
  42408. * Mutation item for text.
  42409. *
  42410. * @see module:engine/view/document~Document#event:mutations
  42411. * @see module:engine/view/observer/mutationobserver~MutatedChildren
  42412. *
  42413. * @typedef {Object} module:engine/view/observer/mutationobserver~MutatedText
  42414. *
  42415. * @property {String} type For text mutations it is always 'text'.
  42416. * @property {module:engine/view/text~Text} node Mutated text node.
  42417. * @property {String} oldText Old text.
  42418. * @property {String} newText New text.
  42419. */
  42420. /**
  42421. * Mutation item for child nodes.
  42422. *
  42423. * @see module:engine/view/document~Document#event:mutations
  42424. * @see module:engine/view/observer/mutationobserver~MutatedText
  42425. *
  42426. * @typedef {Object} module:engine/view/observer/mutationobserver~MutatedChildren
  42427. *
  42428. * @property {String} type For child nodes mutations it is always 'children'.
  42429. * @property {module:engine/view/element~Element} node Parent of the mutated children.
  42430. * @property {Array.<module:engine/view/node~Node>} oldChildren Old child nodes.
  42431. * @property {Array.<module:engine/view/node~Node>} newChildren New child nodes.
  42432. */
  42433. /***/ }),
  42434. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/observer.js":
  42435. /*!*******************************************************************************!*\
  42436. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/observer.js ***!
  42437. \*******************************************************************************/
  42438. /*! exports provided: default */
  42439. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  42440. "use strict";
  42441. __webpack_require__.r(__webpack_exports__);
  42442. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Observer; });
  42443. /* 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");
  42444. /* 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");
  42445. /**
  42446. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  42447. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  42448. */
  42449. /**
  42450. * @module engine/view/observer/observer
  42451. */
  42452. /**
  42453. * Abstract base observer class. Observers are classes which listen to DOM events, do the preliminary
  42454. * processing and fire events on the {@link module:engine/view/document~Document} objects.
  42455. * Observers can also add features to the view, for instance by updating its status or marking elements
  42456. * which need a refresh on DOM events.
  42457. *
  42458. * @abstract
  42459. */
  42460. class Observer {
  42461. /**
  42462. * Creates an instance of the observer.
  42463. *
  42464. * @param {module:engine/view/view~View} view
  42465. */
  42466. constructor( view ) {
  42467. /**
  42468. * An instance of the view controller.
  42469. *
  42470. * @readonly
  42471. * @member {module:engine/view/view~View}
  42472. */
  42473. this.view = view;
  42474. /**
  42475. * A reference to the {@link module:engine/view/document~Document} object.
  42476. *
  42477. * @readonly
  42478. * @member {module:engine/view/document~Document}
  42479. */
  42480. this.document = view.document;
  42481. /**
  42482. * The state of the observer. If it is disabled, no events will be fired.
  42483. *
  42484. * @readonly
  42485. * @member {Boolean}
  42486. */
  42487. this.isEnabled = false;
  42488. }
  42489. /**
  42490. * Enables the observer. This method is called when the observer is registered to the
  42491. * {@link module:engine/view/view~View} and after {@link module:engine/view/view~View#forceRender rendering}
  42492. * (all observers are {@link #disable disabled} before rendering).
  42493. *
  42494. * A typical use case for disabling observers is that mutation observers need to be disabled for the rendering.
  42495. * However, a child class may not need to be disabled, so it can implement an empty method.
  42496. *
  42497. * @see module:engine/view/observer/observer~Observer#disable
  42498. */
  42499. enable() {
  42500. this.isEnabled = true;
  42501. }
  42502. /**
  42503. * Disables the observer. This method is called before
  42504. * {@link module:engine/view/view~View#forceRender rendering} to prevent firing events during rendering.
  42505. *
  42506. * @see module:engine/view/observer/observer~Observer#enable
  42507. */
  42508. disable() {
  42509. this.isEnabled = false;
  42510. }
  42511. /**
  42512. * Disables and destroys the observer, among others removes event listeners created by the observer.
  42513. */
  42514. destroy() {
  42515. this.disable();
  42516. this.stopListening();
  42517. }
  42518. /**
  42519. * Checks whether a given DOM event should be ignored (should not be turned into a synthetic view document event).
  42520. *
  42521. * Currently, an event will be ignored only if its target or any of its ancestors has the `data-cke-ignore-events` attribute.
  42522. * This attribute can be used inside the structures generated by
  42523. * {@link module:engine/view/downcastwriter~DowncastWriter#createUIElement `DowncastWriter#createUIElement()`} to ignore events
  42524. * fired within a UI that should be excluded from CKEditor 5's realms.
  42525. *
  42526. * @param {Node} domTarget The DOM event target to check (usually an element, sometimes a text node and
  42527. * potentially sometimes a document, too).
  42528. * @returns {Boolean} Whether this event should be ignored by the observer.
  42529. */
  42530. checkShouldIgnoreEventFromTarget( domTarget ) {
  42531. if ( domTarget && domTarget.nodeType === 3 ) {
  42532. domTarget = domTarget.parentNode;
  42533. }
  42534. if ( !domTarget || domTarget.nodeType !== 1 ) {
  42535. return false;
  42536. }
  42537. return domTarget.matches( '[data-cke-ignore-events], [data-cke-ignore-events] *' );
  42538. }
  42539. /**
  42540. * Starts observing the given root element.
  42541. *
  42542. * @method #observe
  42543. * @param {HTMLElement} domElement
  42544. * @param {String} name The name of the root element.
  42545. */
  42546. }
  42547. Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_1__["default"])( Observer, _ckeditor_ckeditor5_utils_src_dom_emittermixin__WEBPACK_IMPORTED_MODULE_0__["default"] );
  42548. /***/ }),
  42549. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/selectionobserver.js":
  42550. /*!****************************************************************************************!*\
  42551. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/selectionobserver.js ***!
  42552. \****************************************************************************************/
  42553. /*! exports provided: default */
  42554. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  42555. "use strict";
  42556. __webpack_require__.r(__webpack_exports__);
  42557. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return SelectionObserver; });
  42558. /* harmony import */ var _observer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./observer */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/observer.js");
  42559. /* harmony import */ var _mutationobserver__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./mutationobserver */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/mutationobserver.js");
  42560. /* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lodash-es */ "./node_modules/lodash-es/lodash.js");
  42561. /**
  42562. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  42563. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  42564. */
  42565. /**
  42566. * @module engine/view/observer/selectionobserver
  42567. */
  42568. /* global setInterval, clearInterval */
  42569. /**
  42570. * Selection observer class observes selection changes in the document. If a selection changes on the document this
  42571. * observer checks if there are any mutations and if the DOM selection is different from the
  42572. * {@link module:engine/view/document~Document#selection view selection}. The selection observer fires
  42573. * {@link module:engine/view/document~Document#event:selectionChange} event only if a selection change was the only change in the document
  42574. * and the DOM selection is different then the view selection.
  42575. *
  42576. * Note that this observer is attached by the {@link module:engine/view/view~View} and is available by default.
  42577. *
  42578. * @see module:engine/view/observer/mutationobserver~MutationObserver
  42579. * @extends module:engine/view/observer/observer~Observer
  42580. */
  42581. class SelectionObserver extends _observer__WEBPACK_IMPORTED_MODULE_0__["default"] {
  42582. constructor( view ) {
  42583. super( view );
  42584. /**
  42585. * Instance of the mutation observer. Selection observer calls
  42586. * {@link module:engine/view/observer/mutationobserver~MutationObserver#flush} to ensure that the mutations will be handled
  42587. * before the {@link module:engine/view/document~Document#event:selectionChange} event is fired.
  42588. *
  42589. * @readonly
  42590. * @member {module:engine/view/observer/mutationobserver~MutationObserver}
  42591. * module:engine/view/observer/selectionobserver~SelectionObserver#mutationObserver
  42592. */
  42593. this.mutationObserver = view.getObserver( _mutationobserver__WEBPACK_IMPORTED_MODULE_1__["default"] );
  42594. /**
  42595. * Reference to the view {@link module:engine/view/documentselection~DocumentSelection} object used to compare
  42596. * new selection with it.
  42597. *
  42598. * @readonly
  42599. * @member {module:engine/view/documentselection~DocumentSelection}
  42600. * module:engine/view/observer/selectionobserver~SelectionObserver#selection
  42601. */
  42602. this.selection = this.document.selection;
  42603. /* eslint-disable max-len */
  42604. /**
  42605. * Reference to the {@link module:engine/view/view~View#domConverter}.
  42606. *
  42607. * @readonly
  42608. * @member {module:engine/view/domconverter~DomConverter} module:engine/view/observer/selectionobserver~SelectionObserver#domConverter
  42609. */
  42610. /* eslint-enable max-len */
  42611. this.domConverter = view.domConverter;
  42612. /**
  42613. * A set of documents which have added `selectionchange` listener to avoid adding a listener twice to the same
  42614. * document.
  42615. *
  42616. * @private
  42617. * @member {WeakSet.<Document>} module:engine/view/observer/selectionobserver~SelectionObserver#_documents
  42618. */
  42619. this._documents = new WeakSet();
  42620. /**
  42621. * Fires debounced event `selectionChangeDone`. It uses `lodash#debounce` method to delay function call.
  42622. *
  42623. * @private
  42624. * @param {Object} data Selection change data.
  42625. * @method #_fireSelectionChangeDoneDebounced
  42626. */
  42627. this._fireSelectionChangeDoneDebounced = Object(lodash_es__WEBPACK_IMPORTED_MODULE_2__["debounce"])( data => this.document.fire( 'selectionChangeDone', data ), 200 );
  42628. this._clearInfiniteLoopInterval = setInterval( () => this._clearInfiniteLoop(), 1000 );
  42629. /**
  42630. * Private property to check if the code does not enter infinite loop.
  42631. *
  42632. * @private
  42633. * @member {Number} module:engine/view/observer/selectionobserver~SelectionObserver#_loopbackCounter
  42634. */
  42635. this._loopbackCounter = 0;
  42636. }
  42637. /**
  42638. * @inheritDoc
  42639. */
  42640. observe( domElement ) {
  42641. const domDocument = domElement.ownerDocument;
  42642. // Add listener once per each document.
  42643. if ( this._documents.has( domDocument ) ) {
  42644. return;
  42645. }
  42646. this.listenTo( domDocument, 'selectionchange', ( evt, domEvent ) => {
  42647. this._handleSelectionChange( domEvent, domDocument );
  42648. } );
  42649. this._documents.add( domDocument );
  42650. }
  42651. /**
  42652. * @inheritDoc
  42653. */
  42654. destroy() {
  42655. super.destroy();
  42656. clearInterval( this._clearInfiniteLoopInterval );
  42657. this._fireSelectionChangeDoneDebounced.cancel();
  42658. }
  42659. /**
  42660. * Selection change listener. {@link module:engine/view/observer/mutationobserver~MutationObserver#flush Flush} mutations, check if
  42661. * a selection changes and fires {@link module:engine/view/document~Document#event:selectionChange} event on every change
  42662. * and {@link module:engine/view/document~Document#event:selectionChangeDone} when a selection stop changing.
  42663. *
  42664. * @private
  42665. * @param {Event} domEvent DOM event.
  42666. * @param {Document} domDocument DOM document.
  42667. */
  42668. _handleSelectionChange( domEvent, domDocument ) {
  42669. if ( !this.isEnabled ) {
  42670. return;
  42671. }
  42672. const domSelection = domDocument.defaultView.getSelection();
  42673. if ( this.checkShouldIgnoreEventFromTarget( domSelection.anchorNode ) ) {
  42674. return;
  42675. }
  42676. // Ensure the mutation event will be before selection event on all browsers.
  42677. this.mutationObserver.flush();
  42678. // If there were mutations then the view will be re-rendered by the mutation observer and the selection
  42679. // will be updated, so the selections will equal and the event will not be fired, as expected.
  42680. const newViewSelection = this.domConverter.domSelectionToView( domSelection );
  42681. // Do not convert selection change if the new view selection has no ranges in it.
  42682. //
  42683. // It means that the DOM selection is in some way incorrect. Ranges that were in the DOM selection could not be
  42684. // converted to the view. This happens when the DOM selection was moved outside of the editable element.
  42685. if ( newViewSelection.rangeCount == 0 ) {
  42686. this.view.hasDomSelection = false;
  42687. return;
  42688. }
  42689. this.view.hasDomSelection = true;
  42690. if ( this.selection.isEqual( newViewSelection ) && this.domConverter.isDomSelectionCorrect( domSelection ) ) {
  42691. return;
  42692. }
  42693. // Ensure we are not in the infinite loop (#400).
  42694. // This counter is reset each second. 60 selection changes in 1 second is enough high number
  42695. // to be very difficult (impossible) to achieve using just keyboard keys (during normal editor use).
  42696. if ( ++this._loopbackCounter > 60 ) {
  42697. // Selection change observer detected an infinite rendering loop.
  42698. // Most probably you try to put the selection in the position which is not allowed
  42699. // by the browser and browser fixes it automatically what causes `selectionchange` event on
  42700. // which a loopback through a model tries to re-render the wrong selection and again.
  42701. //
  42702. // @if CK_DEBUG // console.warn( 'Selection change observer detected an infinite rendering loop.' );
  42703. return;
  42704. }
  42705. if ( this.selection.isSimilar( newViewSelection ) ) {
  42706. // If selection was equal and we are at this point of algorithm, it means that it was incorrect.
  42707. // Just re-render it, no need to fire any events, etc.
  42708. this.view.forceRender();
  42709. } else {
  42710. const data = {
  42711. oldSelection: this.selection,
  42712. newSelection: newViewSelection,
  42713. domSelection
  42714. };
  42715. // Prepare data for new selection and fire appropriate events.
  42716. this.document.fire( 'selectionChange', data );
  42717. // Call `#_fireSelectionChangeDoneDebounced` every time when `selectionChange` event is fired.
  42718. // This function is debounced what means that `selectionChangeDone` event will be fired only when
  42719. // defined int the function time will elapse since the last time the function was called.
  42720. // So `selectionChangeDone` will be fired when selection will stop changing.
  42721. this._fireSelectionChangeDoneDebounced( data );
  42722. }
  42723. }
  42724. /**
  42725. * Clears `SelectionObserver` internal properties connected with preventing infinite loop.
  42726. *
  42727. * @protected
  42728. */
  42729. _clearInfiniteLoop() {
  42730. this._loopbackCounter = 0;
  42731. }
  42732. }
  42733. /**
  42734. * Fired when a selection has changed. This event is fired only when the selection change was the only change that happened
  42735. * in the document, and the old selection is different then the new selection.
  42736. *
  42737. * Introduced by {@link module:engine/view/observer/selectionobserver~SelectionObserver}.
  42738. *
  42739. * Note that because {@link module:engine/view/observer/selectionobserver~SelectionObserver} is attached by the
  42740. * {@link module:engine/view/view~View} this event is available by default.
  42741. *
  42742. * @see module:engine/view/observer/selectionobserver~SelectionObserver
  42743. * @event module:engine/view/document~Document#event:selectionChange
  42744. * @param {Object} data
  42745. * @param {module:engine/view/documentselection~DocumentSelection} data.oldSelection Old View selection which is
  42746. * {@link module:engine/view/document~Document#selection}.
  42747. * @param {module:engine/view/selection~Selection} data.newSelection New View selection which is converted DOM selection.
  42748. * @param {Selection} data.domSelection Native DOM selection.
  42749. */
  42750. /**
  42751. * Fired when selection stops changing.
  42752. *
  42753. * Introduced by {@link module:engine/view/observer/selectionobserver~SelectionObserver}.
  42754. *
  42755. * Note that because {@link module:engine/view/observer/selectionobserver~SelectionObserver} is attached by the
  42756. * {@link module:engine/view/view~View} this event is available by default.
  42757. *
  42758. * @see module:engine/view/observer/selectionobserver~SelectionObserver
  42759. * @event module:engine/view/document~Document#event:selectionChangeDone
  42760. * @param {Object} data
  42761. * @param {module:engine/view/documentselection~DocumentSelection} data.oldSelection Old View selection which is
  42762. * {@link module:engine/view/document~Document#selection}.
  42763. * @param {module:engine/view/selection~Selection} data.newSelection New View selection which is converted DOM selection.
  42764. * @param {Selection} data.domSelection Native DOM selection.
  42765. */
  42766. /***/ }),
  42767. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/placeholder.js":
  42768. /*!*************************************************************************!*\
  42769. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/placeholder.js ***!
  42770. \*************************************************************************/
  42771. /*! exports provided: enablePlaceholder, disablePlaceholder, showPlaceholder, hidePlaceholder, needsPlaceholder */
  42772. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  42773. "use strict";
  42774. __webpack_require__.r(__webpack_exports__);
  42775. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "enablePlaceholder", function() { return enablePlaceholder; });
  42776. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "disablePlaceholder", function() { return disablePlaceholder; });
  42777. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "showPlaceholder", function() { return showPlaceholder; });
  42778. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "hidePlaceholder", function() { return hidePlaceholder; });
  42779. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "needsPlaceholder", function() { return needsPlaceholder; });
  42780. /* harmony import */ var _theme_placeholder_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../theme/placeholder.css */ "./node_modules/@ckeditor/ckeditor5-engine/theme/placeholder.css");
  42781. /* harmony import */ var _theme_placeholder_css__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_theme_placeholder_css__WEBPACK_IMPORTED_MODULE_0__);
  42782. /**
  42783. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  42784. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  42785. */
  42786. /**
  42787. * @module engine/view/placeholder
  42788. */
  42789. // Each document stores information about its placeholder elements and check functions.
  42790. const documentPlaceholders = new WeakMap();
  42791. /**
  42792. * A helper that enables a placeholder on the provided view element (also updates its visibility).
  42793. * The placeholder is a CSS pseudo–element (with a text content) attached to the element.
  42794. *
  42795. * To change the placeholder text, simply call this method again with new options.
  42796. *
  42797. * To disable the placeholder, use {@link module:engine/view/placeholder~disablePlaceholder `disablePlaceholder()`} helper.
  42798. *
  42799. * @param {Object} [options] Configuration options of the placeholder.
  42800. * @param {module:engine/view/view~View} options.view Editing view instance.
  42801. * @param {module:engine/view/element~Element} options.element Element that will gain a placeholder.
  42802. * See `options.isDirectHost` to learn more.
  42803. * @param {String} options.text Placeholder text.
  42804. * @param {Boolean} [options.isDirectHost=true] If set `false`, the placeholder will not be enabled directly
  42805. * in the passed `element` but in one of its children (selected automatically, i.e. a first empty child element).
  42806. * Useful when attaching placeholders to elements that can host other elements (not just text), for instance,
  42807. * editable root elements.
  42808. * @param {Boolean} [options.keepOnFocus=false] If set `true`, the placeholder stay visible when the host element is focused.
  42809. */
  42810. function enablePlaceholder( options ) {
  42811. const { view, element, text, isDirectHost = true, keepOnFocus = false } = options;
  42812. const doc = view.document;
  42813. // Use a single a single post fixer per—document to update all placeholders.
  42814. if ( !documentPlaceholders.has( doc ) ) {
  42815. documentPlaceholders.set( doc, new Map() );
  42816. // If a post-fixer callback makes a change, it should return `true` so other post–fixers
  42817. // can re–evaluate the document again.
  42818. doc.registerPostFixer( writer => updateDocumentPlaceholders( doc, writer ) );
  42819. }
  42820. // Store information about the element placeholder under its document.
  42821. documentPlaceholders.get( doc ).set( element, {
  42822. text,
  42823. isDirectHost,
  42824. keepOnFocus,
  42825. hostElement: isDirectHost ? element : null
  42826. } );
  42827. // Update the placeholders right away.
  42828. view.change( writer => updateDocumentPlaceholders( doc, writer ) );
  42829. }
  42830. /**
  42831. * Disables the placeholder functionality from a given element.
  42832. *
  42833. * See {@link module:engine/view/placeholder~enablePlaceholder `enablePlaceholder()`} to learn more.
  42834. *
  42835. * @param {module:engine/view/view~View} view
  42836. * @param {module:engine/view/element~Element} element
  42837. */
  42838. function disablePlaceholder( view, element ) {
  42839. const doc = element.document;
  42840. view.change( writer => {
  42841. if ( !documentPlaceholders.has( doc ) ) {
  42842. return;
  42843. }
  42844. const placeholders = documentPlaceholders.get( doc );
  42845. const config = placeholders.get( element );
  42846. writer.removeAttribute( 'data-placeholder', config.hostElement );
  42847. hidePlaceholder( writer, config.hostElement );
  42848. placeholders.delete( element );
  42849. } );
  42850. }
  42851. /**
  42852. * Shows a placeholder in the provided element by changing related attributes and CSS classes.
  42853. *
  42854. * **Note**: This helper will not update the placeholder visibility nor manage the
  42855. * it in any way in the future. What it does is a one–time state change of an element. Use
  42856. * {@link module:engine/view/placeholder~enablePlaceholder `enablePlaceholder()`} and
  42857. * {@link module:engine/view/placeholder~disablePlaceholder `disablePlaceholder()`} for full
  42858. * placeholder functionality.
  42859. *
  42860. * **Note**: This helper will blindly show the placeholder directly in the root editable element if
  42861. * one is passed, which could result in a visual clash if the editable element has some children
  42862. * (for instance, an empty paragraph). Use {@link module:engine/view/placeholder~enablePlaceholder `enablePlaceholder()`}
  42863. * in that case or make sure the correct element is passed to the helper.
  42864. *
  42865. * @param {module:engine/view/downcastwriter~DowncastWriter} writer
  42866. * @param {module:engine/view/element~Element} element
  42867. * @returns {Boolean} `true`, if any changes were made to the `element`.
  42868. */
  42869. function showPlaceholder( writer, element ) {
  42870. if ( !element.hasClass( 'ck-placeholder' ) ) {
  42871. writer.addClass( 'ck-placeholder', element );
  42872. return true;
  42873. }
  42874. return false;
  42875. }
  42876. /**
  42877. * Hides a placeholder in the element by changing related attributes and CSS classes.
  42878. *
  42879. * **Note**: This helper will not update the placeholder visibility nor manage the
  42880. * it in any way in the future. What it does is a one–time state change of an element. Use
  42881. * {@link module:engine/view/placeholder~enablePlaceholder `enablePlaceholder()`} and
  42882. * {@link module:engine/view/placeholder~disablePlaceholder `disablePlaceholder()`} for full
  42883. * placeholder functionality.
  42884. *
  42885. * @param {module:engine/view/downcastwriter~DowncastWriter} writer
  42886. * @param {module:engine/view/element~Element} element
  42887. * @returns {Boolean} `true`, if any changes were made to the `element`.
  42888. */
  42889. function hidePlaceholder( writer, element ) {
  42890. if ( element.hasClass( 'ck-placeholder' ) ) {
  42891. writer.removeClass( 'ck-placeholder', element );
  42892. return true;
  42893. }
  42894. return false;
  42895. }
  42896. /**
  42897. * Checks if a placeholder should be displayed in the element.
  42898. *
  42899. * **Note**: This helper will blindly check the possibility of showing a placeholder directly in the
  42900. * root editable element if one is passed, which may not be the expected result. If an element can
  42901. * host other elements (not just text), most likely one of its children should be checked instead
  42902. * because it will be the final host for the placeholder. Use
  42903. * {@link module:engine/view/placeholder~enablePlaceholder `enablePlaceholder()`} in that case or make
  42904. * sure the correct element is passed to the helper.
  42905. *
  42906. * @param {module:engine/view/element~Element} element Element that holds the placeholder.
  42907. * @param {Boolean} keepOnFocus Focusing the element will keep the placeholder visible.
  42908. * @returns {Boolean}
  42909. */
  42910. function needsPlaceholder( element, keepOnFocus ) {
  42911. if ( !element.isAttached() ) {
  42912. return false;
  42913. }
  42914. // Anything but uiElement(s) counts as content.
  42915. const hasContent = Array.from( element.getChildren() )
  42916. .some( element => !element.is( 'uiElement' ) );
  42917. if ( hasContent ) {
  42918. return false;
  42919. }
  42920. // Skip the focus check and make the placeholder visible already regardless of document focus state.
  42921. if ( keepOnFocus ) {
  42922. return true;
  42923. }
  42924. const doc = element.document;
  42925. // If the document is blurred.
  42926. if ( !doc.isFocused ) {
  42927. return true;
  42928. }
  42929. const viewSelection = doc.selection;
  42930. const selectionAnchor = viewSelection.anchor;
  42931. // If document is focused and the element is empty but the selection is not anchored inside it.
  42932. return selectionAnchor && selectionAnchor.parent !== element;
  42933. }
  42934. // Updates all placeholders associated with a document in a post–fixer callback.
  42935. //
  42936. // @private
  42937. // @param { module:engine/view/document~Document} doc
  42938. // @param {module:engine/view/downcastwriter~DowncastWriter} writer
  42939. // @returns {Boolean} True if any changes were made to the view document.
  42940. function updateDocumentPlaceholders( doc, writer ) {
  42941. const placeholders = documentPlaceholders.get( doc );
  42942. const directHostElements = [];
  42943. let wasViewModified = false;
  42944. // First set placeholders on the direct hosts.
  42945. for ( const [ element, config ] of placeholders ) {
  42946. if ( config.isDirectHost ) {
  42947. directHostElements.push( element );
  42948. if ( updatePlaceholder( writer, element, config ) ) {
  42949. wasViewModified = true;
  42950. }
  42951. }
  42952. }
  42953. // Then set placeholders on the indirect hosts but only on those that does not already have an direct host placeholder.
  42954. for ( const [ element, config ] of placeholders ) {
  42955. if ( config.isDirectHost ) {
  42956. continue;
  42957. }
  42958. const hostElement = getChildPlaceholderHostSubstitute( element );
  42959. // When not a direct host, it could happen that there is no child element
  42960. // capable of displaying a placeholder.
  42961. if ( !hostElement ) {
  42962. continue;
  42963. }
  42964. // Don't override placeholder if the host element already has some direct placeholder.
  42965. if ( directHostElements.includes( hostElement ) ) {
  42966. continue;
  42967. }
  42968. // Update the host element (used for setting and removing the placeholder).
  42969. config.hostElement = hostElement;
  42970. if ( updatePlaceholder( writer, element, config ) ) {
  42971. wasViewModified = true;
  42972. }
  42973. }
  42974. return wasViewModified;
  42975. }
  42976. // Updates a single placeholder in a post–fixer callback.
  42977. //
  42978. // @private
  42979. // @param {module:engine/view/downcastwriter~DowncastWriter} writer
  42980. // @param {module:engine/view/element~Element} element
  42981. // @param {Object} config Configuration of the placeholder
  42982. // @param {String} config.text
  42983. // @param {Boolean} config.isDirectHost
  42984. // @returns {Boolean} True if any changes were made to the view document.
  42985. function updatePlaceholder( writer, element, config ) {
  42986. const { text, isDirectHost, hostElement } = config;
  42987. let wasViewModified = false;
  42988. // This may be necessary when updating the placeholder text to something else.
  42989. if ( hostElement.getAttribute( 'data-placeholder' ) !== text ) {
  42990. writer.setAttribute( 'data-placeholder', text, hostElement );
  42991. wasViewModified = true;
  42992. }
  42993. // If the host element is not a direct host then placeholder is needed only when there is only one element.
  42994. const isOnlyChild = isDirectHost || element.childCount == 1;
  42995. if ( isOnlyChild && needsPlaceholder( hostElement, config.keepOnFocus ) ) {
  42996. if ( showPlaceholder( writer, hostElement ) ) {
  42997. wasViewModified = true;
  42998. }
  42999. } else if ( hidePlaceholder( writer, hostElement ) ) {
  43000. wasViewModified = true;
  43001. }
  43002. return wasViewModified;
  43003. }
  43004. // Gets a child element capable of displaying a placeholder if a parent element can host more
  43005. // than just text (for instance, when it is a root editable element). The child element
  43006. // can then be used in other placeholder helpers as a substitute of its parent.
  43007. //
  43008. // @private
  43009. // @param {module:engine/view/element~Element} parent
  43010. // @returns {module:engine/view/element~Element|null}
  43011. function getChildPlaceholderHostSubstitute( parent ) {
  43012. if ( parent.childCount ) {
  43013. const firstChild = parent.getChild( 0 );
  43014. if ( firstChild.is( 'element' ) && !firstChild.is( 'uiElement' ) ) {
  43015. return firstChild;
  43016. }
  43017. }
  43018. return null;
  43019. }
  43020. /***/ }),
  43021. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/position.js":
  43022. /*!**********************************************************************!*\
  43023. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/position.js ***!
  43024. \**********************************************************************/
  43025. /*! exports provided: default */
  43026. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  43027. "use strict";
  43028. __webpack_require__.r(__webpack_exports__);
  43029. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Position; });
  43030. /* harmony import */ var _treewalker__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./treewalker */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/treewalker.js");
  43031. /* 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");
  43032. /* 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");
  43033. /* harmony import */ var _editableelement__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./editableelement */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/editableelement.js");
  43034. /* 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");
  43035. /**
  43036. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  43037. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  43038. */
  43039. /**
  43040. * @module engine/view/position
  43041. */
  43042. // To check if component is loaded more than once.
  43043. /**
  43044. * Position in the view tree. Position is represented by its parent node and an offset in this parent.
  43045. *
  43046. * In order to create a new position instance use the `createPosition*()` factory methods available in:
  43047. *
  43048. * * {@link module:engine/view/view~View}
  43049. * * {@link module:engine/view/downcastwriter~DowncastWriter}
  43050. * * {@link module:engine/view/upcastwriter~UpcastWriter}
  43051. */
  43052. class Position {
  43053. /**
  43054. * Creates a position.
  43055. *
  43056. * @param {module:engine/view/node~Node|module:engine/view/documentfragment~DocumentFragment} parent Position parent.
  43057. * @param {Number} offset Position offset.
  43058. */
  43059. constructor( parent, offset ) {
  43060. /**
  43061. * Position parent.
  43062. *
  43063. * @readonly
  43064. * @member {module:engine/view/node~Node|module:engine/view/documentfragment~DocumentFragment}
  43065. * module:engine/view/position~Position#parent
  43066. */
  43067. this.parent = parent;
  43068. /**
  43069. * Position offset.
  43070. *
  43071. * @readonly
  43072. * @member {Number} module:engine/view/position~Position#offset
  43073. */
  43074. this.offset = offset;
  43075. }
  43076. /**
  43077. * Node directly after the position. Equals `null` when there is no node after position or position is located
  43078. * inside text node.
  43079. *
  43080. * @readonly
  43081. * @type {module:engine/view/node~Node|null}
  43082. */
  43083. get nodeAfter() {
  43084. if ( this.parent.is( '$text' ) ) {
  43085. return null;
  43086. }
  43087. return this.parent.getChild( this.offset ) || null;
  43088. }
  43089. /**
  43090. * Node directly before the position. Equals `null` when there is no node before position or position is located
  43091. * inside text node.
  43092. *
  43093. * @readonly
  43094. * @type {module:engine/view/node~Node|null}
  43095. */
  43096. get nodeBefore() {
  43097. if ( this.parent.is( '$text' ) ) {
  43098. return null;
  43099. }
  43100. return this.parent.getChild( this.offset - 1 ) || null;
  43101. }
  43102. /**
  43103. * Is `true` if position is at the beginning of its {@link module:engine/view/position~Position#parent parent}, `false` otherwise.
  43104. *
  43105. * @readonly
  43106. * @type {Boolean}
  43107. */
  43108. get isAtStart() {
  43109. return this.offset === 0;
  43110. }
  43111. /**
  43112. * Is `true` if position is at the end of its {@link module:engine/view/position~Position#parent parent}, `false` otherwise.
  43113. *
  43114. * @readonly
  43115. * @type {Boolean}
  43116. */
  43117. get isAtEnd() {
  43118. const endOffset = this.parent.is( '$text' ) ? this.parent.data.length : this.parent.childCount;
  43119. return this.offset === endOffset;
  43120. }
  43121. /**
  43122. * Position's root, that is the root of the position's parent element.
  43123. *
  43124. * @readonly
  43125. * @type {module:engine/view/node~Node|module:engine/view/documentfragment~DocumentFragment}
  43126. */
  43127. get root() {
  43128. return this.parent.root;
  43129. }
  43130. /**
  43131. * {@link module:engine/view/editableelement~EditableElement EditableElement} instance that contains this position, or `null` if
  43132. * position is not inside an editable element.
  43133. *
  43134. * @type {module:engine/view/editableelement~EditableElement|null}
  43135. */
  43136. get editableElement() {
  43137. let editable = this.parent;
  43138. while ( !( editable instanceof _editableelement__WEBPACK_IMPORTED_MODULE_3__["default"] ) ) {
  43139. if ( editable.parent ) {
  43140. editable = editable.parent;
  43141. } else {
  43142. return null;
  43143. }
  43144. }
  43145. return editable;
  43146. }
  43147. /**
  43148. * Returns a new instance of Position with offset incremented by `shift` value.
  43149. *
  43150. * @param {Number} shift How position offset should get changed. Accepts negative values.
  43151. * @returns {module:engine/view/position~Position} Shifted position.
  43152. */
  43153. getShiftedBy( shift ) {
  43154. const shifted = Position._createAt( this );
  43155. const offset = shifted.offset + shift;
  43156. shifted.offset = offset < 0 ? 0 : offset;
  43157. return shifted;
  43158. }
  43159. /**
  43160. * Gets the farthest position which matches the callback using
  43161. * {@link module:engine/view/treewalker~TreeWalker TreeWalker}.
  43162. *
  43163. * For example:
  43164. *
  43165. * getLastMatchingPosition( value => value.type == 'text' ); // <p>{}foo</p> -> <p>foo[]</p>
  43166. * getLastMatchingPosition( value => value.type == 'text', { direction: 'backward' } ); // <p>foo[]</p> -> <p>{}foo</p>
  43167. * getLastMatchingPosition( value => false ); // Do not move the position.
  43168. *
  43169. * @param {Function} skip Callback function. Gets {@link module:engine/view/treewalker~TreeWalkerValue} and should
  43170. * return `true` if the value should be skipped or `false` if not.
  43171. * @param {Object} options Object with configuration options. See {@link module:engine/view/treewalker~TreeWalker}.
  43172. *
  43173. * @returns {module:engine/view/position~Position} The position after the last item which matches the `skip` callback test.
  43174. */
  43175. getLastMatchingPosition( skip, options = {} ) {
  43176. options.startPosition = this;
  43177. const treeWalker = new _treewalker__WEBPACK_IMPORTED_MODULE_0__["default"]( options );
  43178. treeWalker.skip( skip );
  43179. return treeWalker.position;
  43180. }
  43181. /**
  43182. * Returns ancestors array of this position, that is this position's parent and it's ancestors.
  43183. *
  43184. * @returns {Array} Array with ancestors.
  43185. */
  43186. getAncestors() {
  43187. if ( this.parent.is( 'documentFragment' ) ) {
  43188. return [ this.parent ];
  43189. } else {
  43190. return this.parent.getAncestors( { includeSelf: true } );
  43191. }
  43192. }
  43193. /**
  43194. * Returns a {@link module:engine/view/node~Node} or {@link module:engine/view/documentfragment~DocumentFragment}
  43195. * which is a common ancestor of both positions.
  43196. *
  43197. * @param {module:engine/view/position~Position} position
  43198. * @returns {module:engine/view/node~Node|module:engine/view/documentfragment~DocumentFragment|null}
  43199. */
  43200. getCommonAncestor( position ) {
  43201. const ancestorsA = this.getAncestors();
  43202. const ancestorsB = position.getAncestors();
  43203. let i = 0;
  43204. while ( ancestorsA[ i ] == ancestorsB[ i ] && ancestorsA[ i ] ) {
  43205. i++;
  43206. }
  43207. return i === 0 ? null : ancestorsA[ i - 1 ];
  43208. }
  43209. /**
  43210. * Checks whether this object is of the given type.
  43211. *
  43212. * position.is( 'position' ); // -> true
  43213. * position.is( 'view:position' ); // -> true
  43214. *
  43215. * position.is( 'model:position' ); // -> false
  43216. * position.is( 'element' ); // -> false
  43217. * position.is( 'range' ); // -> false
  43218. *
  43219. * {@link module:engine/view/node~Node#is Check the entire list of view objects} which implement the `is()` method.
  43220. *
  43221. * @param {String} type
  43222. * @returns {Boolean}
  43223. */
  43224. is( type ) {
  43225. return type === 'position' || type === 'view:position';
  43226. }
  43227. /**
  43228. * Checks whether this position equals given position.
  43229. *
  43230. * @param {module:engine/view/position~Position} otherPosition Position to compare with.
  43231. * @returns {Boolean} True if positions are same.
  43232. */
  43233. isEqual( otherPosition ) {
  43234. return ( this.parent == otherPosition.parent && this.offset == otherPosition.offset );
  43235. }
  43236. /**
  43237. * Checks whether this position is located before given position. When method returns `false` it does not mean that
  43238. * this position is after give one. Two positions may be located inside separate roots and in that situation this
  43239. * method will still return `false`.
  43240. *
  43241. * @see module:engine/view/position~Position#isAfter
  43242. * @see module:engine/view/position~Position#compareWith
  43243. * @param {module:engine/view/position~Position} otherPosition Position to compare with.
  43244. * @returns {Boolean} Returns `true` if this position is before given position.
  43245. */
  43246. isBefore( otherPosition ) {
  43247. return this.compareWith( otherPosition ) == 'before';
  43248. }
  43249. /**
  43250. * Checks whether this position is located after given position. When method returns `false` it does not mean that
  43251. * this position is before give one. Two positions may be located inside separate roots and in that situation this
  43252. * method will still return `false`.
  43253. *
  43254. * @see module:engine/view/position~Position#isBefore
  43255. * @see module:engine/view/position~Position#compareWith
  43256. * @param {module:engine/view/position~Position} otherPosition Position to compare with.
  43257. * @returns {Boolean} Returns `true` if this position is after given position.
  43258. */
  43259. isAfter( otherPosition ) {
  43260. return this.compareWith( otherPosition ) == 'after';
  43261. }
  43262. /**
  43263. * Checks whether this position is before, after or in same position that other position. Two positions may be also
  43264. * different when they are located in separate roots.
  43265. *
  43266. * @param {module:engine/view/position~Position} otherPosition Position to compare with.
  43267. * @returns {module:engine/view/position~PositionRelation}
  43268. */
  43269. compareWith( otherPosition ) {
  43270. if ( this.root !== otherPosition.root ) {
  43271. return 'different';
  43272. }
  43273. if ( this.isEqual( otherPosition ) ) {
  43274. return 'same';
  43275. }
  43276. // Get path from root to position's parent element.
  43277. const thisPath = this.parent.is( 'node' ) ? this.parent.getPath() : [];
  43278. const otherPath = otherPosition.parent.is( 'node' ) ? otherPosition.parent.getPath() : [];
  43279. // Add the positions' offsets to the parents offsets.
  43280. thisPath.push( this.offset );
  43281. otherPath.push( otherPosition.offset );
  43282. // Compare both path arrays to find common ancestor.
  43283. const result = Object(_ckeditor_ckeditor5_utils_src_comparearrays__WEBPACK_IMPORTED_MODULE_1__["default"])( thisPath, otherPath );
  43284. switch ( result ) {
  43285. case 'prefix':
  43286. return 'before';
  43287. case 'extension':
  43288. return 'after';
  43289. default:
  43290. return thisPath[ result ] < otherPath[ result ] ? 'before' : 'after';
  43291. }
  43292. }
  43293. /**
  43294. * Creates a {@link module:engine/view/treewalker~TreeWalker TreeWalker} instance with this positions as a start position.
  43295. *
  43296. * @param {Object} options Object with configuration options. See {@link module:engine/view/treewalker~TreeWalker}
  43297. * @param {module:engine/view/range~Range} [options.boundaries=null] Range to define boundaries of the iterator.
  43298. * @param {Boolean} [options.singleCharacters=false]
  43299. * @param {Boolean} [options.shallow=false]
  43300. * @param {Boolean} [options.ignoreElementEnd=false]
  43301. */
  43302. getWalker( options = {} ) {
  43303. options.startPosition = this;
  43304. return new _treewalker__WEBPACK_IMPORTED_MODULE_0__["default"]( options );
  43305. }
  43306. clone() {
  43307. return new Position( this.parent, this.offset );
  43308. }
  43309. /**
  43310. * Creates position at the given location. The location can be specified as:
  43311. *
  43312. * * a {@link module:engine/view/position~Position position},
  43313. * * parent element and offset (offset defaults to `0`),
  43314. * * parent element and `'end'` (sets position at the end of that element),
  43315. * * {@link module:engine/view/item~Item view item} and `'before'` or `'after'` (sets position before or after given view item).
  43316. *
  43317. * This method is a shortcut to other constructors such as:
  43318. *
  43319. * * {@link module:engine/view/position~Position._createBefore},
  43320. * * {@link module:engine/view/position~Position._createAfter}.
  43321. *
  43322. * @protected
  43323. * @param {module:engine/view/item~Item|module:engine/view/position~Position} itemOrPosition
  43324. * @param {Number|'end'|'before'|'after'} [offset] Offset or one of the flags. Used only when
  43325. * first parameter is a {@link module:engine/view/item~Item view item}.
  43326. */
  43327. static _createAt( itemOrPosition, offset ) {
  43328. if ( itemOrPosition instanceof Position ) {
  43329. return new this( itemOrPosition.parent, itemOrPosition.offset );
  43330. } else {
  43331. const node = itemOrPosition;
  43332. if ( offset == 'end' ) {
  43333. offset = node.is( '$text' ) ? node.data.length : node.childCount;
  43334. } else if ( offset == 'before' ) {
  43335. return this._createBefore( node );
  43336. } else if ( offset == 'after' ) {
  43337. return this._createAfter( node );
  43338. } else if ( offset !== 0 && !offset ) {
  43339. /**
  43340. * {@link module:engine/view/view~View#createPositionAt `View#createPositionAt()`}
  43341. * requires the offset to be specified when the first parameter is a view item.
  43342. *
  43343. * @error view-createpositionat-offset-required
  43344. */
  43345. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__["default"]( 'view-createpositionat-offset-required', node );
  43346. }
  43347. return new Position( node, offset );
  43348. }
  43349. }
  43350. /**
  43351. * Creates a new position after given view item.
  43352. *
  43353. * @protected
  43354. * @param {module:engine/view/item~Item} item View item after which the position should be located.
  43355. * @returns {module:engine/view/position~Position}
  43356. */
  43357. static _createAfter( item ) {
  43358. // TextProxy is not a instance of Node so we need do handle it in specific way.
  43359. if ( item.is( '$textProxy' ) ) {
  43360. return new Position( item.textNode, item.offsetInText + item.data.length );
  43361. }
  43362. if ( !item.parent ) {
  43363. /**
  43364. * You can not make a position after a root.
  43365. *
  43366. * @error view-position-after-root
  43367. * @param {module:engine/view/node~Node} root
  43368. */
  43369. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__["default"]( 'view-position-after-root', item, { root: item } );
  43370. }
  43371. return new Position( item.parent, item.index + 1 );
  43372. }
  43373. /**
  43374. * Creates a new position before given view item.
  43375. *
  43376. * @protected
  43377. * @param {module:engine/view/item~Item} item View item before which the position should be located.
  43378. * @returns {module:engine/view/position~Position}
  43379. */
  43380. static _createBefore( item ) {
  43381. // TextProxy is not a instance of Node so we need do handle it in specific way.
  43382. if ( item.is( '$textProxy' ) ) {
  43383. return new Position( item.textNode, item.offsetInText );
  43384. }
  43385. if ( !item.parent ) {
  43386. /**
  43387. * You cannot make a position before a root.
  43388. *
  43389. * @error view-position-before-root
  43390. * @param {module:engine/view/node~Node} root
  43391. */
  43392. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__["default"]( 'view-position-before-root', item, { root: item } );
  43393. }
  43394. return new Position( item.parent, item.index );
  43395. }
  43396. }
  43397. /**
  43398. * A flag indicating whether this position is `'before'` or `'after'` or `'same'` as given position.
  43399. * If positions are in different roots `'different'` flag is returned.
  43400. *
  43401. * @typedef {String} module:engine/view/position~PositionRelation
  43402. */
  43403. /***/ }),
  43404. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/range.js":
  43405. /*!*******************************************************************!*\
  43406. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/range.js ***!
  43407. \*******************************************************************/
  43408. /*! exports provided: default */
  43409. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  43410. "use strict";
  43411. __webpack_require__.r(__webpack_exports__);
  43412. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Range; });
  43413. /* harmony import */ var _position__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./position */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/position.js");
  43414. /* harmony import */ var _treewalker__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./treewalker */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/treewalker.js");
  43415. /**
  43416. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  43417. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  43418. */
  43419. /**
  43420. * @module engine/view/range
  43421. */
  43422. /**
  43423. * Range in the view tree. A range is represented by its start and end {@link module:engine/view/position~Position positions}.
  43424. *
  43425. * In order to create a new position instance use the `createPosition*()` factory methods available in:
  43426. *
  43427. * * {@link module:engine/view/view~View}
  43428. * * {@link module:engine/view/downcastwriter~DowncastWriter}
  43429. * * {@link module:engine/view/upcastwriter~UpcastWriter}
  43430. */
  43431. class Range {
  43432. /**
  43433. * Creates a range spanning from `start` position to `end` position.
  43434. *
  43435. * **Note:** Constructor creates it's own {@link module:engine/view/position~Position} instances basing on passed values.
  43436. *
  43437. * @param {module:engine/view/position~Position} start Start position.
  43438. * @param {module:engine/view/position~Position} [end] End position. If not set, range will be collapsed at the `start` position.
  43439. */
  43440. constructor( start, end = null ) {
  43441. /**
  43442. * Start position.
  43443. *
  43444. * @readonly
  43445. * @member {module:engine/view/position~Position}
  43446. */
  43447. this.start = start.clone();
  43448. /**
  43449. * End position.
  43450. *
  43451. * @readonly
  43452. * @member {module:engine/view/position~Position}
  43453. */
  43454. this.end = end ? end.clone() : start.clone();
  43455. }
  43456. /**
  43457. * Iterable interface.
  43458. *
  43459. * Iterates over all {@link module:engine/view/item~Item view items} that are in this range and returns
  43460. * them together with additional information like length or {@link module:engine/view/position~Position positions},
  43461. * grouped as {@link module:engine/view/treewalker~TreeWalkerValue}.
  43462. *
  43463. * This iterator uses {@link module:engine/view/treewalker~TreeWalker TreeWalker} with `boundaries` set to this range and
  43464. * `ignoreElementEnd` option
  43465. * set to `true`.
  43466. *
  43467. * @returns {Iterable.<module:engine/view/treewalker~TreeWalkerValue>}
  43468. */
  43469. * [ Symbol.iterator ]() {
  43470. yield* new _treewalker__WEBPACK_IMPORTED_MODULE_1__["default"]( { boundaries: this, ignoreElementEnd: true } );
  43471. }
  43472. /**
  43473. * Returns whether the range is collapsed, that is it start and end positions are equal.
  43474. *
  43475. * @type {Boolean}
  43476. */
  43477. get isCollapsed() {
  43478. return this.start.isEqual( this.end );
  43479. }
  43480. /**
  43481. * Returns whether this range is flat, that is if {@link module:engine/view/range~Range#start start} position and
  43482. * {@link module:engine/view/range~Range#end end} position are in the same {@link module:engine/view/position~Position#parent parent}.
  43483. *
  43484. * @type {Boolean}
  43485. */
  43486. get isFlat() {
  43487. return this.start.parent === this.end.parent;
  43488. }
  43489. /**
  43490. * Range root element.
  43491. *
  43492. * @type {module:engine/view/element~Element|module:engine/view/documentfragment~DocumentFragment}
  43493. */
  43494. get root() {
  43495. return this.start.root;
  43496. }
  43497. /**
  43498. * Creates a maximal range that has the same content as this range but is expanded in both ways (at the beginning
  43499. * and at the end).
  43500. *
  43501. * For example:
  43502. *
  43503. * <p>Foo</p><p><b>{Bar}</b></p> -> <p>Foo</p>[<p><b>Bar</b>]</p>
  43504. * <p><b>foo</b>{bar}<span></span></p> -> <p><b>foo[</b>bar<span></span>]</p>
  43505. *
  43506. * Note that in the sample above:
  43507. *
  43508. * - `<p>` have type of {@link module:engine/view/containerelement~ContainerElement},
  43509. * - `<b>` have type of {@link module:engine/view/attributeelement~AttributeElement},
  43510. * - `<span>` have type of {@link module:engine/view/uielement~UIElement}.
  43511. *
  43512. * @returns {module:engine/view/range~Range} Enlarged range.
  43513. */
  43514. getEnlarged() {
  43515. let start = this.start.getLastMatchingPosition( enlargeTrimSkip, { direction: 'backward' } );
  43516. let end = this.end.getLastMatchingPosition( enlargeTrimSkip );
  43517. // Fix positions, in case if they are in Text node.
  43518. if ( start.parent.is( '$text' ) && start.isAtStart ) {
  43519. start = _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createBefore( start.parent );
  43520. }
  43521. if ( end.parent.is( '$text' ) && end.isAtEnd ) {
  43522. end = _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createAfter( end.parent );
  43523. }
  43524. return new Range( start, end );
  43525. }
  43526. /**
  43527. * Creates a minimum range that has the same content as this range but is trimmed in both ways (at the beginning
  43528. * and at the end).
  43529. *
  43530. * For example:
  43531. *
  43532. * <p>Foo</p>[<p><b>Bar</b>]</p> -> <p>Foo</p><p><b>{Bar}</b></p>
  43533. * <p><b>foo[</b>bar<span></span>]</p> -> <p><b>foo</b>{bar}<span></span></p>
  43534. *
  43535. * Note that in the sample above:
  43536. *
  43537. * - `<p>` have type of {@link module:engine/view/containerelement~ContainerElement},
  43538. * - `<b>` have type of {@link module:engine/view/attributeelement~AttributeElement},
  43539. * - `<span>` have type of {@link module:engine/view/uielement~UIElement}.
  43540. *
  43541. * @returns {module:engine/view/range~Range} Shrink range.
  43542. */
  43543. getTrimmed() {
  43544. let start = this.start.getLastMatchingPosition( enlargeTrimSkip );
  43545. if ( start.isAfter( this.end ) || start.isEqual( this.end ) ) {
  43546. return new Range( start, start );
  43547. }
  43548. let end = this.end.getLastMatchingPosition( enlargeTrimSkip, { direction: 'backward' } );
  43549. const nodeAfterStart = start.nodeAfter;
  43550. const nodeBeforeEnd = end.nodeBefore;
  43551. // Because TreeWalker prefers positions next to text node, we need to move them manually into these text nodes.
  43552. if ( nodeAfterStart && nodeAfterStart.is( '$text' ) ) {
  43553. start = new _position__WEBPACK_IMPORTED_MODULE_0__["default"]( nodeAfterStart, 0 );
  43554. }
  43555. if ( nodeBeforeEnd && nodeBeforeEnd.is( '$text' ) ) {
  43556. end = new _position__WEBPACK_IMPORTED_MODULE_0__["default"]( nodeBeforeEnd, nodeBeforeEnd.data.length );
  43557. }
  43558. return new Range( start, end );
  43559. }
  43560. /**
  43561. * Two ranges are equal if their start and end positions are equal.
  43562. *
  43563. * @param {module:engine/view/range~Range} otherRange Range to compare with.
  43564. * @returns {Boolean} `true` if ranges are equal, `false` otherwise
  43565. */
  43566. isEqual( otherRange ) {
  43567. return this == otherRange || ( this.start.isEqual( otherRange.start ) && this.end.isEqual( otherRange.end ) );
  43568. }
  43569. /**
  43570. * Checks whether this range contains given {@link module:engine/view/position~Position position}.
  43571. *
  43572. * @param {module:engine/view/position~Position} position Position to check.
  43573. * @returns {Boolean} `true` if given {@link module:engine/view/position~Position position} is contained in this range,
  43574. * `false` otherwise.
  43575. */
  43576. containsPosition( position ) {
  43577. return position.isAfter( this.start ) && position.isBefore( this.end );
  43578. }
  43579. /**
  43580. * Checks whether this range contains given {@link module:engine/view/range~Range range}.
  43581. *
  43582. * @param {module:engine/view/range~Range} otherRange Range to check.
  43583. * @param {Boolean} [loose=false] Whether the check is loose or strict. If the check is strict (`false`), compared range cannot
  43584. * start or end at the same position as this range boundaries. If the check is loose (`true`), compared range can start, end or
  43585. * even be equal to this range. Note that collapsed ranges are always compared in strict mode.
  43586. * @returns {Boolean} `true` if given {@link module:engine/view/range~Range range} boundaries are contained by this range, `false`
  43587. * otherwise.
  43588. */
  43589. containsRange( otherRange, loose = false ) {
  43590. if ( otherRange.isCollapsed ) {
  43591. loose = false;
  43592. }
  43593. const containsStart = this.containsPosition( otherRange.start ) || ( loose && this.start.isEqual( otherRange.start ) );
  43594. const containsEnd = this.containsPosition( otherRange.end ) || ( loose && this.end.isEqual( otherRange.end ) );
  43595. return containsStart && containsEnd;
  43596. }
  43597. /**
  43598. * Computes which part(s) of this {@link module:engine/view/range~Range range} is not a part of given
  43599. * {@link module:engine/view/range~Range range}.
  43600. * Returned array contains zero, one or two {@link module:engine/view/range~Range ranges}.
  43601. *
  43602. * Examples:
  43603. *
  43604. * let foo = downcastWriter.createText( 'foo' );
  43605. * let img = downcastWriter.createContainerElement( 'img' );
  43606. * let bar = downcastWriter.createText( 'bar' );
  43607. * let p = downcastWriter.createContainerElement( 'p', null, [ foo, img, bar ] );
  43608. *
  43609. * let range = view.createRange( view.createPositionAt( foo, 2 ), view.createPositionAt( bar, 1 ); // "o", img, "b" are in range.
  43610. * let otherRange = view.createRange( // "oo", img, "ba" are in range.
  43611. * view.createPositionAt( foo, 1 ),
  43612. * view.createPositionAt( bar, 2 )
  43613. * );
  43614. * let transformed = range.getDifference( otherRange );
  43615. * // transformed array has no ranges because `otherRange` contains `range`
  43616. *
  43617. * otherRange = view.createRange( view.createPositionAt( foo, 1 ), view.createPositionAt( p, 2 ); // "oo", img are in range.
  43618. * transformed = range.getDifference( otherRange );
  43619. * // transformed array has one range: from ( p, 2 ) to ( bar, 1 )
  43620. *
  43621. * otherRange = view.createRange( view.createPositionAt( p, 1 ), view.createPositionAt( p, 2 ) ); // img is in range.
  43622. * transformed = range.getDifference( otherRange );
  43623. * // transformed array has two ranges: from ( foo, 1 ) to ( p, 1 ) and from ( p, 2 ) to ( bar, 1 )
  43624. *
  43625. * @param {module:engine/view/range~Range} otherRange Range to differentiate against.
  43626. * @returns {Array.<module:engine/view/range~Range>} The difference between ranges.
  43627. */
  43628. getDifference( otherRange ) {
  43629. const ranges = [];
  43630. if ( this.isIntersecting( otherRange ) ) {
  43631. // Ranges intersect.
  43632. if ( this.containsPosition( otherRange.start ) ) {
  43633. // Given range start is inside this range. This means that we have to
  43634. // add shrunken range - from the start to the middle of this range.
  43635. ranges.push( new Range( this.start, otherRange.start ) );
  43636. }
  43637. if ( this.containsPosition( otherRange.end ) ) {
  43638. // Given range end is inside this range. This means that we have to
  43639. // add shrunken range - from the middle of this range to the end.
  43640. ranges.push( new Range( otherRange.end, this.end ) );
  43641. }
  43642. } else {
  43643. // Ranges do not intersect, return the original range.
  43644. ranges.push( this.clone() );
  43645. }
  43646. return ranges;
  43647. }
  43648. /**
  43649. * Returns an intersection of this {@link module:engine/view/range~Range range} and given {@link module:engine/view/range~Range range}.
  43650. * Intersection is a common part of both of those ranges. If ranges has no common part, returns `null`.
  43651. *
  43652. * Examples:
  43653. *
  43654. * let foo = downcastWriter.createText( 'foo' );
  43655. * let img = downcastWriter.createContainerElement( 'img' );
  43656. * let bar = downcastWriter.createText( 'bar' );
  43657. * let p = downcastWriter.createContainerElement( 'p', null, [ foo, img, bar ] );
  43658. *
  43659. * let range = view.createRange( view.createPositionAt( foo, 2 ), view.createPositionAt( bar, 1 ); // "o", img, "b" are in range.
  43660. * let otherRange = view.createRange( view.createPositionAt( foo, 1 ), view.createPositionAt( p, 2 ); // "oo", img are in range.
  43661. * let transformed = range.getIntersection( otherRange ); // range from ( foo, 1 ) to ( p, 2 ).
  43662. *
  43663. * otherRange = view.createRange( view.createPositionAt( bar, 1 ), view.createPositionAt( bar, 3 ); "ar" is in range.
  43664. * transformed = range.getIntersection( otherRange ); // null - no common part.
  43665. *
  43666. * @param {module:engine/view/range~Range} otherRange Range to check for intersection.
  43667. * @returns {module:engine/view/range~Range|null} A common part of given ranges or `null` if ranges have no common part.
  43668. */
  43669. getIntersection( otherRange ) {
  43670. if ( this.isIntersecting( otherRange ) ) {
  43671. // Ranges intersect, so a common range will be returned.
  43672. // At most, it will be same as this range.
  43673. let commonRangeStart = this.start;
  43674. let commonRangeEnd = this.end;
  43675. if ( this.containsPosition( otherRange.start ) ) {
  43676. // Given range start is inside this range. This means thaNt we have to
  43677. // shrink common range to the given range start.
  43678. commonRangeStart = otherRange.start;
  43679. }
  43680. if ( this.containsPosition( otherRange.end ) ) {
  43681. // Given range end is inside this range. This means that we have to
  43682. // shrink common range to the given range end.
  43683. commonRangeEnd = otherRange.end;
  43684. }
  43685. return new Range( commonRangeStart, commonRangeEnd );
  43686. }
  43687. // Ranges do not intersect, so they do not have common part.
  43688. return null;
  43689. }
  43690. /**
  43691. * Creates a {@link module:engine/view/treewalker~TreeWalker TreeWalker} instance with this range as a boundary.
  43692. *
  43693. * @param {Object} options Object with configuration options. See {@link module:engine/view/treewalker~TreeWalker}.
  43694. * @param {module:engine/view/position~Position} [options.startPosition]
  43695. * @param {Boolean} [options.singleCharacters=false]
  43696. * @param {Boolean} [options.shallow=false]
  43697. * @param {Boolean} [options.ignoreElementEnd=false]
  43698. * @returns {module:engine/view/treewalker~TreeWalker}
  43699. */
  43700. getWalker( options = {} ) {
  43701. options.boundaries = this;
  43702. return new _treewalker__WEBPACK_IMPORTED_MODULE_1__["default"]( options );
  43703. }
  43704. /**
  43705. * Returns a {@link module:engine/view/node~Node} or {@link module:engine/view/documentfragment~DocumentFragment}
  43706. * which is a common ancestor of range's both ends (in which the entire range is contained).
  43707. *
  43708. * @returns {module:engine/view/node~Node|module:engine/view/documentfragment~DocumentFragment|null}
  43709. */
  43710. getCommonAncestor() {
  43711. return this.start.getCommonAncestor( this.end );
  43712. }
  43713. /**
  43714. * Returns an {@link module:engine/view/element~Element Element} contained by the range.
  43715. * The element will be returned when it is the **only** node within the range and **fully–contained**
  43716. * at the same time.
  43717. *
  43718. * @returns {module:engine/view/element~Element|null}
  43719. */
  43720. getContainedElement() {
  43721. if ( this.isCollapsed ) {
  43722. return null;
  43723. }
  43724. let nodeAfterStart = this.start.nodeAfter;
  43725. let nodeBeforeEnd = this.end.nodeBefore;
  43726. // Handle the situation when the range position is at the beginning / at the end of a text node.
  43727. // In such situation `.nodeAfter` and `.nodeBefore` are `null` but the range still might be spanning
  43728. // over one element.
  43729. //
  43730. // <p>Foo{<span class="widget"></span>}bar</p> vs <p>Foo[<span class="widget"></span>]bar</p>
  43731. //
  43732. // These are basically the same range, only the difference is if the range position is at
  43733. // at the end/at the beginning of a text node or just before/just after the text node.
  43734. //
  43735. if ( this.start.parent.is( '$text' ) && this.start.isAtEnd && this.start.parent.nextSibling ) {
  43736. nodeAfterStart = this.start.parent.nextSibling;
  43737. }
  43738. if ( this.end.parent.is( '$text' ) && this.end.isAtStart && this.end.parent.previousSibling ) {
  43739. nodeBeforeEnd = this.end.parent.previousSibling;
  43740. }
  43741. if ( nodeAfterStart && nodeAfterStart.is( 'element' ) && nodeAfterStart === nodeBeforeEnd ) {
  43742. return nodeAfterStart;
  43743. }
  43744. return null;
  43745. }
  43746. /**
  43747. * Clones this range.
  43748. *
  43749. * @returns {module:engine/view/range~Range}
  43750. */
  43751. clone() {
  43752. return new Range( this.start, this.end );
  43753. }
  43754. /**
  43755. * Returns an iterator that iterates over all {@link module:engine/view/item~Item view items} that are in this range and returns
  43756. * them.
  43757. *
  43758. * This method uses {@link module:engine/view/treewalker~TreeWalker} with `boundaries` set to this range and `ignoreElementEnd` option
  43759. * set to `true`. However it returns only {@link module:engine/view/item~Item items},
  43760. * not {@link module:engine/view/treewalker~TreeWalkerValue}.
  43761. *
  43762. * You may specify additional options for the tree walker. See {@link module:engine/view/treewalker~TreeWalker} for
  43763. * a full list of available options.
  43764. *
  43765. * @param {Object} options Object with configuration options. See {@link module:engine/view/treewalker~TreeWalker}.
  43766. * @returns {Iterable.<module:engine/view/item~Item>}
  43767. */
  43768. * getItems( options = {} ) {
  43769. options.boundaries = this;
  43770. options.ignoreElementEnd = true;
  43771. const treeWalker = new _treewalker__WEBPACK_IMPORTED_MODULE_1__["default"]( options );
  43772. for ( const value of treeWalker ) {
  43773. yield value.item;
  43774. }
  43775. }
  43776. /**
  43777. * Returns an iterator that iterates over all {@link module:engine/view/position~Position positions} that are boundaries or
  43778. * contained in this range.
  43779. *
  43780. * This method uses {@link module:engine/view/treewalker~TreeWalker} with `boundaries` set to this range. However it returns only
  43781. * {@link module:engine/view/position~Position positions}, not {@link module:engine/view/treewalker~TreeWalkerValue}.
  43782. *
  43783. * You may specify additional options for the tree walker. See {@link module:engine/view/treewalker~TreeWalker} for
  43784. * a full list of available options.
  43785. *
  43786. * @param {Object} options Object with configuration options. See {@link module:engine/view/treewalker~TreeWalker}.
  43787. * @returns {Iterable.<module:engine/view/position~Position>}
  43788. */
  43789. * getPositions( options = {} ) {
  43790. options.boundaries = this;
  43791. const treeWalker = new _treewalker__WEBPACK_IMPORTED_MODULE_1__["default"]( options );
  43792. yield treeWalker.position;
  43793. for ( const value of treeWalker ) {
  43794. yield value.nextPosition;
  43795. }
  43796. }
  43797. /**
  43798. * Checks whether this object is of the given type.
  43799. *
  43800. * range.is( 'range' ); // -> true
  43801. * range.is( 'view:range' ); // -> true
  43802. *
  43803. * range.is( 'model:range' ); // -> false
  43804. * range.is( 'element' ); // -> false
  43805. * range.is( 'selection' ); // -> false
  43806. *
  43807. * {@link module:engine/view/node~Node#is Check the entire list of view objects} which implement the `is()` method.
  43808. *
  43809. * @param {String} type
  43810. * @returns {Boolean}
  43811. */
  43812. is( type ) {
  43813. return type === 'range' || type === 'view:range';
  43814. }
  43815. /**
  43816. * Checks and returns whether this range intersects with the given range.
  43817. *
  43818. * @param {module:engine/view/range~Range} otherRange Range to compare with.
  43819. * @returns {Boolean} True if ranges intersect.
  43820. */
  43821. isIntersecting( otherRange ) {
  43822. return this.start.isBefore( otherRange.end ) && this.end.isAfter( otherRange.start );
  43823. }
  43824. /**
  43825. * Creates a range from the given parents and offsets.
  43826. *
  43827. * @protected
  43828. * @param {module:engine/view/node~Node|module:engine/view/documentfragment~DocumentFragment} startElement Start position
  43829. * parent element.
  43830. * @param {Number} startOffset Start position offset.
  43831. * @param {module:engine/view/node~Node|module:engine/view/documentfragment~DocumentFragment} endElement End position
  43832. * parent element.
  43833. * @param {Number} endOffset End position offset.
  43834. * @returns {module:engine/view/range~Range} Created range.
  43835. */
  43836. static _createFromParentsAndOffsets( startElement, startOffset, endElement, endOffset ) {
  43837. return new this(
  43838. new _position__WEBPACK_IMPORTED_MODULE_0__["default"]( startElement, startOffset ),
  43839. new _position__WEBPACK_IMPORTED_MODULE_0__["default"]( endElement, endOffset )
  43840. );
  43841. }
  43842. /**
  43843. * Creates a new range, spreading from specified {@link module:engine/view/position~Position position} to a position moved by
  43844. * given `shift`. If `shift` is a negative value, shifted position is treated as the beginning of the range.
  43845. *
  43846. * @protected
  43847. * @param {module:engine/view/position~Position} position Beginning of the range.
  43848. * @param {Number} shift How long the range should be.
  43849. * @returns {module:engine/view/range~Range}
  43850. */
  43851. static _createFromPositionAndShift( position, shift ) {
  43852. const start = position;
  43853. const end = position.getShiftedBy( shift );
  43854. return shift > 0 ? new this( start, end ) : new this( end, start );
  43855. }
  43856. /**
  43857. * Creates a range inside an {@link module:engine/view/element~Element element} which starts before the first child of
  43858. * that element and ends after the last child of that element.
  43859. *
  43860. * @protected
  43861. * @param {module:engine/view/element~Element} element Element which is a parent for the range.
  43862. * @returns {module:engine/view/range~Range}
  43863. */
  43864. static _createIn( element ) {
  43865. return this._createFromParentsAndOffsets( element, 0, element, element.childCount );
  43866. }
  43867. /**
  43868. * Creates a range that starts before given {@link module:engine/view/item~Item view item} and ends after it.
  43869. *
  43870. * @protected
  43871. * @param {module:engine/view/item~Item} item
  43872. * @returns {module:engine/view/range~Range}
  43873. */
  43874. static _createOn( item ) {
  43875. const size = item.is( '$textProxy' ) ? item.offsetSize : 1;
  43876. return this._createFromPositionAndShift( _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createBefore( item ), size );
  43877. }
  43878. }
  43879. // Function used by getEnlarged and getTrimmed methods.
  43880. function enlargeTrimSkip( value ) {
  43881. if ( value.item.is( 'attributeElement' ) || value.item.is( 'uiElement' ) ) {
  43882. return true;
  43883. }
  43884. return false;
  43885. }
  43886. /***/ }),
  43887. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/rawelement.js":
  43888. /*!************************************************************************!*\
  43889. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/rawelement.js ***!
  43890. \************************************************************************/
  43891. /*! exports provided: default */
  43892. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  43893. "use strict";
  43894. __webpack_require__.r(__webpack_exports__);
  43895. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return RawElement; });
  43896. /* harmony import */ var _element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./element */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/element.js");
  43897. /* 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");
  43898. /* harmony import */ var _node__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/node.js");
  43899. /**
  43900. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  43901. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  43902. */
  43903. /**
  43904. * @module engine/view/rawelement
  43905. */
  43906. /**
  43907. * The raw element class.
  43908. *
  43909. * The raw elements work as data containers ("wrappers", "sandboxes") but their children are not managed or
  43910. * even recognized by the editor. This encapsulation allows integrations to maintain custom DOM structures
  43911. * in the editor content without, for instance, worrying about compatibility with other editor features.
  43912. * Raw elements are a perfect tool for integration with external frameworks and data sources.
  43913. *
  43914. * Unlike {@link module:engine/view/uielement~UIElement UI elements}, raw elements act like real editor
  43915. * content (similar to {@link module:engine/view/containerelement~ContainerElement} or
  43916. * {@link module:engine/view/emptyelement~EmptyElement}), they are considered by the editor selection and
  43917. * {@link module:widget/utils~toWidget they can work as widgets}.
  43918. *
  43919. * To create a new raw element, use the
  43920. * {@link module:engine/view/downcastwriter~DowncastWriter#createRawElement `downcastWriter#createRawElement()`} method.
  43921. *
  43922. * @extends module:engine/view/element~Element
  43923. */
  43924. class RawElement extends _element__WEBPACK_IMPORTED_MODULE_0__["default"] {
  43925. /**
  43926. * Creates a new instance of a raw element.
  43927. *
  43928. * Throws the `view-rawelement-cannot-add` {@link module:utils/ckeditorerror~CKEditorError CKEditorError} when the `children`
  43929. * parameter is passed to inform that the usage of `RawElement` is incorrect (adding child nodes to `RawElement` is forbidden).
  43930. *
  43931. * @see module:engine/view/downcastwriter~DowncastWriter#createRawElement
  43932. * @protected
  43933. * @param {module:engine/view/document~Document} document The document instance to which this element belongs.
  43934. * @param {String} name A node name.
  43935. * @param {Object|Iterable} [attrs] The collection of attributes.
  43936. * @param {module:engine/view/node~Node|Iterable.<module:engine/view/node~Node>} [children]
  43937. * A list of nodes to be inserted into the created element.
  43938. */
  43939. constructor( document, name, attrs, children ) {
  43940. super( document, name, attrs, children );
  43941. // Override the default of the base class.
  43942. this._isAllowedInsideAttributeElement = true;
  43943. /**
  43944. * Returns `null` because filler is not needed for raw elements.
  43945. *
  43946. * @method #getFillerOffset
  43947. * @returns {null} Always returns null.
  43948. */
  43949. this.getFillerOffset = getFillerOffset;
  43950. }
  43951. /**
  43952. * Checks whether this object is of the given type or name.
  43953. *
  43954. * rawElement.is( 'rawElement' ); // -> true
  43955. * rawElement.is( 'element' ); // -> true
  43956. * rawElement.is( 'node' ); // -> true
  43957. * rawElement.is( 'view:rawElement' ); // -> true
  43958. * rawElement.is( 'view:element' ); // -> true
  43959. * rawElement.is( 'view:node' ); // -> true
  43960. *
  43961. * rawElement.is( 'model:element' ); // -> false
  43962. * rawElement.is( 'documentFragment' ); // -> false
  43963. *
  43964. * Assuming that the object being checked is a raw element, you can also check its
  43965. * {@link module:engine/view/rawelement~RawElement#name name}:
  43966. *
  43967. * rawElement.is( 'img' ); // -> true if this is an img element
  43968. * rawElement.is( 'rawElement', 'img' ); // -> same as above
  43969. * text.is( 'img' ); -> false
  43970. *
  43971. * {@link module:engine/view/node~Node#is Check the entire list of view objects} which implement the `is()` method.
  43972. *
  43973. * @param {String} type The type to check when the `name` parameter is present.
  43974. * Otherwise, it acts like the `name` parameter.
  43975. * @param {String} [name] The element name.
  43976. * @returns {Boolean}
  43977. */
  43978. is( type, name = null ) {
  43979. if ( !name ) {
  43980. return type === 'rawElement' || type === 'view:rawElement' ||
  43981. // From super.is(). This is highly utilised method and cannot call super. See ckeditor/ckeditor5#6529.
  43982. type === this.name || type === 'view:' + this.name ||
  43983. type === 'element' || type === 'view:element' ||
  43984. type === 'node' || type === 'view:node';
  43985. } else {
  43986. return name === this.name && (
  43987. type === 'rawElement' || type === 'view:rawElement' ||
  43988. type === 'element' || type === 'view:element'
  43989. );
  43990. }
  43991. }
  43992. /**
  43993. * Overrides the {@link module:engine/view/element~Element#_insertChild} method.
  43994. * Throws the `view-rawelement-cannot-add` {@link module:utils/ckeditorerror~CKEditorError CKEditorError} to prevent
  43995. * adding any child nodes to a raw element.
  43996. *
  43997. * @protected
  43998. */
  43999. _insertChild( index, nodes ) {
  44000. if ( nodes && ( nodes instanceof _node__WEBPACK_IMPORTED_MODULE_2__["default"] || Array.from( nodes ).length > 0 ) ) {
  44001. /**
  44002. * Cannot add children to a {@link module:engine/view/rawelement~RawElement} instance.
  44003. *
  44004. * @error view-rawelement-cannot-add
  44005. */
  44006. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_1__["default"](
  44007. 'view-rawelement-cannot-add',
  44008. [ this, nodes ]
  44009. );
  44010. }
  44011. }
  44012. /**
  44013. * This allows rendering the children of a {@link module:engine/view/rawelement~RawElement} on the DOM level.
  44014. * This method is called by the {@link module:engine/view/domconverter~DomConverter} with the raw DOM element
  44015. * passed as an argument, leaving the number and shape of the children up to the integrator.
  44016. *
  44017. * This method **must be defined** for the raw element to work:
  44018. *
  44019. * const myRawElement = downcastWriter.createRawElement( 'div' );
  44020. *
  44021. * myRawElement.render = function( domElement ) {
  44022. * domElement.innerHTML = '<b>This is the raw content of myRawElement.</b>';
  44023. * };
  44024. *
  44025. * @method #render
  44026. * @param {HTMLElement} domElement The native DOM element representing the raw view element.
  44027. */
  44028. }
  44029. // Returns `null` because block filler is not needed for raw elements.
  44030. //
  44031. // @returns {null}
  44032. function getFillerOffset() {
  44033. return null;
  44034. }
  44035. /***/ }),
  44036. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/renderer.js":
  44037. /*!**********************************************************************!*\
  44038. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/renderer.js ***!
  44039. \**********************************************************************/
  44040. /*! exports provided: default */
  44041. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  44042. "use strict";
  44043. __webpack_require__.r(__webpack_exports__);
  44044. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Renderer; });
  44045. /* harmony import */ var _text__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./text */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/text.js");
  44046. /* harmony import */ var _position__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./position */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/position.js");
  44047. /* harmony import */ var _filler__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./filler */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/filler.js");
  44048. /* 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");
  44049. /* 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");
  44050. /* 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");
  44051. /* 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");
  44052. /* 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");
  44053. /* 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");
  44054. /* 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");
  44055. /* 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");
  44056. /* 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");
  44057. /* 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");
  44058. /**
  44059. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  44060. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  44061. */
  44062. /* globals Node */
  44063. /**
  44064. * @module engine/view/renderer
  44065. */
  44066. /**
  44067. * Renderer is responsible for updating the DOM structure and the DOM selection based on
  44068. * the {@link module:engine/view/renderer~Renderer#markToSync information about updated view nodes}.
  44069. * In other words, it renders the view to the DOM.
  44070. *
  44071. * Its main responsibility is to make only the necessary, minimal changes to the DOM. However, unlike in many
  44072. * virtual DOM implementations, the primary reason for doing minimal changes is not the performance but ensuring
  44073. * that native editing features such as text composition, autocompletion, spell checking, selection's x-index are
  44074. * affected as little as possible.
  44075. *
  44076. * Renderer uses {@link module:engine/view/domconverter~DomConverter} to transform view nodes and positions
  44077. * to and from the DOM.
  44078. */
  44079. class Renderer {
  44080. /**
  44081. * Creates a renderer instance.
  44082. *
  44083. * @param {module:engine/view/domconverter~DomConverter} domConverter Converter instance.
  44084. * @param {module:engine/view/documentselection~DocumentSelection} selection View selection.
  44085. */
  44086. constructor( domConverter, selection ) {
  44087. /**
  44088. * Set of DOM Documents instances.
  44089. *
  44090. * @readonly
  44091. * @member {Set.<Document>}
  44092. */
  44093. this.domDocuments = new Set();
  44094. /**
  44095. * Converter instance.
  44096. *
  44097. * @readonly
  44098. * @member {module:engine/view/domconverter~DomConverter}
  44099. */
  44100. this.domConverter = domConverter;
  44101. /**
  44102. * Set of nodes which attributes changed and may need to be rendered.
  44103. *
  44104. * @readonly
  44105. * @member {Set.<module:engine/view/node~Node>}
  44106. */
  44107. this.markedAttributes = new Set();
  44108. /**
  44109. * Set of elements which child lists changed and may need to be rendered.
  44110. *
  44111. * @readonly
  44112. * @member {Set.<module:engine/view/node~Node>}
  44113. */
  44114. this.markedChildren = new Set();
  44115. /**
  44116. * Set of text nodes which text data changed and may need to be rendered.
  44117. *
  44118. * @readonly
  44119. * @member {Set.<module:engine/view/node~Node>}
  44120. */
  44121. this.markedTexts = new Set();
  44122. /**
  44123. * View selection. Renderer updates DOM selection based on the view selection.
  44124. *
  44125. * @readonly
  44126. * @member {module:engine/view/documentselection~DocumentSelection}
  44127. */
  44128. this.selection = selection;
  44129. /**
  44130. * Indicates if the view document is focused and selection can be rendered. Selection will not be rendered if
  44131. * this is set to `false`.
  44132. *
  44133. * @member {Boolean}
  44134. */
  44135. this.isFocused = false;
  44136. /**
  44137. * The text node in which the inline filler was rendered.
  44138. *
  44139. * @private
  44140. * @member {Text}
  44141. */
  44142. this._inlineFiller = null;
  44143. /**
  44144. * DOM element containing fake selection.
  44145. *
  44146. * @private
  44147. * @type {null|HTMLElement}
  44148. */
  44149. this._fakeSelectionContainer = null;
  44150. }
  44151. /**
  44152. * Marks a view node to be updated in the DOM by {@link #render `render()`}.
  44153. *
  44154. * Note that only view nodes whose parents have corresponding DOM elements need to be marked to be synchronized.
  44155. *
  44156. * @see #markedAttributes
  44157. * @see #markedChildren
  44158. * @see #markedTexts
  44159. *
  44160. * @param {module:engine/view/document~ChangeType} type Type of the change.
  44161. * @param {module:engine/view/node~Node} node Node to be marked.
  44162. */
  44163. markToSync( type, node ) {
  44164. if ( type === 'text' ) {
  44165. if ( this.domConverter.mapViewToDom( node.parent ) ) {
  44166. this.markedTexts.add( node );
  44167. }
  44168. } else {
  44169. // If the node has no DOM element it is not rendered yet,
  44170. // its children/attributes do not need to be marked to be sync.
  44171. if ( !this.domConverter.mapViewToDom( node ) ) {
  44172. return;
  44173. }
  44174. if ( type === 'attributes' ) {
  44175. this.markedAttributes.add( node );
  44176. } else if ( type === 'children' ) {
  44177. this.markedChildren.add( node );
  44178. } else {
  44179. /**
  44180. * Unknown type passed to Renderer.markToSync.
  44181. *
  44182. * @error view-renderer-unknown-type
  44183. */
  44184. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_8__["default"]( 'view-renderer-unknown-type', this );
  44185. }
  44186. }
  44187. }
  44188. /**
  44189. * Renders all buffered changes ({@link #markedAttributes}, {@link #markedChildren} and {@link #markedTexts}) and
  44190. * the current view selection (if needed) to the DOM by applying a minimal set of changes to it.
  44191. *
  44192. * Renderer tries not to break the text composition (e.g. IME) and x-index of the selection,
  44193. * so it does as little as it is needed to update the DOM.
  44194. *
  44195. * Renderer also handles {@link module:engine/view/filler fillers}. Especially, it checks if the inline filler is needed
  44196. * at the selection position and adds or removes it. To prevent breaking text composition inline filler will not be
  44197. * removed as long as the selection is in the text node which needed it at first.
  44198. */
  44199. render() {
  44200. let inlineFillerPosition;
  44201. // Refresh mappings.
  44202. for ( const element of this.markedChildren ) {
  44203. this._updateChildrenMappings( element );
  44204. }
  44205. // There was inline filler rendered in the DOM but it's not
  44206. // at the selection position any more, so we can remove it
  44207. // (cause even if it's needed, it must be placed in another location).
  44208. if ( this._inlineFiller && !this._isSelectionInInlineFiller() ) {
  44209. this._removeInlineFiller();
  44210. }
  44211. // If we've got the filler, let's try to guess its position in the view.
  44212. if ( this._inlineFiller ) {
  44213. inlineFillerPosition = this._getInlineFillerPosition();
  44214. }
  44215. // Otherwise, if it's needed, create it at the selection position.
  44216. else if ( this._needsInlineFillerAtSelection() ) {
  44217. inlineFillerPosition = this.selection.getFirstPosition();
  44218. // Do not use `markToSync` so it will be added even if the parent is already added.
  44219. this.markedChildren.add( inlineFillerPosition.parent );
  44220. }
  44221. for ( const element of this.markedAttributes ) {
  44222. this._updateAttrs( element );
  44223. }
  44224. for ( const element of this.markedChildren ) {
  44225. this._updateChildren( element, { inlineFillerPosition } );
  44226. }
  44227. for ( const node of this.markedTexts ) {
  44228. if ( !this.markedChildren.has( node.parent ) && this.domConverter.mapViewToDom( node.parent ) ) {
  44229. this._updateText( node, { inlineFillerPosition } );
  44230. }
  44231. }
  44232. // Check whether the inline filler is required and where it really is in the DOM.
  44233. // At this point in most cases it will be in the DOM, but there are exceptions.
  44234. // For example, if the inline filler was deep in the created DOM structure, it will not be created.
  44235. // Similarly, if it was removed at the beginning of this function and then neither text nor children were updated,
  44236. // it will not be present.
  44237. // Fix those and similar scenarios.
  44238. if ( inlineFillerPosition ) {
  44239. const fillerDomPosition = this.domConverter.viewPositionToDom( inlineFillerPosition );
  44240. const domDocument = fillerDomPosition.parent.ownerDocument;
  44241. if ( !Object(_filler__WEBPACK_IMPORTED_MODULE_2__["startsWithFiller"])( fillerDomPosition.parent ) ) {
  44242. // Filler has not been created at filler position. Create it now.
  44243. this._inlineFiller = addInlineFiller( domDocument, fillerDomPosition.parent, fillerDomPosition.offset );
  44244. } else {
  44245. // Filler has been found, save it.
  44246. this._inlineFiller = fillerDomPosition.parent;
  44247. }
  44248. } else {
  44249. // There is no filler needed.
  44250. this._inlineFiller = null;
  44251. }
  44252. // First focus the new editing host, then update the selection.
  44253. // Otherwise, FF may throw an error (https://github.com/ckeditor/ckeditor5/issues/721).
  44254. this._updateFocus();
  44255. this._updateSelection();
  44256. this.markedTexts.clear();
  44257. this.markedAttributes.clear();
  44258. this.markedChildren.clear();
  44259. }
  44260. /**
  44261. * Updates mappings of view element's children.
  44262. *
  44263. * Children that were replaced in the view structure by similar elements (same tag name) are treated as 'replaced'.
  44264. * This means that their mappings can be updated so the new view elements are mapped to the existing DOM elements.
  44265. * Thanks to that these elements do not need to be re-rendered completely.
  44266. *
  44267. * @private
  44268. * @param {module:engine/view/node~Node} viewElement The view element whose children mappings will be updated.
  44269. */
  44270. _updateChildrenMappings( viewElement ) {
  44271. const domElement = this.domConverter.mapViewToDom( viewElement );
  44272. if ( !domElement ) {
  44273. // If there is no `domElement` it means that it was already removed from DOM and there is no need to process it.
  44274. return;
  44275. }
  44276. // Removing nodes from the DOM as we iterate can cause `actualDomChildren`
  44277. // (which is a live-updating `NodeList`) to get out of sync with the
  44278. // indices that we compute as we iterate over `actions`, producing
  44279. // incorrect element mappings.
  44280. //
  44281. // Converting live list to an array to make the list static.
  44282. const actualDomChildren = Array.from(
  44283. this.domConverter.mapViewToDom( viewElement ).childNodes
  44284. );
  44285. const expectedDomChildren = Array.from(
  44286. this.domConverter.viewChildrenToDom( viewElement, domElement.ownerDocument, { withChildren: false } )
  44287. );
  44288. const diff = this._diffNodeLists( actualDomChildren, expectedDomChildren );
  44289. const actions = this._findReplaceActions( diff, actualDomChildren, expectedDomChildren );
  44290. if ( actions.indexOf( 'replace' ) !== -1 ) {
  44291. const counter = { equal: 0, insert: 0, delete: 0 };
  44292. for ( const action of actions ) {
  44293. if ( action === 'replace' ) {
  44294. const insertIndex = counter.equal + counter.insert;
  44295. const deleteIndex = counter.equal + counter.delete;
  44296. const viewChild = viewElement.getChild( insertIndex );
  44297. // UIElement and RawElement are special cases. Their children are not stored in a view (#799)
  44298. // so we cannot use them with replacing flow (since they use view children during rendering
  44299. // which will always result in rendering empty elements).
  44300. if ( viewChild && !( viewChild.is( 'uiElement' ) || viewChild.is( 'rawElement' ) ) ) {
  44301. this._updateElementMappings( viewChild, actualDomChildren[ deleteIndex ] );
  44302. }
  44303. Object(_ckeditor_ckeditor5_utils_src_dom_remove__WEBPACK_IMPORTED_MODULE_6__["default"])( expectedDomChildren[ insertIndex ] );
  44304. counter.equal++;
  44305. } else {
  44306. counter[ action ]++;
  44307. }
  44308. }
  44309. }
  44310. }
  44311. /**
  44312. * Updates mappings of a given view element.
  44313. *
  44314. * @private
  44315. * @param {module:engine/view/node~Node} viewElement The view element whose mappings will be updated.
  44316. * @param {Node} domElement The DOM element representing the given view element.
  44317. */
  44318. _updateElementMappings( viewElement, domElement ) {
  44319. // Remap 'DomConverter' bindings.
  44320. this.domConverter.unbindDomElement( domElement );
  44321. this.domConverter.bindElements( domElement, viewElement );
  44322. // View element may have children which needs to be updated, but are not marked, mark them to update.
  44323. this.markedChildren.add( viewElement );
  44324. // Because we replace new view element mapping with the existing one, the corresponding DOM element
  44325. // will not be rerendered. The new view element may have different attributes than the previous one.
  44326. // Since its corresponding DOM element will not be rerendered, new attributes will not be added
  44327. // to the DOM, so we need to mark it here to make sure its attributes gets updated. See #1427 for more
  44328. // detailed case study.
  44329. // Also there are cases where replaced element is removed from the view structure and then has
  44330. // its attributes changed or removed. In such cases the element will not be present in `markedAttributes`
  44331. // and also may be the same (`element.isSimilar()`) as the reused element not having its attributes updated.
  44332. // To prevent such situations we always mark reused element to have its attributes rerenderd (#1560).
  44333. this.markedAttributes.add( viewElement );
  44334. }
  44335. /**
  44336. * Gets the position of the inline filler based on the current selection.
  44337. * Here, we assume that we know that the filler is needed and
  44338. * {@link #_isSelectionInInlineFiller is at the selection position}, and, since it is needed,
  44339. * it is somewhere at the selection position.
  44340. *
  44341. * Note: The filler position cannot be restored based on the filler's DOM text node, because
  44342. * when this method is called (before rendering), the bindings will often be broken. View-to-DOM
  44343. * bindings are only dependable after rendering.
  44344. *
  44345. * @private
  44346. * @returns {module:engine/view/position~Position}
  44347. */
  44348. _getInlineFillerPosition() {
  44349. const firstPos = this.selection.getFirstPosition();
  44350. if ( firstPos.parent.is( '$text' ) ) {
  44351. return _position__WEBPACK_IMPORTED_MODULE_1__["default"]._createBefore( this.selection.getFirstPosition().parent );
  44352. } else {
  44353. return firstPos;
  44354. }
  44355. }
  44356. /**
  44357. * Returns `true` if the selection has not left the inline filler's text node.
  44358. * If it is `true`, it means that the filler had been added for a reason and the selection did not
  44359. * leave the filler's text node. For example, the user can be in the middle of a composition so it should not be touched.
  44360. *
  44361. * @private
  44362. * @returns {Boolean} `true` if the inline filler and selection are in the same place.
  44363. */
  44364. _isSelectionInInlineFiller() {
  44365. if ( this.selection.rangeCount != 1 || !this.selection.isCollapsed ) {
  44366. return false;
  44367. }
  44368. // Note, we can't check if selection's position equals position of the
  44369. // this._inlineFiller node, because of #663. We may not be able to calculate
  44370. // the filler's position in the view at this stage.
  44371. // Instead, we check it the other way – whether selection is anchored in
  44372. // that text node or next to it.
  44373. // Possible options are:
  44374. // "FILLER{}"
  44375. // "FILLERadded-text{}"
  44376. const selectionPosition = this.selection.getFirstPosition();
  44377. const position = this.domConverter.viewPositionToDom( selectionPosition );
  44378. 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 ) ) {
  44379. return true;
  44380. }
  44381. return false;
  44382. }
  44383. /**
  44384. * Removes the inline filler.
  44385. *
  44386. * @private
  44387. */
  44388. _removeInlineFiller() {
  44389. const domFillerNode = this._inlineFiller;
  44390. // Something weird happened and the stored node doesn't contain the filler's text.
  44391. if ( !Object(_filler__WEBPACK_IMPORTED_MODULE_2__["startsWithFiller"])( domFillerNode ) ) {
  44392. /**
  44393. * The inline filler node was lost. Most likely, something overwrote the filler text node
  44394. * in the DOM.
  44395. *
  44396. * @error view-renderer-filler-was-lost
  44397. */
  44398. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_8__["default"]( 'view-renderer-filler-was-lost', this );
  44399. }
  44400. if ( Object(_filler__WEBPACK_IMPORTED_MODULE_2__["isInlineFiller"])( domFillerNode ) ) {
  44401. domFillerNode.parentNode.removeChild( domFillerNode );
  44402. } else {
  44403. domFillerNode.data = domFillerNode.data.substr( _filler__WEBPACK_IMPORTED_MODULE_2__["INLINE_FILLER_LENGTH"] );
  44404. }
  44405. this._inlineFiller = null;
  44406. }
  44407. /**
  44408. * Checks if the inline {@link module:engine/view/filler filler} should be added.
  44409. *
  44410. * @private
  44411. * @returns {Boolean} `true` if the inline filler should be added.
  44412. */
  44413. _needsInlineFillerAtSelection() {
  44414. if ( this.selection.rangeCount != 1 || !this.selection.isCollapsed ) {
  44415. return false;
  44416. }
  44417. const selectionPosition = this.selection.getFirstPosition();
  44418. const selectionParent = selectionPosition.parent;
  44419. const selectionOffset = selectionPosition.offset;
  44420. // If there is no DOM root we do not care about fillers.
  44421. if ( !this.domConverter.mapViewToDom( selectionParent.root ) ) {
  44422. return false;
  44423. }
  44424. if ( !( selectionParent.is( 'element' ) ) ) {
  44425. return false;
  44426. }
  44427. // Prevent adding inline filler inside elements with contenteditable=false.
  44428. // https://github.com/ckeditor/ckeditor5-engine/issues/1170
  44429. if ( !isEditable( selectionParent ) ) {
  44430. return false;
  44431. }
  44432. // We have block filler, we do not need inline one.
  44433. if ( selectionOffset === selectionParent.getFillerOffset() ) {
  44434. return false;
  44435. }
  44436. const nodeBefore = selectionPosition.nodeBefore;
  44437. const nodeAfter = selectionPosition.nodeAfter;
  44438. if ( nodeBefore instanceof _text__WEBPACK_IMPORTED_MODULE_0__["default"] || nodeAfter instanceof _text__WEBPACK_IMPORTED_MODULE_0__["default"] ) {
  44439. return false;
  44440. }
  44441. return true;
  44442. }
  44443. /**
  44444. * Checks if text needs to be updated and possibly updates it.
  44445. *
  44446. * @private
  44447. * @param {module:engine/view/text~Text} viewText View text to update.
  44448. * @param {Object} options
  44449. * @param {module:engine/view/position~Position} options.inlineFillerPosition The position where the inline
  44450. * filler should be rendered.
  44451. */
  44452. _updateText( viewText, options ) {
  44453. const domText = this.domConverter.findCorrespondingDomText( viewText );
  44454. const newDomText = this.domConverter.viewToDom( viewText, domText.ownerDocument );
  44455. const actualText = domText.data;
  44456. let expectedText = newDomText.data;
  44457. const filler = options.inlineFillerPosition;
  44458. if ( filler && filler.parent == viewText.parent && filler.offset == viewText.index ) {
  44459. expectedText = _filler__WEBPACK_IMPORTED_MODULE_2__["INLINE_FILLER"] + expectedText;
  44460. }
  44461. if ( actualText != expectedText ) {
  44462. const actions = Object(_ckeditor_ckeditor5_utils_src_fastdiff__WEBPACK_IMPORTED_MODULE_11__["default"])( actualText, expectedText );
  44463. for ( const action of actions ) {
  44464. if ( action.type === 'insert' ) {
  44465. domText.insertData( action.index, action.values.join( '' ) );
  44466. } else { // 'delete'
  44467. domText.deleteData( action.index, action.howMany );
  44468. }
  44469. }
  44470. }
  44471. }
  44472. /**
  44473. * Checks if attribute list needs to be updated and possibly updates it.
  44474. *
  44475. * @private
  44476. * @param {module:engine/view/element~Element} viewElement The view element to update.
  44477. */
  44478. _updateAttrs( viewElement ) {
  44479. const domElement = this.domConverter.mapViewToDom( viewElement );
  44480. if ( !domElement ) {
  44481. // If there is no `domElement` it means that 'viewElement' is outdated as its mapping was updated
  44482. // in 'this._updateChildrenMappings()'. There is no need to process it as new view element which
  44483. // replaced old 'viewElement' mapping was also added to 'this.markedAttributes'
  44484. // in 'this._updateChildrenMappings()' so it will be processed separately.
  44485. return;
  44486. }
  44487. const domAttrKeys = Array.from( domElement.attributes ).map( attr => attr.name );
  44488. const viewAttrKeys = viewElement.getAttributeKeys();
  44489. // Add or overwrite attributes.
  44490. for ( const key of viewAttrKeys ) {
  44491. domElement.setAttribute( key, viewElement.getAttribute( key ) );
  44492. }
  44493. // Remove from DOM attributes which do not exists in the view.
  44494. for ( const key of domAttrKeys ) {
  44495. if ( !viewElement.hasAttribute( key ) ) {
  44496. domElement.removeAttribute( key );
  44497. }
  44498. }
  44499. }
  44500. /**
  44501. * Checks if elements child list needs to be updated and possibly updates it.
  44502. *
  44503. * @private
  44504. * @param {module:engine/view/element~Element} viewElement View element to update.
  44505. * @param {Object} options
  44506. * @param {module:engine/view/position~Position} options.inlineFillerPosition The position where the inline
  44507. * filler should be rendered.
  44508. */
  44509. _updateChildren( viewElement, options ) {
  44510. const domElement = this.domConverter.mapViewToDom( viewElement );
  44511. if ( !domElement ) {
  44512. // If there is no `domElement` it means that it was already removed from DOM.
  44513. // There is no need to process it. It will be processed when re-inserted.
  44514. return;
  44515. }
  44516. const inlineFillerPosition = options.inlineFillerPosition;
  44517. const actualDomChildren = this.domConverter.mapViewToDom( viewElement ).childNodes;
  44518. const expectedDomChildren = Array.from(
  44519. this.domConverter.viewChildrenToDom( viewElement, domElement.ownerDocument, { bind: true, inlineFillerPosition } )
  44520. );
  44521. // Inline filler element has to be created as it is present in the DOM, but not in the view. It is required
  44522. // during diffing so text nodes could be compared correctly and also during rendering to maintain
  44523. // proper order and indexes while updating the DOM.
  44524. if ( inlineFillerPosition && inlineFillerPosition.parent === viewElement ) {
  44525. addInlineFiller( domElement.ownerDocument, expectedDomChildren, inlineFillerPosition.offset );
  44526. }
  44527. const diff = this._diffNodeLists( actualDomChildren, expectedDomChildren );
  44528. let i = 0;
  44529. const nodesToUnbind = new Set();
  44530. // Handle deletions first.
  44531. // This is to prevent a situation where an element that already exists in `actualDomChildren` is inserted at a different
  44532. // index in `actualDomChildren`. Since `actualDomChildren` is a `NodeList`, this works like move, not like an insert,
  44533. // and it disrupts the whole algorithm. See https://github.com/ckeditor/ckeditor5/issues/6367.
  44534. //
  44535. // It doesn't matter in what order we remove or add nodes, as long as we remove and add correct nodes at correct indexes.
  44536. for ( const action of diff ) {
  44537. if ( action === 'delete' ) {
  44538. nodesToUnbind.add( actualDomChildren[ i ] );
  44539. Object(_ckeditor_ckeditor5_utils_src_dom_remove__WEBPACK_IMPORTED_MODULE_6__["default"])( actualDomChildren[ i ] );
  44540. } else if ( action === 'equal' ) {
  44541. i++;
  44542. }
  44543. }
  44544. i = 0;
  44545. for ( const action of diff ) {
  44546. if ( action === 'insert' ) {
  44547. Object(_ckeditor_ckeditor5_utils_src_dom_insertat__WEBPACK_IMPORTED_MODULE_5__["default"])( domElement, i, expectedDomChildren[ i ] );
  44548. i++;
  44549. } else if ( action === 'equal' ) {
  44550. // Force updating text nodes inside elements which did not change and do not need to be re-rendered (#1125).
  44551. // Do it here (not in the loop above) because only after insertions the `i` index is correct.
  44552. this._markDescendantTextToSync( this.domConverter.domToView( expectedDomChildren[ i ] ) );
  44553. i++;
  44554. }
  44555. }
  44556. // Unbind removed nodes. When node does not have a parent it means that it was removed from DOM tree during
  44557. // comparison with the expected DOM. We don't need to check child nodes, because if child node was reinserted,
  44558. // it was moved to DOM tree out of the removed node.
  44559. for ( const node of nodesToUnbind ) {
  44560. if ( !node.parentNode ) {
  44561. this.domConverter.unbindDomElement( node );
  44562. }
  44563. }
  44564. }
  44565. /**
  44566. * Shorthand for diffing two arrays or node lists of DOM nodes.
  44567. *
  44568. * @private
  44569. * @param {Array.<Node>|NodeList} actualDomChildren Actual DOM children
  44570. * @param {Array.<Node>|NodeList} expectedDomChildren Expected DOM children.
  44571. * @returns {Array.<String>} The list of actions based on the {@link module:utils/diff~diff} function.
  44572. */
  44573. _diffNodeLists( actualDomChildren, expectedDomChildren ) {
  44574. actualDomChildren = filterOutFakeSelectionContainer( actualDomChildren, this._fakeSelectionContainer );
  44575. return Object(_ckeditor_ckeditor5_utils_src_diff__WEBPACK_IMPORTED_MODULE_4__["default"])( actualDomChildren, expectedDomChildren, sameNodes.bind( null, this.domConverter ) );
  44576. }
  44577. /**
  44578. * Finds DOM nodes that were replaced with the similar nodes (same tag name) in the view. All nodes are compared
  44579. * within one `insert`/`delete` action group, for example:
  44580. *
  44581. * Actual DOM: <p><b>Foo</b>Bar<i>Baz</i><b>Bax</b></p>
  44582. * Expected DOM: <p>Bar<b>123</b><i>Baz</i><b>456</b></p>
  44583. * Input actions: [ insert, insert, delete, delete, equal, insert, delete ]
  44584. * Output actions: [ insert, replace, delete, equal, replace ]
  44585. *
  44586. * @private
  44587. * @param {Array.<String>} actions Actions array which is a result of the {@link module:utils/diff~diff} function.
  44588. * @param {Array.<Node>|NodeList} actualDom Actual DOM children
  44589. * @param {Array.<Node>} expectedDom Expected DOM children.
  44590. * @returns {Array.<String>} Actions array modified with the `replace` actions.
  44591. */
  44592. _findReplaceActions( actions, actualDom, expectedDom ) {
  44593. // If there is no both 'insert' and 'delete' actions, no need to check for replaced elements.
  44594. if ( actions.indexOf( 'insert' ) === -1 || actions.indexOf( 'delete' ) === -1 ) {
  44595. return actions;
  44596. }
  44597. let newActions = [];
  44598. let actualSlice = [];
  44599. let expectedSlice = [];
  44600. const counter = { equal: 0, insert: 0, delete: 0 };
  44601. for ( const action of actions ) {
  44602. if ( action === 'insert' ) {
  44603. expectedSlice.push( expectedDom[ counter.equal + counter.insert ] );
  44604. } else if ( action === 'delete' ) {
  44605. actualSlice.push( actualDom[ counter.equal + counter.delete ] );
  44606. } else { // equal
  44607. newActions = newActions.concat( Object(_ckeditor_ckeditor5_utils_src_diff__WEBPACK_IMPORTED_MODULE_4__["default"])( actualSlice, expectedSlice, areSimilar ).map( x => x === 'equal' ? 'replace' : x ) );
  44608. newActions.push( 'equal' );
  44609. // Reset stored elements on 'equal'.
  44610. actualSlice = [];
  44611. expectedSlice = [];
  44612. }
  44613. counter[ action ]++;
  44614. }
  44615. return newActions.concat( Object(_ckeditor_ckeditor5_utils_src_diff__WEBPACK_IMPORTED_MODULE_4__["default"])( actualSlice, expectedSlice, areSimilar ).map( x => x === 'equal' ? 'replace' : x ) );
  44616. }
  44617. /**
  44618. * Marks text nodes to be synchronized.
  44619. *
  44620. * If a text node is passed, it will be marked. If an element is passed, all descendant text nodes inside it will be marked.
  44621. *
  44622. * @private
  44623. * @param {module:engine/view/node~Node} viewNode View node to sync.
  44624. */
  44625. _markDescendantTextToSync( viewNode ) {
  44626. if ( !viewNode ) {
  44627. return;
  44628. }
  44629. if ( viewNode.is( '$text' ) ) {
  44630. this.markedTexts.add( viewNode );
  44631. } else if ( viewNode.is( 'element' ) ) {
  44632. for ( const child of viewNode.getChildren() ) {
  44633. this._markDescendantTextToSync( child );
  44634. }
  44635. }
  44636. }
  44637. /**
  44638. * Checks if the selection needs to be updated and possibly updates it.
  44639. *
  44640. * @private
  44641. */
  44642. _updateSelection() {
  44643. // If there is no selection - remove DOM and fake selections.
  44644. if ( this.selection.rangeCount === 0 ) {
  44645. this._removeDomSelection();
  44646. this._removeFakeSelection();
  44647. return;
  44648. }
  44649. const domRoot = this.domConverter.mapViewToDom( this.selection.editableElement );
  44650. // Do nothing if there is no focus, or there is no DOM element corresponding to selection's editable element.
  44651. if ( !this.isFocused || !domRoot ) {
  44652. return;
  44653. }
  44654. // Render selection.
  44655. if ( this.selection.isFake ) {
  44656. this._updateFakeSelection( domRoot );
  44657. } else {
  44658. this._removeFakeSelection();
  44659. this._updateDomSelection( domRoot );
  44660. }
  44661. }
  44662. /**
  44663. * Updates the fake selection.
  44664. *
  44665. * @private
  44666. * @param {HTMLElement} domRoot A valid DOM root where the fake selection container should be added.
  44667. */
  44668. _updateFakeSelection( domRoot ) {
  44669. const domDocument = domRoot.ownerDocument;
  44670. if ( !this._fakeSelectionContainer ) {
  44671. this._fakeSelectionContainer = createFakeSelectionContainer( domDocument );
  44672. }
  44673. const container = this._fakeSelectionContainer;
  44674. // Bind fake selection container with the current selection *position*.
  44675. this.domConverter.bindFakeSelection( container, this.selection );
  44676. if ( !this._fakeSelectionNeedsUpdate( domRoot ) ) {
  44677. return;
  44678. }
  44679. if ( !container.parentElement || container.parentElement != domRoot ) {
  44680. domRoot.appendChild( container );
  44681. }
  44682. container.textContent = this.selection.fakeSelectionLabel || '\u00A0';
  44683. const domSelection = domDocument.getSelection();
  44684. const domRange = domDocument.createRange();
  44685. domSelection.removeAllRanges();
  44686. domRange.selectNodeContents( container );
  44687. domSelection.addRange( domRange );
  44688. }
  44689. /**
  44690. * Updates the DOM selection.
  44691. *
  44692. * @private
  44693. * @param {HTMLElement} domRoot A valid DOM root where the DOM selection should be rendered.
  44694. */
  44695. _updateDomSelection( domRoot ) {
  44696. const domSelection = domRoot.ownerDocument.defaultView.getSelection();
  44697. // Let's check whether DOM selection needs updating at all.
  44698. if ( !this._domSelectionNeedsUpdate( domSelection ) ) {
  44699. return;
  44700. }
  44701. // Multi-range selection is not available in most browsers, and, at least in Chrome, trying to
  44702. // set such selection, that is not continuous, throws an error. Because of that, we will just use anchor
  44703. // and focus of view selection.
  44704. // Since we are not supporting multi-range selection, we also do not need to check if proper editable is
  44705. // selected. If there is any editable selected, it is okay (editable is taken from selection anchor).
  44706. const anchor = this.domConverter.viewPositionToDom( this.selection.anchor );
  44707. const focus = this.domConverter.viewPositionToDom( this.selection.focus );
  44708. domSelection.collapse( anchor.parent, anchor.offset );
  44709. domSelection.extend( focus.parent, focus.offset );
  44710. // Firefox–specific hack (https://github.com/ckeditor/ckeditor5-engine/issues/1439).
  44711. if ( _ckeditor_ckeditor5_utils_src_env__WEBPACK_IMPORTED_MODULE_12__["default"].isGecko ) {
  44712. fixGeckoSelectionAfterBr( focus, domSelection );
  44713. }
  44714. }
  44715. /**
  44716. * Checks whether a given DOM selection needs to be updated.
  44717. *
  44718. * @private
  44719. * @param {Selection} domSelection The DOM selection to check.
  44720. * @returns {Boolean}
  44721. */
  44722. _domSelectionNeedsUpdate( domSelection ) {
  44723. if ( !this.domConverter.isDomSelectionCorrect( domSelection ) ) {
  44724. // Current DOM selection is in incorrect position. We need to update it.
  44725. return true;
  44726. }
  44727. const oldViewSelection = domSelection && this.domConverter.domSelectionToView( domSelection );
  44728. if ( oldViewSelection && this.selection.isEqual( oldViewSelection ) ) {
  44729. return false;
  44730. }
  44731. // If selection is not collapsed, it does not need to be updated if it is similar.
  44732. if ( !this.selection.isCollapsed && this.selection.isSimilar( oldViewSelection ) ) {
  44733. // Selection did not changed and is correct, do not update.
  44734. return false;
  44735. }
  44736. // Selections are not similar.
  44737. return true;
  44738. }
  44739. /**
  44740. * Checks whether the fake selection needs to be updated.
  44741. *
  44742. * @private
  44743. * @param {HTMLElement} domRoot A valid DOM root where a new fake selection container should be added.
  44744. * @returns {Boolean}
  44745. */
  44746. _fakeSelectionNeedsUpdate( domRoot ) {
  44747. const container = this._fakeSelectionContainer;
  44748. const domSelection = domRoot.ownerDocument.getSelection();
  44749. // Fake selection needs to be updated if there's no fake selection container, or the container currently sits
  44750. // in a different root.
  44751. if ( !container || container.parentElement !== domRoot ) {
  44752. return true;
  44753. }
  44754. // Make sure that the selection actually is within the fake selection.
  44755. if ( domSelection.anchorNode !== container && !container.contains( domSelection.anchorNode ) ) {
  44756. return true;
  44757. }
  44758. return container.textContent !== this.selection.fakeSelectionLabel;
  44759. }
  44760. /**
  44761. * Removes the DOM selection.
  44762. *
  44763. * @private
  44764. */
  44765. _removeDomSelection() {
  44766. for ( const doc of this.domDocuments ) {
  44767. const domSelection = doc.getSelection();
  44768. if ( domSelection.rangeCount ) {
  44769. const activeDomElement = doc.activeElement;
  44770. const viewElement = this.domConverter.mapDomToView( activeDomElement );
  44771. if ( activeDomElement && viewElement ) {
  44772. doc.getSelection().removeAllRanges();
  44773. }
  44774. }
  44775. }
  44776. }
  44777. /**
  44778. * Removes the fake selection.
  44779. *
  44780. * @private
  44781. */
  44782. _removeFakeSelection() {
  44783. const container = this._fakeSelectionContainer;
  44784. if ( container ) {
  44785. container.remove();
  44786. }
  44787. }
  44788. /**
  44789. * Checks if focus needs to be updated and possibly updates it.
  44790. *
  44791. * @private
  44792. */
  44793. _updateFocus() {
  44794. if ( this.isFocused ) {
  44795. const editable = this.selection.editableElement;
  44796. if ( editable ) {
  44797. this.domConverter.focus( editable );
  44798. }
  44799. }
  44800. }
  44801. }
  44802. Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_3__["default"])( Renderer, _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_7__["default"] );
  44803. // Checks if provided element is editable.
  44804. //
  44805. // @private
  44806. // @param {module:engine/view/element~Element} element
  44807. // @returns {Boolean}
  44808. function isEditable( element ) {
  44809. if ( element.getAttribute( 'contenteditable' ) == 'false' ) {
  44810. return false;
  44811. }
  44812. const parent = element.findAncestor( element => element.hasAttribute( 'contenteditable' ) );
  44813. return !parent || parent.getAttribute( 'contenteditable' ) == 'true';
  44814. }
  44815. // Adds inline filler at a given position.
  44816. //
  44817. // The position can be given as an array of DOM nodes and an offset in that array,
  44818. // or a DOM parent element and an offset in that element.
  44819. //
  44820. // @private
  44821. // @param {Document} domDocument
  44822. // @param {Element|Array.<Node>} domParentOrArray
  44823. // @param {Number} offset
  44824. // @returns {Text} The DOM text node that contains an inline filler.
  44825. function addInlineFiller( domDocument, domParentOrArray, offset ) {
  44826. const childNodes = domParentOrArray instanceof Array ? domParentOrArray : domParentOrArray.childNodes;
  44827. const nodeAfterFiller = childNodes[ offset ];
  44828. if ( Object(_ckeditor_ckeditor5_utils_src_dom_istext__WEBPACK_IMPORTED_MODULE_9__["default"])( nodeAfterFiller ) ) {
  44829. nodeAfterFiller.data = _filler__WEBPACK_IMPORTED_MODULE_2__["INLINE_FILLER"] + nodeAfterFiller.data;
  44830. return nodeAfterFiller;
  44831. } else {
  44832. const fillerNode = domDocument.createTextNode( _filler__WEBPACK_IMPORTED_MODULE_2__["INLINE_FILLER"] );
  44833. if ( Array.isArray( domParentOrArray ) ) {
  44834. childNodes.splice( offset, 0, fillerNode );
  44835. } else {
  44836. Object(_ckeditor_ckeditor5_utils_src_dom_insertat__WEBPACK_IMPORTED_MODULE_5__["default"])( domParentOrArray, offset, fillerNode );
  44837. }
  44838. return fillerNode;
  44839. }
  44840. }
  44841. // Whether two DOM nodes should be considered as similar.
  44842. // Nodes are considered similar if they have the same tag name.
  44843. //
  44844. // @private
  44845. // @param {Node} node1
  44846. // @param {Node} node2
  44847. // @returns {Boolean}
  44848. function areSimilar( node1, node2 ) {
  44849. 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 ) &&
  44850. !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 ) &&
  44851. node1.nodeType !== Node.COMMENT_NODE && node2.nodeType !== Node.COMMENT_NODE &&
  44852. node1.tagName.toLowerCase() === node2.tagName.toLowerCase();
  44853. }
  44854. // Whether two dom nodes should be considered as the same.
  44855. // Two nodes which are considered the same are:
  44856. //
  44857. // * Text nodes with the same text.
  44858. // * Element nodes represented by the same object.
  44859. // * Two block filler elements.
  44860. //
  44861. // @private
  44862. // @param {String} blockFillerMode Block filler mode, see {@link module:engine/view/domconverter~DomConverter#blockFillerMode}.
  44863. // @param {Node} node1
  44864. // @param {Node} node2
  44865. // @returns {Boolean}
  44866. function sameNodes( domConverter, actualDomChild, expectedDomChild ) {
  44867. // Elements.
  44868. if ( actualDomChild === expectedDomChild ) {
  44869. return true;
  44870. }
  44871. // Texts.
  44872. 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 ) ) {
  44873. return actualDomChild.data === expectedDomChild.data;
  44874. }
  44875. // Block fillers.
  44876. else if ( domConverter.isBlockFiller( actualDomChild ) &&
  44877. domConverter.isBlockFiller( expectedDomChild ) ) {
  44878. return true;
  44879. }
  44880. // Not matching types.
  44881. return false;
  44882. }
  44883. // The following is a Firefox–specific hack (https://github.com/ckeditor/ckeditor5-engine/issues/1439).
  44884. // When the native DOM selection is at the end of the block and preceded by <br /> e.g.
  44885. //
  44886. // <p>foo<br/>[]</p>
  44887. //
  44888. // which happens a lot when using the soft line break, the browser fails to (visually) move the
  44889. // caret to the new line. A quick fix is as simple as force–refreshing the selection with the same range.
  44890. function fixGeckoSelectionAfterBr( focus, domSelection ) {
  44891. const parent = focus.parent;
  44892. // This fix works only when the focus point is at the very end of an element.
  44893. // There is no point in running it in cases unrelated to the browser bug.
  44894. if ( parent.nodeType != Node.ELEMENT_NODE || focus.offset != parent.childNodes.length - 1 ) {
  44895. return;
  44896. }
  44897. const childAtOffset = parent.childNodes[ focus.offset ];
  44898. // To stay on the safe side, the fix being as specific as possible, it targets only the
  44899. // selection which is at the very end of the element and preceded by <br />.
  44900. if ( childAtOffset && childAtOffset.tagName == 'BR' ) {
  44901. domSelection.addRange( domSelection.getRangeAt( 0 ) );
  44902. }
  44903. }
  44904. function filterOutFakeSelectionContainer( domChildList, fakeSelectionContainer ) {
  44905. const childList = Array.from( domChildList );
  44906. if ( childList.length == 0 || !fakeSelectionContainer ) {
  44907. return childList;
  44908. }
  44909. const last = childList[ childList.length - 1 ];
  44910. if ( last == fakeSelectionContainer ) {
  44911. childList.pop();
  44912. }
  44913. return childList;
  44914. }
  44915. // Creates a fake selection container for a given document.
  44916. //
  44917. // @private
  44918. // @param {Document} domDocument
  44919. // @returns {HTMLElement}
  44920. function createFakeSelectionContainer( domDocument ) {
  44921. const container = domDocument.createElement( 'div' );
  44922. container.className = 'ck-fake-selection-container';
  44923. Object.assign( container.style, {
  44924. position: 'fixed',
  44925. top: 0,
  44926. left: '-9999px',
  44927. // See https://github.com/ckeditor/ckeditor5/issues/752.
  44928. width: '42px'
  44929. } );
  44930. // Fill it with a text node so we can update it later.
  44931. container.textContent = '\u00A0';
  44932. return container;
  44933. }
  44934. /***/ }),
  44935. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/rooteditableelement.js":
  44936. /*!*********************************************************************************!*\
  44937. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/rooteditableelement.js ***!
  44938. \*********************************************************************************/
  44939. /*! exports provided: default */
  44940. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  44941. "use strict";
  44942. __webpack_require__.r(__webpack_exports__);
  44943. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return RootEditableElement; });
  44944. /* harmony import */ var _editableelement__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./editableelement */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/editableelement.js");
  44945. /**
  44946. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  44947. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  44948. */
  44949. /**
  44950. * @module engine/view/rooteditableelement
  44951. */
  44952. const rootNameSymbol = Symbol( 'rootName' );
  44953. /**
  44954. * Class representing a single root in the data view. A root can be either {@link ~RootEditableElement#isReadOnly editable or read-only},
  44955. * but in both cases it is called "an editable". Roots can contain other {@link module:engine/view/editableelement~EditableElement
  44956. * editable elements} making them "nested editables".
  44957. *
  44958. * @extends module:engine/view/editableelement~EditableElement
  44959. */
  44960. class RootEditableElement extends _editableelement__WEBPACK_IMPORTED_MODULE_0__["default"] {
  44961. /**
  44962. * Creates root editable element.
  44963. *
  44964. * @param {module:engine/view/document~Document} document The document instance to which this element belongs.
  44965. * @param {String} name Node name.
  44966. */
  44967. constructor( document, name ) {
  44968. super( document, name );
  44969. /**
  44970. * Name of this root inside {@link module:engine/view/document~Document} that is an owner of this root. If no
  44971. * other name is set, `main` name is used.
  44972. *
  44973. * @readonly
  44974. * @member {String}
  44975. */
  44976. this.rootName = 'main';
  44977. }
  44978. /**
  44979. * Checks whether this object is of the given.
  44980. *
  44981. * rootEditableElement.is( 'rootElement' ); // -> true
  44982. * rootEditableElement.is( 'editableElement' ); // -> true
  44983. * rootEditableElement.is( 'element' ); // -> true
  44984. * rootEditableElement.is( 'node' ); // -> true
  44985. * rootEditableElement.is( 'view:editableElement' ); // -> true
  44986. * rootEditableElement.is( 'view:element' ); // -> true
  44987. * rootEditableElement.is( 'view:node' ); // -> true
  44988. *
  44989. * rootEditableElement.is( 'model:element' ); // -> false
  44990. * rootEditableElement.is( 'documentFragment' ); // -> false
  44991. *
  44992. * Assuming that the object being checked is a root editable element, you can also check its
  44993. * {@link module:engine/view/rooteditableelement~RootEditableElement#name name}:
  44994. *
  44995. * rootEditableElement.is( 'element', 'div' ); // -> true if this is a div root editable element
  44996. * rootEditableElement.is( 'rootElement', 'div' ); // -> same as above
  44997. * text.is( 'element', 'div' ); -> false
  44998. *
  44999. * {@link module:engine/view/node~Node#is Check the entire list of view objects} which implement the `is()` method.
  45000. *
  45001. * @param {String} type Type to check.
  45002. * @param {String} [name] Element name.
  45003. * @returns {Boolean}
  45004. */
  45005. is( type, name = null ) {
  45006. if ( !name ) {
  45007. return type === 'rootElement' || type === 'view:rootElement' ||
  45008. // From super.is(). This is highly utilised method and cannot call super. See ckeditor/ckeditor5#6529.
  45009. type === 'editableElement' || type === 'view:editableElement' ||
  45010. type === 'containerElement' || type === 'view:containerElement' ||
  45011. type === 'element' || type === 'view:element' ||
  45012. type === 'node' || type === 'view:node';
  45013. } else {
  45014. return name === this.name && (
  45015. type === 'rootElement' || type === 'view:rootElement' ||
  45016. // From super.is(). This is highly utilised method and cannot call super. See ckeditor/ckeditor5#6529.
  45017. type === 'editableElement' || type === 'view:editableElement' ||
  45018. type === 'containerElement' || type === 'view:containerElement' ||
  45019. type === 'element' || type === 'view:element'
  45020. );
  45021. }
  45022. }
  45023. get rootName() {
  45024. return this.getCustomProperty( rootNameSymbol );
  45025. }
  45026. set rootName( rootName ) {
  45027. this._setCustomProperty( rootNameSymbol, rootName );
  45028. }
  45029. /**
  45030. * Overrides old element name and sets new one.
  45031. * This is needed because view roots are created before they are attached to the DOM.
  45032. * The name of the root element is temporary at this stage. It has to be changed when the
  45033. * view root element is attached to the DOM element.
  45034. *
  45035. * @protected
  45036. * @param {String} name The new name of element.
  45037. */
  45038. set _name( name ) {
  45039. this.name = name;
  45040. }
  45041. }
  45042. /***/ }),
  45043. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/selection.js":
  45044. /*!***********************************************************************!*\
  45045. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/selection.js ***!
  45046. \***********************************************************************/
  45047. /*! exports provided: default */
  45048. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  45049. "use strict";
  45050. __webpack_require__.r(__webpack_exports__);
  45051. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Selection; });
  45052. /* 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");
  45053. /* harmony import */ var _range__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./range */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/range.js");
  45054. /* harmony import */ var _position__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./position */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/position.js");
  45055. /* 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");
  45056. /* 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");
  45057. /* harmony import */ var _node__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./node */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/node.js");
  45058. /* 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");
  45059. /* 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");
  45060. /* harmony import */ var _documentselection__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./documentselection */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/documentselection.js");
  45061. /**
  45062. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  45063. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  45064. */
  45065. /**
  45066. * @module engine/view/selection
  45067. */
  45068. /**
  45069. * Class representing an arbirtary selection in the view.
  45070. * See also {@link module:engine/view/documentselection~DocumentSelection}.
  45071. *
  45072. * New selection instances can be created via the constructor or one these methods:
  45073. *
  45074. * * {@link module:engine/view/view~View#createSelection `View#createSelection()`},
  45075. * * {@link module:engine/view/upcastwriter~UpcastWriter#createSelection `UpcastWriter#createSelection()`}.
  45076. *
  45077. * A selection can consist of {@link module:engine/view/range~Range ranges} that can be set by using
  45078. * the {@link module:engine/view/selection~Selection#setTo `Selection#setTo()`} method.
  45079. */
  45080. class Selection {
  45081. /**
  45082. * Creates new selection instance.
  45083. *
  45084. * **Note**: The selection constructor is available as a factory method:
  45085. *
  45086. * * {@link module:engine/view/view~View#createSelection `View#createSelection()`},
  45087. * * {@link module:engine/view/upcastwriter~UpcastWriter#createSelection `UpcastWriter#createSelection()`}.
  45088. *
  45089. * // Creates empty selection without ranges.
  45090. * const selection = writer.createSelection();
  45091. *
  45092. * // Creates selection at the given range.
  45093. * const range = writer.createRange( start, end );
  45094. * const selection = writer.createSelection( range );
  45095. *
  45096. * // Creates selection at the given ranges
  45097. * const ranges = [ writer.createRange( start1, end2 ), writer.createRange( star2, end2 ) ];
  45098. * const selection = writer.createSelection( ranges );
  45099. *
  45100. * // Creates selection from the other selection.
  45101. * const otherSelection = writer.createSelection();
  45102. * const selection = writer.createSelection( otherSelection );
  45103. *
  45104. * // Creates selection from the document selection.
  45105. * const selection = writer.createSelection( editor.editing.view.document.selection );
  45106. *
  45107. * // Creates selection at the given position.
  45108. * const position = writer.createPositionFromPath( root, path );
  45109. * const selection = writer.createSelection( position );
  45110. *
  45111. * // Creates collapsed selection at the position of given item and offset.
  45112. * const paragraph = writer.createContainerElement( 'paragraph' );
  45113. * const selection = writer.createSelection( paragraph, offset );
  45114. *
  45115. * // Creates a range inside an {@link module:engine/view/element~Element element} which starts before the
  45116. * // first child of that element and ends after the last child of that element.
  45117. * const selection = writer.createSelection( paragraph, 'in' );
  45118. *
  45119. * // Creates a range on an {@link module:engine/view/item~Item item} which starts before the item and ends
  45120. * // just after the item.
  45121. * const selection = writer.createSelection( paragraph, 'on' );
  45122. *
  45123. * `Selection`'s constructor allow passing additional options (`backward`, `fake` and `label`) as the last argument.
  45124. *
  45125. * // Creates backward selection.
  45126. * const selection = writer.createSelection( range, { backward: true } );
  45127. *
  45128. * Fake selection does not render as browser native selection over selected elements and is hidden to the user.
  45129. * This way, no native selection UI artifacts are displayed to the user and selection over elements can be
  45130. * represented in other way, for example by applying proper CSS class.
  45131. *
  45132. * Additionally fake's selection label can be provided. It will be used to describe fake selection in DOM
  45133. * (and be properly handled by screen readers).
  45134. *
  45135. * // Creates fake selection with label.
  45136. * const selection = writer.createSelection( range, { fake: true, label: 'foo' } );
  45137. *
  45138. * @param {module:engine/view/selection~Selectable} [selectable=null]
  45139. * @param {Number|'before'|'end'|'after'|'on'|'in'} [placeOrOffset] Offset or place when selectable is an `Item`.
  45140. * @param {Object} [options]
  45141. * @param {Boolean} [options.backward] Sets this selection instance to be backward.
  45142. * @param {Boolean} [options.fake] Sets this selection instance to be marked as `fake`.
  45143. * @param {String} [options.label] Label for the fake selection.
  45144. */
  45145. constructor( selectable = null, placeOrOffset, options ) {
  45146. /**
  45147. * Stores all ranges that are selected.
  45148. *
  45149. * @protected
  45150. * @member {Array.<module:engine/view/range~Range>}
  45151. */
  45152. this._ranges = [];
  45153. /**
  45154. * Specifies whether the last added range was added as a backward or forward range.
  45155. *
  45156. * @protected
  45157. * @member {Boolean}
  45158. */
  45159. this._lastRangeBackward = false;
  45160. /**
  45161. * Specifies whether selection instance is fake.
  45162. *
  45163. * @private
  45164. * @member {Boolean}
  45165. */
  45166. this._isFake = false;
  45167. /**
  45168. * Fake selection's label.
  45169. *
  45170. * @private
  45171. * @member {String}
  45172. */
  45173. this._fakeSelectionLabel = '';
  45174. this.setTo( selectable, placeOrOffset, options );
  45175. }
  45176. /**
  45177. * Returns true if selection instance is marked as `fake`.
  45178. *
  45179. * @see #setTo
  45180. * @type {Boolean}
  45181. */
  45182. get isFake() {
  45183. return this._isFake;
  45184. }
  45185. /**
  45186. * Returns fake selection label.
  45187. *
  45188. * @see #setTo
  45189. * @type {String}
  45190. */
  45191. get fakeSelectionLabel() {
  45192. return this._fakeSelectionLabel;
  45193. }
  45194. /**
  45195. * Selection anchor. Anchor may be described as a position where the selection starts. Together with
  45196. * {@link #focus focus} they define the direction of selection, which is important
  45197. * when expanding/shrinking selection. Anchor is always the start or end of the most recent added range.
  45198. * It may be a bit unintuitive when there are multiple ranges in selection.
  45199. *
  45200. * @see #focus
  45201. * @type {module:engine/view/position~Position}
  45202. */
  45203. get anchor() {
  45204. if ( !this._ranges.length ) {
  45205. return null;
  45206. }
  45207. const range = this._ranges[ this._ranges.length - 1 ];
  45208. const anchor = this._lastRangeBackward ? range.end : range.start;
  45209. return anchor.clone();
  45210. }
  45211. /**
  45212. * Selection focus. Focus is a position where the selection ends.
  45213. *
  45214. * @see #anchor
  45215. * @type {module:engine/view/position~Position}
  45216. */
  45217. get focus() {
  45218. if ( !this._ranges.length ) {
  45219. return null;
  45220. }
  45221. const range = this._ranges[ this._ranges.length - 1 ];
  45222. const focus = this._lastRangeBackward ? range.start : range.end;
  45223. return focus.clone();
  45224. }
  45225. /**
  45226. * Returns whether the selection is collapsed. Selection is collapsed when there is exactly one range which is
  45227. * collapsed.
  45228. *
  45229. * @type {Boolean}
  45230. */
  45231. get isCollapsed() {
  45232. return this.rangeCount === 1 && this._ranges[ 0 ].isCollapsed;
  45233. }
  45234. /**
  45235. * Returns number of ranges in selection.
  45236. *
  45237. * @type {Number}
  45238. */
  45239. get rangeCount() {
  45240. return this._ranges.length;
  45241. }
  45242. /**
  45243. * Specifies whether the {@link #focus} precedes {@link #anchor}.
  45244. *
  45245. * @type {Boolean}
  45246. */
  45247. get isBackward() {
  45248. return !this.isCollapsed && this._lastRangeBackward;
  45249. }
  45250. /**
  45251. * {@link module:engine/view/editableelement~EditableElement EditableElement} instance that contains this selection, or `null`
  45252. * if the selection is not inside an editable element.
  45253. *
  45254. * @type {module:engine/view/editableelement~EditableElement|null}
  45255. */
  45256. get editableElement() {
  45257. if ( this.anchor ) {
  45258. return this.anchor.editableElement;
  45259. }
  45260. return null;
  45261. }
  45262. /**
  45263. * Returns an iterable that contains copies of all ranges added to the selection.
  45264. *
  45265. * @returns {Iterable.<module:engine/view/range~Range>}
  45266. */
  45267. * getRanges() {
  45268. for ( const range of this._ranges ) {
  45269. yield range.clone();
  45270. }
  45271. }
  45272. /**
  45273. * Returns copy of the first range in the selection. First range is the one which
  45274. * {@link module:engine/view/range~Range#start start} position {@link module:engine/view/position~Position#isBefore is before} start
  45275. * position of all other ranges (not to confuse with the first range added to the selection).
  45276. * Returns `null` if no ranges are added to selection.
  45277. *
  45278. * @returns {module:engine/view/range~Range|null}
  45279. */
  45280. getFirstRange() {
  45281. let first = null;
  45282. for ( const range of this._ranges ) {
  45283. if ( !first || range.start.isBefore( first.start ) ) {
  45284. first = range;
  45285. }
  45286. }
  45287. return first ? first.clone() : null;
  45288. }
  45289. /**
  45290. * Returns copy of the last range in the selection. Last range is the one which {@link module:engine/view/range~Range#end end}
  45291. * position {@link module:engine/view/position~Position#isAfter is after} end position of all other ranges (not to confuse
  45292. * with the last range added to the selection). Returns `null` if no ranges are added to selection.
  45293. *
  45294. * @returns {module:engine/view/range~Range|null}
  45295. */
  45296. getLastRange() {
  45297. let last = null;
  45298. for ( const range of this._ranges ) {
  45299. if ( !last || range.end.isAfter( last.end ) ) {
  45300. last = range;
  45301. }
  45302. }
  45303. return last ? last.clone() : null;
  45304. }
  45305. /**
  45306. * Returns copy of the first position in the selection. First position is the position that
  45307. * {@link module:engine/view/position~Position#isBefore is before} any other position in the selection ranges.
  45308. * Returns `null` if no ranges are added to selection.
  45309. *
  45310. * @returns {module:engine/view/position~Position|null}
  45311. */
  45312. getFirstPosition() {
  45313. const firstRange = this.getFirstRange();
  45314. return firstRange ? firstRange.start.clone() : null;
  45315. }
  45316. /**
  45317. * Returns copy of the last position in the selection. Last position is the position that
  45318. * {@link module:engine/view/position~Position#isAfter is after} any other position in the selection ranges.
  45319. * Returns `null` if no ranges are added to selection.
  45320. *
  45321. * @returns {module:engine/view/position~Position|null}
  45322. */
  45323. getLastPosition() {
  45324. const lastRange = this.getLastRange();
  45325. return lastRange ? lastRange.end.clone() : null;
  45326. }
  45327. /**
  45328. * Checks whether, this selection is equal to given selection. Selections are equal if they have same directions,
  45329. * same number of ranges and all ranges from one selection equal to a range from other selection.
  45330. *
  45331. * @param {module:engine/view/selection~Selection|module:engine/view/documentselection~DocumentSelection} otherSelection
  45332. * Selection to compare with.
  45333. * @returns {Boolean} `true` if selections are equal, `false` otherwise.
  45334. */
  45335. isEqual( otherSelection ) {
  45336. if ( this.isFake != otherSelection.isFake ) {
  45337. return false;
  45338. }
  45339. if ( this.isFake && this.fakeSelectionLabel != otherSelection.fakeSelectionLabel ) {
  45340. return false;
  45341. }
  45342. if ( this.rangeCount != otherSelection.rangeCount ) {
  45343. return false;
  45344. } else if ( this.rangeCount === 0 ) {
  45345. return true;
  45346. }
  45347. if ( !this.anchor.isEqual( otherSelection.anchor ) || !this.focus.isEqual( otherSelection.focus ) ) {
  45348. return false;
  45349. }
  45350. for ( const thisRange of this._ranges ) {
  45351. let found = false;
  45352. for ( const otherRange of otherSelection._ranges ) {
  45353. if ( thisRange.isEqual( otherRange ) ) {
  45354. found = true;
  45355. break;
  45356. }
  45357. }
  45358. if ( !found ) {
  45359. return false;
  45360. }
  45361. }
  45362. return true;
  45363. }
  45364. /**
  45365. * Checks whether this selection is similar to given selection. Selections are similar if they have same directions, same
  45366. * number of ranges, and all {@link module:engine/view/range~Range#getTrimmed trimmed} ranges from one selection are
  45367. * equal to any trimmed range from other selection.
  45368. *
  45369. * @param {module:engine/view/selection~Selection|module:engine/view/documentselection~DocumentSelection} otherSelection
  45370. * Selection to compare with.
  45371. * @returns {Boolean} `true` if selections are similar, `false` otherwise.
  45372. */
  45373. isSimilar( otherSelection ) {
  45374. if ( this.isBackward != otherSelection.isBackward ) {
  45375. return false;
  45376. }
  45377. const numOfRangesA = Object(_ckeditor_ckeditor5_utils_src_count__WEBPACK_IMPORTED_MODULE_6__["default"])( this.getRanges() );
  45378. const numOfRangesB = Object(_ckeditor_ckeditor5_utils_src_count__WEBPACK_IMPORTED_MODULE_6__["default"])( otherSelection.getRanges() );
  45379. // If selections have different number of ranges, they cannot be similar.
  45380. if ( numOfRangesA != numOfRangesB ) {
  45381. return false;
  45382. }
  45383. // If both selections have no ranges, they are similar.
  45384. if ( numOfRangesA == 0 ) {
  45385. return true;
  45386. }
  45387. // Check if each range in one selection has a similar range in other selection.
  45388. for ( let rangeA of this.getRanges() ) {
  45389. rangeA = rangeA.getTrimmed();
  45390. let found = false;
  45391. for ( let rangeB of otherSelection.getRanges() ) {
  45392. rangeB = rangeB.getTrimmed();
  45393. if ( rangeA.start.isEqual( rangeB.start ) && rangeA.end.isEqual( rangeB.end ) ) {
  45394. found = true;
  45395. break;
  45396. }
  45397. }
  45398. // For `rangeA`, neither range in `otherSelection` was similar. So selections are not similar.
  45399. if ( !found ) {
  45400. return false;
  45401. }
  45402. }
  45403. // There were no ranges that weren't matched. Selections are similar.
  45404. return true;
  45405. }
  45406. /**
  45407. * Returns the selected element. {@link module:engine/view/element~Element Element} is considered as selected if there is only
  45408. * one range in the selection, and that range contains exactly one element.
  45409. * Returns `null` if there is no selected element.
  45410. *
  45411. * @returns {module:engine/view/element~Element|null}
  45412. */
  45413. getSelectedElement() {
  45414. if ( this.rangeCount !== 1 ) {
  45415. return null;
  45416. }
  45417. return this.getFirstRange().getContainedElement();
  45418. }
  45419. /**
  45420. * Sets this selection's ranges and direction to the specified location based on the given
  45421. * {@link module:engine/view/selection~Selectable selectable}.
  45422. *
  45423. * // Sets selection to the given range.
  45424. * const range = writer.createRange( start, end );
  45425. * selection.setTo( range );
  45426. *
  45427. * // Sets selection to given ranges.
  45428. * const ranges = [ writer.createRange( start1, end2 ), writer.createRange( star2, end2 ) ];
  45429. * selection.setTo( range );
  45430. *
  45431. * // Sets selection to the other selection.
  45432. * const otherSelection = writer.createSelection();
  45433. * selection.setTo( otherSelection );
  45434. *
  45435. * // Sets selection to contents of DocumentSelection.
  45436. * selection.setTo( editor.editing.view.document.selection );
  45437. *
  45438. * // Sets collapsed selection at the given position.
  45439. * const position = writer.createPositionAt( root, path );
  45440. * selection.setTo( position );
  45441. *
  45442. * // Sets collapsed selection at the position of given item and offset.
  45443. * selection.setTo( paragraph, offset );
  45444. *
  45445. * Creates a range inside an {@link module:engine/view/element~Element element} which starts before the first child of
  45446. * that element and ends after the last child of that element.
  45447. *
  45448. * selection.setTo( paragraph, 'in' );
  45449. *
  45450. * Creates a range on an {@link module:engine/view/item~Item item} which starts before the item and ends just after the item.
  45451. *
  45452. * selection.setTo( paragraph, 'on' );
  45453. *
  45454. * // Clears selection. Removes all ranges.
  45455. * selection.setTo( null );
  45456. *
  45457. * `Selection#setTo()` method allow passing additional options (`backward`, `fake` and `label`) as the last argument.
  45458. *
  45459. * // Sets selection as backward.
  45460. * selection.setTo( range, { backward: true } );
  45461. *
  45462. * Fake selection does not render as browser native selection over selected elements and is hidden to the user.
  45463. * This way, no native selection UI artifacts are displayed to the user and selection over elements can be
  45464. * represented in other way, for example by applying proper CSS class.
  45465. *
  45466. * Additionally fake's selection label can be provided. It will be used to describe fake selection in DOM
  45467. * (and be properly handled by screen readers).
  45468. *
  45469. * // Creates fake selection with label.
  45470. * selection.setTo( range, { fake: true, label: 'foo' } );
  45471. *
  45472. * @fires change
  45473. * @param {module:engine/view/selection~Selectable} selectable
  45474. * @param {Number|'before'|'end'|'after'|'on'|'in'} [placeOrOffset] Sets place or offset of the selection.
  45475. * @param {Object} [options]
  45476. * @param {Boolean} [options.backward] Sets this selection instance to be backward.
  45477. * @param {Boolean} [options.fake] Sets this selection instance to be marked as `fake`.
  45478. * @param {String} [options.label] Label for the fake selection.
  45479. */
  45480. setTo( selectable, placeOrOffset, options ) {
  45481. if ( selectable === null ) {
  45482. this._setRanges( [] );
  45483. this._setFakeOptions( placeOrOffset );
  45484. } else if ( selectable instanceof Selection || selectable instanceof _documentselection__WEBPACK_IMPORTED_MODULE_8__["default"] ) {
  45485. this._setRanges( selectable.getRanges(), selectable.isBackward );
  45486. this._setFakeOptions( { fake: selectable.isFake, label: selectable.fakeSelectionLabel } );
  45487. } else if ( selectable instanceof _range__WEBPACK_IMPORTED_MODULE_1__["default"] ) {
  45488. this._setRanges( [ selectable ], placeOrOffset && placeOrOffset.backward );
  45489. this._setFakeOptions( placeOrOffset );
  45490. } else if ( selectable instanceof _position__WEBPACK_IMPORTED_MODULE_2__["default"] ) {
  45491. this._setRanges( [ new _range__WEBPACK_IMPORTED_MODULE_1__["default"]( selectable ) ] );
  45492. this._setFakeOptions( placeOrOffset );
  45493. } else if ( selectable instanceof _node__WEBPACK_IMPORTED_MODULE_5__["default"] ) {
  45494. const backward = !!options && !!options.backward;
  45495. let range;
  45496. if ( placeOrOffset === undefined ) {
  45497. /**
  45498. * selection.setTo requires the second parameter when the first parameter is a node.
  45499. *
  45500. * @error view-selection-setto-required-second-parameter
  45501. */
  45502. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"]( 'view-selection-setto-required-second-parameter', this );
  45503. } else if ( placeOrOffset == 'in' ) {
  45504. range = _range__WEBPACK_IMPORTED_MODULE_1__["default"]._createIn( selectable );
  45505. } else if ( placeOrOffset == 'on' ) {
  45506. range = _range__WEBPACK_IMPORTED_MODULE_1__["default"]._createOn( selectable );
  45507. } else {
  45508. range = new _range__WEBPACK_IMPORTED_MODULE_1__["default"]( _position__WEBPACK_IMPORTED_MODULE_2__["default"]._createAt( selectable, placeOrOffset ) );
  45509. }
  45510. this._setRanges( [ range ], backward );
  45511. this._setFakeOptions( options );
  45512. } else if ( Object(_ckeditor_ckeditor5_utils_src_isiterable__WEBPACK_IMPORTED_MODULE_7__["default"])( selectable ) ) {
  45513. // We assume that the selectable is an iterable of ranges.
  45514. // Array.from() is used to prevent setting ranges to the old iterable
  45515. this._setRanges( selectable, placeOrOffset && placeOrOffset.backward );
  45516. this._setFakeOptions( placeOrOffset );
  45517. } else {
  45518. /**
  45519. * Cannot set selection to given place.
  45520. *
  45521. * @error view-selection-setto-not-selectable
  45522. */
  45523. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"]( 'view-selection-setto-not-selectable', this );
  45524. }
  45525. this.fire( 'change' );
  45526. }
  45527. /**
  45528. * Moves {@link #focus} to the specified location.
  45529. *
  45530. * The location can be specified in the same form as {@link module:engine/view/view~View#createPositionAt view.createPositionAt()}
  45531. * parameters.
  45532. *
  45533. * @fires change
  45534. * @param {module:engine/view/item~Item|module:engine/view/position~Position} itemOrPosition
  45535. * @param {Number|'end'|'before'|'after'} [offset] Offset or one of the flags. Used only when
  45536. * first parameter is a {@link module:engine/view/item~Item view item}.
  45537. */
  45538. setFocus( itemOrPosition, offset ) {
  45539. if ( this.anchor === null ) {
  45540. /**
  45541. * Cannot set selection focus if there are no ranges in selection.
  45542. *
  45543. * @error view-selection-setfocus-no-ranges
  45544. */
  45545. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"]( 'view-selection-setfocus-no-ranges', this );
  45546. }
  45547. const newFocus = _position__WEBPACK_IMPORTED_MODULE_2__["default"]._createAt( itemOrPosition, offset );
  45548. if ( newFocus.compareWith( this.focus ) == 'same' ) {
  45549. return;
  45550. }
  45551. const anchor = this.anchor;
  45552. this._ranges.pop();
  45553. if ( newFocus.compareWith( anchor ) == 'before' ) {
  45554. this._addRange( new _range__WEBPACK_IMPORTED_MODULE_1__["default"]( newFocus, anchor ), true );
  45555. } else {
  45556. this._addRange( new _range__WEBPACK_IMPORTED_MODULE_1__["default"]( anchor, newFocus ) );
  45557. }
  45558. this.fire( 'change' );
  45559. }
  45560. /**
  45561. * Checks whether this object is of the given type.
  45562. *
  45563. * selection.is( 'selection' ); // -> true
  45564. * selection.is( 'view:selection' ); // -> true
  45565. *
  45566. * selection.is( 'model:selection' ); // -> false
  45567. * selection.is( 'element' ); // -> false
  45568. * selection.is( 'range' ); // -> false
  45569. *
  45570. * {@link module:engine/view/node~Node#is Check the entire list of view objects} which implement the `is()` method.
  45571. *
  45572. * @param {String} type
  45573. * @returns {Boolean}
  45574. */
  45575. is( type ) {
  45576. return type === 'selection' || type === 'view:selection';
  45577. }
  45578. /**
  45579. * Replaces all ranges that were added to the selection with given array of ranges. Last range of the array
  45580. * is treated like the last added range and is used to set {@link #anchor anchor} and {@link #focus focus}.
  45581. * Accepts a flag describing in which way the selection is made.
  45582. *
  45583. * @private
  45584. * @param {Iterable.<module:engine/view/range~Range>} newRanges Iterable object of ranges to set.
  45585. * @param {Boolean} [isLastBackward=false] Flag describing if last added range was selected forward - from start to end
  45586. * (`false`) or backward - from end to start (`true`). Defaults to `false`.
  45587. */
  45588. _setRanges( newRanges, isLastBackward = false ) {
  45589. // New ranges should be copied to prevent removing them by setting them to `[]` first.
  45590. // Only applies to situations when selection is set to the same selection or same selection's ranges.
  45591. newRanges = Array.from( newRanges );
  45592. this._ranges = [];
  45593. for ( const range of newRanges ) {
  45594. this._addRange( range );
  45595. }
  45596. this._lastRangeBackward = !!isLastBackward;
  45597. }
  45598. /**
  45599. * Sets this selection instance to be marked as `fake`. A fake selection does not render as browser native selection
  45600. * over selected elements and is hidden to the user. This way, no native selection UI artifacts are displayed to
  45601. * the user and selection over elements can be represented in other way, for example by applying proper CSS class.
  45602. *
  45603. * Additionally fake's selection label can be provided. It will be used to describe fake selection in DOM (and be
  45604. * properly handled by screen readers).
  45605. *
  45606. * @private
  45607. * @param {Object} [options] Options.
  45608. * @param {Boolean} [options.fake] If set to true selection will be marked as `fake`.
  45609. * @param {String} [options.label=''] Fake selection label.
  45610. */
  45611. _setFakeOptions( options = {} ) {
  45612. this._isFake = !!options.fake;
  45613. this._fakeSelectionLabel = options.fake ? options.label || '' : '';
  45614. }
  45615. /**
  45616. * Adds a range to the selection. Added range is copied. This means that passed range is not saved in the
  45617. * selection instance and you can safely operate on it.
  45618. *
  45619. * Accepts a flag describing in which way the selection is made - passed range might be selected from
  45620. * {@link module:engine/view/range~Range#start start} to {@link module:engine/view/range~Range#end end}
  45621. * or from {@link module:engine/view/range~Range#end end} to {@link module:engine/view/range~Range#start start}.
  45622. * The flag is used to set {@link #anchor anchor} and {@link #focus focus} properties.
  45623. *
  45624. * Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `view-selection-range-intersects` if added range intersects
  45625. * with ranges already stored in Selection instance.
  45626. *
  45627. * @private
  45628. * @fires change
  45629. * @param {module:engine/view/range~Range} range
  45630. * @param {Boolean} [isBackward]
  45631. */
  45632. _addRange( range, isBackward = false ) {
  45633. if ( !( range instanceof _range__WEBPACK_IMPORTED_MODULE_1__["default"] ) ) {
  45634. /**
  45635. * Selection range set to an object that is not an instance of {@link module:engine/view/range~Range}.
  45636. *
  45637. * @error view-selection-add-range-not-range
  45638. */
  45639. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"](
  45640. 'view-selection-add-range-not-range',
  45641. this
  45642. );
  45643. }
  45644. this._pushRange( range );
  45645. this._lastRangeBackward = !!isBackward;
  45646. }
  45647. /**
  45648. * Adds range to selection - creates copy of given range so it can be safely used and modified.
  45649. *
  45650. * Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `view-selection-range-intersects` if added range intersects
  45651. * with ranges already stored in selection instance.
  45652. *
  45653. * @private
  45654. * @param {module:engine/view/range~Range} range
  45655. */
  45656. _pushRange( range ) {
  45657. for ( const storedRange of this._ranges ) {
  45658. if ( range.isIntersecting( storedRange ) ) {
  45659. /**
  45660. * Trying to add a range that intersects with another range from selection.
  45661. *
  45662. * @error view-selection-range-intersects
  45663. * @param {module:engine/view/range~Range} addedRange Range that was added to the selection.
  45664. * @param {module:engine/view/range~Range} intersectingRange Range from selection that intersects with `addedRange`.
  45665. */
  45666. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"](
  45667. 'view-selection-range-intersects',
  45668. this,
  45669. { addedRange: range, intersectingRange: storedRange }
  45670. );
  45671. }
  45672. }
  45673. this._ranges.push( new _range__WEBPACK_IMPORTED_MODULE_1__["default"]( range.start, range.end ) );
  45674. }
  45675. /**
  45676. * Fired whenever selection ranges are changed through {@link ~Selection Selection API}.
  45677. *
  45678. * @event change
  45679. */
  45680. }
  45681. Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_3__["default"])( Selection, _ckeditor_ckeditor5_utils_src_emittermixin__WEBPACK_IMPORTED_MODULE_4__["default"] );
  45682. /**
  45683. * An entity that is used to set selection.
  45684. *
  45685. * See also {@link module:engine/view/selection~Selection#setTo}
  45686. *
  45687. * @typedef {
  45688. * module:engine/view/selection~Selection|
  45689. * module:engine/view/documentselection~DocumentSelection|
  45690. * module:engine/view/position~Position|
  45691. * Iterable.<module:engine/view/range~Range>|
  45692. * module:engine/view/range~Range|
  45693. * module:engine/view/item~Item|
  45694. * null
  45695. * } module:engine/view/selection~Selectable
  45696. */
  45697. /***/ }),
  45698. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/styles/background.js":
  45699. /*!*******************************************************************************!*\
  45700. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/styles/background.js ***!
  45701. \*******************************************************************************/
  45702. /*! exports provided: addBackgroundRules */
  45703. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  45704. "use strict";
  45705. __webpack_require__.r(__webpack_exports__);
  45706. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addBackgroundRules", function() { return addBackgroundRules; });
  45707. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/styles/utils.js");
  45708. /**
  45709. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  45710. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  45711. */
  45712. /**
  45713. * @module engine/view/styles/background
  45714. */
  45715. /**
  45716. * Adds a background CSS styles processing rules.
  45717. *
  45718. * editor.data.addStyleProcessorRules( addBackgroundRules );
  45719. *
  45720. * The normalized value is stored as:
  45721. *
  45722. * const styles = {
  45723. * background: {
  45724. * color,
  45725. * repeat,
  45726. * position,
  45727. * attachment,
  45728. * image
  45729. * }
  45730. * };
  45731. *
  45732. * **Note**: Currently only `'background-color'` longhand value is parsed besides `'background'` shorthand. The reducer also supports only
  45733. * `'background-color'` value.
  45734. *
  45735. * @param {module:engine/view/stylesmap~StylesProcessor} stylesProcessor
  45736. */
  45737. function addBackgroundRules( stylesProcessor ) {
  45738. stylesProcessor.setNormalizer( 'background', normalizeBackground );
  45739. stylesProcessor.setNormalizer( 'background-color', value => ( { path: 'background.color', value } ) );
  45740. stylesProcessor.setReducer( 'background', value => {
  45741. const ret = [];
  45742. ret.push( [ 'background-color', value.color ] );
  45743. return ret;
  45744. } );
  45745. }
  45746. function normalizeBackground( value ) {
  45747. const background = {};
  45748. const parts = Object(_utils__WEBPACK_IMPORTED_MODULE_0__["getShorthandValues"])( value );
  45749. for ( const part of parts ) {
  45750. if ( Object(_utils__WEBPACK_IMPORTED_MODULE_0__["isRepeat"])( part ) ) {
  45751. background.repeat = background.repeat || [];
  45752. background.repeat.push( part );
  45753. } else if ( Object(_utils__WEBPACK_IMPORTED_MODULE_0__["isPosition"])( part ) ) {
  45754. background.position = background.position || [];
  45755. background.position.push( part );
  45756. } else if ( Object(_utils__WEBPACK_IMPORTED_MODULE_0__["isAttachment"])( part ) ) {
  45757. background.attachment = part;
  45758. } else if ( Object(_utils__WEBPACK_IMPORTED_MODULE_0__["isColor"])( part ) ) {
  45759. background.color = part;
  45760. } else if ( Object(_utils__WEBPACK_IMPORTED_MODULE_0__["isURL"])( part ) ) {
  45761. background.image = part;
  45762. }
  45763. }
  45764. return {
  45765. path: 'background',
  45766. value: background
  45767. };
  45768. }
  45769. /***/ }),
  45770. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/styles/border.js":
  45771. /*!***************************************************************************!*\
  45772. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/styles/border.js ***!
  45773. \***************************************************************************/
  45774. /*! exports provided: addBorderRules */
  45775. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  45776. "use strict";
  45777. __webpack_require__.r(__webpack_exports__);
  45778. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addBorderRules", function() { return addBorderRules; });
  45779. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/styles/utils.js");
  45780. /**
  45781. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  45782. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  45783. */
  45784. /**
  45785. * @module engine/view/styles/border
  45786. */
  45787. /**
  45788. * Adds a border CSS styles processing rules.
  45789. *
  45790. * editor.data.addStyleProcessorRules( addBorderRules );
  45791. *
  45792. * This rules merges all [border](https://developer.mozilla.org/en-US/docs/Web/CSS/border) styles notation shorthands:
  45793. *
  45794. * - border
  45795. * - border-top
  45796. * - border-right
  45797. * - border-bottom
  45798. * - border-left
  45799. * - border-color
  45800. * - border-style
  45801. * - border-width
  45802. *
  45803. * and all corresponding longhand forms (like `border-top-color`, `border-top-style`, etc).
  45804. *
  45805. * It does not handle other shorthands (like `border-radius` or `border-image`).
  45806. *
  45807. * The normalized model stores border values as:
  45808. *
  45809. * const styles = {
  45810. * border: {
  45811. * color: { top, right, bottom, left },
  45812. * style: { top, right, bottom, left },
  45813. * width: { top, right, bottom, left },
  45814. * }
  45815. * };
  45816. *
  45817. * @param {module:engine/view/stylesmap~StylesProcessor} stylesProcessor
  45818. */
  45819. function addBorderRules( stylesProcessor ) {
  45820. stylesProcessor.setNormalizer( 'border', borderNormalizer );
  45821. // Border-position shorthands.
  45822. stylesProcessor.setNormalizer( 'border-top', getBorderPositionNormalizer( 'top' ) );
  45823. stylesProcessor.setNormalizer( 'border-right', getBorderPositionNormalizer( 'right' ) );
  45824. stylesProcessor.setNormalizer( 'border-bottom', getBorderPositionNormalizer( 'bottom' ) );
  45825. stylesProcessor.setNormalizer( 'border-left', getBorderPositionNormalizer( 'left' ) );
  45826. // Border-property shorthands.
  45827. stylesProcessor.setNormalizer( 'border-color', getBorderPropertyNormalizer( 'color' ) );
  45828. stylesProcessor.setNormalizer( 'border-width', getBorderPropertyNormalizer( 'width' ) );
  45829. stylesProcessor.setNormalizer( 'border-style', getBorderPropertyNormalizer( 'style' ) );
  45830. // Border longhands.
  45831. stylesProcessor.setNormalizer( 'border-top-color', getBorderPropertyPositionNormalizer( 'color', 'top' ) );
  45832. stylesProcessor.setNormalizer( 'border-top-style', getBorderPropertyPositionNormalizer( 'style', 'top' ) );
  45833. stylesProcessor.setNormalizer( 'border-top-width', getBorderPropertyPositionNormalizer( 'width', 'top' ) );
  45834. stylesProcessor.setNormalizer( 'border-right-color', getBorderPropertyPositionNormalizer( 'color', 'right' ) );
  45835. stylesProcessor.setNormalizer( 'border-right-style', getBorderPropertyPositionNormalizer( 'style', 'right' ) );
  45836. stylesProcessor.setNormalizer( 'border-right-width', getBorderPropertyPositionNormalizer( 'width', 'right' ) );
  45837. stylesProcessor.setNormalizer( 'border-bottom-color', getBorderPropertyPositionNormalizer( 'color', 'bottom' ) );
  45838. stylesProcessor.setNormalizer( 'border-bottom-style', getBorderPropertyPositionNormalizer( 'style', 'bottom' ) );
  45839. stylesProcessor.setNormalizer( 'border-bottom-width', getBorderPropertyPositionNormalizer( 'width', 'bottom' ) );
  45840. stylesProcessor.setNormalizer( 'border-left-color', getBorderPropertyPositionNormalizer( 'color', 'left' ) );
  45841. stylesProcessor.setNormalizer( 'border-left-style', getBorderPropertyPositionNormalizer( 'style', 'left' ) );
  45842. stylesProcessor.setNormalizer( 'border-left-width', getBorderPropertyPositionNormalizer( 'width', 'left' ) );
  45843. stylesProcessor.setExtractor( 'border-top', getBorderPositionExtractor( 'top' ) );
  45844. stylesProcessor.setExtractor( 'border-right', getBorderPositionExtractor( 'right' ) );
  45845. stylesProcessor.setExtractor( 'border-bottom', getBorderPositionExtractor( 'bottom' ) );
  45846. stylesProcessor.setExtractor( 'border-left', getBorderPositionExtractor( 'left' ) );
  45847. stylesProcessor.setExtractor( 'border-top-color', 'border.color.top' );
  45848. stylesProcessor.setExtractor( 'border-right-color', 'border.color.right' );
  45849. stylesProcessor.setExtractor( 'border-bottom-color', 'border.color.bottom' );
  45850. stylesProcessor.setExtractor( 'border-left-color', 'border.color.left' );
  45851. stylesProcessor.setExtractor( 'border-top-width', 'border.width.top' );
  45852. stylesProcessor.setExtractor( 'border-right-width', 'border.width.right' );
  45853. stylesProcessor.setExtractor( 'border-bottom-width', 'border.width.bottom' );
  45854. stylesProcessor.setExtractor( 'border-left-width', 'border.width.left' );
  45855. stylesProcessor.setExtractor( 'border-top-style', 'border.style.top' );
  45856. stylesProcessor.setExtractor( 'border-right-style', 'border.style.right' );
  45857. stylesProcessor.setExtractor( 'border-bottom-style', 'border.style.bottom' );
  45858. stylesProcessor.setExtractor( 'border-left-style', 'border.style.left' );
  45859. stylesProcessor.setReducer( 'border-color', Object(_utils__WEBPACK_IMPORTED_MODULE_0__["getBoxSidesValueReducer"])( 'border-color' ) );
  45860. stylesProcessor.setReducer( 'border-style', Object(_utils__WEBPACK_IMPORTED_MODULE_0__["getBoxSidesValueReducer"])( 'border-style' ) );
  45861. stylesProcessor.setReducer( 'border-width', Object(_utils__WEBPACK_IMPORTED_MODULE_0__["getBoxSidesValueReducer"])( 'border-width' ) );
  45862. stylesProcessor.setReducer( 'border-top', getBorderPositionReducer( 'top' ) );
  45863. stylesProcessor.setReducer( 'border-right', getBorderPositionReducer( 'right' ) );
  45864. stylesProcessor.setReducer( 'border-bottom', getBorderPositionReducer( 'bottom' ) );
  45865. stylesProcessor.setReducer( 'border-left', getBorderPositionReducer( 'left' ) );
  45866. stylesProcessor.setReducer( 'border', getBorderReducer() );
  45867. stylesProcessor.setStyleRelation( 'border', [
  45868. 'border-color', 'border-style', 'border-width',
  45869. 'border-top', 'border-right', 'border-bottom', 'border-left',
  45870. 'border-top-color', 'border-right-color', 'border-bottom-color', 'border-left-color',
  45871. 'border-top-style', 'border-right-style', 'border-bottom-style', 'border-left-style',
  45872. 'border-top-width', 'border-right-width', 'border-bottom-width', 'border-left-width'
  45873. ] );
  45874. stylesProcessor.setStyleRelation( 'border-color', [
  45875. 'border-top-color', 'border-right-color', 'border-bottom-color', 'border-left-color'
  45876. ] );
  45877. stylesProcessor.setStyleRelation( 'border-style', [
  45878. 'border-top-style', 'border-right-style', 'border-bottom-style', 'border-left-style'
  45879. ] );
  45880. stylesProcessor.setStyleRelation( 'border-width', [
  45881. 'border-top-width', 'border-right-width', 'border-bottom-width', 'border-left-width'
  45882. ] );
  45883. stylesProcessor.setStyleRelation( 'border-top', [ 'border-top-color', 'border-top-style', 'border-top-width' ] );
  45884. stylesProcessor.setStyleRelation( 'border-right', [ 'border-right-color', 'border-right-style', 'border-right-width' ] );
  45885. stylesProcessor.setStyleRelation( 'border-bottom', [ 'border-bottom-color', 'border-bottom-style', 'border-bottom-width' ] );
  45886. stylesProcessor.setStyleRelation( 'border-left', [ 'border-left-color', 'border-left-style', 'border-left-width' ] );
  45887. }
  45888. function borderNormalizer( value ) {
  45889. const { color, style, width } = normalizeBorderShorthand( value );
  45890. return {
  45891. path: 'border',
  45892. value: {
  45893. color: Object(_utils__WEBPACK_IMPORTED_MODULE_0__["getBoxSidesValues"])( color ),
  45894. style: Object(_utils__WEBPACK_IMPORTED_MODULE_0__["getBoxSidesValues"])( style ),
  45895. width: Object(_utils__WEBPACK_IMPORTED_MODULE_0__["getBoxSidesValues"])( width )
  45896. }
  45897. };
  45898. }
  45899. function getBorderPositionNormalizer( side ) {
  45900. return value => {
  45901. const { color, style, width } = normalizeBorderShorthand( value );
  45902. const border = {};
  45903. if ( color !== undefined ) {
  45904. border.color = { [ side ]: color };
  45905. }
  45906. if ( style !== undefined ) {
  45907. border.style = { [ side ]: style };
  45908. }
  45909. if ( width !== undefined ) {
  45910. border.width = { [ side ]: width };
  45911. }
  45912. return {
  45913. path: 'border',
  45914. value: border
  45915. };
  45916. };
  45917. }
  45918. function getBorderPropertyNormalizer( propertyName ) {
  45919. return value => {
  45920. return {
  45921. path: 'border',
  45922. value: toBorderPropertyShorthand( value, propertyName )
  45923. };
  45924. };
  45925. }
  45926. function toBorderPropertyShorthand( value, property ) {
  45927. return {
  45928. [ property ]: Object(_utils__WEBPACK_IMPORTED_MODULE_0__["getBoxSidesValues"])( value )
  45929. };
  45930. }
  45931. function getBorderPropertyPositionNormalizer( property, side ) {
  45932. return value => {
  45933. return {
  45934. path: 'border',
  45935. value: {
  45936. [ property ]: {
  45937. [ side ]: value
  45938. }
  45939. }
  45940. };
  45941. };
  45942. }
  45943. function getBorderPositionExtractor( which ) {
  45944. return ( name, styles ) => {
  45945. if ( styles.border ) {
  45946. return extractBorderPosition( styles.border, which );
  45947. }
  45948. };
  45949. }
  45950. function extractBorderPosition( border, which ) {
  45951. const value = {};
  45952. if ( border.width && border.width[ which ] ) {
  45953. value.width = border.width[ which ];
  45954. }
  45955. if ( border.style && border.style[ which ] ) {
  45956. value.style = border.style[ which ];
  45957. }
  45958. if ( border.color && border.color[ which ] ) {
  45959. value.color = border.color[ which ];
  45960. }
  45961. return value;
  45962. }
  45963. function normalizeBorderShorthand( string ) {
  45964. const result = {};
  45965. const parts = Object(_utils__WEBPACK_IMPORTED_MODULE_0__["getShorthandValues"])( string );
  45966. for ( const part of parts ) {
  45967. if ( Object(_utils__WEBPACK_IMPORTED_MODULE_0__["isLength"])( part ) || /thin|medium|thick/.test( part ) ) {
  45968. result.width = part;
  45969. } else if ( Object(_utils__WEBPACK_IMPORTED_MODULE_0__["isLineStyle"])( part ) ) {
  45970. result.style = part;
  45971. } else {
  45972. result.color = part;
  45973. }
  45974. }
  45975. return result;
  45976. }
  45977. // The border reducer factory.
  45978. //
  45979. // It tries to produce the most optimal output for the specified styles.
  45980. //
  45981. // For border style:
  45982. //
  45983. // style: {top: "solid", bottom: "solid", right: "solid", left: "solid"}
  45984. //
  45985. // It will produce: `border-style: solid` output.
  45986. // For border style and color:
  45987. //
  45988. // color: {top: "#ff0", bottom: "#ff0", right: "#ff0", left: "#ff0"}
  45989. // style: {top: "solid", bottom: "solid", right: "solid", left: "solid"}
  45990. //
  45991. // It will produce: `border-color: #ff0; border-style: solid`
  45992. // If all border parameters are specified:
  45993. //
  45994. // color: {top: "#ff0", bottom: "#ff0", right: "#ff0", left: "#ff0"}
  45995. // style: {top: "solid", bottom: "solid", right: "solid", left: "solid"}
  45996. // width: {top: "2px", bottom: "2px", right: "2px", left: "2px"}
  45997. //
  45998. // It will combine everything into the single property: `border: 2px solid #ff0`.
  45999. //
  46000. // Definitions are merged only if all border selectors have the same values.
  46001. //
  46002. // @returns {Function}
  46003. function getBorderReducer() {
  46004. return value => {
  46005. const topStyles = extractBorderPosition( value, 'top' );
  46006. const rightStyles = extractBorderPosition( value, 'right' );
  46007. const bottomStyles = extractBorderPosition( value, 'bottom' );
  46008. const leftStyles = extractBorderPosition( value, 'left' );
  46009. const borderStyles = [ topStyles, rightStyles, bottomStyles, leftStyles ];
  46010. const borderStylesByType = {
  46011. width: getReducedStyleValueForType( borderStyles, 'width' ),
  46012. style: getReducedStyleValueForType( borderStyles, 'style' ),
  46013. color: getReducedStyleValueForType( borderStyles, 'color' )
  46014. };
  46015. // Try reducing to a single `border:` property.
  46016. const reducedBorderStyle = reduceBorderPosition( borderStylesByType, 'all' );
  46017. if ( reducedBorderStyle.length ) {
  46018. return reducedBorderStyle;
  46019. }
  46020. // Try reducing to `border-style:`, `border-width:`, `border-color:` properties.
  46021. const reducedStyleTypes = Object.entries( borderStylesByType ).reduce( ( reducedStyleTypes, [ type, value ] ) => {
  46022. if ( value ) {
  46023. reducedStyleTypes.push( [ `border-${ type }`, value ] );
  46024. // Remove it from the full set to not include it in the most specific properties later.
  46025. borderStyles.forEach( style => ( style[ type ] = null ) );
  46026. }
  46027. return reducedStyleTypes;
  46028. }, [] );
  46029. // The reduced properties (by type) and all the rest that could not be reduced.
  46030. return [
  46031. ...reducedStyleTypes,
  46032. ...reduceBorderPosition( topStyles, 'top' ),
  46033. ...reduceBorderPosition( rightStyles, 'right' ),
  46034. ...reduceBorderPosition( bottomStyles, 'bottom' ),
  46035. ...reduceBorderPosition( leftStyles, 'left' )
  46036. ];
  46037. };
  46038. // @param {Array.<Object>} styles The array of objects with `style`, `color`, `width` properties.
  46039. // @param {'width'|'style'|'color'} type
  46040. function getReducedStyleValueForType( styles, type ) {
  46041. return styles
  46042. .map( style => style[ type ] )
  46043. .reduce( ( result, style ) => result == style ? result : null );
  46044. }
  46045. }
  46046. function getBorderPositionReducer( which ) {
  46047. return value => reduceBorderPosition( value, which );
  46048. }
  46049. // Returns an array with reduced border styles depending on specified values.
  46050. //
  46051. // If all (width, style, color) border properties are specified, the returned selector will be
  46052. // merged into the group: `border-*: [width] [style] [color]`.
  46053. //
  46054. // Otherwise, the specific definitions will be returned: `border-(width|style|color)-*: [value]`.
  46055. //
  46056. // @param {Object|null} value Styles if defined.
  46057. // @param {'top'|'right'|'bottom'|'left'|'all'} which The border position.
  46058. // @returns {Array}
  46059. function reduceBorderPosition( value, which ) {
  46060. const borderTypes = [];
  46061. if ( value && value.width ) {
  46062. borderTypes.push( 'width' );
  46063. }
  46064. if ( value && value.style ) {
  46065. borderTypes.push( 'style' );
  46066. }
  46067. if ( value && value.color ) {
  46068. borderTypes.push( 'color' );
  46069. }
  46070. if ( borderTypes.length == 3 ) {
  46071. const borderValue = borderTypes.map( item => value[ item ] ).join( ' ' );
  46072. return [
  46073. which == 'all' ? [ 'border', borderValue ] : [ `border-${ which }`, borderValue ]
  46074. ];
  46075. }
  46076. // We are unable to reduce to a single `border:` property.
  46077. if ( which == 'all' ) {
  46078. return [];
  46079. }
  46080. return borderTypes.map( type => {
  46081. return [ `border-${ which }-${ type }`, value[ type ] ];
  46082. } );
  46083. }
  46084. /***/ }),
  46085. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/styles/margin.js":
  46086. /*!***************************************************************************!*\
  46087. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/styles/margin.js ***!
  46088. \***************************************************************************/
  46089. /*! exports provided: addMarginRules */
  46090. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  46091. "use strict";
  46092. __webpack_require__.r(__webpack_exports__);
  46093. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addMarginRules", function() { return addMarginRules; });
  46094. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/styles/utils.js");
  46095. /**
  46096. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  46097. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  46098. */
  46099. /**
  46100. * @module engine/view/styles/margin
  46101. */
  46102. /**
  46103. * Adds a margin CSS styles processing rules.
  46104. *
  46105. * editor.data.addStyleProcessorRules( addMarginRules );
  46106. *
  46107. * The normalized value is stored as:
  46108. *
  46109. * const styles = {
  46110. * margin: {
  46111. * top,
  46112. * right,
  46113. * bottom,
  46114. * left
  46115. * }
  46116. * };
  46117. *
  46118. * @param {module:engine/view/stylesmap~StylesProcessor} stylesProcessor
  46119. */
  46120. function addMarginRules( stylesProcessor ) {
  46121. stylesProcessor.setNormalizer( 'margin', Object(_utils__WEBPACK_IMPORTED_MODULE_0__["getPositionShorthandNormalizer"])( 'margin' ) );
  46122. stylesProcessor.setNormalizer( 'margin-top', value => ( { path: 'margin.top', value } ) );
  46123. stylesProcessor.setNormalizer( 'margin-right', value => ( { path: 'margin.right', value } ) );
  46124. stylesProcessor.setNormalizer( 'margin-bottom', value => ( { path: 'margin.bottom', value } ) );
  46125. stylesProcessor.setNormalizer( 'margin-left', value => ( { path: 'margin.left', value } ) );
  46126. stylesProcessor.setReducer( 'margin', Object(_utils__WEBPACK_IMPORTED_MODULE_0__["getBoxSidesValueReducer"])( 'margin' ) );
  46127. stylesProcessor.setStyleRelation( 'margin', [ 'margin-top', 'margin-right', 'margin-bottom', 'margin-left' ] );
  46128. }
  46129. /***/ }),
  46130. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/styles/padding.js":
  46131. /*!****************************************************************************!*\
  46132. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/styles/padding.js ***!
  46133. \****************************************************************************/
  46134. /*! exports provided: addPaddingRules */
  46135. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  46136. "use strict";
  46137. __webpack_require__.r(__webpack_exports__);
  46138. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addPaddingRules", function() { return addPaddingRules; });
  46139. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/styles/utils.js");
  46140. /**
  46141. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  46142. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  46143. */
  46144. /**
  46145. * @module engine/view/styles/padding
  46146. */
  46147. /**
  46148. * Adds a margin CSS styles processing rules.
  46149. *
  46150. * editor.data.addStyleProcessorRules( addPaddingRules );
  46151. *
  46152. * The normalized value is stored as:
  46153. *
  46154. * const styles = {
  46155. * padding: {
  46156. * top,
  46157. * right,
  46158. * bottom,
  46159. * left
  46160. * }
  46161. * };
  46162. *
  46163. * @param {module:engine/view/stylesmap~StylesProcessor} stylesProcessor
  46164. */
  46165. function addPaddingRules( stylesProcessor ) {
  46166. stylesProcessor.setNormalizer( 'padding', Object(_utils__WEBPACK_IMPORTED_MODULE_0__["getPositionShorthandNormalizer"])( 'padding' ) );
  46167. stylesProcessor.setNormalizer( 'padding-top', value => ( { path: 'padding.top', value } ) );
  46168. stylesProcessor.setNormalizer( 'padding-right', value => ( { path: 'padding.right', value } ) );
  46169. stylesProcessor.setNormalizer( 'padding-bottom', value => ( { path: 'padding.bottom', value } ) );
  46170. stylesProcessor.setNormalizer( 'padding-left', value => ( { path: 'padding.left', value } ) );
  46171. stylesProcessor.setReducer( 'padding', Object(_utils__WEBPACK_IMPORTED_MODULE_0__["getBoxSidesValueReducer"])( 'padding' ) );
  46172. stylesProcessor.setStyleRelation( 'padding', [ 'padding-top', 'padding-right', 'padding-bottom', 'padding-left' ] );
  46173. }
  46174. /***/ }),
  46175. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/styles/utils.js":
  46176. /*!**************************************************************************!*\
  46177. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/styles/utils.js ***!
  46178. \**************************************************************************/
  46179. /*! exports provided: isColor, isLineStyle, isLength, isPercentage, isRepeat, isPosition, isAttachment, isURL, getBoxSidesValues, getBoxSidesValueReducer, getBoxSidesShorthandValue, getPositionShorthandNormalizer, getShorthandValues */
  46180. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  46181. "use strict";
  46182. __webpack_require__.r(__webpack_exports__);
  46183. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isColor", function() { return isColor; });
  46184. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isLineStyle", function() { return isLineStyle; });
  46185. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isLength", function() { return isLength; });
  46186. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isPercentage", function() { return isPercentage; });
  46187. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isRepeat", function() { return isRepeat; });
  46188. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isPosition", function() { return isPosition; });
  46189. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isAttachment", function() { return isAttachment; });
  46190. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isURL", function() { return isURL; });
  46191. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getBoxSidesValues", function() { return getBoxSidesValues; });
  46192. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getBoxSidesValueReducer", function() { return getBoxSidesValueReducer; });
  46193. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getBoxSidesShorthandValue", function() { return getBoxSidesShorthandValue; });
  46194. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getPositionShorthandNormalizer", function() { return getPositionShorthandNormalizer; });
  46195. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getShorthandValues", function() { return getShorthandValues; });
  46196. /**
  46197. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  46198. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  46199. */
  46200. /**
  46201. * @module engine/view/styles/utils
  46202. */
  46203. const HEX_COLOR_REGEXP = /^#([0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/i;
  46204. const RGB_COLOR_REGEXP = /^rgb\([ ]?([0-9]{1,3}[ %]?,[ ]?){2,3}[0-9]{1,3}[ %]?\)$/i;
  46205. const RGBA_COLOR_REGEXP = /^rgba\([ ]?([0-9]{1,3}[ %]?,[ ]?){3}(1|[0-9]+%|[0]?\.?[0-9]+)\)$/i;
  46206. const HSL_COLOR_REGEXP = /^hsl\([ ]?([0-9]{1,3}[ %]?[,]?[ ]*){3}(1|[0-9]+%|[0]?\.?[0-9]+)?\)$/i;
  46207. const HSLA_COLOR_REGEXP = /^hsla\([ ]?([0-9]{1,3}[ %]?,[ ]?){2,3}(1|[0-9]+%|[0]?\.?[0-9]+)\)$/i;
  46208. const COLOR_NAMES = new Set( [
  46209. // CSS Level 1
  46210. 'black', 'silver', 'gray', 'white', 'maroon', 'red', 'purple', 'fuchsia',
  46211. 'green', 'lime', 'olive', 'yellow', 'navy', 'blue', 'teal', 'aqua',
  46212. // CSS Level 2 (Revision 1)
  46213. 'orange',
  46214. // CSS Color Module Level 3
  46215. 'aliceblue', 'antiquewhite', 'aquamarine', 'azure', 'beige', 'bisque', 'blanchedalmond', 'blueviolet', 'brown',
  46216. 'burlywood', 'cadetblue', 'chartreuse', 'chocolate', 'coral', 'cornflowerblue', 'cornsilk', 'crimson', 'cyan',
  46217. 'darkblue', 'darkcyan', 'darkgoldenrod', 'darkgray', 'darkgreen', 'darkgrey', 'darkkhaki', 'darkmagenta',
  46218. 'darkolivegreen', 'darkorange', 'darkorchid', 'darkred', 'darksalmon', 'darkseagreen', 'darkslateblue',
  46219. 'darkslategray', 'darkslategrey', 'darkturquoise', 'darkviolet', 'deeppink', 'deepskyblue', 'dimgray', 'dimgrey',
  46220. 'dodgerblue', 'firebrick', 'floralwhite', 'forestgreen', 'gainsboro', 'ghostwhite', 'gold', 'goldenrod',
  46221. 'greenyellow', 'grey', 'honeydew', 'hotpink', 'indianred', 'indigo', 'ivory', 'khaki', 'lavender', 'lavenderblush',
  46222. 'lawngreen', 'lemonchiffon', 'lightblue', 'lightcoral', 'lightcyan', 'lightgoldenrodyellow', 'lightgray',
  46223. 'lightgreen', 'lightgrey', 'lightpink', 'lightsalmon', 'lightseagreen', 'lightskyblue', 'lightslategray',
  46224. 'lightslategrey', 'lightsteelblue', 'lightyellow', 'limegreen', 'linen', 'magenta', 'mediumaquamarine',
  46225. 'mediumblue', 'mediumorchid', 'mediumpurple', 'mediumseagreen', 'mediumslateblue', 'mediumspringgreen',
  46226. 'mediumturquoise', 'mediumvioletred', 'midnightblue', 'mintcream', 'mistyrose', 'moccasin', 'navajowhite',
  46227. 'oldlace', 'olivedrab', 'orangered', 'orchid', 'palegoldenrod', 'palegreen', 'paleturquoise', 'palevioletred',
  46228. 'papayawhip', 'peachpuff', 'peru', 'pink', 'plum', 'powderblue', 'rosybrown', 'royalblue', 'saddlebrown', 'salmon',
  46229. 'sandybrown', 'seagreen', 'seashell', 'sienna', 'skyblue', 'slateblue', 'slategray', 'slategrey', 'snow',
  46230. 'springgreen', 'steelblue', 'tan', 'thistle', 'tomato', 'turquoise', 'violet', 'wheat', 'whitesmoke', 'yellowgreen',
  46231. // CSS Color Module Level 4
  46232. 'rebeccapurple',
  46233. // Keywords
  46234. 'currentcolor', 'transparent'
  46235. ] );
  46236. /**
  46237. * Checks if string contains [color](https://developer.mozilla.org/en-US/docs/Web/CSS/color) CSS value.
  46238. *
  46239. * isColor( '#f00' ); // true
  46240. * isColor( '#AA00BB33' ); // true
  46241. * isColor( 'rgb(0, 0, 250)' ); // true
  46242. * isColor( 'hsla(240, 100%, 50%, .7)' ); // true
  46243. * isColor( 'deepskyblue' ); // true
  46244. *
  46245. * **Note**: It does not support CSS Level 4 whitespace syntax, system colors and radius values for HSL colors.
  46246. *
  46247. * @param {String} string
  46248. * @returns {Boolean}
  46249. */
  46250. function isColor( string ) {
  46251. // As far as I was able to test checking some pre-conditions is faster than joining each test with ||.
  46252. if ( string.startsWith( '#' ) ) {
  46253. return HEX_COLOR_REGEXP.test( string );
  46254. }
  46255. if ( string.startsWith( 'rgb' ) ) {
  46256. return RGB_COLOR_REGEXP.test( string ) || RGBA_COLOR_REGEXP.test( string );
  46257. }
  46258. if ( string.startsWith( 'hsl' ) ) {
  46259. return HSL_COLOR_REGEXP.test( string ) || HSLA_COLOR_REGEXP.test( string );
  46260. }
  46261. // Array check > RegExp test.
  46262. return COLOR_NAMES.has( string.toLowerCase() );
  46263. }
  46264. const lineStyleValues = [ 'none', 'hidden', 'dotted', 'dashed', 'solid', 'double', 'groove', 'ridge', 'inset', 'outset' ];
  46265. /**
  46266. * Checks if string contains [line style](https://developer.mozilla.org/en-US/docs/Web/CSS/border-style) CSS value.
  46267. *
  46268. * @param {String} string
  46269. * @returns {Boolean}
  46270. */
  46271. function isLineStyle( string ) {
  46272. return lineStyleValues.includes( string );
  46273. }
  46274. const lengthRegExp = /^([+-]?[0-9]*([.][0-9]+)?(px|cm|mm|in|pc|pt|ch|em|ex|rem|vh|vw|vmin|vmax)|0)$/;
  46275. /**
  46276. * Checks if string contains [length](https://developer.mozilla.org/en-US/docs/Web/CSS/length) CSS value.
  46277. *
  46278. * @param {String} string
  46279. * @returns {Boolean}
  46280. */
  46281. function isLength( string ) {
  46282. return lengthRegExp.test( string );
  46283. }
  46284. const PERCENTAGE_VALUE_REGEXP = /^[+-]?[0-9]*([.][0-9]+)?%$/;
  46285. /**
  46286. * Checks if string contains [percentage](https://developer.mozilla.org/en-US/docs/Web/CSS/percentage) CSS value.
  46287. *
  46288. * @param {String} string
  46289. * @returns {Boolean}
  46290. */
  46291. function isPercentage( string ) {
  46292. return PERCENTAGE_VALUE_REGEXP.test( string );
  46293. }
  46294. const repeatValues = [ 'repeat-x', 'repeat-y', 'repeat', 'space', 'round', 'no-repeat' ];
  46295. /**
  46296. * Checks if string contains [background repeat](https://developer.mozilla.org/en-US/docs/Web/CSS/background-repeat) CSS value.
  46297. *
  46298. * @param {String} string
  46299. * @returns {Boolean}
  46300. */
  46301. function isRepeat( string ) {
  46302. return repeatValues.includes( string );
  46303. }
  46304. const positionValues = [ 'center', 'top', 'bottom', 'left', 'right' ];
  46305. /**
  46306. * Checks if string contains [background position](https://developer.mozilla.org/en-US/docs/Web/CSS/background-position) CSS value.
  46307. *
  46308. * @param {String} string
  46309. * @returns {Boolean}
  46310. */
  46311. function isPosition( string ) {
  46312. return positionValues.includes( string );
  46313. }
  46314. const attachmentValues = [ 'fixed', 'scroll', 'local' ];
  46315. /**
  46316. * Checks if string contains [background attachment](https://developer.mozilla.org/en-US/docs/Web/CSS/background-attachment) CSS value.
  46317. *
  46318. * @param {String} string
  46319. * @returns {Boolean}
  46320. */
  46321. function isAttachment( string ) {
  46322. return attachmentValues.includes( string );
  46323. }
  46324. const urlRegExp = /^url\(/;
  46325. /**
  46326. * Checks if string contains [URL](https://developer.mozilla.org/en-US/docs/Web/CSS/url) CSS value.
  46327. *
  46328. * @param {String} string
  46329. * @returns {Boolean}
  46330. */
  46331. function isURL( string ) {
  46332. return urlRegExp.test( string );
  46333. }
  46334. function getBoxSidesValues( value = '' ) {
  46335. if ( value === '' ) {
  46336. return { top: undefined, right: undefined, bottom: undefined, left: undefined };
  46337. }
  46338. const values = getShorthandValues( value );
  46339. const top = values[ 0 ];
  46340. const bottom = values[ 2 ] || top;
  46341. const right = values[ 1 ] || top;
  46342. const left = values[ 3 ] || right;
  46343. return { top, bottom, right, left };
  46344. }
  46345. /**
  46346. * Default reducer for CSS properties that concerns edges of a box
  46347. * [shorthand](https://developer.mozilla.org/en-US/docs/Web/CSS/Shorthand_properties) notations:
  46348. *
  46349. * stylesProcessor.setReducer( 'padding', getBoxSidesValueReducer( 'padding' ) );
  46350. *
  46351. * @param {String} styleShorthand
  46352. * @returns {Function}
  46353. */
  46354. function getBoxSidesValueReducer( styleShorthand ) {
  46355. return value => {
  46356. const { top, right, bottom, left } = value;
  46357. const reduced = [];
  46358. if ( ![ top, right, left, bottom ].every( value => !!value ) ) {
  46359. if ( top ) {
  46360. reduced.push( [ styleShorthand + '-top', top ] );
  46361. }
  46362. if ( right ) {
  46363. reduced.push( [ styleShorthand + '-right', right ] );
  46364. }
  46365. if ( bottom ) {
  46366. reduced.push( [ styleShorthand + '-bottom', bottom ] );
  46367. }
  46368. if ( left ) {
  46369. reduced.push( [ styleShorthand + '-left', left ] );
  46370. }
  46371. } else {
  46372. reduced.push( [ styleShorthand, getBoxSidesShorthandValue( value ) ] );
  46373. }
  46374. return reduced;
  46375. };
  46376. }
  46377. /**
  46378. * Returns a [shorthand](https://developer.mozilla.org/en-US/docs/Web/CSS/Shorthand_properties) notation
  46379. * of a CSS property value.
  46380. *
  46381. * getBoxSidesShorthandValue( { top: '1px', right: '1px', bottom: '2px', left: '1px' } );
  46382. * // will return '1px 1px 2px'
  46383. *
  46384. * @param {module:engine/view/stylesmap~BoxSides} styleShorthand
  46385. * @returns {String}
  46386. */
  46387. function getBoxSidesShorthandValue( { top, right, bottom, left } ) {
  46388. const out = [];
  46389. if ( left !== right ) {
  46390. out.push( top, right, bottom, left );
  46391. } else if ( bottom !== top ) {
  46392. out.push( top, right, bottom );
  46393. } else if ( right !== top ) {
  46394. out.push( top, right );
  46395. } else {
  46396. out.push( top );
  46397. }
  46398. return out.join( ' ' );
  46399. }
  46400. /**
  46401. * Creates a normalizer for a [shorthand](https://developer.mozilla.org/en-US/docs/Web/CSS/Shorthand_properties) 1-to-4 value.
  46402. *
  46403. * stylesProcessor.setNormalizer( 'margin', getPositionShorthandNormalizer( 'margin' ) );
  46404. *
  46405. * @param {String} shorthand
  46406. * @returns {Function}
  46407. */
  46408. function getPositionShorthandNormalizer( shorthand ) {
  46409. return value => {
  46410. return {
  46411. path: shorthand,
  46412. value: getBoxSidesValues( value )
  46413. };
  46414. };
  46415. }
  46416. /**
  46417. * Parses parts of a 1-to-4 value notation - handles some CSS values with spaces (like RGB()).
  46418. *
  46419. * getShorthandValues( 'red blue RGB(0, 0, 0)');
  46420. * // will return [ 'red', 'blue', 'RGB(0, 0, 0)' ]
  46421. *
  46422. * @param {String} string
  46423. * @returns {Array.<String>}
  46424. */
  46425. function getShorthandValues( string ) {
  46426. return string
  46427. .replace( /, /g, ',' ) // Exclude comma from spaces evaluation as values are separated by spaces.
  46428. .split( ' ' )
  46429. .map( string => string.replace( /,/g, ', ' ) ); // Restore original notation.
  46430. }
  46431. /***/ }),
  46432. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/stylesmap.js":
  46433. /*!***********************************************************************!*\
  46434. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/stylesmap.js ***!
  46435. \***********************************************************************/
  46436. /*! exports provided: default, StylesProcessor */
  46437. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  46438. "use strict";
  46439. __webpack_require__.r(__webpack_exports__);
  46440. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return StylesMap; });
  46441. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "StylesProcessor", function() { return StylesProcessor; });
  46442. /* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash-es */ "./node_modules/lodash-es/lodash.js");
  46443. /**
  46444. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  46445. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  46446. */
  46447. /**
  46448. * @module engine/view/stylesmap
  46449. */
  46450. /**
  46451. * Styles map. Allows handling (adding, removing, retrieving) a set of style rules (usually, of an element).
  46452. *
  46453. * The styles map is capable of normalizing style names so e.g. the following operations are possible:
  46454. */
  46455. class StylesMap {
  46456. /**
  46457. * Creates Styles instance.
  46458. *
  46459. * @param {module:engine/view/stylesmap~StylesProcessor} styleProcessor
  46460. */
  46461. constructor( styleProcessor ) {
  46462. /**
  46463. * Keeps an internal representation of styles map. Normalized styles are kept as object tree to allow unified modification and
  46464. * value access model using lodash's get, set, unset, etc methods.
  46465. *
  46466. * When no style processor rules are defined the it acts as simple key-value storage.
  46467. *
  46468. * @private
  46469. * @type {Object}
  46470. */
  46471. this._styles = {};
  46472. /**
  46473. * An instance of the {@link module:engine/view/stylesmap~StylesProcessor}.
  46474. *
  46475. * @private
  46476. * @member {module:engine/view/stylesmap~StylesProcessor}
  46477. */
  46478. this._styleProcessor = styleProcessor;
  46479. }
  46480. /**
  46481. * Returns true if style map has no styles set.
  46482. *
  46483. * @type {Boolean}
  46484. */
  46485. get isEmpty() {
  46486. const entries = Object.entries( this._styles );
  46487. const from = Array.from( entries );
  46488. return !from.length;
  46489. }
  46490. /**
  46491. * Number of styles defined.
  46492. *
  46493. * @type {Number}
  46494. */
  46495. get size() {
  46496. if ( this.isEmpty ) {
  46497. return 0;
  46498. }
  46499. return this.getStyleNames().length;
  46500. }
  46501. /**
  46502. * Set styles map to a new value.
  46503. *
  46504. * styles.setTo( 'border:1px solid blue;margin-top:1px;' );
  46505. *
  46506. * @param {String} inlineStyle
  46507. */
  46508. setTo( inlineStyle ) {
  46509. this.clear();
  46510. const parsedStyles = Array.from( parseInlineStyles( inlineStyle ).entries() );
  46511. for ( const [ key, value ] of parsedStyles ) {
  46512. this._styleProcessor.toNormalizedForm( key, value, this._styles );
  46513. }
  46514. }
  46515. /**
  46516. * Checks if a given style is set.
  46517. *
  46518. * styles.setTo( 'margin-left:1px;' );
  46519. *
  46520. * styles.has( 'margin-left' ); // -> true
  46521. * styles.has( 'padding' ); // -> false
  46522. *
  46523. * **Note**: This check supports normalized style names.
  46524. *
  46525. * // Enable 'margin' shorthand processing:
  46526. * editor.data.addStyleProcessorRules( addMarginRules );
  46527. *
  46528. * styles.setTo( 'margin:2px;' );
  46529. *
  46530. * styles.has( 'margin' ); // -> true
  46531. * styles.has( 'margin-top' ); // -> true
  46532. * styles.has( 'margin-left' ); // -> true
  46533. *
  46534. * styles.remove( 'margin-top' );
  46535. *
  46536. * styles.has( 'margin' ); // -> false
  46537. * styles.has( 'margin-top' ); // -> false
  46538. * styles.has( 'margin-left' ); // -> true
  46539. *
  46540. * @param {String} name Style name.
  46541. * @returns {Boolean}
  46542. */
  46543. has( name ) {
  46544. if ( this.isEmpty ) {
  46545. return false;
  46546. }
  46547. const styles = this._styleProcessor.getReducedForm( name, this._styles );
  46548. const propertyDescriptor = styles.find( ( [ property ] ) => property === name );
  46549. // Only return a value if it is set;
  46550. return Array.isArray( propertyDescriptor );
  46551. }
  46552. /**
  46553. * Sets a given style.
  46554. *
  46555. * Can insert one by one:
  46556. *
  46557. * styles.set( 'color', 'blue' );
  46558. * styles.set( 'margin-right', '1em' );
  46559. *
  46560. * or many styles at once:
  46561. *
  46562. * styles.set( {
  46563. * color: 'blue',
  46564. * 'margin-right': '1em'
  46565. * } );
  46566. *
  46567. * ***Note**:* This method uses {@link module:engine/controller/datacontroller~DataController#addStyleProcessorRules
  46568. * enabled style processor rules} to normalize passed values.
  46569. *
  46570. * // Enable 'margin' shorthand processing:
  46571. * editor.data.addStyleProcessorRules( addMarginRules );
  46572. *
  46573. * styles.set( 'margin', '2px' );
  46574. *
  46575. * The above code will set margin to:
  46576. *
  46577. * styles.getNormalized( 'margin' );
  46578. * // -> { top: '2px', right: '2px', bottom: '2px', left: '2px' }
  46579. *
  46580. * Which makes it possible to retrieve a "sub-value":
  46581. *
  46582. * styles.get( 'margin-left' ); // -> '2px'
  46583. *
  46584. * Or modify it:
  46585. *
  46586. * styles.remove( 'margin-left' );
  46587. *
  46588. * styles.getNormalized( 'margin' ); // -> { top: '1px', bottom: '1px', right: '1px' }
  46589. * styles.toString(); // -> 'margin-bottom:1px;margin-right:1px;margin-top:1px;'
  46590. *
  46591. * This method also allows to set normalized values directly (if a particular styles processor rule was enabled):
  46592. *
  46593. * styles.set( 'border-color', { top: 'blue' } );
  46594. * styles.set( 'margin', { right: '2em' } );
  46595. *
  46596. * styles.toString(); // -> 'border-color-top:blue;margin-right:2em;'
  46597. *
  46598. * @param {String|Object} nameOrObject Style property name or object with multiple properties.
  46599. * @param {String|Object} valueOrObject Value to set.
  46600. */
  46601. set( nameOrObject, valueOrObject ) {
  46602. if ( Object(lodash_es__WEBPACK_IMPORTED_MODULE_0__["isObject"])( nameOrObject ) ) {
  46603. for ( const [ key, value ] of Object.entries( nameOrObject ) ) {
  46604. this._styleProcessor.toNormalizedForm( key, value, this._styles );
  46605. }
  46606. } else {
  46607. this._styleProcessor.toNormalizedForm( nameOrObject, valueOrObject, this._styles );
  46608. }
  46609. }
  46610. /**
  46611. * Removes given style.
  46612. *
  46613. * styles.setTo( 'background:#f00;margin-right:2px;' );
  46614. *
  46615. * styles.remove( 'background' );
  46616. *
  46617. * styles.toString(); // -> 'margin-right:2px;'
  46618. *
  46619. * ***Note**:* This method uses {@link module:engine/controller/datacontroller~DataController#addStyleProcessorRules
  46620. * enabled style processor rules} to normalize passed values.
  46621. *
  46622. * // Enable 'margin' shorthand processing:
  46623. * editor.data.addStyleProcessorRules( addMarginRules );
  46624. *
  46625. * styles.setTo( 'margin:1px' );
  46626. *
  46627. * styles.remove( 'margin-top' );
  46628. * styles.remove( 'margin-right' );
  46629. *
  46630. * styles.toString(); // -> 'margin-bottom:1px;margin-left:1px;'
  46631. *
  46632. * @param {String} name Style name.
  46633. */
  46634. remove( name ) {
  46635. const path = toPath( name );
  46636. Object(lodash_es__WEBPACK_IMPORTED_MODULE_0__["unset"])( this._styles, path );
  46637. delete this._styles[ name ];
  46638. this._cleanEmptyObjectsOnPath( path );
  46639. }
  46640. /**
  46641. * Returns a normalized style object or a single value.
  46642. *
  46643. * // Enable 'margin' shorthand processing:
  46644. * editor.data.addStyleProcessorRules( addMarginRules );
  46645. *
  46646. * const styles = new Styles();
  46647. * styles.setTo( 'margin:1px 2px 3em;' );
  46648. *
  46649. * styles.getNormalized( 'margin' );
  46650. * // will log:
  46651. * // {
  46652. * // top: '1px',
  46653. * // right: '2px',
  46654. * // bottom: '3em',
  46655. * // left: '2px' // normalized value from margin shorthand
  46656. * // }
  46657. *
  46658. * styles.getNormalized( 'margin-left' ); // -> '2px'
  46659. *
  46660. * **Note**: This method will only return normalized styles if a style processor was defined.
  46661. *
  46662. * @param {String} name Style name.
  46663. * @returns {Object|String|undefined}
  46664. */
  46665. getNormalized( name ) {
  46666. return this._styleProcessor.getNormalized( name, this._styles );
  46667. }
  46668. /**
  46669. * Returns a normalized style string. Styles are sorted by name.
  46670. *
  46671. * styles.set( 'margin' , '1px' );
  46672. * styles.set( 'background', '#f00' );
  46673. *
  46674. * styles.toString(); // -> 'background:#f00;margin:1px;'
  46675. *
  46676. * **Note**: This method supports normalized styles if defined.
  46677. *
  46678. * // Enable 'margin' shorthand processing:
  46679. * editor.data.addStyleProcessorRules( addMarginRules );
  46680. *
  46681. * styles.set( 'margin' , '1px' );
  46682. * styles.set( 'background', '#f00' );
  46683. * styles.remove( 'margin-top' );
  46684. * styles.remove( 'margin-right' );
  46685. *
  46686. * styles.toString(); // -> 'background:#f00;margin-bottom:1px;margin-left:1px;'
  46687. *
  46688. * @returns {String}
  46689. */
  46690. toString() {
  46691. if ( this.isEmpty ) {
  46692. return '';
  46693. }
  46694. return this._getStylesEntries()
  46695. .map( arr => arr.join( ':' ) )
  46696. .sort()
  46697. .join( ';' ) + ';';
  46698. }
  46699. /**
  46700. * Returns property as a value string or undefined if property is not set.
  46701. *
  46702. * // Enable 'margin' shorthand processing:
  46703. * editor.data.addStyleProcessorRules( addMarginRules );
  46704. *
  46705. * const styles = new Styles();
  46706. * styles.setTo( 'margin:1px;' );
  46707. * styles.set( 'margin-bottom', '3em' );
  46708. *
  46709. * styles.getAsString( 'margin' ); // -> 'margin: 1px 1px 3em;'
  46710. *
  46711. * Note, however, that all sub-values must be set for the longhand property name to return a value:
  46712. *
  46713. * const styles = new Styles();
  46714. * styles.setTo( 'margin:1px;' );
  46715. * styles.remove( 'margin-bottom' );
  46716. *
  46717. * styles.getAsString( 'margin' ); // -> undefined
  46718. *
  46719. * In the above scenario, it is not possible to return a `margin` value, so `undefined` is returned.
  46720. * Instead, you should use:
  46721. *
  46722. * const styles = new Styles();
  46723. * styles.setTo( 'margin:1px;' );
  46724. * styles.remove( 'margin-bottom' );
  46725. *
  46726. * for ( const styleName of styles.getStyleNames() ) {
  46727. * console.log( styleName, styles.getAsString( styleName ) );
  46728. * }
  46729. * // 'margin-top', '1px'
  46730. * // 'margin-right', '1px'
  46731. * // 'margin-left', '1px'
  46732. *
  46733. * In general, it is recommend to iterate over style names like in the example above. This way, you will always get all
  46734. * the currently set style values. So, if all the 4 margin values would be set
  46735. * the for-of loop above would yield only `'margin'`, `'1px'`:
  46736. *
  46737. * const styles = new Styles();
  46738. * styles.setTo( 'margin:1px;' );
  46739. *
  46740. * for ( const styleName of styles.getStyleNames() ) {
  46741. * console.log( styleName, styles.getAsString( styleName ) );
  46742. * }
  46743. * // 'margin', '1px'
  46744. *
  46745. * **Note**: To get a normalized version of a longhand property use the {@link #getNormalized `#getNormalized()`} method.
  46746. *
  46747. * @param {String} propertyName
  46748. * @returns {String|undefined}
  46749. */
  46750. getAsString( propertyName ) {
  46751. if ( this.isEmpty ) {
  46752. return;
  46753. }
  46754. if ( this._styles[ propertyName ] && !Object(lodash_es__WEBPACK_IMPORTED_MODULE_0__["isObject"])( this._styles[ propertyName ] ) ) {
  46755. // Try return styles set directly - values that are not parsed.
  46756. return this._styles[ propertyName ];
  46757. }
  46758. const styles = this._styleProcessor.getReducedForm( propertyName, this._styles );
  46759. const propertyDescriptor = styles.find( ( [ property ] ) => property === propertyName );
  46760. // Only return a value if it is set;
  46761. if ( Array.isArray( propertyDescriptor ) ) {
  46762. return propertyDescriptor[ 1 ];
  46763. }
  46764. }
  46765. /**
  46766. * Returns style property names as they would appear when using {@link #toString `#toString()`}.
  46767. *
  46768. * @returns {Array.<String>}
  46769. */
  46770. getStyleNames() {
  46771. if ( this.isEmpty ) {
  46772. return [];
  46773. }
  46774. const entries = this._getStylesEntries();
  46775. return entries.map( ( [ key ] ) => key );
  46776. }
  46777. /**
  46778. * Removes all styles.
  46779. */
  46780. clear() {
  46781. this._styles = {};
  46782. }
  46783. /**
  46784. * Returns normalized styles entries for further processing.
  46785. *
  46786. * @private
  46787. * @returns {Array.<module:engine/view/stylesmap~PropertyDescriptor>}
  46788. */
  46789. _getStylesEntries() {
  46790. const parsed = [];
  46791. const keys = Object.keys( this._styles );
  46792. for ( const key of keys ) {
  46793. parsed.push( ...this._styleProcessor.getReducedForm( key, this._styles ) );
  46794. }
  46795. return parsed;
  46796. }
  46797. /**
  46798. * Removes empty objects upon removing an entry from internal object.
  46799. *
  46800. * @param {String} path
  46801. * @private
  46802. */
  46803. _cleanEmptyObjectsOnPath( path ) {
  46804. const pathParts = path.split( '.' );
  46805. const isChildPath = pathParts.length > 1;
  46806. if ( !isChildPath ) {
  46807. return;
  46808. }
  46809. const parentPath = pathParts.splice( 0, pathParts.length - 1 ).join( '.' );
  46810. const parentObject = Object(lodash_es__WEBPACK_IMPORTED_MODULE_0__["get"])( this._styles, parentPath );
  46811. if ( !parentObject ) {
  46812. return;
  46813. }
  46814. const isParentEmpty = !Array.from( Object.keys( parentObject ) ).length;
  46815. if ( isParentEmpty ) {
  46816. this.remove( parentPath );
  46817. }
  46818. }
  46819. }
  46820. /**
  46821. * Style processor is responsible for writing and reading a normalized styles object.
  46822. */
  46823. class StylesProcessor {
  46824. /**
  46825. * Creates StylesProcessor instance.
  46826. *
  46827. * @private
  46828. */
  46829. constructor() {
  46830. this._normalizers = new Map();
  46831. this._extractors = new Map();
  46832. this._reducers = new Map();
  46833. this._consumables = new Map();
  46834. }
  46835. /**
  46836. * Parse style string value to a normalized object and appends it to styles object.
  46837. *
  46838. * const styles = {};
  46839. *
  46840. * stylesProcessor.toNormalizedForm( 'margin', '1px', styles );
  46841. *
  46842. * // styles will consist: { margin: { top: '1px', right: '1px', bottom: '1px', left: '1px; } }
  46843. *
  46844. * **Note**: To define normalizer callbacks use {@link #setNormalizer}.
  46845. *
  46846. * @param {String} name Name of style property.
  46847. * @param {String} propertyValue Value of style property.
  46848. * @param {Object} styles Object holding normalized styles.
  46849. */
  46850. toNormalizedForm( name, propertyValue, styles ) {
  46851. if ( Object(lodash_es__WEBPACK_IMPORTED_MODULE_0__["isObject"])( propertyValue ) ) {
  46852. appendStyleValue( styles, toPath( name ), propertyValue );
  46853. return;
  46854. }
  46855. if ( this._normalizers.has( name ) ) {
  46856. const normalizer = this._normalizers.get( name );
  46857. const { path, value } = normalizer( propertyValue );
  46858. appendStyleValue( styles, path, value );
  46859. } else {
  46860. appendStyleValue( styles, name, propertyValue );
  46861. }
  46862. }
  46863. /**
  46864. * Returns a normalized version of a style property.
  46865. * const styles = {
  46866. * margin: { top: '1px', right: '1px', bottom: '1px', left: '1px; },
  46867. * background: { color: '#f00' }
  46868. * };
  46869. *
  46870. * stylesProcessor.getNormalized( 'background' );
  46871. * // will return: { color: '#f00' }
  46872. *
  46873. * stylesProcessor.getNormalized( 'margin-top' );
  46874. * // will return: '1px'
  46875. *
  46876. * **Note**: In some cases extracting single value requires defining an extractor callback {@link #setExtractor}.
  46877. *
  46878. * @param {String} name Name of style property.
  46879. * @param {Object} styles Object holding normalized styles.
  46880. * @returns {*}
  46881. */
  46882. getNormalized( name, styles ) {
  46883. if ( !name ) {
  46884. return Object(lodash_es__WEBPACK_IMPORTED_MODULE_0__["merge"])( {}, styles );
  46885. }
  46886. // Might be empty string.
  46887. if ( styles[ name ] !== undefined ) {
  46888. return styles[ name ];
  46889. }
  46890. if ( this._extractors.has( name ) ) {
  46891. const extractor = this._extractors.get( name );
  46892. if ( typeof extractor === 'string' ) {
  46893. return Object(lodash_es__WEBPACK_IMPORTED_MODULE_0__["get"])( styles, extractor );
  46894. }
  46895. const value = extractor( name, styles );
  46896. if ( value ) {
  46897. return value;
  46898. }
  46899. }
  46900. return Object(lodash_es__WEBPACK_IMPORTED_MODULE_0__["get"])( styles, toPath( name ) );
  46901. }
  46902. /**
  46903. * Returns a reduced form of style property form normalized object.
  46904. *
  46905. * For default margin reducer, the below code:
  46906. *
  46907. * stylesProcessor.getReducedForm( 'margin', {
  46908. * margin: { top: '1px', right: '1px', bottom: '2px', left: '1px; }
  46909. * } );
  46910. *
  46911. * will return:
  46912. *
  46913. * [
  46914. * [ 'margin', '1px 1px 2px' ]
  46915. * ]
  46916. *
  46917. * because it might be represented as a shorthand 'margin' value. However if one of margin long hand values is missing it should return:
  46918. *
  46919. * [
  46920. * [ 'margin-top', '1px' ],
  46921. * [ 'margin-right', '1px' ],
  46922. * [ 'margin-bottom', '2px' ]
  46923. * // the 'left' value is missing - cannot use 'margin' shorthand.
  46924. * ]
  46925. *
  46926. * **Note**: To define reducer callbacks use {@link #setReducer}.
  46927. *
  46928. * @param {String} name Name of style property.
  46929. * @param {Object} styles Object holding normalized styles.
  46930. * @returns {Array.<module:engine/view/stylesmap~PropertyDescriptor>}
  46931. */
  46932. getReducedForm( name, styles ) {
  46933. const normalizedValue = this.getNormalized( name, styles );
  46934. // Might be empty string.
  46935. if ( normalizedValue === undefined ) {
  46936. return [];
  46937. }
  46938. if ( this._reducers.has( name ) ) {
  46939. const reducer = this._reducers.get( name );
  46940. return reducer( normalizedValue );
  46941. }
  46942. return [ [ name, normalizedValue ] ];
  46943. }
  46944. /**
  46945. * Returns related style names.
  46946. *
  46947. * stylesProcessor.getRelatedStyles( 'margin' );
  46948. * // will return: [ 'margin-top', 'margin-right', 'margin-bottom', 'margin-left' ];
  46949. *
  46950. * stylesProcessor.getRelatedStyles( 'margin-top' );
  46951. * // will return: [ 'margin' ];
  46952. *
  46953. * **Note**: To define new style relations load an existing style processor or use
  46954. * {@link module:engine/view/stylesmap~StylesProcessor#setStyleRelation `StylesProcessor.setStyleRelation()`}.
  46955. *
  46956. * @param {String} name
  46957. * @returns {Array.<String>}
  46958. */
  46959. getRelatedStyles( name ) {
  46960. return this._consumables.get( name ) || [];
  46961. }
  46962. /**
  46963. * Adds a normalizer method for a style property.
  46964. *
  46965. * A normalizer returns describing how the value should be normalized.
  46966. *
  46967. * For instance 'margin' style is a shorthand for four margin values:
  46968. *
  46969. * - 'margin-top'
  46970. * - 'margin-right'
  46971. * - 'margin-bottom'
  46972. * - 'margin-left'
  46973. *
  46974. * and can be written in various ways if some values are equal to others. For instance `'margin: 1px 2em;'` is a shorthand for
  46975. * `'margin-top: 1px;margin-right: 2em;margin-bottom: 1px;margin-left: 2em'`.
  46976. *
  46977. * A normalizer should parse various margin notations as a single object:
  46978. *
  46979. * const styles = {
  46980. * margin: {
  46981. * top: '1px',
  46982. * right: '2em',
  46983. * bottom: '1px',
  46984. * left: '2em'
  46985. * }
  46986. * };
  46987. *
  46988. * Thus a normalizer for 'margin' style should return an object defining style path and value to store:
  46989. *
  46990. * const returnValue = {
  46991. * path: 'margin',
  46992. * value: {
  46993. * top: '1px',
  46994. * right: '2em',
  46995. * bottom: '1px',
  46996. * left: '2em'
  46997. * }
  46998. * };
  46999. *
  47000. * Additionally to fully support all margin notations there should be also defined 4 normalizers for longhand margin notations. Below
  47001. * is an example for 'margin-top' style property normalizer:
  47002. *
  47003. * stylesProcessor.setNormalizer( 'margin-top', valueString => {
  47004. * return {
  47005. * path: 'margin.top',
  47006. * value: valueString
  47007. * }
  47008. * } );
  47009. *
  47010. * @param {String} name
  47011. * @param {Function} callback
  47012. */
  47013. setNormalizer( name, callback ) {
  47014. this._normalizers.set( name, callback );
  47015. }
  47016. /**
  47017. * Adds a extractor callback for a style property.
  47018. *
  47019. * Most normalized style values are stored as one level objects. It is assumed that `'margin-top'` style will be stored as:
  47020. *
  47021. * const styles = {
  47022. * margin: {
  47023. * top: 'value'
  47024. * }
  47025. * }
  47026. *
  47027. * However, some styles can have conflicting notations and thus it might be harder to extract a style value from shorthand. For instance
  47028. * the 'border-top-style' can be defined using `'border-top:solid'`, `'border-style:solid none none none'` or by `'border:solid'`
  47029. * shorthands. The default border styles processors stores styles as:
  47030. *
  47031. * const styles = {
  47032. * border: {
  47033. * style: {
  47034. * top: 'solid'
  47035. * }
  47036. * }
  47037. * }
  47038. *
  47039. * as it is better to modify border style independently from other values. On the other part the output of the border might be
  47040. * desired as `border-top`, `border-left`, etc notation.
  47041. *
  47042. * In the above example a reducer should return a side border value that combines style, color and width:
  47043. *
  47044. * styleProcessor.setExtractor( 'border-top', styles => {
  47045. * return {
  47046. * color: styles.border.color.top,
  47047. * style: styles.border.style.top,
  47048. * width: styles.border.width.top
  47049. * }
  47050. * } );
  47051. *
  47052. * @param {String} name
  47053. * @param {Function|String} callbackOrPath Callback that return a requested value or path string for single values.
  47054. */
  47055. setExtractor( name, callbackOrPath ) {
  47056. this._extractors.set( name, callbackOrPath );
  47057. }
  47058. /**
  47059. * Adds a reducer callback for a style property.
  47060. *
  47061. * Reducer returns a minimal notation for given style name. For longhand properties it is not required to write a reducer as
  47062. * by default the direct value from style path is taken.
  47063. *
  47064. * For shorthand styles a reducer should return minimal style notation either by returning single name-value tuple or multiple tuples
  47065. * if a shorthand cannot be used. For instance for a margin shorthand a reducer might return:
  47066. *
  47067. * const marginShortHandTuple = [
  47068. * [ 'margin', '1px 1px 2px' ]
  47069. * ];
  47070. *
  47071. * or a longhand tuples for defined values:
  47072. *
  47073. * // Considering margin.bottom and margin.left are undefined.
  47074. * const marginLonghandsTuples = [
  47075. * [ 'margin-top', '1px' ],
  47076. * [ 'margin-right', '1px' ]
  47077. * ];
  47078. *
  47079. * A reducer obtains a normalized style value:
  47080. *
  47081. * // Simplified reducer that always outputs 4 values which are always present:
  47082. * stylesProcessor.setReducer( 'margin', margin => {
  47083. * return [
  47084. * [ 'margin', `${ margin.top } ${ margin.right } ${ margin.bottom } ${ margin.left }` ]
  47085. * ]
  47086. * } );
  47087. *
  47088. * @param {String} name
  47089. * @param {Function} callback
  47090. */
  47091. setReducer( name, callback ) {
  47092. this._reducers.set( name, callback );
  47093. }
  47094. /**
  47095. * Defines a style shorthand relation to other style notations.
  47096. *
  47097. * stylesProcessor.setStyleRelation( 'margin', [
  47098. * 'margin-top',
  47099. * 'margin-right',
  47100. * 'margin-bottom',
  47101. * 'margin-left'
  47102. * ] );
  47103. *
  47104. * This enables expanding of style names for shorthands. For instance, if defined,
  47105. * {@link module:engine/conversion/viewconsumable~ViewConsumable view consumable} items are automatically created
  47106. * for long-hand margin style notation alongside the `'margin'` item.
  47107. *
  47108. * This means that when an element being converted has a style `margin`, a converter for `margin-left` will work just
  47109. * fine since the view consumable will contain a consumable `margin-left` item (thanks to the relation) and
  47110. * `element.getStyle( 'margin-left' )` will work as well assuming that the style processor was correctly configured.
  47111. * However, once `margin-left` is consumed, `margin` will not be consumable anymore.
  47112. *
  47113. * @param {String} shorthandName
  47114. * @param {Array.<String>} styleNames
  47115. */
  47116. setStyleRelation( shorthandName, styleNames ) {
  47117. this._mapStyleNames( shorthandName, styleNames );
  47118. for ( const alsoName of styleNames ) {
  47119. this._mapStyleNames( alsoName, [ shorthandName ] );
  47120. }
  47121. }
  47122. /**
  47123. * Set two-way binding of style names.
  47124. *
  47125. * @param {String} name
  47126. * @param {Array.<String>} styleNames
  47127. * @private
  47128. */
  47129. _mapStyleNames( name, styleNames ) {
  47130. if ( !this._consumables.has( name ) ) {
  47131. this._consumables.set( name, [] );
  47132. }
  47133. this._consumables.get( name ).push( ...styleNames );
  47134. }
  47135. }
  47136. // Parses inline styles and puts property - value pairs into styles map.
  47137. //
  47138. // @param {String} stylesString Styles to parse.
  47139. // @returns {Map.<String, String>} stylesMap Map of parsed properties and values.
  47140. function parseInlineStyles( stylesString ) {
  47141. // `null` if no quote was found in input string or last found quote was a closing quote. See below.
  47142. let quoteType = null;
  47143. let propertyNameStart = 0;
  47144. let propertyValueStart = 0;
  47145. let propertyName = null;
  47146. const stylesMap = new Map();
  47147. // Do not set anything if input string is empty.
  47148. if ( stylesString === '' ) {
  47149. return stylesMap;
  47150. }
  47151. // Fix inline styles that do not end with `;` so they are compatible with algorithm below.
  47152. if ( stylesString.charAt( stylesString.length - 1 ) != ';' ) {
  47153. stylesString = stylesString + ';';
  47154. }
  47155. // Seek the whole string for "special characters".
  47156. for ( let i = 0; i < stylesString.length; i++ ) {
  47157. const char = stylesString.charAt( i );
  47158. if ( quoteType === null ) {
  47159. // No quote found yet or last found quote was a closing quote.
  47160. switch ( char ) {
  47161. case ':':
  47162. // Most of time colon means that property name just ended.
  47163. // Sometimes however `:` is found inside property value (for example in background image url).
  47164. if ( !propertyName ) {
  47165. // Treat this as end of property only if property name is not already saved.
  47166. // Save property name.
  47167. propertyName = stylesString.substr( propertyNameStart, i - propertyNameStart );
  47168. // Save this point as the start of property value.
  47169. propertyValueStart = i + 1;
  47170. }
  47171. break;
  47172. case '"':
  47173. case '\'':
  47174. // Opening quote found (this is an opening quote, because `quoteType` is `null`).
  47175. quoteType = char;
  47176. break;
  47177. case ';': {
  47178. // Property value just ended.
  47179. // Use previously stored property value start to obtain property value.
  47180. const propertyValue = stylesString.substr( propertyValueStart, i - propertyValueStart );
  47181. if ( propertyName ) {
  47182. // Save parsed part.
  47183. stylesMap.set( propertyName.trim(), propertyValue.trim() );
  47184. }
  47185. propertyName = null;
  47186. // Save this point as property name start. Property name starts immediately after previous property value ends.
  47187. propertyNameStart = i + 1;
  47188. break;
  47189. }
  47190. }
  47191. } else if ( char === quoteType ) {
  47192. // If a quote char is found and it is a closing quote, mark this fact by `null`-ing `quoteType`.
  47193. quoteType = null;
  47194. }
  47195. }
  47196. return stylesMap;
  47197. }
  47198. // Return lodash compatible path from style name.
  47199. function toPath( name ) {
  47200. return name.replace( '-', '.' );
  47201. }
  47202. // Appends style definition to the styles object.
  47203. //
  47204. // @param {String} nameOrPath
  47205. // @param {String|Object} valueOrObject
  47206. // @private
  47207. function appendStyleValue( stylesObject, nameOrPath, valueOrObject ) {
  47208. let valueToSet = valueOrObject;
  47209. if ( Object(lodash_es__WEBPACK_IMPORTED_MODULE_0__["isObject"])( valueOrObject ) ) {
  47210. valueToSet = Object(lodash_es__WEBPACK_IMPORTED_MODULE_0__["merge"])( {}, Object(lodash_es__WEBPACK_IMPORTED_MODULE_0__["get"])( stylesObject, nameOrPath ), valueOrObject );
  47211. }
  47212. Object(lodash_es__WEBPACK_IMPORTED_MODULE_0__["set"])( stylesObject, nameOrPath, valueToSet );
  47213. }
  47214. /**
  47215. * A CSS style property descriptor that contains tuplet of two strings:
  47216. *
  47217. * - first string describes property name
  47218. * - second string describes property value
  47219. *
  47220. * const marginDescriptor = [ 'margin', '2px 3em' ];
  47221. * const marginTopDescriptor = [ 'margin-top', '2px' ];
  47222. *
  47223. * @typedef {Array.<String, String>} module:engine/view/stylesmap~PropertyDescriptor
  47224. */
  47225. /**
  47226. * An object describing values associated with the sides of a box, for instance margins, paddings,
  47227. * border widths, border colors, etc.
  47228. *
  47229. * const margin = {
  47230. * top: '1px',
  47231. * right: '3px',
  47232. * bottom: '3px',
  47233. * left: '7px'
  47234. * };
  47235. *
  47236. * const borderColor = {
  47237. * top: 'red',
  47238. * right: 'blue',
  47239. * bottom: 'blue',
  47240. * left: 'red'
  47241. * };
  47242. *
  47243. * @typedef {Object} module:engine/view/stylesmap~BoxSides
  47244. *
  47245. * @property {String} top Top side value.
  47246. * @property {String} right Right side value.
  47247. * @property {String} bottom Bottom side value.
  47248. * @property {String} left Left side value.
  47249. */
  47250. /***/ }),
  47251. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/text.js":
  47252. /*!******************************************************************!*\
  47253. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/text.js ***!
  47254. \******************************************************************/
  47255. /*! exports provided: default */
  47256. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  47257. "use strict";
  47258. __webpack_require__.r(__webpack_exports__);
  47259. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Text; });
  47260. /* harmony import */ var _node__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/node.js");
  47261. /**
  47262. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  47263. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  47264. */
  47265. /**
  47266. * @module engine/view/text
  47267. */
  47268. /**
  47269. * Tree view text node.
  47270. *
  47271. * The constructor of this class should not be used directly. To create a new text node instance
  47272. * use the {@link module:engine/view/downcastwriter~DowncastWriter#createText `DowncastWriter#createText()`}
  47273. * method when working on data downcasted from the model or the
  47274. * {@link module:engine/view/upcastwriter~UpcastWriter#createText `UpcastWriter#createText()`}
  47275. * method when working on non-semantic views.
  47276. *
  47277. * @extends module:engine/view/node~Node
  47278. */
  47279. class Text extends _node__WEBPACK_IMPORTED_MODULE_0__["default"] {
  47280. /**
  47281. * Creates a tree view text node.
  47282. *
  47283. * @protected
  47284. * @param {module:engine/view/document~Document} document The document instance to which this text node belongs.
  47285. * @param {String} data The text's data.
  47286. */
  47287. constructor( document, data ) {
  47288. super( document );
  47289. /**
  47290. * The text content.
  47291. *
  47292. * Setting the data fires the {@link module:engine/view/node~Node#event:change:text change event}.
  47293. *
  47294. * @protected
  47295. * @member {String} module:engine/view/text~Text#_textData
  47296. */
  47297. this._textData = data;
  47298. }
  47299. /**
  47300. * Checks whether this object is of the given type.
  47301. *
  47302. * text.is( '$text' ); // -> true
  47303. * text.is( 'node' ); // -> true
  47304. * text.is( 'view:$text' ); // -> true
  47305. * text.is( 'view:node' ); // -> true
  47306. *
  47307. * text.is( 'model:$text' ); // -> false
  47308. * text.is( 'element' ); // -> false
  47309. * text.is( 'range' ); // -> false
  47310. *
  47311. * {@link module:engine/view/node~Node#is Check the entire list of view objects} which implement the `is()` method.
  47312. *
  47313. * **Note:** Until version 20.0.0 this method wasn't accepting `'$text'` type. The legacy `'text'` type is still
  47314. * accepted for backward compatibility.
  47315. *
  47316. * @param {String} type Type to check.
  47317. * @returns {Boolean}
  47318. */
  47319. is( type ) {
  47320. return type === '$text' || type === 'view:$text' ||
  47321. // This are legacy values kept for backward compatibility.
  47322. type === 'text' || type === 'view:text' ||
  47323. // From super.is(). This is highly utilised method and cannot call super. See ckeditor/ckeditor5#6529.
  47324. type === 'node' || type === 'view:node';
  47325. }
  47326. /**
  47327. * The text content.
  47328. *
  47329. * @readonly
  47330. * @type {String}
  47331. */
  47332. get data() {
  47333. return this._textData;
  47334. }
  47335. /**
  47336. * The `_data` property is controlled by a getter and a setter.
  47337. *
  47338. * The getter is required when using the addition assignment operator on protected property:
  47339. *
  47340. * const foo = downcastWriter.createText( 'foo' );
  47341. * const bar = downcastWriter.createText( 'bar' );
  47342. *
  47343. * foo._data += bar.data; // executes: `foo._data = foo._data + bar.data`
  47344. * console.log( foo.data ); // prints: 'foobar'
  47345. *
  47346. * If the protected getter didn't exist, `foo._data` will return `undefined` and result of the merge will be invalid.
  47347. *
  47348. * The setter sets data and fires the {@link module:engine/view/node~Node#event:change:text change event}.
  47349. *
  47350. * @protected
  47351. * @type {String}
  47352. */
  47353. get _data() {
  47354. return this.data;
  47355. }
  47356. set _data( data ) {
  47357. this._fireChange( 'text', this );
  47358. this._textData = data;
  47359. }
  47360. /**
  47361. * Checks if this text node is similar to other text node.
  47362. * Both nodes should have the same data to be considered as similar.
  47363. *
  47364. * @param {module:engine/view/text~Text} otherNode Node to check if it is same as this node.
  47365. * @returns {Boolean}
  47366. */
  47367. isSimilar( otherNode ) {
  47368. if ( !( otherNode instanceof Text ) ) {
  47369. return false;
  47370. }
  47371. return this === otherNode || this.data === otherNode.data;
  47372. }
  47373. /**
  47374. * Clones this node.
  47375. *
  47376. * @protected
  47377. * @returns {module:engine/view/text~Text} Text node that is a clone of this node.
  47378. */
  47379. _clone() {
  47380. return new Text( this.document, this.data );
  47381. }
  47382. // @if CK_DEBUG_ENGINE // toString() {
  47383. // @if CK_DEBUG_ENGINE // return `#${ this.data }`;
  47384. // @if CK_DEBUG_ENGINE // }
  47385. // @if CK_DEBUG_ENGINE // log() {
  47386. // @if CK_DEBUG_ENGINE // console.log( 'ViewText: ' + this );
  47387. // @if CK_DEBUG_ENGINE // }
  47388. // @if CK_DEBUG_ENGINE // logExtended() {
  47389. // @if CK_DEBUG_ENGINE // console.log( 'ViewText: ' + this );
  47390. // @if CK_DEBUG_ENGINE // }
  47391. }
  47392. /***/ }),
  47393. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/textproxy.js":
  47394. /*!***********************************************************************!*\
  47395. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/textproxy.js ***!
  47396. \***********************************************************************/
  47397. /*! exports provided: default */
  47398. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  47399. "use strict";
  47400. __webpack_require__.r(__webpack_exports__);
  47401. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return TextProxy; });
  47402. /* 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");
  47403. /**
  47404. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  47405. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  47406. */
  47407. /**
  47408. * @module engine/view/textproxy
  47409. */
  47410. /**
  47411. * TextProxy is a wrapper for substring of {@link module:engine/view/text~Text}. Instance of this class is created by
  47412. * {@link module:engine/view/treewalker~TreeWalker} when only a part of {@link module:engine/view/text~Text} needs to be returned.
  47413. *
  47414. * `TextProxy` has an API similar to {@link module:engine/view/text~Text Text} and allows to do most of the common tasks performed
  47415. * on view nodes.
  47416. *
  47417. * **Note:** Some `TextProxy` instances may represent whole text node, not just a part of it.
  47418. * See {@link module:engine/view/textproxy~TextProxy#isPartial}.
  47419. *
  47420. * **Note:** `TextProxy` is a readonly interface.
  47421. *
  47422. * **Note:** `TextProxy` instances are created on the fly basing on the current state of parent {@link module:engine/view/text~Text}.
  47423. * Because of this it is highly unrecommended to store references to `TextProxy instances because they might get
  47424. * invalidated due to operations on Document. Also TextProxy is not a {@link module:engine/view/node~Node} so it can not be
  47425. * inserted as a child of {@link module:engine/view/element~Element}.
  47426. *
  47427. * `TextProxy` instances are created by {@link module:engine/view/treewalker~TreeWalker view tree walker}. You should not need to create
  47428. * an instance of this class by your own.
  47429. */
  47430. class TextProxy {
  47431. /**
  47432. * Creates a text proxy.
  47433. *
  47434. * @protected
  47435. * @param {module:engine/view/text~Text} textNode Text node which part is represented by this text proxy.
  47436. * @param {Number} offsetInText Offset in {@link module:engine/view/textproxy~TextProxy#textNode text node}
  47437. * from which the text proxy starts.
  47438. * @param {Number} length Text proxy length, that is how many text node's characters, starting from `offsetInText` it represents.
  47439. * @constructor
  47440. */
  47441. constructor( textNode, offsetInText, length ) {
  47442. /**
  47443. * Reference to the {@link module:engine/view/text~Text} element which TextProxy is a substring.
  47444. *
  47445. * @readonly
  47446. * @member {module:engine/view/text~Text} module:engine/view/textproxy~TextProxy#textNode
  47447. */
  47448. this.textNode = textNode;
  47449. if ( offsetInText < 0 || offsetInText > textNode.data.length ) {
  47450. /**
  47451. * Given offsetInText value is incorrect.
  47452. *
  47453. * @error view-textproxy-wrong-offsetintext
  47454. */
  47455. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"]( 'view-textproxy-wrong-offsetintext', this );
  47456. }
  47457. if ( length < 0 || offsetInText + length > textNode.data.length ) {
  47458. /**
  47459. * Given length value is incorrect.
  47460. *
  47461. * @error view-textproxy-wrong-length
  47462. */
  47463. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"]( 'view-textproxy-wrong-length', this );
  47464. }
  47465. /**
  47466. * Text data represented by this text proxy.
  47467. *
  47468. * @readonly
  47469. * @member {String} module:engine/view/textproxy~TextProxy#data
  47470. */
  47471. this.data = textNode.data.substring( offsetInText, offsetInText + length );
  47472. /**
  47473. * Offset in the `textNode` where this `TextProxy` instance starts.
  47474. *
  47475. * @readonly
  47476. * @member {Number} module:engine/view/textproxy~TextProxy#offsetInText
  47477. */
  47478. this.offsetInText = offsetInText;
  47479. }
  47480. /**
  47481. * Offset size of this node.
  47482. *
  47483. * @readonly
  47484. * @type {Number}
  47485. */
  47486. get offsetSize() {
  47487. return this.data.length;
  47488. }
  47489. /**
  47490. * Flag indicating whether `TextProxy` instance covers only part of the original {@link module:engine/view/text~Text text node}
  47491. * (`true`) or the whole text node (`false`).
  47492. *
  47493. * This is `false` when text proxy starts at the very beginning of {@link module:engine/view/textproxy~TextProxy#textNode textNode}
  47494. * ({@link module:engine/view/textproxy~TextProxy#offsetInText offsetInText} equals `0`) and text proxy sizes is equal to
  47495. * text node size.
  47496. *
  47497. * @readonly
  47498. * @type {Boolean}
  47499. */
  47500. get isPartial() {
  47501. return this.data.length !== this.textNode.data.length;
  47502. }
  47503. /**
  47504. * Parent of this text proxy, which is same as parent of text node represented by this text proxy.
  47505. *
  47506. * @readonly
  47507. * @type {module:engine/view/element~Element|module:engine/view/documentfragment~DocumentFragment|null}
  47508. */
  47509. get parent() {
  47510. return this.textNode.parent;
  47511. }
  47512. /**
  47513. * Root of this text proxy, which is same as root of text node represented by this text proxy.
  47514. *
  47515. * @readonly
  47516. * @type {module:engine/view/node~Node|module:engine/view/documentfragment~DocumentFragment}
  47517. */
  47518. get root() {
  47519. return this.textNode.root;
  47520. }
  47521. /**
  47522. * {@link module:engine/view/document~Document View document} that owns this text proxy, or `null` if the text proxy is inside
  47523. * {@link module:engine/view/documentfragment~DocumentFragment document fragment}.
  47524. *
  47525. * @readonly
  47526. * @type {module:engine/view/document~Document|null}
  47527. */
  47528. get document() {
  47529. return this.textNode.document;
  47530. }
  47531. /**
  47532. * Checks whether this object is of the given type.
  47533. *
  47534. * textProxy.is( '$textProxy' ); // -> true
  47535. * textProxy.is( 'view:$textProxy' ); // -> true
  47536. *
  47537. * textProxy.is( 'model:$textProxy' ); // -> false
  47538. * textProxy.is( 'element' ); // -> false
  47539. * textProxy.is( 'range' ); // -> false
  47540. *
  47541. * {@link module:engine/view/node~Node#is Check the entire list of view objects} which implement the `is()` method.
  47542. *
  47543. * **Note:** Until version 20.0.0 this method wasn't accepting `'$textProxy'` type. The legacy `'textProxy'` type is still
  47544. * accepted for backward compatibility.
  47545. *
  47546. * @param {String} type Type to check.
  47547. * @returns {Boolean}
  47548. */
  47549. is( type ) {
  47550. return type === '$textProxy' || type === 'view:$textProxy' ||
  47551. // This are legacy values kept for backward compatibility.
  47552. type === 'textProxy' || type === 'view:textProxy';
  47553. }
  47554. /**
  47555. * Returns ancestors array of this text proxy.
  47556. *
  47557. * @param {Object} options Options object.
  47558. * @param {Boolean} [options.includeSelf=false] When set to `true` {#textNode} will be also included in parent's array.
  47559. * @param {Boolean} [options.parentFirst=false] When set to `true`, array will be sorted from text proxy parent to
  47560. * root element, otherwise root element will be the first item in the array.
  47561. * @returns {Array} Array with ancestors.
  47562. */
  47563. getAncestors( options = { includeSelf: false, parentFirst: false } ) {
  47564. const ancestors = [];
  47565. let parent = options.includeSelf ? this.textNode : this.parent;
  47566. while ( parent !== null ) {
  47567. ancestors[ options.parentFirst ? 'push' : 'unshift' ]( parent );
  47568. parent = parent.parent;
  47569. }
  47570. return ancestors;
  47571. }
  47572. // @if CK_DEBUG_ENGINE // toString() {
  47573. // @if CK_DEBUG_ENGINE // return `#${ this.data }`;
  47574. // @if CK_DEBUG_ENGINE // }
  47575. // @if CK_DEBUG_ENGINE // log() {
  47576. // @if CK_DEBUG_ENGINE // console.log( 'ViewTextProxy: ' + this );
  47577. // @if CK_DEBUG_ENGINE // }
  47578. // @if CK_DEBUG_ENGINE // logExtended() {
  47579. // @if CK_DEBUG_ENGINE // console.log( 'ViewTextProxy: ' + this );
  47580. // @if CK_DEBUG_ENGINE // }
  47581. }
  47582. /***/ }),
  47583. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/treewalker.js":
  47584. /*!************************************************************************!*\
  47585. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/treewalker.js ***!
  47586. \************************************************************************/
  47587. /*! exports provided: default */
  47588. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  47589. "use strict";
  47590. __webpack_require__.r(__webpack_exports__);
  47591. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return TreeWalker; });
  47592. /* harmony import */ var _element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./element */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/element.js");
  47593. /* harmony import */ var _text__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./text */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/text.js");
  47594. /* harmony import */ var _textproxy__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./textproxy */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/textproxy.js");
  47595. /* harmony import */ var _position__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./position */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/position.js");
  47596. /* 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");
  47597. /**
  47598. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  47599. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  47600. */
  47601. /**
  47602. * @module engine/view/treewalker
  47603. */
  47604. /**
  47605. * Position iterator class. It allows to iterate forward and backward over the document.
  47606. */
  47607. class TreeWalker {
  47608. /**
  47609. * Creates a range iterator. All parameters are optional, but you have to specify either `boundaries` or `startPosition`.
  47610. *
  47611. * @constructor
  47612. * @param {Object} options Object with configuration.
  47613. * @param {module:engine/view/range~Range} [options.boundaries=null] Range to define boundaries of the iterator.
  47614. * @param {module:engine/view/position~Position} [options.startPosition] Starting position.
  47615. * @param {'forward'|'backward'} [options.direction='forward'] Walking direction.
  47616. * @param {Boolean} [options.singleCharacters=false] Flag indicating whether all characters from
  47617. * {@link module:engine/view/text~Text} should be returned as one {@link module:engine/view/text~Text} (`false`) ore one by one as
  47618. * {@link module:engine/view/textproxy~TextProxy} (`true`).
  47619. * @param {Boolean} [options.shallow=false] Flag indicating whether iterator should enter elements or not. If the
  47620. * iterator is shallow child nodes of any iterated node will not be returned along with `elementEnd` tag.
  47621. * @param {Boolean} [options.ignoreElementEnd=false] Flag indicating whether iterator should ignore `elementEnd`
  47622. * tags. If the option is true walker will not return a parent node of start position. If this option is `true`
  47623. * each {@link module:engine/view/element~Element} will be returned once, while if the option is `false` they might be returned
  47624. * twice: for `'elementStart'` and `'elementEnd'`.
  47625. */
  47626. constructor( options = {} ) {
  47627. if ( !options.boundaries && !options.startPosition ) {
  47628. /**
  47629. * Neither boundaries nor starting position have been defined.
  47630. *
  47631. * @error view-tree-walker-no-start-position
  47632. */
  47633. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_4__["default"](
  47634. 'view-tree-walker-no-start-position',
  47635. null
  47636. );
  47637. }
  47638. if ( options.direction && options.direction != 'forward' && options.direction != 'backward' ) {
  47639. /**
  47640. * Only `backward` and `forward` direction allowed.
  47641. *
  47642. * @error view-tree-walker-unknown-direction
  47643. */
  47644. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_4__["default"]( 'view-tree-walker-unknown-direction', options.startPosition, { direction: options.direction } );
  47645. }
  47646. /**
  47647. * Iterator boundaries.
  47648. *
  47649. * When the iterator is walking `'forward'` on the end of boundary or is walking `'backward'`
  47650. * on the start of boundary, then `{ done: true }` is returned.
  47651. *
  47652. * If boundaries are not defined they are set before first and after last child of the root node.
  47653. *
  47654. * @readonly
  47655. * @member {module:engine/view/range~Range} module:engine/view/treewalker~TreeWalker#boundaries
  47656. */
  47657. this.boundaries = options.boundaries || null;
  47658. /**
  47659. * Iterator position. If start position is not defined then position depends on {@link #direction}. If direction is
  47660. * `'forward'` position starts form the beginning, when direction is `'backward'` position starts from the end.
  47661. *
  47662. * @readonly
  47663. * @member {module:engine/view/position~Position} module:engine/view/treewalker~TreeWalker#position
  47664. */
  47665. if ( options.startPosition ) {
  47666. this.position = _position__WEBPACK_IMPORTED_MODULE_3__["default"]._createAt( options.startPosition );
  47667. } else {
  47668. this.position = _position__WEBPACK_IMPORTED_MODULE_3__["default"]._createAt( options.boundaries[ options.direction == 'backward' ? 'end' : 'start' ] );
  47669. }
  47670. /**
  47671. * Walking direction. Defaults `'forward'`.
  47672. *
  47673. * @readonly
  47674. * @member {'backward'|'forward'} module:engine/view/treewalker~TreeWalker#direction
  47675. */
  47676. this.direction = options.direction || 'forward';
  47677. /**
  47678. * Flag indicating whether all characters from {@link module:engine/view/text~Text} should be returned as one
  47679. * {@link module:engine/view/text~Text} or one by one as {@link module:engine/view/textproxy~TextProxy}.
  47680. *
  47681. * @readonly
  47682. * @member {Boolean} module:engine/view/treewalker~TreeWalker#singleCharacters
  47683. */
  47684. this.singleCharacters = !!options.singleCharacters;
  47685. /**
  47686. * Flag indicating whether iterator should enter elements or not. If the iterator is shallow child nodes of any
  47687. * iterated node will not be returned along with `elementEnd` tag.
  47688. *
  47689. * @readonly
  47690. * @member {Boolean} module:engine/view/treewalker~TreeWalker#shallow
  47691. */
  47692. this.shallow = !!options.shallow;
  47693. /**
  47694. * Flag indicating whether iterator should ignore `elementEnd` tags. If set to `true`, walker will not
  47695. * return a parent node of the start position. Each {@link module:engine/view/element~Element} will be returned once.
  47696. * When set to `false` each element might be returned twice: for `'elementStart'` and `'elementEnd'`.
  47697. *
  47698. * @readonly
  47699. * @member {Boolean} module:engine/view/treewalker~TreeWalker#ignoreElementEnd
  47700. */
  47701. this.ignoreElementEnd = !!options.ignoreElementEnd;
  47702. /**
  47703. * Start boundary parent.
  47704. *
  47705. * @private
  47706. * @member {module:engine/view/node~Node} module:engine/view/treewalker~TreeWalker#_boundaryStartParent
  47707. */
  47708. this._boundaryStartParent = this.boundaries ? this.boundaries.start.parent : null;
  47709. /**
  47710. * End boundary parent.
  47711. *
  47712. * @private
  47713. * @member {module:engine/view/node~Node} module:engine/view/treewalker~TreeWalker#_boundaryEndParent
  47714. */
  47715. this._boundaryEndParent = this.boundaries ? this.boundaries.end.parent : null;
  47716. }
  47717. /**
  47718. * Iterable interface.
  47719. *
  47720. * @returns {Iterable.<module:engine/view/treewalker~TreeWalkerValue>}
  47721. */
  47722. [ Symbol.iterator ]() {
  47723. return this;
  47724. }
  47725. /**
  47726. * Moves {@link #position} in the {@link #direction} skipping values as long as the callback function returns `true`.
  47727. *
  47728. * For example:
  47729. *
  47730. * walker.skip( value => value.type == 'text' ); // <p>{}foo</p> -> <p>foo[]</p>
  47731. * walker.skip( value => true ); // Move the position to the end: <p>{}foo</p> -> <p>foo</p>[]
  47732. * walker.skip( value => false ); // Do not move the position.
  47733. *
  47734. * @param {Function} skip Callback function. Gets {@link module:engine/view/treewalker~TreeWalkerValue} and should
  47735. * return `true` if the value should be skipped or `false` if not.
  47736. */
  47737. skip( skip ) {
  47738. let done, value, prevPosition;
  47739. do {
  47740. prevPosition = this.position;
  47741. ( { done, value } = this.next() );
  47742. } while ( !done && skip( value ) );
  47743. if ( !done ) {
  47744. this.position = prevPosition;
  47745. }
  47746. }
  47747. /**
  47748. * Gets the next tree walker's value.
  47749. *
  47750. * @returns {module:engine/view/treewalker~TreeWalkerValue} Object implementing iterator interface, returning
  47751. * information about taken step.
  47752. */
  47753. next() {
  47754. if ( this.direction == 'forward' ) {
  47755. return this._next();
  47756. } else {
  47757. return this._previous();
  47758. }
  47759. }
  47760. /**
  47761. * Makes a step forward in view. Moves the {@link #position} to the next position and returns the encountered value.
  47762. *
  47763. * @private
  47764. * @returns {Object}
  47765. * @returns {Boolean} return.done `true` if iterator is done, `false` otherwise.
  47766. * @returns {module:engine/view/treewalker~TreeWalkerValue} return.value Information about taken step.
  47767. */
  47768. _next() {
  47769. let position = this.position.clone();
  47770. const previousPosition = this.position;
  47771. const parent = position.parent;
  47772. // We are at the end of the root.
  47773. if ( parent.parent === null && position.offset === parent.childCount ) {
  47774. return { done: true };
  47775. }
  47776. // We reached the walker boundary.
  47777. if ( parent === this._boundaryEndParent && position.offset == this.boundaries.end.offset ) {
  47778. return { done: true };
  47779. }
  47780. // Get node just after current position.
  47781. let node;
  47782. // Text is a specific parent because it contains string instead of child nodes.
  47783. if ( parent instanceof _text__WEBPACK_IMPORTED_MODULE_1__["default"] ) {
  47784. if ( position.isAtEnd ) {
  47785. // Prevent returning "elementEnd" for Text node. Skip that value and return the next walker step.
  47786. this.position = _position__WEBPACK_IMPORTED_MODULE_3__["default"]._createAfter( parent );
  47787. return this._next();
  47788. }
  47789. node = parent.data[ position.offset ];
  47790. } else {
  47791. node = parent.getChild( position.offset );
  47792. }
  47793. if ( node instanceof _element__WEBPACK_IMPORTED_MODULE_0__["default"] ) {
  47794. if ( !this.shallow ) {
  47795. position = new _position__WEBPACK_IMPORTED_MODULE_3__["default"]( node, 0 );
  47796. } else {
  47797. position.offset++;
  47798. }
  47799. this.position = position;
  47800. return this._formatReturnValue( 'elementStart', node, previousPosition, position, 1 );
  47801. } else if ( node instanceof _text__WEBPACK_IMPORTED_MODULE_1__["default"] ) {
  47802. if ( this.singleCharacters ) {
  47803. position = new _position__WEBPACK_IMPORTED_MODULE_3__["default"]( node, 0 );
  47804. this.position = position;
  47805. return this._next();
  47806. } else {
  47807. let charactersCount = node.data.length;
  47808. let item;
  47809. // If text stick out of walker range, we need to cut it and wrap in TextProxy.
  47810. if ( node == this._boundaryEndParent ) {
  47811. charactersCount = this.boundaries.end.offset;
  47812. item = new _textproxy__WEBPACK_IMPORTED_MODULE_2__["default"]( node, 0, charactersCount );
  47813. position = _position__WEBPACK_IMPORTED_MODULE_3__["default"]._createAfter( item );
  47814. } else {
  47815. item = new _textproxy__WEBPACK_IMPORTED_MODULE_2__["default"]( node, 0, node.data.length );
  47816. // If not just keep moving forward.
  47817. position.offset++;
  47818. }
  47819. this.position = position;
  47820. return this._formatReturnValue( 'text', item, previousPosition, position, charactersCount );
  47821. }
  47822. } else if ( typeof node == 'string' ) {
  47823. let textLength;
  47824. if ( this.singleCharacters ) {
  47825. textLength = 1;
  47826. } else {
  47827. // Check if text stick out of walker range.
  47828. const endOffset = parent === this._boundaryEndParent ? this.boundaries.end.offset : parent.data.length;
  47829. textLength = endOffset - position.offset;
  47830. }
  47831. const textProxy = new _textproxy__WEBPACK_IMPORTED_MODULE_2__["default"]( parent, position.offset, textLength );
  47832. position.offset += textLength;
  47833. this.position = position;
  47834. return this._formatReturnValue( 'text', textProxy, previousPosition, position, textLength );
  47835. } else {
  47836. // `node` is not set, we reached the end of current `parent`.
  47837. position = _position__WEBPACK_IMPORTED_MODULE_3__["default"]._createAfter( parent );
  47838. this.position = position;
  47839. if ( this.ignoreElementEnd ) {
  47840. return this._next();
  47841. } else {
  47842. return this._formatReturnValue( 'elementEnd', parent, previousPosition, position );
  47843. }
  47844. }
  47845. }
  47846. /**
  47847. * Makes a step backward in view. Moves the {@link #position} to the previous position and returns the encountered value.
  47848. *
  47849. * @private
  47850. * @returns {Object}
  47851. * @returns {Boolean} return.done True if iterator is done.
  47852. * @returns {module:engine/view/treewalker~TreeWalkerValue} return.value Information about taken step.
  47853. */
  47854. _previous() {
  47855. let position = this.position.clone();
  47856. const previousPosition = this.position;
  47857. const parent = position.parent;
  47858. // We are at the beginning of the root.
  47859. if ( parent.parent === null && position.offset === 0 ) {
  47860. return { done: true };
  47861. }
  47862. // We reached the walker boundary.
  47863. if ( parent == this._boundaryStartParent && position.offset == this.boundaries.start.offset ) {
  47864. return { done: true };
  47865. }
  47866. // Get node just before current position.
  47867. let node;
  47868. // Text {@link module:engine/view/text~Text} element is a specific parent because contains string instead of child nodes.
  47869. if ( parent instanceof _text__WEBPACK_IMPORTED_MODULE_1__["default"] ) {
  47870. if ( position.isAtStart ) {
  47871. // Prevent returning "elementStart" for Text node. Skip that value and return the next walker step.
  47872. this.position = _position__WEBPACK_IMPORTED_MODULE_3__["default"]._createBefore( parent );
  47873. return this._previous();
  47874. }
  47875. node = parent.data[ position.offset - 1 ];
  47876. } else {
  47877. node = parent.getChild( position.offset - 1 );
  47878. }
  47879. if ( node instanceof _element__WEBPACK_IMPORTED_MODULE_0__["default"] ) {
  47880. if ( !this.shallow ) {
  47881. position = new _position__WEBPACK_IMPORTED_MODULE_3__["default"]( node, node.childCount );
  47882. this.position = position;
  47883. if ( this.ignoreElementEnd ) {
  47884. return this._previous();
  47885. } else {
  47886. return this._formatReturnValue( 'elementEnd', node, previousPosition, position );
  47887. }
  47888. } else {
  47889. position.offset--;
  47890. this.position = position;
  47891. return this._formatReturnValue( 'elementStart', node, previousPosition, position, 1 );
  47892. }
  47893. } else if ( node instanceof _text__WEBPACK_IMPORTED_MODULE_1__["default"] ) {
  47894. if ( this.singleCharacters ) {
  47895. position = new _position__WEBPACK_IMPORTED_MODULE_3__["default"]( node, node.data.length );
  47896. this.position = position;
  47897. return this._previous();
  47898. } else {
  47899. let charactersCount = node.data.length;
  47900. let item;
  47901. // If text stick out of walker range, we need to cut it and wrap in TextProxy.
  47902. if ( node == this._boundaryStartParent ) {
  47903. const offset = this.boundaries.start.offset;
  47904. item = new _textproxy__WEBPACK_IMPORTED_MODULE_2__["default"]( node, offset, node.data.length - offset );
  47905. charactersCount = item.data.length;
  47906. position = _position__WEBPACK_IMPORTED_MODULE_3__["default"]._createBefore( item );
  47907. } else {
  47908. item = new _textproxy__WEBPACK_IMPORTED_MODULE_2__["default"]( node, 0, node.data.length );
  47909. // If not just keep moving backward.
  47910. position.offset--;
  47911. }
  47912. this.position = position;
  47913. return this._formatReturnValue( 'text', item, previousPosition, position, charactersCount );
  47914. }
  47915. } else if ( typeof node == 'string' ) {
  47916. let textLength;
  47917. if ( !this.singleCharacters ) {
  47918. // Check if text stick out of walker range.
  47919. const startOffset = parent === this._boundaryStartParent ? this.boundaries.start.offset : 0;
  47920. textLength = position.offset - startOffset;
  47921. } else {
  47922. textLength = 1;
  47923. }
  47924. position.offset -= textLength;
  47925. const textProxy = new _textproxy__WEBPACK_IMPORTED_MODULE_2__["default"]( parent, position.offset, textLength );
  47926. this.position = position;
  47927. return this._formatReturnValue( 'text', textProxy, previousPosition, position, textLength );
  47928. } else {
  47929. // `node` is not set, we reached the beginning of current `parent`.
  47930. position = _position__WEBPACK_IMPORTED_MODULE_3__["default"]._createBefore( parent );
  47931. this.position = position;
  47932. return this._formatReturnValue( 'elementStart', parent, previousPosition, position, 1 );
  47933. }
  47934. }
  47935. /**
  47936. * Format returned data and adjust `previousPosition` and `nextPosition` if reach the bound of the {@link module:engine/view/text~Text}.
  47937. *
  47938. * @private
  47939. * @param {module:engine/view/treewalker~TreeWalkerValueType} type Type of step.
  47940. * @param {module:engine/view/item~Item} item Item between old and new position.
  47941. * @param {module:engine/view/position~Position} previousPosition Previous position of iterator.
  47942. * @param {module:engine/view/position~Position} nextPosition Next position of iterator.
  47943. * @param {Number} [length] Length of the item.
  47944. * @returns {module:engine/view/treewalker~TreeWalkerValue}
  47945. */
  47946. _formatReturnValue( type, item, previousPosition, nextPosition, length ) {
  47947. // Text is a specific parent, because contains string instead of children.
  47948. // Walker doesn't enter to the Text except situations when walker is iterating over every single character,
  47949. // or the bound starts/ends inside the Text. So when the position is at the beginning or at the end of the Text
  47950. // we move it just before or just after Text.
  47951. if ( item instanceof _textproxy__WEBPACK_IMPORTED_MODULE_2__["default"] ) {
  47952. // Position is at the end of Text.
  47953. if ( item.offsetInText + item.data.length == item.textNode.data.length ) {
  47954. if ( this.direction == 'forward' && !( this.boundaries && this.boundaries.end.isEqual( this.position ) ) ) {
  47955. nextPosition = _position__WEBPACK_IMPORTED_MODULE_3__["default"]._createAfter( item.textNode );
  47956. // When we change nextPosition of returned value we need also update walker current position.
  47957. this.position = nextPosition;
  47958. } else {
  47959. previousPosition = _position__WEBPACK_IMPORTED_MODULE_3__["default"]._createAfter( item.textNode );
  47960. }
  47961. }
  47962. // Position is at the begining ot the text.
  47963. if ( item.offsetInText === 0 ) {
  47964. if ( this.direction == 'backward' && !( this.boundaries && this.boundaries.start.isEqual( this.position ) ) ) {
  47965. nextPosition = _position__WEBPACK_IMPORTED_MODULE_3__["default"]._createBefore( item.textNode );
  47966. // When we change nextPosition of returned value we need also update walker current position.
  47967. this.position = nextPosition;
  47968. } else {
  47969. previousPosition = _position__WEBPACK_IMPORTED_MODULE_3__["default"]._createBefore( item.textNode );
  47970. }
  47971. }
  47972. }
  47973. return {
  47974. done: false,
  47975. value: {
  47976. type,
  47977. item,
  47978. previousPosition,
  47979. nextPosition,
  47980. length
  47981. }
  47982. };
  47983. }
  47984. }
  47985. /**
  47986. * Type of the step made by {@link module:engine/view/treewalker~TreeWalker}.
  47987. * Possible values: `'elementStart'` if walker is at the beginning of a node, `'elementEnd'` if walker is at the end
  47988. * of node, or `'text'` if walker traversed over single and multiple characters.
  47989. * For {@link module:engine/view/text~Text} `elementStart` and `elementEnd` is not returned.
  47990. *
  47991. * @typedef {String} module:engine/view/treewalker~TreeWalkerValueType
  47992. */
  47993. /**
  47994. * Object returned by {@link module:engine/view/treewalker~TreeWalker} when traversing tree view.
  47995. *
  47996. * @typedef {Object} module:engine/view/treewalker~TreeWalkerValue
  47997. * @property {module:engine/view/treewalker~TreeWalkerValueType} type
  47998. * @property {module:engine/view/item~Item} item Item between the old and the new positions
  47999. * of the tree walker.
  48000. * @property {module:engine/view/position~Position} previousPosition Previous position of the iterator.
  48001. * * Forward iteration: For `'elementEnd'` it is the last position inside the element. For all other types it is the
  48002. * position before the item.
  48003. * * Backward iteration: For `'elementStart'` it is the first position inside the element. For all other types it is
  48004. * the position after item.
  48005. * * 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
  48006. * inside of the text to its parent just before or just after that text.
  48007. * @property {module:engine/view/position~Position} nextPosition Next position of the iterator.
  48008. * * Forward iteration: For `'elementStart'` it is the first position inside the element. For all other types it is
  48009. * the position after the item.
  48010. * * Backward iteration: For `'elementEnd'` it is last position inside element. For all other types it is the position
  48011. * before the item.
  48012. * * 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
  48013. * inside of the text to its parent just before or just after that text.
  48014. * @property {Number} [length] Length of the item. For `'elementStart'` it is `1`. For `'text'` it is
  48015. * the length of that text. For `'elementEnd'` it is `undefined`.
  48016. */
  48017. /**
  48018. * Tree walking directions.
  48019. *
  48020. * @typedef {'forward'|'backward'} module:engine/view/treewalker~TreeWalkerDirection
  48021. */
  48022. /***/ }),
  48023. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/uielement.js":
  48024. /*!***********************************************************************!*\
  48025. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/uielement.js ***!
  48026. \***********************************************************************/
  48027. /*! exports provided: default, injectUiElementHandling */
  48028. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  48029. "use strict";
  48030. __webpack_require__.r(__webpack_exports__);
  48031. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return UIElement; });
  48032. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "injectUiElementHandling", function() { return injectUiElementHandling; });
  48033. /* harmony import */ var _element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./element */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/element.js");
  48034. /* 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");
  48035. /* harmony import */ var _node__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/node.js");
  48036. /* 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");
  48037. /**
  48038. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  48039. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  48040. */
  48041. /**
  48042. * @module engine/view/uielement
  48043. */
  48044. /**
  48045. * UI element class. It should be used to represent editing UI which needs to be injected into the editing view
  48046. * If possible, you should keep your UI outside the editing view. However, if that is not possible,
  48047. * UI elements can be used.
  48048. *
  48049. * How a UI element is rendered is in your control (you pass a callback to
  48050. * {@link module:engine/view/downcastwriter~DowncastWriter#createUIElement `downcastWriter#createUIElement()`}).
  48051. * The editor will ignore your UI element – the selection cannot be placed in it, it is skipped (invisible) when
  48052. * the user modifies the selection by using arrow keys and the editor does not listen to any mutations which
  48053. * happen inside your UI elements.
  48054. *
  48055. * The limitation is that you cannot convert a model element to a UI element. UI elements need to be
  48056. * created for {@link module:engine/model/markercollection~Marker markers} or as additinal elements
  48057. * inside normal {@link module:engine/view/containerelement~ContainerElement container elements}.
  48058. *
  48059. * To create a new UI element use the
  48060. * {@link module:engine/view/downcastwriter~DowncastWriter#createUIElement `downcastWriter#createUIElement()`} method.
  48061. *
  48062. * @extends module:engine/view/element~Element
  48063. */
  48064. class UIElement extends _element__WEBPACK_IMPORTED_MODULE_0__["default"] {
  48065. /**
  48066. * Creates new instance of UIElement.
  48067. *
  48068. * Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `view-uielement-cannot-add` when third parameter is passed,
  48069. * to inform that usage of UIElement is incorrect (adding child nodes to UIElement is forbidden).
  48070. *
  48071. * @see module:engine/view/downcastwriter~DowncastWriter#createUIElement
  48072. * @protected
  48073. * @param {module:engine/view/document~Document} document The document instance to which this element belongs.
  48074. * @param {String} name Node name.
  48075. * @param {Object|Iterable} [attributes] Collection of attributes.
  48076. * @param {module:engine/view/node~Node|Iterable.<module:engine/view/node~Node>} [children]
  48077. * A list of nodes to be inserted into created element.
  48078. */
  48079. constructor( document, name, attributes, children ) {
  48080. super( document, name, attributes, children );
  48081. // Override the default of the base class.
  48082. this._isAllowedInsideAttributeElement = true;
  48083. /**
  48084. * Returns `null` because filler is not needed for UIElements.
  48085. *
  48086. * @method #getFillerOffset
  48087. * @returns {null} Always returns null.
  48088. */
  48089. this.getFillerOffset = getFillerOffset;
  48090. }
  48091. /**
  48092. * Checks whether this object is of the given.
  48093. *
  48094. * uiElement.is( 'uiElement' ); // -> true
  48095. * uiElement.is( 'element' ); // -> true
  48096. * uiElement.is( 'node' ); // -> true
  48097. * uiElement.is( 'view:uiElement' ); // -> true
  48098. * uiElement.is( 'view:element' ); // -> true
  48099. * uiElement.is( 'view:node' ); // -> true
  48100. *
  48101. * uiElement.is( 'model:element' ); // -> false
  48102. * uiElement.is( 'documentFragment' ); // -> false
  48103. *
  48104. * Assuming that the object being checked is an ui element, you can also check its
  48105. * {@link module:engine/view/uielement~UIElement#name name}:
  48106. *
  48107. * uiElement.is( 'element', 'span' ); // -> true if this is a span ui element
  48108. * uiElement.is( 'uiElement', 'span' ); // -> same as above
  48109. * text.is( 'element', 'span' ); -> false
  48110. *
  48111. * {@link module:engine/view/node~Node#is Check the entire list of view objects} which implement the `is()` method.
  48112. *
  48113. * @param {String} type Type to check.
  48114. * @param {String} [name] Element name.
  48115. * @returns {Boolean}
  48116. */
  48117. is( type, name = null ) {
  48118. if ( !name ) {
  48119. return type === 'uiElement' || type === 'view:uiElement' ||
  48120. // From super.is(). This is highly utilised method and cannot call super. See ckeditor/ckeditor5#6529.
  48121. type === 'element' || type === 'view:element' ||
  48122. type === 'node' || type === 'view:node';
  48123. } else {
  48124. return name === this.name && (
  48125. type === 'uiElement' || type === 'view:uiElement' ||
  48126. type === 'element' || type === 'view:element'
  48127. );
  48128. }
  48129. }
  48130. /**
  48131. * Overrides {@link module:engine/view/element~Element#_insertChild} method.
  48132. * Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `view-uielement-cannot-add` to prevent adding any child nodes
  48133. * to UIElement.
  48134. *
  48135. * @protected
  48136. */
  48137. _insertChild( index, nodes ) {
  48138. if ( nodes && ( nodes instanceof _node__WEBPACK_IMPORTED_MODULE_2__["default"] || Array.from( nodes ).length > 0 ) ) {
  48139. /**
  48140. * Cannot add children to {@link module:engine/view/uielement~UIElement}.
  48141. *
  48142. * @error view-uielement-cannot-add
  48143. */
  48144. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_1__["default"]( 'view-uielement-cannot-add', this );
  48145. }
  48146. }
  48147. /**
  48148. * Renders this {@link module:engine/view/uielement~UIElement} to DOM. This method is called by
  48149. * {@link module:engine/view/domconverter~DomConverter}.
  48150. * Do not use inheritance to create custom rendering method, replace `render()` method instead:
  48151. *
  48152. * const myUIElement = downcastWriter.createUIElement( 'span' );
  48153. * myUIElement.render = function( domDocument ) {
  48154. * const domElement = this.toDomElement( domDocument );
  48155. * domElement.innerHTML = '<b>this is ui element</b>';
  48156. *
  48157. * return domElement;
  48158. * };
  48159. *
  48160. * If changes in your UI element should trigger some editor UI update you should call
  48161. * the {@link module:core/editor/editorui~EditorUI#update `editor.ui.update()`} method
  48162. * after rendering your UI element.
  48163. *
  48164. * @param {Document} domDocument
  48165. * @returns {HTMLElement}
  48166. */
  48167. render( domDocument ) {
  48168. return this.toDomElement( domDocument );
  48169. }
  48170. /**
  48171. * Creates DOM element based on this view UIElement.
  48172. * Note that each time this method is called new DOM element is created.
  48173. *
  48174. * @param {Document} domDocument
  48175. * @returns {HTMLElement}
  48176. */
  48177. toDomElement( domDocument ) {
  48178. const domElement = domDocument.createElement( this.name );
  48179. for ( const key of this.getAttributeKeys() ) {
  48180. domElement.setAttribute( key, this.getAttribute( key ) );
  48181. }
  48182. return domElement;
  48183. }
  48184. }
  48185. /**
  48186. * This function injects UI element handling to the given {@link module:engine/view/document~Document document}.
  48187. *
  48188. * A callback is added to {@link module:engine/view/document~Document#event:keydown document keydown event}.
  48189. * The callback handles the situation when right arrow key is pressed and selection is collapsed before a UI element.
  48190. * Without this handler, it would be impossible to "jump over" UI element using right arrow key.
  48191. *
  48192. * @param {module:engine/view/view~View} view View controller to which the quirks handling will be injected.
  48193. */
  48194. function injectUiElementHandling( view ) {
  48195. view.document.on( 'arrowKey', ( evt, data ) => jumpOverUiElement( evt, data, view.domConverter ), { priority: 'low' } );
  48196. }
  48197. // Returns `null` because block filler is not needed for UIElements.
  48198. //
  48199. // @returns {null}
  48200. function getFillerOffset() {
  48201. return null;
  48202. }
  48203. // Selection cannot be placed in a `UIElement`. Whenever it is placed there, it is moved before it. This
  48204. // causes a situation when it is impossible to jump over `UIElement` using right arrow key, because the selection
  48205. // ends up in ui element (in DOM) and is moved back to the left. This handler fixes this situation.
  48206. function jumpOverUiElement( evt, data, domConverter ) {
  48207. if ( data.keyCode == _ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_3__["keyCodes"].arrowright ) {
  48208. const domSelection = data.domTarget.ownerDocument.defaultView.getSelection();
  48209. const domSelectionCollapsed = domSelection.rangeCount == 1 && domSelection.getRangeAt( 0 ).collapsed;
  48210. // Jump over UI element if selection is collapsed or shift key is pressed. These are the cases when selection would extend.
  48211. if ( domSelectionCollapsed || data.shiftKey ) {
  48212. const domParent = domSelection.focusNode;
  48213. const domOffset = domSelection.focusOffset;
  48214. const viewPosition = domConverter.domPositionToView( domParent, domOffset );
  48215. // In case if dom element is not converted to view or is not mapped or something. Happens for example in some tests.
  48216. if ( viewPosition === null ) {
  48217. return;
  48218. }
  48219. // Skip all following ui elements.
  48220. let jumpedOverAnyUiElement = false;
  48221. const nextViewPosition = viewPosition.getLastMatchingPosition( value => {
  48222. if ( value.item.is( 'uiElement' ) ) {
  48223. // Remember that there was at least one ui element.
  48224. jumpedOverAnyUiElement = true;
  48225. }
  48226. // Jump over ui elements, jump over empty attribute elements, move up from inside of attribute element.
  48227. if ( value.item.is( 'uiElement' ) || value.item.is( 'attributeElement' ) ) {
  48228. return true;
  48229. }
  48230. // Don't jump over text or don't get out of container element.
  48231. return false;
  48232. } );
  48233. // If anything has been skipped, fix position.
  48234. // This `if` could be possibly omitted but maybe it is better not to mess with DOM selection if not needed.
  48235. if ( jumpedOverAnyUiElement ) {
  48236. const newDomPosition = domConverter.viewPositionToDom( nextViewPosition );
  48237. if ( domSelectionCollapsed ) {
  48238. // Selection was collapsed, so collapse it at further position.
  48239. domSelection.collapse( newDomPosition.parent, newDomPosition.offset );
  48240. } else {
  48241. // Selection was not collapse, so extend it instead of collapsing.
  48242. domSelection.extend( newDomPosition.parent, newDomPosition.offset );
  48243. }
  48244. }
  48245. }
  48246. }
  48247. }
  48248. /***/ }),
  48249. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/upcastwriter.js":
  48250. /*!**************************************************************************!*\
  48251. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/upcastwriter.js ***!
  48252. \**************************************************************************/
  48253. /*! exports provided: default */
  48254. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  48255. "use strict";
  48256. __webpack_require__.r(__webpack_exports__);
  48257. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return UpcastWriter; });
  48258. /* harmony import */ var _documentfragment__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./documentfragment */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/documentfragment.js");
  48259. /* harmony import */ var _element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./element */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/element.js");
  48260. /* harmony import */ var _text__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./text */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/text.js");
  48261. /* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! lodash-es */ "./node_modules/lodash-es/lodash.js");
  48262. /* harmony import */ var _position__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./position */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/position.js");
  48263. /* harmony import */ var _range__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./range */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/range.js");
  48264. /* harmony import */ var _selection__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./selection */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/selection.js");
  48265. /**
  48266. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  48267. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  48268. */
  48269. /**
  48270. * @module module:engine/view/upcastwriter
  48271. */
  48272. /**
  48273. * View upcast writer. It provides a set of methods used to manipulate non-semantic view trees.
  48274. *
  48275. * It should be used only while working on a non-semantic view
  48276. * (e.g. a view created from HTML string on paste).
  48277. * To manipulate a view which was or is being downcasted from the the model use the
  48278. * {@link module:engine/view/downcastwriter~DowncastWriter downcast writer}.
  48279. *
  48280. * Read more about changing the view in the {@glink framework/guides/architecture/editing-engine#changing-the-view Changing the view}
  48281. * section of the {@glink framework/guides/architecture/editing-engine Editing engine architecture} guide.
  48282. *
  48283. * Unlike `DowncastWriter`, which is available in the {@link module:engine/view/view~View#change `View#change()`} block,
  48284. * `UpcastWriter` can be created wherever you need it:
  48285. *
  48286. * const writer = new UpcastWriter( viewDocument );
  48287. * const text = writer.createText( 'foo!' );
  48288. *
  48289. * writer.appendChild( text, someViewElement );
  48290. */
  48291. class UpcastWriter {
  48292. /**
  48293. * @param {module:engine/view/document~Document} document The view document instance in which this upcast writer operates.
  48294. */
  48295. constructor( document ) {
  48296. /**
  48297. * The view document instance in which this upcast writer operates.
  48298. *
  48299. * @readonly
  48300. * @type {module:engine/view/document~Document}
  48301. */
  48302. this.document = document;
  48303. }
  48304. /**
  48305. * Creates a new {@link module:engine/view/documentfragment~DocumentFragment} instance.
  48306. *
  48307. * @param {module:engine/view/node~Node|Iterable.<module:engine/view/node~Node>} [children]
  48308. * A list of nodes to be inserted into the created document fragment.
  48309. * @returns {module:engine/view/documentfragment~DocumentFragment} The created document fragment.
  48310. */
  48311. createDocumentFragment( children ) {
  48312. return new _documentfragment__WEBPACK_IMPORTED_MODULE_0__["default"]( this.document, children );
  48313. }
  48314. /**
  48315. * Creates a new {@link module:engine/view/element~Element} instance.
  48316. *
  48317. * Attributes can be passed in various formats:
  48318. *
  48319. * upcastWriter.createElement( 'div', { class: 'editor', contentEditable: 'true' } ); // object
  48320. * upcastWriter.createElement( 'div', [ [ 'class', 'editor' ], [ 'contentEditable', 'true' ] ] ); // map-like iterator
  48321. * upcastWriter.createElement( 'div', mapOfAttributes ); // map
  48322. *
  48323. * @param {String} name Node name.
  48324. * @param {Object|Iterable} [attrs] Collection of attributes.
  48325. * @param {module:engine/view/node~Node|Iterable.<module:engine/view/node~Node>} [children]
  48326. * A list of nodes to be inserted into created element.
  48327. * @returns {module:engine/view/element~Element} Created element.
  48328. */
  48329. createElement( name, attrs, children ) {
  48330. return new _element__WEBPACK_IMPORTED_MODULE_1__["default"]( this.document, name, attrs, children );
  48331. }
  48332. /**
  48333. * Creates a new {@link module:engine/view/text~Text} instance.
  48334. *
  48335. * @param {String} data The text's data.
  48336. * @returns {module:engine/view/text~Text} The created text node.
  48337. */
  48338. createText( data ) {
  48339. return new _text__WEBPACK_IMPORTED_MODULE_2__["default"]( this.document, data );
  48340. }
  48341. /**
  48342. * Clones the provided element.
  48343. *
  48344. * @see module:engine/view/element~Element#_clone
  48345. * @param {module:engine/view/element~Element} element Element to be cloned.
  48346. * @param {Boolean} [deep=false] If set to `true` clones element and all its children recursively. When set to `false`,
  48347. * element will be cloned without any children.
  48348. * @returns {module:engine/view/element~Element} Clone of this element.
  48349. */
  48350. clone( element, deep = false ) {
  48351. return element._clone( deep );
  48352. }
  48353. /**
  48354. * Appends a child node or a list of child nodes at the end of this node
  48355. * and sets the parent of these nodes to this element.
  48356. *
  48357. * @see module:engine/view/element~Element#_appendChild
  48358. * @param {module:engine/view/item~Item|Iterable.<module:engine/view/item~Item>} items Items to be inserted.
  48359. * @param {module:engine/view/element~Element|module:engine/view/documentfragment~DocumentFragment} element Element
  48360. * to which items will be appended.
  48361. * @fires module:engine/view/node~Node#event:change
  48362. * @returns {Number} Number of appended nodes.
  48363. */
  48364. appendChild( items, element ) {
  48365. return element._appendChild( items );
  48366. }
  48367. /**
  48368. * Inserts a child node or a list of child nodes on the given index and sets the parent of these nodes to
  48369. * this element.
  48370. *
  48371. * @see module:engine/view/element~Element#_insertChild
  48372. * @param {Number} index Offset at which nodes should be inserted.
  48373. * @param {module:engine/view/item~Item|Iterable.<module:engine/view/item~Item>} items Items to be inserted.
  48374. * @param {module:engine/view/element~Element|module:engine/view/documentfragment~DocumentFragment} element Element
  48375. * to which items will be inserted.
  48376. * @fires module:engine/view/node~Node#event:change
  48377. * @returns {Number} Number of inserted nodes.
  48378. */
  48379. insertChild( index, items, element ) {
  48380. return element._insertChild( index, items );
  48381. }
  48382. /**
  48383. * Removes the given number of child nodes starting at the given index and set the parent of these nodes to `null`.
  48384. *
  48385. * @see module:engine/view/element~Element#_removeChildren
  48386. * @param {Number} index Offset from which nodes will be removed.
  48387. * @param {Number} howMany Number of nodes to remove.
  48388. * @param {module:engine/view/element~Element|module:engine/view/documentfragment~DocumentFragment} element Element
  48389. * which children will be removed.
  48390. * @fires module:engine/view/node~Node#event:change
  48391. * @returns {Array.<module:engine/view/node~Node>} The array containing removed nodes.
  48392. */
  48393. removeChildren( index, howMany, element ) {
  48394. return element._removeChildren( index, howMany );
  48395. }
  48396. /**
  48397. * Removes given element from the view structure. Will not have effect on detached elements.
  48398. *
  48399. * @param {module:engine/view/element~Element} element Element which will be removed.
  48400. * @returns {Array.<module:engine/view/node~Node>} The array containing removed nodes.
  48401. */
  48402. remove( element ) {
  48403. const parent = element.parent;
  48404. if ( parent ) {
  48405. return this.removeChildren( parent.getChildIndex( element ), 1, parent );
  48406. }
  48407. return [];
  48408. }
  48409. /**
  48410. * Replaces given element with the new one in the view structure. Will not have effect on detached elements.
  48411. *
  48412. * @param {module:engine/view/element~Element} oldElement Element which will be replaced.
  48413. * @param {module:engine/view/element~Element} newElement Element which will be inserted in the place of the old element.
  48414. * @returns {Boolean} Whether old element was successfully replaced.
  48415. */
  48416. replace( oldElement, newElement ) {
  48417. const parent = oldElement.parent;
  48418. if ( parent ) {
  48419. const index = parent.getChildIndex( oldElement );
  48420. this.removeChildren( index, 1, parent );
  48421. this.insertChild( index, newElement, parent );
  48422. return true;
  48423. }
  48424. return false;
  48425. }
  48426. /**
  48427. * Removes given element from view structure and places its children in its position.
  48428. * It does nothing if element has no parent.
  48429. *
  48430. * @param {module:engine/view/element~Element} element Element to unwrap.
  48431. */
  48432. unwrapElement( element ) {
  48433. const parent = element.parent;
  48434. if ( parent ) {
  48435. const index = parent.getChildIndex( element );
  48436. this.remove( element );
  48437. this.insertChild( index, element.getChildren(), parent );
  48438. }
  48439. }
  48440. /**
  48441. * Renames element by creating a copy of a given element but with its name changed and then moving contents of the
  48442. * old element to the new one.
  48443. *
  48444. * Since this function creates a new element and removes the given one, the new element is returned to keep reference.
  48445. *
  48446. * @param {String} newName New element name.
  48447. * @param {module:engine/view/element~Element} element Element to be renamed.
  48448. * @returns {module:engine/view/element~Element|null} New element or null if the old element
  48449. * was not replaced (happens for detached elements).
  48450. */
  48451. rename( newName, element ) {
  48452. const newElement = new _element__WEBPACK_IMPORTED_MODULE_1__["default"]( this.document, newName, element.getAttributes(), element.getChildren() );
  48453. return this.replace( element, newElement ) ? newElement : null;
  48454. }
  48455. /**
  48456. * Adds or overwrites element's attribute with a specified key and value.
  48457. *
  48458. * writer.setAttribute( 'href', 'http://ckeditor.com', linkElement );
  48459. *
  48460. * @see module:engine/view/element~Element#_setAttribute
  48461. * @param {String} key Attribute key.
  48462. * @param {String} value Attribute value.
  48463. * @param {module:engine/view/element~Element} element Element for which attribute will be set.
  48464. */
  48465. setAttribute( key, value, element ) {
  48466. element._setAttribute( key, value );
  48467. }
  48468. /**
  48469. * Removes attribute from the element.
  48470. *
  48471. * writer.removeAttribute( 'href', linkElement );
  48472. *
  48473. * @see module:engine/view/element~Element#_removeAttribute
  48474. * @param {String} key Attribute key.
  48475. * @param {module:engine/view/element~Element} element Element from which attribute will be removed.
  48476. */
  48477. removeAttribute( key, element ) {
  48478. element._removeAttribute( key );
  48479. }
  48480. /**
  48481. * Adds specified class to the element.
  48482. *
  48483. * writer.addClass( 'foo', linkElement );
  48484. * writer.addClass( [ 'foo', 'bar' ], linkElement );
  48485. *
  48486. * @see module:engine/view/element~Element#_addClass
  48487. * @param {Array.<String>|String} className Single class name or array of class names which will be added.
  48488. * @param {module:engine/view/element~Element} element Element for which class will be added.
  48489. */
  48490. addClass( className, element ) {
  48491. element._addClass( className );
  48492. }
  48493. /**
  48494. * Removes specified class from the element.
  48495. *
  48496. * writer.removeClass( 'foo', linkElement );
  48497. * writer.removeClass( [ 'foo', 'bar' ], linkElement );
  48498. *
  48499. * @see module:engine/view/element~Element#_removeClass
  48500. * @param {Array.<String>|String} className Single class name or array of class names which will be removed.
  48501. * @param {module:engine/view/element~Element} element Element from which class will be removed.
  48502. */
  48503. removeClass( className, element ) {
  48504. element._removeClass( className );
  48505. }
  48506. /**
  48507. * Adds style to the element.
  48508. *
  48509. * writer.setStyle( 'color', 'red', element );
  48510. * writer.setStyle( {
  48511. * color: 'red',
  48512. * position: 'fixed'
  48513. * }, element );
  48514. *
  48515. * **Note**: This method can work with normalized style names if
  48516. * {@link module:engine/controller/datacontroller~DataController#addStyleProcessorRules a particular style processor rule is enabled}.
  48517. * See {@link module:engine/view/stylesmap~StylesMap#set `StylesMap#set()`} for details.
  48518. *
  48519. * @see module:engine/view/element~Element#_setStyle
  48520. * @param {String|Object} property Property name or object with key - value pairs.
  48521. * @param {String} [value] Value to set. This parameter is ignored if object is provided as the first parameter.
  48522. * @param {module:engine/view/element~Element} element Element for which style will be added.
  48523. */
  48524. setStyle( property, value, element ) {
  48525. if ( Object(lodash_es__WEBPACK_IMPORTED_MODULE_3__["isPlainObject"])( property ) && element === undefined ) {
  48526. element = value;
  48527. }
  48528. element._setStyle( property, value );
  48529. }
  48530. /**
  48531. * Removes specified style from the element.
  48532. *
  48533. * writer.removeStyle( 'color', element ); // Removes 'color' style.
  48534. * writer.removeStyle( [ 'color', 'border-top' ], element ); // Removes both 'color' and 'border-top' styles.
  48535. *
  48536. * **Note**: This method can work with normalized style names if
  48537. * {@link module:engine/controller/datacontroller~DataController#addStyleProcessorRules a particular style processor rule is enabled}.
  48538. * See {@link module:engine/view/stylesmap~StylesMap#remove `StylesMap#remove()`} for details.
  48539. *
  48540. * @see module:engine/view/element~Element#_removeStyle
  48541. * @param {Array.<String>|String} property Style property name or names to be removed.
  48542. * @param {module:engine/view/element~Element} element Element from which style will be removed.
  48543. */
  48544. removeStyle( property, element ) {
  48545. element._removeStyle( property );
  48546. }
  48547. /**
  48548. * Sets a custom property on element. Unlike attributes, custom properties are not rendered to the DOM,
  48549. * so they can be used to add special data to elements.
  48550. *
  48551. * @see module:engine/view/element~Element#_setCustomProperty
  48552. * @param {String|Symbol} key Custom property name/key.
  48553. * @param {*} value Custom property value to be stored.
  48554. * @param {module:engine/view/element~Element} element Element for which custom property will be set.
  48555. */
  48556. setCustomProperty( key, value, element ) {
  48557. element._setCustomProperty( key, value );
  48558. }
  48559. /**
  48560. * Removes a custom property stored under the given key.
  48561. *
  48562. * @see module:engine/view/element~Element#_removeCustomProperty
  48563. * @param {String|Symbol} key Name/key of the custom property to be removed.
  48564. * @param {module:engine/view/element~Element} element Element from which the custom property will be removed.
  48565. * @returns {Boolean} Returns true if property was removed.
  48566. */
  48567. removeCustomProperty( key, element ) {
  48568. return element._removeCustomProperty( key );
  48569. }
  48570. /**
  48571. * Creates position at the given location. The location can be specified as:
  48572. *
  48573. * * a {@link module:engine/view/position~Position position},
  48574. * * parent element and offset (offset defaults to `0`),
  48575. * * parent element and `'end'` (sets position at the end of that element),
  48576. * * {@link module:engine/view/item~Item view item} and `'before'` or `'after'` (sets position before or after given view item).
  48577. *
  48578. * This method is a shortcut to other constructors such as:
  48579. *
  48580. * * {@link #createPositionBefore},
  48581. * * {@link #createPositionAfter},
  48582. *
  48583. * @param {module:engine/view/item~Item|module:engine/model/position~Position} itemOrPosition
  48584. * @param {Number|'end'|'before'|'after'} [offset] Offset or one of the flags. Used only when
  48585. * first parameter is a {@link module:engine/view/item~Item view item}.
  48586. * @returns {module:engine/view/position~Position}
  48587. */
  48588. createPositionAt( itemOrPosition, offset ) {
  48589. return _position__WEBPACK_IMPORTED_MODULE_4__["default"]._createAt( itemOrPosition, offset );
  48590. }
  48591. /**
  48592. * Creates a new position after given view item.
  48593. *
  48594. * @param {module:engine/view/item~Item} item View item after which the position should be located.
  48595. * @returns {module:engine/view/position~Position}
  48596. */
  48597. createPositionAfter( item ) {
  48598. return _position__WEBPACK_IMPORTED_MODULE_4__["default"]._createAfter( item );
  48599. }
  48600. /**
  48601. * Creates a new position before given view item.
  48602. *
  48603. * @param {module:engine/view/item~Item} item View item before which the position should be located.
  48604. * @returns {module:engine/view/position~Position}
  48605. */
  48606. createPositionBefore( item ) {
  48607. return _position__WEBPACK_IMPORTED_MODULE_4__["default"]._createBefore( item );
  48608. }
  48609. /**
  48610. * Creates a range spanning from `start` position to `end` position.
  48611. *
  48612. * **Note:** This factory method creates it's own {@link module:engine/view/position~Position} instances basing on passed values.
  48613. *
  48614. * @param {module:engine/view/position~Position} start Start position.
  48615. * @param {module:engine/view/position~Position} [end] End position. If not set, range will be collapsed at `start` position.
  48616. * @returns {module:engine/view/range~Range}
  48617. */
  48618. createRange( start, end ) {
  48619. return new _range__WEBPACK_IMPORTED_MODULE_5__["default"]( start, end );
  48620. }
  48621. /**
  48622. * Creates a range that starts before given {@link module:engine/view/item~Item view item} and ends after it.
  48623. *
  48624. * @param {module:engine/view/item~Item} item
  48625. * @returns {module:engine/view/range~Range}
  48626. */
  48627. createRangeOn( item ) {
  48628. return _range__WEBPACK_IMPORTED_MODULE_5__["default"]._createOn( item );
  48629. }
  48630. /**
  48631. * Creates a range inside an {@link module:engine/view/element~Element element} which starts before the first child of
  48632. * that element and ends after the last child of that element.
  48633. *
  48634. * @param {module:engine/view/element~Element} element Element which is a parent for the range.
  48635. * @returns {module:engine/view/range~Range}
  48636. */
  48637. createRangeIn( element ) {
  48638. return _range__WEBPACK_IMPORTED_MODULE_5__["default"]._createIn( element );
  48639. }
  48640. /**
  48641. * Creates a new {@link module:engine/view/selection~Selection} instance.
  48642. *
  48643. * // Creates empty selection without ranges.
  48644. * const selection = writer.createSelection();
  48645. *
  48646. * // Creates selection at the given range.
  48647. * const range = writer.createRange( start, end );
  48648. * const selection = writer.createSelection( range );
  48649. *
  48650. * // Creates selection at the given ranges
  48651. * const ranges = [ writer.createRange( start1, end2 ), writer.createRange( star2, end2 ) ];
  48652. * const selection = writer.createSelection( ranges );
  48653. *
  48654. * // Creates selection from the other selection.
  48655. * const otherSelection = writer.createSelection();
  48656. * const selection = writer.createSelection( otherSelection );
  48657. *
  48658. * // Creates selection from the document selection.
  48659. * const selection = writer.createSelection( editor.editing.view.document.selection );
  48660. *
  48661. * // Creates selection at the given position.
  48662. * const position = writer.createPositionFromPath( root, path );
  48663. * const selection = writer.createSelection( position );
  48664. *
  48665. * // Creates collapsed selection at the position of given item and offset.
  48666. * const paragraph = writer.createContainerElement( 'paragraph' );
  48667. * const selection = writer.createSelection( paragraph, offset );
  48668. *
  48669. * // Creates a range inside an {@link module:engine/view/element~Element element} which starts before the
  48670. * // first child of that element and ends after the last child of that element.
  48671. * const selection = writer.createSelection( paragraph, 'in' );
  48672. *
  48673. * // Creates a range on an {@link module:engine/view/item~Item item} which starts before the item and ends
  48674. * // just after the item.
  48675. * const selection = writer.createSelection( paragraph, 'on' );
  48676. *
  48677. * `Selection`'s constructor allow passing additional options (`backward`, `fake` and `label`) as the last argument.
  48678. *
  48679. * // Creates backward selection.
  48680. * const selection = writer.createSelection( range, { backward: true } );
  48681. *
  48682. * Fake selection does not render as browser native selection over selected elements and is hidden to the user.
  48683. * This way, no native selection UI artifacts are displayed to the user and selection over elements can be
  48684. * represented in other way, for example by applying proper CSS class.
  48685. *
  48686. * Additionally fake's selection label can be provided. It will be used to describe fake selection in DOM
  48687. * (and be properly handled by screen readers).
  48688. *
  48689. * // Creates fake selection with label.
  48690. * const selection = writer.createSelection( range, { fake: true, label: 'foo' } );
  48691. *
  48692. * @param {module:engine/view/selection~Selectable} [selectable=null]
  48693. * @param {Number|'before'|'end'|'after'|'on'|'in'} [placeOrOffset] Offset or place when selectable is an `Item`.
  48694. * @param {Object} [options]
  48695. * @param {Boolean} [options.backward] Sets this selection instance to be backward.
  48696. * @param {Boolean} [options.fake] Sets this selection instance to be marked as `fake`.
  48697. * @param {String} [options.label] Label for the fake selection.
  48698. * @returns {module:engine/view/selection~Selection}
  48699. */
  48700. createSelection( selectable, placeOrOffset, options ) {
  48701. return new _selection__WEBPACK_IMPORTED_MODULE_6__["default"]( selectable, placeOrOffset, options );
  48702. }
  48703. }
  48704. /***/ }),
  48705. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/view.js":
  48706. /*!******************************************************************!*\
  48707. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/view.js ***!
  48708. \******************************************************************/
  48709. /*! exports provided: default */
  48710. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  48711. "use strict";
  48712. __webpack_require__.r(__webpack_exports__);
  48713. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return View; });
  48714. /* harmony import */ var _document__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./document */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/document.js");
  48715. /* harmony import */ var _downcastwriter__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./downcastwriter */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/downcastwriter.js");
  48716. /* harmony import */ var _renderer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./renderer */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/renderer.js");
  48717. /* harmony import */ var _domconverter__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./domconverter */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/domconverter.js");
  48718. /* harmony import */ var _position__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./position */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/position.js");
  48719. /* harmony import */ var _range__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./range */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/range.js");
  48720. /* harmony import */ var _selection__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./selection */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/selection.js");
  48721. /* harmony import */ var _observer_mutationobserver__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./observer/mutationobserver */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/mutationobserver.js");
  48722. /* harmony import */ var _observer_keyobserver__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./observer/keyobserver */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/keyobserver.js");
  48723. /* harmony import */ var _observer_fakeselectionobserver__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./observer/fakeselectionobserver */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/fakeselectionobserver.js");
  48724. /* harmony import */ var _observer_selectionobserver__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./observer/selectionobserver */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/selectionobserver.js");
  48725. /* harmony import */ var _observer_focusobserver__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./observer/focusobserver */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/focusobserver.js");
  48726. /* harmony import */ var _observer_compositionobserver__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./observer/compositionobserver */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/compositionobserver.js");
  48727. /* harmony import */ var _observer_inputobserver__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./observer/inputobserver */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/inputobserver.js");
  48728. /* harmony import */ var _observer_arrowkeysobserver__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./observer/arrowkeysobserver */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/arrowkeysobserver.js");
  48729. /* harmony import */ var _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/observablemixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/observablemixin.js");
  48730. /* harmony import */ var _ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/mix */ "./node_modules/@ckeditor/ckeditor5-utils/src/mix.js");
  48731. /* harmony import */ var _ckeditor_ckeditor5_utils_src_dom_scroll__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/dom/scroll */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/scroll.js");
  48732. /* harmony import */ var _uielement__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./uielement */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/uielement.js");
  48733. /* harmony import */ var _filler__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./filler */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/filler.js");
  48734. /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  48735. /* harmony import */ var _ckeditor_ckeditor5_utils_src_env__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/env */ "./node_modules/@ckeditor/ckeditor5-utils/src/env.js");
  48736. /**
  48737. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  48738. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  48739. */
  48740. /**
  48741. * @module engine/view/view
  48742. */
  48743. /**
  48744. * Editor's view controller class. Its main responsibility is DOM - View management for editing purposes, to provide
  48745. * abstraction over the DOM structure and events and hide all browsers quirks.
  48746. *
  48747. * View controller renders view document to DOM whenever view structure changes. To determine when view can be rendered,
  48748. * all changes need to be done using the {@link module:engine/view/view~View#change} method, using
  48749. * {@link module:engine/view/downcastwriter~DowncastWriter}:
  48750. *
  48751. * view.change( writer => {
  48752. * writer.insert( position, writer.createText( 'foo' ) );
  48753. * } );
  48754. *
  48755. * View controller also register {@link module:engine/view/observer/observer~Observer observers} which observes changes
  48756. * on DOM and fire events on the {@link module:engine/view/document~Document Document}.
  48757. * Note that the following observers are added by the class constructor and are always available:
  48758. *
  48759. * * {@link module:engine/view/observer/mutationobserver~MutationObserver},
  48760. * * {@link module:engine/view/observer/selectionobserver~SelectionObserver},
  48761. * * {@link module:engine/view/observer/focusobserver~FocusObserver},
  48762. * * {@link module:engine/view/observer/keyobserver~KeyObserver},
  48763. * * {@link module:engine/view/observer/fakeselectionobserver~FakeSelectionObserver}.
  48764. * * {@link module:engine/view/observer/compositionobserver~CompositionObserver}.
  48765. *
  48766. * This class also {@link module:engine/view/view~View#attachDomRoot binds the DOM and the view elements}.
  48767. *
  48768. * 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
  48769. * elements you do not need this controller. You can use the {@link module:engine/view/domconverter~DomConverter DomConverter} instead.
  48770. *
  48771. * @mixes module:utils/observablemixin~ObservableMixin
  48772. */
  48773. class View {
  48774. /**
  48775. * @param {module:engine/view/stylesmap~StylesProcessor} stylesProcessor The styles processor instance.
  48776. */
  48777. constructor( stylesProcessor ) {
  48778. /**
  48779. * Instance of the {@link module:engine/view/document~Document} associated with this view controller.
  48780. *
  48781. * @readonly
  48782. * @type {module:engine/view/document~Document}
  48783. */
  48784. this.document = new _document__WEBPACK_IMPORTED_MODULE_0__["default"]( stylesProcessor );
  48785. /**
  48786. * Instance of the {@link module:engine/view/domconverter~DomConverter domConverter} used by
  48787. * {@link module:engine/view/view~View#_renderer renderer}
  48788. * and {@link module:engine/view/observer/observer~Observer observers}.
  48789. *
  48790. * @readonly
  48791. * @type {module:engine/view/domconverter~DomConverter}
  48792. */
  48793. this.domConverter = new _domconverter__WEBPACK_IMPORTED_MODULE_3__["default"]( this.document );
  48794. /**
  48795. * Roots of the DOM tree. Map on the `HTMLElement`s with roots names as keys.
  48796. *
  48797. * @readonly
  48798. * @type {Map.<String, HTMLElement>}
  48799. */
  48800. this.domRoots = new Map();
  48801. /**
  48802. * Used to prevent calling {@link #forceRender} and {@link #change} during rendering view to the DOM.
  48803. *
  48804. * @readonly
  48805. * @member {Boolean} #isRenderingInProgress
  48806. */
  48807. this.set( 'isRenderingInProgress', false );
  48808. /**
  48809. * Informs whether the DOM selection is inside any of the DOM roots managed by the view.
  48810. *
  48811. * @readonly
  48812. * @member {Boolean} #hasDomSelection
  48813. */
  48814. this.set( 'hasDomSelection', false );
  48815. /**
  48816. * Instance of the {@link module:engine/view/renderer~Renderer renderer}.
  48817. *
  48818. * @protected
  48819. * @type {module:engine/view/renderer~Renderer}
  48820. */
  48821. this._renderer = new _renderer__WEBPACK_IMPORTED_MODULE_2__["default"]( this.domConverter, this.document.selection );
  48822. this._renderer.bind( 'isFocused' ).to( this.document );
  48823. /**
  48824. * A DOM root attributes cache. It saves the initial values of DOM root attributes before the DOM element
  48825. * is {@link module:engine/view/view~View#attachDomRoot attached} to the view so later on, when
  48826. * the view is destroyed ({@link module:engine/view/view~View#detachDomRoot}), they can be easily restored.
  48827. * This way, the DOM element can go back to the (clean) state as if the editing view never used it.
  48828. *
  48829. * @private
  48830. * @member {WeakMap.<HTMLElement,Object>}
  48831. */
  48832. this._initialDomRootAttributes = new WeakMap();
  48833. /**
  48834. * Map of registered {@link module:engine/view/observer/observer~Observer observers}.
  48835. *
  48836. * @private
  48837. * @type {Map.<Function, module:engine/view/observer/observer~Observer>}
  48838. */
  48839. this._observers = new Map();
  48840. /**
  48841. * Is set to `true` when {@link #change view changes} are currently in progress.
  48842. *
  48843. * @private
  48844. * @type {Boolean}
  48845. */
  48846. this._ongoingChange = false;
  48847. /**
  48848. * Used to prevent calling {@link #forceRender} and {@link #change} during rendering view to the DOM.
  48849. *
  48850. * @private
  48851. * @type {Boolean}
  48852. */
  48853. this._postFixersInProgress = false;
  48854. /**
  48855. * Internal flag to temporary disable rendering. See the usage in the {@link #_disableRendering}.
  48856. *
  48857. * @private
  48858. * @type {Boolean}
  48859. */
  48860. this._renderingDisabled = false;
  48861. /**
  48862. * Internal flag that disables rendering when there are no changes since the last rendering.
  48863. * It stores information about changed selection and changed elements from attached document roots.
  48864. *
  48865. * @private
  48866. * @type {Boolean}
  48867. */
  48868. this._hasChangedSinceTheLastRendering = false;
  48869. /**
  48870. * DowncastWriter instance used in {@link #change change method} callbacks.
  48871. *
  48872. * @private
  48873. * @type {module:engine/view/downcastwriter~DowncastWriter}
  48874. */
  48875. this._writer = new _downcastwriter__WEBPACK_IMPORTED_MODULE_1__["default"]( this.document );
  48876. // Add default observers.
  48877. this.addObserver( _observer_mutationobserver__WEBPACK_IMPORTED_MODULE_7__["default"] );
  48878. this.addObserver( _observer_selectionobserver__WEBPACK_IMPORTED_MODULE_10__["default"] );
  48879. this.addObserver( _observer_focusobserver__WEBPACK_IMPORTED_MODULE_11__["default"] );
  48880. this.addObserver( _observer_keyobserver__WEBPACK_IMPORTED_MODULE_8__["default"] );
  48881. this.addObserver( _observer_fakeselectionobserver__WEBPACK_IMPORTED_MODULE_9__["default"] );
  48882. this.addObserver( _observer_compositionobserver__WEBPACK_IMPORTED_MODULE_12__["default"] );
  48883. this.addObserver( _observer_arrowkeysobserver__WEBPACK_IMPORTED_MODULE_14__["default"] );
  48884. if ( _ckeditor_ckeditor5_utils_src_env__WEBPACK_IMPORTED_MODULE_21__["default"].isAndroid ) {
  48885. this.addObserver( _observer_inputobserver__WEBPACK_IMPORTED_MODULE_13__["default"] );
  48886. }
  48887. // Inject quirks handlers.
  48888. Object(_filler__WEBPACK_IMPORTED_MODULE_19__["injectQuirksHandling"])( this );
  48889. Object(_uielement__WEBPACK_IMPORTED_MODULE_18__["injectUiElementHandling"])( this );
  48890. // Use 'normal' priority so that rendering is performed as first when using that priority.
  48891. this.on( 'render', () => {
  48892. this._render();
  48893. // Informs that layout has changed after render.
  48894. this.document.fire( 'layoutChanged' );
  48895. // Reset the `_hasChangedSinceTheLastRendering` flag after rendering.
  48896. this._hasChangedSinceTheLastRendering = false;
  48897. } );
  48898. // Listen to the document selection changes directly.
  48899. this.listenTo( this.document.selection, 'change', () => {
  48900. this._hasChangedSinceTheLastRendering = true;
  48901. } );
  48902. }
  48903. /**
  48904. * Attaches a DOM root element to the view element and enable all observers on that element.
  48905. * Also {@link module:engine/view/renderer~Renderer#markToSync mark element} to be synchronized
  48906. * with the view what means that all child nodes will be removed and replaced with content of the view root.
  48907. *
  48908. * This method also will change view element name as the same as tag name of given dom root.
  48909. * Name is always transformed to lower case.
  48910. *
  48911. * **Note:** Use {@link #detachDomRoot `detachDomRoot()`} to revert this action.
  48912. *
  48913. * @param {Element} domRoot DOM root element.
  48914. * @param {String} [name='main'] Name of the root.
  48915. */
  48916. attachDomRoot( domRoot, name = 'main' ) {
  48917. const viewRoot = this.document.getRoot( name );
  48918. // Set view root name the same as DOM root tag name.
  48919. viewRoot._name = domRoot.tagName.toLowerCase();
  48920. const initialDomRootAttributes = {};
  48921. // 1. Copy and cache the attributes to remember the state of the element before attaching.
  48922. // The cached attributes will be restored in detachDomRoot() so the element goes to the
  48923. // clean state as if the editing view never used it.
  48924. // 2. Apply the attributes using the view writer, so they all go under the control of the engine.
  48925. // The editing view takes over the attribute management completely because various
  48926. // features (e.g. addPlaceholder()) require dynamic changes of those attributes and they
  48927. // cannot be managed by the engine and the UI library at the same time.
  48928. for ( const { name, value } of Array.from( domRoot.attributes ) ) {
  48929. initialDomRootAttributes[ name ] = value;
  48930. // Do not use writer.setAttribute() for the class attribute. The EditableUIView class
  48931. // and its descendants could have already set some using the writer.addClass() on the view
  48932. // document root. They haven't been rendered yet so they are not present in the DOM root.
  48933. // Using writer.setAttribute( 'class', ... ) would override them completely.
  48934. if ( name === 'class' ) {
  48935. this._writer.addClass( value.split( ' ' ), viewRoot );
  48936. } else {
  48937. this._writer.setAttribute( name, value, viewRoot );
  48938. }
  48939. }
  48940. this._initialDomRootAttributes.set( domRoot, initialDomRootAttributes );
  48941. const updateContenteditableAttribute = () => {
  48942. this._writer.setAttribute( 'contenteditable', !viewRoot.isReadOnly, viewRoot );
  48943. if ( viewRoot.isReadOnly ) {
  48944. this._writer.addClass( 'ck-read-only', viewRoot );
  48945. } else {
  48946. this._writer.removeClass( 'ck-read-only', viewRoot );
  48947. }
  48948. };
  48949. // Set initial value.
  48950. updateContenteditableAttribute();
  48951. this.domRoots.set( name, domRoot );
  48952. this.domConverter.bindElements( domRoot, viewRoot );
  48953. this._renderer.markToSync( 'children', viewRoot );
  48954. this._renderer.markToSync( 'attributes', viewRoot );
  48955. this._renderer.domDocuments.add( domRoot.ownerDocument );
  48956. viewRoot.on( 'change:children', ( evt, node ) => this._renderer.markToSync( 'children', node ) );
  48957. viewRoot.on( 'change:attributes', ( evt, node ) => this._renderer.markToSync( 'attributes', node ) );
  48958. viewRoot.on( 'change:text', ( evt, node ) => this._renderer.markToSync( 'text', node ) );
  48959. viewRoot.on( 'change:isReadOnly', () => this.change( updateContenteditableAttribute ) );
  48960. viewRoot.on( 'change', () => {
  48961. this._hasChangedSinceTheLastRendering = true;
  48962. } );
  48963. for ( const observer of this._observers.values() ) {
  48964. observer.observe( domRoot, name );
  48965. }
  48966. }
  48967. /**
  48968. * Detaches a DOM root element from the view element and restores its attributes to the state before
  48969. * {@link #attachDomRoot `attachDomRoot()`}.
  48970. *
  48971. * @param {String} name Name of the root to detach.
  48972. */
  48973. detachDomRoot( name ) {
  48974. const domRoot = this.domRoots.get( name );
  48975. // Remove all root attributes so the DOM element is "bare".
  48976. Array.from( domRoot.attributes ).forEach( ( { name } ) => domRoot.removeAttribute( name ) );
  48977. const initialDomRootAttributes = this._initialDomRootAttributes.get( domRoot );
  48978. // Revert all view root attributes back to the state before attachDomRoot was called.
  48979. for ( const attribute in initialDomRootAttributes ) {
  48980. domRoot.setAttribute( attribute, initialDomRootAttributes[ attribute ] );
  48981. }
  48982. this.domRoots.delete( name );
  48983. this.domConverter.unbindDomElement( domRoot );
  48984. }
  48985. /**
  48986. * Gets DOM root element.
  48987. *
  48988. * @param {String} [name='main'] Name of the root.
  48989. * @returns {Element} DOM root element instance.
  48990. */
  48991. getDomRoot( name = 'main' ) {
  48992. return this.domRoots.get( name );
  48993. }
  48994. /**
  48995. * Creates observer of the given type if not yet created, {@link module:engine/view/observer/observer~Observer#enable enables} it
  48996. * and {@link module:engine/view/observer/observer~Observer#observe attaches} to all existing and future
  48997. * {@link #domRoots DOM roots}.
  48998. *
  48999. * Note: Observers are recognized by their constructor (classes). A single observer will be instantiated and used only
  49000. * when registered for the first time. This means that features and other components can register a single observer
  49001. * multiple times without caring whether it has been already added or not.
  49002. *
  49003. * @param {Function} Observer The constructor of an observer to add.
  49004. * Should create an instance inheriting from {@link module:engine/view/observer/observer~Observer}.
  49005. * @returns {module:engine/view/observer/observer~Observer} Added observer instance.
  49006. */
  49007. addObserver( Observer ) {
  49008. let observer = this._observers.get( Observer );
  49009. if ( observer ) {
  49010. return observer;
  49011. }
  49012. observer = new Observer( this );
  49013. this._observers.set( Observer, observer );
  49014. for ( const [ name, domElement ] of this.domRoots ) {
  49015. observer.observe( domElement, name );
  49016. }
  49017. observer.enable();
  49018. return observer;
  49019. }
  49020. /**
  49021. * Returns observer of the given type or `undefined` if such observer has not been added yet.
  49022. *
  49023. * @param {Function} Observer The constructor of an observer to get.
  49024. * @returns {module:engine/view/observer/observer~Observer|undefined} Observer instance or undefined.
  49025. */
  49026. getObserver( Observer ) {
  49027. return this._observers.get( Observer );
  49028. }
  49029. /**
  49030. * Disables all added observers.
  49031. */
  49032. disableObservers() {
  49033. for ( const observer of this._observers.values() ) {
  49034. observer.disable();
  49035. }
  49036. }
  49037. /**
  49038. * Enables all added observers.
  49039. */
  49040. enableObservers() {
  49041. for ( const observer of this._observers.values() ) {
  49042. observer.enable();
  49043. }
  49044. }
  49045. /**
  49046. * Scrolls the page viewport and {@link #domRoots} with their ancestors to reveal the
  49047. * caret, if not already visible to the user.
  49048. */
  49049. scrollToTheSelection() {
  49050. const range = this.document.selection.getFirstRange();
  49051. if ( range ) {
  49052. Object(_ckeditor_ckeditor5_utils_src_dom_scroll__WEBPACK_IMPORTED_MODULE_17__["scrollViewportToShowTarget"])( {
  49053. target: this.domConverter.viewRangeToDom( range ),
  49054. viewportOffset: 20
  49055. } );
  49056. }
  49057. }
  49058. /**
  49059. * It will focus DOM element representing {@link module:engine/view/editableelement~EditableElement EditableElement}
  49060. * that is currently having selection inside.
  49061. */
  49062. focus() {
  49063. if ( !this.document.isFocused ) {
  49064. const editable = this.document.selection.editableElement;
  49065. if ( editable ) {
  49066. this.domConverter.focus( editable );
  49067. this.forceRender();
  49068. } else {
  49069. // Before focusing view document, selection should be placed inside one of the view's editables.
  49070. // Normally its selection will be converted from model document (which have default selection), but
  49071. // when using view document on its own, we need to manually place selection before focusing it.
  49072. //
  49073. // @if CK_DEBUG // console.warn( 'There is no selection in any editable to focus.' );
  49074. }
  49075. }
  49076. }
  49077. /**
  49078. * The `change()` method is the primary way of changing the view. You should use it to modify any node in the view tree.
  49079. * It makes sure that after all changes are made the view is rendered to the DOM (assuming that the view will be changed
  49080. * inside the callback). It prevents situations when the DOM is updated when the view state is not yet correct. It allows
  49081. * to nest calls one inside another and still performs a single rendering after all those changes are made.
  49082. * It also returns the return value of its callback.
  49083. *
  49084. * const text = view.change( writer => {
  49085. * const newText = writer.createText( 'foo' );
  49086. * writer.insert( position1, newText );
  49087. *
  49088. * view.change( writer => {
  49089. * writer.insert( position2, writer.createText( 'bar' ) );
  49090. * } );
  49091. *
  49092. * writer.remove( range );
  49093. *
  49094. * return newText;
  49095. * } );
  49096. *
  49097. * When the outermost change block is done and rendering to the DOM is over the
  49098. * {@link module:engine/view/view~View#event:render `View#render`} event is fired.
  49099. *
  49100. * This method throws a `applying-view-changes-on-rendering` error when
  49101. * the change block is used after rendering to the DOM has started.
  49102. *
  49103. * @param {Function} callback Callback function which may modify the view.
  49104. * @returns {*} Value returned by the callback.
  49105. */
  49106. change( callback ) {
  49107. if ( this.isRenderingInProgress || this._postFixersInProgress ) {
  49108. /**
  49109. * Thrown when there is an attempt to make changes to the view tree when it is in incorrect state. This may
  49110. * cause some unexpected behaviour and inconsistency between the DOM and the view.
  49111. * This may be caused by:
  49112. *
  49113. * * calling {@link #change} or {@link #forceRender} during rendering process,
  49114. * * calling {@link #change} or {@link #forceRender} inside of
  49115. * {@link module:engine/view/document~Document#registerPostFixer post-fixer function}.
  49116. *
  49117. * @error cannot-change-view-tree
  49118. */
  49119. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_20__["default"](
  49120. 'cannot-change-view-tree',
  49121. this
  49122. );
  49123. }
  49124. try {
  49125. // Recursive call to view.change() method - execute listener immediately.
  49126. if ( this._ongoingChange ) {
  49127. return callback( this._writer );
  49128. }
  49129. // This lock will assure that all recursive calls to view.change() will end up in same block - one "render"
  49130. // event for all nested calls.
  49131. this._ongoingChange = true;
  49132. const callbackResult = callback( this._writer );
  49133. this._ongoingChange = false;
  49134. // This lock is used by editing controller to render changes from outer most model.change() once. As plugins might call
  49135. // view.change() inside model.change() block - this will ensures that postfixers and rendering are called once after all
  49136. // changes. Also, we don't need to render anything if there're no changes since last rendering.
  49137. if ( !this._renderingDisabled && this._hasChangedSinceTheLastRendering ) {
  49138. this._postFixersInProgress = true;
  49139. this.document._callPostFixers( this._writer );
  49140. this._postFixersInProgress = false;
  49141. this.fire( 'render' );
  49142. }
  49143. return callbackResult;
  49144. } catch ( err ) {
  49145. // @if CK_DEBUG // throw err;
  49146. /* istanbul ignore next */
  49147. _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_20__["default"].rethrowUnexpectedError( err, this );
  49148. }
  49149. }
  49150. /**
  49151. * Forces rendering {@link module:engine/view/document~Document view document} to DOM. If any view changes are
  49152. * currently in progress, rendering will start after all {@link #change change blocks} are processed.
  49153. *
  49154. * Note that this method is dedicated for special cases. All view changes should be wrapped in the {@link #change}
  49155. * block and the view will automatically check whether it needs to render DOM or not.
  49156. *
  49157. * Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `applying-view-changes-on-rendering` when
  49158. * trying to re-render when rendering to DOM has already started.
  49159. */
  49160. forceRender() {
  49161. this._hasChangedSinceTheLastRendering = true;
  49162. this.change( () => {} );
  49163. }
  49164. /**
  49165. * Destroys this instance. Makes sure that all observers are destroyed and listeners removed.
  49166. */
  49167. destroy() {
  49168. for ( const observer of this._observers.values() ) {
  49169. observer.destroy();
  49170. }
  49171. this.document.destroy();
  49172. this.stopListening();
  49173. }
  49174. /**
  49175. * Creates position at the given location. The location can be specified as:
  49176. *
  49177. * * a {@link module:engine/view/position~Position position},
  49178. * * parent element and offset (offset defaults to `0`),
  49179. * * parent element and `'end'` (sets position at the end of that element),
  49180. * * {@link module:engine/view/item~Item view item} and `'before'` or `'after'` (sets position before or after given view item).
  49181. *
  49182. * This method is a shortcut to other constructors such as:
  49183. *
  49184. * * {@link #createPositionBefore},
  49185. * * {@link #createPositionAfter},
  49186. *
  49187. * @param {module:engine/view/item~Item|module:engine/model/position~Position} itemOrPosition
  49188. * @param {Number|'end'|'before'|'after'} [offset] Offset or one of the flags. Used only when
  49189. * first parameter is a {@link module:engine/view/item~Item view item}.
  49190. */
  49191. createPositionAt( itemOrPosition, offset ) {
  49192. return _position__WEBPACK_IMPORTED_MODULE_4__["default"]._createAt( itemOrPosition, offset );
  49193. }
  49194. /**
  49195. * Creates a new position after given view item.
  49196. *
  49197. * @param {module:engine/view/item~Item} item View item after which the position should be located.
  49198. * @returns {module:engine/view/position~Position}
  49199. */
  49200. createPositionAfter( item ) {
  49201. return _position__WEBPACK_IMPORTED_MODULE_4__["default"]._createAfter( item );
  49202. }
  49203. /**
  49204. * Creates a new position before given view item.
  49205. *
  49206. * @param {module:engine/view/item~Item} item View item before which the position should be located.
  49207. * @returns {module:engine/view/position~Position}
  49208. */
  49209. createPositionBefore( item ) {
  49210. return _position__WEBPACK_IMPORTED_MODULE_4__["default"]._createBefore( item );
  49211. }
  49212. /**
  49213. * Creates a range spanning from `start` position to `end` position.
  49214. *
  49215. * **Note:** This factory method creates it's own {@link module:engine/view/position~Position} instances basing on passed values.
  49216. *
  49217. * @param {module:engine/view/position~Position} start Start position.
  49218. * @param {module:engine/view/position~Position} [end] End position. If not set, range will be collapsed at `start` position.
  49219. * @returns {module:engine/view/range~Range}
  49220. */
  49221. createRange( start, end ) {
  49222. return new _range__WEBPACK_IMPORTED_MODULE_5__["default"]( start, end );
  49223. }
  49224. /**
  49225. * Creates a range that starts before given {@link module:engine/view/item~Item view item} and ends after it.
  49226. *
  49227. * @param {module:engine/view/item~Item} item
  49228. * @returns {module:engine/view/range~Range}
  49229. */
  49230. createRangeOn( item ) {
  49231. return _range__WEBPACK_IMPORTED_MODULE_5__["default"]._createOn( item );
  49232. }
  49233. /**
  49234. * Creates a range inside an {@link module:engine/view/element~Element element} which starts before the first child of
  49235. * that element and ends after the last child of that element.
  49236. *
  49237. * @param {module:engine/view/element~Element} element Element which is a parent for the range.
  49238. * @returns {module:engine/view/range~Range}
  49239. */
  49240. createRangeIn( element ) {
  49241. return _range__WEBPACK_IMPORTED_MODULE_5__["default"]._createIn( element );
  49242. }
  49243. /**
  49244. Creates new {@link module:engine/view/selection~Selection} instance.
  49245. *
  49246. * // Creates empty selection without ranges.
  49247. * const selection = view.createSelection();
  49248. *
  49249. * // Creates selection at the given range.
  49250. * const range = view.createRange( start, end );
  49251. * const selection = view.createSelection( range );
  49252. *
  49253. * // Creates selection at the given ranges
  49254. * const ranges = [ view.createRange( start1, end2 ), view.createRange( star2, end2 ) ];
  49255. * const selection = view.createSelection( ranges );
  49256. *
  49257. * // Creates selection from the other selection.
  49258. * const otherSelection = view.createSelection();
  49259. * const selection = view.createSelection( otherSelection );
  49260. *
  49261. * // Creates selection from the document selection.
  49262. * const selection = view.createSelection( editor.editing.view.document.selection );
  49263. *
  49264. * // Creates selection at the given position.
  49265. * const position = view.createPositionFromPath( root, path );
  49266. * const selection = view.createSelection( position );
  49267. *
  49268. * // Creates collapsed selection at the position of given item and offset.
  49269. * const paragraph = view.createContainerElement( 'paragraph' );
  49270. * const selection = view.createSelection( paragraph, offset );
  49271. *
  49272. * // Creates a range inside an {@link module:engine/view/element~Element element} which starts before the
  49273. * // first child of that element and ends after the last child of that element.
  49274. * const selection = view.createSelection( paragraph, 'in' );
  49275. *
  49276. * // Creates a range on an {@link module:engine/view/item~Item item} which starts before the item and ends
  49277. * // just after the item.
  49278. * const selection = view.createSelection( paragraph, 'on' );
  49279. *
  49280. * `Selection`'s factory method allow passing additional options (`backward`, `fake` and `label`) as the last argument.
  49281. *
  49282. * // Creates backward selection.
  49283. * const selection = view.createSelection( range, { backward: true } );
  49284. *
  49285. * Fake selection does not render as browser native selection over selected elements and is hidden to the user.
  49286. * This way, no native selection UI artifacts are displayed to the user and selection over elements can be
  49287. * represented in other way, for example by applying proper CSS class.
  49288. *
  49289. * Additionally fake's selection label can be provided. It will be used to describe fake selection in DOM
  49290. * (and be properly handled by screen readers).
  49291. *
  49292. * // Creates fake selection with label.
  49293. * const selection = view.createSelection( range, { fake: true, label: 'foo' } );
  49294. *
  49295. * @param {module:engine/view/selection~Selectable} [selectable=null]
  49296. * @param {Number|'before'|'end'|'after'|'on'|'in'} [placeOrOffset] Offset or place when selectable is an `Item`.
  49297. * @param {Object} [options]
  49298. * @param {Boolean} [options.backward] Sets this selection instance to be backward.
  49299. * @param {Boolean} [options.fake] Sets this selection instance to be marked as `fake`.
  49300. * @param {String} [options.label] Label for the fake selection.
  49301. * @returns {module:engine/view/selection~Selection}
  49302. */
  49303. createSelection( selectable, placeOrOffset, options ) {
  49304. return new _selection__WEBPACK_IMPORTED_MODULE_6__["default"]( selectable, placeOrOffset, options );
  49305. }
  49306. /**
  49307. * Disables or enables rendering. If the flag is set to `true` then the rendering will be disabled.
  49308. * If the flag is set to `false` and if there was some change in the meantime, then the rendering action will be performed.
  49309. *
  49310. * @protected
  49311. * @param {Boolean} flag A flag indicates whether the rendering should be disabled.
  49312. */
  49313. _disableRendering( flag ) {
  49314. this._renderingDisabled = flag;
  49315. if ( flag == false ) {
  49316. // Render when you stop blocking rendering.
  49317. this.change( () => {} );
  49318. }
  49319. }
  49320. /**
  49321. * Renders all changes. In order to avoid triggering the observers (e.g. mutations) all observers are disabled
  49322. * before rendering and re-enabled after that.
  49323. *
  49324. * @private
  49325. */
  49326. _render() {
  49327. this.isRenderingInProgress = true;
  49328. this.disableObservers();
  49329. this._renderer.render();
  49330. this.enableObservers();
  49331. this.isRenderingInProgress = false;
  49332. }
  49333. /**
  49334. * Fired after a topmost {@link module:engine/view/view~View#change change block} and all
  49335. * {@link module:engine/view/document~Document#registerPostFixer post-fixers} are executed.
  49336. *
  49337. * Actual rendering is performed as a first listener on 'normal' priority.
  49338. *
  49339. * view.on( 'render', () => {
  49340. * // Rendering to the DOM is complete.
  49341. * } );
  49342. *
  49343. * This event is useful when you want to update interface elements after the rendering, e.g. position of the
  49344. * balloon panel. If you wants to change view structure use
  49345. * {@link module:engine/view/document~Document#registerPostFixer post-fixers}.
  49346. *
  49347. * @event module:engine/view/view~View#event:render
  49348. */
  49349. }
  49350. Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_16__["default"])( View, _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_15__["default"] );
  49351. /***/ }),
  49352. /***/ "./node_modules/@ckeditor/ckeditor5-engine/theme/placeholder.css":
  49353. /*!***********************************************************************!*\
  49354. !*** ./node_modules/@ckeditor/ckeditor5-engine/theme/placeholder.css ***!
  49355. \***********************************************************************/
  49356. /*! no static exports found */
  49357. /***/ (function(module, exports, __webpack_require__) {
  49358. var api = __webpack_require__(/*! ../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  49359. 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");
  49360. content = content.__esModule ? content.default : content;
  49361. if (typeof content === 'string') {
  49362. content = [[module.i, content, '']];
  49363. }
  49364. var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
  49365. options.insert = "head";
  49366. options.singleton = true;
  49367. var update = api(content, options);
  49368. module.exports = content.locals || {};
  49369. /***/ }),
  49370. /***/ "./node_modules/@ckeditor/ckeditor5-enter/src/enter.js":
  49371. /*!*************************************************************!*\
  49372. !*** ./node_modules/@ckeditor/ckeditor5-enter/src/enter.js ***!
  49373. \*************************************************************/
  49374. /*! exports provided: default */
  49375. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  49376. "use strict";
  49377. __webpack_require__.r(__webpack_exports__);
  49378. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Enter; });
  49379. /* 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");
  49380. /* harmony import */ var _entercommand__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./entercommand */ "./node_modules/@ckeditor/ckeditor5-enter/src/entercommand.js");
  49381. /* harmony import */ var _enterobserver__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./enterobserver */ "./node_modules/@ckeditor/ckeditor5-enter/src/enterobserver.js");
  49382. /**
  49383. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  49384. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  49385. */
  49386. /**
  49387. * @module enter/enter
  49388. */
  49389. /**
  49390. * This plugin handles the <kbd>Enter</kbd> key (hard line break) in the editor.
  49391. *
  49392. * See also the {@link module:enter/shiftenter~ShiftEnter} plugin.
  49393. *
  49394. * For more information about this feature see the {@glink api/enter package page}.
  49395. *
  49396. * @extends module:core/plugin~Plugin
  49397. */
  49398. class Enter extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
  49399. /**
  49400. * @inheritDoc
  49401. */
  49402. static get pluginName() {
  49403. return 'Enter';
  49404. }
  49405. init() {
  49406. const editor = this.editor;
  49407. const view = editor.editing.view;
  49408. const viewDocument = view.document;
  49409. view.addObserver( _enterobserver__WEBPACK_IMPORTED_MODULE_2__["default"] );
  49410. editor.commands.add( 'enter', new _entercommand__WEBPACK_IMPORTED_MODULE_1__["default"]( editor ) );
  49411. this.listenTo( viewDocument, 'enter', ( evt, data ) => {
  49412. data.preventDefault();
  49413. // The soft enter key is handled by the ShiftEnter plugin.
  49414. if ( data.isSoft ) {
  49415. return;
  49416. }
  49417. editor.execute( 'enter' );
  49418. view.scrollToTheSelection();
  49419. }, { priority: 'low' } );
  49420. }
  49421. }
  49422. /***/ }),
  49423. /***/ "./node_modules/@ckeditor/ckeditor5-enter/src/entercommand.js":
  49424. /*!********************************************************************!*\
  49425. !*** ./node_modules/@ckeditor/ckeditor5-enter/src/entercommand.js ***!
  49426. \********************************************************************/
  49427. /*! exports provided: default */
  49428. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  49429. "use strict";
  49430. __webpack_require__.r(__webpack_exports__);
  49431. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return EnterCommand; });
  49432. /* 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");
  49433. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./utils */ "./node_modules/@ckeditor/ckeditor5-enter/src/utils.js");
  49434. /**
  49435. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  49436. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  49437. */
  49438. /**
  49439. * @module enter/entercommand
  49440. */
  49441. /**
  49442. * Enter command. It is used by the {@link module:enter/enter~Enter Enter feature} to handle the <kbd>Enter</kbd> key.
  49443. *
  49444. * @extends module:core/command~Command
  49445. */
  49446. class EnterCommand extends _ckeditor_ckeditor5_core_src_command__WEBPACK_IMPORTED_MODULE_0__["default"] {
  49447. /**
  49448. * @inheritDoc
  49449. */
  49450. execute() {
  49451. const model = this.editor.model;
  49452. const doc = model.document;
  49453. model.change( writer => {
  49454. enterBlock( this.editor.model, writer, doc.selection, model.schema );
  49455. this.fire( 'afterExecute', { writer } );
  49456. } );
  49457. }
  49458. }
  49459. // Creates a new block in the way that the <kbd>Enter</kbd> key is expected to work.
  49460. //
  49461. // @param {module:engine/model~Model} model
  49462. // @param {module:engine/model/writer~Writer} writer
  49463. // @param {module:engine/model/selection~Selection|module:engine/model/documentselection~DocumentSelection} selection
  49464. // Selection on which the action should be performed.
  49465. // @param {module:engine/model/schema~Schema} schema
  49466. function enterBlock( model, writer, selection, schema ) {
  49467. const isSelectionEmpty = selection.isCollapsed;
  49468. const range = selection.getFirstRange();
  49469. const startElement = range.start.parent;
  49470. const endElement = range.end.parent;
  49471. // Don't touch the roots and other limit elements.
  49472. if ( schema.isLimit( startElement ) || schema.isLimit( endElement ) ) {
  49473. // Delete the selected content but only if inside a single limit element.
  49474. // Abort, when crossing limit elements boundary (e.g. <limit1>x[x</limit1>donttouchme<limit2>y]y</limit2>).
  49475. // This is an edge case and it's hard to tell what should actually happen because such a selection
  49476. // is not entirely valid.
  49477. if ( !isSelectionEmpty && startElement == endElement ) {
  49478. model.deleteContent( selection );
  49479. }
  49480. return;
  49481. }
  49482. if ( isSelectionEmpty ) {
  49483. const attributesToCopy = Object(_utils__WEBPACK_IMPORTED_MODULE_1__["getCopyOnEnterAttributes"])( writer.model.schema, selection.getAttributes() );
  49484. splitBlock( writer, range.start );
  49485. writer.setSelectionAttribute( attributesToCopy );
  49486. } else {
  49487. const leaveUnmerged = !( range.start.isAtStart && range.end.isAtEnd );
  49488. const isContainedWithinOneElement = ( startElement == endElement );
  49489. model.deleteContent( selection, { leaveUnmerged } );
  49490. if ( leaveUnmerged ) {
  49491. // Partially selected elements.
  49492. //
  49493. // <h>x[xx]x</h> -> <h>x^x</h> -> <h>x</h><h>^x</h>
  49494. if ( isContainedWithinOneElement ) {
  49495. splitBlock( writer, selection.focus );
  49496. }
  49497. // Selection over multiple elements.
  49498. //
  49499. // <h>x[x</h><p>y]y<p> -> <h>x^</h><p>y</p> -> <h>x</h><p>^y</p>
  49500. else {
  49501. writer.setSelection( endElement, 0 );
  49502. }
  49503. }
  49504. }
  49505. }
  49506. function splitBlock( writer, splitPos ) {
  49507. writer.split( splitPos );
  49508. writer.setSelection( splitPos.parent.nextSibling, 0 );
  49509. }
  49510. /***/ }),
  49511. /***/ "./node_modules/@ckeditor/ckeditor5-enter/src/enterobserver.js":
  49512. /*!*********************************************************************!*\
  49513. !*** ./node_modules/@ckeditor/ckeditor5-enter/src/enterobserver.js ***!
  49514. \*********************************************************************/
  49515. /*! exports provided: default */
  49516. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  49517. "use strict";
  49518. __webpack_require__.r(__webpack_exports__);
  49519. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return EnterObserver; });
  49520. /* 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");
  49521. /* 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");
  49522. /* harmony import */ var _ckeditor_ckeditor5_engine_src_view_observer_bubblingeventinfo__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-engine/src/view/observer/bubblingeventinfo */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/bubblingeventinfo.js");
  49523. /* 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");
  49524. /**
  49525. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  49526. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  49527. */
  49528. /**
  49529. * @module enter/enterobserver
  49530. */
  49531. /**
  49532. * Enter observer introduces the {@link module:engine/view/document~Document#event:enter} event.
  49533. *
  49534. * @extends module:engine/view/observer/observer~Observer
  49535. */
  49536. class EnterObserver extends _ckeditor_ckeditor5_engine_src_view_observer_observer__WEBPACK_IMPORTED_MODULE_0__["default"] {
  49537. /**
  49538. * @inheritDoc
  49539. */
  49540. constructor( view ) {
  49541. super( view );
  49542. const doc = this.document;
  49543. doc.on( 'keydown', ( evt, data ) => {
  49544. if ( this.isEnabled && data.keyCode == _ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_3__["keyCodes"].enter ) {
  49545. const event = new _ckeditor_ckeditor5_engine_src_view_observer_bubblingeventinfo__WEBPACK_IMPORTED_MODULE_2__["default"]( doc, 'enter', doc.selection.getFirstRange() );
  49546. doc.fire( event, new _ckeditor_ckeditor5_engine_src_view_observer_domeventdata__WEBPACK_IMPORTED_MODULE_1__["default"]( doc, data.domEvent, {
  49547. isSoft: data.shiftKey
  49548. } ) );
  49549. // Stop `keydown` event if `enter` event was stopped.
  49550. // https://github.com/ckeditor/ckeditor5/issues/753
  49551. if ( event.stop.called ) {
  49552. evt.stop();
  49553. }
  49554. }
  49555. } );
  49556. }
  49557. /**
  49558. * @inheritDoc
  49559. */
  49560. observe() {}
  49561. }
  49562. /**
  49563. * Event fired when the user presses the <kbd>Enter</kbd> key.
  49564. *
  49565. * Note: This event is fired by the {@link module:enter/enterobserver~EnterObserver observer}
  49566. * (usually registered by the {@link module:enter/enter~Enter Enter feature} and
  49567. * {@link module:enter/shiftenter~ShiftEnter ShiftEnter feature}).
  49568. *
  49569. * @event module:engine/view/document~Document#event:enter
  49570. * @param {module:engine/view/observer/domeventdata~DomEventData} data
  49571. * @param {Boolean} data.isSoft Whether it's a soft enter (<kbd>Shift</kbd>+<kbd>Enter</kbd>) or hard enter (<kbd>Enter</kbd>).
  49572. */
  49573. /***/ }),
  49574. /***/ "./node_modules/@ckeditor/ckeditor5-enter/src/index.js":
  49575. /*!*************************************************************!*\
  49576. !*** ./node_modules/@ckeditor/ckeditor5-enter/src/index.js ***!
  49577. \*************************************************************/
  49578. /*! exports provided: Enter, ShiftEnter */
  49579. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  49580. "use strict";
  49581. __webpack_require__.r(__webpack_exports__);
  49582. /* harmony import */ var _enter__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./enter */ "./node_modules/@ckeditor/ckeditor5-enter/src/enter.js");
  49583. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Enter", function() { return _enter__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  49584. /* harmony import */ var _shiftenter__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./shiftenter */ "./node_modules/@ckeditor/ckeditor5-enter/src/shiftenter.js");
  49585. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ShiftEnter", function() { return _shiftenter__WEBPACK_IMPORTED_MODULE_1__["default"]; });
  49586. /**
  49587. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  49588. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  49589. */
  49590. /**
  49591. * @module enter
  49592. */
  49593. /***/ }),
  49594. /***/ "./node_modules/@ckeditor/ckeditor5-enter/src/shiftenter.js":
  49595. /*!******************************************************************!*\
  49596. !*** ./node_modules/@ckeditor/ckeditor5-enter/src/shiftenter.js ***!
  49597. \******************************************************************/
  49598. /*! exports provided: default */
  49599. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  49600. "use strict";
  49601. __webpack_require__.r(__webpack_exports__);
  49602. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ShiftEnter; });
  49603. /* harmony import */ var _shiftentercommand__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./shiftentercommand */ "./node_modules/@ckeditor/ckeditor5-enter/src/shiftentercommand.js");
  49604. /* harmony import */ var _enterobserver__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./enterobserver */ "./node_modules/@ckeditor/ckeditor5-enter/src/enterobserver.js");
  49605. /* 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");
  49606. /**
  49607. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  49608. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  49609. */
  49610. /**
  49611. * @module enter/shiftenter
  49612. */
  49613. /**
  49614. * This plugin handles the <kbd>Shift</kbd>+<kbd>Enter</kbd> keystroke (soft line break) in the editor.
  49615. *
  49616. * See also the {@link module:enter/enter~Enter} plugin.
  49617. *
  49618. * For more information about this feature see the {@glink api/enter package page}.
  49619. *
  49620. * @extends module:core/plugin~Plugin
  49621. */
  49622. class ShiftEnter extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_2__["default"] {
  49623. /**
  49624. * @inheritDoc
  49625. */
  49626. static get pluginName() {
  49627. return 'ShiftEnter';
  49628. }
  49629. init() {
  49630. const editor = this.editor;
  49631. const schema = editor.model.schema;
  49632. const conversion = editor.conversion;
  49633. const view = editor.editing.view;
  49634. const viewDocument = view.document;
  49635. // Configure the schema.
  49636. schema.register( 'softBreak', {
  49637. allowWhere: '$text',
  49638. isInline: true
  49639. } );
  49640. // Configure converters.
  49641. conversion.for( 'upcast' )
  49642. .elementToElement( {
  49643. model: 'softBreak',
  49644. view: 'br'
  49645. } );
  49646. conversion.for( 'downcast' )
  49647. .elementToElement( {
  49648. model: 'softBreak',
  49649. view: ( modelElement, { writer } ) => writer.createEmptyElement( 'br' )
  49650. } );
  49651. view.addObserver( _enterobserver__WEBPACK_IMPORTED_MODULE_1__["default"] );
  49652. editor.commands.add( 'shiftEnter', new _shiftentercommand__WEBPACK_IMPORTED_MODULE_0__["default"]( editor ) );
  49653. this.listenTo( viewDocument, 'enter', ( evt, data ) => {
  49654. data.preventDefault();
  49655. // The hard enter key is handled by the Enter plugin.
  49656. if ( !data.isSoft ) {
  49657. return;
  49658. }
  49659. editor.execute( 'shiftEnter' );
  49660. view.scrollToTheSelection();
  49661. }, { priority: 'low' } );
  49662. }
  49663. }
  49664. /***/ }),
  49665. /***/ "./node_modules/@ckeditor/ckeditor5-enter/src/shiftentercommand.js":
  49666. /*!*************************************************************************!*\
  49667. !*** ./node_modules/@ckeditor/ckeditor5-enter/src/shiftentercommand.js ***!
  49668. \*************************************************************************/
  49669. /*! exports provided: default */
  49670. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  49671. "use strict";
  49672. __webpack_require__.r(__webpack_exports__);
  49673. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ShiftEnterCommand; });
  49674. /* 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");
  49675. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./utils */ "./node_modules/@ckeditor/ckeditor5-enter/src/utils.js");
  49676. /**
  49677. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  49678. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  49679. */
  49680. /**
  49681. * @module enter/shiftentercommand
  49682. */
  49683. /**
  49684. * ShiftEnter command. It is used by the {@link module:enter/shiftenter~ShiftEnter ShiftEnter feature} to handle
  49685. * the <kbd>Shift</kbd>+<kbd>Enter</kbd> keystroke.
  49686. *
  49687. * @extends module:core/command~Command
  49688. */
  49689. class ShiftEnterCommand extends _ckeditor_ckeditor5_core_src_command__WEBPACK_IMPORTED_MODULE_0__["default"] {
  49690. /**
  49691. * @inheritDoc
  49692. */
  49693. execute() {
  49694. const model = this.editor.model;
  49695. const doc = model.document;
  49696. model.change( writer => {
  49697. softBreakAction( model, writer, doc.selection );
  49698. this.fire( 'afterExecute', { writer } );
  49699. } );
  49700. }
  49701. refresh() {
  49702. const model = this.editor.model;
  49703. const doc = model.document;
  49704. this.isEnabled = isEnabled( model.schema, doc.selection );
  49705. }
  49706. }
  49707. // Checks whether the ShiftEnter command should be enabled in the specified selection.
  49708. //
  49709. // @param {module:engine/model/schema~Schema} schema
  49710. // @param {module:engine/model/selection~Selection|module:engine/model/documentselection~DocumentSelection} selection
  49711. function isEnabled( schema, selection ) {
  49712. // At this moment it is okay to support single range selections only.
  49713. // But in the future we may need to change that.
  49714. if ( selection.rangeCount > 1 ) {
  49715. return false;
  49716. }
  49717. const anchorPos = selection.anchor;
  49718. // Check whether the break element can be inserted in the current selection anchor.
  49719. if ( !anchorPos || !schema.checkChild( anchorPos, 'softBreak' ) ) {
  49720. return false;
  49721. }
  49722. const range = selection.getFirstRange();
  49723. const startElement = range.start.parent;
  49724. const endElement = range.end.parent;
  49725. // Do not modify the content if selection is cross-limit elements.
  49726. if ( ( isInsideLimitElement( startElement, schema ) || isInsideLimitElement( endElement, schema ) ) && startElement !== endElement ) {
  49727. return false;
  49728. }
  49729. return true;
  49730. }
  49731. // Creates a break in the way that the <kbd>Shift</kbd>+<kbd>Enter</kbd> keystroke is expected to work.
  49732. //
  49733. // @param {module:engine/model~Model} model
  49734. // @param {module:engine/model/writer~Writer} writer
  49735. // @param {module:engine/model/selection~Selection|module:engine/model/documentselection~DocumentSelection} selection
  49736. // Selection on which the action should be performed.
  49737. function softBreakAction( model, writer, selection ) {
  49738. const isSelectionEmpty = selection.isCollapsed;
  49739. const range = selection.getFirstRange();
  49740. const startElement = range.start.parent;
  49741. const endElement = range.end.parent;
  49742. const isContainedWithinOneElement = ( startElement == endElement );
  49743. if ( isSelectionEmpty ) {
  49744. const attributesToCopy = Object(_utils__WEBPACK_IMPORTED_MODULE_1__["getCopyOnEnterAttributes"])( model.schema, selection.getAttributes() );
  49745. insertBreak( model, writer, range.end );
  49746. writer.removeSelectionAttribute( selection.getAttributeKeys() );
  49747. writer.setSelectionAttribute( attributesToCopy );
  49748. } else {
  49749. const leaveUnmerged = !( range.start.isAtStart && range.end.isAtEnd );
  49750. model.deleteContent( selection, { leaveUnmerged } );
  49751. // Selection within one element:
  49752. //
  49753. // <h>x[xx]x</h> -> <h>x^x</h> -> <h>x<br>^x</h>
  49754. if ( isContainedWithinOneElement ) {
  49755. insertBreak( model, writer, selection.focus );
  49756. }
  49757. // Selection over multiple elements.
  49758. //
  49759. // <h>x[x</h><p>y]y<p> -> <h>x^</h><p>y</p> -> <h>x</h><p>^y</p>
  49760. //
  49761. // We chose not to insert a line break in this case because:
  49762. //
  49763. // * it's not a very common scenario,
  49764. // * it actually surprised me when I saw the "expected behavior" in real life.
  49765. //
  49766. // It's ok if the user will need to be more specific where they want the <br> to be inserted.
  49767. else {
  49768. // Move the selection to the 2nd element (last step of the example above).
  49769. if ( leaveUnmerged ) {
  49770. writer.setSelection( endElement, 0 );
  49771. }
  49772. }
  49773. }
  49774. }
  49775. function insertBreak( model, writer, position ) {
  49776. const breakLineElement = writer.createElement( 'softBreak' );
  49777. model.insertContent( breakLineElement, position );
  49778. writer.setSelection( breakLineElement, 'after' );
  49779. }
  49780. // Checks whether the specified `element` is a child of the limit element.
  49781. //
  49782. // Checking whether the `<p>` element is inside a limit element:
  49783. // - <$root><p>Text.</p></$root> => false
  49784. // - <$root><limitElement><p>Text</p></limitElement></$root> => true
  49785. //
  49786. // @param {module:engine/model/element~Element} element
  49787. // @param {module:engine/schema~Schema} schema
  49788. // @returns {Boolean}
  49789. function isInsideLimitElement( element, schema ) {
  49790. // `$root` is a limit element but in this case is an invalid element.
  49791. if ( element.is( 'rootElement' ) ) {
  49792. return false;
  49793. }
  49794. return schema.isLimit( element ) || isInsideLimitElement( element.parent, schema );
  49795. }
  49796. /***/ }),
  49797. /***/ "./node_modules/@ckeditor/ckeditor5-enter/src/utils.js":
  49798. /*!*************************************************************!*\
  49799. !*** ./node_modules/@ckeditor/ckeditor5-enter/src/utils.js ***!
  49800. \*************************************************************/
  49801. /*! exports provided: getCopyOnEnterAttributes */
  49802. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  49803. "use strict";
  49804. __webpack_require__.r(__webpack_exports__);
  49805. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getCopyOnEnterAttributes", function() { return getCopyOnEnterAttributes; });
  49806. /**
  49807. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  49808. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  49809. */
  49810. /**
  49811. * @module enter/utils
  49812. */
  49813. /**
  49814. * Returns attributes that should be preserved on the enter key.
  49815. *
  49816. * Filtering is realized based on `copyOnEnter` attribute property. Read more about attribute properties
  49817. * {@link module:engine/model/schema~Schema#setAttributeProperties here}.
  49818. *
  49819. * @param {module:engine/model/schema~Schema} schema
  49820. * @param {Iterable.<*>} allAttributes attributes to filter.
  49821. * @returns {Iterable.<*>}
  49822. */
  49823. function* getCopyOnEnterAttributes( schema, allAttributes ) {
  49824. for ( const attribute of allAttributes ) {
  49825. if ( attribute && schema.getAttributeProperties( attribute[ 0 ] ).copyOnEnter ) {
  49826. yield attribute;
  49827. }
  49828. }
  49829. }
  49830. /***/ }),
  49831. /***/ "./node_modules/@ckeditor/ckeditor5-essentials/src/essentials.js":
  49832. /*!***********************************************************************!*\
  49833. !*** ./node_modules/@ckeditor/ckeditor5-essentials/src/essentials.js ***!
  49834. \***********************************************************************/
  49835. /*! exports provided: default */
  49836. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  49837. "use strict";
  49838. __webpack_require__.r(__webpack_exports__);
  49839. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Essentials; });
  49840. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  49841. /* harmony import */ var ckeditor5_src_clipboard__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/clipboard */ "./node_modules/ckeditor5/src/clipboard.js");
  49842. /* harmony import */ var ckeditor5_src_enter__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ckeditor5/src/enter */ "./node_modules/ckeditor5/src/enter.js");
  49843. /* harmony import */ var ckeditor5_src_select_all__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ckeditor5/src/select-all */ "./node_modules/ckeditor5/src/select-all.js");
  49844. /* harmony import */ var ckeditor5_src_typing__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ckeditor5/src/typing */ "./node_modules/ckeditor5/src/typing.js");
  49845. /* harmony import */ var ckeditor5_src_undo__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ckeditor5/src/undo */ "./node_modules/ckeditor5/src/undo.js");
  49846. /**
  49847. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  49848. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  49849. */
  49850. /**
  49851. * @module essentials/essentials
  49852. */
  49853. /**
  49854. * A plugin including all essential editing features. It represents a set of features that enables similar functionalities
  49855. * to a `<textarea>` element.
  49856. *
  49857. * It includes:
  49858. *
  49859. * * {@link module:clipboard/clipboard~Clipboard},
  49860. * * {@link module:enter/enter~Enter},
  49861. * * {@link module:select-all/selectall~SelectAll},
  49862. * * {@link module:enter/shiftenter~ShiftEnter},
  49863. * * {@link module:typing/typing~Typing},
  49864. * * {@link module:undo/undo~Undo}.
  49865. *
  49866. * This plugin set does not define any block-level containers (such as {@link module:paragraph/paragraph~Paragraph}).
  49867. * If your editor is supposed to handle block content, make sure to include it.
  49868. *
  49869. * @extends module:core/plugin~Plugin
  49870. */
  49871. class Essentials extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  49872. /**
  49873. * @inheritDoc
  49874. */
  49875. static get requires() {
  49876. return [ ckeditor5_src_clipboard__WEBPACK_IMPORTED_MODULE_1__["Clipboard"], ckeditor5_src_enter__WEBPACK_IMPORTED_MODULE_2__["Enter"], ckeditor5_src_select_all__WEBPACK_IMPORTED_MODULE_3__["SelectAll"], ckeditor5_src_enter__WEBPACK_IMPORTED_MODULE_2__["ShiftEnter"], ckeditor5_src_typing__WEBPACK_IMPORTED_MODULE_4__["Typing"], ckeditor5_src_undo__WEBPACK_IMPORTED_MODULE_5__["Undo"] ];
  49877. }
  49878. /**
  49879. * @inheritDoc
  49880. */
  49881. static get pluginName() {
  49882. return 'Essentials';
  49883. }
  49884. }
  49885. /***/ }),
  49886. /***/ "./node_modules/@ckeditor/ckeditor5-font/src/documentcolorcollection.js":
  49887. /*!******************************************************************************!*\
  49888. !*** ./node_modules/@ckeditor/ckeditor5-font/src/documentcolorcollection.js ***!
  49889. \******************************************************************************/
  49890. /*! exports provided: default */
  49891. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  49892. "use strict";
  49893. __webpack_require__.r(__webpack_exports__);
  49894. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return DocumentColorCollection; });
  49895. /* harmony import */ var ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/utils */ "./node_modules/ckeditor5/src/utils.js");
  49896. /**
  49897. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  49898. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  49899. */
  49900. /**
  49901. * @module font/documentcolorcollection
  49902. */
  49903. /**
  49904. * A collection to store document colors. It enforces colors to be unique.
  49905. *
  49906. * @mixes module:utils/observablemixin~ObservableMixin
  49907. * @extends module:utils/collection~Collection
  49908. */
  49909. class DocumentColorCollection extends ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_0__["Collection"] {
  49910. constructor( options ) {
  49911. super( options );
  49912. /**
  49913. * Indicates whether the document color collection is empty.
  49914. *
  49915. * @observable
  49916. * @readonly
  49917. * @member {Boolean} #isEmpty
  49918. */
  49919. this.set( 'isEmpty', true );
  49920. this.on( 'change', () => {
  49921. this.set( 'isEmpty', this.length === 0 );
  49922. } );
  49923. }
  49924. /**
  49925. * Adds a color to the document color collection.
  49926. *
  49927. * This method ensures that no color duplicates are inserted (compared using
  49928. * the color value of the {@link module:ui/colorgrid/colorgrid~ColorDefinition}).
  49929. *
  49930. * If the item does not have an ID, it will be automatically generated and set on the item.
  49931. *
  49932. * @chainable
  49933. * @param {module:ui/colorgrid/colorgrid~ColorDefinition} item
  49934. * @param {Number} [index] The position of the item in the collection. The item
  49935. * is pushed to the collection when `index` is not specified.
  49936. * @fires add
  49937. * @fires change
  49938. */
  49939. add( item, index ) {
  49940. if ( this.find( element => element.color === item.color ) ) {
  49941. // No duplicates are allowed.
  49942. return;
  49943. }
  49944. super.add( item, index );
  49945. }
  49946. /**
  49947. * Checks if an object with given colors is present in the document color collection.
  49948. *
  49949. * @param {String} color
  49950. * @returns {Boolean}
  49951. */
  49952. hasColor( color ) {
  49953. return !!this.find( item => item.color === color );
  49954. }
  49955. }
  49956. Object(ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_0__["mix"])( DocumentColorCollection, ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_0__["ObservableMixin"] );
  49957. /***/ }),
  49958. /***/ "./node_modules/@ckeditor/ckeditor5-font/src/fontbackgroundcolor.js":
  49959. /*!**************************************************************************!*\
  49960. !*** ./node_modules/@ckeditor/ckeditor5-font/src/fontbackgroundcolor.js ***!
  49961. \**************************************************************************/
  49962. /*! exports provided: default */
  49963. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  49964. "use strict";
  49965. __webpack_require__.r(__webpack_exports__);
  49966. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return FontBackgroundColor; });
  49967. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  49968. /* harmony import */ var _fontbackgroundcolor_fontbackgroundcolorediting__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./fontbackgroundcolor/fontbackgroundcolorediting */ "./node_modules/@ckeditor/ckeditor5-font/src/fontbackgroundcolor/fontbackgroundcolorediting.js");
  49969. /* harmony import */ var _fontbackgroundcolor_fontbackgroundcolorui__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./fontbackgroundcolor/fontbackgroundcolorui */ "./node_modules/@ckeditor/ckeditor5-font/src/fontbackgroundcolor/fontbackgroundcolorui.js");
  49970. /**
  49971. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  49972. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  49973. */
  49974. /**
  49975. * @module font/fontbackgroundcolor
  49976. */
  49977. /**
  49978. * The font background color plugin.
  49979. *
  49980. * For a detailed overview, check the {@glink features/font font feature} documentation
  49981. * and the {@glink api/font package page}.
  49982. *
  49983. * This is a "glue" plugin which loads
  49984. * the {@link module:font/fontbackgroundcolor/fontbackgroundcolorediting~FontBackgroundColorEditing} and
  49985. * {@link module:font/fontbackgroundcolor/fontbackgroundcolorui~FontBackgroundColorUI} features in the editor.
  49986. *
  49987. * @extends module:core/plugin~Plugin
  49988. */
  49989. class FontBackgroundColor extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  49990. /**
  49991. * @inheritDoc
  49992. */
  49993. static get requires() {
  49994. return [ _fontbackgroundcolor_fontbackgroundcolorediting__WEBPACK_IMPORTED_MODULE_1__["default"], _fontbackgroundcolor_fontbackgroundcolorui__WEBPACK_IMPORTED_MODULE_2__["default"] ];
  49995. }
  49996. /**
  49997. * @inheritDoc
  49998. */
  49999. static get pluginName() {
  50000. return 'FontBackgroundColor';
  50001. }
  50002. }
  50003. /**
  50004. * The configuration of the font background color feature.
  50005. * It is introduced by the {@link module:font/fontbackgroundcolor/fontbackgroundcolorediting~FontBackgroundColorEditing} feature.
  50006. *
  50007. * Read more in {@link module:font/fontbackgroundcolor~FontBackgroundColorConfig}.
  50008. *
  50009. * @member {module:font/fontbackgroundcolor~FontBackgroundColorConfig} module:core/editor/editorconfig~EditorConfig#fontBackgroundColor
  50010. */
  50011. /**
  50012. * The configuration of the font background color feature.
  50013. * This option is used by the {@link module:font/fontbackgroundcolor/fontbackgroundcolorediting~FontBackgroundColorEditing} feature.
  50014. *
  50015. * ClassicEditor
  50016. * .create( {
  50017. * fontBackgroundColor: ... // Font background color feature configuration.
  50018. * } )
  50019. * .then( ... )
  50020. * .catch( ... );
  50021. *
  50022. * See {@link module:core/editor/editorconfig~EditorConfig all editor options}.
  50023. *
  50024. * @interface module:font/fontbackgroundcolor~FontBackgroundColorConfig
  50025. */
  50026. /**
  50027. * Available font background colors defined as an array of strings or objects.
  50028. *
  50029. * The default value registers the following colors:
  50030. *
  50031. * const fontBackgroundColorConfig = {
  50032. * colors: [
  50033. * {
  50034. * color: 'hsl(0, 0%, 0%)',
  50035. * label: 'Black'
  50036. * },
  50037. * {
  50038. * color: 'hsl(0, 0%, 30%)',
  50039. * label: 'Dim grey'
  50040. * },
  50041. * {
  50042. * color: 'hsl(0, 0%, 60%)',
  50043. * label: 'Grey'
  50044. * },
  50045. * {
  50046. * color: 'hsl(0, 0%, 90%)',
  50047. * label: 'Light grey'
  50048. * },
  50049. * {
  50050. * color: 'hsl(0, 0%, 100%)',
  50051. * label: 'White',
  50052. * hasBorder: true
  50053. * },
  50054. * {
  50055. * color: 'hsl(0, 75%, 60%)',
  50056. * label: 'Red'
  50057. * },
  50058. * {
  50059. * color: 'hsl(30, 75%, 60%)',
  50060. * label: 'Orange'
  50061. * },
  50062. * {
  50063. * color: 'hsl(60, 75%, 60%)',
  50064. * label: 'Yellow'
  50065. * },
  50066. * {
  50067. * color: 'hsl(90, 75%, 60%)',
  50068. * label: 'Light green'
  50069. * },
  50070. * {
  50071. * color: 'hsl(120, 75%, 60%)',
  50072. * label: 'Green'
  50073. * },
  50074. * {
  50075. * color: 'hsl(150, 75%, 60%)',
  50076. * label: 'Aquamarine'
  50077. * },
  50078. * {
  50079. * color: 'hsl(180, 75%, 60%)',
  50080. * label: 'Turquoise'
  50081. * },
  50082. * {
  50083. * color: 'hsl(210, 75%, 60%)',
  50084. * label: 'Light blue'
  50085. * },
  50086. * {
  50087. * color: 'hsl(240, 75%, 60%)',
  50088. * label: 'Blue'
  50089. * },
  50090. * {
  50091. * color: 'hsl(270, 75%, 60%)',
  50092. * label: 'Purple'
  50093. * }
  50094. * ]
  50095. * };
  50096. *
  50097. * **Note**: The colors are displayed in the `'fontBackgroundColor'` dropdown.
  50098. *
  50099. * @member {Array.<String|Object>} module:font/fontbackgroundcolor~FontBackgroundColorConfig#colors
  50100. */
  50101. /**
  50102. * Represents the number of columns in the font background color dropdown.
  50103. *
  50104. * The default value is:
  50105. *
  50106. * const fontBackgroundColorConfig = {
  50107. * columns: 5
  50108. * }
  50109. *
  50110. * @member {Number} module:font/fontbackgroundcolor~FontBackgroundColorConfig#columns
  50111. */
  50112. /**
  50113. * Determines the maximum number of available document colors.
  50114. * Setting it to `0` will disable the document colors feature.
  50115. *
  50116. * By default it equals to the {@link module:font/fontbackgroundcolor~FontBackgroundColorConfig#columns} value.
  50117. *
  50118. * Examples:
  50119. *
  50120. * // 1) Neither document colors nor columns are defined in the configuration.
  50121. * // Document colors will equal 5,
  50122. * // because the value will be inherited from columns,
  50123. * // which has a predefined value of 5.
  50124. * const fontBackgroundColorConfig = {}
  50125. *
  50126. * // 2) Document colors will equal 8, because the value will be inherited from columns.
  50127. * const fontBackgroundColorConfig = {
  50128. * columns: 8
  50129. * }
  50130. *
  50131. * // 3) Document colors will equal 24, because it has its own value defined.
  50132. * const fontBackgroundColorConfig = {
  50133. * columns: 8,
  50134. * documentColors: 24
  50135. * }
  50136. *
  50137. * // 4) The document colors feature will be disabled.
  50138. * const fontBackgroundColorConfig = {
  50139. * columns: 8,
  50140. * documentColors: 0
  50141. * }
  50142. *
  50143. * @member {Number} module:font/fontbackgroundcolor~FontBackgroundColorConfig#documentColors
  50144. */
  50145. /***/ }),
  50146. /***/ "./node_modules/@ckeditor/ckeditor5-font/src/fontbackgroundcolor/fontbackgroundcolorcommand.js":
  50147. /*!*****************************************************************************************************!*\
  50148. !*** ./node_modules/@ckeditor/ckeditor5-font/src/fontbackgroundcolor/fontbackgroundcolorcommand.js ***!
  50149. \*****************************************************************************************************/
  50150. /*! exports provided: default */
  50151. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  50152. "use strict";
  50153. __webpack_require__.r(__webpack_exports__);
  50154. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return FontBackgroundColorCommand; });
  50155. /* harmony import */ var _fontcommand__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../fontcommand */ "./node_modules/@ckeditor/ckeditor5-font/src/fontcommand.js");
  50156. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils */ "./node_modules/@ckeditor/ckeditor5-font/src/utils.js");
  50157. /**
  50158. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  50159. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  50160. */
  50161. /**
  50162. * @module font/fontbackgroundcolor/fontbackgroundcolorcommand
  50163. */
  50164. /**
  50165. * The font background color command. It is used by
  50166. * {@link module:font/fontbackgroundcolor/fontbackgroundcolorediting~FontBackgroundColorEditing}
  50167. * to apply the font background color.
  50168. *
  50169. * editor.execute( 'fontBackgroundColor', { value: 'rgb(250, 20, 20)' } );
  50170. *
  50171. * **Note**: Executing the command with the `null` value removes the attribute from the model.
  50172. *
  50173. * @extends module:font/fontcommand~FontCommand
  50174. */
  50175. class FontBackgroundColorCommand extends _fontcommand__WEBPACK_IMPORTED_MODULE_0__["default"] {
  50176. /**
  50177. * @inheritDoc
  50178. */
  50179. constructor( editor ) {
  50180. super( editor, _utils__WEBPACK_IMPORTED_MODULE_1__["FONT_BACKGROUND_COLOR"] );
  50181. }
  50182. }
  50183. /***/ }),
  50184. /***/ "./node_modules/@ckeditor/ckeditor5-font/src/fontbackgroundcolor/fontbackgroundcolorediting.js":
  50185. /*!*****************************************************************************************************!*\
  50186. !*** ./node_modules/@ckeditor/ckeditor5-font/src/fontbackgroundcolor/fontbackgroundcolorediting.js ***!
  50187. \*****************************************************************************************************/
  50188. /*! exports provided: default */
  50189. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  50190. "use strict";
  50191. __webpack_require__.r(__webpack_exports__);
  50192. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return FontBackgroundColorEditing; });
  50193. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  50194. /* harmony import */ var ckeditor5_src_engine__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/engine */ "./node_modules/ckeditor5/src/engine.js");
  50195. /* harmony import */ var _fontbackgroundcolorcommand__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./fontbackgroundcolorcommand */ "./node_modules/@ckeditor/ckeditor5-font/src/fontbackgroundcolor/fontbackgroundcolorcommand.js");
  50196. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils */ "./node_modules/@ckeditor/ckeditor5-font/src/utils.js");
  50197. /**
  50198. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  50199. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  50200. */
  50201. /**
  50202. * @module font/fontbackgroundcolor/fontbackgroundcolorediting
  50203. */
  50204. /**
  50205. * The font background color editing feature.
  50206. *
  50207. * It introduces the {@link module:font/fontbackgroundcolor/fontbackgroundcolorcommand~FontBackgroundColorCommand command} and
  50208. * the `fontBackgroundColor` attribute in the {@link module:engine/model/model~Model model} which renders
  50209. * in the {@link module:engine/view/view view} as a `<span>` element (`<span style="background-color: ...">`),
  50210. * depending on the {@link module:font/fontbackgroundcolor~FontBackgroundColorConfig configuration}.
  50211. *
  50212. * @extends module:core/plugin~Plugin
  50213. */
  50214. class FontBackgroundColorEditing extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  50215. /**
  50216. * @inheritDoc
  50217. */
  50218. static get pluginName() {
  50219. return 'FontBackgroundColorEditing';
  50220. }
  50221. /**
  50222. * @inheritDoc
  50223. */
  50224. constructor( editor ) {
  50225. super( editor );
  50226. editor.config.define( _utils__WEBPACK_IMPORTED_MODULE_3__["FONT_BACKGROUND_COLOR"], {
  50227. colors: [
  50228. {
  50229. color: 'hsl(0, 0%, 0%)',
  50230. label: 'Black'
  50231. },
  50232. {
  50233. color: 'hsl(0, 0%, 30%)',
  50234. label: 'Dim grey'
  50235. },
  50236. {
  50237. color: 'hsl(0, 0%, 60%)',
  50238. label: 'Grey'
  50239. },
  50240. {
  50241. color: 'hsl(0, 0%, 90%)',
  50242. label: 'Light grey'
  50243. },
  50244. {
  50245. color: 'hsl(0, 0%, 100%)',
  50246. label: 'White',
  50247. hasBorder: true
  50248. },
  50249. {
  50250. color: 'hsl(0, 75%, 60%)',
  50251. label: 'Red'
  50252. },
  50253. {
  50254. color: 'hsl(30, 75%, 60%)',
  50255. label: 'Orange'
  50256. },
  50257. {
  50258. color: 'hsl(60, 75%, 60%)',
  50259. label: 'Yellow'
  50260. },
  50261. {
  50262. color: 'hsl(90, 75%, 60%)',
  50263. label: 'Light green'
  50264. },
  50265. {
  50266. color: 'hsl(120, 75%, 60%)',
  50267. label: 'Green'
  50268. },
  50269. {
  50270. color: 'hsl(150, 75%, 60%)',
  50271. label: 'Aquamarine'
  50272. },
  50273. {
  50274. color: 'hsl(180, 75%, 60%)',
  50275. label: 'Turquoise'
  50276. },
  50277. {
  50278. color: 'hsl(210, 75%, 60%)',
  50279. label: 'Light blue'
  50280. },
  50281. {
  50282. color: 'hsl(240, 75%, 60%)',
  50283. label: 'Blue'
  50284. },
  50285. {
  50286. color: 'hsl(270, 75%, 60%)',
  50287. label: 'Purple'
  50288. }
  50289. ],
  50290. columns: 5
  50291. } );
  50292. editor.data.addStyleProcessorRules( ckeditor5_src_engine__WEBPACK_IMPORTED_MODULE_1__["addBackgroundRules"] );
  50293. editor.conversion.for( 'upcast' ).elementToAttribute( {
  50294. view: {
  50295. name: 'span',
  50296. styles: {
  50297. 'background-color': /[\s\S]+/
  50298. }
  50299. },
  50300. model: {
  50301. key: _utils__WEBPACK_IMPORTED_MODULE_3__["FONT_BACKGROUND_COLOR"],
  50302. value: Object(_utils__WEBPACK_IMPORTED_MODULE_3__["renderUpcastAttribute"])( 'background-color' )
  50303. }
  50304. } );
  50305. editor.conversion.for( 'downcast' ).attributeToElement( {
  50306. model: _utils__WEBPACK_IMPORTED_MODULE_3__["FONT_BACKGROUND_COLOR"],
  50307. view: Object(_utils__WEBPACK_IMPORTED_MODULE_3__["renderDowncastElement"])( 'background-color' )
  50308. } );
  50309. editor.commands.add( _utils__WEBPACK_IMPORTED_MODULE_3__["FONT_BACKGROUND_COLOR"], new _fontbackgroundcolorcommand__WEBPACK_IMPORTED_MODULE_2__["default"]( editor ) );
  50310. // Allow the font backgroundColor attribute on text nodes.
  50311. editor.model.schema.extend( '$text', { allowAttributes: _utils__WEBPACK_IMPORTED_MODULE_3__["FONT_BACKGROUND_COLOR"] } );
  50312. editor.model.schema.setAttributeProperties( _utils__WEBPACK_IMPORTED_MODULE_3__["FONT_BACKGROUND_COLOR"], {
  50313. isFormatting: true,
  50314. copyOnEnter: true
  50315. } );
  50316. }
  50317. }
  50318. /***/ }),
  50319. /***/ "./node_modules/@ckeditor/ckeditor5-font/src/fontbackgroundcolor/fontbackgroundcolorui.js":
  50320. /*!************************************************************************************************!*\
  50321. !*** ./node_modules/@ckeditor/ckeditor5-font/src/fontbackgroundcolor/fontbackgroundcolorui.js ***!
  50322. \************************************************************************************************/
  50323. /*! exports provided: default */
  50324. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  50325. "use strict";
  50326. __webpack_require__.r(__webpack_exports__);
  50327. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return FontBackgroundColorUI; });
  50328. /* harmony import */ var _ui_colorui__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../ui/colorui */ "./node_modules/@ckeditor/ckeditor5-font/src/ui/colorui.js");
  50329. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils */ "./node_modules/@ckeditor/ckeditor5-font/src/utils.js");
  50330. /* 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");
  50331. /**
  50332. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  50333. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  50334. */
  50335. /**
  50336. * @module font/fontbackgroundcolor/fontbackgroundcolorui
  50337. */
  50338. /**
  50339. * The font background color UI plugin. It introduces the `'fontBackgroundColor'` dropdown.
  50340. *
  50341. * @extends module:core/plugin~Plugin
  50342. */
  50343. class FontBackgroundColorUI extends _ui_colorui__WEBPACK_IMPORTED_MODULE_0__["default"] {
  50344. /**
  50345. * @inheritDoc
  50346. */
  50347. constructor( editor ) {
  50348. const t = editor.locale.t;
  50349. super( editor, {
  50350. commandName: _utils__WEBPACK_IMPORTED_MODULE_1__["FONT_BACKGROUND_COLOR"],
  50351. componentName: _utils__WEBPACK_IMPORTED_MODULE_1__["FONT_BACKGROUND_COLOR"],
  50352. icon: _theme_icons_font_background_svg__WEBPACK_IMPORTED_MODULE_2__["default"],
  50353. dropdownLabel: t( 'Font Background Color' )
  50354. } );
  50355. }
  50356. /**
  50357. * @inheritDoc
  50358. */
  50359. static get pluginName() {
  50360. return 'FontBackgroundColorUI';
  50361. }
  50362. }
  50363. /***/ }),
  50364. /***/ "./node_modules/@ckeditor/ckeditor5-font/src/fontcolor.js":
  50365. /*!****************************************************************!*\
  50366. !*** ./node_modules/@ckeditor/ckeditor5-font/src/fontcolor.js ***!
  50367. \****************************************************************/
  50368. /*! exports provided: default */
  50369. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  50370. "use strict";
  50371. __webpack_require__.r(__webpack_exports__);
  50372. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return FontColor; });
  50373. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  50374. /* harmony import */ var _fontcolor_fontcolorediting__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./fontcolor/fontcolorediting */ "./node_modules/@ckeditor/ckeditor5-font/src/fontcolor/fontcolorediting.js");
  50375. /* harmony import */ var _fontcolor_fontcolorui__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./fontcolor/fontcolorui */ "./node_modules/@ckeditor/ckeditor5-font/src/fontcolor/fontcolorui.js");
  50376. /**
  50377. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  50378. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  50379. */
  50380. /**
  50381. * @module font/fontcolor
  50382. */
  50383. /**
  50384. * The font color plugin.
  50385. *
  50386. * For a detailed overview, check the {@glink features/font font feature} documentation
  50387. * and the {@glink api/font package page}.
  50388. *
  50389. * This is a "glue" plugin which loads the {@link module:font/fontcolor/fontcolorediting~FontColorEditing} and
  50390. * {@link module:font/fontcolor/fontcolorui~FontColorUI} features in the editor.
  50391. *
  50392. * @extends module:core/plugin~Plugin
  50393. */
  50394. class FontColor extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  50395. /**
  50396. * @inheritDoc
  50397. */
  50398. static get requires() {
  50399. return [ _fontcolor_fontcolorediting__WEBPACK_IMPORTED_MODULE_1__["default"], _fontcolor_fontcolorui__WEBPACK_IMPORTED_MODULE_2__["default"] ];
  50400. }
  50401. /**
  50402. * @inheritDoc
  50403. */
  50404. static get pluginName() {
  50405. return 'FontColor';
  50406. }
  50407. }
  50408. /**
  50409. * The configuration of the font color feature.
  50410. * It is introduced by the {@link module:font/fontcolor/fontcolorediting~FontColorEditing} feature.
  50411. *
  50412. * Read more in {@link module:font/fontcolor~FontColorConfig}.
  50413. *
  50414. * @member {module:font/fontcolor~FontColorConfig} module:core/editor/editorconfig~EditorConfig#fontColor
  50415. */
  50416. /**
  50417. * The configuration of the font color feature.
  50418. * This option is used by the {@link module:font/fontcolor/fontcolorediting~FontColorEditing} feature.
  50419. *
  50420. * ClassicEditor
  50421. * .create( {
  50422. * fontColor: ... // Font color feature configuration.
  50423. * } )
  50424. * .then( ... )
  50425. * .catch( ... );
  50426. *
  50427. * See {@link module:core/editor/editorconfig~EditorConfig all editor options}.
  50428. *
  50429. * @interface module:font/fontcolor~FontColorConfig
  50430. */
  50431. /**
  50432. * Available font colors defined as an array of strings or objects.
  50433. *
  50434. * The default value registers the following colors:
  50435. *
  50436. * const fontColorConfig = {
  50437. * colors: [
  50438. * {
  50439. * color: 'hsl(0, 0%, 0%)',
  50440. * label: 'Black'
  50441. * },
  50442. * {
  50443. * color: 'hsl(0, 0%, 30%)',
  50444. * label: 'Dim grey'
  50445. * },
  50446. * {
  50447. * color: 'hsl(0, 0%, 60%)',
  50448. * label: 'Grey'
  50449. * },
  50450. * {
  50451. * color: 'hsl(0, 0%, 90%)',
  50452. * label: 'Light grey'
  50453. * },
  50454. * {
  50455. * color: 'hsl(0, 0%, 100%)',
  50456. * label: 'White',
  50457. * hasBorder: true
  50458. * },
  50459. * {
  50460. * color: 'hsl(0, 75%, 60%)',
  50461. * label: 'Red'
  50462. * },
  50463. * {
  50464. * color: 'hsl(30, 75%, 60%)',
  50465. * label: 'Orange'
  50466. * },
  50467. * {
  50468. * color: 'hsl(60, 75%, 60%)',
  50469. * label: 'Yellow'
  50470. * },
  50471. * {
  50472. * color: 'hsl(90, 75%, 60%)',
  50473. * label: 'Light green'
  50474. * },
  50475. * {
  50476. * color: 'hsl(120, 75%, 60%)',
  50477. * label: 'Green'
  50478. * },
  50479. * {
  50480. * color: 'hsl(150, 75%, 60%)',
  50481. * label: 'Aquamarine'
  50482. * },
  50483. * {
  50484. * color: 'hsl(180, 75%, 60%)',
  50485. * label: 'Turquoise'
  50486. * },
  50487. * {
  50488. * color: 'hsl(210, 75%, 60%)',
  50489. * label: 'Light blue'
  50490. * },
  50491. * {
  50492. * color: 'hsl(240, 75%, 60%)',
  50493. * label: 'Blue'
  50494. * },
  50495. * {
  50496. * color: 'hsl(270, 75%, 60%)',
  50497. * label: 'Purple'
  50498. * }
  50499. * ]
  50500. * };
  50501. *
  50502. * **Note**: The colors are displayed in the `'fontColor'` dropdown.
  50503. *
  50504. * @member {Array.<String|Object>} module:font/fontcolor~FontColorConfig#colors
  50505. */
  50506. /**
  50507. * Represents the number of columns in the font color dropdown.
  50508. *
  50509. * The default value is:
  50510. *
  50511. * const fontColorConfig = {
  50512. * columns: 5
  50513. * }
  50514. *
  50515. * @member {Number} module:font/fontcolor~FontColorConfig#columns
  50516. */
  50517. /**
  50518. * Determines the maximum number of available document colors.
  50519. * Setting it to `0` will disable the document colors feature.
  50520. *
  50521. * By default it equals to the {@link module:font/fontcolor~FontColorConfig#columns} value.
  50522. *
  50523. * Examples:
  50524. *
  50525. * // 1) Neither document colors nor columns are defined in the configuration.
  50526. * // Document colors will equal 5,
  50527. * // because the value will be inherited from columns,
  50528. * // which has a predefined value of 5.
  50529. * const fontColorConfig = {}
  50530. *
  50531. * // 2) Document colors will equal 8, because the value will be inherited from columns.
  50532. * const fontColorConfig = {
  50533. * columns: 8
  50534. * }
  50535. *
  50536. * // 3) Document colors will equal 24, because it has its own value defined.
  50537. * const fontColorConfig = {
  50538. * columns: 8,
  50539. * documentColors: 24
  50540. * }
  50541. *
  50542. * // 4) The document colors feature will be disabled.
  50543. * const fontColorConfig = {
  50544. * columns: 8,
  50545. * documentColors: 0
  50546. * }
  50547. *
  50548. * @member {Number} module:font/fontcolor~FontColorConfig#documentColors
  50549. */
  50550. /***/ }),
  50551. /***/ "./node_modules/@ckeditor/ckeditor5-font/src/fontcolor/fontcolorcommand.js":
  50552. /*!*********************************************************************************!*\
  50553. !*** ./node_modules/@ckeditor/ckeditor5-font/src/fontcolor/fontcolorcommand.js ***!
  50554. \*********************************************************************************/
  50555. /*! exports provided: default */
  50556. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  50557. "use strict";
  50558. __webpack_require__.r(__webpack_exports__);
  50559. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return FontColorCommand; });
  50560. /* harmony import */ var _fontcommand__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../fontcommand */ "./node_modules/@ckeditor/ckeditor5-font/src/fontcommand.js");
  50561. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils */ "./node_modules/@ckeditor/ckeditor5-font/src/utils.js");
  50562. /**
  50563. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  50564. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  50565. */
  50566. /**
  50567. * @module font/fontcolor/fontcolorcommand
  50568. */
  50569. /**
  50570. * The font color command. It is used by {@link module:font/fontcolor/fontcolorediting~FontColorEditing}
  50571. * to apply the font color.
  50572. *
  50573. * editor.execute( 'fontColor', { value: 'rgb(250, 20, 20)' } );
  50574. *
  50575. * **Note**: Executing the command with the `null` value removes the attribute from the model.
  50576. *
  50577. * @extends module:font/fontcommand~FontCommand
  50578. */
  50579. class FontColorCommand extends _fontcommand__WEBPACK_IMPORTED_MODULE_0__["default"] {
  50580. /**
  50581. * @inheritDoc
  50582. */
  50583. constructor( editor ) {
  50584. super( editor, _utils__WEBPACK_IMPORTED_MODULE_1__["FONT_COLOR"] );
  50585. }
  50586. }
  50587. /***/ }),
  50588. /***/ "./node_modules/@ckeditor/ckeditor5-font/src/fontcolor/fontcolorediting.js":
  50589. /*!*********************************************************************************!*\
  50590. !*** ./node_modules/@ckeditor/ckeditor5-font/src/fontcolor/fontcolorediting.js ***!
  50591. \*********************************************************************************/
  50592. /*! exports provided: default */
  50593. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  50594. "use strict";
  50595. __webpack_require__.r(__webpack_exports__);
  50596. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return FontColorEditing; });
  50597. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  50598. /* harmony import */ var _fontcolorcommand__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./fontcolorcommand */ "./node_modules/@ckeditor/ckeditor5-font/src/fontcolor/fontcolorcommand.js");
  50599. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils */ "./node_modules/@ckeditor/ckeditor5-font/src/utils.js");
  50600. /**
  50601. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  50602. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  50603. */
  50604. /**
  50605. * @module font/fontcolor/fontcolorediting
  50606. */
  50607. /**
  50608. * The font color editing feature.
  50609. *
  50610. * It introduces the {@link module:font/fontcolor/fontcolorcommand~FontColorCommand command} and
  50611. * the `fontColor` attribute in the {@link module:engine/model/model~Model model} which renders
  50612. * in the {@link module:engine/view/view view} as a `<span>` element (`<span style="color: ...">`),
  50613. * depending on the {@link module:font/fontcolor~FontColorConfig configuration}.
  50614. *
  50615. * @extends module:core/plugin~Plugin
  50616. */
  50617. class FontColorEditing extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  50618. /**
  50619. * @inheritDoc
  50620. */
  50621. static get pluginName() {
  50622. return 'FontColorEditing';
  50623. }
  50624. /**
  50625. * @inheritDoc
  50626. */
  50627. constructor( editor ) {
  50628. super( editor );
  50629. editor.config.define( _utils__WEBPACK_IMPORTED_MODULE_2__["FONT_COLOR"], {
  50630. colors: [
  50631. {
  50632. color: 'hsl(0, 0%, 0%)',
  50633. label: 'Black'
  50634. },
  50635. {
  50636. color: 'hsl(0, 0%, 30%)',
  50637. label: 'Dim grey'
  50638. },
  50639. {
  50640. color: 'hsl(0, 0%, 60%)',
  50641. label: 'Grey'
  50642. },
  50643. {
  50644. color: 'hsl(0, 0%, 90%)',
  50645. label: 'Light grey'
  50646. },
  50647. {
  50648. color: 'hsl(0, 0%, 100%)',
  50649. label: 'White',
  50650. hasBorder: true
  50651. },
  50652. {
  50653. color: 'hsl(0, 75%, 60%)',
  50654. label: 'Red'
  50655. },
  50656. {
  50657. color: 'hsl(30, 75%, 60%)',
  50658. label: 'Orange'
  50659. },
  50660. {
  50661. color: 'hsl(60, 75%, 60%)',
  50662. label: 'Yellow'
  50663. },
  50664. {
  50665. color: 'hsl(90, 75%, 60%)',
  50666. label: 'Light green'
  50667. },
  50668. {
  50669. color: 'hsl(120, 75%, 60%)',
  50670. label: 'Green'
  50671. },
  50672. {
  50673. color: 'hsl(150, 75%, 60%)',
  50674. label: 'Aquamarine'
  50675. },
  50676. {
  50677. color: 'hsl(180, 75%, 60%)',
  50678. label: 'Turquoise'
  50679. },
  50680. {
  50681. color: 'hsl(210, 75%, 60%)',
  50682. label: 'Light blue'
  50683. },
  50684. {
  50685. color: 'hsl(240, 75%, 60%)',
  50686. label: 'Blue'
  50687. },
  50688. {
  50689. color: 'hsl(270, 75%, 60%)',
  50690. label: 'Purple'
  50691. }
  50692. ],
  50693. columns: 5
  50694. } );
  50695. editor.conversion.for( 'upcast' ).elementToAttribute( {
  50696. view: {
  50697. name: 'span',
  50698. styles: {
  50699. 'color': /[\s\S]+/
  50700. }
  50701. },
  50702. model: {
  50703. key: _utils__WEBPACK_IMPORTED_MODULE_2__["FONT_COLOR"],
  50704. value: Object(_utils__WEBPACK_IMPORTED_MODULE_2__["renderUpcastAttribute"])( 'color' )
  50705. }
  50706. } );
  50707. // Support legacy `<font color="..">` formatting.
  50708. editor.conversion.for( 'upcast' ).elementToAttribute( {
  50709. view: {
  50710. name: 'font',
  50711. attributes: {
  50712. 'color': /^#?\w+$/
  50713. }
  50714. },
  50715. model: {
  50716. key: _utils__WEBPACK_IMPORTED_MODULE_2__["FONT_COLOR"],
  50717. value: viewElement => viewElement.getAttribute( 'color' )
  50718. }
  50719. } );
  50720. editor.conversion.for( 'downcast' ).attributeToElement( {
  50721. model: _utils__WEBPACK_IMPORTED_MODULE_2__["FONT_COLOR"],
  50722. view: Object(_utils__WEBPACK_IMPORTED_MODULE_2__["renderDowncastElement"])( 'color' )
  50723. } );
  50724. editor.commands.add( _utils__WEBPACK_IMPORTED_MODULE_2__["FONT_COLOR"], new _fontcolorcommand__WEBPACK_IMPORTED_MODULE_1__["default"]( editor ) );
  50725. // Allow the font color attribute on text nodes.
  50726. editor.model.schema.extend( '$text', { allowAttributes: _utils__WEBPACK_IMPORTED_MODULE_2__["FONT_COLOR"] } );
  50727. editor.model.schema.setAttributeProperties( _utils__WEBPACK_IMPORTED_MODULE_2__["FONT_COLOR"], {
  50728. isFormatting: true,
  50729. copyOnEnter: true
  50730. } );
  50731. }
  50732. }
  50733. /***/ }),
  50734. /***/ "./node_modules/@ckeditor/ckeditor5-font/src/fontcolor/fontcolorui.js":
  50735. /*!****************************************************************************!*\
  50736. !*** ./node_modules/@ckeditor/ckeditor5-font/src/fontcolor/fontcolorui.js ***!
  50737. \****************************************************************************/
  50738. /*! exports provided: default */
  50739. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  50740. "use strict";
  50741. __webpack_require__.r(__webpack_exports__);
  50742. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return FontColorUI; });
  50743. /* harmony import */ var _ui_colorui__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../ui/colorui */ "./node_modules/@ckeditor/ckeditor5-font/src/ui/colorui.js");
  50744. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils */ "./node_modules/@ckeditor/ckeditor5-font/src/utils.js");
  50745. /* 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");
  50746. /**
  50747. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  50748. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  50749. */
  50750. /**
  50751. * @module font/fontcolor/fontcolorui
  50752. */
  50753. /**
  50754. * The font color UI plugin. It introduces the `'fontColor'` dropdown.
  50755. *
  50756. * @extends module:core/plugin~Plugin
  50757. */
  50758. class FontColorUI extends _ui_colorui__WEBPACK_IMPORTED_MODULE_0__["default"] {
  50759. /**
  50760. * @inheritDoc
  50761. */
  50762. constructor( editor ) {
  50763. const t = editor.locale.t;
  50764. super( editor, {
  50765. commandName: _utils__WEBPACK_IMPORTED_MODULE_1__["FONT_COLOR"],
  50766. componentName: _utils__WEBPACK_IMPORTED_MODULE_1__["FONT_COLOR"],
  50767. icon: _theme_icons_font_color_svg__WEBPACK_IMPORTED_MODULE_2__["default"],
  50768. dropdownLabel: t( 'Font Color' )
  50769. } );
  50770. }
  50771. /**
  50772. * @inheritDoc
  50773. */
  50774. static get pluginName() {
  50775. return 'FontColorUI';
  50776. }
  50777. }
  50778. /***/ }),
  50779. /***/ "./node_modules/@ckeditor/ckeditor5-font/src/fontcommand.js":
  50780. /*!******************************************************************!*\
  50781. !*** ./node_modules/@ckeditor/ckeditor5-font/src/fontcommand.js ***!
  50782. \******************************************************************/
  50783. /*! exports provided: default */
  50784. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  50785. "use strict";
  50786. __webpack_require__.r(__webpack_exports__);
  50787. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return FontCommand; });
  50788. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  50789. /**
  50790. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  50791. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  50792. */
  50793. /**
  50794. * @module font/fontcommand
  50795. */
  50796. /**
  50797. * The base font command.
  50798. *
  50799. * @extends module:core/command~Command
  50800. */
  50801. class FontCommand extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Command"] {
  50802. /**
  50803. * Creates an instance of the command.
  50804. *
  50805. * @param {module:core/editor/editor~Editor} editor Editor instance.
  50806. * @param {String} attributeKey The name of a model attribute on which this command operates.
  50807. */
  50808. constructor( editor, attributeKey ) {
  50809. super( editor );
  50810. /**
  50811. * When set, it reflects the {@link #attributeKey} value of the selection.
  50812. *
  50813. * @observable
  50814. * @readonly
  50815. * @member {String} module:font/fontcommand~FontCommand#value
  50816. */
  50817. /**
  50818. * A model attribute on which this command operates.
  50819. *
  50820. * @readonly
  50821. * @member {Boolean} module:font/fontcommand~FontCommand#attributeKey
  50822. */
  50823. this.attributeKey = attributeKey;
  50824. }
  50825. /**
  50826. * @inheritDoc
  50827. */
  50828. refresh() {
  50829. const model = this.editor.model;
  50830. const doc = model.document;
  50831. this.value = doc.selection.getAttribute( this.attributeKey );
  50832. this.isEnabled = model.schema.checkAttributeInSelection( doc.selection, this.attributeKey );
  50833. }
  50834. /**
  50835. * Executes the command. Applies the `value` of the {@link #attributeKey} to the selection.
  50836. * If no `value` is passed, it removes the attribute from the selection.
  50837. *
  50838. * @protected
  50839. * @param {Object} [options] Options for the executed command.
  50840. * @param {String} [options.value] The value to apply.
  50841. * @fires execute
  50842. */
  50843. execute( options = {} ) {
  50844. const model = this.editor.model;
  50845. const document = model.document;
  50846. const selection = document.selection;
  50847. const value = options.value;
  50848. model.change( writer => {
  50849. if ( selection.isCollapsed ) {
  50850. if ( value ) {
  50851. writer.setSelectionAttribute( this.attributeKey, value );
  50852. } else {
  50853. writer.removeSelectionAttribute( this.attributeKey );
  50854. }
  50855. } else {
  50856. const ranges = model.schema.getValidRanges( selection.getRanges(), this.attributeKey );
  50857. for ( const range of ranges ) {
  50858. if ( value ) {
  50859. writer.setAttribute( this.attributeKey, value, range );
  50860. } else {
  50861. writer.removeAttribute( this.attributeKey, range );
  50862. }
  50863. }
  50864. }
  50865. } );
  50866. }
  50867. }
  50868. /***/ }),
  50869. /***/ "./node_modules/@ckeditor/ckeditor5-font/src/ui/colortableview.js":
  50870. /*!************************************************************************!*\
  50871. !*** ./node_modules/@ckeditor/ckeditor5-font/src/ui/colortableview.js ***!
  50872. \************************************************************************/
  50873. /*! exports provided: default */
  50874. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  50875. "use strict";
  50876. __webpack_require__.r(__webpack_exports__);
  50877. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ColorTableView; });
  50878. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  50879. /* harmony import */ var ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/ui */ "./node_modules/ckeditor5/src/ui.js");
  50880. /* harmony import */ var ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ckeditor5/src/utils */ "./node_modules/ckeditor5/src/utils.js");
  50881. /* harmony import */ var _documentcolorcollection__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../documentcolorcollection */ "./node_modules/@ckeditor/ckeditor5-font/src/documentcolorcollection.js");
  50882. /* harmony import */ var _theme_fontcolor_css__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../theme/fontcolor.css */ "./node_modules/@ckeditor/ckeditor5-font/theme/fontcolor.css");
  50883. /* harmony import */ var _theme_fontcolor_css__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_theme_fontcolor_css__WEBPACK_IMPORTED_MODULE_4__);
  50884. /**
  50885. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  50886. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  50887. */
  50888. /**
  50889. * @module font/ui/colortableview
  50890. */
  50891. /**
  50892. * A class which represents a view with the following sub–components:
  50893. *
  50894. * * A remove color button,
  50895. * * A static {@link module:ui/colorgrid/colorgrid~ColorGridView} of colors defined in the configuration,
  50896. * * A dynamic {@link module:ui/colorgrid/colorgrid~ColorGridView} of colors used in the document.
  50897. *
  50898. * @extends module:ui/view~View
  50899. */
  50900. class ColorTableView extends ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__["View"] {
  50901. /**
  50902. * Creates a view to be inserted as a child of {@link module:ui/dropdown/dropdownview~DropdownView}.
  50903. *
  50904. * @param {module:utils/locale~Locale} [locale] The localization services instance.
  50905. * @param {Object} config The configuration object.
  50906. * @param {Array.<module:ui/colorgrid/colorgrid~ColorDefinition>} config.colors An array with definitions of colors to
  50907. * be displayed in the table.
  50908. * @param {Number} config.columns The number of columns in the color grid.
  50909. * @param {String} config.removeButtonLabel The label of the button responsible for removing the color.
  50910. * @param {String} config.documentColorsLabel The label for the section with the document colors.
  50911. * @param {String} config.documentColorsCount The number of colors in the document colors section inside the color dropdown.
  50912. */
  50913. constructor( locale, { colors, columns, removeButtonLabel, documentColorsLabel, documentColorsCount } ) {
  50914. super( locale );
  50915. /**
  50916. * A collection of the children of the table.
  50917. *
  50918. * @readonly
  50919. * @member {module:ui/viewcollection~ViewCollection}
  50920. */
  50921. this.items = this.createCollection();
  50922. /**
  50923. * An array with objects representing colors to be displayed in the grid.
  50924. *
  50925. * @type {Arrray.<module:ui/colorgrid/colorgrid~ColorDefinition>}
  50926. */
  50927. this.colorDefinitions = colors;
  50928. /**
  50929. * Tracks information about the DOM focus in the list.
  50930. *
  50931. * @readonly
  50932. * @member {module:utils/focustracker~FocusTracker}
  50933. */
  50934. this.focusTracker = new ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_2__["FocusTracker"]();
  50935. /**
  50936. * An instance of the {@link module:utils/keystrokehandler~KeystrokeHandler}.
  50937. *
  50938. * @readonly
  50939. * @member {module:utils/keystrokehandler~KeystrokeHandler}
  50940. */
  50941. this.keystrokes = new ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_2__["KeystrokeHandler"]();
  50942. /**
  50943. * Keeps the value of the command associated with the table for the current selection.
  50944. *
  50945. * @type {String}
  50946. */
  50947. this.set( 'selectedColor' );
  50948. /**
  50949. * The label of the button responsible for removing color attributes.
  50950. *
  50951. * @type {String}
  50952. */
  50953. this.removeButtonLabel = removeButtonLabel;
  50954. /**
  50955. * The number of columns in the color grid.
  50956. *
  50957. * @type {Number}
  50958. */
  50959. this.columns = columns;
  50960. /**
  50961. * A collection of definitions that store the document colors.
  50962. *
  50963. * @readonly
  50964. * @member {module:font/documentcolorcollection~DocumentColorCollection}
  50965. */
  50966. this.documentColors = new _documentcolorcollection__WEBPACK_IMPORTED_MODULE_3__["default"]();
  50967. /**
  50968. * The maximum number of colors in the document colors section.
  50969. * If it equals 0, the document colors section is not added.
  50970. *
  50971. * @readonly
  50972. * @type {Number}
  50973. */
  50974. this.documentColorsCount = documentColorsCount;
  50975. /**
  50976. * Preserves the reference to {@link module:ui/colorgrid/colorgrid~ColorGridView} used to create
  50977. * the default (static) color set.
  50978. *
  50979. * The property is loaded once the the parent dropdown is opened the first time.
  50980. *
  50981. * @readonly
  50982. * @member {module:ui/colorgrid/colorgrid~ColorGridView|undefined} #staticColorsGrid
  50983. */
  50984. /**
  50985. * Preserves the reference to {@link module:ui/colorgrid/colorgrid~ColorGridView} used to create
  50986. * the document colors. It remains undefined if the document colors feature is disabled.
  50987. *
  50988. * The property is loaded once the the parent dropdown is opened the first time.
  50989. *
  50990. * @readonly
  50991. * @member {module:ui/colorgrid/colorgrid~ColorGridView|undefined} #documentColorsGrid
  50992. */
  50993. /**
  50994. * Helps cycling over focusable {@link #items} in the list.
  50995. *
  50996. * @readonly
  50997. * @protected
  50998. * @member {module:ui/focuscycler~FocusCycler}
  50999. */
  51000. this._focusCycler = new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__["FocusCycler"]( {
  51001. focusables: this.items,
  51002. focusTracker: this.focusTracker,
  51003. keystrokeHandler: this.keystrokes,
  51004. actions: {
  51005. // Navigate list items backwards using the Arrow Up key.
  51006. focusPrevious: 'arrowup',
  51007. // Navigate list items forwards using the Arrow Down key.
  51008. focusNext: 'arrowdown'
  51009. }
  51010. } );
  51011. /**
  51012. * Document color section's label.
  51013. *
  51014. * @private
  51015. * @readonly
  51016. * @type {String}
  51017. */
  51018. this._documentColorsLabel = documentColorsLabel;
  51019. this.setTemplate( {
  51020. tag: 'div',
  51021. attributes: {
  51022. class: [
  51023. 'ck',
  51024. 'ck-color-table'
  51025. ]
  51026. },
  51027. children: this.items
  51028. } );
  51029. this.items.add( this._removeColorButton() );
  51030. }
  51031. /**
  51032. * Scans through the editor model and searches for text node attributes with the given attribute name.
  51033. * Found entries are set as document colors.
  51034. *
  51035. * All the previously stored document colors will be lost in the process.
  51036. *
  51037. * @param {module:engine/model/model~Model} model The model used as a source to obtain the document colors.
  51038. * @param {String} attributeName Determines the name of the related model's attribute for a given dropdown.
  51039. */
  51040. updateDocumentColors( model, attributeName ) {
  51041. const document = model.document;
  51042. const maxCount = this.documentColorsCount;
  51043. this.documentColors.clear();
  51044. for ( const rootName of document.getRootNames() ) {
  51045. const root = document.getRoot( rootName );
  51046. const range = model.createRangeIn( root );
  51047. for ( const node of range.getItems() ) {
  51048. if ( node.is( '$textProxy' ) && node.hasAttribute( attributeName ) ) {
  51049. this._addColorToDocumentColors( node.getAttribute( attributeName ) );
  51050. if ( this.documentColors.length >= maxCount ) {
  51051. return;
  51052. }
  51053. }
  51054. }
  51055. }
  51056. }
  51057. /**
  51058. * Refreshes the state of the selected color in one or both {@link module:ui/colorgrid/colorgrid~ColorGridView}s
  51059. * available in the {@link module:font/ui/colortableview~ColorTableView}. It guarantees that the selection will occur only in one
  51060. * of them.
  51061. */
  51062. updateSelectedColors() {
  51063. const documentColorsGrid = this.documentColorsGrid;
  51064. const staticColorsGrid = this.staticColorsGrid;
  51065. const selectedColor = this.selectedColor;
  51066. staticColorsGrid.selectedColor = selectedColor;
  51067. if ( documentColorsGrid ) {
  51068. documentColorsGrid.selectedColor = selectedColor;
  51069. }
  51070. }
  51071. /**
  51072. * @inheritDoc
  51073. */
  51074. render() {
  51075. super.render();
  51076. // Items added before rendering should be known to the #focusTracker.
  51077. for ( const item of this.items ) {
  51078. this.focusTracker.add( item.element );
  51079. }
  51080. // Start listening for the keystrokes coming from #element.
  51081. this.keystrokes.listenTo( this.element );
  51082. }
  51083. /**
  51084. * Appends {@link #staticColorsGrid} and {@link #documentColorsGrid} views.
  51085. */
  51086. appendGrids() {
  51087. if ( this.staticColorsGrid ) {
  51088. return;
  51089. }
  51090. this.staticColorsGrid = this._createStaticColorsGrid();
  51091. this.items.add( this.staticColorsGrid );
  51092. if ( this.documentColorsCount ) {
  51093. // Create a label for document colors.
  51094. const bind = ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__["Template"].bind( this.documentColors, this.documentColors );
  51095. const label = new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__["LabelView"]( this.locale );
  51096. label.text = this._documentColorsLabel;
  51097. label.extendTemplate( {
  51098. attributes: {
  51099. class: [
  51100. 'ck',
  51101. 'ck-color-grid__label',
  51102. bind.if( 'isEmpty', 'ck-hidden' )
  51103. ]
  51104. }
  51105. } );
  51106. this.items.add( label );
  51107. this.documentColorsGrid = this._createDocumentColorsGrid();
  51108. this.items.add( this.documentColorsGrid );
  51109. }
  51110. }
  51111. /**
  51112. * Focuses the first focusable element in {@link #items}.
  51113. */
  51114. focus() {
  51115. this._focusCycler.focusFirst();
  51116. }
  51117. /**
  51118. * Focuses the last focusable element in {@link #items}.
  51119. */
  51120. focusLast() {
  51121. this._focusCycler.focusLast();
  51122. }
  51123. /**
  51124. * Adds the remove color button as a child of the current view.
  51125. *
  51126. * @private
  51127. * @returns {module:ui/button/buttonview~ButtonView}
  51128. */
  51129. _removeColorButton() {
  51130. const buttonView = new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__["ButtonView"]();
  51131. buttonView.set( {
  51132. withText: true,
  51133. icon: ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["icons"].eraser,
  51134. tooltip: true,
  51135. label: this.removeButtonLabel
  51136. } );
  51137. buttonView.class = 'ck-color-table__remove-color';
  51138. buttonView.on( 'execute', () => {
  51139. this.fire( 'execute', { value: null } );
  51140. } );
  51141. return buttonView;
  51142. }
  51143. /**
  51144. * Creates a static color table grid based on the editor configuration.
  51145. *
  51146. * @private
  51147. * @returns {module:ui/colorgrid/colorgrid~ColorGridView}
  51148. */
  51149. _createStaticColorsGrid() {
  51150. const colorGrid = new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__["ColorGridView"]( this.locale, {
  51151. colorDefinitions: this.colorDefinitions,
  51152. columns: this.columns
  51153. } );
  51154. colorGrid.delegate( 'execute' ).to( this );
  51155. return colorGrid;
  51156. }
  51157. /**
  51158. * Creates the document colors section view and binds it to {@link #documentColors}.
  51159. *
  51160. * @private
  51161. * @returns {module:ui/colorgrid/colorgrid~ColorGridView}
  51162. */
  51163. _createDocumentColorsGrid() {
  51164. const bind = ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__["Template"].bind( this.documentColors, this.documentColors );
  51165. const documentColorsGrid = new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__["ColorGridView"]( this.locale, {
  51166. columns: this.columns
  51167. } );
  51168. documentColorsGrid.delegate( 'execute' ).to( this );
  51169. documentColorsGrid.extendTemplate( {
  51170. attributes: {
  51171. class: bind.if( 'isEmpty', 'ck-hidden' )
  51172. }
  51173. } );
  51174. documentColorsGrid.items.bindTo( this.documentColors ).using(
  51175. colorObj => {
  51176. const colorTile = new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__["ColorTileView"]();
  51177. colorTile.set( {
  51178. color: colorObj.color,
  51179. hasBorder: colorObj.options && colorObj.options.hasBorder
  51180. } );
  51181. if ( colorObj.label ) {
  51182. colorTile.set( {
  51183. label: colorObj.label,
  51184. tooltip: true
  51185. } );
  51186. }
  51187. colorTile.on( 'execute', () => {
  51188. this.fire( 'execute', {
  51189. value: colorObj.color
  51190. } );
  51191. } );
  51192. return colorTile;
  51193. }
  51194. );
  51195. // Selected color should be cleared when document colors became empty.
  51196. this.documentColors.on( 'change:isEmpty', ( evt, name, val ) => {
  51197. if ( val ) {
  51198. documentColorsGrid.selectedColor = null;
  51199. }
  51200. } );
  51201. return documentColorsGrid;
  51202. }
  51203. /**
  51204. * Adds a given color to the document colors list. If possible, the method will attempt to use
  51205. * data from the {@link #colorDefinitions} (label, color options).
  51206. *
  51207. * @private
  51208. * @param {String} color A string that stores the value of the recently applied color.
  51209. */
  51210. _addColorToDocumentColors( color ) {
  51211. const predefinedColor = this.colorDefinitions
  51212. .find( definition => definition.color === color );
  51213. if ( !predefinedColor ) {
  51214. this.documentColors.add( {
  51215. color,
  51216. label: color,
  51217. options: {
  51218. hasBorder: false
  51219. }
  51220. } );
  51221. } else {
  51222. this.documentColors.add( Object.assign( {}, predefinedColor ) );
  51223. }
  51224. }
  51225. }
  51226. /***/ }),
  51227. /***/ "./node_modules/@ckeditor/ckeditor5-font/src/ui/colorui.js":
  51228. /*!*****************************************************************!*\
  51229. !*** ./node_modules/@ckeditor/ckeditor5-font/src/ui/colorui.js ***!
  51230. \*****************************************************************/
  51231. /*! exports provided: default */
  51232. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  51233. "use strict";
  51234. __webpack_require__.r(__webpack_exports__);
  51235. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ColorUI; });
  51236. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  51237. /* harmony import */ var ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/ui */ "./node_modules/ckeditor5/src/ui.js");
  51238. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils */ "./node_modules/@ckeditor/ckeditor5-font/src/utils.js");
  51239. /**
  51240. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  51241. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  51242. */
  51243. /**
  51244. * @module font/ui/colorui
  51245. */
  51246. /**
  51247. * The color UI plugin which isolates the common logic responsible for displaying dropdowns with color grids.
  51248. *
  51249. * It is used to create the `'fontBackgroundColor'` and `'fontColor'` dropdowns, each hosting
  51250. * a {@link module:font/ui/colortableview~ColorTableView}.
  51251. *
  51252. * @extends module:core/plugin~Plugin
  51253. */
  51254. class ColorUI extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  51255. /**
  51256. * Creates a plugin which introduces a dropdown with a pre–configured {@link module:font/ui/colortableview~ColorTableView}.
  51257. *
  51258. * @param {module:core/editor/editor~Editor} editor
  51259. * @param {Object} config The configuration object.
  51260. * @param {String} config.commandName The name of the command which will be executed when a color tile is clicked.
  51261. * @param {String} config.componentName The name of the dropdown in the {@link module:ui/componentfactory~ComponentFactory}
  51262. * and the configuration scope name in `editor.config`.
  51263. * @param {String} config.icon The SVG icon used by the dropdown.
  51264. * @param {String} config.dropdownLabel The label used by the dropdown.
  51265. */
  51266. constructor( editor, { commandName, icon, componentName, dropdownLabel } ) {
  51267. super( editor );
  51268. /**
  51269. * The name of the command which will be executed when a color tile is clicked.
  51270. *
  51271. * @type {String}
  51272. */
  51273. this.commandName = commandName;
  51274. /**
  51275. * The name of this component in the {@link module:ui/componentfactory~ComponentFactory}.
  51276. * Also the configuration scope name in `editor.config`.
  51277. *
  51278. * @type {String}
  51279. */
  51280. this.componentName = componentName;
  51281. /**
  51282. * The SVG icon used by the dropdown.
  51283. * @type {String}
  51284. */
  51285. this.icon = icon;
  51286. /**
  51287. * The label used by the dropdown.
  51288. *
  51289. * @type {String}
  51290. */
  51291. this.dropdownLabel = dropdownLabel;
  51292. /**
  51293. * The number of columns in the color grid.
  51294. *
  51295. * @type {Number}
  51296. */
  51297. this.columns = editor.config.get( `${ this.componentName }.columns` );
  51298. /**
  51299. * Keeps a reference to {@link module:font/ui/colortableview~ColorTableView}.
  51300. *
  51301. * @member {module:font/ui/colortableview~ColorTableView}
  51302. */
  51303. this.colorTableView = undefined;
  51304. }
  51305. /**
  51306. * @inheritDoc
  51307. */
  51308. init() {
  51309. const editor = this.editor;
  51310. const locale = editor.locale;
  51311. const t = locale.t;
  51312. const command = editor.commands.get( this.commandName );
  51313. const colorsConfig = Object(ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__["normalizeColorOptions"])( editor.config.get( this.componentName ).colors );
  51314. const localizedColors = Object(ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__["getLocalizedColorOptions"])( locale, colorsConfig );
  51315. const documentColorsCount = editor.config.get( `${ this.componentName }.documentColors` );
  51316. // Register the UI component.
  51317. editor.ui.componentFactory.add( this.componentName, locale => {
  51318. const dropdownView = Object(ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__["createDropdown"])( locale );
  51319. this.colorTableView = Object(_utils__WEBPACK_IMPORTED_MODULE_2__["addColorTableToDropdown"])( {
  51320. dropdownView,
  51321. colors: localizedColors.map( option => ( {
  51322. label: option.label,
  51323. color: option.model,
  51324. options: {
  51325. hasBorder: option.hasBorder
  51326. }
  51327. } ) ),
  51328. columns: this.columns,
  51329. removeButtonLabel: t( 'Remove color' ),
  51330. documentColorsLabel: documentColorsCount !== 0 ? t( 'Document colors' ) : undefined,
  51331. documentColorsCount: documentColorsCount === undefined ? this.columns : documentColorsCount
  51332. } );
  51333. this.colorTableView.bind( 'selectedColor' ).to( command, 'value' );
  51334. dropdownView.buttonView.set( {
  51335. label: this.dropdownLabel,
  51336. icon: this.icon,
  51337. tooltip: true
  51338. } );
  51339. dropdownView.extendTemplate( {
  51340. attributes: {
  51341. class: 'ck-color-ui-dropdown'
  51342. }
  51343. } );
  51344. dropdownView.bind( 'isEnabled' ).to( command );
  51345. dropdownView.on( 'execute', ( evt, data ) => {
  51346. editor.execute( this.commandName, data );
  51347. editor.editing.view.focus();
  51348. } );
  51349. dropdownView.on( 'change:isOpen', ( evt, name, isVisible ) => {
  51350. // Grids rendering is deferred (#6192).
  51351. dropdownView.colorTableView.appendGrids();
  51352. if ( isVisible ) {
  51353. if ( documentColorsCount !== 0 ) {
  51354. this.colorTableView.updateDocumentColors( editor.model, this.componentName );
  51355. }
  51356. this.colorTableView.updateSelectedColors();
  51357. }
  51358. } );
  51359. return dropdownView;
  51360. } );
  51361. }
  51362. }
  51363. /***/ }),
  51364. /***/ "./node_modules/@ckeditor/ckeditor5-font/src/utils.js":
  51365. /*!************************************************************!*\
  51366. !*** ./node_modules/@ckeditor/ckeditor5-font/src/utils.js ***!
  51367. \************************************************************/
  51368. /*! exports provided: FONT_SIZE, FONT_FAMILY, FONT_COLOR, FONT_BACKGROUND_COLOR, buildDefinition, renderUpcastAttribute, renderDowncastElement, addColorTableToDropdown */
  51369. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  51370. "use strict";
  51371. __webpack_require__.r(__webpack_exports__);
  51372. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FONT_SIZE", function() { return FONT_SIZE; });
  51373. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FONT_FAMILY", function() { return FONT_FAMILY; });
  51374. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FONT_COLOR", function() { return FONT_COLOR; });
  51375. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FONT_BACKGROUND_COLOR", function() { return FONT_BACKGROUND_COLOR; });
  51376. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "buildDefinition", function() { return buildDefinition; });
  51377. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderUpcastAttribute", function() { return renderUpcastAttribute; });
  51378. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderDowncastElement", function() { return renderDowncastElement; });
  51379. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addColorTableToDropdown", function() { return addColorTableToDropdown; });
  51380. /* harmony import */ var _ui_colortableview__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ui/colortableview */ "./node_modules/@ckeditor/ckeditor5-font/src/ui/colortableview.js");
  51381. /**
  51382. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  51383. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  51384. */
  51385. /**
  51386. * @module font/utils
  51387. */
  51388. /**
  51389. * The name of the font size plugin.
  51390. */
  51391. const FONT_SIZE = 'fontSize';
  51392. /**
  51393. * The name of the font family plugin.
  51394. */
  51395. const FONT_FAMILY = 'fontFamily';
  51396. /**
  51397. * The name of the font color plugin.
  51398. */
  51399. const FONT_COLOR = 'fontColor';
  51400. /**
  51401. * The name of the font background color plugin.
  51402. */
  51403. const FONT_BACKGROUND_COLOR = 'fontBackgroundColor';
  51404. /**
  51405. * Builds a proper {@link module:engine/conversion/conversion~ConverterDefinition converter definition} out of input data.
  51406. *
  51407. * @param {String} modelAttributeKey Key
  51408. * @param {Array.<module:font/fontfamily~FontFamilyOption>|Array.<module:font/fontsize~FontSizeOption>} options
  51409. * @returns {module:engine/conversion/conversion~ConverterDefinition}
  51410. */
  51411. function buildDefinition( modelAttributeKey, options ) {
  51412. const definition = {
  51413. model: {
  51414. key: modelAttributeKey,
  51415. values: []
  51416. },
  51417. view: {},
  51418. upcastAlso: {}
  51419. };
  51420. for ( const option of options ) {
  51421. definition.model.values.push( option.model );
  51422. definition.view[ option.model ] = option.view;
  51423. if ( option.upcastAlso ) {
  51424. definition.upcastAlso[ option.model ] = option.upcastAlso;
  51425. }
  51426. }
  51427. return definition;
  51428. }
  51429. /**
  51430. * A {@link module:font/fontcolor~FontColor font color} and
  51431. * {@link module:font/fontbackgroundcolor~FontBackgroundColor font background color} helper
  51432. * responsible for upcasting data to the model.
  51433. *
  51434. * **Note**: The `styleAttr` parameter should be either `'color'` or `'background-color'`.
  51435. *
  51436. * @param {String} styleAttr
  51437. * @return {String}
  51438. */
  51439. function renderUpcastAttribute( styleAttr ) {
  51440. return viewElement => normalizeColorCode( viewElement.getStyle( styleAttr ) );
  51441. }
  51442. /**
  51443. * A {@link module:font/fontcolor~FontColor font color} and
  51444. * {@link module:font/fontbackgroundcolor~FontBackgroundColor font background color} helper
  51445. * responsible for downcasting a color attribute to a `<span>` element.
  51446. *
  51447. * **Note**: The `styleAttr` parameter should be either `'color'` or `'background-color'`.
  51448. *
  51449. * @param {String} styleAttr
  51450. */
  51451. function renderDowncastElement( styleAttr ) {
  51452. return ( modelAttributeValue, { writer } ) => writer.createAttributeElement( 'span', {
  51453. style: `${ styleAttr }:${ modelAttributeValue }`
  51454. }, { priority: 7 } );
  51455. }
  51456. /**
  51457. * A helper that adds {@link module:font/ui/colortableview~ColorTableView} to the color dropdown with proper initial values.
  51458. *
  51459. * @param {Object} config The configuration object.
  51460. * @param {module:ui/dropdown/dropdownview~DropdownView} config.dropdownView The dropdown view to which
  51461. * a {@link module:font/ui/colortableview~ColorTableView} will be added.
  51462. * @param {Array.<module:ui/colorgrid/colorgrid~ColorDefinition>} config.colors An array with definitions
  51463. * representing colors to be displayed in the color table.
  51464. * @param {String} config.removeButtonLabel The label for the button responsible for removing the color.
  51465. * @param {String} config.documentColorsLabel The label for the section with document colors.
  51466. * @param {String} config.documentColorsCount The number of document colors inside the dropdown.
  51467. * @returns {module:font/ui/colortableview~ColorTableView} The new color table view.
  51468. */
  51469. function addColorTableToDropdown( { dropdownView, colors, columns, removeButtonLabel, documentColorsLabel, documentColorsCount } ) {
  51470. const locale = dropdownView.locale;
  51471. const colorTableView = new _ui_colortableview__WEBPACK_IMPORTED_MODULE_0__["default"]( locale, { colors, columns, removeButtonLabel, documentColorsLabel, documentColorsCount } );
  51472. dropdownView.colorTableView = colorTableView;
  51473. dropdownView.panelView.children.add( colorTableView );
  51474. colorTableView.delegate( 'execute' ).to( dropdownView, 'execute' );
  51475. return colorTableView;
  51476. }
  51477. // Fixes the color value string.
  51478. //
  51479. // @param {String} value
  51480. // @returns {String}
  51481. function normalizeColorCode( value ) {
  51482. return value.replace( /\s/g, '' );
  51483. }
  51484. /***/ }),
  51485. /***/ "./node_modules/@ckeditor/ckeditor5-font/theme/fontcolor.css":
  51486. /*!*******************************************************************!*\
  51487. !*** ./node_modules/@ckeditor/ckeditor5-font/theme/fontcolor.css ***!
  51488. \*******************************************************************/
  51489. /*! no static exports found */
  51490. /***/ (function(module, exports, __webpack_require__) {
  51491. var api = __webpack_require__(/*! ../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  51492. 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");
  51493. content = content.__esModule ? content.default : content;
  51494. if (typeof content === 'string') {
  51495. content = [[module.i, content, '']];
  51496. }
  51497. var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
  51498. options.insert = "head";
  51499. options.singleton = true;
  51500. var update = api(content, options);
  51501. module.exports = content.locals || {};
  51502. /***/ }),
  51503. /***/ "./node_modules/@ckeditor/ckeditor5-font/theme/icons/font-background.svg":
  51504. /*!*******************************************************************************!*\
  51505. !*** ./node_modules/@ckeditor/ckeditor5-font/theme/icons/font-background.svg ***!
  51506. \*******************************************************************************/
  51507. /*! exports provided: default */
  51508. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  51509. "use strict";
  51510. __webpack_require__.r(__webpack_exports__);
  51511. /* 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>");
  51512. /***/ }),
  51513. /***/ "./node_modules/@ckeditor/ckeditor5-font/theme/icons/font-color.svg":
  51514. /*!**************************************************************************!*\
  51515. !*** ./node_modules/@ckeditor/ckeditor5-font/theme/icons/font-color.svg ***!
  51516. \**************************************************************************/
  51517. /*! exports provided: default */
  51518. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  51519. "use strict";
  51520. __webpack_require__.r(__webpack_exports__);
  51521. /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M12.4 10.3 10 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>");
  51522. /***/ }),
  51523. /***/ "./node_modules/@ckeditor/ckeditor5-heading/src/heading.js":
  51524. /*!*****************************************************************!*\
  51525. !*** ./node_modules/@ckeditor/ckeditor5-heading/src/heading.js ***!
  51526. \*****************************************************************/
  51527. /*! exports provided: default */
  51528. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  51529. "use strict";
  51530. __webpack_require__.r(__webpack_exports__);
  51531. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Heading; });
  51532. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  51533. /* harmony import */ var _headingediting__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./headingediting */ "./node_modules/@ckeditor/ckeditor5-heading/src/headingediting.js");
  51534. /* harmony import */ var _headingui__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./headingui */ "./node_modules/@ckeditor/ckeditor5-heading/src/headingui.js");
  51535. /* harmony import */ var _theme_heading_css__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../theme/heading.css */ "./node_modules/@ckeditor/ckeditor5-heading/theme/heading.css");
  51536. /* harmony import */ var _theme_heading_css__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_theme_heading_css__WEBPACK_IMPORTED_MODULE_3__);
  51537. /**
  51538. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  51539. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  51540. */
  51541. /**
  51542. * @module heading/heading
  51543. */
  51544. /**
  51545. * The headings feature.
  51546. *
  51547. * For a detailed overview, check the {@glink features/headings Headings feature documentation}
  51548. * and the {@glink api/heading package page}.
  51549. *
  51550. * This is a "glue" plugin which loads the {@link module:heading/headingediting~HeadingEditing heading editing feature}
  51551. * and {@link module:heading/headingui~HeadingUI heading UI feature}.
  51552. *
  51553. * @extends module:core/plugin~Plugin
  51554. */
  51555. class Heading extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  51556. /**
  51557. * @inheritDoc
  51558. */
  51559. static get requires() {
  51560. return [ _headingediting__WEBPACK_IMPORTED_MODULE_1__["default"], _headingui__WEBPACK_IMPORTED_MODULE_2__["default"] ];
  51561. }
  51562. /**
  51563. * @inheritDoc
  51564. */
  51565. static get pluginName() {
  51566. return 'Heading';
  51567. }
  51568. }
  51569. /**
  51570. * The configuration of the heading feature. Introduced by the {@link module:heading/headingediting~HeadingEditing} feature.
  51571. *
  51572. * Read more in {@link module:heading/heading~HeadingConfig}.
  51573. *
  51574. * @member {module:heading/heading~HeadingConfig} module:core/editor/editorconfig~EditorConfig#heading
  51575. */
  51576. /**
  51577. * The configuration of the heading feature.
  51578. * The option is used by the {@link module:heading/headingediting~HeadingEditing} feature.
  51579. *
  51580. * ClassicEditor
  51581. * .create( {
  51582. * heading: ... // Heading feature config.
  51583. * } )
  51584. * .then( ... )
  51585. * .catch( ... );
  51586. *
  51587. * See {@link module:core/editor/editorconfig~EditorConfig all editor options}.
  51588. *
  51589. * @interface HeadingConfig
  51590. */
  51591. /**
  51592. * The available heading options.
  51593. *
  51594. * The default value is:
  51595. *
  51596. * const headingConfig = {
  51597. * options: [
  51598. * { model: 'paragraph', title: 'Paragraph', class: 'ck-heading_paragraph' },
  51599. * { model: 'heading1', view: 'h2', title: 'Heading 1', class: 'ck-heading_heading1' },
  51600. * { model: 'heading2', view: 'h3', title: 'Heading 2', class: 'ck-heading_heading2' },
  51601. * { model: 'heading3', view: 'h4', title: 'Heading 3', class: 'ck-heading_heading3' }
  51602. * ]
  51603. * };
  51604. *
  51605. * It defines 3 levels of headings. In the editor model they will use `heading1`, `heading2`, and `heading3` elements.
  51606. * Their respective view elements (so the elements output by the editor) will be: `h2`, `h3`, and `h4`. This means that
  51607. * if you choose "Heading 1" in the headings dropdown the editor will turn the current block to `<heading1>` in the model
  51608. * which will result in rendering (and outputting to data) the `<h2>` element.
  51609. *
  51610. * The `title` and `class` properties will be used by the `headings` dropdown to render available options.
  51611. * Usually, the first option in the headings dropdown is the "Paragraph" option, hence it's also defined on the list.
  51612. * However, you don't need to define its view representation because it's handled by
  51613. * the {@link module:paragraph/paragraph~Paragraph} feature (which is required by
  51614. * the {@link module:heading/headingediting~HeadingEditing} feature).
  51615. *
  51616. * You can **read more** about configuring heading levels and **see more examples** in
  51617. * the {@glink features/headings Headings} guide.
  51618. *
  51619. * Note: In the model you should always start from `heading1`, regardless of how the headings are represented in the view.
  51620. * That's assumption is used by features like {@link module:autoformat/autoformat~Autoformat} to know which element
  51621. * they should use when applying the first level heading.
  51622. *
  51623. * The defined headings are also available as values passed to the `'heading'` command under their model names.
  51624. * For example, the below code will apply `<heading1>` to the current selection:
  51625. *
  51626. * editor.execute( 'heading', { value: 'heading1' } );
  51627. *
  51628. * @member {Array.<module:heading/heading~HeadingOption>} module:heading/heading~HeadingConfig#options
  51629. */
  51630. /**
  51631. * Heading option descriptor.
  51632. *
  51633. * @typedef {Object} module:heading/heading~HeadingOption
  51634. * @property {String} model Name of the model element to convert.
  51635. * @property {module:engine/view/elementdefinition~ElementDefinition} view Definition of a view element to convert from/to.
  51636. * @property {String} title The user-readable title of the option.
  51637. * @property {String} class The class which will be added to the dropdown item representing this option.
  51638. * @property {String} [icon] Icon used by {@link module:heading/headingbuttonsui~HeadingButtonsUI}. It can be omitted when using
  51639. * the default configuration.
  51640. * @extends module:engine/conversion/conversion~ConverterDefinition
  51641. */
  51642. /***/ }),
  51643. /***/ "./node_modules/@ckeditor/ckeditor5-heading/src/headingcommand.js":
  51644. /*!************************************************************************!*\
  51645. !*** ./node_modules/@ckeditor/ckeditor5-heading/src/headingcommand.js ***!
  51646. \************************************************************************/
  51647. /*! exports provided: default */
  51648. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  51649. "use strict";
  51650. __webpack_require__.r(__webpack_exports__);
  51651. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return HeadingCommand; });
  51652. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  51653. /* harmony import */ var ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/utils */ "./node_modules/ckeditor5/src/utils.js");
  51654. /**
  51655. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  51656. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  51657. */
  51658. /**
  51659. * @module heading/headingcommand
  51660. */
  51661. /**
  51662. * The heading command. It is used by the {@link module:heading/heading~Heading heading feature} to apply headings.
  51663. *
  51664. * @extends module:core/command~Command
  51665. */
  51666. class HeadingCommand extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Command"] {
  51667. /**
  51668. * Creates an instance of the command.
  51669. *
  51670. * @param {module:core/editor/editor~Editor} editor Editor instance.
  51671. * @param {Array.<String>} modelElements Names of the element which this command can apply in the model.
  51672. */
  51673. constructor( editor, modelElements ) {
  51674. super( editor );
  51675. /**
  51676. * If the selection starts in a heading (which {@link #modelElements is supported by this command})
  51677. * the value is set to the name of that heading model element.
  51678. * It is set to `false` otherwise.
  51679. *
  51680. * @observable
  51681. * @readonly
  51682. * @member {Boolean|String} #value
  51683. */
  51684. /**
  51685. * Set of defined model's elements names that this command support.
  51686. * See {@link module:heading/heading~HeadingOption}.
  51687. *
  51688. * @readonly
  51689. * @member {Array.<String>}
  51690. */
  51691. this.modelElements = modelElements;
  51692. }
  51693. /**
  51694. * @inheritDoc
  51695. */
  51696. refresh() {
  51697. const block = Object(ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_1__["first"])( this.editor.model.document.selection.getSelectedBlocks() );
  51698. this.value = !!block && this.modelElements.includes( block.name ) && block.name;
  51699. this.isEnabled = !!block && this.modelElements.some( heading => checkCanBecomeHeading( block, heading, this.editor.model.schema ) );
  51700. }
  51701. /**
  51702. * Executes the command. Applies the heading to the selected blocks or, if the first selected
  51703. * block is a heading already, turns selected headings (of this level only) to paragraphs.
  51704. *
  51705. * @param {Object} options
  51706. * @param {String} options.value Name of the element which this command will apply in the model.
  51707. * @fires execute
  51708. */
  51709. execute( options ) {
  51710. const model = this.editor.model;
  51711. const document = model.document;
  51712. const modelElement = options.value;
  51713. model.change( writer => {
  51714. const blocks = Array.from( document.selection.getSelectedBlocks() )
  51715. .filter( block => {
  51716. return checkCanBecomeHeading( block, modelElement, model.schema );
  51717. } );
  51718. for ( const block of blocks ) {
  51719. if ( !block.is( 'element', modelElement ) ) {
  51720. writer.rename( block, modelElement );
  51721. }
  51722. }
  51723. } );
  51724. }
  51725. }
  51726. // Checks whether the given block can be replaced by a specific heading.
  51727. //
  51728. // @private
  51729. // @param {module:engine/model/element~Element} block A block to be tested.
  51730. // @param {module:heading/headingcommand~HeadingCommand#modelElement} heading Command element name in the model.
  51731. // @param {module:engine/model/schema~Schema} schema The schema of the document.
  51732. // @returns {Boolean}
  51733. function checkCanBecomeHeading( block, heading, schema ) {
  51734. return schema.checkChild( block.parent, heading ) && !schema.isObject( block );
  51735. }
  51736. /***/ }),
  51737. /***/ "./node_modules/@ckeditor/ckeditor5-heading/src/headingediting.js":
  51738. /*!************************************************************************!*\
  51739. !*** ./node_modules/@ckeditor/ckeditor5-heading/src/headingediting.js ***!
  51740. \************************************************************************/
  51741. /*! exports provided: default */
  51742. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  51743. "use strict";
  51744. __webpack_require__.r(__webpack_exports__);
  51745. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return HeadingEditing; });
  51746. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  51747. /* harmony import */ var ckeditor5_src_paragraph__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/paragraph */ "./node_modules/ckeditor5/src/paragraph.js");
  51748. /* harmony import */ var ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ckeditor5/src/utils */ "./node_modules/ckeditor5/src/utils.js");
  51749. /* harmony import */ var _headingcommand__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./headingcommand */ "./node_modules/@ckeditor/ckeditor5-heading/src/headingcommand.js");
  51750. /**
  51751. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  51752. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  51753. */
  51754. /**
  51755. * @module heading/headingediting
  51756. */
  51757. const defaultModelElement = 'paragraph';
  51758. /**
  51759. * The headings engine feature. It handles switching between block formats &ndash; headings and paragraph.
  51760. * This class represents the engine part of the heading feature. See also {@link module:heading/heading~Heading}.
  51761. * It introduces `heading1`-`headingN` commands which allow to convert paragraphs into headings.
  51762. *
  51763. * @extends module:core/plugin~Plugin
  51764. */
  51765. class HeadingEditing extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  51766. /**
  51767. * @inheritDoc
  51768. */
  51769. static get pluginName() {
  51770. return 'HeadingEditing';
  51771. }
  51772. /**
  51773. * @inheritDoc
  51774. */
  51775. constructor( editor ) {
  51776. super( editor );
  51777. editor.config.define( 'heading', {
  51778. options: [
  51779. { model: 'paragraph', title: 'Paragraph', class: 'ck-heading_paragraph' },
  51780. { model: 'heading1', view: 'h2', title: 'Heading 1', class: 'ck-heading_heading1' },
  51781. { model: 'heading2', view: 'h3', title: 'Heading 2', class: 'ck-heading_heading2' },
  51782. { model: 'heading3', view: 'h4', title: 'Heading 3', class: 'ck-heading_heading3' }
  51783. ]
  51784. } );
  51785. }
  51786. /**
  51787. * @inheritDoc
  51788. */
  51789. static get requires() {
  51790. return [ ckeditor5_src_paragraph__WEBPACK_IMPORTED_MODULE_1__["Paragraph"] ];
  51791. }
  51792. /**
  51793. * @inheritDoc
  51794. */
  51795. init() {
  51796. const editor = this.editor;
  51797. const options = editor.config.get( 'heading.options' );
  51798. const modelElements = [];
  51799. for ( const option of options ) {
  51800. // Skip paragraph - it is defined in required Paragraph feature.
  51801. if ( option.model !== defaultModelElement ) {
  51802. // Schema.
  51803. editor.model.schema.register( option.model, {
  51804. inheritAllFrom: '$block'
  51805. } );
  51806. editor.conversion.elementToElement( option );
  51807. modelElements.push( option.model );
  51808. }
  51809. }
  51810. this._addDefaultH1Conversion( editor );
  51811. // Register the heading command for this option.
  51812. editor.commands.add( 'heading', new _headingcommand__WEBPACK_IMPORTED_MODULE_3__["default"]( editor, modelElements ) );
  51813. }
  51814. /**
  51815. * @inheritDoc
  51816. */
  51817. afterInit() {
  51818. // If the enter command is added to the editor, alter its behavior.
  51819. // Enter at the end of a heading element should create a paragraph.
  51820. const editor = this.editor;
  51821. const enterCommand = editor.commands.get( 'enter' );
  51822. const options = editor.config.get( 'heading.options' );
  51823. if ( enterCommand ) {
  51824. this.listenTo( enterCommand, 'afterExecute', ( evt, data ) => {
  51825. const positionParent = editor.model.document.selection.getFirstPosition().parent;
  51826. const isHeading = options.some( option => positionParent.is( 'element', option.model ) );
  51827. if ( isHeading && !positionParent.is( 'element', defaultModelElement ) && positionParent.childCount === 0 ) {
  51828. data.writer.rename( positionParent, defaultModelElement );
  51829. }
  51830. } );
  51831. }
  51832. }
  51833. /**
  51834. * Adds default conversion for `h1` -> `heading1` with a low priority.
  51835. *
  51836. * @private
  51837. * @param {module:core/editor/editor~Editor} editor Editor instance on which to add the `h1` conversion.
  51838. */
  51839. _addDefaultH1Conversion( editor ) {
  51840. editor.conversion.for( 'upcast' ).elementToElement( {
  51841. model: 'heading1',
  51842. view: 'h1',
  51843. // With a `low` priority, `paragraph` plugin autoparagraphing mechanism is executed. Make sure
  51844. // this listener is called before it. If not, `h1` will be transformed into a paragraph.
  51845. converterPriority: ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_2__["priorities"].get( 'low' ) + 1
  51846. } );
  51847. }
  51848. }
  51849. /***/ }),
  51850. /***/ "./node_modules/@ckeditor/ckeditor5-heading/src/headingui.js":
  51851. /*!*******************************************************************!*\
  51852. !*** ./node_modules/@ckeditor/ckeditor5-heading/src/headingui.js ***!
  51853. \*******************************************************************/
  51854. /*! exports provided: default */
  51855. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  51856. "use strict";
  51857. __webpack_require__.r(__webpack_exports__);
  51858. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return HeadingUI; });
  51859. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  51860. /* harmony import */ var ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/ui */ "./node_modules/ckeditor5/src/ui.js");
  51861. /* harmony import */ var ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ckeditor5/src/utils */ "./node_modules/ckeditor5/src/utils.js");
  51862. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils */ "./node_modules/@ckeditor/ckeditor5-heading/src/utils.js");
  51863. /* harmony import */ var _theme_heading_css__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../theme/heading.css */ "./node_modules/@ckeditor/ckeditor5-heading/theme/heading.css");
  51864. /* harmony import */ var _theme_heading_css__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_theme_heading_css__WEBPACK_IMPORTED_MODULE_4__);
  51865. /**
  51866. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  51867. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  51868. */
  51869. /**
  51870. * @module heading/headingui
  51871. */
  51872. /**
  51873. * The headings UI feature. It introduces the `headings` dropdown.
  51874. *
  51875. * @extends module:core/plugin~Plugin
  51876. */
  51877. class HeadingUI extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  51878. /**
  51879. * @inheritDoc
  51880. */
  51881. static get pluginName() {
  51882. return 'HeadingUI';
  51883. }
  51884. /**
  51885. * @inheritDoc
  51886. */
  51887. init() {
  51888. const editor = this.editor;
  51889. const t = editor.t;
  51890. const options = Object(_utils__WEBPACK_IMPORTED_MODULE_3__["getLocalizedOptions"])( editor );
  51891. const defaultTitle = t( 'Choose heading' );
  51892. const dropdownTooltip = t( 'Heading' );
  51893. // Register UI component.
  51894. editor.ui.componentFactory.add( 'heading', locale => {
  51895. const titles = {};
  51896. const itemDefinitions = new ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_2__["Collection"]();
  51897. const headingCommand = editor.commands.get( 'heading' );
  51898. const paragraphCommand = editor.commands.get( 'paragraph' );
  51899. const commands = [ headingCommand ];
  51900. for ( const option of options ) {
  51901. const def = {
  51902. type: 'button',
  51903. model: new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__["Model"]( {
  51904. label: option.title,
  51905. class: option.class,
  51906. withText: true
  51907. } )
  51908. };
  51909. if ( option.model === 'paragraph' ) {
  51910. def.model.bind( 'isOn' ).to( paragraphCommand, 'value' );
  51911. def.model.set( 'commandName', 'paragraph' );
  51912. commands.push( paragraphCommand );
  51913. } else {
  51914. def.model.bind( 'isOn' ).to( headingCommand, 'value', value => value === option.model );
  51915. def.model.set( {
  51916. commandName: 'heading',
  51917. commandValue: option.model
  51918. } );
  51919. }
  51920. // Add the option to the collection.
  51921. itemDefinitions.add( def );
  51922. titles[ option.model ] = option.title;
  51923. }
  51924. const dropdownView = Object(ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__["createDropdown"])( locale );
  51925. Object(ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__["addListToDropdown"])( dropdownView, itemDefinitions );
  51926. dropdownView.buttonView.set( {
  51927. isOn: false,
  51928. withText: true,
  51929. tooltip: dropdownTooltip
  51930. } );
  51931. dropdownView.extendTemplate( {
  51932. attributes: {
  51933. class: [
  51934. 'ck-heading-dropdown'
  51935. ]
  51936. }
  51937. } );
  51938. dropdownView.bind( 'isEnabled' ).toMany( commands, 'isEnabled', ( ...areEnabled ) => {
  51939. return areEnabled.some( isEnabled => isEnabled );
  51940. } );
  51941. dropdownView.buttonView.bind( 'label' ).to( headingCommand, 'value', paragraphCommand, 'value', ( value, para ) => {
  51942. const whichModel = value || para && 'paragraph';
  51943. // If none of the commands is active, display default title.
  51944. return titles[ whichModel ] ? titles[ whichModel ] : defaultTitle;
  51945. } );
  51946. // Execute command when an item from the dropdown is selected.
  51947. this.listenTo( dropdownView, 'execute', evt => {
  51948. editor.execute( evt.source.commandName, evt.source.commandValue ? { value: evt.source.commandValue } : undefined );
  51949. editor.editing.view.focus();
  51950. } );
  51951. return dropdownView;
  51952. } );
  51953. }
  51954. }
  51955. /***/ }),
  51956. /***/ "./node_modules/@ckeditor/ckeditor5-heading/src/utils.js":
  51957. /*!***************************************************************!*\
  51958. !*** ./node_modules/@ckeditor/ckeditor5-heading/src/utils.js ***!
  51959. \***************************************************************/
  51960. /*! exports provided: getLocalizedOptions */
  51961. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  51962. "use strict";
  51963. __webpack_require__.r(__webpack_exports__);
  51964. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getLocalizedOptions", function() { return getLocalizedOptions; });
  51965. /**
  51966. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  51967. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  51968. */
  51969. /**
  51970. * @module heading/utils
  51971. */
  51972. /**
  51973. * Returns heading options as defined in `config.heading.options` but processed to consider
  51974. * the editor localization, i.e. to display {@link module:heading/heading~HeadingOption}
  51975. * in the correct language.
  51976. *
  51977. * Note: The reason behind this method is that there is no way to use {@link module:utils/locale~Locale#t}
  51978. * when the user configuration is defined because the editor does not exist yet.
  51979. *
  51980. * @param {module:core/editor/editor~Editor} editor
  51981. * @returns {Array.<module:heading/heading~HeadingOption>}.
  51982. */
  51983. function getLocalizedOptions( editor ) {
  51984. const t = editor.t;
  51985. const localizedTitles = {
  51986. Paragraph: t( 'Paragraph' ),
  51987. 'Heading 1': t( 'Heading 1' ),
  51988. 'Heading 2': t( 'Heading 2' ),
  51989. 'Heading 3': t( 'Heading 3' ),
  51990. 'Heading 4': t( 'Heading 4' ),
  51991. 'Heading 5': t( 'Heading 5' ),
  51992. 'Heading 6': t( 'Heading 6' )
  51993. };
  51994. return editor.config.get( 'heading.options' ).map( option => {
  51995. const title = localizedTitles[ option.title ];
  51996. if ( title && title != option.title ) {
  51997. option.title = title;
  51998. }
  51999. return option;
  52000. } );
  52001. }
  52002. /***/ }),
  52003. /***/ "./node_modules/@ckeditor/ckeditor5-heading/theme/heading.css":
  52004. /*!********************************************************************!*\
  52005. !*** ./node_modules/@ckeditor/ckeditor5-heading/theme/heading.css ***!
  52006. \********************************************************************/
  52007. /*! no static exports found */
  52008. /***/ (function(module, exports, __webpack_require__) {
  52009. var api = __webpack_require__(/*! ../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  52010. 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");
  52011. content = content.__esModule ? content.default : content;
  52012. if (typeof content === 'string') {
  52013. content = [[module.i, content, '']];
  52014. }
  52015. var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
  52016. options.insert = "head";
  52017. options.singleton = true;
  52018. var update = api(content, options);
  52019. module.exports = content.locals || {};
  52020. /***/ }),
  52021. /***/ "./node_modules/@ckeditor/ckeditor5-html-embed/src/htmlembed.js":
  52022. /*!**********************************************************************!*\
  52023. !*** ./node_modules/@ckeditor/ckeditor5-html-embed/src/htmlembed.js ***!
  52024. \**********************************************************************/
  52025. /*! exports provided: default */
  52026. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  52027. "use strict";
  52028. __webpack_require__.r(__webpack_exports__);
  52029. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return HtmlEmbed; });
  52030. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  52031. /* harmony import */ var ckeditor5_src_widget__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/widget */ "./node_modules/ckeditor5/src/widget.js");
  52032. /* harmony import */ var _htmlembedediting__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./htmlembedediting */ "./node_modules/@ckeditor/ckeditor5-html-embed/src/htmlembedediting.js");
  52033. /* harmony import */ var _htmlembedui__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./htmlembedui */ "./node_modules/@ckeditor/ckeditor5-html-embed/src/htmlembedui.js");
  52034. /**
  52035. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  52036. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  52037. */
  52038. /**
  52039. * @module html-embed/htmlembed
  52040. */
  52041. /**
  52042. * The HTML embed feature.
  52043. *
  52044. * It allows inserting HTML snippets directly into the editor.
  52045. *
  52046. * For a detailed overview, check the {@glink features/html-embed HTML embed feature} documentation.
  52047. *
  52048. * @extends module:core/plugin~Plugin
  52049. */
  52050. class HtmlEmbed extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  52051. /**
  52052. * @inheritDoc
  52053. */
  52054. static get requires() {
  52055. return [ _htmlembedediting__WEBPACK_IMPORTED_MODULE_2__["default"], _htmlembedui__WEBPACK_IMPORTED_MODULE_3__["default"], ckeditor5_src_widget__WEBPACK_IMPORTED_MODULE_1__["Widget"] ];
  52056. }
  52057. /**
  52058. * @inheritDoc
  52059. */
  52060. static get pluginName() {
  52061. return 'HtmlEmbed';
  52062. }
  52063. }
  52064. /**
  52065. * The configuration of the HTML embed feature.
  52066. *
  52067. * ClassicEditor
  52068. * .create( editorElement, {
  52069. * htmlEmbed: ... // HTML embed feature options.
  52070. * } )
  52071. * .then( ... )
  52072. * .catch( ... );
  52073. *
  52074. * See {@link module:core/editor/editorconfig~EditorConfig all editor options}.
  52075. *
  52076. * @interface HtmlEmbedConfig
  52077. */
  52078. /**
  52079. * Whether the feature should render previews of the embedded HTML.
  52080. *
  52081. * When set to `true`, the feature will produce a preview of the inserted HTML based on a sanitized
  52082. * version of the HTML provided by the user.
  52083. *
  52084. * The function responsible for sanitizing the HTML needs to be specified in
  52085. * {@link module:html-embed/htmlembed~HtmlEmbedConfig#sanitizeHtml `config.htmlEmbed.sanitizeHtml()`}.
  52086. *
  52087. * Read more about the security aspect of this feature in the {@glink features/html-embed#security "Security"} section of
  52088. * the {@glink features/html-embed HTML embed} feature guide.
  52089. *
  52090. * @member {Boolean} [module:html-embed/htmlembed~HtmlEmbedConfig#showPreviews=false]
  52091. */
  52092. /**
  52093. * Callback used to sanitize the HTML provided by the user when generating previews of it in the editor.
  52094. *
  52095. * We strongly recommend overwriting the default function to avoid XSS vulnerabilities.
  52096. *
  52097. * Read more about the security aspect of this feature in the {@glink features/html-embed#security "Security"} section of
  52098. * the {@glink features/html-embed HTML embed} feature guide.
  52099. *
  52100. * The function receives the input HTML (as a string), and should return an object
  52101. * that matches the {@link module:html-embed/htmlembed~HtmlEmbedSanitizeOutput} interface.
  52102. *
  52103. * ClassicEditor
  52104. * .create( editorElement, {
  52105. * htmlEmbed: {
  52106. * showPreviews: true,
  52107. * sanitizeHtml( inputHtml ) {
  52108. * // Strip unsafe elements and attributes, e.g.:
  52109. * // the `<script>` elements and `on*` attributes.
  52110. * const outputHtml = sanitize( inputHtml );
  52111. *
  52112. * return {
  52113. * html: outputHtml,
  52114. * // true or false depending on whether the sanitizer stripped anything.
  52115. * hasChanged: ...
  52116. * };
  52117. * },
  52118. * }
  52119. * } )
  52120. * .then( ... )
  52121. * .catch( ... );
  52122. *
  52123. * **Note:** The function is used only when the feature
  52124. * {@link module:html-embed/htmlembed~HtmlEmbedConfig#showPreviews is configured to render previews}.
  52125. *
  52126. * @member {Function} [module:html-embed/htmlembed~HtmlEmbedConfig#sanitizeHtml]
  52127. */
  52128. /**
  52129. * An object returned by the {@link module:html-embed/htmlembed~HtmlEmbedConfig#sanitizeHtml} function.
  52130. *
  52131. * @interface HtmlEmbedSanitizeOutput
  52132. */
  52133. /**
  52134. * An output (safe) HTML that will be inserted into the {@glink framework/guides/architecture/editing-engine editing view}.
  52135. *
  52136. * @member {String} module:html-embed/htmlembed~HtmlEmbedSanitizeOutput#html
  52137. */
  52138. /**
  52139. * A flag that indicates whether the output HTML is different than the input value.
  52140. *
  52141. * @member {Boolean} [module:html-embed/htmlembed~HtmlEmbedSanitizeOutput#hasChanged]
  52142. */
  52143. /***/ }),
  52144. /***/ "./node_modules/@ckeditor/ckeditor5-html-embed/src/htmlembedediting.js":
  52145. /*!*****************************************************************************!*\
  52146. !*** ./node_modules/@ckeditor/ckeditor5-html-embed/src/htmlembedediting.js ***!
  52147. \*****************************************************************************/
  52148. /*! exports provided: default */
  52149. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  52150. "use strict";
  52151. __webpack_require__.r(__webpack_exports__);
  52152. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return HtmlEmbedEditing; });
  52153. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  52154. /* harmony import */ var ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/ui */ "./node_modules/ckeditor5/src/ui.js");
  52155. /* harmony import */ var ckeditor5_src_widget__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ckeditor5/src/widget */ "./node_modules/ckeditor5/src/widget.js");
  52156. /* harmony import */ var ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ckeditor5/src/utils */ "./node_modules/ckeditor5/src/utils.js");
  52157. /* harmony import */ var _inserthtmlembedcommand__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./inserthtmlembedcommand */ "./node_modules/@ckeditor/ckeditor5-html-embed/src/inserthtmlembedcommand.js");
  52158. /* harmony import */ var _updatehtmlembedcommand__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./updatehtmlembedcommand */ "./node_modules/@ckeditor/ckeditor5-html-embed/src/updatehtmlembedcommand.js");
  52159. /* harmony import */ var _theme_htmlembed_css__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../theme/htmlembed.css */ "./node_modules/@ckeditor/ckeditor5-html-embed/theme/htmlembed.css");
  52160. /* harmony import */ var _theme_htmlembed_css__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_theme_htmlembed_css__WEBPACK_IMPORTED_MODULE_6__);
  52161. /**
  52162. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  52163. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  52164. */
  52165. /**
  52166. * @module html-embed/htmlembedediting
  52167. */
  52168. /**
  52169. * The HTML embed editing feature.
  52170. *
  52171. * @extends module:core/plugin~Plugin
  52172. */
  52173. class HtmlEmbedEditing extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  52174. /**
  52175. * @inheritDoc
  52176. */
  52177. static get pluginName() {
  52178. return 'HtmlEmbedEditing';
  52179. }
  52180. /**
  52181. * @inheritDoc
  52182. */
  52183. constructor( editor ) {
  52184. super( editor );
  52185. editor.config.define( 'htmlEmbed', {
  52186. showPreviews: false,
  52187. sanitizeHtml: rawHtml => {
  52188. /**
  52189. * When using the HTML embed feature with the `htmlEmbed.showPreviews=true` option, it is strongly recommended to
  52190. * define a sanitize function that will clean up the input HTML in order to avoid XSS vulnerability.
  52191. *
  52192. * For a detailed overview, check the {@glink features/html-embed HTML embed feature} documentation.
  52193. *
  52194. * @error html-embed-provide-sanitize-function
  52195. */
  52196. Object(ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_3__["logWarning"])( 'html-embed-provide-sanitize-function' );
  52197. return {
  52198. html: rawHtml,
  52199. hasChanged: false
  52200. };
  52201. }
  52202. } );
  52203. }
  52204. /**
  52205. * @inheritDoc
  52206. */
  52207. init() {
  52208. const editor = this.editor;
  52209. const schema = editor.model.schema;
  52210. schema.register( 'rawHtml', {
  52211. isObject: true,
  52212. allowWhere: '$block',
  52213. allowAttributes: [ 'value' ]
  52214. } );
  52215. editor.commands.add( 'updateHtmlEmbed', new _updatehtmlembedcommand__WEBPACK_IMPORTED_MODULE_5__["default"]( editor ) );
  52216. editor.commands.add( 'insertHtmlEmbed', new _inserthtmlembedcommand__WEBPACK_IMPORTED_MODULE_4__["default"]( editor ) );
  52217. this._setupConversion();
  52218. }
  52219. /**
  52220. * Prepares converters for the feature.
  52221. *
  52222. * @private
  52223. */
  52224. _setupConversion() {
  52225. const editor = this.editor;
  52226. const t = editor.t;
  52227. const view = editor.editing.view;
  52228. const htmlEmbedConfig = editor.config.get( 'htmlEmbed' );
  52229. // Register div.raw-html-embed as a raw content element so all of it's content will be provided
  52230. // as a view element's custom property while data upcasting.
  52231. editor.data.registerRawContentMatcher( {
  52232. name: 'div',
  52233. classes: 'raw-html-embed'
  52234. } );
  52235. editor.conversion.for( 'upcast' ).elementToElement( {
  52236. view: {
  52237. name: 'div',
  52238. classes: 'raw-html-embed'
  52239. },
  52240. model: ( viewElement, { writer } ) => {
  52241. // The div.raw-html-embed is registered as a raw content element,
  52242. // so all it's content is available in a custom property.
  52243. return writer.createElement( 'rawHtml', {
  52244. value: viewElement.getCustomProperty( '$rawContent' )
  52245. } );
  52246. }
  52247. } );
  52248. editor.conversion.for( 'dataDowncast' ).elementToElement( {
  52249. model: 'rawHtml',
  52250. view: ( modelElement, { writer } ) => {
  52251. return writer.createRawElement( 'div', { class: 'raw-html-embed' }, function( domElement ) {
  52252. domElement.innerHTML = modelElement.getAttribute( 'value' ) || '';
  52253. } );
  52254. }
  52255. } );
  52256. editor.conversion.for( 'editingDowncast' ).elementToElement( {
  52257. triggerBy: {
  52258. attributes: [ 'value' ]
  52259. },
  52260. model: 'rawHtml',
  52261. view: ( modelElement, { writer } ) => {
  52262. let domContentWrapper, state, props;
  52263. const viewContainer = writer.createContainerElement( 'div', {
  52264. class: 'raw-html-embed',
  52265. 'data-html-embed-label': t( 'HTML snippet' ),
  52266. dir: editor.locale.uiLanguageDirection
  52267. } );
  52268. // Widget cannot be a raw element because the widget system would not be able
  52269. // to add its UI to it. Thus, we need this wrapper.
  52270. const viewContentWrapper = writer.createRawElement( 'div', {
  52271. class: 'raw-html-embed__content-wrapper'
  52272. }, function( domElement ) {
  52273. domContentWrapper = domElement;
  52274. renderContent( { domElement, editor, state, props } );
  52275. // Since there is a `data-cke-ignore-events` attribute set on the wrapper element in the editable mode,
  52276. // the explicit `mousedown` handler on the `capture` phase is needed to move the selection onto the whole
  52277. // HTML embed widget.
  52278. domContentWrapper.addEventListener( 'mousedown', () => {
  52279. if ( state.isEditable ) {
  52280. const model = editor.model;
  52281. const selectedElement = model.document.selection.getSelectedElement();
  52282. // Move the selection onto the whole HTML embed widget if it's currently not selected.
  52283. if ( selectedElement !== modelElement ) {
  52284. model.change( writer => writer.setSelection( modelElement, 'on' ) );
  52285. }
  52286. }
  52287. }, true );
  52288. } );
  52289. // API exposed on each raw HTML embed widget so other features can control a particular widget.
  52290. const rawHtmlApi = {
  52291. makeEditable() {
  52292. state = Object.assign( {}, state, {
  52293. isEditable: true
  52294. } );
  52295. renderContent( { domElement: domContentWrapper, editor, state, props } );
  52296. view.change( writer => {
  52297. writer.setAttribute( 'data-cke-ignore-events', 'true', viewContentWrapper );
  52298. } );
  52299. // This could be potentially pulled to a separate method called focusTextarea().
  52300. domContentWrapper.querySelector( 'textarea' ).focus();
  52301. },
  52302. save( newValue ) {
  52303. // If the value didn't change, we just cancel. If it changed,
  52304. // it's enough to update the model – the entire widget will be reconverted.
  52305. if ( newValue !== state.getRawHtmlValue() ) {
  52306. editor.execute( 'updateHtmlEmbed', newValue );
  52307. editor.editing.view.focus();
  52308. } else {
  52309. this.cancel();
  52310. }
  52311. },
  52312. cancel() {
  52313. state = Object.assign( {}, state, {
  52314. isEditable: false
  52315. } );
  52316. renderContent( { domElement: domContentWrapper, editor, state, props } );
  52317. editor.editing.view.focus();
  52318. view.change( writer => {
  52319. writer.removeAttribute( 'data-cke-ignore-events', viewContentWrapper );
  52320. } );
  52321. }
  52322. };
  52323. state = {
  52324. showPreviews: htmlEmbedConfig.showPreviews,
  52325. isEditable: false,
  52326. getRawHtmlValue: () => modelElement.getAttribute( 'value' ) || ''
  52327. };
  52328. props = {
  52329. sanitizeHtml: htmlEmbedConfig.sanitizeHtml,
  52330. textareaPlaceholder: t( 'Paste raw HTML here...' ),
  52331. onEditClick() {
  52332. rawHtmlApi.makeEditable();
  52333. },
  52334. onSaveClick( newValue ) {
  52335. rawHtmlApi.save( newValue );
  52336. },
  52337. onCancelClick() {
  52338. rawHtmlApi.cancel();
  52339. }
  52340. };
  52341. writer.insert( writer.createPositionAt( viewContainer, 0 ), viewContentWrapper );
  52342. writer.setCustomProperty( 'rawHtmlApi', rawHtmlApi, viewContainer );
  52343. writer.setCustomProperty( 'rawHtml', true, viewContainer );
  52344. return Object(ckeditor5_src_widget__WEBPACK_IMPORTED_MODULE_2__["toWidget"])( viewContainer, writer, {
  52345. widgetLabel: t( 'HTML snippet' ),
  52346. hasSelectionHandle: true
  52347. } );
  52348. }
  52349. } );
  52350. function renderContent( { domElement, editor, state, props } ) {
  52351. // Remove all children;
  52352. domElement.textContent = '';
  52353. const domDocument = domElement.ownerDocument;
  52354. let domTextarea;
  52355. if ( state.isEditable ) {
  52356. const textareaProps = {
  52357. isDisabled: false,
  52358. placeholder: props.textareaPlaceholder
  52359. };
  52360. domTextarea = createDomTextarea( { domDocument, state, props: textareaProps } );
  52361. domElement.append( domTextarea );
  52362. } else if ( state.showPreviews ) {
  52363. const previewContainerProps = {
  52364. sanitizeHtml: props.sanitizeHtml
  52365. };
  52366. domElement.append( createPreviewContainer( { domDocument, state, props: previewContainerProps, editor } ) );
  52367. } else {
  52368. const textareaProps = {
  52369. isDisabled: true,
  52370. placeholder: props.textareaPlaceholder
  52371. };
  52372. domElement.append( createDomTextarea( { domDocument, state, props: textareaProps } ) );
  52373. }
  52374. const buttonsWrapperProps = {
  52375. onEditClick: props.onEditClick,
  52376. onSaveClick: () => {
  52377. props.onSaveClick( domTextarea.value );
  52378. },
  52379. onCancelClick: props.onCancelClick
  52380. };
  52381. domElement.prepend( createDomButtonsWrapper( { editor, domDocument, state, props: buttonsWrapperProps } ) );
  52382. }
  52383. function createDomButtonsWrapper( { editor, domDocument, state, props } ) {
  52384. const domButtonsWrapper = Object(ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_3__["createElement"])( domDocument, 'div', {
  52385. class: 'raw-html-embed__buttons-wrapper'
  52386. } );
  52387. // TODO these should be cached and we should only clone here these cached nodes!
  52388. const domEditButton = createDomButton( editor, 'edit' );
  52389. const domSaveButton = createDomButton( editor, 'save' );
  52390. const domCancelButton = createDomButton( editor, 'cancel' );
  52391. if ( state.isEditable ) {
  52392. const clonedDomSaveButton = domSaveButton.cloneNode( true );
  52393. const clonedDomCancelButton = domCancelButton.cloneNode( true );
  52394. clonedDomSaveButton.addEventListener( 'click', evt => {
  52395. evt.preventDefault();
  52396. props.onSaveClick( );
  52397. } );
  52398. clonedDomCancelButton.addEventListener( 'click', evt => {
  52399. evt.preventDefault();
  52400. props.onCancelClick( );
  52401. } );
  52402. domButtonsWrapper.appendChild( clonedDomSaveButton );
  52403. domButtonsWrapper.appendChild( clonedDomCancelButton );
  52404. } else {
  52405. const clonedDomEditButton = domEditButton.cloneNode( true );
  52406. clonedDomEditButton.addEventListener( 'click', evt => {
  52407. evt.preventDefault();
  52408. props.onEditClick();
  52409. } );
  52410. domButtonsWrapper.appendChild( clonedDomEditButton );
  52411. }
  52412. return domButtonsWrapper;
  52413. }
  52414. function createDomTextarea( { domDocument, state, props } ) {
  52415. const domTextarea = Object(ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_3__["createElement"])( domDocument, 'textarea', {
  52416. placeholder: props.placeholder,
  52417. class: 'ck ck-reset ck-input ck-input-text raw-html-embed__source'
  52418. } );
  52419. domTextarea.disabled = props.isDisabled;
  52420. domTextarea.value = state.getRawHtmlValue();
  52421. return domTextarea;
  52422. }
  52423. function createPreviewContainer( { domDocument, state, props, editor } ) {
  52424. const sanitizedOutput = props.sanitizeHtml( state.getRawHtmlValue() );
  52425. const placeholderText = state.getRawHtmlValue().length > 0 ?
  52426. t( 'No preview available' ) :
  52427. t( 'Empty snippet content' );
  52428. const domPreviewPlaceholder = Object(ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_3__["createElement"])( domDocument, 'div', {
  52429. class: 'ck ck-reset_all raw-html-embed__preview-placeholder'
  52430. }, placeholderText );
  52431. const domPreviewContent = Object(ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_3__["createElement"])( domDocument, 'div', {
  52432. class: 'raw-html-embed__preview-content',
  52433. dir: editor.locale.contentLanguageDirection
  52434. } );
  52435. // Creating a contextual document fragment allows executing scripts when inserting into the preview element.
  52436. // See: #8326.
  52437. const domRange = domDocument.createRange();
  52438. const domDocumentFragment = domRange.createContextualFragment( sanitizedOutput.html );
  52439. domPreviewContent.appendChild( domDocumentFragment );
  52440. const domPreviewContainer = Object(ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_3__["createElement"])( domDocument, 'div', {
  52441. class: 'raw-html-embed__preview'
  52442. }, [
  52443. domPreviewPlaceholder, domPreviewContent
  52444. ] );
  52445. return domPreviewContainer;
  52446. }
  52447. }
  52448. }
  52449. // Returns a toggle mode button DOM element that can be cloned and used in conversion.
  52450. //
  52451. // @param {module:utils/locale~Locale} locale Editor locale.
  52452. // @param {'edit'|'save'|'cancel'} type Type of button to create.
  52453. // @returns {HTMLElement}
  52454. function createDomButton( editor, type ) {
  52455. const t = editor.locale.t;
  52456. const buttonView = new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__["ButtonView"]( editor.locale );
  52457. const command = editor.commands.get( 'updateHtmlEmbed' );
  52458. buttonView.set( {
  52459. tooltipPosition: editor.locale.uiLanguageDirection === 'rtl' ? 'e' : 'w',
  52460. icon: ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["icons"].pencil,
  52461. tooltip: true
  52462. } );
  52463. buttonView.render();
  52464. if ( type === 'edit' ) {
  52465. buttonView.set( {
  52466. icon: ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["icons"].pencil,
  52467. label: t( 'Edit source' ),
  52468. class: 'raw-html-embed__edit-button'
  52469. } );
  52470. } else if ( type === 'save' ) {
  52471. buttonView.set( {
  52472. icon: ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["icons"].check,
  52473. label: t( 'Save changes' ),
  52474. class: 'raw-html-embed__save-button'
  52475. } );
  52476. buttonView.bind( 'isEnabled' ).to( command, 'isEnabled' );
  52477. } else {
  52478. buttonView.set( {
  52479. icon: ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["icons"].cancel,
  52480. label: t( 'Cancel' ),
  52481. class: 'raw-html-embed__cancel-button'
  52482. } );
  52483. }
  52484. buttonView.destroy();
  52485. return buttonView.element.cloneNode( true );
  52486. }
  52487. /***/ }),
  52488. /***/ "./node_modules/@ckeditor/ckeditor5-html-embed/src/htmlembedui.js":
  52489. /*!************************************************************************!*\
  52490. !*** ./node_modules/@ckeditor/ckeditor5-html-embed/src/htmlembedui.js ***!
  52491. \************************************************************************/
  52492. /*! exports provided: default */
  52493. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  52494. "use strict";
  52495. __webpack_require__.r(__webpack_exports__);
  52496. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return HtmlEmbedUI; });
  52497. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  52498. /* harmony import */ var ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/ui */ "./node_modules/ckeditor5/src/ui.js");
  52499. /* harmony import */ var _theme_icons_html_svg__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../theme/icons/html.svg */ "./node_modules/@ckeditor/ckeditor5-html-embed/theme/icons/html.svg");
  52500. /**
  52501. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  52502. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  52503. */
  52504. /**
  52505. * @module html-embed/htmlembedui
  52506. */
  52507. /**
  52508. * The HTML embed UI plugin.
  52509. *
  52510. * @extends module:core/plugin~Plugin
  52511. */
  52512. class HtmlEmbedUI extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  52513. /**
  52514. * @inheritDoc
  52515. */
  52516. static get pluginName() {
  52517. return 'HtmlEmbedUI';
  52518. }
  52519. /**
  52520. * @inheritDoc
  52521. */
  52522. init() {
  52523. const editor = this.editor;
  52524. const t = editor.t;
  52525. // Add the `htmlEmbed` button to feature components.
  52526. editor.ui.componentFactory.add( 'htmlEmbed', locale => {
  52527. const command = editor.commands.get( 'insertHtmlEmbed' );
  52528. const view = new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__["ButtonView"]( locale );
  52529. view.set( {
  52530. label: t( 'Insert HTML' ),
  52531. icon: _theme_icons_html_svg__WEBPACK_IMPORTED_MODULE_2__["default"],
  52532. tooltip: true
  52533. } );
  52534. view.bind( 'isEnabled' ).to( command, 'isEnabled' );
  52535. // Execute the command.
  52536. this.listenTo( view, 'execute', () => {
  52537. editor.execute( 'insertHtmlEmbed' );
  52538. editor.editing.view.focus();
  52539. const widgetWrapper = editor.editing.view.document.selection.getSelectedElement();
  52540. widgetWrapper.getCustomProperty( 'rawHtmlApi' ).makeEditable();
  52541. } );
  52542. return view;
  52543. } );
  52544. }
  52545. }
  52546. /***/ }),
  52547. /***/ "./node_modules/@ckeditor/ckeditor5-html-embed/src/inserthtmlembedcommand.js":
  52548. /*!***********************************************************************************!*\
  52549. !*** ./node_modules/@ckeditor/ckeditor5-html-embed/src/inserthtmlembedcommand.js ***!
  52550. \***********************************************************************************/
  52551. /*! exports provided: default */
  52552. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  52553. "use strict";
  52554. __webpack_require__.r(__webpack_exports__);
  52555. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return InsertHtmlEmbedCommand; });
  52556. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  52557. /* harmony import */ var ckeditor5_src_widget__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/widget */ "./node_modules/ckeditor5/src/widget.js");
  52558. /**
  52559. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  52560. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  52561. */
  52562. /**
  52563. * @module html-embed/inserthtmlembedcommand
  52564. */
  52565. /**
  52566. * The insert HTML embed element command.
  52567. *
  52568. * The command is registered by {@link module:html-embed/htmlembedediting~HtmlEmbedEditing} as `'insertHtmlEmbed'`.
  52569. *
  52570. * To insert the HTML embed element at the current selection, execute the command:
  52571. *
  52572. * editor.execute( 'insertHtmlEmbed' );
  52573. *
  52574. * @extends module:core/command~Command
  52575. */
  52576. class InsertHtmlEmbedCommand extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Command"] {
  52577. /**
  52578. * @inheritDoc
  52579. */
  52580. refresh() {
  52581. this.isEnabled = isHtmlEmbedAllowed( this.editor.model );
  52582. }
  52583. /**
  52584. * Executes the command, which creates and inserts a new HTML embed element.
  52585. *
  52586. * @fires execute
  52587. */
  52588. execute() {
  52589. const model = this.editor.model;
  52590. model.change( writer => {
  52591. const rawHtmlElement = writer.createElement( 'rawHtml' );
  52592. model.insertContent( rawHtmlElement );
  52593. writer.setSelection( rawHtmlElement, 'on' );
  52594. } );
  52595. }
  52596. }
  52597. // Checks if the `htmlEmbed` element can be inserted at the current model selection.
  52598. //
  52599. // @param {module:engine/model/model~Model} model
  52600. // @returns {Boolean}
  52601. function isHtmlEmbedAllowed( model ) {
  52602. const schema = model.schema;
  52603. const selection = model.document.selection;
  52604. return isHtmlEmbedAllowedInParent( selection, schema, model ) &&
  52605. !Object(ckeditor5_src_widget__WEBPACK_IMPORTED_MODULE_1__["checkSelectionOnObject"])( selection, schema );
  52606. }
  52607. // Checks if an HTML embed is allowed by the schema in the optimal insertion parent.
  52608. //
  52609. // @param {module:engine/model/selection~Selection|module:engine/model/documentselection~DocumentSelection} selection
  52610. // @param {module:engine/model/schema~Schema} schema
  52611. // @param {module:engine/model/model~Model} model Model instance.
  52612. // @returns {Boolean}
  52613. function isHtmlEmbedAllowedInParent( selection, schema, model ) {
  52614. const parent = getInsertPageBreakParent( selection, model );
  52615. return schema.checkChild( parent, 'rawHtml' );
  52616. }
  52617. // Returns a node that will be used to insert a page break with `model.insertContent` to check if a html embed element can be placed there.
  52618. //
  52619. // @param {module:engine/model/selection~Selection|module:engine/model/documentselection~DocumentSelection} selection
  52620. // @param {module:engine/model/model~Model} model Model instance.
  52621. // @returns {module:engine/model/element~Element}
  52622. function getInsertPageBreakParent( selection, model ) {
  52623. const insertAt = Object(ckeditor5_src_widget__WEBPACK_IMPORTED_MODULE_1__["findOptimalInsertionPosition"])( selection, model );
  52624. const parent = insertAt.parent;
  52625. if ( parent.isEmpty && !parent.is( 'element', '$root' ) ) {
  52626. return parent.parent;
  52627. }
  52628. return parent;
  52629. }
  52630. /***/ }),
  52631. /***/ "./node_modules/@ckeditor/ckeditor5-html-embed/src/updatehtmlembedcommand.js":
  52632. /*!***********************************************************************************!*\
  52633. !*** ./node_modules/@ckeditor/ckeditor5-html-embed/src/updatehtmlembedcommand.js ***!
  52634. \***********************************************************************************/
  52635. /*! exports provided: default */
  52636. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  52637. "use strict";
  52638. __webpack_require__.r(__webpack_exports__);
  52639. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return UpdateHtmlEmbedCommand; });
  52640. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  52641. /**
  52642. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  52643. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  52644. */
  52645. /**
  52646. * @module html-embed/updatehtmlembedcommand
  52647. */
  52648. /**
  52649. * The update HTML embed value command.
  52650. *
  52651. * The command is registered by {@link module:html-embed/htmlembedediting~HtmlEmbedEditing} as `'updateHtmlEmbed'`.
  52652. *
  52653. * To update the value of the HTML embed element at the current selection, execute the command:
  52654. *
  52655. * editor.execute( 'updateHtmlEmbed', '<b>HTML.</b>' );
  52656. *
  52657. * @extends module:core/command~Command
  52658. */
  52659. class UpdateHtmlEmbedCommand extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Command"] {
  52660. /**
  52661. * @inheritDoc
  52662. */
  52663. refresh() {
  52664. const model = this.editor.model;
  52665. const selection = model.document.selection;
  52666. const rawHtmlElement = getSelectedRawHtmlModelWidget( selection );
  52667. this.isEnabled = !!rawHtmlElement;
  52668. }
  52669. /**
  52670. * Executes the command, which updates the `value` attribute of the embedded HTML element:
  52671. *
  52672. * @fires execute
  52673. * @param {String} value HTML as a string.
  52674. */
  52675. execute( value ) {
  52676. const model = this.editor.model;
  52677. const selection = model.document.selection;
  52678. const selectedRawHtmlElement = getSelectedRawHtmlModelWidget( selection );
  52679. model.change( writer => {
  52680. writer.setAttribute( 'value', value, selectedRawHtmlElement );
  52681. } );
  52682. }
  52683. }
  52684. // Returns the selected HTML embed element in the model, if any.
  52685. //
  52686. // @param {module:engine/model/selection~Selection} selection
  52687. // @returns {module:engine/model/element~Element|null}
  52688. function getSelectedRawHtmlModelWidget( selection ) {
  52689. const selectedElement = selection.getSelectedElement();
  52690. if ( selectedElement && selectedElement.is( 'element', 'rawHtml' ) ) {
  52691. return selectedElement;
  52692. }
  52693. return null;
  52694. }
  52695. /***/ }),
  52696. /***/ "./node_modules/@ckeditor/ckeditor5-html-embed/theme/htmlembed.css":
  52697. /*!*************************************************************************!*\
  52698. !*** ./node_modules/@ckeditor/ckeditor5-html-embed/theme/htmlembed.css ***!
  52699. \*************************************************************************/
  52700. /*! no static exports found */
  52701. /***/ (function(module, exports, __webpack_require__) {
  52702. var api = __webpack_require__(/*! ../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  52703. var content = __webpack_require__(/*! !../../../postcss-loader/src??ref--5-1!./htmlembed.css */ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-html-embed/theme/htmlembed.css");
  52704. content = content.__esModule ? content.default : content;
  52705. if (typeof content === 'string') {
  52706. content = [[module.i, content, '']];
  52707. }
  52708. var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
  52709. options.insert = "head";
  52710. options.singleton = true;
  52711. var update = api(content, options);
  52712. module.exports = content.locals || {};
  52713. /***/ }),
  52714. /***/ "./node_modules/@ckeditor/ckeditor5-html-embed/theme/icons/html.svg":
  52715. /*!**************************************************************************!*\
  52716. !*** ./node_modules/@ckeditor/ckeditor5-html-embed/theme/icons/html.svg ***!
  52717. \**************************************************************************/
  52718. /*! exports provided: default */
  52719. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  52720. "use strict";
  52721. __webpack_require__.r(__webpack_exports__);
  52722. /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M17 0a2 2 0 0 1 2 2v7a1 1 0 0 1 1 1v5a1 1 0 0 1-.883.993l-.118.006L19 17a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2l-.001-1.001-.116-.006A1 1 0 0 1 0 15v-5a1 1 0 0 1 .999-1L1 2a2 2 0 0 1 2-2h14zm.499 15.999h-15L2.5 17a.5.5 0 0 0 .5.5h14a.5.5 0 0 0 .5-.5l-.001-1.001zm-3.478-6.013-.014.014H14v.007l-1.525 1.525-1.46-1.46-.015.013V10h-1v5h1v-3.53l1.428 1.43.048.043.131-.129L14 11.421V15h1v-5h-.965l-.014-.014zM2 10H1v5h1v-2h2v2h1v-5H4v2H2v-2zm7 0H6v1h1v4h1v-4h1v-1zm8 0h-1v5h3v-1h-2v-4zm0-8.5H3a.5.5 0 0 0-.5.5l-.001 6.999h15L17.5 2a.5.5 0 0 0-.5-.5zM10 7v1H4V7h6zm3-2v1H4V5h9zm-3-2v1H4V3h6z\"/></svg>");
  52723. /***/ }),
  52724. /***/ "./node_modules/@ckeditor/ckeditor5-image/src/image.js":
  52725. /*!*************************************************************!*\
  52726. !*** ./node_modules/@ckeditor/ckeditor5-image/src/image.js ***!
  52727. \*************************************************************/
  52728. /*! exports provided: default */
  52729. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  52730. "use strict";
  52731. __webpack_require__.r(__webpack_exports__);
  52732. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Image; });
  52733. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  52734. /* harmony import */ var ckeditor5_src_widget__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/widget */ "./node_modules/ckeditor5/src/widget.js");
  52735. /* harmony import */ var _image_imageediting__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./image/imageediting */ "./node_modules/@ckeditor/ckeditor5-image/src/image/imageediting.js");
  52736. /* harmony import */ var _imagetextalternative__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./imagetextalternative */ "./node_modules/@ckeditor/ckeditor5-image/src/imagetextalternative.js");
  52737. /* harmony import */ var _image_utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./image/utils */ "./node_modules/@ckeditor/ckeditor5-image/src/image/utils.js");
  52738. /* harmony import */ var _theme_image_css__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../theme/image.css */ "./node_modules/@ckeditor/ckeditor5-image/theme/image.css");
  52739. /* harmony import */ var _theme_image_css__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_theme_image_css__WEBPACK_IMPORTED_MODULE_5__);
  52740. /**
  52741. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  52742. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  52743. */
  52744. /**
  52745. * @module image/image
  52746. */
  52747. /**
  52748. * The image plugin.
  52749. *
  52750. * For a detailed overview, check the {@glink features/image image feature} documentation.
  52751. *
  52752. * This is a "glue" plugin which loads the following plugins:
  52753. *
  52754. * * {@link module:image/image/imageediting~ImageEditing},
  52755. * * {@link module:image/imagetextalternative~ImageTextAlternative}.
  52756. *
  52757. * Usually, it is used in conjuction with other plugins from this package. See the {@glink api/image package page}
  52758. * for more information.
  52759. *
  52760. * @extends module:core/plugin~Plugin
  52761. */
  52762. class Image extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  52763. /**
  52764. * @inheritDoc
  52765. */
  52766. static get requires() {
  52767. return [ _image_imageediting__WEBPACK_IMPORTED_MODULE_2__["default"], ckeditor5_src_widget__WEBPACK_IMPORTED_MODULE_1__["Widget"], _imagetextalternative__WEBPACK_IMPORTED_MODULE_3__["default"] ];
  52768. }
  52769. /**
  52770. * @inheritDoc
  52771. */
  52772. static get pluginName() {
  52773. return 'Image';
  52774. }
  52775. /**
  52776. * Checks if a given view element is an image widget.
  52777. *
  52778. * @param {module:engine/view/element~Element} viewElement
  52779. * @returns {Boolean}
  52780. */
  52781. isImageWidget( viewElement ) {
  52782. return Object(_image_utils__WEBPACK_IMPORTED_MODULE_4__["isImageWidget"])( viewElement );
  52783. }
  52784. }
  52785. /**
  52786. * The configuration of the image features. Used by the image features in the `@ckeditor/ckeditor5-image` package.
  52787. *
  52788. * Read more in {@link module:image/image~ImageConfig}.
  52789. *
  52790. * @member {module:image/image~ImageConfig} module:core/editor/editorconfig~EditorConfig#image
  52791. */
  52792. /**
  52793. * The configuration of the image features. Used by the image features in the `@ckeditor/ckeditor5-image` package.
  52794. *
  52795. * ClassicEditor
  52796. * .create( editorElement, {
  52797. * image: ... // Image feature options.
  52798. * } )
  52799. * .then( ... )
  52800. * .catch( ... );
  52801. *
  52802. * See {@link module:core/editor/editorconfig~EditorConfig all editor options}.
  52803. *
  52804. * @interface ImageConfig
  52805. */
  52806. /***/ }),
  52807. /***/ "./node_modules/@ckeditor/ckeditor5-image/src/image/converters.js":
  52808. /*!************************************************************************!*\
  52809. !*** ./node_modules/@ckeditor/ckeditor5-image/src/image/converters.js ***!
  52810. \************************************************************************/
  52811. /*! exports provided: viewFigureToModel, srcsetAttributeConverter, modelToViewAttributeConverter */
  52812. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  52813. "use strict";
  52814. __webpack_require__.r(__webpack_exports__);
  52815. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "viewFigureToModel", function() { return viewFigureToModel; });
  52816. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "srcsetAttributeConverter", function() { return srcsetAttributeConverter; });
  52817. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "modelToViewAttributeConverter", function() { return modelToViewAttributeConverter; });
  52818. /* harmony import */ var ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/utils */ "./node_modules/ckeditor5/src/utils.js");
  52819. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./utils */ "./node_modules/@ckeditor/ckeditor5-image/src/image/utils.js");
  52820. /**
  52821. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  52822. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  52823. */
  52824. /**
  52825. * @module image/image/converters
  52826. */
  52827. /**
  52828. * Returns a function that converts the image view representation:
  52829. *
  52830. * <figure class="image"><img src="..." alt="..."></img></figure>
  52831. *
  52832. * to the model representation:
  52833. *
  52834. * <image src="..." alt="..."></image>
  52835. *
  52836. * The entire content of the `<figure>` element except the first `<img>` is being converted as children
  52837. * of the `<image>` model element.
  52838. *
  52839. * @returns {Function}
  52840. */
  52841. function viewFigureToModel() {
  52842. return dispatcher => {
  52843. dispatcher.on( 'element:figure', converter );
  52844. };
  52845. function converter( evt, data, conversionApi ) {
  52846. // Do not convert if this is not an "image figure".
  52847. if ( !conversionApi.consumable.test( data.viewItem, { name: true, classes: 'image' } ) ) {
  52848. return;
  52849. }
  52850. // Find an image element inside the figure element.
  52851. const viewImage = Object(_utils__WEBPACK_IMPORTED_MODULE_1__["getViewImgFromWidget"])( data.viewItem );
  52852. // Do not convert if image element is absent, is missing src attribute or was already converted.
  52853. if ( !viewImage || !viewImage.hasAttribute( 'src' ) || !conversionApi.consumable.test( viewImage, { name: true } ) ) {
  52854. return;
  52855. }
  52856. // Convert view image to model image.
  52857. const conversionResult = conversionApi.convertItem( viewImage, data.modelCursor );
  52858. // Get image element from conversion result.
  52859. const modelImage = Object(ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_0__["first"])( conversionResult.modelRange.getItems() );
  52860. // When image wasn't successfully converted then finish conversion.
  52861. if ( !modelImage ) {
  52862. return;
  52863. }
  52864. // Convert rest of the figure element's children as an image children.
  52865. conversionApi.convertChildren( data.viewItem, modelImage );
  52866. conversionApi.updateConversionResult( modelImage, data );
  52867. }
  52868. }
  52869. /**
  52870. * Converter used to convert the `srcset` model image attribute to the `srcset`, `sizes` and `width` attributes in the view.
  52871. *
  52872. * @returns {Function}
  52873. */
  52874. function srcsetAttributeConverter() {
  52875. return dispatcher => {
  52876. dispatcher.on( 'attribute:srcset:image', converter );
  52877. };
  52878. function converter( evt, data, conversionApi ) {
  52879. if ( !conversionApi.consumable.consume( data.item, evt.name ) ) {
  52880. return;
  52881. }
  52882. const writer = conversionApi.writer;
  52883. const figure = conversionApi.mapper.toViewElement( data.item );
  52884. const img = Object(_utils__WEBPACK_IMPORTED_MODULE_1__["getViewImgFromWidget"])( figure );
  52885. if ( data.attributeNewValue === null ) {
  52886. const srcset = data.attributeOldValue;
  52887. if ( srcset.data ) {
  52888. writer.removeAttribute( 'srcset', img );
  52889. writer.removeAttribute( 'sizes', img );
  52890. if ( srcset.width ) {
  52891. writer.removeAttribute( 'width', img );
  52892. }
  52893. }
  52894. } else {
  52895. const srcset = data.attributeNewValue;
  52896. if ( srcset.data ) {
  52897. writer.setAttribute( 'srcset', srcset.data, img );
  52898. // Always outputting `100vw`. See https://github.com/ckeditor/ckeditor5-image/issues/2.
  52899. writer.setAttribute( 'sizes', '100vw', img );
  52900. if ( srcset.width ) {
  52901. writer.setAttribute( 'width', srcset.width, img );
  52902. }
  52903. }
  52904. }
  52905. }
  52906. }
  52907. function modelToViewAttributeConverter( attributeKey ) {
  52908. return dispatcher => {
  52909. dispatcher.on( `attribute:${ attributeKey }:image`, converter );
  52910. };
  52911. function converter( evt, data, conversionApi ) {
  52912. if ( !conversionApi.consumable.consume( data.item, evt.name ) ) {
  52913. return;
  52914. }
  52915. const viewWriter = conversionApi.writer;
  52916. const figure = conversionApi.mapper.toViewElement( data.item );
  52917. const img = Object(_utils__WEBPACK_IMPORTED_MODULE_1__["getViewImgFromWidget"])( figure );
  52918. viewWriter.setAttribute( data.attributeKey, data.attributeNewValue || '', img );
  52919. }
  52920. }
  52921. /***/ }),
  52922. /***/ "./node_modules/@ckeditor/ckeditor5-image/src/image/imageediting.js":
  52923. /*!**************************************************************************!*\
  52924. !*** ./node_modules/@ckeditor/ckeditor5-image/src/image/imageediting.js ***!
  52925. \**************************************************************************/
  52926. /*! exports provided: default, createImageViewElement */
  52927. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  52928. "use strict";
  52929. __webpack_require__.r(__webpack_exports__);
  52930. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ImageEditing; });
  52931. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createImageViewElement", function() { return createImageViewElement; });
  52932. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  52933. /* harmony import */ var _imageloadobserver__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./imageloadobserver */ "./node_modules/@ckeditor/ckeditor5-image/src/image/imageloadobserver.js");
  52934. /* harmony import */ var _converters__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./converters */ "./node_modules/@ckeditor/ckeditor5-image/src/image/converters.js");
  52935. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils */ "./node_modules/@ckeditor/ckeditor5-image/src/image/utils.js");
  52936. /* harmony import */ var _insertimagecommand__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./insertimagecommand */ "./node_modules/@ckeditor/ckeditor5-image/src/image/insertimagecommand.js");
  52937. /**
  52938. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  52939. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  52940. */
  52941. /**
  52942. * @module image/image/imageediting
  52943. */
  52944. /**
  52945. * The image engine plugin.
  52946. *
  52947. * It registers:
  52948. *
  52949. * * `<image>` as a block element in the document schema, and allows `alt`, `src` and `srcset` attributes.
  52950. * * converters for editing and data pipelines.
  52951. * * `'insertImage'` command.
  52952. * * `'imageInsert'` command as an alias for `insertImage` command.
  52953. *
  52954. * @extends module:core/plugin~Plugin
  52955. */
  52956. class ImageEditing extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  52957. /**
  52958. * @inheritDoc
  52959. */
  52960. static get pluginName() {
  52961. return 'ImageEditing';
  52962. }
  52963. /**
  52964. * @inheritDoc
  52965. */
  52966. init() {
  52967. const editor = this.editor;
  52968. const schema = editor.model.schema;
  52969. const t = editor.t;
  52970. const conversion = editor.conversion;
  52971. // See https://github.com/ckeditor/ckeditor5-image/issues/142.
  52972. editor.editing.view.addObserver( _imageloadobserver__WEBPACK_IMPORTED_MODULE_1__["default"] );
  52973. // Configure schema.
  52974. schema.register( 'image', {
  52975. isObject: true,
  52976. isBlock: true,
  52977. allowWhere: '$block',
  52978. allowAttributes: [ 'alt', 'src', 'srcset' ]
  52979. } );
  52980. conversion.for( 'dataDowncast' ).elementToElement( {
  52981. model: 'image',
  52982. view: ( modelElement, { writer } ) => createImageViewElement( writer )
  52983. } );
  52984. conversion.for( 'editingDowncast' ).elementToElement( {
  52985. model: 'image',
  52986. view: ( modelElement, { writer } ) => Object(_utils__WEBPACK_IMPORTED_MODULE_3__["toImageWidget"])( createImageViewElement( writer ), writer, t( 'image widget' ) )
  52987. } );
  52988. conversion.for( 'downcast' )
  52989. .add( Object(_converters__WEBPACK_IMPORTED_MODULE_2__["modelToViewAttributeConverter"])( 'src' ) )
  52990. .add( Object(_converters__WEBPACK_IMPORTED_MODULE_2__["modelToViewAttributeConverter"])( 'alt' ) )
  52991. .add( Object(_converters__WEBPACK_IMPORTED_MODULE_2__["srcsetAttributeConverter"])() );
  52992. conversion.for( 'upcast' )
  52993. .elementToElement( {
  52994. view: {
  52995. name: 'img',
  52996. attributes: {
  52997. src: true
  52998. }
  52999. },
  53000. model: ( viewImage, { writer } ) => writer.createElement( 'image', { src: viewImage.getAttribute( 'src' ) } )
  53001. } )
  53002. .attributeToAttribute( {
  53003. view: {
  53004. name: 'img',
  53005. key: 'alt'
  53006. },
  53007. model: 'alt'
  53008. } )
  53009. .attributeToAttribute( {
  53010. view: {
  53011. name: 'img',
  53012. key: 'srcset'
  53013. },
  53014. model: {
  53015. key: 'srcset',
  53016. value: viewImage => {
  53017. const value = {
  53018. data: viewImage.getAttribute( 'srcset' )
  53019. };
  53020. if ( viewImage.hasAttribute( 'width' ) ) {
  53021. value.width = viewImage.getAttribute( 'width' );
  53022. }
  53023. return value;
  53024. }
  53025. }
  53026. } )
  53027. .add( Object(_converters__WEBPACK_IMPORTED_MODULE_2__["viewFigureToModel"])() );
  53028. const insertImageCommand = new _insertimagecommand__WEBPACK_IMPORTED_MODULE_4__["default"]( editor );
  53029. // Register `insertImage` command and add `imageInsert` command as an alias for backward compatibility.
  53030. editor.commands.add( 'insertImage', insertImageCommand );
  53031. editor.commands.add( 'imageInsert', insertImageCommand );
  53032. }
  53033. }
  53034. // Creates a view element representing the image.
  53035. //
  53036. // <figure class="image"><img></img></figure>
  53037. //
  53038. // Note that `alt` and `src` attributes are converted separately, so they are not included.
  53039. //
  53040. // @private
  53041. // @param {module:engine/view/downcastwriter~DowncastWriter} writer
  53042. // @returns {module:engine/view/containerelement~ContainerElement}
  53043. function createImageViewElement( writer ) {
  53044. const emptyElement = writer.createEmptyElement( 'img' );
  53045. const figure = writer.createContainerElement( 'figure', { class: 'image' } );
  53046. writer.insert( writer.createPositionAt( figure, 0 ), emptyElement );
  53047. return figure;
  53048. }
  53049. /***/ }),
  53050. /***/ "./node_modules/@ckeditor/ckeditor5-image/src/image/imageloadobserver.js":
  53051. /*!*******************************************************************************!*\
  53052. !*** ./node_modules/@ckeditor/ckeditor5-image/src/image/imageloadobserver.js ***!
  53053. \*******************************************************************************/
  53054. /*! exports provided: default */
  53055. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  53056. "use strict";
  53057. __webpack_require__.r(__webpack_exports__);
  53058. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ImageLoadObserver; });
  53059. /* harmony import */ var ckeditor5_src_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/engine */ "./node_modules/ckeditor5/src/engine.js");
  53060. /**
  53061. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  53062. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  53063. */
  53064. /**
  53065. * @module image/image/imageloadobserver
  53066. */
  53067. /**
  53068. * Observes all new images added to the {@link module:engine/view/document~Document},
  53069. * fires {@link module:engine/view/document~Document#event:imageLoaded} and
  53070. * {@link module:engine/view/document~Document#event:layoutChanged} event every time when the new image
  53071. * has been loaded.
  53072. *
  53073. * **Note:** This event is not fired for images that has been added to the document and rendered as `complete` (already loaded).
  53074. *
  53075. * @extends module:engine/view/observer/observer~Observer
  53076. */
  53077. class ImageLoadObserver extends ckeditor5_src_engine__WEBPACK_IMPORTED_MODULE_0__["Observer"] {
  53078. /**
  53079. * @inheritDoc
  53080. */
  53081. observe( domRoot ) {
  53082. this.listenTo( domRoot, 'load', ( event, domEvent ) => {
  53083. const domElement = domEvent.target;
  53084. if ( this.checkShouldIgnoreEventFromTarget( domElement ) ) {
  53085. return;
  53086. }
  53087. if ( domElement.tagName == 'IMG' ) {
  53088. this._fireEvents( domEvent );
  53089. }
  53090. // Use capture phase for better performance (#4504).
  53091. }, { useCapture: true } );
  53092. }
  53093. /**
  53094. * Fires {@link module:engine/view/document~Document#event:layoutChanged} and
  53095. * {@link module:engine/view/document~Document#event:imageLoaded}
  53096. * if observer {@link #isEnabled is enabled}.
  53097. *
  53098. * @protected
  53099. * @param {Event} domEvent The DOM event.
  53100. */
  53101. _fireEvents( domEvent ) {
  53102. if ( this.isEnabled ) {
  53103. this.document.fire( 'layoutChanged' );
  53104. this.document.fire( 'imageLoaded', domEvent );
  53105. }
  53106. }
  53107. }
  53108. /**
  53109. * Fired when an <img/> DOM element has been loaded in the DOM root.
  53110. *
  53111. * Introduced by {@link module:image/image/imageloadobserver~ImageLoadObserver}.
  53112. *
  53113. * @see module:image/image/imageloadobserver~ImageLoadObserver
  53114. * @event module:engine/view/document~Document#event:imageLoaded
  53115. * @param {module:engine/view/observer/domeventdata~DomEventData} data Event data.
  53116. */
  53117. /***/ }),
  53118. /***/ "./node_modules/@ckeditor/ckeditor5-image/src/image/insertimagecommand.js":
  53119. /*!********************************************************************************!*\
  53120. !*** ./node_modules/@ckeditor/ckeditor5-image/src/image/insertimagecommand.js ***!
  53121. \********************************************************************************/
  53122. /*! exports provided: default */
  53123. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  53124. "use strict";
  53125. __webpack_require__.r(__webpack_exports__);
  53126. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return InsertImageCommand; });
  53127. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  53128. /* harmony import */ var ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/utils */ "./node_modules/ckeditor5/src/utils.js");
  53129. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils */ "./node_modules/@ckeditor/ckeditor5-image/src/image/utils.js");
  53130. /**
  53131. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  53132. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  53133. */
  53134. /**
  53135. * @module image/image/insertimagecommand
  53136. */
  53137. /**
  53138. * Insert image command.
  53139. *
  53140. * The command is registered by the {@link module:image/image/imageediting~ImageEditing} plugin as `insertImage`
  53141. * and it is also available via aliased `imageInsert` name.
  53142. *
  53143. * In order to insert an image at the current selection position
  53144. * (according to the {@link module:widget/utils~findOptimalInsertionPosition} algorithm),
  53145. * execute the command and specify the image source:
  53146. *
  53147. * editor.execute( 'insertImage', { source: 'http://url.to.the/image' } );
  53148. *
  53149. * It is also possible to insert multiple images at once:
  53150. *
  53151. * editor.execute( 'insertImage', {
  53152. * source: [
  53153. * 'path/to/image.jpg',
  53154. * 'path/to/other-image.jpg'
  53155. * ]
  53156. * } );
  53157. *
  53158. * @extends module:core/command~Command
  53159. */
  53160. class InsertImageCommand extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Command"] {
  53161. /**
  53162. * @inheritDoc
  53163. */
  53164. refresh() {
  53165. this.isEnabled = Object(_utils__WEBPACK_IMPORTED_MODULE_2__["isImageAllowed"])( this.editor.model );
  53166. }
  53167. /**
  53168. * Executes the command.
  53169. *
  53170. * @fires execute
  53171. * @param {Object} options Options for the executed command.
  53172. * @param {String|Array.<String>} options.source The image source or an array of image sources to insert.
  53173. */
  53174. execute( options ) {
  53175. const model = this.editor.model;
  53176. for ( const src of Object(ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_1__["toArray"])( options.source ) ) {
  53177. Object(_utils__WEBPACK_IMPORTED_MODULE_2__["insertImage"])( model, { src } );
  53178. }
  53179. }
  53180. }
  53181. /***/ }),
  53182. /***/ "./node_modules/@ckeditor/ckeditor5-image/src/image/ui/utils.js":
  53183. /*!**********************************************************************!*\
  53184. !*** ./node_modules/@ckeditor/ckeditor5-image/src/image/ui/utils.js ***!
  53185. \**********************************************************************/
  53186. /*! exports provided: repositionContextualBalloon, getBalloonPositionData */
  53187. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  53188. "use strict";
  53189. __webpack_require__.r(__webpack_exports__);
  53190. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "repositionContextualBalloon", function() { return repositionContextualBalloon; });
  53191. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getBalloonPositionData", function() { return getBalloonPositionData; });
  53192. /* harmony import */ var ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/ui */ "./node_modules/ckeditor5/src/ui.js");
  53193. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils */ "./node_modules/@ckeditor/ckeditor5-image/src/image/utils.js");
  53194. /**
  53195. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  53196. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  53197. */
  53198. /**
  53199. * @module image/image/ui/utils
  53200. */
  53201. /**
  53202. * A helper utility that positions the
  53203. * {@link module:ui/panel/balloon/contextualballoon~ContextualBalloon contextual balloon} instance
  53204. * with respect to the image in the editor content, if one is selected.
  53205. *
  53206. * @param {module:core/editor/editor~Editor} editor The editor instance.
  53207. */
  53208. function repositionContextualBalloon( editor ) {
  53209. const balloon = editor.plugins.get( 'ContextualBalloon' );
  53210. if ( Object(_utils__WEBPACK_IMPORTED_MODULE_1__["getSelectedImageWidget"])( editor.editing.view.document.selection ) ) {
  53211. const position = getBalloonPositionData( editor );
  53212. balloon.updatePosition( position );
  53213. }
  53214. }
  53215. /**
  53216. * Returns the positioning options that control the geometry of the
  53217. * {@link module:ui/panel/balloon/contextualballoon~ContextualBalloon contextual balloon} with respect
  53218. * to the selected element in the editor content.
  53219. *
  53220. * @param {module:core/editor/editor~Editor} editor The editor instance.
  53221. * @returns {module:utils/dom/position~Options}
  53222. */
  53223. function getBalloonPositionData( editor ) {
  53224. const editingView = editor.editing.view;
  53225. const defaultPositions = ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_0__["BalloonPanelView"].defaultPositions;
  53226. return {
  53227. target: editingView.domConverter.viewToDom( editingView.document.selection.getSelectedElement() ),
  53228. positions: [
  53229. defaultPositions.northArrowSouth,
  53230. defaultPositions.northArrowSouthWest,
  53231. defaultPositions.northArrowSouthEast,
  53232. defaultPositions.southArrowNorth,
  53233. defaultPositions.southArrowNorthWest,
  53234. defaultPositions.southArrowNorthEast
  53235. ]
  53236. };
  53237. }
  53238. /***/ }),
  53239. /***/ "./node_modules/@ckeditor/ckeditor5-image/src/image/utils.js":
  53240. /*!*******************************************************************!*\
  53241. !*** ./node_modules/@ckeditor/ckeditor5-image/src/image/utils.js ***!
  53242. \*******************************************************************/
  53243. /*! exports provided: toImageWidget, isImageWidget, getSelectedImageWidget, isImage, insertImage, isImageAllowed, getViewImgFromWidget */
  53244. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  53245. "use strict";
  53246. __webpack_require__.r(__webpack_exports__);
  53247. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toImageWidget", function() { return toImageWidget; });
  53248. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isImageWidget", function() { return isImageWidget; });
  53249. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getSelectedImageWidget", function() { return getSelectedImageWidget; });
  53250. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isImage", function() { return isImage; });
  53251. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "insertImage", function() { return insertImage; });
  53252. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isImageAllowed", function() { return isImageAllowed; });
  53253. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getViewImgFromWidget", function() { return getViewImgFromWidget; });
  53254. /* harmony import */ var ckeditor5_src_widget__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/widget */ "./node_modules/ckeditor5/src/widget.js");
  53255. /**
  53256. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  53257. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  53258. */
  53259. /**
  53260. * @module image/image/utils
  53261. */
  53262. /**
  53263. * Converts a given {@link module:engine/view/element~Element} to an image widget:
  53264. * * Adds a {@link module:engine/view/element~Element#_setCustomProperty custom property} allowing to recognize the image widget element.
  53265. * * Calls the {@link module:widget/utils~toWidget} function with the proper element's label creator.
  53266. *
  53267. * @param {module:engine/view/element~Element} viewElement
  53268. * @param {module:engine/view/downcastwriter~DowncastWriter} writer An instance of the view writer.
  53269. * @param {String} label The element's label. It will be concatenated with the image `alt` attribute if one is present.
  53270. * @returns {module:engine/view/element~Element}
  53271. */
  53272. function toImageWidget( viewElement, writer, label ) {
  53273. writer.setCustomProperty( 'image', true, viewElement );
  53274. return Object(ckeditor5_src_widget__WEBPACK_IMPORTED_MODULE_0__["toWidget"])( viewElement, writer, { label: labelCreator } );
  53275. function labelCreator() {
  53276. const imgElement = getViewImgFromWidget( viewElement );
  53277. const altText = imgElement.getAttribute( 'alt' );
  53278. return altText ? `${ altText } ${ label }` : label;
  53279. }
  53280. }
  53281. /**
  53282. * Checks if a given view element is an image widget.
  53283. *
  53284. * @param {module:engine/view/element~Element} viewElement
  53285. * @returns {Boolean}
  53286. */
  53287. function isImageWidget( viewElement ) {
  53288. return !!viewElement.getCustomProperty( 'image' ) && Object(ckeditor5_src_widget__WEBPACK_IMPORTED_MODULE_0__["isWidget"])( viewElement );
  53289. }
  53290. /**
  53291. * Returns an image widget editing view element if one is selected.
  53292. *
  53293. * @param {module:engine/view/selection~Selection|module:engine/view/documentselection~DocumentSelection} selection
  53294. * @returns {module:engine/view/element~Element|null}
  53295. */
  53296. function getSelectedImageWidget( selection ) {
  53297. const viewElement = selection.getSelectedElement();
  53298. if ( viewElement && isImageWidget( viewElement ) ) {
  53299. return viewElement;
  53300. }
  53301. return null;
  53302. }
  53303. /**
  53304. * Checks if the provided model element is an `image`.
  53305. *
  53306. * @param {module:engine/model/element~Element} modelElement
  53307. * @returns {Boolean}
  53308. */
  53309. function isImage( modelElement ) {
  53310. return !!modelElement && modelElement.is( 'element', 'image' );
  53311. }
  53312. /**
  53313. * Handles inserting single file. This method unifies image insertion using {@link module:widget/utils~findOptimalInsertionPosition} method.
  53314. *
  53315. * insertImage( model, { src: 'path/to/image.jpg' } );
  53316. *
  53317. * @param {module:engine/model/model~Model} model
  53318. * @param {Object} [attributes={}] Attributes of inserted image
  53319. * @param {module:engine/model/position~Position} [insertPosition] Position to insert the image. If not specified,
  53320. * the {@link module:widget/utils~findOptimalInsertionPosition} logic will be applied.
  53321. */
  53322. function insertImage( model, attributes = {}, insertPosition = null ) {
  53323. model.change( writer => {
  53324. const imageElement = writer.createElement( 'image', attributes );
  53325. const insertAtSelection = insertPosition || Object(ckeditor5_src_widget__WEBPACK_IMPORTED_MODULE_0__["findOptimalInsertionPosition"])( model.document.selection, model );
  53326. model.insertContent( imageElement, insertAtSelection );
  53327. // Inserting an image might've failed due to schema regulations.
  53328. if ( imageElement.parent ) {
  53329. writer.setSelection( imageElement, 'on' );
  53330. }
  53331. } );
  53332. }
  53333. /**
  53334. * Checks if image can be inserted at current model selection.
  53335. *
  53336. * @param {module:engine/model/model~Model} model
  53337. * @returns {Boolean}
  53338. */
  53339. function isImageAllowed( model ) {
  53340. const schema = model.schema;
  53341. const selection = model.document.selection;
  53342. return isImageAllowedInParent( selection, schema, model ) &&
  53343. !Object(ckeditor5_src_widget__WEBPACK_IMPORTED_MODULE_0__["checkSelectionOnObject"])( selection, schema ) &&
  53344. isInOtherImage( selection );
  53345. }
  53346. /**
  53347. * Get view `<img>` element from the view widget (`<figure>`).
  53348. *
  53349. * Assuming that image is always a first child of a widget (ie. `figureView.getChild( 0 )`) is unsafe as other features might
  53350. * inject their own elements to the widget.
  53351. *
  53352. * The `<img>` can be wrapped to other elements, e.g. `<a>`. Nested check required.
  53353. *
  53354. * @param {module:engine/view/element~Element} figureView
  53355. * @returns {module:engine/view/element~Element}
  53356. */
  53357. function getViewImgFromWidget( figureView ) {
  53358. const figureChildren = [];
  53359. for ( const figureChild of figureView.getChildren() ) {
  53360. figureChildren.push( figureChild );
  53361. if ( figureChild.is( 'element' ) ) {
  53362. figureChildren.push( ...figureChild.getChildren() );
  53363. }
  53364. }
  53365. return figureChildren.find( viewChild => viewChild.is( 'element', 'img' ) );
  53366. }
  53367. // Checks if image is allowed by schema in optimal insertion parent.
  53368. //
  53369. // @returns {Boolean}
  53370. function isImageAllowedInParent( selection, schema, model ) {
  53371. const parent = getInsertImageParent( selection, model );
  53372. return schema.checkChild( parent, 'image' );
  53373. }
  53374. // Checks if selection is placed in other image (ie. in caption).
  53375. function isInOtherImage( selection ) {
  53376. return [ ...selection.focus.getAncestors() ].every( ancestor => !ancestor.is( 'element', 'image' ) );
  53377. }
  53378. // Returns a node that will be used to insert image with `model.insertContent` to check if image can be placed there.
  53379. function getInsertImageParent( selection, model ) {
  53380. const insertAt = Object(ckeditor5_src_widget__WEBPACK_IMPORTED_MODULE_0__["findOptimalInsertionPosition"])( selection, model );
  53381. const parent = insertAt.parent;
  53382. if ( parent.isEmpty && !parent.is( 'element', '$root' ) ) {
  53383. return parent.parent;
  53384. }
  53385. return parent;
  53386. }
  53387. /***/ }),
  53388. /***/ "./node_modules/@ckeditor/ckeditor5-image/src/imagecaption.js":
  53389. /*!********************************************************************!*\
  53390. !*** ./node_modules/@ckeditor/ckeditor5-image/src/imagecaption.js ***!
  53391. \********************************************************************/
  53392. /*! exports provided: default */
  53393. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  53394. "use strict";
  53395. __webpack_require__.r(__webpack_exports__);
  53396. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ImageCaption; });
  53397. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  53398. /* harmony import */ var _imagecaption_imagecaptionediting__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./imagecaption/imagecaptionediting */ "./node_modules/@ckeditor/ckeditor5-image/src/imagecaption/imagecaptionediting.js");
  53399. /* harmony import */ var _theme_imagecaption_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../theme/imagecaption.css */ "./node_modules/@ckeditor/ckeditor5-image/theme/imagecaption.css");
  53400. /* harmony import */ var _theme_imagecaption_css__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_theme_imagecaption_css__WEBPACK_IMPORTED_MODULE_2__);
  53401. /**
  53402. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  53403. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  53404. */
  53405. /**
  53406. * @module image/imagecaption
  53407. */
  53408. /**
  53409. * The image caption plugin.
  53410. *
  53411. * For a detailed overview, check the {@glink features/image#image-captions image caption} documentation.
  53412. *
  53413. * @extends module:core/plugin~Plugin
  53414. */
  53415. class ImageCaption extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  53416. /**
  53417. * @inheritDoc
  53418. */
  53419. static get requires() {
  53420. return [ _imagecaption_imagecaptionediting__WEBPACK_IMPORTED_MODULE_1__["default"] ];
  53421. }
  53422. /**
  53423. * @inheritDoc
  53424. */
  53425. static get pluginName() {
  53426. return 'ImageCaption';
  53427. }
  53428. }
  53429. /***/ }),
  53430. /***/ "./node_modules/@ckeditor/ckeditor5-image/src/imagecaption/imagecaptionediting.js":
  53431. /*!****************************************************************************************!*\
  53432. !*** ./node_modules/@ckeditor/ckeditor5-image/src/imagecaption/imagecaptionediting.js ***!
  53433. \****************************************************************************************/
  53434. /*! exports provided: default */
  53435. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  53436. "use strict";
  53437. __webpack_require__.r(__webpack_exports__);
  53438. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ImageCaptionEditing; });
  53439. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  53440. /* harmony import */ var _image_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../image/utils */ "./node_modules/@ckeditor/ckeditor5-image/src/image/utils.js");
  53441. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils */ "./node_modules/@ckeditor/ckeditor5-image/src/imagecaption/utils.js");
  53442. /**
  53443. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  53444. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  53445. */
  53446. /**
  53447. * @module image/imagecaption/imagecaptionediting
  53448. */
  53449. /**
  53450. * The image caption engine plugin.
  53451. *
  53452. * It registers proper converters. It takes care of adding a caption element if the image without it is inserted
  53453. * to the model document.
  53454. *
  53455. * @extends module:core/plugin~Plugin
  53456. */
  53457. class ImageCaptionEditing extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  53458. /**
  53459. * @inheritDoc
  53460. */
  53461. static get pluginName() {
  53462. return 'ImageCaptionEditing';
  53463. }
  53464. /**
  53465. * @inheritDoc
  53466. */
  53467. init() {
  53468. const editor = this.editor;
  53469. const view = editor.editing.view;
  53470. const schema = editor.model.schema;
  53471. const data = editor.data;
  53472. const editing = editor.editing;
  53473. const t = editor.t;
  53474. /**
  53475. * The last selected caption editable.
  53476. * It is used for hiding the editable when it is empty and the image widget is no longer selected.
  53477. *
  53478. * @private
  53479. * @member {module:engine/view/editableelement~EditableElement} #_lastSelectedCaption
  53480. */
  53481. // Schema configuration.
  53482. if ( !schema.isRegistered( 'caption' ) ) {
  53483. schema.register( 'caption', {
  53484. allowIn: 'image',
  53485. allowContentOf: '$block',
  53486. isLimit: true
  53487. } );
  53488. } else {
  53489. schema.extend( 'caption', {
  53490. allowIn: 'image'
  53491. } );
  53492. }
  53493. // Add caption element to each image inserted without it.
  53494. editor.model.document.registerPostFixer( writer => this._insertMissingModelCaptionElement( writer ) );
  53495. // View to model converter for the data pipeline.
  53496. editor.conversion.for( 'upcast' ).elementToElement( {
  53497. view: _utils__WEBPACK_IMPORTED_MODULE_2__["matchImageCaption"],
  53498. model: 'caption'
  53499. } );
  53500. // Model to view converter for the data pipeline.
  53501. const createCaptionForData = writer => writer.createContainerElement( 'figcaption' );
  53502. data.downcastDispatcher.on( 'insert:caption', captionModelToView( createCaptionForData, false ) );
  53503. // Model to view converter for the editing pipeline.
  53504. const createCaptionForEditing = Object(_utils__WEBPACK_IMPORTED_MODULE_2__["captionElementCreator"])( view, t( 'Enter image caption' ) );
  53505. editing.downcastDispatcher.on( 'insert:caption', captionModelToView( createCaptionForEditing ) );
  53506. // Always show caption in view when something is inserted in model.
  53507. editing.downcastDispatcher.on(
  53508. 'insert',
  53509. this._fixCaptionVisibility( data => data.item ),
  53510. { priority: 'high' }
  53511. );
  53512. // Hide caption when everything is removed from it.
  53513. editing.downcastDispatcher.on( 'remove', this._fixCaptionVisibility( data => data.position.parent ), { priority: 'high' } );
  53514. // Update caption visibility on view in post fixer.
  53515. view.document.registerPostFixer( writer => this._updateCaptionVisibility( writer ) );
  53516. }
  53517. /**
  53518. * Updates the view before each rendering, making sure that empty captions (so unnecessary ones) are hidden
  53519. * and then visible when the image is selected.
  53520. *
  53521. * @private
  53522. * @param {module:engine/view/downcastwriter~DowncastWriter} viewWriter
  53523. * @returns {Boolean} Returns `true` when the view is updated.
  53524. */
  53525. _updateCaptionVisibility( viewWriter ) {
  53526. const mapper = this.editor.editing.mapper;
  53527. const lastCaption = this._lastSelectedCaption;
  53528. let viewCaption;
  53529. // If whole image is selected.
  53530. const modelSelection = this.editor.model.document.selection;
  53531. const selectedElement = modelSelection.getSelectedElement();
  53532. if ( selectedElement && selectedElement.is( 'element', 'image' ) ) {
  53533. const modelCaption = Object(_utils__WEBPACK_IMPORTED_MODULE_2__["getCaptionFromImage"])( selectedElement );
  53534. viewCaption = mapper.toViewElement( modelCaption );
  53535. }
  53536. // If selection is placed inside caption.
  53537. const position = modelSelection.getFirstPosition();
  53538. const modelCaption = getParentCaption( position.parent );
  53539. if ( modelCaption ) {
  53540. viewCaption = mapper.toViewElement( modelCaption );
  53541. }
  53542. // Is currently any caption selected?
  53543. if ( viewCaption && !this.editor.isReadOnly ) {
  53544. // Was any caption selected before?
  53545. if ( lastCaption ) {
  53546. // Same caption as before?
  53547. if ( lastCaption === viewCaption ) {
  53548. return showCaption( viewCaption, viewWriter );
  53549. } else {
  53550. hideCaptionIfEmpty( lastCaption, viewWriter );
  53551. this._lastSelectedCaption = viewCaption;
  53552. return showCaption( viewCaption, viewWriter );
  53553. }
  53554. } else {
  53555. this._lastSelectedCaption = viewCaption;
  53556. return showCaption( viewCaption, viewWriter );
  53557. }
  53558. } else {
  53559. // Was any caption selected before?
  53560. if ( lastCaption ) {
  53561. const viewModified = hideCaptionIfEmpty( lastCaption, viewWriter );
  53562. this._lastSelectedCaption = null;
  53563. return viewModified;
  53564. } else {
  53565. return false;
  53566. }
  53567. }
  53568. }
  53569. /**
  53570. * Returns a converter that fixes caption visibility during the model-to-view conversion.
  53571. * Checks if the changed node is placed inside the caption element and fixes its visibility in the view.
  53572. *
  53573. * @private
  53574. * @param {Function} nodeFinder
  53575. * @returns {Function}
  53576. */
  53577. _fixCaptionVisibility( nodeFinder ) {
  53578. return ( evt, data, conversionApi ) => {
  53579. const node = nodeFinder( data );
  53580. const modelCaption = getParentCaption( node );
  53581. const mapper = this.editor.editing.mapper;
  53582. const viewWriter = conversionApi.writer;
  53583. if ( modelCaption ) {
  53584. const viewCaption = mapper.toViewElement( modelCaption );
  53585. if ( viewCaption ) {
  53586. if ( modelCaption.childCount ) {
  53587. viewWriter.removeClass( 'ck-hidden', viewCaption );
  53588. } else {
  53589. viewWriter.addClass( 'ck-hidden', viewCaption );
  53590. }
  53591. }
  53592. }
  53593. };
  53594. }
  53595. /**
  53596. * Checks whether the data inserted to the model document have an image element that has no caption element inside it.
  53597. * If there is none, it adds it to the image element.
  53598. *
  53599. * @private
  53600. * @param {module:engine/model/writer~Writer} writer The writer to make changes with.
  53601. * @returns {Boolean} `true` if any change was applied, `false` otherwise.
  53602. */
  53603. _insertMissingModelCaptionElement( writer ) {
  53604. const model = this.editor.model;
  53605. const changes = model.document.differ.getChanges();
  53606. const imagesWithoutCaption = [];
  53607. for ( const entry of changes ) {
  53608. if ( entry.type == 'insert' && entry.name != '$text' ) {
  53609. const item = entry.position.nodeAfter;
  53610. if ( item.is( 'element', 'image' ) && !Object(_utils__WEBPACK_IMPORTED_MODULE_2__["getCaptionFromImage"])( item ) ) {
  53611. imagesWithoutCaption.push( item );
  53612. }
  53613. // Check elements with children for nested images.
  53614. if ( !item.is( 'element', 'image' ) && item.childCount ) {
  53615. for ( const nestedItem of model.createRangeIn( item ).getItems() ) {
  53616. if ( nestedItem.is( 'element', 'image' ) && !Object(_utils__WEBPACK_IMPORTED_MODULE_2__["getCaptionFromImage"])( nestedItem ) ) {
  53617. imagesWithoutCaption.push( nestedItem );
  53618. }
  53619. }
  53620. }
  53621. }
  53622. }
  53623. for ( const image of imagesWithoutCaption ) {
  53624. writer.appendElement( 'caption', image );
  53625. }
  53626. return !!imagesWithoutCaption.length;
  53627. }
  53628. }
  53629. // Creates a converter that converts image caption model element to view element.
  53630. //
  53631. // @private
  53632. // @param {Function} elementCreator
  53633. // @param {Boolean} [hide=true] When set to `false` view element will not be inserted when it's empty.
  53634. // @returns {Function}
  53635. function captionModelToView( elementCreator, hide = true ) {
  53636. return ( evt, data, conversionApi ) => {
  53637. const captionElement = data.item;
  53638. // Return if element shouldn't be present when empty.
  53639. if ( !captionElement.childCount && !hide ) {
  53640. return;
  53641. }
  53642. if ( Object(_image_utils__WEBPACK_IMPORTED_MODULE_1__["isImage"])( captionElement.parent ) ) {
  53643. if ( !conversionApi.consumable.consume( data.item, 'insert' ) ) {
  53644. return;
  53645. }
  53646. const viewImage = conversionApi.mapper.toViewElement( data.range.start.parent );
  53647. const viewCaption = elementCreator( conversionApi.writer );
  53648. const viewWriter = conversionApi.writer;
  53649. // Hide if empty.
  53650. if ( !captionElement.childCount ) {
  53651. viewWriter.addClass( 'ck-hidden', viewCaption );
  53652. }
  53653. insertViewCaptionAndBind( viewCaption, data.item, viewImage, conversionApi );
  53654. }
  53655. };
  53656. }
  53657. // Inserts `viewCaption` at the end of `viewImage` and binds it to `modelCaption`.
  53658. //
  53659. // @private
  53660. // @param {module:engine/view/containerelement~ContainerElement} viewCaption
  53661. // @param {module:engine/model/element~Element} modelCaption
  53662. // @param {module:engine/view/containerelement~ContainerElement} viewImage
  53663. // @param {module:engine/conversion/downcastdispatcher~DowncastConversionApi} conversionApi
  53664. function insertViewCaptionAndBind( viewCaption, modelCaption, viewImage, conversionApi ) {
  53665. const viewPosition = conversionApi.writer.createPositionAt( viewImage, 'end' );
  53666. conversionApi.writer.insert( viewPosition, viewCaption );
  53667. conversionApi.mapper.bindElements( modelCaption, viewCaption );
  53668. }
  53669. // Checks if the provided node or one of its ancestors is a caption element, and returns it.
  53670. //
  53671. // @private
  53672. // @param {module:engine/model/node~Node} node
  53673. // @returns {module:engine/model/element~Element|null}
  53674. function getParentCaption( node ) {
  53675. const ancestors = node.getAncestors( { includeSelf: true } );
  53676. const caption = ancestors.find( ancestor => ancestor.name == 'caption' );
  53677. if ( caption && caption.parent && caption.parent.name == 'image' ) {
  53678. return caption;
  53679. }
  53680. return null;
  53681. }
  53682. // Hides a given caption in the view if it is empty.
  53683. //
  53684. // @private
  53685. // @param {module:engine/view/containerelement~ContainerElement} caption
  53686. // @param {module:engine/view/downcastwriter~DowncastWriter} viewWriter
  53687. // @returns {Boolean} Returns `true` if the view was modified.
  53688. function hideCaptionIfEmpty( caption, viewWriter ) {
  53689. if ( !caption.childCount && !caption.hasClass( 'ck-hidden' ) ) {
  53690. viewWriter.addClass( 'ck-hidden', caption );
  53691. return true;
  53692. }
  53693. return false;
  53694. }
  53695. // Shows the caption.
  53696. //
  53697. // @private
  53698. // @param {module:engine/view/containerelement~ContainerElement} caption
  53699. // @param {module:engine/view/downcastwriter~DowncastWriter} viewWriter
  53700. // @returns {Boolean} Returns `true` if the view was modified.
  53701. function showCaption( caption, viewWriter ) {
  53702. if ( caption.hasClass( 'ck-hidden' ) ) {
  53703. viewWriter.removeClass( 'ck-hidden', caption );
  53704. return true;
  53705. }
  53706. return false;
  53707. }
  53708. /***/ }),
  53709. /***/ "./node_modules/@ckeditor/ckeditor5-image/src/imagecaption/utils.js":
  53710. /*!**************************************************************************!*\
  53711. !*** ./node_modules/@ckeditor/ckeditor5-image/src/imagecaption/utils.js ***!
  53712. \**************************************************************************/
  53713. /*! exports provided: captionElementCreator, isCaption, getCaptionFromImage, matchImageCaption */
  53714. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  53715. "use strict";
  53716. __webpack_require__.r(__webpack_exports__);
  53717. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "captionElementCreator", function() { return captionElementCreator; });
  53718. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isCaption", function() { return isCaption; });
  53719. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getCaptionFromImage", function() { return getCaptionFromImage; });
  53720. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "matchImageCaption", function() { return matchImageCaption; });
  53721. /* harmony import */ var ckeditor5_src_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/engine */ "./node_modules/ckeditor5/src/engine.js");
  53722. /* harmony import */ var ckeditor5_src_widget__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/widget */ "./node_modules/ckeditor5/src/widget.js");
  53723. /**
  53724. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  53725. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  53726. */
  53727. /**
  53728. * @module image/imagecaption/utils
  53729. */
  53730. /**
  53731. * Returns a function that creates a caption editable element for the given {@link module:engine/view/document~Document}.
  53732. *
  53733. * @param {module:engine/view/view~View} view
  53734. * @param {String} placeholderText The text to be displayed when the caption is empty.
  53735. * @returns {Function}
  53736. */
  53737. function captionElementCreator( view, placeholderText ) {
  53738. return writer => {
  53739. const editable = writer.createEditableElement( 'figcaption' );
  53740. writer.setCustomProperty( 'imageCaption', true, editable );
  53741. Object(ckeditor5_src_engine__WEBPACK_IMPORTED_MODULE_0__["enablePlaceholder"])( {
  53742. view,
  53743. element: editable,
  53744. text: placeholderText
  53745. } );
  53746. return Object(ckeditor5_src_widget__WEBPACK_IMPORTED_MODULE_1__["toWidgetEditable"])( editable, writer );
  53747. };
  53748. }
  53749. /**
  53750. * Returns `true` if a given view element is the image caption editable.
  53751. *
  53752. * @param {module:engine/view/element~Element} viewElement
  53753. * @returns {Boolean}
  53754. */
  53755. function isCaption( viewElement ) {
  53756. return !!viewElement.getCustomProperty( 'imageCaption' );
  53757. }
  53758. /**
  53759. * Returns the caption model element from a given image element. Returns `null` if no caption is found.
  53760. *
  53761. * @param {module:engine/model/element~Element} imageModelElement
  53762. * @returns {module:engine/model/element~Element|null}
  53763. */
  53764. function getCaptionFromImage( imageModelElement ) {
  53765. for ( const node of imageModelElement.getChildren() ) {
  53766. if ( !!node && node.is( 'element', 'caption' ) ) {
  53767. return node;
  53768. }
  53769. }
  53770. return null;
  53771. }
  53772. /**
  53773. * {@link module:engine/view/matcher~Matcher} pattern. Checks if a given element is a `<figcaption>` element that is placed
  53774. * inside the image `<figure>` element.
  53775. *
  53776. * @param {module:engine/view/element~Element} element
  53777. * @returns {Object|null} Returns the object accepted by {@link module:engine/view/matcher~Matcher} or `null` if the element
  53778. * cannot be matched.
  53779. */
  53780. function matchImageCaption( element ) {
  53781. const parent = element.parent;
  53782. // Convert only captions for images.
  53783. if ( element.name == 'figcaption' && parent && parent.name == 'figure' && parent.hasClass( 'image' ) ) {
  53784. return { name: true };
  53785. }
  53786. return null;
  53787. }
  53788. /***/ }),
  53789. /***/ "./node_modules/@ckeditor/ckeditor5-image/src/imageresize.js":
  53790. /*!*******************************************************************!*\
  53791. !*** ./node_modules/@ckeditor/ckeditor5-image/src/imageresize.js ***!
  53792. \*******************************************************************/
  53793. /*! exports provided: default */
  53794. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  53795. "use strict";
  53796. __webpack_require__.r(__webpack_exports__);
  53797. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ImageResize; });
  53798. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  53799. /* harmony import */ var _imageresize_imageresizebuttons__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./imageresize/imageresizebuttons */ "./node_modules/@ckeditor/ckeditor5-image/src/imageresize/imageresizebuttons.js");
  53800. /* harmony import */ var _imageresize_imageresizeediting__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./imageresize/imageresizeediting */ "./node_modules/@ckeditor/ckeditor5-image/src/imageresize/imageresizeediting.js");
  53801. /* harmony import */ var _imageresize_imageresizehandles__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./imageresize/imageresizehandles */ "./node_modules/@ckeditor/ckeditor5-image/src/imageresize/imageresizehandles.js");
  53802. /* harmony import */ var _theme_imageresize_css__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../theme/imageresize.css */ "./node_modules/@ckeditor/ckeditor5-image/theme/imageresize.css");
  53803. /* harmony import */ var _theme_imageresize_css__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_theme_imageresize_css__WEBPACK_IMPORTED_MODULE_4__);
  53804. /**
  53805. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  53806. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  53807. */
  53808. /**
  53809. * @module image/imageresize
  53810. */
  53811. /**
  53812. * The image resize plugin.
  53813. *
  53814. * It adds a possibility to resize each image using handles.
  53815. *
  53816. * @extends module:core/plugin~Plugin
  53817. */
  53818. class ImageResize extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  53819. /**
  53820. * @inheritDoc
  53821. */
  53822. static get requires() {
  53823. return [ _imageresize_imageresizeediting__WEBPACK_IMPORTED_MODULE_2__["default"], _imageresize_imageresizehandles__WEBPACK_IMPORTED_MODULE_3__["default"], _imageresize_imageresizebuttons__WEBPACK_IMPORTED_MODULE_1__["default"] ];
  53824. }
  53825. /**
  53826. * @inheritDoc
  53827. */
  53828. static get pluginName() {
  53829. return 'ImageResize';
  53830. }
  53831. }
  53832. /**
  53833. * The available options are `'px'` or `'%'`.
  53834. *
  53835. * Determines the size unit applied to the resized image.
  53836. *
  53837. * ClassicEditor
  53838. * .create( editorElement, {
  53839. * image: {
  53840. * resizeUnit: 'px'
  53841. * }
  53842. * } )
  53843. * .then( ... )
  53844. * .catch( ... );
  53845. *
  53846. *
  53847. * This option is used by the {@link module:image/imageresize~ImageResize} feature.
  53848. *
  53849. * @default '%'
  53850. * @member {String} module:image/image~ImageConfig#resizeUnit
  53851. */
  53852. /**
  53853. * The image resize options.
  53854. *
  53855. * Each option should have at least these two properties:
  53856. *
  53857. * * name: The name of the UI component registered in the global
  53858. * {@link module:core/editor/editorui~EditorUI#componentFactory component factory} of the editor,
  53859. * representing the button a user can click to change the size of an image,
  53860. * * value: An actual image width applied when a user clicks the mentioned button
  53861. * ({@link module:image/imageresize/resizeimagecommand~ResizeImageCommand} gets executed).
  53862. * The value property is combined with the {@link module:image/image~ImageConfig#resizeUnit `config.image.resizeUnit`} (`%` by default).
  53863. * For instance: `value: '50'` and `resizeUnit: '%'` will render as `'50%'` in the UI.
  53864. *
  53865. * **Resetting the image size**
  53866. *
  53867. * If you want to set an option that will reset image to its original size, you need to pass a `null` value
  53868. * to one of the options. The `:original` token is not mandatory, you can call it anything you wish, but it must reflect
  53869. * in the standalone buttons configuration for the image toolbar.
  53870. *
  53871. * ClassicEditor
  53872. * .create( editorElement, {
  53873. * image: {
  53874. * resizeUnit: "%",
  53875. * resizeOptions: [ {
  53876. * name: 'resizeImage:original',
  53877. * value: null
  53878. * },
  53879. * {
  53880. * name: 'resizeImage:50',
  53881. * value: '50'
  53882. * },
  53883. * {
  53884. * name: 'resizeImage:75',
  53885. * value: '75'
  53886. * } ]
  53887. * }
  53888. * } )
  53889. * .then( ... )
  53890. * .catch( ... );
  53891. *
  53892. * **Resizing images using a dropdown**
  53893. *
  53894. * With resize options defined, you can decide whether you want to display them as a dropdown or as standalone buttons.
  53895. * For the dropdown, you need to pass only the `resizeImage` token to the
  53896. {@link module:image/image~ImageConfig#toolbar `config.image.toolbar`}. The dropdown contains all defined options by default:
  53897. *
  53898. * ClassicEditor
  53899. * .create( editorElement, {
  53900. * image: {
  53901. * resizeUnit: "%",
  53902. * resizeOptions: [ {
  53903. * name: 'resizeImage:original',
  53904. * value: null
  53905. * },
  53906. * {
  53907. * name: 'resizeImage:50',
  53908. * value: '50'
  53909. * },
  53910. * {
  53911. * name: 'resizeImage:75',
  53912. * value: '75'
  53913. * } ],
  53914. * toolbar: [ 'resizeImage', ... ],
  53915. * }
  53916. * } )
  53917. * .then( ... )
  53918. * .catch( ... );
  53919. *
  53920. * **Resizing images using individual buttons**
  53921. *
  53922. * If you want to have separate buttons for {@link module:image/imageresize/imageresizebuttons~ImageResizeOption each option},
  53923. * pass their names to the {@link module:image/image~ImageConfig#toolbar `config.image.toolbar`} instead. Please keep in mind
  53924. * that this time **you must define the additional
  53925. * {@link module:image/imageresize/imageresizebuttons~ImageResizeOption `icon` property}**:
  53926. *
  53927. * ClassicEditor
  53928. * .create( editorElement, {
  53929. * image: {
  53930. * resizeUnit: "%",
  53931. * resizeOptions: [ {
  53932. * name: 'resizeImage:original',
  53933. * value: null,
  53934. * icon: 'original'
  53935. * },
  53936. * {
  53937. * name: 'resizeImage:25',
  53938. * value: '25',
  53939. * icon: 'small'
  53940. * },
  53941. * {
  53942. * name: 'resizeImage:50',
  53943. * value: '50',
  53944. * icon: 'medium'
  53945. * },
  53946. * {
  53947. * name: 'resizeImage:75',
  53948. * value: '75',
  53949. * icon: 'large'
  53950. * } ],
  53951. * toolbar: [ 'resizeImage:25', 'resizeImage:50', 'resizeImage:75', 'resizeImage:original', ... ],
  53952. * }
  53953. * } )
  53954. * .then( ... )
  53955. * .catch( ... );
  53956. *
  53957. * **Customizing resize button labels**
  53958. *
  53959. * You can set your own label for each resize button. To do that, add the `label` property like in the example below.
  53960. *
  53961. * * When using the **dropdown**, the labels are displayed on the list of all options when you open the dropdown.
  53962. * * When using **standalone buttons**, the labels will are displayed as tooltips when a user hovers over the button.
  53963. *
  53964. * ClassicEditor
  53965. * .create( editorElement, {
  53966. * image: {
  53967. * resizeUnit: "%",
  53968. * resizeOptions: [ {
  53969. * name: 'resizeImage:original',
  53970. * value: null,
  53971. * label: 'Original size'
  53972. * // Note: add the "icon" property if you're configuring a standalone button.
  53973. * },
  53974. * {
  53975. * name: 'resizeImage:50',
  53976. * value: '50',
  53977. * label: 'Medium size'
  53978. * // Note: add the "icon" property if you're configuring a standalone button.
  53979. * },
  53980. * {
  53981. * name: 'resizeImage:75',
  53982. * value: '75',
  53983. * label: 'Large size'
  53984. * // Note: add the "icon" property if you're configuring a standalone button.
  53985. * } ]
  53986. * }
  53987. * } )
  53988. * .then( ... )
  53989. * .catch( ... );
  53990. *
  53991. * **Default value**
  53992. *
  53993. * The following configuration is used by default:
  53994. *
  53995. * resizeOptions = [
  53996. * {
  53997. * name: 'resizeImage:original',
  53998. * value: null,
  53999. * icon: 'original'
  54000. * },
  54001. * {
  54002. * name: 'resizeImage:25',
  54003. * value: '25',
  54004. * icon: 'small'
  54005. * },
  54006. * {
  54007. * name: 'resizeImage:50',
  54008. * value: '50',
  54009. * icon: 'medium'
  54010. * },
  54011. * {
  54012. * name: 'resizeImage:75',
  54013. * value: '75',
  54014. * icon: 'large'
  54015. * }
  54016. * ];
  54017. *
  54018. * @member {Array.<module:image/imageresize/imageresizebuttons~ImageResizeOption>} module:image/image~ImageConfig#resizeOptions
  54019. */
  54020. /***/ }),
  54021. /***/ "./node_modules/@ckeditor/ckeditor5-image/src/imageresize/imageresizebuttons.js":
  54022. /*!**************************************************************************************!*\
  54023. !*** ./node_modules/@ckeditor/ckeditor5-image/src/imageresize/imageresizebuttons.js ***!
  54024. \**************************************************************************************/
  54025. /*! exports provided: default */
  54026. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  54027. "use strict";
  54028. __webpack_require__.r(__webpack_exports__);
  54029. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ImageResizeButtons; });
  54030. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  54031. /* harmony import */ var ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/ui */ "./node_modules/ckeditor5/src/ui.js");
  54032. /* harmony import */ var ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ckeditor5/src/utils */ "./node_modules/ckeditor5/src/utils.js");
  54033. /* harmony import */ var _imageresizeediting__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./imageresizeediting */ "./node_modules/@ckeditor/ckeditor5-image/src/imageresize/imageresizeediting.js");
  54034. /**
  54035. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  54036. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  54037. */
  54038. /**
  54039. * @module image/imageresize/imageresizebuttons
  54040. */
  54041. const RESIZE_ICONS = {
  54042. small: ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["icons"].objectSizeSmall,
  54043. medium: ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["icons"].objectSizeMedium,
  54044. large: ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["icons"].objectSizeLarge,
  54045. original: ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["icons"].objectSizeFull
  54046. };
  54047. /**
  54048. * The image resize buttons plugin.
  54049. *
  54050. * It adds a possibility to resize images using the toolbar dropdown or individual buttons, depending on the plugin configuration.
  54051. *
  54052. * @extends module:core/plugin~Plugin
  54053. */
  54054. class ImageResizeButtons extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  54055. /**
  54056. * @inheritDoc
  54057. */
  54058. static get requires() {
  54059. return [ _imageresizeediting__WEBPACK_IMPORTED_MODULE_3__["default"] ];
  54060. }
  54061. /**
  54062. * @inheritDoc
  54063. */
  54064. static get pluginName() {
  54065. return 'ImageResizeButtons';
  54066. }
  54067. /**
  54068. * @inheritDoc
  54069. */
  54070. constructor( editor ) {
  54071. super( editor );
  54072. /**
  54073. * The resize unit.
  54074. *
  54075. * @readonly
  54076. * @private
  54077. * @type {module:image/image~ImageConfig#resizeUnit}
  54078. * @default '%'
  54079. */
  54080. this._resizeUnit = editor.config.get( 'image.resizeUnit' );
  54081. }
  54082. /**
  54083. * @inheritDoc
  54084. */
  54085. init() {
  54086. const editor = this.editor;
  54087. const options = editor.config.get( 'image.resizeOptions' );
  54088. const command = editor.commands.get( 'resizeImage' );
  54089. this.bind( 'isEnabled' ).to( command );
  54090. for ( const option of options ) {
  54091. this._registerImageResizeButton( option );
  54092. }
  54093. this._registerImageResizeDropdown( options );
  54094. }
  54095. /**
  54096. * A helper function that creates a standalone button component for the plugin.
  54097. *
  54098. * @private
  54099. * @param {module:image/imageresize/imageresizebuttons~ImageResizeOption} resizeOption A model of the resize option.
  54100. */
  54101. _registerImageResizeButton( option ) {
  54102. const editor = this.editor;
  54103. const { name, value, icon } = option;
  54104. const optionValueWithUnit = value ? value + this._resizeUnit : null;
  54105. editor.ui.componentFactory.add( name, locale => {
  54106. const button = new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__["ButtonView"]( locale );
  54107. const command = editor.commands.get( 'resizeImage' );
  54108. const labelText = this._getOptionLabelValue( option, true );
  54109. if ( !RESIZE_ICONS[ icon ] ) {
  54110. /**
  54111. * When configuring {@link module:image/image~ImageConfig#resizeOptions `config.image.resizeOptions`} for standalone
  54112. * buttons, a valid `icon` token must be set for each option.
  54113. *
  54114. * See all valid options described in the
  54115. * {@link module:image/imageresize/imageresizebuttons~ImageResizeOption plugin configuration}.
  54116. *
  54117. * @error imageresizebuttons-missing-icon
  54118. * @param {module:image/imageresize/imageresizebuttons~ImageResizeOption} option Invalid image resize option.
  54119. */
  54120. throw new ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_2__["CKEditorError"](
  54121. 'imageresizebuttons-missing-icon',
  54122. editor,
  54123. option
  54124. );
  54125. }
  54126. button.set( {
  54127. // Use the `label` property for a verbose description (because of ARIA).
  54128. label: labelText,
  54129. icon: RESIZE_ICONS[ icon ],
  54130. tooltip: labelText,
  54131. isToggleable: true
  54132. } );
  54133. // Bind button to the command.
  54134. button.bind( 'isEnabled' ).to( this );
  54135. button.bind( 'isOn' ).to( command, 'value', getIsOnButtonCallback( optionValueWithUnit ) );
  54136. this.listenTo( button, 'execute', () => {
  54137. editor.execute( 'resizeImage', { width: optionValueWithUnit } );
  54138. } );
  54139. return button;
  54140. } );
  54141. }
  54142. /**
  54143. * A helper function that creates a dropdown component for the plugin containing all the resize options defined in
  54144. * the editor configuration.
  54145. *
  54146. * @private
  54147. * @param {Array.<module:image/imageresize/imageresizebuttons~ImageResizeOption>} options An array of configured options.
  54148. */
  54149. _registerImageResizeDropdown( options ) {
  54150. const editor = this.editor;
  54151. const t = editor.t;
  54152. const originalSizeOption = options.find( option => !option.value );
  54153. const componentCreator = locale => {
  54154. const command = editor.commands.get( 'resizeImage' );
  54155. const dropdownView = Object(ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__["createDropdown"])( locale, ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__["DropdownButtonView"] );
  54156. const dropdownButton = dropdownView.buttonView;
  54157. dropdownButton.set( {
  54158. tooltip: t( 'Resize image' ),
  54159. commandValue: originalSizeOption.value,
  54160. icon: RESIZE_ICONS.medium,
  54161. isToggleable: true,
  54162. label: this._getOptionLabelValue( originalSizeOption ),
  54163. withText: true,
  54164. class: 'ck-resize-image-button'
  54165. } );
  54166. dropdownButton.bind( 'label' ).to( command, 'value', commandValue => {
  54167. if ( commandValue && commandValue.width ) {
  54168. return commandValue.width;
  54169. } else {
  54170. return this._getOptionLabelValue( originalSizeOption );
  54171. }
  54172. } );
  54173. dropdownView.bind( 'isOn' ).to( command );
  54174. dropdownView.bind( 'isEnabled' ).to( this );
  54175. Object(ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__["addListToDropdown"])( dropdownView, this._getResizeDropdownListItemDefinitions( options, command ) );
  54176. dropdownView.listView.ariaLabel = t( 'Image resize list' );
  54177. // Execute command when an item from the dropdown is selected.
  54178. this.listenTo( dropdownView, 'execute', evt => {
  54179. editor.execute( evt.source.commandName, { width: evt.source.commandValue } );
  54180. editor.editing.view.focus();
  54181. } );
  54182. return dropdownView;
  54183. };
  54184. // Register `resizeImage` dropdown and add `imageResize` dropdown as an alias for backward compatibility.
  54185. editor.ui.componentFactory.add( 'resizeImage', componentCreator );
  54186. editor.ui.componentFactory.add( 'imageResize', componentCreator );
  54187. }
  54188. /**
  54189. * A helper function for creating an option label value string.
  54190. *
  54191. * @private
  54192. * @param {module:image/imageresize/imageresizebuttons~ImageResizeOption} option A resize option object.
  54193. * @param {Boolean} [forTooltip] An optional flag for creating a tooltip label.
  54194. * @returns {String} A user-defined label combined from the numeric value and the resize unit or the default label
  54195. * for reset options (`Original`).
  54196. */
  54197. _getOptionLabelValue( option, forTooltip ) {
  54198. const t = this.editor.t;
  54199. if ( option.label ) {
  54200. return option.label;
  54201. } else if ( forTooltip ) {
  54202. if ( option.value ) {
  54203. return t( 'Resize image to %0', option.value + this._resizeUnit );
  54204. } else {
  54205. return t( 'Resize image to the original size' );
  54206. }
  54207. } else {
  54208. if ( option.value ) {
  54209. return option.value + this._resizeUnit;
  54210. } else {
  54211. return t( 'Original' );
  54212. }
  54213. }
  54214. }
  54215. /**
  54216. * A helper function that parses the resize options and returns list item definitions ready for use in the dropdown.
  54217. *
  54218. * @private
  54219. * @param {Array.<module:image/imageresize/imageresizebuttons~ImageResizeOption>} options The resize options.
  54220. * @param {module:image/imageresize/resizeimagecommand~ResizeImageCommand} command The resize image command.
  54221. * @returns {Iterable.<module:ui/dropdown/utils~ListDropdownItemDefinition>} Dropdown item definitions.
  54222. */
  54223. _getResizeDropdownListItemDefinitions( options, command ) {
  54224. const itemDefinitions = new ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_2__["Collection"]();
  54225. options.map( option => {
  54226. const optionValueWithUnit = option.value ? option.value + this._resizeUnit : null;
  54227. const definition = {
  54228. type: 'button',
  54229. model: new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__["Model"]( {
  54230. commandName: 'resizeImage',
  54231. commandValue: optionValueWithUnit,
  54232. label: this._getOptionLabelValue( option ),
  54233. withText: true,
  54234. icon: null
  54235. } )
  54236. };
  54237. definition.model.bind( 'isOn' ).to( command, 'value', getIsOnButtonCallback( optionValueWithUnit ) );
  54238. itemDefinitions.add( definition );
  54239. } );
  54240. return itemDefinitions;
  54241. }
  54242. }
  54243. // A helper function for setting the `isOn` state of buttons in value bindings.
  54244. function getIsOnButtonCallback( value ) {
  54245. return commandValue => {
  54246. if ( value === null && commandValue === value ) {
  54247. return true;
  54248. }
  54249. return commandValue && commandValue.width === value;
  54250. };
  54251. }
  54252. /**
  54253. * The image resize option used in the {@link module:image/image~ImageConfig#resizeOptions image resize configuration}.
  54254. *
  54255. * @typedef {Object} module:image/imageresize/imageresizebuttons~ImageResizeOption
  54256. * @property {String} name The name of the UI component that changes the image size.
  54257. * * If you configure the feature using individual resize buttons, you can refer to this name in the
  54258. * {@link module:image/image~ImageConfig#toolbar image toolbar configuration}.
  54259. * * If you configure the feature using the resize dropdown, this name will be used for a list item in the dropdown.
  54260. * @property {String} value The value of the resize option without the unit
  54261. * ({@link module:image/image~ImageConfig#resizeUnit configured separately}). `null` resets an image to its original size.
  54262. * @property {String} [resizeOptions.icon] An icon used by an individual resize button (see the `name` property to learn more).
  54263. * Available icons are: `'small'`, `'medium'`, `'large'`, `'original'`.
  54264. * @property {String} [label] An option label displayed in the dropdown or, if the feature is configured using
  54265. * individual buttons, a {@link module:ui/button/buttonview~ButtonView#tooltip} and an ARIA attribute of a button.
  54266. * If not specified, the label is generated automatically based on the `value` option and the
  54267. * {@link module:image/image~ImageConfig#resizeUnit `config.image.resizeUnit`}.
  54268. */
  54269. /***/ }),
  54270. /***/ "./node_modules/@ckeditor/ckeditor5-image/src/imageresize/imageresizeediting.js":
  54271. /*!**************************************************************************************!*\
  54272. !*** ./node_modules/@ckeditor/ckeditor5-image/src/imageresize/imageresizeediting.js ***!
  54273. \**************************************************************************************/
  54274. /*! exports provided: default */
  54275. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  54276. "use strict";
  54277. __webpack_require__.r(__webpack_exports__);
  54278. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ImageResizeEditing; });
  54279. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  54280. /* harmony import */ var _resizeimagecommand__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./resizeimagecommand */ "./node_modules/@ckeditor/ckeditor5-image/src/imageresize/resizeimagecommand.js");
  54281. /**
  54282. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  54283. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  54284. */
  54285. /**
  54286. * @module image/imageresize/imageresizeediting
  54287. */
  54288. /**
  54289. * The image resize editing feature.
  54290. *
  54291. * It adds the ability to resize each image using handles or manually by
  54292. * {@link module:image/imageresize/imageresizebuttons~ImageResizeButtons} buttons.
  54293. *
  54294. * @extends module:core/plugin~Plugin
  54295. */
  54296. class ImageResizeEditing extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  54297. /**
  54298. * @inheritDoc
  54299. */
  54300. static get pluginName() {
  54301. return 'ImageResizeEditing';
  54302. }
  54303. /**
  54304. * @inheritDoc
  54305. */
  54306. constructor( editor ) {
  54307. super( editor );
  54308. editor.config.define( 'image', {
  54309. resizeUnit: '%',
  54310. resizeOptions: [ {
  54311. name: 'resizeImage:original',
  54312. value: null,
  54313. icon: 'original'
  54314. },
  54315. {
  54316. name: 'resizeImage:25',
  54317. value: '25',
  54318. icon: 'small'
  54319. },
  54320. {
  54321. name: 'resizeImage:50',
  54322. value: '50',
  54323. icon: 'medium'
  54324. },
  54325. {
  54326. name: 'resizeImage:75',
  54327. value: '75',
  54328. icon: 'large'
  54329. } ]
  54330. } );
  54331. }
  54332. /**
  54333. * @inheritDoc
  54334. */
  54335. init() {
  54336. const editor = this.editor;
  54337. const resizeImageCommand = new _resizeimagecommand__WEBPACK_IMPORTED_MODULE_1__["default"]( editor );
  54338. this._registerSchema();
  54339. this._registerConverters();
  54340. // Register `resizeImage` command and add `imageResize` command as an alias for backward compatibility.
  54341. editor.commands.add( 'resizeImage', resizeImageCommand );
  54342. editor.commands.add( 'imageResize', resizeImageCommand );
  54343. }
  54344. /**
  54345. * @private
  54346. */
  54347. _registerSchema() {
  54348. this.editor.model.schema.extend( 'image', { allowAttributes: 'width' } );
  54349. this.editor.model.schema.setAttributeProperties( 'width', {
  54350. isFormatting: true
  54351. } );
  54352. }
  54353. /**
  54354. * Registers image resize converters.
  54355. *
  54356. * @private
  54357. */
  54358. _registerConverters() {
  54359. const editor = this.editor;
  54360. // Dedicated converter to propagate image's attribute to the img tag.
  54361. editor.conversion.for( 'downcast' ).add( dispatcher =>
  54362. dispatcher.on( 'attribute:width:image', ( evt, data, conversionApi ) => {
  54363. if ( !conversionApi.consumable.consume( data.item, evt.name ) ) {
  54364. return;
  54365. }
  54366. const viewWriter = conversionApi.writer;
  54367. const figure = conversionApi.mapper.toViewElement( data.item );
  54368. if ( data.attributeNewValue !== null ) {
  54369. viewWriter.setStyle( 'width', data.attributeNewValue, figure );
  54370. viewWriter.addClass( 'image_resized', figure );
  54371. } else {
  54372. viewWriter.removeStyle( 'width', figure );
  54373. viewWriter.removeClass( 'image_resized', figure );
  54374. }
  54375. } )
  54376. );
  54377. editor.conversion.for( 'upcast' )
  54378. .attributeToAttribute( {
  54379. view: {
  54380. name: 'figure',
  54381. styles: {
  54382. width: /.+/
  54383. }
  54384. },
  54385. model: {
  54386. key: 'width',
  54387. value: viewElement => viewElement.getStyle( 'width' )
  54388. }
  54389. } );
  54390. }
  54391. }
  54392. /***/ }),
  54393. /***/ "./node_modules/@ckeditor/ckeditor5-image/src/imageresize/imageresizehandles.js":
  54394. /*!**************************************************************************************!*\
  54395. !*** ./node_modules/@ckeditor/ckeditor5-image/src/imageresize/imageresizehandles.js ***!
  54396. \**************************************************************************************/
  54397. /*! exports provided: default */
  54398. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  54399. "use strict";
  54400. __webpack_require__.r(__webpack_exports__);
  54401. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ImageResizeHandles; });
  54402. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  54403. /* harmony import */ var ckeditor5_src_widget__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/widget */ "./node_modules/ckeditor5/src/widget.js");
  54404. /* harmony import */ var _image_imageloadobserver__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../image/imageloadobserver */ "./node_modules/@ckeditor/ckeditor5-image/src/image/imageloadobserver.js");
  54405. /**
  54406. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  54407. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  54408. */
  54409. /**
  54410. * @module image/imageresize/imageresizehandles
  54411. */
  54412. /**
  54413. * The image resize by handles feature.
  54414. *
  54415. * It adds the ability to resize each image using handles or manually by
  54416. * {@link module:image/imageresize/imageresizebuttons~ImageResizeButtons} buttons.
  54417. *
  54418. * @extends module:core/plugin~Plugin
  54419. */
  54420. class ImageResizeHandles extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  54421. /**
  54422. * @inheritDoc
  54423. */
  54424. static get requires() {
  54425. return [ ckeditor5_src_widget__WEBPACK_IMPORTED_MODULE_1__["WidgetResize"] ];
  54426. }
  54427. /**
  54428. * @inheritDoc
  54429. */
  54430. static get pluginName() {
  54431. return 'ImageResizeHandles';
  54432. }
  54433. /**
  54434. * @inheritDoc
  54435. */
  54436. init() {
  54437. const command = this.editor.commands.get( 'resizeImage' );
  54438. this.bind( 'isEnabled' ).to( command );
  54439. this._setupResizerCreator();
  54440. }
  54441. /**
  54442. * Attaches the listeners responsible for creating a resizer for each image, except for images inside the HTML embed preview.
  54443. *
  54444. * @private
  54445. */
  54446. _setupResizerCreator() {
  54447. const editor = this.editor;
  54448. const editingView = editor.editing.view;
  54449. editingView.addObserver( _image_imageloadobserver__WEBPACK_IMPORTED_MODULE_2__["default"] );
  54450. this.listenTo( editingView.document, 'imageLoaded', ( evt, domEvent ) => {
  54451. // The resizer must be attached only to images loaded by the `ImageInsert`, `ImageUpload` or `LinkImage` plugins.
  54452. if ( !domEvent.target.matches( 'figure.image.ck-widget > img, figure.image.ck-widget > a > img' ) ) {
  54453. return;
  54454. }
  54455. const imageView = editor.editing.view.domConverter.domToView( domEvent.target );
  54456. const widgetView = imageView.findAncestor( 'figure' );
  54457. let resizer = this.editor.plugins.get( ckeditor5_src_widget__WEBPACK_IMPORTED_MODULE_1__["WidgetResize"] ).getResizerByViewElement( widgetView );
  54458. if ( resizer ) {
  54459. // There are rare cases when the image will be triggered multiple times for the same widget, e.g. when
  54460. // the image's source was changed after upload (https://github.com/ckeditor/ckeditor5/pull/8108#issuecomment-708302992).
  54461. resizer.redraw();
  54462. return;
  54463. }
  54464. const mapper = editor.editing.mapper;
  54465. const imageModel = mapper.toModelElement( widgetView );
  54466. resizer = editor.plugins
  54467. .get( ckeditor5_src_widget__WEBPACK_IMPORTED_MODULE_1__["WidgetResize"] )
  54468. .attachTo( {
  54469. unit: editor.config.get( 'image.resizeUnit' ),
  54470. modelElement: imageModel,
  54471. viewElement: widgetView,
  54472. editor,
  54473. getHandleHost( domWidgetElement ) {
  54474. return domWidgetElement.querySelector( 'img' );
  54475. },
  54476. getResizeHost( domWidgetElement ) {
  54477. return domWidgetElement;
  54478. },
  54479. // TODO consider other positions.
  54480. isCentered() {
  54481. const imageStyle = imageModel.getAttribute( 'imageStyle' );
  54482. return !imageStyle || imageStyle == 'full' || imageStyle == 'alignCenter';
  54483. },
  54484. onCommit( newValue ) {
  54485. editor.execute( 'resizeImage', { width: newValue } );
  54486. }
  54487. } );
  54488. resizer.on( 'updateSize', () => {
  54489. if ( !widgetView.hasClass( 'image_resized' ) ) {
  54490. editingView.change( writer => {
  54491. writer.addClass( 'image_resized', widgetView );
  54492. } );
  54493. }
  54494. } );
  54495. resizer.bind( 'isEnabled' ).to( this );
  54496. } );
  54497. }
  54498. }
  54499. /***/ }),
  54500. /***/ "./node_modules/@ckeditor/ckeditor5-image/src/imageresize/resizeimagecommand.js":
  54501. /*!**************************************************************************************!*\
  54502. !*** ./node_modules/@ckeditor/ckeditor5-image/src/imageresize/resizeimagecommand.js ***!
  54503. \**************************************************************************************/
  54504. /*! exports provided: default */
  54505. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  54506. "use strict";
  54507. __webpack_require__.r(__webpack_exports__);
  54508. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ResizeImageCommand; });
  54509. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  54510. /* harmony import */ var _image_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../image/utils */ "./node_modules/@ckeditor/ckeditor5-image/src/image/utils.js");
  54511. /**
  54512. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  54513. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  54514. */
  54515. /**
  54516. * @module image/imageresize/resizeimagecommand
  54517. */
  54518. /**
  54519. * The resize image command. Currently, it only supports the width attribute.
  54520. *
  54521. * @extends module:core/command~Command
  54522. */
  54523. class ResizeImageCommand extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Command"] {
  54524. /**
  54525. * @inheritDoc
  54526. */
  54527. refresh() {
  54528. const element = this.editor.model.document.selection.getSelectedElement();
  54529. this.isEnabled = Object(_image_utils__WEBPACK_IMPORTED_MODULE_1__["isImage"])( element );
  54530. if ( !element || !element.hasAttribute( 'width' ) ) {
  54531. this.value = null;
  54532. } else {
  54533. this.value = {
  54534. width: element.getAttribute( 'width' ),
  54535. height: null
  54536. };
  54537. }
  54538. }
  54539. /**
  54540. * Executes the command.
  54541. *
  54542. * // Sets the width to 50%:
  54543. * editor.execute( 'resizeImage', { width: '50%' } );
  54544. *
  54545. * // Removes the width attribute:
  54546. * editor.execute( 'resizeImage', { width: null } );
  54547. *
  54548. * @param {Object} options
  54549. * @param {String|null} options.width The new width of the image.
  54550. * @fires execute
  54551. */
  54552. execute( options ) {
  54553. const model = this.editor.model;
  54554. const imageElement = model.document.selection.getSelectedElement();
  54555. this.value = {
  54556. width: options.width,
  54557. height: null
  54558. };
  54559. if ( imageElement ) {
  54560. model.change( writer => {
  54561. writer.setAttribute( 'width', options.width, imageElement );
  54562. } );
  54563. }
  54564. }
  54565. }
  54566. /***/ }),
  54567. /***/ "./node_modules/@ckeditor/ckeditor5-image/src/imagestyle.js":
  54568. /*!******************************************************************!*\
  54569. !*** ./node_modules/@ckeditor/ckeditor5-image/src/imagestyle.js ***!
  54570. \******************************************************************/
  54571. /*! exports provided: default */
  54572. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  54573. "use strict";
  54574. __webpack_require__.r(__webpack_exports__);
  54575. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ImageStyle; });
  54576. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  54577. /* harmony import */ var _imagestyle_imagestyleediting__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./imagestyle/imagestyleediting */ "./node_modules/@ckeditor/ckeditor5-image/src/imagestyle/imagestyleediting.js");
  54578. /* harmony import */ var _imagestyle_imagestyleui__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./imagestyle/imagestyleui */ "./node_modules/@ckeditor/ckeditor5-image/src/imagestyle/imagestyleui.js");
  54579. /**
  54580. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  54581. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  54582. */
  54583. /**
  54584. * @module image/imagestyle
  54585. */
  54586. /**
  54587. * The image style plugin.
  54588. *
  54589. * For a detailed overview, check the {@glink features/image#image-styles image styles} documentation.
  54590. *
  54591. * This is a "glue" plugin which loads the {@link module:image/imagestyle/imagestyleediting~ImageStyleEditing}
  54592. * and {@link module:image/imagestyle/imagestyleui~ImageStyleUI} plugins.
  54593. *
  54594. * @extends module:core/plugin~Plugin
  54595. */
  54596. class ImageStyle extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  54597. /**
  54598. * @inheritDoc
  54599. */
  54600. static get requires() {
  54601. return [ _imagestyle_imagestyleediting__WEBPACK_IMPORTED_MODULE_1__["default"], _imagestyle_imagestyleui__WEBPACK_IMPORTED_MODULE_2__["default"] ];
  54602. }
  54603. /**
  54604. * @inheritDoc
  54605. */
  54606. static get pluginName() {
  54607. return 'ImageStyle';
  54608. }
  54609. }
  54610. /**
  54611. * Available image styles.
  54612. *
  54613. * The default value is:
  54614. *
  54615. * const imageConfig = {
  54616. * styles: [ 'full', 'side' ]
  54617. * };
  54618. *
  54619. * which configures two default styles:
  54620. *
  54621. * * the "full" style which does not apply any class, e.g. for images styled to span 100% width of the content,
  54622. * * the "side" style with the `.image-style-side` CSS class.
  54623. *
  54624. * See {@link module:image/imagestyle/utils~defaultStyles} to learn more about default
  54625. * styles provided by the image feature.
  54626. *
  54627. * The {@link module:image/imagestyle/utils~defaultStyles default styles} can be customized,
  54628. * e.g. to change the icon, title or CSS class of the style. The feature also provides several
  54629. * {@link module:image/imagestyle/utils~defaultIcons default icons} to choose from.
  54630. *
  54631. * import customIcon from 'custom-icon.svg';
  54632. *
  54633. * // ...
  54634. *
  54635. * const imageConfig = {
  54636. * styles: [
  54637. * // This will only customize the icon of the "full" style.
  54638. * // Note: 'right' is one of default icons provided by the feature.
  54639. * { name: 'full', icon: 'right' },
  54640. *
  54641. * // This will customize the icon, title and CSS class of the default "side" style.
  54642. * { name: 'side', icon: customIcon, title: 'My side style', className: 'custom-side-image' }
  54643. * ]
  54644. * };
  54645. *
  54646. * If none of the default styles is good enough, it is possible to define independent custom styles, too:
  54647. *
  54648. * import { icons } from 'ckeditor5/src/core';
  54649. *
  54650. * const fullSizeIcon = icons.objectCenter';
  54651. * const sideIcon = icons.objectRight';
  54652. *
  54653. * // ...
  54654. *
  54655. * const imageConfig = {
  54656. * styles: [
  54657. * // A completely custom full size style with no class, used as a default.
  54658. * { name: 'fullSize', title: 'Full size', icon: fullSizeIcon, isDefault: true },
  54659. *
  54660. * { name: 'side', title: 'To the side', icon: sideIcon, className: 'side-image' }
  54661. * ]
  54662. * };
  54663. *
  54664. * Note: Setting `title` to one of {@link module:image/imagestyle/imagestyleui~ImageStyleUI#localizedDefaultStylesTitles}
  54665. * will automatically translate it to the language of the editor.
  54666. *
  54667. * Read more about styling images in the {@glink features/image#image-styles Image styles guide}.
  54668. *
  54669. * The feature creates commands based on defined styles, so you can change the style of a selected image by executing
  54670. * the following command:
  54671. *
  54672. * editor.execute( 'imageStyle' { value: 'side' } );
  54673. *
  54674. * The feature also creates buttons that execute the commands. So, assuming that you use the
  54675. * default image styles setting, you can {@link module:image/image~ImageConfig#toolbar configure the image toolbar}
  54676. * (or any other toolbar) to contain these options:
  54677. *
  54678. * const imageConfig = {
  54679. * toolbar: [ 'imageStyle:full', 'imageStyle:side' ]
  54680. * };
  54681. *
  54682. * @member {Array.<module:image/imagestyle/imagestyleediting~ImageStyleFormat>} module:image/image~ImageConfig#styles
  54683. */
  54684. /***/ }),
  54685. /***/ "./node_modules/@ckeditor/ckeditor5-image/src/imagestyle/converters.js":
  54686. /*!*****************************************************************************!*\
  54687. !*** ./node_modules/@ckeditor/ckeditor5-image/src/imagestyle/converters.js ***!
  54688. \*****************************************************************************/
  54689. /*! exports provided: modelToViewStyleAttribute, viewToModelStyleAttribute */
  54690. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  54691. "use strict";
  54692. __webpack_require__.r(__webpack_exports__);
  54693. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "modelToViewStyleAttribute", function() { return modelToViewStyleAttribute; });
  54694. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "viewToModelStyleAttribute", function() { return viewToModelStyleAttribute; });
  54695. /* harmony import */ var ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/utils */ "./node_modules/ckeditor5/src/utils.js");
  54696. /**
  54697. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  54698. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  54699. */
  54700. /**
  54701. * @module image/imagestyle/converters
  54702. */
  54703. /**
  54704. * Returns a converter for the `imageStyle` attribute. It can be used for adding, changing and removing the attribute.
  54705. *
  54706. * @param {Object} styles An object containing available styles. See {@link module:image/imagestyle/imagestyleediting~ImageStyleFormat}
  54707. * for more details.
  54708. * @returns {Function} A model-to-view attribute converter.
  54709. */
  54710. function modelToViewStyleAttribute( styles ) {
  54711. return ( evt, data, conversionApi ) => {
  54712. if ( !conversionApi.consumable.consume( data.item, evt.name ) ) {
  54713. return;
  54714. }
  54715. // Check if there is class name associated with given value.
  54716. const newStyle = getStyleByName( data.attributeNewValue, styles );
  54717. const oldStyle = getStyleByName( data.attributeOldValue, styles );
  54718. const viewElement = conversionApi.mapper.toViewElement( data.item );
  54719. const viewWriter = conversionApi.writer;
  54720. if ( oldStyle ) {
  54721. viewWriter.removeClass( oldStyle.className, viewElement );
  54722. }
  54723. if ( newStyle ) {
  54724. viewWriter.addClass( newStyle.className, viewElement );
  54725. }
  54726. };
  54727. }
  54728. /**
  54729. * Returns a view-to-model converter converting image CSS classes to a proper value in the model.
  54730. *
  54731. * @param {Array.<module:image/imagestyle/imagestyleediting~ImageStyleFormat>} styles The styles for which the converter is created.
  54732. * @returns {Function} A view-to-model converter.
  54733. */
  54734. function viewToModelStyleAttribute( styles ) {
  54735. // Convert only non–default styles.
  54736. const filteredStyles = styles.filter( style => !style.isDefault );
  54737. return ( evt, data, conversionApi ) => {
  54738. if ( !data.modelRange ) {
  54739. return;
  54740. }
  54741. const viewFigureElement = data.viewItem;
  54742. const modelImageElement = Object(ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_0__["first"])( data.modelRange.getItems() );
  54743. // Check if `modelImageElement` exists (see: https://github.com/ckeditor/ckeditor5/issues/8270)
  54744. // and `imageStyle` attribute is allowed for that element, otherwise stop conversion early.
  54745. if ( modelImageElement && !conversionApi.schema.checkAttribute( modelImageElement, 'imageStyle' ) ) {
  54746. return;
  54747. }
  54748. // Convert style one by one.
  54749. for ( const style of filteredStyles ) {
  54750. // Try to consume class corresponding with style.
  54751. if ( conversionApi.consumable.consume( viewFigureElement, { classes: style.className } ) ) {
  54752. // And convert this style to model attribute.
  54753. conversionApi.writer.setAttribute( 'imageStyle', style.name, modelImageElement );
  54754. }
  54755. }
  54756. };
  54757. }
  54758. // Returns the style with a given `name` from an array of styles.
  54759. //
  54760. // @param {String} name
  54761. // @param {Array.<module:image/imagestyle/imagestyleediting~ImageStyleFormat> } styles
  54762. // @returns {module:image/imagestyle/imagestyleediting~ImageStyleFormat|undefined}
  54763. function getStyleByName( name, styles ) {
  54764. for ( const style of styles ) {
  54765. if ( style.name === name ) {
  54766. return style;
  54767. }
  54768. }
  54769. }
  54770. /***/ }),
  54771. /***/ "./node_modules/@ckeditor/ckeditor5-image/src/imagestyle/imagestylecommand.js":
  54772. /*!************************************************************************************!*\
  54773. !*** ./node_modules/@ckeditor/ckeditor5-image/src/imagestyle/imagestylecommand.js ***!
  54774. \************************************************************************************/
  54775. /*! exports provided: default */
  54776. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  54777. "use strict";
  54778. __webpack_require__.r(__webpack_exports__);
  54779. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ImageStyleCommand; });
  54780. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  54781. /* harmony import */ var _image_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../image/utils */ "./node_modules/@ckeditor/ckeditor5-image/src/image/utils.js");
  54782. /**
  54783. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  54784. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  54785. */
  54786. /**
  54787. * @module image/imagestyle/imagestylecommand
  54788. */
  54789. /**
  54790. * The image style command. It is used to apply different image styles.
  54791. *
  54792. * @extends module:core/command~Command
  54793. */
  54794. class ImageStyleCommand extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Command"] {
  54795. /**
  54796. * Creates an instance of the image style command. Each command instance is handling one style.
  54797. *
  54798. * @param {module:core/editor/editor~Editor} editor The editor instance.
  54799. * @param {Array.<module:image/imagestyle/imagestyleediting~ImageStyleFormat>} styles The styles that this command supports.
  54800. */
  54801. constructor( editor, styles ) {
  54802. super( editor );
  54803. /**
  54804. * The name of the default style, if it is present. If there is no default style, it defaults to `false`.
  54805. *
  54806. * @readonly
  54807. * @type {Boolean|String}
  54808. */
  54809. this.defaultStyle = false;
  54810. /**
  54811. * A style handled by this command.
  54812. *
  54813. * @readonly
  54814. * @member {Array.<module:image/imagestyle/imagestyleediting~ImageStyleFormat>} #styles
  54815. */
  54816. this.styles = styles.reduce( ( styles, style ) => {
  54817. styles[ style.name ] = style;
  54818. if ( style.isDefault ) {
  54819. this.defaultStyle = style.name;
  54820. }
  54821. return styles;
  54822. }, {} );
  54823. }
  54824. /**
  54825. * @inheritDoc
  54826. */
  54827. refresh() {
  54828. const element = this.editor.model.document.selection.getSelectedElement();
  54829. this.isEnabled = Object(_image_utils__WEBPACK_IMPORTED_MODULE_1__["isImage"])( element );
  54830. if ( !element ) {
  54831. this.value = false;
  54832. } else if ( element.hasAttribute( 'imageStyle' ) ) {
  54833. const attributeValue = element.getAttribute( 'imageStyle' );
  54834. this.value = this.styles[ attributeValue ] ? attributeValue : false;
  54835. } else {
  54836. this.value = this.defaultStyle;
  54837. }
  54838. }
  54839. /**
  54840. * Executes the command.
  54841. *
  54842. * editor.execute( 'imageStyle', { value: 'side' } );
  54843. *
  54844. * @param {Object} options
  54845. * @param {String} options.value The name of the style (based on the
  54846. * {@link module:image/image~ImageConfig#styles `image.styles`} configuration option).
  54847. * @fires execute
  54848. */
  54849. execute( options ) {
  54850. const styleName = options.value;
  54851. const model = this.editor.model;
  54852. const imageElement = model.document.selection.getSelectedElement();
  54853. model.change( writer => {
  54854. // Default style means that there is no `imageStyle` attribute in the model.
  54855. // https://github.com/ckeditor/ckeditor5-image/issues/147
  54856. if ( this.styles[ styleName ].isDefault ) {
  54857. writer.removeAttribute( 'imageStyle', imageElement );
  54858. } else {
  54859. writer.setAttribute( 'imageStyle', styleName, imageElement );
  54860. }
  54861. } );
  54862. }
  54863. }
  54864. /***/ }),
  54865. /***/ "./node_modules/@ckeditor/ckeditor5-image/src/imagestyle/imagestyleediting.js":
  54866. /*!************************************************************************************!*\
  54867. !*** ./node_modules/@ckeditor/ckeditor5-image/src/imagestyle/imagestyleediting.js ***!
  54868. \************************************************************************************/
  54869. /*! exports provided: default */
  54870. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  54871. "use strict";
  54872. __webpack_require__.r(__webpack_exports__);
  54873. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ImageStyleEditing; });
  54874. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  54875. /* harmony import */ var _imagestylecommand__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./imagestylecommand */ "./node_modules/@ckeditor/ckeditor5-image/src/imagestyle/imagestylecommand.js");
  54876. /* harmony import */ var _converters__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./converters */ "./node_modules/@ckeditor/ckeditor5-image/src/imagestyle/converters.js");
  54877. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils */ "./node_modules/@ckeditor/ckeditor5-image/src/imagestyle/utils.js");
  54878. /**
  54879. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  54880. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  54881. */
  54882. /**
  54883. * @module image/imagestyle/imagestyleediting
  54884. */
  54885. /**
  54886. * The image style engine plugin. It sets the default configuration, creates converters and registers
  54887. * {@link module:image/imagestyle/imagestylecommand~ImageStyleCommand ImageStyleCommand}.
  54888. *
  54889. * @extends module:core/plugin~Plugin
  54890. */
  54891. class ImageStyleEditing extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  54892. /**
  54893. * @inheritDoc
  54894. */
  54895. static get pluginName() {
  54896. return 'ImageStyleEditing';
  54897. }
  54898. /**
  54899. * @inheritDoc
  54900. */
  54901. init() {
  54902. const editor = this.editor;
  54903. const schema = editor.model.schema;
  54904. const data = editor.data;
  54905. const editing = editor.editing;
  54906. // Define default configuration.
  54907. editor.config.define( 'image.styles', [ 'full', 'side' ] );
  54908. // Get configuration.
  54909. const styles = Object(_utils__WEBPACK_IMPORTED_MODULE_3__["normalizeImageStyles"])( editor.config.get( 'image.styles' ) );
  54910. // Allow imageStyle attribute in image.
  54911. // We could call it 'style' but https://github.com/ckeditor/ckeditor5-engine/issues/559.
  54912. schema.extend( 'image', { allowAttributes: 'imageStyle' } );
  54913. // Converters for imageStyle attribute from model to view.
  54914. const modelToViewConverter = Object(_converters__WEBPACK_IMPORTED_MODULE_2__["modelToViewStyleAttribute"])( styles );
  54915. editing.downcastDispatcher.on( 'attribute:imageStyle:image', modelToViewConverter );
  54916. data.downcastDispatcher.on( 'attribute:imageStyle:image', modelToViewConverter );
  54917. // Converter for figure element from view to model.
  54918. data.upcastDispatcher.on( 'element:figure', Object(_converters__WEBPACK_IMPORTED_MODULE_2__["viewToModelStyleAttribute"])( styles ), { priority: 'low' } );
  54919. // Register imageStyle command.
  54920. editor.commands.add( 'imageStyle', new _imagestylecommand__WEBPACK_IMPORTED_MODULE_1__["default"]( editor, styles ) );
  54921. }
  54922. }
  54923. /**
  54924. * The image style format descriptor.
  54925. *
  54926. * import fullSizeIcon from 'path/to/icon.svg';
  54927. *
  54928. * const imageStyleFormat = {
  54929. * name: 'fullSize',
  54930. * icon: fullSizeIcon,
  54931. * title: 'Full size image',
  54932. * className: 'image-full-size'
  54933. * }
  54934. *
  54935. * @typedef {Object} module:image/imagestyle/imagestyleediting~ImageStyleFormat
  54936. *
  54937. * @property {String} name The unique name of the style. It will be used to:
  54938. *
  54939. * * Store the chosen style in the model by setting the `imageStyle` attribute of the `<image>` element.
  54940. * * As a value of the {@link module:image/imagestyle/imagestylecommand~ImageStyleCommand#execute `imageStyle` command},
  54941. * * when registering a button for each of the styles (`'imageStyle:{name}'`) in the
  54942. * {@link module:ui/componentfactory~ComponentFactory UI components factory} (this functionality is provided by the
  54943. * {@link module:image/imagestyle/imagestyleui~ImageStyleUI} plugin).
  54944. *
  54945. * @property {Boolean} [isDefault] When set, the style will be used as the default one.
  54946. * A default style does not apply any CSS class to the view element.
  54947. *
  54948. * @property {String} icon One of the following to be used when creating the style's button:
  54949. *
  54950. * * An SVG icon source (as an XML string).
  54951. * * One of {@link module:image/imagestyle/utils~defaultIcons} to use a default icon provided by the plugin.
  54952. *
  54953. * @property {String} title The style's title.
  54954. *
  54955. * @property {String} className The CSS class used to represent the style in the view.
  54956. */
  54957. /***/ }),
  54958. /***/ "./node_modules/@ckeditor/ckeditor5-image/src/imagestyle/imagestyleui.js":
  54959. /*!*******************************************************************************!*\
  54960. !*** ./node_modules/@ckeditor/ckeditor5-image/src/imagestyle/imagestyleui.js ***!
  54961. \*******************************************************************************/
  54962. /*! exports provided: default */
  54963. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  54964. "use strict";
  54965. __webpack_require__.r(__webpack_exports__);
  54966. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ImageStyleUI; });
  54967. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  54968. /* harmony import */ var ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/ui */ "./node_modules/ckeditor5/src/ui.js");
  54969. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils */ "./node_modules/@ckeditor/ckeditor5-image/src/imagestyle/utils.js");
  54970. /* harmony import */ var _theme_imagestyle_css__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../theme/imagestyle.css */ "./node_modules/@ckeditor/ckeditor5-image/theme/imagestyle.css");
  54971. /* harmony import */ var _theme_imagestyle_css__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_theme_imagestyle_css__WEBPACK_IMPORTED_MODULE_3__);
  54972. /**
  54973. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  54974. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  54975. */
  54976. /**
  54977. * @module image/imagestyle/imagestyleui
  54978. */
  54979. /**
  54980. * The image style UI plugin.
  54981. *
  54982. * @extends module:core/plugin~Plugin
  54983. */
  54984. class ImageStyleUI extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  54985. /**
  54986. * @inheritDoc
  54987. */
  54988. static get pluginName() {
  54989. return 'ImageStyleUI';
  54990. }
  54991. /**
  54992. * Returns the default localized style titles provided by the plugin.
  54993. *
  54994. * The following localized titles corresponding with
  54995. * {@link module:image/imagestyle/utils~defaultStyles} are available:
  54996. *
  54997. * * `'Full size image'`,
  54998. * * `'Side image'`,
  54999. * * `'Left aligned image'`,
  55000. * * `'Centered image'`,
  55001. * * `'Right aligned image'`
  55002. *
  55003. * @returns {Object.<String,String>}
  55004. */
  55005. get localizedDefaultStylesTitles() {
  55006. const t = this.editor.t;
  55007. return {
  55008. 'Full size image': t( 'Full size image' ),
  55009. 'Side image': t( 'Side image' ),
  55010. 'Left aligned image': t( 'Left aligned image' ),
  55011. 'Centered image': t( 'Centered image' ),
  55012. 'Right aligned image': t( 'Right aligned image' )
  55013. };
  55014. }
  55015. /**
  55016. * @inheritDoc
  55017. */
  55018. init() {
  55019. const editor = this.editor;
  55020. const configuredStyles = editor.config.get( 'image.styles' );
  55021. const translatedStyles = translateStyles( Object(_utils__WEBPACK_IMPORTED_MODULE_2__["normalizeImageStyles"])( configuredStyles ), this.localizedDefaultStylesTitles );
  55022. for ( const style of translatedStyles ) {
  55023. this._createButton( style );
  55024. }
  55025. }
  55026. /**
  55027. * Creates a button for each style and stores it in the editor {@link module:ui/componentfactory~ComponentFactory ComponentFactory}.
  55028. *
  55029. * @private
  55030. * @param {module:image/imagestyle/imagestyleediting~ImageStyleFormat} style
  55031. */
  55032. _createButton( style ) {
  55033. const editor = this.editor;
  55034. const componentName = `imageStyle:${ style.name }`;
  55035. editor.ui.componentFactory.add( componentName, locale => {
  55036. const command = editor.commands.get( 'imageStyle' );
  55037. const view = new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__["ButtonView"]( locale );
  55038. view.set( {
  55039. label: style.title,
  55040. icon: style.icon,
  55041. tooltip: true,
  55042. isToggleable: true
  55043. } );
  55044. view.bind( 'isEnabled' ).to( command, 'isEnabled' );
  55045. view.bind( 'isOn' ).to( command, 'value', value => value === style.name );
  55046. this.listenTo( view, 'execute', () => {
  55047. editor.execute( 'imageStyle', { value: style.name } );
  55048. editor.editing.view.focus();
  55049. } );
  55050. return view;
  55051. } );
  55052. }
  55053. }
  55054. /**
  55055. * Returns the translated `title` from the passed styles array.
  55056. *
  55057. * @param {Array.<module:image/imagestyle/imagestyleediting~ImageStyleFormat>} styles
  55058. * @param titles
  55059. * @returns {Array.<module:image/imagestyle/imagestyleediting~ImageStyleFormat>}
  55060. */
  55061. function translateStyles( styles, titles ) {
  55062. for ( const style of styles ) {
  55063. // Localize the titles of the styles, if a title corresponds with
  55064. // a localized default provided by the plugin.
  55065. if ( titles[ style.title ] ) {
  55066. style.title = titles[ style.title ];
  55067. }
  55068. }
  55069. return styles;
  55070. }
  55071. /***/ }),
  55072. /***/ "./node_modules/@ckeditor/ckeditor5-image/src/imagestyle/utils.js":
  55073. /*!************************************************************************!*\
  55074. !*** ./node_modules/@ckeditor/ckeditor5-image/src/imagestyle/utils.js ***!
  55075. \************************************************************************/
  55076. /*! exports provided: normalizeImageStyles */
  55077. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  55078. "use strict";
  55079. __webpack_require__.r(__webpack_exports__);
  55080. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "normalizeImageStyles", function() { return normalizeImageStyles; });
  55081. /* harmony import */ var ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/utils */ "./node_modules/ckeditor5/src/utils.js");
  55082. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  55083. /**
  55084. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  55085. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  55086. */
  55087. /**
  55088. * @module image/imagestyle/utils
  55089. */
  55090. /**
  55091. * Default image styles provided by the plugin that can be referred in the
  55092. * {@link module:image/image~ImageConfig#styles} configuration.
  55093. *
  55094. * Among them, 2 default semantic content styles are available:
  55095. *
  55096. * * `full` is a full–width image without any CSS class,
  55097. * * `side` is a side image styled with the `image-style-side` CSS class.
  55098. *
  55099. * There are also 3 styles focused on formatting:
  55100. *
  55101. * * `alignLeft` aligns the image to the left using the `image-style-align-left` class,
  55102. * * `alignCenter` centers the image using the `image-style-align-center` class,
  55103. * * `alignRight` aligns the image to the right using the `image-style-align-right` class,
  55104. *
  55105. * @member {Object.<String,Object>}
  55106. */
  55107. const defaultStyles = {
  55108. // This option is equal to the situation when no style is applied.
  55109. full: {
  55110. name: 'full',
  55111. title: 'Full size image',
  55112. icon: ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_1__["icons"].objectFullWidth,
  55113. isDefault: true
  55114. },
  55115. // This represents a side image.
  55116. side: {
  55117. name: 'side',
  55118. title: 'Side image',
  55119. icon: ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_1__["icons"].objectRight,
  55120. className: 'image-style-side'
  55121. },
  55122. // This style represents an image aligned to the left.
  55123. alignLeft: {
  55124. name: 'alignLeft',
  55125. title: 'Left aligned image',
  55126. icon: ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_1__["icons"].objectLeft,
  55127. className: 'image-style-align-left'
  55128. },
  55129. // This style represents a centered image.
  55130. alignCenter: {
  55131. name: 'alignCenter',
  55132. title: 'Centered image',
  55133. icon: ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_1__["icons"].objectCenter,
  55134. className: 'image-style-align-center'
  55135. },
  55136. // This style represents an image aligned to the right.
  55137. alignRight: {
  55138. name: 'alignRight',
  55139. title: 'Right aligned image',
  55140. icon: ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_1__["icons"].objectRight,
  55141. className: 'image-style-align-right'
  55142. }
  55143. };
  55144. /**
  55145. * Default image style icons provided by the plugin that can be referred in the
  55146. * {@link module:image/image~ImageConfig#styles} configuration.
  55147. *
  55148. * There are 4 icons available: `'full'`, `'left'`, `'center'` and `'right'`.
  55149. *
  55150. * @member {Object.<String, String>}
  55151. */
  55152. const defaultIcons = {
  55153. full: ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_1__["icons"].objectFullWidth,
  55154. left: ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_1__["icons"].objectLeft,
  55155. right: ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_1__["icons"].objectRight,
  55156. center: ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_1__["icons"].objectCenter
  55157. };
  55158. /**
  55159. * Returns a {@link module:image/image~ImageConfig#styles} array with items normalized in the
  55160. * {@link module:image/imagestyle/imagestyleediting~ImageStyleFormat} format and a complete `icon` markup for each style.
  55161. *
  55162. * @returns {Array.<module:image/imagestyle/imagestyleediting~ImageStyleFormat>}
  55163. */
  55164. function normalizeImageStyles( configuredStyles = [] ) {
  55165. return configuredStyles.map( _normalizeStyle );
  55166. }
  55167. // Normalizes an image style provided in the {@link module:image/image~ImageConfig#styles}
  55168. // and returns it in a {@link module:image/imagestyle/imagestyleediting~ImageStyleFormat}.
  55169. //
  55170. // @param {Object} style
  55171. // @returns {@link module:image/imagestyle/imagestyleediting~ImageStyleFormat}
  55172. function _normalizeStyle( style ) {
  55173. // Just the name of the style has been passed.
  55174. if ( typeof style == 'string' ) {
  55175. const styleName = style;
  55176. // If it's one of the defaults, just use it.
  55177. if ( defaultStyles[ styleName ] ) {
  55178. // Clone the style to avoid overriding defaults.
  55179. style = Object.assign( {}, defaultStyles[ styleName ] );
  55180. }
  55181. // If it's just a name but none of the defaults, warn because probably it's a mistake.
  55182. else {
  55183. /**
  55184. * There is no such image style of given name.
  55185. *
  55186. * @error image-style-not-found
  55187. * @param {String} name Name of a missing style name.
  55188. */
  55189. Object(ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_0__["logWarning"])( 'image-style-not-found', { name: styleName } );
  55190. // Normalize the style anyway to prevent errors.
  55191. style = {
  55192. name: styleName
  55193. };
  55194. }
  55195. }
  55196. // If an object style has been passed and if the name matches one of the defaults,
  55197. // extend it with defaults – the user wants to customize a default style.
  55198. // Note: Don't override the user–defined style object, clone it instead.
  55199. else if ( defaultStyles[ style.name ] ) {
  55200. const defaultStyle = defaultStyles[ style.name ];
  55201. const extendedStyle = Object.assign( {}, style );
  55202. for ( const prop in defaultStyle ) {
  55203. if ( !Object.prototype.hasOwnProperty.call( style, prop ) ) {
  55204. extendedStyle[ prop ] = defaultStyle[ prop ];
  55205. }
  55206. }
  55207. style = extendedStyle;
  55208. }
  55209. // If an icon is defined as a string and correspond with a name
  55210. // in default icons, use the default icon provided by the plugin.
  55211. if ( typeof style.icon == 'string' && defaultIcons[ style.icon ] ) {
  55212. style.icon = defaultIcons[ style.icon ];
  55213. }
  55214. return style;
  55215. }
  55216. /***/ }),
  55217. /***/ "./node_modules/@ckeditor/ckeditor5-image/src/imagetextalternative.js":
  55218. /*!****************************************************************************!*\
  55219. !*** ./node_modules/@ckeditor/ckeditor5-image/src/imagetextalternative.js ***!
  55220. \****************************************************************************/
  55221. /*! exports provided: default */
  55222. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  55223. "use strict";
  55224. __webpack_require__.r(__webpack_exports__);
  55225. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ImageTextAlternative; });
  55226. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  55227. /* harmony import */ var _imagetextalternative_imagetextalternativeediting__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./imagetextalternative/imagetextalternativeediting */ "./node_modules/@ckeditor/ckeditor5-image/src/imagetextalternative/imagetextalternativeediting.js");
  55228. /* harmony import */ var _imagetextalternative_imagetextalternativeui__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./imagetextalternative/imagetextalternativeui */ "./node_modules/@ckeditor/ckeditor5-image/src/imagetextalternative/imagetextalternativeui.js");
  55229. /**
  55230. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  55231. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  55232. */
  55233. /**
  55234. * @module image/imagetextalternative
  55235. */
  55236. /**
  55237. * The image text alternative plugin.
  55238. *
  55239. * For a detailed overview, check the {@glink features/image#image-styles image styles} documentation.
  55240. *
  55241. * This is a "glue" plugin which loads the
  55242. * {@link module:image/imagetextalternative/imagetextalternativeediting~ImageTextAlternativeEditing}
  55243. * and {@link module:image/imagetextalternative/imagetextalternativeui~ImageTextAlternativeUI} plugins.
  55244. *
  55245. * @extends module:core/plugin~Plugin
  55246. */
  55247. class ImageTextAlternative extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  55248. /**
  55249. * @inheritDoc
  55250. */
  55251. static get requires() {
  55252. return [ _imagetextalternative_imagetextalternativeediting__WEBPACK_IMPORTED_MODULE_1__["default"], _imagetextalternative_imagetextalternativeui__WEBPACK_IMPORTED_MODULE_2__["default"] ];
  55253. }
  55254. /**
  55255. * @inheritDoc
  55256. */
  55257. static get pluginName() {
  55258. return 'ImageTextAlternative';
  55259. }
  55260. }
  55261. /***/ }),
  55262. /***/ "./node_modules/@ckeditor/ckeditor5-image/src/imagetextalternative/imagetextalternativecommand.js":
  55263. /*!********************************************************************************************************!*\
  55264. !*** ./node_modules/@ckeditor/ckeditor5-image/src/imagetextalternative/imagetextalternativecommand.js ***!
  55265. \********************************************************************************************************/
  55266. /*! exports provided: default */
  55267. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  55268. "use strict";
  55269. __webpack_require__.r(__webpack_exports__);
  55270. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ImageTextAlternativeCommand; });
  55271. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  55272. /* harmony import */ var _image_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../image/utils */ "./node_modules/@ckeditor/ckeditor5-image/src/image/utils.js");
  55273. /**
  55274. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  55275. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  55276. */
  55277. /**
  55278. * @module image/imagetextalternative/imagetextalternativecommand
  55279. */
  55280. /**
  55281. * The image text alternative command. It is used to change the `alt` attribute of `<image>` elements.
  55282. *
  55283. * @extends module:core/command~Command
  55284. */
  55285. class ImageTextAlternativeCommand extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Command"] {
  55286. /**
  55287. * The command value: `false` if there is no `alt` attribute, otherwise the value of the `alt` attribute.
  55288. *
  55289. * @readonly
  55290. * @observable
  55291. * @member {String|Boolean} #value
  55292. */
  55293. /**
  55294. * @inheritDoc
  55295. */
  55296. refresh() {
  55297. const element = this.editor.model.document.selection.getSelectedElement();
  55298. this.isEnabled = Object(_image_utils__WEBPACK_IMPORTED_MODULE_1__["isImage"])( element );
  55299. if ( Object(_image_utils__WEBPACK_IMPORTED_MODULE_1__["isImage"])( element ) && element.hasAttribute( 'alt' ) ) {
  55300. this.value = element.getAttribute( 'alt' );
  55301. } else {
  55302. this.value = false;
  55303. }
  55304. }
  55305. /**
  55306. * Executes the command.
  55307. *
  55308. * @fires execute
  55309. * @param {Object} options
  55310. * @param {String} options.newValue The new value of the `alt` attribute to set.
  55311. */
  55312. execute( options ) {
  55313. const model = this.editor.model;
  55314. const imageElement = model.document.selection.getSelectedElement();
  55315. model.change( writer => {
  55316. writer.setAttribute( 'alt', options.newValue, imageElement );
  55317. } );
  55318. }
  55319. }
  55320. /***/ }),
  55321. /***/ "./node_modules/@ckeditor/ckeditor5-image/src/imagetextalternative/imagetextalternativeediting.js":
  55322. /*!********************************************************************************************************!*\
  55323. !*** ./node_modules/@ckeditor/ckeditor5-image/src/imagetextalternative/imagetextalternativeediting.js ***!
  55324. \********************************************************************************************************/
  55325. /*! exports provided: default */
  55326. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  55327. "use strict";
  55328. __webpack_require__.r(__webpack_exports__);
  55329. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ImageTextAlternativeEditing; });
  55330. /* harmony import */ var _imagetextalternativecommand__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./imagetextalternativecommand */ "./node_modules/@ckeditor/ckeditor5-image/src/imagetextalternative/imagetextalternativecommand.js");
  55331. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  55332. /**
  55333. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  55334. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  55335. */
  55336. /**
  55337. * @module image/imagetextalternative/imagetextalternativeediting
  55338. */
  55339. /**
  55340. * The image text alternative editing plugin.
  55341. *
  55342. * Registers the `'imageTextAlternative'` command.
  55343. *
  55344. * @extends module:core/plugin~Plugin
  55345. */
  55346. class ImageTextAlternativeEditing extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_1__["Plugin"] {
  55347. /**
  55348. * @inheritDoc
  55349. */
  55350. static get pluginName() {
  55351. return 'ImageTextAlternativeEditing';
  55352. }
  55353. /**
  55354. * @inheritDoc
  55355. */
  55356. init() {
  55357. this.editor.commands.add( 'imageTextAlternative', new _imagetextalternativecommand__WEBPACK_IMPORTED_MODULE_0__["default"]( this.editor ) );
  55358. }
  55359. }
  55360. /***/ }),
  55361. /***/ "./node_modules/@ckeditor/ckeditor5-image/src/imagetextalternative/imagetextalternativeui.js":
  55362. /*!***************************************************************************************************!*\
  55363. !*** ./node_modules/@ckeditor/ckeditor5-image/src/imagetextalternative/imagetextalternativeui.js ***!
  55364. \***************************************************************************************************/
  55365. /*! exports provided: default */
  55366. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  55367. "use strict";
  55368. __webpack_require__.r(__webpack_exports__);
  55369. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ImageTextAlternativeUI; });
  55370. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  55371. /* harmony import */ var ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/ui */ "./node_modules/ckeditor5/src/ui.js");
  55372. /* harmony import */ var _ui_textalternativeformview__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./ui/textalternativeformview */ "./node_modules/@ckeditor/ckeditor5-image/src/imagetextalternative/ui/textalternativeformview.js");
  55373. /* harmony import */ var _image_ui_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../image/ui/utils */ "./node_modules/@ckeditor/ckeditor5-image/src/image/ui/utils.js");
  55374. /* harmony import */ var _image_utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../image/utils */ "./node_modules/@ckeditor/ckeditor5-image/src/image/utils.js");
  55375. /**
  55376. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  55377. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  55378. */
  55379. /**
  55380. * @module image/imagetextalternative/imagetextalternativeui
  55381. */
  55382. /**
  55383. * The image text alternative UI plugin.
  55384. *
  55385. * The plugin uses the {@link module:ui/panel/balloon/contextualballoon~ContextualBalloon}.
  55386. *
  55387. * @extends module:core/plugin~Plugin
  55388. */
  55389. class ImageTextAlternativeUI extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  55390. /**
  55391. * @inheritDoc
  55392. */
  55393. static get requires() {
  55394. return [ ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__["ContextualBalloon"] ];
  55395. }
  55396. /**
  55397. * @inheritDoc
  55398. */
  55399. static get pluginName() {
  55400. return 'ImageTextAlternativeUI';
  55401. }
  55402. /**
  55403. * @inheritDoc
  55404. */
  55405. init() {
  55406. this._createButton();
  55407. this._createForm();
  55408. }
  55409. /**
  55410. * @inheritDoc
  55411. */
  55412. destroy() {
  55413. super.destroy();
  55414. // Destroy created UI components as they are not automatically destroyed (see ckeditor5#1341).
  55415. this._form.destroy();
  55416. }
  55417. /**
  55418. * Creates a button showing the balloon panel for changing the image text alternative and
  55419. * registers it in the editor {@link module:ui/componentfactory~ComponentFactory ComponentFactory}.
  55420. *
  55421. * @private
  55422. */
  55423. _createButton() {
  55424. const editor = this.editor;
  55425. const t = editor.t;
  55426. editor.ui.componentFactory.add( 'imageTextAlternative', locale => {
  55427. const command = editor.commands.get( 'imageTextAlternative' );
  55428. const view = new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__["ButtonView"]( locale );
  55429. view.set( {
  55430. label: t( 'Change image text alternative' ),
  55431. icon: ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["icons"].lowVision,
  55432. tooltip: true
  55433. } );
  55434. view.bind( 'isEnabled' ).to( command, 'isEnabled' );
  55435. this.listenTo( view, 'execute', () => {
  55436. this._showForm();
  55437. } );
  55438. return view;
  55439. } );
  55440. }
  55441. /**
  55442. * Creates the {@link module:image/imagetextalternative/ui/textalternativeformview~TextAlternativeFormView}
  55443. * form.
  55444. *
  55445. * @private
  55446. */
  55447. _createForm() {
  55448. const editor = this.editor;
  55449. const view = editor.editing.view;
  55450. const viewDocument = view.document;
  55451. /**
  55452. * The contextual balloon plugin instance.
  55453. *
  55454. * @private
  55455. * @member {module:ui/panel/balloon/contextualballoon~ContextualBalloon}
  55456. */
  55457. this._balloon = this.editor.plugins.get( 'ContextualBalloon' );
  55458. /**
  55459. * A form containing a textarea and buttons, used to change the `alt` text value.
  55460. *
  55461. * @member {module:image/imagetextalternative/ui/textalternativeformview~TextAlternativeFormView}
  55462. */
  55463. this._form = new _ui_textalternativeformview__WEBPACK_IMPORTED_MODULE_2__["default"]( editor.locale );
  55464. // Render the form so its #element is available for clickOutsideHandler.
  55465. this._form.render();
  55466. this.listenTo( this._form, 'submit', () => {
  55467. editor.execute( 'imageTextAlternative', {
  55468. newValue: this._form.labeledInput.fieldView.element.value
  55469. } );
  55470. this._hideForm( true );
  55471. } );
  55472. this.listenTo( this._form, 'cancel', () => {
  55473. this._hideForm( true );
  55474. } );
  55475. // Close the form on Esc key press.
  55476. this._form.keystrokes.set( 'Esc', ( data, cancel ) => {
  55477. this._hideForm( true );
  55478. cancel();
  55479. } );
  55480. // Reposition the balloon or hide the form if an image widget is no longer selected.
  55481. this.listenTo( editor.ui, 'update', () => {
  55482. if ( !Object(_image_utils__WEBPACK_IMPORTED_MODULE_4__["getSelectedImageWidget"])( viewDocument.selection ) ) {
  55483. this._hideForm( true );
  55484. } else if ( this._isVisible ) {
  55485. Object(_image_ui_utils__WEBPACK_IMPORTED_MODULE_3__["repositionContextualBalloon"])( editor );
  55486. }
  55487. } );
  55488. // Close on click outside of balloon panel element.
  55489. Object(ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__["clickOutsideHandler"])( {
  55490. emitter: this._form,
  55491. activator: () => this._isVisible,
  55492. contextElements: [ this._balloon.view.element ],
  55493. callback: () => this._hideForm()
  55494. } );
  55495. }
  55496. /**
  55497. * Shows the {@link #_form} in the {@link #_balloon}.
  55498. *
  55499. * @private
  55500. */
  55501. _showForm() {
  55502. if ( this._isVisible ) {
  55503. return;
  55504. }
  55505. const editor = this.editor;
  55506. const command = editor.commands.get( 'imageTextAlternative' );
  55507. const labeledInput = this._form.labeledInput;
  55508. this._form.disableCssTransitions();
  55509. if ( !this._isInBalloon ) {
  55510. this._balloon.add( {
  55511. view: this._form,
  55512. position: Object(_image_ui_utils__WEBPACK_IMPORTED_MODULE_3__["getBalloonPositionData"])( editor )
  55513. } );
  55514. }
  55515. // Make sure that each time the panel shows up, the field remains in sync with the value of
  55516. // the command. If the user typed in the input, then canceled the balloon (`labeledInput#value`
  55517. // stays unaltered) and re-opened it without changing the value of the command, they would see the
  55518. // old value instead of the actual value of the command.
  55519. // https://github.com/ckeditor/ckeditor5-image/issues/114
  55520. labeledInput.fieldView.value = labeledInput.fieldView.element.value = command.value || '';
  55521. this._form.labeledInput.fieldView.select();
  55522. this._form.enableCssTransitions();
  55523. }
  55524. /**
  55525. * Removes the {@link #_form} from the {@link #_balloon}.
  55526. *
  55527. * @param {Boolean} [focusEditable=false] Controls whether the editing view is focused afterwards.
  55528. * @private
  55529. */
  55530. _hideForm( focusEditable ) {
  55531. if ( !this._isInBalloon ) {
  55532. return;
  55533. }
  55534. // Blur the input element before removing it from DOM to prevent issues in some browsers.
  55535. // See https://github.com/ckeditor/ckeditor5/issues/1501.
  55536. if ( this._form.focusTracker.isFocused ) {
  55537. this._form.saveButtonView.focus();
  55538. }
  55539. this._balloon.remove( this._form );
  55540. if ( focusEditable ) {
  55541. this.editor.editing.view.focus();
  55542. }
  55543. }
  55544. /**
  55545. * Returns `true` when the {@link #_form} is the visible view in the {@link #_balloon}.
  55546. *
  55547. * @private
  55548. * @type {Boolean}
  55549. */
  55550. get _isVisible() {
  55551. return this._balloon.visibleView === this._form;
  55552. }
  55553. /**
  55554. * Returns `true` when the {@link #_form} is in the {@link #_balloon}.
  55555. *
  55556. * @private
  55557. * @type {Boolean}
  55558. */
  55559. get _isInBalloon() {
  55560. return this._balloon.hasView( this._form );
  55561. }
  55562. }
  55563. /***/ }),
  55564. /***/ "./node_modules/@ckeditor/ckeditor5-image/src/imagetextalternative/ui/textalternativeformview.js":
  55565. /*!*******************************************************************************************************!*\
  55566. !*** ./node_modules/@ckeditor/ckeditor5-image/src/imagetextalternative/ui/textalternativeformview.js ***!
  55567. \*******************************************************************************************************/
  55568. /*! exports provided: default */
  55569. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  55570. "use strict";
  55571. __webpack_require__.r(__webpack_exports__);
  55572. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return TextAlternativeFormView; });
  55573. /* harmony import */ var ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/ui */ "./node_modules/ckeditor5/src/ui.js");
  55574. /* harmony import */ var ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/utils */ "./node_modules/ckeditor5/src/utils.js");
  55575. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  55576. /* harmony import */ var _theme_textalternativeform_css__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../theme/textalternativeform.css */ "./node_modules/@ckeditor/ckeditor5-image/theme/textalternativeform.css");
  55577. /* harmony import */ var _theme_textalternativeform_css__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_theme_textalternativeform_css__WEBPACK_IMPORTED_MODULE_3__);
  55578. /* harmony import */ var _ckeditor_ckeditor5_ui_theme_components_responsive_form_responsiveform_css__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @ckeditor/ckeditor5-ui/theme/components/responsive-form/responsiveform.css */ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/responsive-form/responsiveform.css");
  55579. /* harmony import */ var _ckeditor_ckeditor5_ui_theme_components_responsive_form_responsiveform_css__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_ckeditor_ckeditor5_ui_theme_components_responsive_form_responsiveform_css__WEBPACK_IMPORTED_MODULE_4__);
  55580. /**
  55581. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  55582. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  55583. */
  55584. /**
  55585. * @module image/imagetextalternative/ui/textalternativeformview
  55586. */
  55587. // See: #8833.
  55588. // eslint-disable-next-line ckeditor5-rules/ckeditor-imports
  55589. /**
  55590. * The TextAlternativeFormView class.
  55591. *
  55592. * @extends module:ui/view~View
  55593. */
  55594. class TextAlternativeFormView extends ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_0__["View"] {
  55595. /**
  55596. * @inheritDoc
  55597. */
  55598. constructor( locale ) {
  55599. super( locale );
  55600. const t = this.locale.t;
  55601. /**
  55602. * Tracks information about the DOM focus in the form.
  55603. *
  55604. * @readonly
  55605. * @member {module:utils/focustracker~FocusTracker}
  55606. */
  55607. this.focusTracker = new ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_1__["FocusTracker"]();
  55608. /**
  55609. * An instance of the {@link module:utils/keystrokehandler~KeystrokeHandler}.
  55610. *
  55611. * @readonly
  55612. * @member {module:utils/keystrokehandler~KeystrokeHandler}
  55613. */
  55614. this.keystrokes = new ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_1__["KeystrokeHandler"]();
  55615. /**
  55616. * An input with a label.
  55617. *
  55618. * @member {module:ui/labeledfield/labeledfieldview~LabeledFieldView} #labeledInput
  55619. */
  55620. this.labeledInput = this._createLabeledInputView();
  55621. /**
  55622. * A button used to submit the form.
  55623. *
  55624. * @member {module:ui/button/buttonview~ButtonView} #saveButtonView
  55625. */
  55626. this.saveButtonView = this._createButton( t( 'Save' ), ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_2__["icons"].check, 'ck-button-save' );
  55627. this.saveButtonView.type = 'submit';
  55628. /**
  55629. * A button used to cancel the form.
  55630. *
  55631. * @member {module:ui/button/buttonview~ButtonView} #cancelButtonView
  55632. */
  55633. this.cancelButtonView = this._createButton( t( 'Cancel' ), ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_2__["icons"].cancel, 'ck-button-cancel', 'cancel' );
  55634. /**
  55635. * A collection of views which can be focused in the form.
  55636. *
  55637. * @readonly
  55638. * @protected
  55639. * @member {module:ui/viewcollection~ViewCollection}
  55640. */
  55641. this._focusables = new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_0__["ViewCollection"]();
  55642. /**
  55643. * Helps cycling over {@link #_focusables} in the form.
  55644. *
  55645. * @readonly
  55646. * @protected
  55647. * @member {module:ui/focuscycler~FocusCycler}
  55648. */
  55649. this._focusCycler = new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_0__["FocusCycler"]( {
  55650. focusables: this._focusables,
  55651. focusTracker: this.focusTracker,
  55652. keystrokeHandler: this.keystrokes,
  55653. actions: {
  55654. // Navigate form fields backwards using the Shift + Tab keystroke.
  55655. focusPrevious: 'shift + tab',
  55656. // Navigate form fields forwards using the Tab key.
  55657. focusNext: 'tab'
  55658. }
  55659. } );
  55660. this.setTemplate( {
  55661. tag: 'form',
  55662. attributes: {
  55663. class: [
  55664. 'ck',
  55665. 'ck-text-alternative-form',
  55666. 'ck-responsive-form'
  55667. ],
  55668. // https://github.com/ckeditor/ckeditor5-image/issues/40
  55669. tabindex: '-1'
  55670. },
  55671. children: [
  55672. this.labeledInput,
  55673. this.saveButtonView,
  55674. this.cancelButtonView
  55675. ]
  55676. } );
  55677. Object(ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_0__["injectCssTransitionDisabler"])( this );
  55678. }
  55679. /**
  55680. * @inheritDoc
  55681. */
  55682. render() {
  55683. super.render();
  55684. this.keystrokes.listenTo( this.element );
  55685. Object(ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_0__["submitHandler"])( { view: this } );
  55686. [ this.labeledInput, this.saveButtonView, this.cancelButtonView ]
  55687. .forEach( v => {
  55688. // Register the view as focusable.
  55689. this._focusables.add( v );
  55690. // Register the view in the focus tracker.
  55691. this.focusTracker.add( v.element );
  55692. } );
  55693. }
  55694. /**
  55695. * Creates the button view.
  55696. *
  55697. * @private
  55698. * @param {String} label The button label
  55699. * @param {String} icon The button's icon.
  55700. * @param {String} className The additional button CSS class name.
  55701. * @param {String} [eventName] The event name that the ButtonView#execute event will be delegated to.
  55702. * @returns {module:ui/button/buttonview~ButtonView} The button view instance.
  55703. */
  55704. _createButton( label, icon, className, eventName ) {
  55705. const button = new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_0__["ButtonView"]( this.locale );
  55706. button.set( {
  55707. label,
  55708. icon,
  55709. tooltip: true
  55710. } );
  55711. button.extendTemplate( {
  55712. attributes: {
  55713. class: className
  55714. }
  55715. } );
  55716. if ( eventName ) {
  55717. button.delegate( 'execute' ).to( this, eventName );
  55718. }
  55719. return button;
  55720. }
  55721. /**
  55722. * Creates an input with a label.
  55723. *
  55724. * @private
  55725. * @returns {module:ui/labeledfield/labeledfieldview~LabeledFieldView} Labeled field view instance.
  55726. */
  55727. _createLabeledInputView() {
  55728. const t = this.locale.t;
  55729. const labeledInput = new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_0__["LabeledFieldView"]( this.locale, ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_0__["createLabeledInputText"] );
  55730. labeledInput.label = t( 'Text alternative' );
  55731. return labeledInput;
  55732. }
  55733. }
  55734. /***/ }),
  55735. /***/ "./node_modules/@ckeditor/ckeditor5-image/src/imagetoolbar.js":
  55736. /*!********************************************************************!*\
  55737. !*** ./node_modules/@ckeditor/ckeditor5-image/src/imagetoolbar.js ***!
  55738. \********************************************************************/
  55739. /*! exports provided: default */
  55740. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  55741. "use strict";
  55742. __webpack_require__.r(__webpack_exports__);
  55743. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ImageToolbar; });
  55744. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  55745. /* harmony import */ var ckeditor5_src_widget__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/widget */ "./node_modules/ckeditor5/src/widget.js");
  55746. /* harmony import */ var _image_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./image/utils */ "./node_modules/@ckeditor/ckeditor5-image/src/image/utils.js");
  55747. /**
  55748. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  55749. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  55750. */
  55751. /**
  55752. * @module image/imagetoolbar
  55753. */
  55754. /**
  55755. * The image toolbar plugin. It creates and manages the image toolbar (the toolbar displayed when an image is selected).
  55756. *
  55757. * For a detailed overview, check the {@glink features/image#image-contextual-toolbar image contextual toolbar} documentation.
  55758. *
  55759. * Instances of toolbar components (e.g. buttons) are created using the editor's
  55760. * {@link module:ui/componentfactory~ComponentFactory component factory}
  55761. * based on the {@link module:image/image~ImageConfig#toolbar `image.toolbar` configuration option}.
  55762. *
  55763. * The toolbar uses the {@link module:ui/panel/balloon/contextualballoon~ContextualBalloon}.
  55764. *
  55765. * @extends module:core/plugin~Plugin
  55766. */
  55767. class ImageToolbar extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  55768. /**
  55769. * @inheritDoc
  55770. */
  55771. static get requires() {
  55772. return [ ckeditor5_src_widget__WEBPACK_IMPORTED_MODULE_1__["WidgetToolbarRepository"] ];
  55773. }
  55774. /**
  55775. * @inheritDoc
  55776. */
  55777. static get pluginName() {
  55778. return 'ImageToolbar';
  55779. }
  55780. /**
  55781. * @inheritDoc
  55782. */
  55783. afterInit() {
  55784. const editor = this.editor;
  55785. const t = editor.t;
  55786. const widgetToolbarRepository = editor.plugins.get( ckeditor5_src_widget__WEBPACK_IMPORTED_MODULE_1__["WidgetToolbarRepository"] );
  55787. widgetToolbarRepository.register( 'image', {
  55788. ariaLabel: t( 'Image toolbar' ),
  55789. items: editor.config.get( 'image.toolbar' ) || [],
  55790. getRelatedElement: _image_utils__WEBPACK_IMPORTED_MODULE_2__["getSelectedImageWidget"]
  55791. } );
  55792. }
  55793. }
  55794. /**
  55795. * Items to be placed in the image toolbar.
  55796. * This option is used by the {@link module:image/imagetoolbar~ImageToolbar} feature.
  55797. *
  55798. * Assuming that you use the following features:
  55799. *
  55800. * * {@link module:image/imagestyle~ImageStyle} (with a default configuration),
  55801. * * {@link module:image/imagetextalternative~ImageTextAlternative},
  55802. *
  55803. * three toolbar items will be available in {@link module:ui/componentfactory~ComponentFactory}:
  55804. * `'imageStyle:full'`, `'imageStyle:side'`, and `'imageTextAlternative'` so you can configure the toolbar like this:
  55805. *
  55806. * const imageConfig = {
  55807. * toolbar: [ 'imageStyle:full', 'imageStyle:side', '|', 'imageTextAlternative' ]
  55808. * };
  55809. *
  55810. * Of course, the same buttons can also be used in the
  55811. * {@link module:core/editor/editorconfig~EditorConfig#toolbar main editor toolbar}.
  55812. *
  55813. * Read more about configuring toolbar in {@link module:core/editor/editorconfig~EditorConfig#toolbar}.
  55814. *
  55815. * @member {Array.<String>} module:image/image~ImageConfig#toolbar
  55816. */
  55817. /***/ }),
  55818. /***/ "./node_modules/@ckeditor/ckeditor5-image/src/imageupload.js":
  55819. /*!*******************************************************************!*\
  55820. !*** ./node_modules/@ckeditor/ckeditor5-image/src/imageupload.js ***!
  55821. \*******************************************************************/
  55822. /*! exports provided: default */
  55823. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  55824. "use strict";
  55825. __webpack_require__.r(__webpack_exports__);
  55826. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ImageUpload; });
  55827. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  55828. /* harmony import */ var _imageupload_imageuploadui__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./imageupload/imageuploadui */ "./node_modules/@ckeditor/ckeditor5-image/src/imageupload/imageuploadui.js");
  55829. /* harmony import */ var _imageupload_imageuploadprogress__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./imageupload/imageuploadprogress */ "./node_modules/@ckeditor/ckeditor5-image/src/imageupload/imageuploadprogress.js");
  55830. /* harmony import */ var _imageupload_imageuploadediting__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./imageupload/imageuploadediting */ "./node_modules/@ckeditor/ckeditor5-image/src/imageupload/imageuploadediting.js");
  55831. /**
  55832. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  55833. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  55834. */
  55835. /**
  55836. * @module image/imageupload
  55837. */
  55838. /**
  55839. * The image upload plugin.
  55840. *
  55841. * For a detailed overview, check the {@glink features/image-upload/image-upload image upload feature} documentation.
  55842. *
  55843. * This plugin does not do anything directly, but it loads a set of specific plugins to enable image uploading:
  55844. *
  55845. * * {@link module:image/imageupload/imageuploadediting~ImageUploadEditing},
  55846. * * {@link module:image/imageupload/imageuploadui~ImageUploadUI},
  55847. * * {@link module:image/imageupload/imageuploadprogress~ImageUploadProgress}.
  55848. *
  55849. * @extends module:core/plugin~Plugin
  55850. */
  55851. class ImageUpload extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  55852. /**
  55853. * @inheritDoc
  55854. */
  55855. static get pluginName() {
  55856. return 'ImageUpload';
  55857. }
  55858. /**
  55859. * @inheritDoc
  55860. */
  55861. static get requires() {
  55862. return [ _imageupload_imageuploadediting__WEBPACK_IMPORTED_MODULE_3__["default"], _imageupload_imageuploadui__WEBPACK_IMPORTED_MODULE_1__["default"], _imageupload_imageuploadprogress__WEBPACK_IMPORTED_MODULE_2__["default"] ];
  55863. }
  55864. }
  55865. /**
  55866. * The image upload configuration.
  55867. *
  55868. * @member {module:image/imageupload~ImageUploadConfig} module:image/image~ImageConfig#upload
  55869. */
  55870. /**
  55871. * The configuration of the image upload feature. Used by the image upload feature in the `@ckeditor/ckeditor5-image` package.
  55872. *
  55873. * ClassicEditor
  55874. * .create( editorElement, {
  55875. * image: {
  55876. * upload: ... // Image upload feature options.
  55877. * }
  55878. * } )
  55879. * .then( ... )
  55880. * .catch( ... );
  55881. *
  55882. * See {@link module:core/editor/editorconfig~EditorConfig all editor options}.
  55883. *
  55884. * @interface module:image/imageupload~ImageUploadConfig
  55885. */
  55886. /**
  55887. * The list of accepted image types.
  55888. *
  55889. * The accepted types of images can be customized to allow only certain types of images:
  55890. *
  55891. * // Allow only JPEG and PNG images:
  55892. * const imageUploadConfig = {
  55893. * types: [ 'png', 'jpeg' ]
  55894. * };
  55895. *
  55896. * The type string should match [one of the sub-types](https://www.iana.org/assignments/media-types/media-types.xhtml#image)
  55897. * of the image MIME type. For example, for the `image/jpeg` MIME type, add `'jpeg'` to your image upload configuration.
  55898. *
  55899. * **Note:** This setting only restricts some image types to be selected and uploaded through the CKEditor UI and commands. Image type
  55900. * recognition and filtering should also be implemented on the server which accepts image uploads.
  55901. *
  55902. * @member {Array.<String>} module:image/imageupload~ImageUploadConfig#types
  55903. * @default [ 'jpeg', 'png', 'gif', 'bmp', 'webp', 'tiff' ]
  55904. */
  55905. /***/ }),
  55906. /***/ "./node_modules/@ckeditor/ckeditor5-image/src/imageupload/imageuploadediting.js":
  55907. /*!**************************************************************************************!*\
  55908. !*** ./node_modules/@ckeditor/ckeditor5-image/src/imageupload/imageuploadediting.js ***!
  55909. \**************************************************************************************/
  55910. /*! exports provided: default, isHtmlIncluded */
  55911. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  55912. "use strict";
  55913. __webpack_require__.r(__webpack_exports__);
  55914. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ImageUploadEditing; });
  55915. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isHtmlIncluded", function() { return isHtmlIncluded; });
  55916. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  55917. /* harmony import */ var ckeditor5_src_engine__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/engine */ "./node_modules/ckeditor5/src/engine.js");
  55918. /* harmony import */ var ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ckeditor5/src/ui */ "./node_modules/ckeditor5/src/ui.js");
  55919. /* harmony import */ var ckeditor5_src_clipboard__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ckeditor5/src/clipboard */ "./node_modules/ckeditor5/src/clipboard.js");
  55920. /* harmony import */ var ckeditor5_src_upload__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ckeditor5/src/upload */ "./node_modules/ckeditor5/src/upload.js");
  55921. /* harmony import */ var ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ckeditor5/src/utils */ "./node_modules/ckeditor5/src/utils.js");
  55922. /* harmony import */ var _uploadimagecommand__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./uploadimagecommand */ "./node_modules/@ckeditor/ckeditor5-image/src/imageupload/uploadimagecommand.js");
  55923. /* harmony import */ var _src_imageupload_utils__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../src/imageupload/utils */ "./node_modules/@ckeditor/ckeditor5-image/src/imageupload/utils.js");
  55924. /* harmony import */ var _image_utils__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../image/utils */ "./node_modules/@ckeditor/ckeditor5-image/src/image/utils.js");
  55925. /**
  55926. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  55927. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  55928. */
  55929. /**
  55930. * @module image/imageupload/imageuploadediting
  55931. */
  55932. /**
  55933. * The editing part of the image upload feature. It registers the `'uploadImage'` command
  55934. * and the `imageUpload` command as an aliased name.
  55935. *
  55936. * When an image is uploaded, it fires the {@link ~ImageUploadEditing#event:uploadComplete `uploadComplete` event}
  55937. * that allows adding custom attributes to the {@link module:engine/model/element~Element image element}.
  55938. *
  55939. * @extends module:core/plugin~Plugin
  55940. */
  55941. class ImageUploadEditing extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  55942. /**
  55943. * @inheritDoc
  55944. */
  55945. static get requires() {
  55946. return [ ckeditor5_src_upload__WEBPACK_IMPORTED_MODULE_4__["FileRepository"], ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_2__["Notification"], ckeditor5_src_clipboard__WEBPACK_IMPORTED_MODULE_3__["ClipboardPipeline"] ];
  55947. }
  55948. static get pluginName() {
  55949. return 'ImageUploadEditing';
  55950. }
  55951. /**
  55952. * @inheritDoc
  55953. */
  55954. constructor( editor ) {
  55955. super( editor );
  55956. editor.config.define( 'image', {
  55957. upload: {
  55958. types: [ 'jpeg', 'png', 'gif', 'bmp', 'webp', 'tiff' ]
  55959. }
  55960. } );
  55961. }
  55962. /**
  55963. * @inheritDoc
  55964. */
  55965. init() {
  55966. const editor = this.editor;
  55967. const doc = editor.model.document;
  55968. const schema = editor.model.schema;
  55969. const conversion = editor.conversion;
  55970. const fileRepository = editor.plugins.get( ckeditor5_src_upload__WEBPACK_IMPORTED_MODULE_4__["FileRepository"] );
  55971. const imageTypes = Object(_src_imageupload_utils__WEBPACK_IMPORTED_MODULE_7__["createImageTypeRegExp"])( editor.config.get( 'image.upload.types' ) );
  55972. // Setup schema to allow uploadId and uploadStatus for images.
  55973. schema.extend( 'image', {
  55974. allowAttributes: [ 'uploadId', 'uploadStatus' ]
  55975. } );
  55976. const uploadImageCommand = new _uploadimagecommand__WEBPACK_IMPORTED_MODULE_6__["default"]( editor );
  55977. // Register `uploadImage` command and add `imageUpload` command as an alias for backward compatibility.
  55978. editor.commands.add( 'uploadImage', uploadImageCommand );
  55979. editor.commands.add( 'imageUpload', uploadImageCommand );
  55980. // Register upcast converter for uploadId.
  55981. conversion.for( 'upcast' )
  55982. .attributeToAttribute( {
  55983. view: {
  55984. name: 'img',
  55985. key: 'uploadId'
  55986. },
  55987. model: 'uploadId'
  55988. } );
  55989. // Handle pasted images.
  55990. // For every image file, a new file loader is created and a placeholder image is
  55991. // inserted into the content. Then, those images are uploaded once they appear in the model
  55992. // (see Document#change listener below).
  55993. this.listenTo( editor.editing.view.document, 'clipboardInput', ( evt, data ) => {
  55994. // Skip if non empty HTML data is included.
  55995. // https://github.com/ckeditor/ckeditor5-upload/issues/68
  55996. if ( isHtmlIncluded( data.dataTransfer ) ) {
  55997. return;
  55998. }
  55999. const images = Array.from( data.dataTransfer.files ).filter( file => {
  56000. // See https://github.com/ckeditor/ckeditor5-image/pull/254.
  56001. if ( !file ) {
  56002. return false;
  56003. }
  56004. return imageTypes.test( file.type );
  56005. } );
  56006. if ( !images.length ) {
  56007. return;
  56008. }
  56009. evt.stop();
  56010. editor.model.change( writer => {
  56011. // Set selection to paste target.
  56012. if ( data.targetRanges ) {
  56013. writer.setSelection( data.targetRanges.map( viewRange => editor.editing.mapper.toModelRange( viewRange ) ) );
  56014. }
  56015. // Upload images after the selection has changed in order to ensure the command's state is refreshed.
  56016. editor.model.enqueueChange( 'default', () => {
  56017. editor.execute( 'uploadImage', { file: images } );
  56018. } );
  56019. } );
  56020. } );
  56021. // Handle HTML pasted with images with base64 or blob sources.
  56022. // For every image file, a new file loader is created and a placeholder image is
  56023. // inserted into the content. Then, those images are uploaded once they appear in the model
  56024. // (see Document#change listener below).
  56025. this.listenTo( editor.plugins.get( 'ClipboardPipeline' ), 'inputTransformation', ( evt, data ) => {
  56026. const fetchableImages = Array.from( editor.editing.view.createRangeIn( data.content ) )
  56027. .filter( value => Object(_src_imageupload_utils__WEBPACK_IMPORTED_MODULE_7__["isLocalImage"])( value.item ) && !value.item.getAttribute( 'uploadProcessed' ) )
  56028. .map( value => { return { promise: Object(_src_imageupload_utils__WEBPACK_IMPORTED_MODULE_7__["fetchLocalImage"])( value.item ), imageElement: value.item }; } );
  56029. if ( !fetchableImages.length ) {
  56030. return;
  56031. }
  56032. const writer = new ckeditor5_src_engine__WEBPACK_IMPORTED_MODULE_1__["UpcastWriter"]( editor.editing.view.document );
  56033. for ( const fetchableImage of fetchableImages ) {
  56034. // Set attribute marking that the image was processed already.
  56035. writer.setAttribute( 'uploadProcessed', true, fetchableImage.imageElement );
  56036. const loader = fileRepository.createLoader( fetchableImage.promise );
  56037. if ( loader ) {
  56038. writer.setAttribute( 'src', '', fetchableImage.imageElement );
  56039. writer.setAttribute( 'uploadId', loader.id, fetchableImage.imageElement );
  56040. }
  56041. }
  56042. } );
  56043. // Prevents from the browser redirecting to the dropped image.
  56044. editor.editing.view.document.on( 'dragover', ( evt, data ) => {
  56045. data.preventDefault();
  56046. } );
  56047. // Upload placeholder images that appeared in the model.
  56048. doc.on( 'change', () => {
  56049. const changes = doc.differ.getChanges( { includeChangesInGraveyard: true } );
  56050. for ( const entry of changes ) {
  56051. if ( entry.type == 'insert' && entry.name != '$text' ) {
  56052. const item = entry.position.nodeAfter;
  56053. const isInGraveyard = entry.position.root.rootName == '$graveyard';
  56054. for ( const image of getImagesFromChangeItem( editor, item ) ) {
  56055. // Check if the image element still has upload id.
  56056. const uploadId = image.getAttribute( 'uploadId' );
  56057. if ( !uploadId ) {
  56058. continue;
  56059. }
  56060. // Check if the image is loaded on this client.
  56061. const loader = fileRepository.loaders.get( uploadId );
  56062. if ( !loader ) {
  56063. continue;
  56064. }
  56065. if ( isInGraveyard ) {
  56066. // If the image was inserted to the graveyard - abort the loading process.
  56067. loader.abort();
  56068. } else if ( loader.status == 'idle' ) {
  56069. // If the image was inserted into content and has not been loaded yet, start loading it.
  56070. this._readAndUpload( loader, image );
  56071. }
  56072. }
  56073. }
  56074. }
  56075. } );
  56076. // Set the default handler for feeding the image element with `src` and `srcset` attributes.
  56077. this.on( 'uploadComplete', ( evt, { imageElement, data } ) => {
  56078. const urls = data.urls ? data.urls : data;
  56079. this.editor.model.change( writer => {
  56080. writer.setAttribute( 'src', urls.default, imageElement );
  56081. this._parseAndSetSrcsetAttributeOnImage( urls, imageElement, writer );
  56082. } );
  56083. }, { priority: 'low' } );
  56084. }
  56085. /**
  56086. * Reads and uploads an image.
  56087. *
  56088. * The image is read from the disk and as a Base64-encoded string it is set temporarily to
  56089. * `image[src]`. When the image is successfully uploaded, the temporary data is replaced with the target
  56090. * image's URL (the URL to the uploaded image on the server).
  56091. *
  56092. * @protected
  56093. * @param {module:upload/filerepository~FileLoader} loader
  56094. * @param {module:engine/model/element~Element} imageElement
  56095. * @returns {Promise}
  56096. */
  56097. _readAndUpload( loader, imageElement ) {
  56098. const editor = this.editor;
  56099. const model = editor.model;
  56100. const t = editor.locale.t;
  56101. const fileRepository = editor.plugins.get( ckeditor5_src_upload__WEBPACK_IMPORTED_MODULE_4__["FileRepository"] );
  56102. const notification = editor.plugins.get( ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_2__["Notification"] );
  56103. model.enqueueChange( 'transparent', writer => {
  56104. writer.setAttribute( 'uploadStatus', 'reading', imageElement );
  56105. } );
  56106. return loader.read()
  56107. .then( () => {
  56108. const promise = loader.upload();
  56109. // Force re–paint in Safari. Without it, the image will display with a wrong size.
  56110. // https://github.com/ckeditor/ckeditor5/issues/1975
  56111. /* istanbul ignore next */
  56112. if ( ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_5__["env"].isSafari ) {
  56113. const viewFigure = editor.editing.mapper.toViewElement( imageElement );
  56114. const viewImg = Object(_image_utils__WEBPACK_IMPORTED_MODULE_8__["getViewImgFromWidget"])( viewFigure );
  56115. editor.editing.view.once( 'render', () => {
  56116. // Early returns just to be safe. There might be some code ran
  56117. // in between the outer scope and this callback.
  56118. if ( !viewImg.parent ) {
  56119. return;
  56120. }
  56121. const domFigure = editor.editing.view.domConverter.mapViewToDom( viewImg.parent );
  56122. if ( !domFigure ) {
  56123. return;
  56124. }
  56125. const originalDisplay = domFigure.style.display;
  56126. domFigure.style.display = 'none';
  56127. // Make sure this line will never be removed during minification for having "no effect".
  56128. domFigure._ckHack = domFigure.offsetHeight;
  56129. domFigure.style.display = originalDisplay;
  56130. } );
  56131. }
  56132. model.enqueueChange( 'transparent', writer => {
  56133. writer.setAttribute( 'uploadStatus', 'uploading', imageElement );
  56134. } );
  56135. return promise;
  56136. } )
  56137. .then( data => {
  56138. model.enqueueChange( 'transparent', writer => {
  56139. writer.setAttribute( 'uploadStatus', 'complete', imageElement );
  56140. /**
  56141. * An event fired when an image is uploaded. You can hook into this event to provide
  56142. * custom attributes to the {@link module:engine/model/element~Element image element} based on the data from
  56143. * the server.
  56144. *
  56145. * const imageUploadEditing = editor.plugins.get( 'ImageUploadEditing' );
  56146. *
  56147. * imageUploadEditing.on( 'uploadComplete', ( evt, { data, imageElement } ) => {
  56148. * editor.model.change( writer => {
  56149. * writer.setAttribute( 'someAttribute', 'foo', imageElement );
  56150. * } );
  56151. * } );
  56152. *
  56153. * You can also stop the default handler that sets the `src` and `srcset` attributes
  56154. * if you want to provide custom values for these attributes.
  56155. *
  56156. * imageUploadEditing.on( 'uploadComplete', ( evt, { data, imageElement } ) => {
  56157. * evt.stop();
  56158. * } );
  56159. *
  56160. * **Note**: This event is fired by the {@link module:image/imageupload/imageuploadediting~ImageUploadEditing} plugin.
  56161. *
  56162. * @event uploadComplete
  56163. * @param {Object} data The `uploadComplete` event data.
  56164. * @param {Object} data.data The data coming from the upload adapter.
  56165. * @param {module:engine/model/element~Element} data.imageElement The
  56166. * model {@link module:engine/model/element~Element image element} that can be customized.
  56167. */
  56168. this.fire( 'uploadComplete', { data, imageElement } );
  56169. } );
  56170. clean();
  56171. } )
  56172. .catch( error => {
  56173. // If status is not 'error' nor 'aborted' - throw error because it means that something else went wrong,
  56174. // it might be generic error and it would be real pain to find what is going on.
  56175. if ( loader.status !== 'error' && loader.status !== 'aborted' ) {
  56176. throw error;
  56177. }
  56178. // Might be 'aborted'.
  56179. if ( loader.status == 'error' && error ) {
  56180. notification.showWarning( error, {
  56181. title: t( 'Upload failed' ),
  56182. namespace: 'upload'
  56183. } );
  56184. }
  56185. clean();
  56186. // Permanently remove image from insertion batch.
  56187. model.enqueueChange( 'transparent', writer => {
  56188. writer.remove( imageElement );
  56189. } );
  56190. } );
  56191. function clean() {
  56192. model.enqueueChange( 'transparent', writer => {
  56193. writer.removeAttribute( 'uploadId', imageElement );
  56194. writer.removeAttribute( 'uploadStatus', imageElement );
  56195. } );
  56196. fileRepository.destroyLoader( loader );
  56197. }
  56198. }
  56199. /**
  56200. * Creates the `srcset` attribute based on a given file upload response and sets it as an attribute to a specific image element.
  56201. *
  56202. * @protected
  56203. * @param {Object} data Data object from which `srcset` will be created.
  56204. * @param {module:engine/model/element~Element} image The image element on which the `srcset` attribute will be set.
  56205. * @param {module:engine/model/writer~Writer} writer
  56206. */
  56207. _parseAndSetSrcsetAttributeOnImage( data, image, writer ) {
  56208. // Srcset attribute for responsive images support.
  56209. let maxWidth = 0;
  56210. const srcsetAttribute = Object.keys( data )
  56211. // Filter out keys that are not integers.
  56212. .filter( key => {
  56213. const width = parseInt( key, 10 );
  56214. if ( !isNaN( width ) ) {
  56215. maxWidth = Math.max( maxWidth, width );
  56216. return true;
  56217. }
  56218. } )
  56219. // Convert each key to srcset entry.
  56220. .map( key => `${ data[ key ] } ${ key }w` )
  56221. // Join all entries.
  56222. .join( ', ' );
  56223. if ( srcsetAttribute != '' ) {
  56224. writer.setAttribute( 'srcset', {
  56225. data: srcsetAttribute,
  56226. width: maxWidth
  56227. }, image );
  56228. }
  56229. }
  56230. }
  56231. // Returns `true` if non-empty `text/html` is included in the data transfer.
  56232. //
  56233. // @param {module:clipboard/datatransfer~DataTransfer} dataTransfer
  56234. // @returns {Boolean}
  56235. function isHtmlIncluded( dataTransfer ) {
  56236. return Array.from( dataTransfer.types ).includes( 'text/html' ) && dataTransfer.getData( 'text/html' ) !== '';
  56237. }
  56238. function getImagesFromChangeItem( editor, item ) {
  56239. return Array.from( editor.model.createRangeOn( item ) )
  56240. .filter( value => value.item.is( 'element', 'image' ) )
  56241. .map( value => value.item );
  56242. }
  56243. /***/ }),
  56244. /***/ "./node_modules/@ckeditor/ckeditor5-image/src/imageupload/imageuploadprogress.js":
  56245. /*!***************************************************************************************!*\
  56246. !*** ./node_modules/@ckeditor/ckeditor5-image/src/imageupload/imageuploadprogress.js ***!
  56247. \***************************************************************************************/
  56248. /*! exports provided: default */
  56249. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  56250. "use strict";
  56251. __webpack_require__.r(__webpack_exports__);
  56252. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ImageUploadProgress; });
  56253. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  56254. /* harmony import */ var ckeditor5_src_upload__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/upload */ "./node_modules/ckeditor5/src/upload.js");
  56255. /* harmony import */ var _image_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../image/utils */ "./node_modules/@ckeditor/ckeditor5-image/src/image/utils.js");
  56256. /* harmony import */ var _theme_icons_image_placeholder_svg__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../theme/icons/image_placeholder.svg */ "./node_modules/@ckeditor/ckeditor5-image/theme/icons/image_placeholder.svg");
  56257. /* harmony import */ var _theme_imageuploadprogress_css__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../theme/imageuploadprogress.css */ "./node_modules/@ckeditor/ckeditor5-image/theme/imageuploadprogress.css");
  56258. /* harmony import */ var _theme_imageuploadprogress_css__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_theme_imageuploadprogress_css__WEBPACK_IMPORTED_MODULE_4__);
  56259. /* harmony import */ var _theme_imageuploadicon_css__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../theme/imageuploadicon.css */ "./node_modules/@ckeditor/ckeditor5-image/theme/imageuploadicon.css");
  56260. /* harmony import */ var _theme_imageuploadicon_css__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_theme_imageuploadicon_css__WEBPACK_IMPORTED_MODULE_5__);
  56261. /* harmony import */ var _theme_imageuploadloader_css__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../theme/imageuploadloader.css */ "./node_modules/@ckeditor/ckeditor5-image/theme/imageuploadloader.css");
  56262. /* harmony import */ var _theme_imageuploadloader_css__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_theme_imageuploadloader_css__WEBPACK_IMPORTED_MODULE_6__);
  56263. /**
  56264. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  56265. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  56266. */
  56267. /**
  56268. * @module image/imageupload/imageuploadprogress
  56269. */
  56270. /* globals setTimeout */
  56271. /**
  56272. * The image upload progress plugin.
  56273. * It shows a placeholder when the image is read from the disk and a progress bar while the image is uploading.
  56274. *
  56275. * @extends module:core/plugin~Plugin
  56276. */
  56277. class ImageUploadProgress extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  56278. /**
  56279. * @inheritDoc
  56280. */
  56281. static get pluginName() {
  56282. return 'ImageUploadProgress';
  56283. }
  56284. /**
  56285. * @inheritDoc
  56286. */
  56287. constructor( editor ) {
  56288. super( editor );
  56289. /**
  56290. * The image placeholder that is displayed before real image data can be accessed.
  56291. *
  56292. * @protected
  56293. * @member {String} #placeholder
  56294. */
  56295. this.placeholder = 'data:image/svg+xml;utf8,' + encodeURIComponent( _theme_icons_image_placeholder_svg__WEBPACK_IMPORTED_MODULE_3__["default"] );
  56296. }
  56297. /**
  56298. * @inheritDoc
  56299. */
  56300. init() {
  56301. const editor = this.editor;
  56302. // Upload status change - update image's view according to that status.
  56303. editor.editing.downcastDispatcher.on( 'attribute:uploadStatus:image', ( ...args ) => this.uploadStatusChange( ...args ) );
  56304. }
  56305. /**
  56306. * This method is called each time the image `uploadStatus` attribute is changed.
  56307. *
  56308. * @param {module:utils/eventinfo~EventInfo} evt An object containing information about the fired event.
  56309. * @param {Object} data Additional information about the change.
  56310. * @param {module:engine/conversion/downcastdispatcher~DowncastConversionApi} conversionApi
  56311. */
  56312. uploadStatusChange( evt, data, conversionApi ) {
  56313. const editor = this.editor;
  56314. const modelImage = data.item;
  56315. const uploadId = modelImage.getAttribute( 'uploadId' );
  56316. if ( !conversionApi.consumable.consume( data.item, evt.name ) ) {
  56317. return;
  56318. }
  56319. const fileRepository = editor.plugins.get( ckeditor5_src_upload__WEBPACK_IMPORTED_MODULE_1__["FileRepository"] );
  56320. const status = uploadId ? data.attributeNewValue : null;
  56321. const placeholder = this.placeholder;
  56322. const viewFigure = editor.editing.mapper.toViewElement( modelImage );
  56323. const viewWriter = conversionApi.writer;
  56324. if ( status == 'reading' ) {
  56325. // Start "appearing" effect and show placeholder with infinite progress bar on the top
  56326. // while image is read from disk.
  56327. _startAppearEffect( viewFigure, viewWriter );
  56328. _showPlaceholder( placeholder, viewFigure, viewWriter );
  56329. return;
  56330. }
  56331. // Show progress bar on the top of the image when image is uploading.
  56332. if ( status == 'uploading' ) {
  56333. const loader = fileRepository.loaders.get( uploadId );
  56334. // Start appear effect if needed - see https://github.com/ckeditor/ckeditor5-image/issues/191.
  56335. _startAppearEffect( viewFigure, viewWriter );
  56336. if ( !loader ) {
  56337. // There is no loader associated with uploadId - this means that image came from external changes.
  56338. // In such cases we still want to show the placeholder until image is fully uploaded.
  56339. // Show placeholder if needed - see https://github.com/ckeditor/ckeditor5-image/issues/191.
  56340. _showPlaceholder( placeholder, viewFigure, viewWriter );
  56341. } else {
  56342. // Hide placeholder and initialize progress bar showing upload progress.
  56343. _hidePlaceholder( viewFigure, viewWriter );
  56344. _showProgressBar( viewFigure, viewWriter, loader, editor.editing.view );
  56345. _displayLocalImage( viewFigure, viewWriter, loader );
  56346. }
  56347. return;
  56348. }
  56349. if ( status == 'complete' && fileRepository.loaders.get( uploadId ) ) {
  56350. _showCompleteIcon( viewFigure, viewWriter, editor.editing.view );
  56351. }
  56352. // Clean up.
  56353. _hideProgressBar( viewFigure, viewWriter );
  56354. _hidePlaceholder( viewFigure, viewWriter );
  56355. _stopAppearEffect( viewFigure, viewWriter );
  56356. }
  56357. }
  56358. // Adds ck-appear class to the image figure if one is not already applied.
  56359. //
  56360. // @param {module:engine/view/containerelement~ContainerElement} viewFigure
  56361. // @param {module:engine/view/downcastwriter~DowncastWriter} writer
  56362. function _startAppearEffect( viewFigure, writer ) {
  56363. if ( !viewFigure.hasClass( 'ck-appear' ) ) {
  56364. writer.addClass( 'ck-appear', viewFigure );
  56365. }
  56366. }
  56367. // Removes ck-appear class to the image figure if one is not already removed.
  56368. //
  56369. // @param {module:engine/view/containerelement~ContainerElement} viewFigure
  56370. // @param {module:engine/view/downcastwriter~DowncastWriter} writer
  56371. function _stopAppearEffect( viewFigure, writer ) {
  56372. writer.removeClass( 'ck-appear', viewFigure );
  56373. }
  56374. // Shows placeholder together with infinite progress bar on given image figure.
  56375. //
  56376. // @param {String} Data-uri with a svg placeholder.
  56377. // @param {module:engine/view/containerelement~ContainerElement} viewFigure
  56378. // @param {module:engine/view/downcastwriter~DowncastWriter} writer
  56379. function _showPlaceholder( placeholder, viewFigure, writer ) {
  56380. if ( !viewFigure.hasClass( 'ck-image-upload-placeholder' ) ) {
  56381. writer.addClass( 'ck-image-upload-placeholder', viewFigure );
  56382. }
  56383. const viewImg = Object(_image_utils__WEBPACK_IMPORTED_MODULE_2__["getViewImgFromWidget"])( viewFigure );
  56384. if ( viewImg.getAttribute( 'src' ) !== placeholder ) {
  56385. writer.setAttribute( 'src', placeholder, viewImg );
  56386. }
  56387. if ( !_getUIElement( viewFigure, 'placeholder' ) ) {
  56388. writer.insert( writer.createPositionAfter( viewImg ), _createPlaceholder( writer ) );
  56389. }
  56390. }
  56391. // Removes placeholder together with infinite progress bar on given image figure.
  56392. //
  56393. // @param {module:engine/view/containerelement~ContainerElement} viewFigure
  56394. // @param {module:engine/view/downcastwriter~DowncastWriter} writer
  56395. function _hidePlaceholder( viewFigure, writer ) {
  56396. if ( viewFigure.hasClass( 'ck-image-upload-placeholder' ) ) {
  56397. writer.removeClass( 'ck-image-upload-placeholder', viewFigure );
  56398. }
  56399. _removeUIElement( viewFigure, writer, 'placeholder' );
  56400. }
  56401. // Shows progress bar displaying upload progress.
  56402. // Attaches it to the file loader to update when upload percentace is changed.
  56403. //
  56404. // @param {module:engine/view/containerelement~ContainerElement} viewFigure
  56405. // @param {module:engine/view/downcastwriter~DowncastWriter} writer
  56406. // @param {module:upload/filerepository~FileLoader} loader
  56407. // @param {module:engine/view/view~View} view
  56408. function _showProgressBar( viewFigure, writer, loader, view ) {
  56409. const progressBar = _createProgressBar( writer );
  56410. writer.insert( writer.createPositionAt( viewFigure, 'end' ), progressBar );
  56411. // Update progress bar width when uploadedPercent is changed.
  56412. loader.on( 'change:uploadedPercent', ( evt, name, value ) => {
  56413. view.change( writer => {
  56414. writer.setStyle( 'width', value + '%', progressBar );
  56415. } );
  56416. } );
  56417. }
  56418. // Hides upload progress bar.
  56419. //
  56420. // @param {module:engine/view/containerelement~ContainerElement} viewFigure
  56421. // @param {module:engine/view/downcastwriter~DowncastWriter} writer
  56422. function _hideProgressBar( viewFigure, writer ) {
  56423. _removeUIElement( viewFigure, writer, 'progressBar' );
  56424. }
  56425. // Shows complete icon and hides after a certain amount of time.
  56426. //
  56427. // @param {module:engine/view/containerelement~ContainerElement} viewFigure
  56428. // @param {module:engine/view/downcastwriter~DowncastWriter} writer
  56429. // @param {module:engine/view/view~View} view
  56430. function _showCompleteIcon( viewFigure, writer, view ) {
  56431. const completeIcon = writer.createUIElement( 'div', { class: 'ck-image-upload-complete-icon' } );
  56432. writer.insert( writer.createPositionAt( viewFigure, 'end' ), completeIcon );
  56433. setTimeout( () => {
  56434. view.change( writer => writer.remove( writer.createRangeOn( completeIcon ) ) );
  56435. }, 3000 );
  56436. }
  56437. // Create progress bar element using {@link module:engine/view/uielement~UIElement}.
  56438. //
  56439. // @private
  56440. // @param {module:engine/view/downcastwriter~DowncastWriter} writer
  56441. // @returns {module:engine/view/uielement~UIElement}
  56442. function _createProgressBar( writer ) {
  56443. const progressBar = writer.createUIElement( 'div', { class: 'ck-progress-bar' } );
  56444. writer.setCustomProperty( 'progressBar', true, progressBar );
  56445. return progressBar;
  56446. }
  56447. // Create placeholder element using {@link module:engine/view/uielement~UIElement}.
  56448. //
  56449. // @private
  56450. // @param {module:engine/view/downcastwriter~DowncastWriter} writer
  56451. // @returns {module:engine/view/uielement~UIElement}
  56452. function _createPlaceholder( writer ) {
  56453. const placeholder = writer.createUIElement( 'div', { class: 'ck-upload-placeholder-loader' } );
  56454. writer.setCustomProperty( 'placeholder', true, placeholder );
  56455. return placeholder;
  56456. }
  56457. // Returns {@link module:engine/view/uielement~UIElement} of given unique property from image figure element.
  56458. // Returns `undefined` if element is not found.
  56459. //
  56460. // @private
  56461. // @param {module:engine/view/element~Element} imageFigure
  56462. // @param {String} uniqueProperty
  56463. // @returns {module:engine/view/uielement~UIElement|undefined}
  56464. function _getUIElement( imageFigure, uniqueProperty ) {
  56465. for ( const child of imageFigure.getChildren() ) {
  56466. if ( child.getCustomProperty( uniqueProperty ) ) {
  56467. return child;
  56468. }
  56469. }
  56470. }
  56471. // Removes {@link module:engine/view/uielement~UIElement} of given unique property from image figure element.
  56472. //
  56473. // @private
  56474. // @param {module:engine/view/element~Element} imageFigure
  56475. // @param {module:engine/view/downcastwriter~DowncastWriter} writer
  56476. // @param {String} uniqueProperty
  56477. function _removeUIElement( viewFigure, writer, uniqueProperty ) {
  56478. const element = _getUIElement( viewFigure, uniqueProperty );
  56479. if ( element ) {
  56480. writer.remove( writer.createRangeOn( element ) );
  56481. }
  56482. }
  56483. // Displays local data from file loader.
  56484. //
  56485. // @param {module:engine/view/element~Element} imageFigure
  56486. // @param {module:engine/view/downcastwriter~DowncastWriter} writer
  56487. // @param {module:upload/filerepository~FileLoader} loader
  56488. function _displayLocalImage( viewFigure, writer, loader ) {
  56489. if ( loader.data ) {
  56490. const viewImg = Object(_image_utils__WEBPACK_IMPORTED_MODULE_2__["getViewImgFromWidget"])( viewFigure );
  56491. writer.setAttribute( 'src', loader.data, viewImg );
  56492. }
  56493. }
  56494. /***/ }),
  56495. /***/ "./node_modules/@ckeditor/ckeditor5-image/src/imageupload/imageuploadui.js":
  56496. /*!*********************************************************************************!*\
  56497. !*** ./node_modules/@ckeditor/ckeditor5-image/src/imageupload/imageuploadui.js ***!
  56498. \*********************************************************************************/
  56499. /*! exports provided: default */
  56500. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  56501. "use strict";
  56502. __webpack_require__.r(__webpack_exports__);
  56503. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ImageUploadUI; });
  56504. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  56505. /* harmony import */ var ckeditor5_src_upload__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/upload */ "./node_modules/ckeditor5/src/upload.js");
  56506. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils */ "./node_modules/@ckeditor/ckeditor5-image/src/imageupload/utils.js");
  56507. /**
  56508. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  56509. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  56510. */
  56511. /**
  56512. * @module image/imageupload/imageuploadui
  56513. */
  56514. /**
  56515. * The image upload button plugin.
  56516. *
  56517. * For a detailed overview, check the {@glink features/image-upload/image-upload Image upload feature} documentation.
  56518. *
  56519. * Adds the `'uploadImage'` button to the {@link module:ui/componentfactory~ComponentFactory UI component factory}
  56520. * and also the `imageUpload` button as an alias for backward compatibility.
  56521. *
  56522. * @extends module:core/plugin~Plugin
  56523. */
  56524. class ImageUploadUI extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  56525. /**
  56526. * @inheritDoc
  56527. */
  56528. static get pluginName() {
  56529. return 'ImageUploadUI';
  56530. }
  56531. /**
  56532. * @inheritDoc
  56533. */
  56534. init() {
  56535. const editor = this.editor;
  56536. const t = editor.t;
  56537. const componentCreator = locale => {
  56538. const view = new ckeditor5_src_upload__WEBPACK_IMPORTED_MODULE_1__["FileDialogButtonView"]( locale );
  56539. const command = editor.commands.get( 'uploadImage' );
  56540. const imageTypes = editor.config.get( 'image.upload.types' );
  56541. const imageTypesRegExp = Object(_utils__WEBPACK_IMPORTED_MODULE_2__["createImageTypeRegExp"])( imageTypes );
  56542. view.set( {
  56543. acceptedType: imageTypes.map( type => `image/${ type }` ).join( ',' ),
  56544. allowMultipleFiles: true
  56545. } );
  56546. view.buttonView.set( {
  56547. label: t( 'Insert image' ),
  56548. icon: ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["icons"].image,
  56549. tooltip: true
  56550. } );
  56551. view.buttonView.bind( 'isEnabled' ).to( command );
  56552. view.on( 'done', ( evt, files ) => {
  56553. const imagesToUpload = Array.from( files ).filter( file => imageTypesRegExp.test( file.type ) );
  56554. if ( imagesToUpload.length ) {
  56555. editor.execute( 'uploadImage', { file: imagesToUpload } );
  56556. }
  56557. } );
  56558. return view;
  56559. };
  56560. // Setup `uploadImage` button and add `imageUpload` button as an alias for backward compatibility.
  56561. editor.ui.componentFactory.add( 'uploadImage', componentCreator );
  56562. editor.ui.componentFactory.add( 'imageUpload', componentCreator );
  56563. }
  56564. }
  56565. /***/ }),
  56566. /***/ "./node_modules/@ckeditor/ckeditor5-image/src/imageupload/uploadimagecommand.js":
  56567. /*!**************************************************************************************!*\
  56568. !*** ./node_modules/@ckeditor/ckeditor5-image/src/imageupload/uploadimagecommand.js ***!
  56569. \**************************************************************************************/
  56570. /*! exports provided: default */
  56571. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  56572. "use strict";
  56573. __webpack_require__.r(__webpack_exports__);
  56574. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return UploadImageCommand; });
  56575. /* harmony import */ var ckeditor5_src_upload__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/upload */ "./node_modules/ckeditor5/src/upload.js");
  56576. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  56577. /* harmony import */ var ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ckeditor5/src/utils */ "./node_modules/ckeditor5/src/utils.js");
  56578. /* harmony import */ var _image_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../image/utils */ "./node_modules/@ckeditor/ckeditor5-image/src/image/utils.js");
  56579. /**
  56580. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  56581. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  56582. */
  56583. /**
  56584. * @module image/imageupload/uploadimagecommand
  56585. */
  56586. /**
  56587. * The upload image command.
  56588. *
  56589. * The command is registered by the {@link module:image/imageupload/imageuploadediting~ImageUploadEditing} plugin as `uploadImage`
  56590. * and it is also available via aliased `imageUpload` name.
  56591. *
  56592. * In order to upload an image at the current selection position
  56593. * (according to the {@link module:widget/utils~findOptimalInsertionPosition} algorithm),
  56594. * execute the command and pass the native image file instance:
  56595. *
  56596. * this.listenTo( editor.editing.view.document, 'clipboardInput', ( evt, data ) => {
  56597. * // Assuming that only images were pasted:
  56598. * const images = Array.from( data.dataTransfer.files );
  56599. *
  56600. * // Upload the first image:
  56601. * editor.execute( 'uploadImage', { file: images[ 0 ] } );
  56602. * } );
  56603. *
  56604. * It is also possible to insert multiple images at once:
  56605. *
  56606. * editor.execute( 'uploadImage', {
  56607. * file: [
  56608. * file1,
  56609. * file2
  56610. * ]
  56611. * } );
  56612. *
  56613. * @extends module:core/command~Command
  56614. */
  56615. class UploadImageCommand extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_1__["Command"] {
  56616. /**
  56617. * @inheritDoc
  56618. */
  56619. refresh() {
  56620. const imageElement = this.editor.model.document.selection.getSelectedElement();
  56621. const isImage = imageElement && imageElement.name === 'image' || false;
  56622. this.isEnabled = Object(_image_utils__WEBPACK_IMPORTED_MODULE_3__["isImageAllowed"])( this.editor.model ) || isImage;
  56623. }
  56624. /**
  56625. * Executes the command.
  56626. *
  56627. * @fires execute
  56628. * @param {Object} options Options for the executed command.
  56629. * @param {File|Array.<File>} options.file The image file or an array of image files to upload.
  56630. */
  56631. execute( options ) {
  56632. const editor = this.editor;
  56633. const model = editor.model;
  56634. const fileRepository = editor.plugins.get( ckeditor5_src_upload__WEBPACK_IMPORTED_MODULE_0__["FileRepository"] );
  56635. for ( const file of Object(ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_2__["toArray"])( options.file ) ) {
  56636. uploadImage( model, fileRepository, file );
  56637. }
  56638. }
  56639. }
  56640. // Handles uploading single file.
  56641. //
  56642. // @param {module:engine/model/model~Model} model
  56643. // @param {File} file
  56644. function uploadImage( model, fileRepository, file ) {
  56645. const loader = fileRepository.createLoader( file );
  56646. // Do not throw when upload adapter is not set. FileRepository will log an error anyway.
  56647. if ( !loader ) {
  56648. return;
  56649. }
  56650. Object(_image_utils__WEBPACK_IMPORTED_MODULE_3__["insertImage"])( model, { uploadId: loader.id } );
  56651. }
  56652. /***/ }),
  56653. /***/ "./node_modules/@ckeditor/ckeditor5-image/src/imageupload/utils.js":
  56654. /*!*************************************************************************!*\
  56655. !*** ./node_modules/@ckeditor/ckeditor5-image/src/imageupload/utils.js ***!
  56656. \*************************************************************************/
  56657. /*! exports provided: createImageTypeRegExp, fetchLocalImage, isLocalImage */
  56658. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  56659. "use strict";
  56660. __webpack_require__.r(__webpack_exports__);
  56661. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createImageTypeRegExp", function() { return createImageTypeRegExp; });
  56662. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fetchLocalImage", function() { return fetchLocalImage; });
  56663. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isLocalImage", function() { return isLocalImage; });
  56664. /* harmony import */ var ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/utils */ "./node_modules/ckeditor5/src/utils.js");
  56665. /**
  56666. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  56667. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  56668. */
  56669. /**
  56670. * @module image/imageupload/utils
  56671. */
  56672. /* global fetch, File */
  56673. /**
  56674. * Creates a regular expression used to test for image files.
  56675. *
  56676. * const imageType = createImageTypeRegExp( [ 'png', 'jpeg', 'svg+xml', 'vnd.microsoft.icon' ] );
  56677. *
  56678. * console.log( 'is supported image', imageType.test( file.type ) );
  56679. *
  56680. * @param {Array.<String>} types
  56681. * @returns {RegExp}
  56682. */
  56683. function createImageTypeRegExp( types ) {
  56684. // Sanitize the MIME type name which may include: "+", "-" or ".".
  56685. const regExpSafeNames = types.map( type => type.replace( '+', '\\+' ) );
  56686. return new RegExp( `^image\\/(${ regExpSafeNames.join( '|' ) })$` );
  56687. }
  56688. /**
  56689. * Creates a promise that fetches the image local source (Base64 or blob) and resolves with a `File` object.
  56690. *
  56691. * @param {module:engine/view/element~Element} image Image whose source to fetch.
  56692. * @returns {Promise.<File>} A promise which resolves when an image source is fetched and converted to a `File` instance.
  56693. * It resolves with a `File` object. If there were any errors during file processing, the promise will be rejected.
  56694. */
  56695. function fetchLocalImage( image ) {
  56696. return new Promise( ( resolve, reject ) => {
  56697. const imageSrc = image.getAttribute( 'src' );
  56698. // Fetch works asynchronously and so does not block browser UI when processing data.
  56699. fetch( imageSrc )
  56700. .then( resource => resource.blob() )
  56701. .then( blob => {
  56702. const mimeType = getImageMimeType( blob, imageSrc );
  56703. const ext = mimeType.replace( 'image/', '' );
  56704. const filename = `image.${ ext }`;
  56705. const file = new File( [ blob ], filename, { type: mimeType } );
  56706. resolve( file );
  56707. } )
  56708. .catch( err => {
  56709. // Fetch fails only, if it can't make a request due to a network failure or if anything prevented the request
  56710. // from completing, i.e. the Content Security Policy rules. It is not possible to detect the exact cause of failure,
  56711. // so we are just trying the fallback solution, if general TypeError is thrown.
  56712. return err && err.name === 'TypeError' ?
  56713. convertLocalImageOnCanvas( imageSrc ).then( resolve ).catch( reject ) :
  56714. reject( err );
  56715. } );
  56716. } );
  56717. }
  56718. /**
  56719. * Checks whether a given node is an image element with a local source (Base64 or blob).
  56720. *
  56721. * @param {module:engine/view/node~Node} node The node to check.
  56722. * @returns {Boolean}
  56723. */
  56724. function isLocalImage( node ) {
  56725. if ( !node.is( 'element', 'img' ) || !node.getAttribute( 'src' ) ) {
  56726. return false;
  56727. }
  56728. return node.getAttribute( 'src' ).match( /^data:image\/\w+;base64,/g ) ||
  56729. node.getAttribute( 'src' ).match( /^blob:/g );
  56730. }
  56731. // Extracts an image type based on its blob representation or its source.
  56732. //
  56733. // @param {String} src Image `src` attribute value.
  56734. // @param {Blob} blob Image blob representation.
  56735. // @returns {String}
  56736. function getImageMimeType( blob, src ) {
  56737. if ( blob.type ) {
  56738. return blob.type;
  56739. } else if ( src.match( /data:(image\/\w+);base64/ ) ) {
  56740. return src.match( /data:(image\/\w+);base64/ )[ 1 ].toLowerCase();
  56741. } else {
  56742. // Fallback to 'jpeg' as common extension.
  56743. return 'image/jpeg';
  56744. }
  56745. }
  56746. // Creates a promise that converts the image local source (Base64 or blob) to a blob using canvas and resolves
  56747. // with a `File` object.
  56748. //
  56749. // @param {String} imageSrc Image `src` attribute value.
  56750. // @returns {Promise.<File>} A promise which resolves when an image source is converted to a `File` instance.
  56751. // It resolves with a `File` object. If there were any errors during file processing, the promise will be rejected.
  56752. function convertLocalImageOnCanvas( imageSrc ) {
  56753. return getBlobFromCanvas( imageSrc ).then( blob => {
  56754. const mimeType = getImageMimeType( blob, imageSrc );
  56755. const ext = mimeType.replace( 'image/', '' );
  56756. const filename = `image.${ ext }`;
  56757. return new File( [ blob ], filename, { type: mimeType } );
  56758. } );
  56759. }
  56760. // Creates a promise that resolves with a `Blob` object converted from the image source (Base64 or blob).
  56761. //
  56762. // @param {String} imageSrc Image `src` attribute value.
  56763. // @returns {Promise.<Blob>}
  56764. function getBlobFromCanvas( imageSrc ) {
  56765. return new Promise( ( resolve, reject ) => {
  56766. const image = ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_0__["global"].document.createElement( 'img' );
  56767. image.addEventListener( 'load', () => {
  56768. const canvas = ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_0__["global"].document.createElement( 'canvas' );
  56769. canvas.width = image.width;
  56770. canvas.height = image.height;
  56771. const ctx = canvas.getContext( '2d' );
  56772. ctx.drawImage( image, 0, 0 );
  56773. canvas.toBlob( blob => blob ? resolve( blob ) : reject() );
  56774. } );
  56775. image.addEventListener( 'error', () => reject() );
  56776. image.src = imageSrc;
  56777. } );
  56778. }
  56779. /***/ }),
  56780. /***/ "./node_modules/@ckeditor/ckeditor5-image/theme/icons/image_placeholder.svg":
  56781. /*!**********************************************************************************!*\
  56782. !*** ./node_modules/@ckeditor/ckeditor5-image/theme/icons/image_placeholder.svg ***!
  56783. \**********************************************************************************/
  56784. /*! exports provided: default */
  56785. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  56786. "use strict";
  56787. __webpack_require__.r(__webpack_exports__);
  56788. /* harmony default export */ __webpack_exports__["default"] = ("<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 700 250\"><rect rx=\"4\"/></svg>");
  56789. /***/ }),
  56790. /***/ "./node_modules/@ckeditor/ckeditor5-image/theme/image.css":
  56791. /*!****************************************************************!*\
  56792. !*** ./node_modules/@ckeditor/ckeditor5-image/theme/image.css ***!
  56793. \****************************************************************/
  56794. /*! no static exports found */
  56795. /***/ (function(module, exports, __webpack_require__) {
  56796. var api = __webpack_require__(/*! ../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  56797. 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");
  56798. content = content.__esModule ? content.default : content;
  56799. if (typeof content === 'string') {
  56800. content = [[module.i, content, '']];
  56801. }
  56802. var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
  56803. options.insert = "head";
  56804. options.singleton = true;
  56805. var update = api(content, options);
  56806. module.exports = content.locals || {};
  56807. /***/ }),
  56808. /***/ "./node_modules/@ckeditor/ckeditor5-image/theme/imagecaption.css":
  56809. /*!***********************************************************************!*\
  56810. !*** ./node_modules/@ckeditor/ckeditor5-image/theme/imagecaption.css ***!
  56811. \***********************************************************************/
  56812. /*! no static exports found */
  56813. /***/ (function(module, exports, __webpack_require__) {
  56814. var api = __webpack_require__(/*! ../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  56815. 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");
  56816. content = content.__esModule ? content.default : content;
  56817. if (typeof content === 'string') {
  56818. content = [[module.i, content, '']];
  56819. }
  56820. var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
  56821. options.insert = "head";
  56822. options.singleton = true;
  56823. var update = api(content, options);
  56824. module.exports = content.locals || {};
  56825. /***/ }),
  56826. /***/ "./node_modules/@ckeditor/ckeditor5-image/theme/imageresize.css":
  56827. /*!**********************************************************************!*\
  56828. !*** ./node_modules/@ckeditor/ckeditor5-image/theme/imageresize.css ***!
  56829. \**********************************************************************/
  56830. /*! no static exports found */
  56831. /***/ (function(module, exports, __webpack_require__) {
  56832. var api = __webpack_require__(/*! ../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  56833. 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");
  56834. content = content.__esModule ? content.default : content;
  56835. if (typeof content === 'string') {
  56836. content = [[module.i, content, '']];
  56837. }
  56838. var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
  56839. options.insert = "head";
  56840. options.singleton = true;
  56841. var update = api(content, options);
  56842. module.exports = content.locals || {};
  56843. /***/ }),
  56844. /***/ "./node_modules/@ckeditor/ckeditor5-image/theme/imagestyle.css":
  56845. /*!*********************************************************************!*\
  56846. !*** ./node_modules/@ckeditor/ckeditor5-image/theme/imagestyle.css ***!
  56847. \*********************************************************************/
  56848. /*! no static exports found */
  56849. /***/ (function(module, exports, __webpack_require__) {
  56850. var api = __webpack_require__(/*! ../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  56851. 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");
  56852. content = content.__esModule ? content.default : content;
  56853. if (typeof content === 'string') {
  56854. content = [[module.i, content, '']];
  56855. }
  56856. var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
  56857. options.insert = "head";
  56858. options.singleton = true;
  56859. var update = api(content, options);
  56860. module.exports = content.locals || {};
  56861. /***/ }),
  56862. /***/ "./node_modules/@ckeditor/ckeditor5-image/theme/imageuploadicon.css":
  56863. /*!**************************************************************************!*\
  56864. !*** ./node_modules/@ckeditor/ckeditor5-image/theme/imageuploadicon.css ***!
  56865. \**************************************************************************/
  56866. /*! no static exports found */
  56867. /***/ (function(module, exports, __webpack_require__) {
  56868. var api = __webpack_require__(/*! ../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  56869. 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");
  56870. content = content.__esModule ? content.default : content;
  56871. if (typeof content === 'string') {
  56872. content = [[module.i, content, '']];
  56873. }
  56874. var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
  56875. options.insert = "head";
  56876. options.singleton = true;
  56877. var update = api(content, options);
  56878. module.exports = content.locals || {};
  56879. /***/ }),
  56880. /***/ "./node_modules/@ckeditor/ckeditor5-image/theme/imageuploadloader.css":
  56881. /*!****************************************************************************!*\
  56882. !*** ./node_modules/@ckeditor/ckeditor5-image/theme/imageuploadloader.css ***!
  56883. \****************************************************************************/
  56884. /*! no static exports found */
  56885. /***/ (function(module, exports, __webpack_require__) {
  56886. var api = __webpack_require__(/*! ../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  56887. 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");
  56888. content = content.__esModule ? content.default : content;
  56889. if (typeof content === 'string') {
  56890. content = [[module.i, content, '']];
  56891. }
  56892. var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
  56893. options.insert = "head";
  56894. options.singleton = true;
  56895. var update = api(content, options);
  56896. module.exports = content.locals || {};
  56897. /***/ }),
  56898. /***/ "./node_modules/@ckeditor/ckeditor5-image/theme/imageuploadprogress.css":
  56899. /*!******************************************************************************!*\
  56900. !*** ./node_modules/@ckeditor/ckeditor5-image/theme/imageuploadprogress.css ***!
  56901. \******************************************************************************/
  56902. /*! no static exports found */
  56903. /***/ (function(module, exports, __webpack_require__) {
  56904. var api = __webpack_require__(/*! ../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  56905. 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");
  56906. content = content.__esModule ? content.default : content;
  56907. if (typeof content === 'string') {
  56908. content = [[module.i, content, '']];
  56909. }
  56910. var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
  56911. options.insert = "head";
  56912. options.singleton = true;
  56913. var update = api(content, options);
  56914. module.exports = content.locals || {};
  56915. /***/ }),
  56916. /***/ "./node_modules/@ckeditor/ckeditor5-image/theme/textalternativeform.css":
  56917. /*!******************************************************************************!*\
  56918. !*** ./node_modules/@ckeditor/ckeditor5-image/theme/textalternativeform.css ***!
  56919. \******************************************************************************/
  56920. /*! no static exports found */
  56921. /***/ (function(module, exports, __webpack_require__) {
  56922. var api = __webpack_require__(/*! ../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  56923. 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");
  56924. content = content.__esModule ? content.default : content;
  56925. if (typeof content === 'string') {
  56926. content = [[module.i, content, '']];
  56927. }
  56928. var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
  56929. options.insert = "head";
  56930. options.singleton = true;
  56931. var update = api(content, options);
  56932. module.exports = content.locals || {};
  56933. /***/ }),
  56934. /***/ "./node_modules/@ckeditor/ckeditor5-indent/src/indent.js":
  56935. /*!***************************************************************!*\
  56936. !*** ./node_modules/@ckeditor/ckeditor5-indent/src/indent.js ***!
  56937. \***************************************************************/
  56938. /*! exports provided: default */
  56939. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  56940. "use strict";
  56941. __webpack_require__.r(__webpack_exports__);
  56942. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Indent; });
  56943. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  56944. /* harmony import */ var _indentediting__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./indentediting */ "./node_modules/@ckeditor/ckeditor5-indent/src/indentediting.js");
  56945. /* harmony import */ var _indentui__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./indentui */ "./node_modules/@ckeditor/ckeditor5-indent/src/indentui.js");
  56946. /**
  56947. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  56948. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  56949. */
  56950. /**
  56951. * @module indent/indent
  56952. */
  56953. /**
  56954. * The indent feature.
  56955. *
  56956. * This plugin acts as a single entry point plugin for other features that implement indentation of elements like lists or paragraphs.
  56957. *
  56958. * The compatible features are:
  56959. *
  56960. * * The {@link module:list/list~List} or {@link module:list/listediting~ListEditing} feature for list indentation.
  56961. * * The {@link module:indent/indentblock~IndentBlock} feature for block indentation.
  56962. *
  56963. * This is a "glue" plugin that loads the following plugins:
  56964. *
  56965. * * The {@link module:indent/indentediting~IndentEditing indent editing feature}.
  56966. * * The {@link module:indent/indentui~IndentUI indent UI feature}.
  56967. *
  56968. * The dependent plugins register the `'indent'` and `'outdent'` commands and introduce the `'indent'` and `'outdent'` buttons
  56969. * that allow to increase or decrease text indentation of supported elements.
  56970. *
  56971. * **Note**: In order for the commands and buttons to work, at least one of compatible features is required.
  56972. *
  56973. * @extends module:core/plugin~Plugin
  56974. */
  56975. class Indent extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  56976. /**
  56977. * @inheritDoc
  56978. */
  56979. static get pluginName() {
  56980. return 'Indent';
  56981. }
  56982. /**
  56983. * @inheritDoc
  56984. */
  56985. static get requires() {
  56986. return [ _indentediting__WEBPACK_IMPORTED_MODULE_1__["default"], _indentui__WEBPACK_IMPORTED_MODULE_2__["default"] ];
  56987. }
  56988. }
  56989. /***/ }),
  56990. /***/ "./node_modules/@ckeditor/ckeditor5-indent/src/indentediting.js":
  56991. /*!**********************************************************************!*\
  56992. !*** ./node_modules/@ckeditor/ckeditor5-indent/src/indentediting.js ***!
  56993. \**********************************************************************/
  56994. /*! exports provided: default */
  56995. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  56996. "use strict";
  56997. __webpack_require__.r(__webpack_exports__);
  56998. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return IndentEditing; });
  56999. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  57000. /**
  57001. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  57002. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  57003. */
  57004. /**
  57005. * @module indent/indentediting
  57006. */
  57007. /**
  57008. * The indent editing feature.
  57009. *
  57010. * This plugin registers the `'indent'` and `'outdent'` commands.
  57011. *
  57012. * **Note**: In order for the commands to work, at least one of the compatible features is required. Read more in the
  57013. * {@link module:indent/indent~Indent indent feature} API documentation.
  57014. *
  57015. * @extends module:core/plugin~Plugin
  57016. */
  57017. class IndentEditing extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  57018. /**
  57019. * @inheritDoc
  57020. */
  57021. static get pluginName() {
  57022. return 'IndentEditing';
  57023. }
  57024. /**
  57025. * @inheritDoc
  57026. */
  57027. init() {
  57028. const editor = this.editor;
  57029. editor.commands.add( 'indent', new ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["MultiCommand"]( editor ) );
  57030. editor.commands.add( 'outdent', new ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["MultiCommand"]( editor ) );
  57031. }
  57032. }
  57033. /***/ }),
  57034. /***/ "./node_modules/@ckeditor/ckeditor5-indent/src/indentui.js":
  57035. /*!*****************************************************************!*\
  57036. !*** ./node_modules/@ckeditor/ckeditor5-indent/src/indentui.js ***!
  57037. \*****************************************************************/
  57038. /*! exports provided: default */
  57039. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  57040. "use strict";
  57041. __webpack_require__.r(__webpack_exports__);
  57042. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return IndentUI; });
  57043. /* harmony import */ var ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/ui */ "./node_modules/ckeditor5/src/ui.js");
  57044. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  57045. /* 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");
  57046. /* 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");
  57047. /**
  57048. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  57049. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  57050. */
  57051. /**
  57052. * @module indent/indentui
  57053. */
  57054. /**
  57055. * The indent UI feature.
  57056. *
  57057. * This plugin registers the `'indent'` and `'outdent'` buttons.
  57058. *
  57059. * **Note**: In order for the commands to work, at least one of the compatible features is required. Read more in
  57060. * the {@link module:indent/indent~Indent indent feature} API documentation.
  57061. *
  57062. * @extends module:core/plugin~Plugin
  57063. */
  57064. class IndentUI extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_1__["Plugin"] {
  57065. /**
  57066. * @inheritDoc
  57067. */
  57068. static get pluginName() {
  57069. return 'IndentUI';
  57070. }
  57071. /**
  57072. * @inheritDoc
  57073. */
  57074. init() {
  57075. const editor = this.editor;
  57076. const locale = editor.locale;
  57077. const t = editor.t;
  57078. const localizedIndentIcon = locale.uiLanguageDirection == 'ltr' ? _theme_icons_indent_svg__WEBPACK_IMPORTED_MODULE_2__["default"] : _theme_icons_outdent_svg__WEBPACK_IMPORTED_MODULE_3__["default"];
  57079. const localizedOutdentIcon = locale.uiLanguageDirection == 'ltr' ? _theme_icons_outdent_svg__WEBPACK_IMPORTED_MODULE_3__["default"] : _theme_icons_indent_svg__WEBPACK_IMPORTED_MODULE_2__["default"];
  57080. this._defineButton( 'indent', t( 'Increase indent' ), localizedIndentIcon );
  57081. this._defineButton( 'outdent', t( 'Decrease indent' ), localizedOutdentIcon );
  57082. }
  57083. /**
  57084. * Defines a UI button.
  57085. *
  57086. * @param {String} commandName
  57087. * @param {String} label
  57088. * @param {String} icon
  57089. * @private
  57090. */
  57091. _defineButton( commandName, label, icon ) {
  57092. const editor = this.editor;
  57093. editor.ui.componentFactory.add( commandName, locale => {
  57094. const command = editor.commands.get( commandName );
  57095. const view = new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_0__["ButtonView"]( locale );
  57096. view.set( {
  57097. label,
  57098. icon,
  57099. tooltip: true
  57100. } );
  57101. view.bind( 'isOn', 'isEnabled' ).to( command, 'value', 'isEnabled' );
  57102. this.listenTo( view, 'execute', () => {
  57103. editor.execute( commandName );
  57104. editor.editing.view.focus();
  57105. } );
  57106. return view;
  57107. } );
  57108. }
  57109. }
  57110. /***/ }),
  57111. /***/ "./node_modules/@ckeditor/ckeditor5-indent/theme/icons/indent.svg":
  57112. /*!************************************************************************!*\
  57113. !*** ./node_modules/@ckeditor/ckeditor5-indent/theme/icons/indent.svg ***!
  57114. \************************************************************************/
  57115. /*! exports provided: default */
  57116. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  57117. "use strict";
  57118. __webpack_require__.r(__webpack_exports__);
  57119. /* 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.95 5.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>");
  57120. /***/ }),
  57121. /***/ "./node_modules/@ckeditor/ckeditor5-indent/theme/icons/outdent.svg":
  57122. /*!*************************************************************************!*\
  57123. !*** ./node_modules/@ckeditor/ckeditor5-indent/theme/icons/outdent.svg ***!
  57124. \*************************************************************************/
  57125. /*! exports provided: default */
  57126. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  57127. "use strict";
  57128. __webpack_require__.r(__webpack_exports__);
  57129. /* 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>");
  57130. /***/ }),
  57131. /***/ "./node_modules/@ckeditor/ckeditor5-link/src/autolink.js":
  57132. /*!***************************************************************!*\
  57133. !*** ./node_modules/@ckeditor/ckeditor5-link/src/autolink.js ***!
  57134. \***************************************************************/
  57135. /*! exports provided: default */
  57136. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  57137. "use strict";
  57138. __webpack_require__.r(__webpack_exports__);
  57139. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return AutoLink; });
  57140. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  57141. /* harmony import */ var ckeditor5_src_typing__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/typing */ "./node_modules/ckeditor5/src/typing.js");
  57142. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils */ "./node_modules/@ckeditor/ckeditor5-link/src/utils.js");
  57143. /**
  57144. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  57145. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  57146. */
  57147. /**
  57148. * @module link/autolink
  57149. */
  57150. const MIN_LINK_LENGTH_WITH_SPACE_AT_END = 4; // Ie: "t.co " (length 5).
  57151. // This was a tweak from https://gist.github.com/dperini/729294.
  57152. const URL_REG_EXP = new RegExp(
  57153. // Group 1: Line start or after a space.
  57154. '(^|\\s)' +
  57155. // Group 2: Detected URL (or e-mail).
  57156. '(' +
  57157. // Protocol identifier or short syntax "//"
  57158. // a. Full form http://user@foo.bar.baz:8080/foo/bar.html#baz?foo=bar
  57159. '(' +
  57160. '(?:(?:(?:https?|ftp):)?\\/\\/)' +
  57161. // BasicAuth using user:pass (optional)
  57162. '(?:\\S+(?::\\S*)?@)?' +
  57163. '(?:' +
  57164. // IP address dotted notation octets
  57165. // excludes loopback network 0.0.0.0
  57166. // excludes reserved space >= 224.0.0.0
  57167. // excludes network & broadcast addresses
  57168. // (first & last IP address of each class)
  57169. '(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])' +
  57170. '(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}' +
  57171. '(?:\\.(?:[1-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))' +
  57172. '|' +
  57173. '(' +
  57174. // Do not allow `www.foo` - see https://github.com/ckeditor/ckeditor5/issues/8050.
  57175. '((?!www\\.)|(www\\.))' +
  57176. // Host & domain names.
  57177. '(?![-_])(?:[-_a-z0-9\\u00a1-\\uffff]{1,63}\\.)+' +
  57178. // TLD identifier name.
  57179. '(?:[a-z\\u00a1-\\uffff]{2,63})' +
  57180. ')' +
  57181. ')' +
  57182. // port number (optional)
  57183. '(?::\\d{2,5})?' +
  57184. // resource path (optional)
  57185. '(?:[/?#]\\S*)?' +
  57186. ')' +
  57187. '|' +
  57188. // b. Short form (either www.example.com or example@example.com)
  57189. '(' +
  57190. '(www.|(\\S+@))' +
  57191. // Host & domain names.
  57192. '((?![-_])(?:[-_a-z0-9\\u00a1-\\uffff]{1,63}\\.))+' +
  57193. // TLD identifier name.
  57194. '(?:[a-z\\u00a1-\\uffff]{2,63})' +
  57195. ')' +
  57196. ')$', 'i' );
  57197. const URL_GROUP_IN_MATCH = 2;
  57198. /**
  57199. * The autolink plugin.
  57200. *
  57201. * @extends module:core/plugin~Plugin
  57202. */
  57203. class AutoLink extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  57204. /**
  57205. * @inheritDoc
  57206. */
  57207. static get pluginName() {
  57208. return 'AutoLink';
  57209. }
  57210. /**
  57211. * @inheritDoc
  57212. */
  57213. init() {
  57214. const editor = this.editor;
  57215. const selection = editor.model.document.selection;
  57216. selection.on( 'change:range', () => {
  57217. // Disable plugin when selection is inside a code block.
  57218. this.isEnabled = !selection.anchor.parent.is( 'element', 'codeBlock' );
  57219. } );
  57220. this._enableTypingHandling();
  57221. }
  57222. /**
  57223. * @inheritDoc
  57224. */
  57225. afterInit() {
  57226. this._enableEnterHandling();
  57227. this._enableShiftEnterHandling();
  57228. }
  57229. /**
  57230. * Enables autolinking on typing.
  57231. *
  57232. * @private
  57233. */
  57234. _enableTypingHandling() {
  57235. const editor = this.editor;
  57236. const watcher = new ckeditor5_src_typing__WEBPACK_IMPORTED_MODULE_1__["TextWatcher"]( editor.model, text => {
  57237. // 1. Detect <kbd>Space</kbd> after a text with a potential link.
  57238. if ( !isSingleSpaceAtTheEnd( text ) ) {
  57239. return;
  57240. }
  57241. // 2. Check text before last typed <kbd>Space</kbd>.
  57242. const url = getUrlAtTextEnd( text.substr( 0, text.length - 1 ) );
  57243. if ( url ) {
  57244. return { url };
  57245. }
  57246. } );
  57247. const input = editor.plugins.get( 'Input' );
  57248. watcher.on( 'matched:data', ( evt, data ) => {
  57249. const { batch, range, url } = data;
  57250. if ( !input.isInput( batch ) ) {
  57251. return;
  57252. }
  57253. const linkEnd = range.end.getShiftedBy( -1 ); // Executed after a space character.
  57254. const linkStart = linkEnd.getShiftedBy( -url.length );
  57255. const linkRange = editor.model.createRange( linkStart, linkEnd );
  57256. this._applyAutoLink( url, linkRange );
  57257. } );
  57258. watcher.bind( 'isEnabled' ).to( this );
  57259. }
  57260. /**
  57261. * Enables autolinking on the <kbd>Enter</kbd> key.
  57262. *
  57263. * @private
  57264. */
  57265. _enableEnterHandling() {
  57266. const editor = this.editor;
  57267. const model = editor.model;
  57268. const enterCommand = editor.commands.get( 'enter' );
  57269. if ( !enterCommand ) {
  57270. return;
  57271. }
  57272. enterCommand.on( 'execute', () => {
  57273. const position = model.document.selection.getFirstPosition();
  57274. if ( !position.parent.previousSibling ) {
  57275. return;
  57276. }
  57277. const rangeToCheck = model.createRangeIn( position.parent.previousSibling );
  57278. this._checkAndApplyAutoLinkOnRange( rangeToCheck );
  57279. } );
  57280. }
  57281. /**
  57282. * Enables autolinking on the <kbd>Shift</kbd>+<kbd>Enter</kbd> keyboard shortcut.
  57283. *
  57284. * @private
  57285. */
  57286. _enableShiftEnterHandling() {
  57287. const editor = this.editor;
  57288. const model = editor.model;
  57289. const shiftEnterCommand = editor.commands.get( 'shiftEnter' );
  57290. if ( !shiftEnterCommand ) {
  57291. return;
  57292. }
  57293. shiftEnterCommand.on( 'execute', () => {
  57294. const position = model.document.selection.getFirstPosition();
  57295. const rangeToCheck = model.createRange(
  57296. model.createPositionAt( position.parent, 0 ),
  57297. position.getShiftedBy( -1 )
  57298. );
  57299. this._checkAndApplyAutoLinkOnRange( rangeToCheck );
  57300. } );
  57301. }
  57302. /**
  57303. * Checks if the passed range contains a linkable text.
  57304. *
  57305. * @param {module:engine/model/range~Range} rangeToCheck
  57306. * @private
  57307. */
  57308. _checkAndApplyAutoLinkOnRange( rangeToCheck ) {
  57309. const model = this.editor.model;
  57310. const { text, range } = Object(ckeditor5_src_typing__WEBPACK_IMPORTED_MODULE_1__["getLastTextLine"])( rangeToCheck, model );
  57311. const url = getUrlAtTextEnd( text );
  57312. if ( url ) {
  57313. const linkRange = model.createRange(
  57314. range.end.getShiftedBy( -url.length ),
  57315. range.end
  57316. );
  57317. this._applyAutoLink( url, linkRange );
  57318. }
  57319. }
  57320. /**
  57321. * Applies a link on a given range.
  57322. *
  57323. * @param {String} url The URL to link.
  57324. * @param {module:engine/model/range~Range} range The text range to apply the link attribute to.
  57325. * @private
  57326. */
  57327. _applyAutoLink( link, range ) {
  57328. const model = this.editor.model;
  57329. if ( !this.isEnabled || !isLinkAllowedOnRange( range, model ) ) {
  57330. return;
  57331. }
  57332. // Enqueue change to make undo step.
  57333. model.enqueueChange( writer => {
  57334. const defaultProtocol = this.editor.config.get( 'link.defaultProtocol' );
  57335. const parsedUrl = Object(_utils__WEBPACK_IMPORTED_MODULE_2__["addLinkProtocolIfApplicable"])( link, defaultProtocol );
  57336. writer.setAttribute( 'linkHref', parsedUrl, range );
  57337. } );
  57338. }
  57339. }
  57340. // Check if text should be evaluated by the plugin in order to reduce number of RegExp checks on whole text.
  57341. function isSingleSpaceAtTheEnd( text ) {
  57342. return text.length > MIN_LINK_LENGTH_WITH_SPACE_AT_END && text[ text.length - 1 ] === ' ' && text[ text.length - 2 ] !== ' ';
  57343. }
  57344. function getUrlAtTextEnd( text ) {
  57345. const match = URL_REG_EXP.exec( text );
  57346. return match ? match[ URL_GROUP_IN_MATCH ] : null;
  57347. }
  57348. function isLinkAllowedOnRange( range, model ) {
  57349. return model.schema.checkAttributeInSelection( model.createSelection( range ), 'linkHref' );
  57350. }
  57351. /***/ }),
  57352. /***/ "./node_modules/@ckeditor/ckeditor5-link/src/link.js":
  57353. /*!***********************************************************!*\
  57354. !*** ./node_modules/@ckeditor/ckeditor5-link/src/link.js ***!
  57355. \***********************************************************/
  57356. /*! exports provided: default */
  57357. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  57358. "use strict";
  57359. __webpack_require__.r(__webpack_exports__);
  57360. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Link; });
  57361. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  57362. /* harmony import */ var _linkediting__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./linkediting */ "./node_modules/@ckeditor/ckeditor5-link/src/linkediting.js");
  57363. /* harmony import */ var _linkui__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./linkui */ "./node_modules/@ckeditor/ckeditor5-link/src/linkui.js");
  57364. /* harmony import */ var _autolink__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./autolink */ "./node_modules/@ckeditor/ckeditor5-link/src/autolink.js");
  57365. /**
  57366. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  57367. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  57368. */
  57369. /**
  57370. * @module link/link
  57371. */
  57372. /**
  57373. * The link plugin.
  57374. *
  57375. * This is a "glue" plugin that loads the {@link module:link/linkediting~LinkEditing link editing feature}
  57376. * and {@link module:link/linkui~LinkUI link UI feature}.
  57377. *
  57378. * @extends module:core/plugin~Plugin
  57379. */
  57380. class Link extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  57381. /**
  57382. * @inheritDoc
  57383. */
  57384. static get requires() {
  57385. return [ _linkediting__WEBPACK_IMPORTED_MODULE_1__["default"], _linkui__WEBPACK_IMPORTED_MODULE_2__["default"], _autolink__WEBPACK_IMPORTED_MODULE_3__["default"] ];
  57386. }
  57387. /**
  57388. * @inheritDoc
  57389. */
  57390. static get pluginName() {
  57391. return 'Link';
  57392. }
  57393. }
  57394. /**
  57395. * The configuration of the {@link module:link/link~Link} feature.
  57396. *
  57397. * Read more in {@link module:link/link~LinkConfig}.
  57398. *
  57399. * @member {module:link/link~LinkConfig} module:core/editor/editorconfig~EditorConfig#link
  57400. */
  57401. /**
  57402. * The configuration of the {@link module:link/link~Link link feature}.
  57403. *
  57404. * ClassicEditor
  57405. * .create( editorElement, {
  57406. * link: ... // Link feature configuration.
  57407. * } )
  57408. * .then( ... )
  57409. * .catch( ... );
  57410. *
  57411. * See {@link module:core/editor/editorconfig~EditorConfig all editor options}.
  57412. * @interface LinkConfig
  57413. */
  57414. /**
  57415. * When set, the editor will add the given protocol to the link when the user creates a link without one.
  57416. * For example, when the user is creating a link and types `ckeditor.com` in the link form input, during link submission
  57417. * the editor will automatically add the `http://` protocol, so the link will look as follows: `http://ckeditor.com`.
  57418. *
  57419. * The feature also provides email address auto-detection. When you submit `hello@example.com`,
  57420. * the plugin will automatically change it to `mailto:hello@example.com`.
  57421. *
  57422. * ClassicEditor
  57423. * .create( editorElement, {
  57424. * link: {
  57425. * defaultProtocol: 'http://'
  57426. * }
  57427. * } )
  57428. * .then( ... )
  57429. * .catch( ... );
  57430. *
  57431. * **NOTE:** If no configuration is provided, the editor will not auto-fix the links.
  57432. *
  57433. * @member {String} module:link/link~LinkConfig#defaultProtocol
  57434. */
  57435. /**
  57436. * When set to `true`, the `target="blank"` and `rel="noopener noreferrer"` attributes are automatically added to all external links
  57437. * in the editor. "External links" are all links in the editor content starting with `http`, `https`, or `//`.
  57438. *
  57439. * ClassicEditor
  57440. * .create( editorElement, {
  57441. * link: {
  57442. * addTargetToExternalLinks: true
  57443. * }
  57444. * } )
  57445. * .then( ... )
  57446. * .catch( ... );
  57447. *
  57448. * Internally, this option activates a predefined {@link module:link/link~LinkConfig#decorators automatic link decorator}
  57449. * that extends all external links with the `target` and `rel` attributes.
  57450. *
  57451. * **Note**: To control the `target` and `rel` attributes of specific links in the edited content, a dedicated
  57452. * {@link module:link/link~LinkDecoratorManualDefinition manual} decorator must be defined in the
  57453. * {@link module:link/link~LinkConfig#decorators `config.link.decorators`} array. In such scenario,
  57454. * the `config.link.addTargetToExternalLinks` option should remain `undefined` or `false` to not interfere with the manual decorator.
  57455. *
  57456. * It is possible to add other {@link module:link/link~LinkDecoratorAutomaticDefinition automatic}
  57457. * or {@link module:link/link~LinkDecoratorManualDefinition manual} link decorators when this option is active.
  57458. *
  57459. * More information about decorators can be found in the {@link module:link/link~LinkConfig#decorators decorators configuration}
  57460. * reference.
  57461. *
  57462. * @default false
  57463. * @member {Boolean} module:link/link~LinkConfig#addTargetToExternalLinks
  57464. */
  57465. /**
  57466. * Decorators provide an easy way to configure and manage additional link attributes in the editor content. There are
  57467. * two types of link decorators:
  57468. *
  57469. * * {@link module:link/link~LinkDecoratorAutomaticDefinition Automatic} &ndash; They match links against pre–defined rules and
  57470. * manage their attributes based on the results.
  57471. * * {@link module:link/link~LinkDecoratorManualDefinition Manual} &ndash; They allow users to control link attributes individually,
  57472. * using the editor UI.
  57473. *
  57474. * Link decorators are defined as objects with key-value pairs, where the key is the name provided for a given decorator and the
  57475. * value is the decorator definition.
  57476. *
  57477. * The name of the decorator also corresponds to the {@glink framework/guides/architecture/editing-engine#text-attributes text attribute}
  57478. * in the model. For instance, the `isExternal` decorator below is represented as a `linkIsExternal` attribute in the model.
  57479. *
  57480. * ClassicEditor
  57481. * .create( editorElement, {
  57482. * link: {
  57483. * decorators: {
  57484. * isExternal: {
  57485. * mode: 'automatic',
  57486. * callback: url => url.startsWith( 'http://' ),
  57487. * attributes: {
  57488. * target: '_blank',
  57489. * rel: 'noopener noreferrer'
  57490. * }
  57491. * },
  57492. * isDownloadable: {
  57493. * mode: 'manual',
  57494. * label: 'Downloadable',
  57495. * attributes: {
  57496. * download: 'file.png',
  57497. * }
  57498. * },
  57499. * // ...
  57500. * }
  57501. * }
  57502. * } )
  57503. * .then( ... )
  57504. * .catch( ... );
  57505. *
  57506. * To learn more about the configuration syntax, check out the {@link module:link/link~LinkDecoratorAutomaticDefinition automatic}
  57507. * and {@link module:link/link~LinkDecoratorManualDefinition manual} decorator option reference.
  57508. *
  57509. * **Warning:** Currently, link decorators work independently of one another and no conflict resolution mechanism exists.
  57510. * For example, configuring the `target` attribute using both an automatic and a manual decorator at the same time could end up with
  57511. * quirky results. The same applies if multiple manual or automatic decorators were defined for the same attribute.
  57512. *
  57513. * **Note**: Since the `target` attribute management for external links is a common use case, there is a predefined automatic decorator
  57514. * dedicated for that purpose which can be enabled by turning a single option on. Check out the
  57515. * {@link module:link/link~LinkConfig#addTargetToExternalLinks `config.link.addTargetToExternalLinks`}
  57516. * configuration description to learn more.
  57517. *
  57518. * See also the {@glink features/link#custom-link-attributes-decorators link feature guide} for more information.
  57519. *
  57520. * @member {Object.<String, module:link/link~LinkDecoratorDefinition>} module:link/link~LinkConfig#decorators
  57521. */
  57522. /**
  57523. * A link decorator definition. Two types implement this defition:
  57524. *
  57525. * * {@link module:link/link~LinkDecoratorManualDefinition}
  57526. * * {@link module:link/link~LinkDecoratorAutomaticDefinition}
  57527. *
  57528. * Refer to their document for more information about available options or to the
  57529. * {@glink features/link#custom-link-attributes-decorators link feature guide} for general information.
  57530. *
  57531. * @interface LinkDecoratorDefinition
  57532. */
  57533. /**
  57534. * Link decorator type.
  57535. *
  57536. * Check out the {@glink features/link#custom-link-attributes-decorators link feature guide} for more information.
  57537. *
  57538. * @member {'manual'|'automatic'} module:link/link~LinkDecoratorDefinition#mode
  57539. */
  57540. /**
  57541. * Describes an automatic {@link module:link/link~LinkConfig#decorators link decorator}. This decorator type matches
  57542. * all links in the editor content against a function that decides whether the link should receive a pre–defined set of attributes.
  57543. *
  57544. * 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
  57545. * `href` (URL). When the callback returns `true`, attributes are applied to the link.
  57546. *
  57547. * For example, to add the `target="_blank"` attribute to all links in the editor starting with `http://`, the
  57548. * configuration could look like this:
  57549. *
  57550. * {
  57551. * mode: 'automatic',
  57552. * callback: url => url.startsWith( 'http://' ),
  57553. * attributes: {
  57554. * target: '_blank'
  57555. * }
  57556. * }
  57557. *
  57558. * **Note**: Since the `target` attribute management for external links is a common use case, there is a predefined automatic decorator
  57559. * dedicated for that purpose that can be enabled by turning a single option on. Check out the
  57560. * {@link module:link/link~LinkConfig#addTargetToExternalLinks `config.link.addTargetToExternalLinks`}
  57561. * configuration description to learn more.
  57562. *
  57563. * @typedef {Object} module:link/link~LinkDecoratorAutomaticDefinition
  57564. * @property {'automatic'} mode Link decorator type. It is `'automatic'` for all automatic decorators.
  57565. * @property {Function} callback Takes a `url` as a parameter and returns `true` if the `attributes` should be applied to the link.
  57566. * @property {Object} attributes Key-value pairs used as link attributes added to the output during the
  57567. * {@glink framework/guides/architecture/editing-engine#conversion downcasting}.
  57568. * Attributes should follow the {@link module:engine/view/elementdefinition~ElementDefinition} syntax.
  57569. */
  57570. /**
  57571. * Describes a manual {@link module:link/link~LinkConfig#decorators link decorator}. This decorator type is represented in
  57572. * the link feature's {@link module:link/linkui user interface} as a switch that the user can use to control the presence
  57573. * of a predefined set of attributes.
  57574. *
  57575. * For instance, to allow the users to manually control the presence of the `target="_blank"` and
  57576. * `rel="noopener noreferrer"` attributes on specific links, the decorator could look as follows:
  57577. *
  57578. * {
  57579. * mode: 'manual',
  57580. * label: 'Open in a new tab',
  57581. * defaultValue: true,
  57582. * attributes: {
  57583. * target: '_blank',
  57584. * rel: 'noopener noreferrer'
  57585. * }
  57586. * }
  57587. *
  57588. * @typedef {Object} module:link/link~LinkDecoratorManualDefinition
  57589. * @property {'manual'} mode Link decorator type. It is `'manual'` for all manual decorators.
  57590. * @property {String} label The label of the UI button that the user can use to control the presence of link attributes.
  57591. * @property {Object} attributes Key-value pairs used as link attributes added to the output during the
  57592. * {@glink framework/guides/architecture/editing-engine#conversion downcasting}.
  57593. * Attributes should follow the {@link module:engine/view/elementdefinition~ElementDefinition} syntax.
  57594. * @property {Boolean} [defaultValue] Controls whether the decorator is "on" by default.
  57595. */
  57596. /***/ }),
  57597. /***/ "./node_modules/@ckeditor/ckeditor5-link/src/linkcommand.js":
  57598. /*!******************************************************************!*\
  57599. !*** ./node_modules/@ckeditor/ckeditor5-link/src/linkcommand.js ***!
  57600. \******************************************************************/
  57601. /*! exports provided: default */
  57602. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  57603. "use strict";
  57604. __webpack_require__.r(__webpack_exports__);
  57605. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return LinkCommand; });
  57606. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  57607. /* harmony import */ var ckeditor5_src_typing__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/typing */ "./node_modules/ckeditor5/src/typing.js");
  57608. /* harmony import */ var ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ckeditor5/src/utils */ "./node_modules/ckeditor5/src/utils.js");
  57609. /* harmony import */ var _utils_automaticdecorators__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils/automaticdecorators */ "./node_modules/@ckeditor/ckeditor5-link/src/utils/automaticdecorators.js");
  57610. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./utils */ "./node_modules/@ckeditor/ckeditor5-link/src/utils.js");
  57611. /**
  57612. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  57613. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  57614. */
  57615. /**
  57616. * @module link/linkcommand
  57617. */
  57618. /**
  57619. * The link command. It is used by the {@link module:link/link~Link link feature}.
  57620. *
  57621. * @extends module:core/command~Command
  57622. */
  57623. class LinkCommand extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Command"] {
  57624. /**
  57625. * The value of the `'linkHref'` attribute if the start of the selection is located in a node with this attribute.
  57626. *
  57627. * @observable
  57628. * @readonly
  57629. * @member {Object|undefined} #value
  57630. */
  57631. constructor( editor ) {
  57632. super( editor );
  57633. /**
  57634. * A collection of {@link module:link/utils~ManualDecorator manual decorators}
  57635. * corresponding to the {@link module:link/link~LinkConfig#decorators decorator configuration}.
  57636. *
  57637. * You can consider it a model with states of manual decorators added to the currently selected link.
  57638. *
  57639. * @readonly
  57640. * @type {module:utils/collection~Collection}
  57641. */
  57642. this.manualDecorators = new ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_2__["Collection"]();
  57643. /**
  57644. * An instance of the helper that ties together all {@link module:link/link~LinkDecoratorAutomaticDefinition}
  57645. * that are used by the {@glink features/link link} and the {@glink features/image#linking-images linking images} features.
  57646. *
  57647. * @readonly
  57648. * @type {module:link/utils~AutomaticDecorators}
  57649. */
  57650. this.automaticDecorators = new _utils_automaticdecorators__WEBPACK_IMPORTED_MODULE_3__["default"]();
  57651. }
  57652. /**
  57653. * Synchronizes the state of {@link #manualDecorators} with the currently present elements in the model.
  57654. */
  57655. restoreManualDecoratorStates() {
  57656. for ( const manualDecorator of this.manualDecorators ) {
  57657. manualDecorator.value = this._getDecoratorStateFromModel( manualDecorator.id );
  57658. }
  57659. }
  57660. /**
  57661. * @inheritDoc
  57662. */
  57663. refresh() {
  57664. const model = this.editor.model;
  57665. const doc = model.document;
  57666. const selectedElement = Object(ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_2__["first"])( doc.selection.getSelectedBlocks() );
  57667. // A check for the `LinkImage` plugin. If the selection contains an element, get values from the element.
  57668. // Currently the selection reads attributes from text nodes only. See #7429 and #7465.
  57669. if ( Object(_utils__WEBPACK_IMPORTED_MODULE_4__["isImageAllowed"])( selectedElement, model.schema ) ) {
  57670. this.value = selectedElement.getAttribute( 'linkHref' );
  57671. this.isEnabled = model.schema.checkAttribute( selectedElement, 'linkHref' );
  57672. } else {
  57673. this.value = doc.selection.getAttribute( 'linkHref' );
  57674. this.isEnabled = model.schema.checkAttributeInSelection( doc.selection, 'linkHref' );
  57675. }
  57676. for ( const manualDecorator of this.manualDecorators ) {
  57677. manualDecorator.value = this._getDecoratorStateFromModel( manualDecorator.id );
  57678. }
  57679. }
  57680. /**
  57681. * Executes the command.
  57682. *
  57683. * When the selection is non-collapsed, the `linkHref` attribute will be applied to nodes inside the selection, but only to
  57684. * those nodes where the `linkHref` attribute is allowed (disallowed nodes will be omitted).
  57685. *
  57686. * When the selection is collapsed and is not inside the text with the `linkHref` attribute, a
  57687. * new {@link module:engine/model/text~Text text node} with the `linkHref` attribute will be inserted in place of the caret, but
  57688. * only if such element is allowed in this place. The `_data` of the inserted text will equal the `href` parameter.
  57689. * The selection will be updated to wrap the just inserted text node.
  57690. *
  57691. * When the selection is collapsed and inside the text with the `linkHref` attribute, the attribute value will be updated.
  57692. *
  57693. * # Decorators and model attribute management
  57694. *
  57695. * There is an optional argument to this command that applies or removes model
  57696. * {@glink framework/guides/architecture/editing-engine#text-attributes text attributes} brought by
  57697. * {@link module:link/utils~ManualDecorator manual link decorators}.
  57698. *
  57699. * Text attribute names in the model correspond to the entries in the {@link module:link/link~LinkConfig#decorators configuration}.
  57700. * For every decorator configured, a model text attribute exists with the "link" prefix. For example, a `'linkMyDecorator'` attribute
  57701. * corresponds to `'myDecorator'` in the configuration.
  57702. *
  57703. * To learn more about link decorators, check out the {@link module:link/link~LinkConfig#decorators `config.link.decorators`}
  57704. * documentation.
  57705. *
  57706. * Here is how to manage decorator attributes with the link command:
  57707. *
  57708. * const linkCommand = editor.commands.get( 'link' );
  57709. *
  57710. * // Adding a new decorator attribute.
  57711. * linkCommand.execute( 'http://example.com', {
  57712. * linkIsExternal: true
  57713. * } );
  57714. *
  57715. * // Removing a decorator attribute from the selection.
  57716. * linkCommand.execute( 'http://example.com', {
  57717. * linkIsExternal: false
  57718. * } );
  57719. *
  57720. * // Adding multiple decorator attributes at the same time.
  57721. * linkCommand.execute( 'http://example.com', {
  57722. * linkIsExternal: true,
  57723. * linkIsDownloadable: true,
  57724. * } );
  57725. *
  57726. * // Removing and adding decorator attributes at the same time.
  57727. * linkCommand.execute( 'http://example.com', {
  57728. * linkIsExternal: false,
  57729. * linkFoo: true,
  57730. * linkIsDownloadable: false,
  57731. * } );
  57732. *
  57733. * **Note**: If the decorator attribute name is not specified, its state remains untouched.
  57734. *
  57735. * **Note**: {@link module:link/unlinkcommand~UnlinkCommand#execute `UnlinkCommand#execute()`} removes all
  57736. * decorator attributes.
  57737. *
  57738. * @fires execute
  57739. * @param {String} href Link destination.
  57740. * @param {Object} [manualDecoratorIds={}] The information about manual decorator attributes to be applied or removed upon execution.
  57741. */
  57742. execute( href, manualDecoratorIds = {} ) {
  57743. const model = this.editor.model;
  57744. const selection = model.document.selection;
  57745. // Stores information about manual decorators to turn them on/off when command is applied.
  57746. const truthyManualDecorators = [];
  57747. const falsyManualDecorators = [];
  57748. for ( const name in manualDecoratorIds ) {
  57749. if ( manualDecoratorIds[ name ] ) {
  57750. truthyManualDecorators.push( name );
  57751. } else {
  57752. falsyManualDecorators.push( name );
  57753. }
  57754. }
  57755. model.change( writer => {
  57756. // If selection is collapsed then update selected link or insert new one at the place of caret.
  57757. if ( selection.isCollapsed ) {
  57758. const position = selection.getFirstPosition();
  57759. // When selection is inside text with `linkHref` attribute.
  57760. if ( selection.hasAttribute( 'linkHref' ) ) {
  57761. // Then update `linkHref` value.
  57762. const linkRange = Object(ckeditor5_src_typing__WEBPACK_IMPORTED_MODULE_1__["findAttributeRange"])( position, 'linkHref', selection.getAttribute( 'linkHref' ), model );
  57763. writer.setAttribute( 'linkHref', href, linkRange );
  57764. truthyManualDecorators.forEach( item => {
  57765. writer.setAttribute( item, true, linkRange );
  57766. } );
  57767. falsyManualDecorators.forEach( item => {
  57768. writer.removeAttribute( item, linkRange );
  57769. } );
  57770. // Put the selection at the end of the updated link.
  57771. writer.setSelection( writer.createPositionAfter( linkRange.end.nodeBefore ) );
  57772. }
  57773. // If not then insert text node with `linkHref` attribute in place of caret.
  57774. // However, since selection is collapsed, attribute value will be used as data for text node.
  57775. // So, if `href` is empty, do not create text node.
  57776. else if ( href !== '' ) {
  57777. const attributes = Object(ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_2__["toMap"])( selection.getAttributes() );
  57778. attributes.set( 'linkHref', href );
  57779. truthyManualDecorators.forEach( item => {
  57780. attributes.set( item, true );
  57781. } );
  57782. const { end: positionAfter } = model.insertContent( writer.createText( href, attributes ), position );
  57783. // Put the selection at the end of the inserted link.
  57784. // Using end of range returned from insertContent in case nodes with the same attributes got merged.
  57785. writer.setSelection( positionAfter );
  57786. }
  57787. // Remove the `linkHref` attribute and all link decorators from the selection.
  57788. // It stops adding a new content into the link element.
  57789. [ 'linkHref', ...truthyManualDecorators, ...falsyManualDecorators ].forEach( item => {
  57790. writer.removeSelectionAttribute( item );
  57791. } );
  57792. } else {
  57793. // If selection has non-collapsed ranges, we change attribute on nodes inside those ranges
  57794. // omitting nodes where the `linkHref` attribute is disallowed.
  57795. const ranges = model.schema.getValidRanges( selection.getRanges(), 'linkHref' );
  57796. // But for the first, check whether the `linkHref` attribute is allowed on selected blocks (e.g. the "image" element).
  57797. const allowedRanges = [];
  57798. for ( const element of selection.getSelectedBlocks() ) {
  57799. if ( model.schema.checkAttribute( element, 'linkHref' ) ) {
  57800. allowedRanges.push( writer.createRangeOn( element ) );
  57801. }
  57802. }
  57803. // Ranges that accept the `linkHref` attribute. Since we will iterate over `allowedRanges`, let's clone it.
  57804. const rangesToUpdate = allowedRanges.slice();
  57805. // For all selection ranges we want to check whether given range is inside an element that accepts the `linkHref` attribute.
  57806. // If so, we don't want to propagate applying the attribute to its children.
  57807. for ( const range of ranges ) {
  57808. if ( this._isRangeToUpdate( range, allowedRanges ) ) {
  57809. rangesToUpdate.push( range );
  57810. }
  57811. }
  57812. for ( const range of rangesToUpdate ) {
  57813. writer.setAttribute( 'linkHref', href, range );
  57814. truthyManualDecorators.forEach( item => {
  57815. writer.setAttribute( item, true, range );
  57816. } );
  57817. falsyManualDecorators.forEach( item => {
  57818. writer.removeAttribute( item, range );
  57819. } );
  57820. }
  57821. }
  57822. } );
  57823. }
  57824. /**
  57825. * Provides information whether a decorator with a given name is present in the currently processed selection.
  57826. *
  57827. * @private
  57828. * @param {String} decoratorName The name of the manual decorator used in the model
  57829. * @returns {Boolean} The information whether a given decorator is currently present in the selection.
  57830. */
  57831. _getDecoratorStateFromModel( decoratorName ) {
  57832. const model = this.editor.model;
  57833. const doc = model.document;
  57834. const selectedElement = Object(ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_2__["first"])( doc.selection.getSelectedBlocks() );
  57835. // A check for the `LinkImage` plugin. If the selection contains an element, get values from the element.
  57836. // Currently the selection reads attributes from text nodes only. See #7429 and #7465.
  57837. if ( Object(_utils__WEBPACK_IMPORTED_MODULE_4__["isImageAllowed"])( selectedElement, model.schema ) ) {
  57838. return selectedElement.getAttribute( decoratorName );
  57839. }
  57840. return doc.selection.getAttribute( decoratorName );
  57841. }
  57842. /**
  57843. * Checks whether specified `range` is inside an element that accepts the `linkHref` attribute.
  57844. *
  57845. * @private
  57846. * @param {module:engine/view/range~Range} range A range to check.
  57847. * @param {Array.<module:engine/view/range~Range>} allowedRanges An array of ranges created on elements where the attribute is accepted.
  57848. * @returns {Boolean}
  57849. */
  57850. _isRangeToUpdate( range, allowedRanges ) {
  57851. for ( const allowedRange of allowedRanges ) {
  57852. // A range is inside an element that will have the `linkHref` attribute. Do not modify its nodes.
  57853. if ( allowedRange.containsRange( range ) ) {
  57854. return false;
  57855. }
  57856. }
  57857. return true;
  57858. }
  57859. }
  57860. /***/ }),
  57861. /***/ "./node_modules/@ckeditor/ckeditor5-link/src/linkediting.js":
  57862. /*!******************************************************************!*\
  57863. !*** ./node_modules/@ckeditor/ckeditor5-link/src/linkediting.js ***!
  57864. \******************************************************************/
  57865. /*! exports provided: default */
  57866. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  57867. "use strict";
  57868. __webpack_require__.r(__webpack_exports__);
  57869. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return LinkEditing; });
  57870. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  57871. /* harmony import */ var ckeditor5_src_engine__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/engine */ "./node_modules/ckeditor5/src/engine.js");
  57872. /* harmony import */ var ckeditor5_src_typing__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ckeditor5/src/typing */ "./node_modules/ckeditor5/src/typing.js");
  57873. /* harmony import */ var ckeditor5_src_clipboard__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ckeditor5/src/clipboard */ "./node_modules/ckeditor5/src/clipboard.js");
  57874. /* harmony import */ var ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ckeditor5/src/utils */ "./node_modules/ckeditor5/src/utils.js");
  57875. /* harmony import */ var _linkcommand__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./linkcommand */ "./node_modules/@ckeditor/ckeditor5-link/src/linkcommand.js");
  57876. /* harmony import */ var _unlinkcommand__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./unlinkcommand */ "./node_modules/@ckeditor/ckeditor5-link/src/unlinkcommand.js");
  57877. /* harmony import */ var _utils_manualdecorator__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./utils/manualdecorator */ "./node_modules/@ckeditor/ckeditor5-link/src/utils/manualdecorator.js");
  57878. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./utils */ "./node_modules/@ckeditor/ckeditor5-link/src/utils.js");
  57879. /* harmony import */ var _theme_link_css__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../theme/link.css */ "./node_modules/@ckeditor/ckeditor5-link/theme/link.css");
  57880. /* harmony import */ var _theme_link_css__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_theme_link_css__WEBPACK_IMPORTED_MODULE_9__);
  57881. /**
  57882. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  57883. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  57884. */
  57885. /**
  57886. * @module link/linkediting
  57887. */
  57888. const HIGHLIGHT_CLASS = 'ck-link_selected';
  57889. const DECORATOR_AUTOMATIC = 'automatic';
  57890. const DECORATOR_MANUAL = 'manual';
  57891. const EXTERNAL_LINKS_REGEXP = /^(https?:)?\/\//;
  57892. /**
  57893. * The link engine feature.
  57894. *
  57895. * It introduces the `linkHref="url"` attribute in the model which renders to the view as a `<a href="url">` element
  57896. * as well as `'link'` and `'unlink'` commands.
  57897. *
  57898. * @extends module:core/plugin~Plugin
  57899. */
  57900. class LinkEditing extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  57901. /**
  57902. * @inheritDoc
  57903. */
  57904. static get pluginName() {
  57905. return 'LinkEditing';
  57906. }
  57907. /**
  57908. * @inheritDoc
  57909. */
  57910. static get requires() {
  57911. // Clipboard is required for handling cut and paste events while typing over the link.
  57912. return [ ckeditor5_src_typing__WEBPACK_IMPORTED_MODULE_2__["TwoStepCaretMovement"], ckeditor5_src_typing__WEBPACK_IMPORTED_MODULE_2__["Input"], ckeditor5_src_clipboard__WEBPACK_IMPORTED_MODULE_3__["ClipboardPipeline"] ];
  57913. }
  57914. /**
  57915. * @inheritDoc
  57916. */
  57917. constructor( editor ) {
  57918. super( editor );
  57919. editor.config.define( 'link', {
  57920. addTargetToExternalLinks: false
  57921. } );
  57922. }
  57923. /**
  57924. * @inheritDoc
  57925. */
  57926. init() {
  57927. const editor = this.editor;
  57928. // Allow link attribute on all inline nodes.
  57929. editor.model.schema.extend( '$text', { allowAttributes: 'linkHref' } );
  57930. editor.conversion.for( 'dataDowncast' )
  57931. .attributeToElement( { model: 'linkHref', view: _utils__WEBPACK_IMPORTED_MODULE_8__["createLinkElement"] } );
  57932. editor.conversion.for( 'editingDowncast' )
  57933. .attributeToElement( { model: 'linkHref', view: ( href, conversionApi ) => {
  57934. return Object(_utils__WEBPACK_IMPORTED_MODULE_8__["createLinkElement"])( Object(_utils__WEBPACK_IMPORTED_MODULE_8__["ensureSafeUrl"])( href ), conversionApi );
  57935. } } );
  57936. editor.conversion.for( 'upcast' )
  57937. .elementToAttribute( {
  57938. view: {
  57939. name: 'a',
  57940. attributes: {
  57941. href: true
  57942. }
  57943. },
  57944. model: {
  57945. key: 'linkHref',
  57946. value: viewElement => viewElement.getAttribute( 'href' )
  57947. }
  57948. } );
  57949. // Create linking commands.
  57950. editor.commands.add( 'link', new _linkcommand__WEBPACK_IMPORTED_MODULE_5__["default"]( editor ) );
  57951. editor.commands.add( 'unlink', new _unlinkcommand__WEBPACK_IMPORTED_MODULE_6__["default"]( editor ) );
  57952. const linkDecorators = Object(_utils__WEBPACK_IMPORTED_MODULE_8__["getLocalizedDecorators"])( editor.t, Object(_utils__WEBPACK_IMPORTED_MODULE_8__["normalizeDecorators"])( editor.config.get( 'link.decorators' ) ) );
  57953. this._enableAutomaticDecorators( linkDecorators.filter( item => item.mode === DECORATOR_AUTOMATIC ) );
  57954. this._enableManualDecorators( linkDecorators.filter( item => item.mode === DECORATOR_MANUAL ) );
  57955. // Enable two-step caret movement for `linkHref` attribute.
  57956. const twoStepCaretMovementPlugin = editor.plugins.get( ckeditor5_src_typing__WEBPACK_IMPORTED_MODULE_2__["TwoStepCaretMovement"] );
  57957. twoStepCaretMovementPlugin.registerAttribute( 'linkHref' );
  57958. // Setup highlight over selected link.
  57959. Object(ckeditor5_src_typing__WEBPACK_IMPORTED_MODULE_2__["inlineHighlight"])( editor, 'linkHref', 'a', HIGHLIGHT_CLASS );
  57960. // Change the attributes of the selection in certain situations after the link was inserted into the document.
  57961. this._enableInsertContentSelectionAttributesFixer();
  57962. // Handle a click at the beginning/end of a link element.
  57963. this._enableClickingAfterLink();
  57964. // Handle typing over the link.
  57965. this._enableTypingOverLink();
  57966. // Handle removing the content after the link element.
  57967. this._handleDeleteContentAfterLink();
  57968. }
  57969. /**
  57970. * Processes an array of configured {@link module:link/link~LinkDecoratorAutomaticDefinition automatic decorators}
  57971. * and registers a {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher downcast dispatcher}
  57972. * for each one of them. Downcast dispatchers are obtained using the
  57973. * {@link module:link/utils~AutomaticDecorators#getDispatcher} method.
  57974. *
  57975. * **Note**: This method also activates the automatic external link decorator if enabled with
  57976. * {@link module:link/link~LinkConfig#addTargetToExternalLinks `config.link.addTargetToExternalLinks`}.
  57977. *
  57978. * @private
  57979. * @param {Array.<module:link/link~LinkDecoratorAutomaticDefinition>} automaticDecoratorDefinitions
  57980. */
  57981. _enableAutomaticDecorators( automaticDecoratorDefinitions ) {
  57982. const editor = this.editor;
  57983. // Store automatic decorators in the command instance as we do the same with manual decorators.
  57984. // Thanks to that, `LinkImageEditing` plugin can re-use the same definitions.
  57985. const command = editor.commands.get( 'link' );
  57986. const automaticDecorators = command.automaticDecorators;
  57987. // Adds a default decorator for external links.
  57988. if ( editor.config.get( 'link.addTargetToExternalLinks' ) ) {
  57989. automaticDecorators.add( {
  57990. id: 'linkIsExternal',
  57991. mode: DECORATOR_AUTOMATIC,
  57992. callback: url => EXTERNAL_LINKS_REGEXP.test( url ),
  57993. attributes: {
  57994. target: '_blank',
  57995. rel: 'noopener noreferrer'
  57996. }
  57997. } );
  57998. }
  57999. automaticDecorators.add( automaticDecoratorDefinitions );
  58000. if ( automaticDecorators.length ) {
  58001. editor.conversion.for( 'downcast' ).add( automaticDecorators.getDispatcher() );
  58002. }
  58003. }
  58004. /**
  58005. * Processes an array of configured {@link module:link/link~LinkDecoratorManualDefinition manual decorators},
  58006. * transforms them into {@link module:link/utils~ManualDecorator} instances and stores them in the
  58007. * {@link module:link/linkcommand~LinkCommand#manualDecorators} collection (a model for manual decorators state).
  58008. *
  58009. * Also registers an {@link module:engine/conversion/downcasthelpers~DowncastHelpers#attributeToElement attribute-to-element}
  58010. * converter for each manual decorator and extends the {@link module:engine/model/schema~Schema model's schema}
  58011. * with adequate model attributes.
  58012. *
  58013. * @private
  58014. * @param {Array.<module:link/link~LinkDecoratorManualDefinition>} manualDecoratorDefinitions
  58015. */
  58016. _enableManualDecorators( manualDecoratorDefinitions ) {
  58017. if ( !manualDecoratorDefinitions.length ) {
  58018. return;
  58019. }
  58020. const editor = this.editor;
  58021. const command = editor.commands.get( 'link' );
  58022. const manualDecorators = command.manualDecorators;
  58023. manualDecoratorDefinitions.forEach( decorator => {
  58024. editor.model.schema.extend( '$text', { allowAttributes: decorator.id } );
  58025. // Keeps reference to manual decorator to decode its name to attributes during downcast.
  58026. manualDecorators.add( new _utils_manualdecorator__WEBPACK_IMPORTED_MODULE_7__["default"]( decorator ) );
  58027. editor.conversion.for( 'downcast' ).attributeToElement( {
  58028. model: decorator.id,
  58029. view: ( manualDecoratorName, { writer } ) => {
  58030. if ( manualDecoratorName ) {
  58031. const attributes = manualDecorators.get( decorator.id ).attributes;
  58032. const element = writer.createAttributeElement( 'a', attributes, { priority: 5 } );
  58033. writer.setCustomProperty( 'link', true, element );
  58034. return element;
  58035. }
  58036. } } );
  58037. editor.conversion.for( 'upcast' ).elementToAttribute( {
  58038. view: {
  58039. name: 'a',
  58040. attributes: manualDecorators.get( decorator.id ).attributes
  58041. },
  58042. model: {
  58043. key: decorator.id
  58044. }
  58045. } );
  58046. } );
  58047. }
  58048. /**
  58049. * Starts listening to {@link module:engine/model/model~Model#event:insertContent} and corrects the model
  58050. * selection attributes if the selection is at the end of a link after inserting the content.
  58051. *
  58052. * The purpose of this action is to improve the overall UX because the user is no longer "trapped" by the
  58053. * `linkHref` attribute of the selection and they can type a "clean" (`linkHref`–less) text right away.
  58054. *
  58055. * See https://github.com/ckeditor/ckeditor5/issues/6053.
  58056. *
  58057. * @private
  58058. */
  58059. _enableInsertContentSelectionAttributesFixer() {
  58060. const editor = this.editor;
  58061. const model = editor.model;
  58062. const selection = model.document.selection;
  58063. this.listenTo( model, 'insertContent', () => {
  58064. const nodeBefore = selection.anchor.nodeBefore;
  58065. const nodeAfter = selection.anchor.nodeAfter;
  58066. // NOTE: ↰ and ↱ represent the gravity of the selection.
  58067. // The only truly valid case is:
  58068. //
  58069. // ↰
  58070. // ...<$text linkHref="foo">INSERTED[]</$text>
  58071. //
  58072. // If the selection is not "trapped" by the `linkHref` attribute after inserting, there's nothing
  58073. // to fix there.
  58074. if ( !selection.hasAttribute( 'linkHref' ) ) {
  58075. return;
  58076. }
  58077. // Filter out the following case where a link with the same href (e.g. <a href="foo">INSERTED</a>) is inserted
  58078. // in the middle of an existing link:
  58079. //
  58080. // Before insertion:
  58081. // ↰
  58082. // <$text linkHref="foo">l[]ink</$text>
  58083. //
  58084. // Expected after insertion:
  58085. // ↰
  58086. // <$text linkHref="foo">lINSERTED[]ink</$text>
  58087. //
  58088. if ( !nodeBefore ) {
  58089. return;
  58090. }
  58091. // Filter out the following case where the selection has the "linkHref" attribute because the
  58092. // gravity is overridden and some text with another attribute (e.g. <b>INSERTED</b>) is inserted:
  58093. //
  58094. // Before insertion:
  58095. //
  58096. // ↱
  58097. // <$text linkHref="foo">[]link</$text>
  58098. //
  58099. // Expected after insertion:
  58100. //
  58101. // ↱
  58102. // <$text bold="true">INSERTED</$text><$text linkHref="foo">[]link</$text>
  58103. //
  58104. if ( !nodeBefore.hasAttribute( 'linkHref' ) ) {
  58105. return;
  58106. }
  58107. // Filter out the following case where a link is a inserted in the middle (or before) another link
  58108. // (different URLs, so they will not merge). In this (let's say weird) case, we can leave the selection
  58109. // attributes as they are because the user will end up writing in one link or another anyway.
  58110. //
  58111. // Before insertion:
  58112. //
  58113. // ↰
  58114. // <$text linkHref="foo">l[]ink</$text>
  58115. //
  58116. // Expected after insertion:
  58117. //
  58118. // ↰
  58119. // <$text linkHref="foo">l</$text><$text linkHref="bar">INSERTED[]</$text><$text linkHref="foo">ink</$text>
  58120. //
  58121. if ( nodeAfter && nodeAfter.hasAttribute( 'linkHref' ) ) {
  58122. return;
  58123. }
  58124. model.change( writer => {
  58125. removeLinkAttributesFromSelection( writer, getLinkAttributesAllowedOnText( model.schema ) );
  58126. } );
  58127. }, { priority: 'low' } );
  58128. }
  58129. /**
  58130. * Starts listening to {@link module:engine/view/document~Document#event:mousedown} and
  58131. * {@link module:engine/view/document~Document#event:selectionChange} and puts the selection before/after a link node
  58132. * if clicked at the beginning/ending of the link.
  58133. *
  58134. * The purpose of this action is to allow typing around the link node directly after a click.
  58135. *
  58136. * See https://github.com/ckeditor/ckeditor5/issues/1016.
  58137. *
  58138. * @private
  58139. */
  58140. _enableClickingAfterLink() {
  58141. const editor = this.editor;
  58142. const model = editor.model;
  58143. editor.editing.view.addObserver( ckeditor5_src_engine__WEBPACK_IMPORTED_MODULE_1__["MouseObserver"] );
  58144. let clicked = false;
  58145. // Detect the click.
  58146. this.listenTo( editor.editing.view.document, 'mousedown', () => {
  58147. clicked = true;
  58148. } );
  58149. // When the selection has changed...
  58150. this.listenTo( editor.editing.view.document, 'selectionChange', () => {
  58151. if ( !clicked ) {
  58152. return;
  58153. }
  58154. // ...and it was caused by the click...
  58155. clicked = false;
  58156. const selection = model.document.selection;
  58157. // ...and no text is selected...
  58158. if ( !selection.isCollapsed ) {
  58159. return;
  58160. }
  58161. // ...and clicked text is the link...
  58162. if ( !selection.hasAttribute( 'linkHref' ) ) {
  58163. return;
  58164. }
  58165. const position = selection.getFirstPosition();
  58166. const linkRange = Object(ckeditor5_src_typing__WEBPACK_IMPORTED_MODULE_2__["findAttributeRange"])( position, 'linkHref', selection.getAttribute( 'linkHref' ), model );
  58167. // ...check whether clicked start/end boundary of the link.
  58168. // If so, remove the `linkHref` attribute.
  58169. if ( position.isTouching( linkRange.start ) || position.isTouching( linkRange.end ) ) {
  58170. model.change( writer => {
  58171. removeLinkAttributesFromSelection( writer, getLinkAttributesAllowedOnText( model.schema ) );
  58172. } );
  58173. }
  58174. } );
  58175. }
  58176. /**
  58177. * Starts listening to {@link module:engine/model/model~Model#deleteContent} and {@link module:engine/model/model~Model#insertContent}
  58178. * and checks whether typing over the link. If so, attributes of removed text are preserved and applied to the inserted text.
  58179. *
  58180. * The purpose of this action is to allow modifying a text without loosing the `linkHref` attribute (and other).
  58181. *
  58182. * See https://github.com/ckeditor/ckeditor5/issues/4762.
  58183. *
  58184. * @private
  58185. */
  58186. _enableTypingOverLink() {
  58187. const editor = this.editor;
  58188. const view = editor.editing.view;
  58189. // Selection attributes when started typing over the link.
  58190. let selectionAttributes;
  58191. // Whether pressed `Backspace` or `Delete`. If so, attributes should not be preserved.
  58192. let deletedContent;
  58193. // Detect pressing `Backspace` / `Delete`.
  58194. this.listenTo( view.document, 'delete', () => {
  58195. deletedContent = true;
  58196. }, { priority: 'high' } );
  58197. // Listening to `model#deleteContent` allows detecting whether selected content was a link.
  58198. // If so, before removing the element, we will copy its attributes.
  58199. this.listenTo( editor.model, 'deleteContent', () => {
  58200. const selection = editor.model.document.selection;
  58201. // Copy attributes only if anything is selected.
  58202. if ( selection.isCollapsed ) {
  58203. return;
  58204. }
  58205. // When the content was deleted, do not preserve attributes.
  58206. if ( deletedContent ) {
  58207. deletedContent = false;
  58208. return;
  58209. }
  58210. // Enabled only when typing.
  58211. if ( !isTyping( editor ) ) {
  58212. return;
  58213. }
  58214. if ( shouldCopyAttributes( editor.model ) ) {
  58215. selectionAttributes = selection.getAttributes();
  58216. }
  58217. }, { priority: 'high' } );
  58218. // Listening to `model#insertContent` allows detecting the content insertion.
  58219. // We want to apply attributes that were removed while typing over the link.
  58220. this.listenTo( editor.model, 'insertContent', ( evt, [ element ] ) => {
  58221. deletedContent = false;
  58222. // Enabled only when typing.
  58223. if ( !isTyping( editor ) ) {
  58224. return;
  58225. }
  58226. if ( !selectionAttributes ) {
  58227. return;
  58228. }
  58229. editor.model.change( writer => {
  58230. for ( const [ attribute, value ] of selectionAttributes ) {
  58231. writer.setAttribute( attribute, value, element );
  58232. }
  58233. } );
  58234. selectionAttributes = null;
  58235. }, { priority: 'high' } );
  58236. }
  58237. /**
  58238. * Starts listening to {@link module:engine/model/model~Model#deleteContent} and checks whether
  58239. * removing a content right after the "linkHref" attribute.
  58240. *
  58241. * If so, the selection should not preserve the `linkHref` attribute. However, if
  58242. * the {@link module:typing/twostepcaretmovement~TwoStepCaretMovement} plugin is active and
  58243. * the selection has the "linkHref" attribute due to overriden gravity (at the end), the `linkHref` attribute should stay untouched.
  58244. *
  58245. * The purpose of this action is to allow removing the link text and keep the selection outside the link.
  58246. *
  58247. * See https://github.com/ckeditor/ckeditor5/issues/7521.
  58248. *
  58249. * @private
  58250. */
  58251. _handleDeleteContentAfterLink() {
  58252. const editor = this.editor;
  58253. const model = editor.model;
  58254. const selection = model.document.selection;
  58255. const view = editor.editing.view;
  58256. // A flag whether attributes `linkHref` attribute should be preserved.
  58257. let shouldPreserveAttributes = false;
  58258. // A flag whether the `Backspace` key was pressed.
  58259. let hasBackspacePressed = false;
  58260. // Detect pressing `Backspace`.
  58261. this.listenTo( view.document, 'delete', ( evt, data ) => {
  58262. hasBackspacePressed = data.domEvent.keyCode === ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_4__["keyCodes"].backspace;
  58263. }, { priority: 'high' } );
  58264. // Before removing the content, check whether the selection is inside a link or at the end of link but with 2-SCM enabled.
  58265. // If so, we want to preserve link attributes.
  58266. this.listenTo( model, 'deleteContent', () => {
  58267. // Reset the state.
  58268. shouldPreserveAttributes = false;
  58269. const position = selection.getFirstPosition();
  58270. const linkHref = selection.getAttribute( 'linkHref' );
  58271. if ( !linkHref ) {
  58272. return;
  58273. }
  58274. const linkRange = Object(ckeditor5_src_typing__WEBPACK_IMPORTED_MODULE_2__["findAttributeRange"])( position, 'linkHref', linkHref, model );
  58275. // Preserve `linkHref` attribute if the selection is in the middle of the link or
  58276. // the selection is at the end of the link and 2-SCM is activated.
  58277. shouldPreserveAttributes = linkRange.containsPosition( position ) || linkRange.end.isEqual( position );
  58278. }, { priority: 'high' } );
  58279. // After removing the content, check whether the current selection should preserve the `linkHref` attribute.
  58280. this.listenTo( model, 'deleteContent', () => {
  58281. // If didn't press `Backspace`.
  58282. if ( !hasBackspacePressed ) {
  58283. return;
  58284. }
  58285. hasBackspacePressed = false;
  58286. // Disable the mechanism if inside a link (`<$text url="foo">F[]oo</$text>` or <$text url="foo">Foo[]</$text>`).
  58287. if ( shouldPreserveAttributes ) {
  58288. return;
  58289. }
  58290. // Use `model.enqueueChange()` in order to execute the callback at the end of the changes process.
  58291. editor.model.enqueueChange( writer => {
  58292. removeLinkAttributesFromSelection( writer, getLinkAttributesAllowedOnText( model.schema ) );
  58293. } );
  58294. }, { priority: 'low' } );
  58295. }
  58296. }
  58297. // Make the selection free of link-related model attributes.
  58298. // All link-related model attributes start with "link". That includes not only "linkHref"
  58299. // but also all decorator attributes (they have dynamic names), or even custom plugins.
  58300. //
  58301. // @param {module:engine/model/writer~Writer} writer
  58302. // @param {Array.<String>} linkAttributes
  58303. function removeLinkAttributesFromSelection( writer, linkAttributes ) {
  58304. writer.removeSelectionAttribute( 'linkHref' );
  58305. for ( const attribute of linkAttributes ) {
  58306. writer.removeSelectionAttribute( attribute );
  58307. }
  58308. }
  58309. // Checks whether selection's attributes should be copied to the new inserted text.
  58310. //
  58311. // @param {module:engine/model/model~Model} model
  58312. // @returns {Boolean}
  58313. function shouldCopyAttributes( model ) {
  58314. const selection = model.document.selection;
  58315. const firstPosition = selection.getFirstPosition();
  58316. const lastPosition = selection.getLastPosition();
  58317. const nodeAtFirstPosition = firstPosition.nodeAfter;
  58318. // The text link node does not exist...
  58319. if ( !nodeAtFirstPosition ) {
  58320. return false;
  58321. }
  58322. // ...or it isn't the text node...
  58323. if ( !nodeAtFirstPosition.is( '$text' ) ) {
  58324. return false;
  58325. }
  58326. // ...or isn't the link.
  58327. if ( !nodeAtFirstPosition.hasAttribute( 'linkHref' ) ) {
  58328. return false;
  58329. }
  58330. // `textNode` = the position is inside the link element.
  58331. // `nodeBefore` = the position is at the end of the link element.
  58332. const nodeAtLastPosition = lastPosition.textNode || lastPosition.nodeBefore;
  58333. // If both references the same node selection contains a single text node.
  58334. if ( nodeAtFirstPosition === nodeAtLastPosition ) {
  58335. return true;
  58336. }
  58337. // If nodes are not equal, maybe the link nodes has defined additional attributes inside.
  58338. // First, we need to find the entire link range.
  58339. const linkRange = Object(ckeditor5_src_typing__WEBPACK_IMPORTED_MODULE_2__["findAttributeRange"])( firstPosition, 'linkHref', nodeAtFirstPosition.getAttribute( 'linkHref' ), model );
  58340. // Then we can check whether selected range is inside the found link range. If so, attributes should be preserved.
  58341. return linkRange.containsRange( model.createRange( firstPosition, lastPosition ), true );
  58342. }
  58343. // Checks whether provided changes were caused by typing.
  58344. //
  58345. // @params {module:core/editor/editor~Editor} editor
  58346. // @returns {Boolean}
  58347. function isTyping( editor ) {
  58348. const input = editor.plugins.get( 'Input' );
  58349. return input.isInput( editor.model.change( writer => writer.batch ) );
  58350. }
  58351. // Returns an array containing names of attributes allowed on `$text` that describes the link item.
  58352. //
  58353. // @param {module:engine/model/schema~Schema} schema
  58354. // @returns {Array.<String>}
  58355. function getLinkAttributesAllowedOnText( schema ) {
  58356. const textAttributes = schema.getDefinition( '$text' ).allowAttributes;
  58357. return textAttributes.filter( attribute => attribute.startsWith( 'link' ) );
  58358. }
  58359. /***/ }),
  58360. /***/ "./node_modules/@ckeditor/ckeditor5-link/src/linkimage.js":
  58361. /*!****************************************************************!*\
  58362. !*** ./node_modules/@ckeditor/ckeditor5-link/src/linkimage.js ***!
  58363. \****************************************************************/
  58364. /*! exports provided: default */
  58365. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  58366. "use strict";
  58367. __webpack_require__.r(__webpack_exports__);
  58368. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return LinkImage; });
  58369. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  58370. /* harmony import */ var _linkimageediting__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./linkimageediting */ "./node_modules/@ckeditor/ckeditor5-link/src/linkimageediting.js");
  58371. /* harmony import */ var _linkimageui__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./linkimageui */ "./node_modules/@ckeditor/ckeditor5-link/src/linkimageui.js");
  58372. /* harmony import */ var _theme_linkimage_css__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../theme/linkimage.css */ "./node_modules/@ckeditor/ckeditor5-link/theme/linkimage.css");
  58373. /* harmony import */ var _theme_linkimage_css__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_theme_linkimage_css__WEBPACK_IMPORTED_MODULE_3__);
  58374. /**
  58375. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  58376. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  58377. */
  58378. /**
  58379. * @module link/linkimage
  58380. */
  58381. /**
  58382. * The `LinkImage` plugin.
  58383. *
  58384. * This is a "glue" plugin that loads the {@link module:link/linkimageediting~LinkImageEditing link image editing feature}
  58385. * and {@link module:link/linkimageui~LinkImageUI link image UI feature}.
  58386. *
  58387. * @extends module:core/plugin~Plugin
  58388. */
  58389. class LinkImage extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  58390. /**
  58391. * @inheritDoc
  58392. */
  58393. static get requires() {
  58394. return [ _linkimageediting__WEBPACK_IMPORTED_MODULE_1__["default"], _linkimageui__WEBPACK_IMPORTED_MODULE_2__["default"] ];
  58395. }
  58396. /**
  58397. * @inheritDoc
  58398. */
  58399. static get pluginName() {
  58400. return 'LinkImage';
  58401. }
  58402. }
  58403. /***/ }),
  58404. /***/ "./node_modules/@ckeditor/ckeditor5-link/src/linkimageediting.js":
  58405. /*!***********************************************************************!*\
  58406. !*** ./node_modules/@ckeditor/ckeditor5-link/src/linkimageediting.js ***!
  58407. \***********************************************************************/
  58408. /*! exports provided: default */
  58409. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  58410. "use strict";
  58411. __webpack_require__.r(__webpack_exports__);
  58412. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return LinkImageEditing; });
  58413. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  58414. /* harmony import */ var ckeditor5_src_engine__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/engine */ "./node_modules/ckeditor5/src/engine.js");
  58415. /* harmony import */ var ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ckeditor5/src/utils */ "./node_modules/ckeditor5/src/utils.js");
  58416. /* harmony import */ var _linkediting__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./linkediting */ "./node_modules/@ckeditor/ckeditor5-link/src/linkediting.js");
  58417. /* harmony import */ var _theme_icons_link_svg__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../theme/icons/link.svg */ "./node_modules/@ckeditor/ckeditor5-link/theme/icons/link.svg");
  58418. /**
  58419. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  58420. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  58421. */
  58422. /**
  58423. * @module link/linkimageediting
  58424. */
  58425. /**
  58426. * The link image engine feature.
  58427. *
  58428. * It accepts the `linkHref="url"` attribute in the model for the {@link module:image/image~Image `<image>`} element
  58429. * which allows linking images.
  58430. *
  58431. * @extends module:core/plugin~Plugin
  58432. */
  58433. class LinkImageEditing extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  58434. /**
  58435. * @inheritDoc
  58436. */
  58437. static get requires() {
  58438. return [ 'ImageEditing', _linkediting__WEBPACK_IMPORTED_MODULE_3__["default"] ];
  58439. }
  58440. /**
  58441. * @inheritDoc
  58442. */
  58443. static get pluginName() {
  58444. return 'LinkImageEditing';
  58445. }
  58446. init() {
  58447. const editor = this.editor;
  58448. editor.model.schema.extend( 'image', { allowAttributes: [ 'linkHref' ] } );
  58449. editor.conversion.for( 'upcast' ).add( upcastLink() );
  58450. editor.conversion.for( 'editingDowncast' ).add( downcastImageLink( { attachIconIndicator: true } ) );
  58451. editor.conversion.for( 'dataDowncast' ).add( downcastImageLink( { attachIconIndicator: false } ) );
  58452. // Definitions for decorators are provided by the `link` command and the `LinkEditing` plugin.
  58453. this._enableAutomaticDecorators();
  58454. this._enableManualDecorators();
  58455. }
  58456. /**
  58457. * Processes {@link module:link/link~LinkDecoratorAutomaticDefinition automatic decorators} definitions and
  58458. * attaches proper converters that will work when linking an image.`
  58459. *
  58460. * @private
  58461. */
  58462. _enableAutomaticDecorators() {
  58463. const editor = this.editor;
  58464. const command = editor.commands.get( 'link' );
  58465. const automaticDecorators = command.automaticDecorators;
  58466. if ( automaticDecorators.length ) {
  58467. editor.conversion.for( 'downcast' ).add( automaticDecorators.getDispatcherForLinkedImage() );
  58468. }
  58469. }
  58470. /**
  58471. * Processes transformed {@link module:link/utils~ManualDecorator} instances and attaches proper converters
  58472. * that will work when linking an image.
  58473. *
  58474. * @private
  58475. */
  58476. _enableManualDecorators() {
  58477. const editor = this.editor;
  58478. const command = editor.commands.get( 'link' );
  58479. const manualDecorators = command.manualDecorators;
  58480. for ( const decorator of command.manualDecorators ) {
  58481. editor.model.schema.extend( 'image', { allowAttributes: decorator.id } );
  58482. editor.conversion.for( 'downcast' ).add( downcastImageLinkManualDecorator( manualDecorators, decorator ) );
  58483. editor.conversion.for( 'upcast' ).add( upcastImageLinkManualDecorator( manualDecorators, decorator ) );
  58484. }
  58485. }
  58486. }
  58487. // Returns a converter that consumes the 'href' attribute if a link contains an image.
  58488. //
  58489. // @private
  58490. // @returns {Function}
  58491. function upcastLink() {
  58492. return dispatcher => {
  58493. dispatcher.on( 'element:a', ( evt, data, conversionApi ) => {
  58494. const viewLink = data.viewItem;
  58495. const imageInLink = getFirstImage( viewLink );
  58496. if ( !imageInLink ) {
  58497. return;
  58498. }
  58499. // There's an image inside an <a> element - we consume it so it won't be picked up by the Link plugin.
  58500. const consumableAttributes = { attributes: [ 'href' ] };
  58501. // Consume the `href` attribute so the default one will not convert it to $text attribute.
  58502. if ( !conversionApi.consumable.consume( viewLink, consumableAttributes ) ) {
  58503. // Might be consumed by something else - i.e. other converter with priority=highest - a standard check.
  58504. return;
  58505. }
  58506. const linkHref = viewLink.getAttribute( 'href' );
  58507. // Missing the 'href' attribute.
  58508. if ( !linkHref ) {
  58509. return;
  58510. }
  58511. // A full definition of the image feature.
  58512. // figure > a > img: parent of the view link element is an image element (figure).
  58513. let modelElement = data.modelCursor.parent;
  58514. if ( !modelElement.is( 'element', 'image' ) ) {
  58515. // a > img: parent of the view link is not the image (figure) element. We need to convert it manually.
  58516. const conversionResult = conversionApi.convertItem( imageInLink, data.modelCursor );
  58517. // Set image range as conversion result.
  58518. data.modelRange = conversionResult.modelRange;
  58519. // Continue conversion where image conversion ends.
  58520. data.modelCursor = conversionResult.modelCursor;
  58521. modelElement = data.modelCursor.nodeBefore;
  58522. }
  58523. if ( modelElement && modelElement.is( 'element', 'image' ) ) {
  58524. // Set the linkHref attribute from link element on model image element.
  58525. conversionApi.writer.setAttribute( 'linkHref', linkHref, modelElement );
  58526. }
  58527. }, { priority: 'high' } );
  58528. // Using the same priority that `upcastImageLinkManualDecorator()` converter guarantees
  58529. // that manual decorators will decorate the proper element.
  58530. };
  58531. }
  58532. // Return a converter that adds the `<a>` element to data.
  58533. //
  58534. // @private
  58535. // @params {Object} options
  58536. // @params {Boolean} options.attachIconIndicator=false If set to `true`, an icon that informs about the linked image will be added.
  58537. // @returns {Function}
  58538. function downcastImageLink( options ) {
  58539. return dispatcher => {
  58540. dispatcher.on( 'attribute:linkHref:image', ( evt, data, conversionApi ) => {
  58541. // The image will be already converted - so it will be present in the view.
  58542. const viewFigure = conversionApi.mapper.toViewElement( data.item );
  58543. const writer = conversionApi.writer;
  58544. // But we need to check whether the link element exists.
  58545. const linkInImage = Array.from( viewFigure.getChildren() ).find( child => child.name === 'a' );
  58546. let linkIconIndicator;
  58547. if ( options.attachIconIndicator ) {
  58548. // Create an icon indicator for a linked image.
  58549. linkIconIndicator = writer.createUIElement( 'span', { class: 'ck ck-link-image_icon' }, function( domDocument ) {
  58550. const domElement = this.toDomElement( domDocument );
  58551. domElement.innerHTML = _theme_icons_link_svg__WEBPACK_IMPORTED_MODULE_4__["default"];
  58552. return domElement;
  58553. } );
  58554. }
  58555. // If so, update the attribute if it's defined or remove the entire link if the attribute is empty.
  58556. if ( linkInImage ) {
  58557. if ( data.attributeNewValue ) {
  58558. writer.setAttribute( 'href', data.attributeNewValue, linkInImage );
  58559. } else {
  58560. const viewImage = Array.from( linkInImage.getChildren() ).find( child => child.name === 'img' );
  58561. writer.move( writer.createRangeOn( viewImage ), writer.createPositionAt( viewFigure, 0 ) );
  58562. writer.remove( linkInImage );
  58563. }
  58564. } else {
  58565. // But if it does not exist. Let's wrap already converted image by newly created link element.
  58566. // 1. Create an empty link element.
  58567. const linkElement = writer.createContainerElement( 'a', { href: data.attributeNewValue } );
  58568. // 2. Insert link inside the associated image.
  58569. writer.insert( writer.createPositionAt( viewFigure, 0 ), linkElement );
  58570. // 3. Move the image to the link.
  58571. writer.move( writer.createRangeOn( viewFigure.getChild( 1 ) ), writer.createPositionAt( linkElement, 0 ) );
  58572. // 4. Inset the linked image icon indicator while downcast to editing.
  58573. if ( linkIconIndicator ) {
  58574. writer.insert( writer.createPositionAt( linkElement, 'end' ), linkIconIndicator );
  58575. }
  58576. }
  58577. } );
  58578. };
  58579. }
  58580. // Returns a converter that decorates the `<a>` element when the image is the link label.
  58581. //
  58582. // @private
  58583. // @returns {Function}
  58584. function downcastImageLinkManualDecorator( manualDecorators, decorator ) {
  58585. return dispatcher => {
  58586. dispatcher.on( `attribute:${ decorator.id }:image`, ( evt, data, conversionApi ) => {
  58587. const attributes = manualDecorators.get( decorator.id ).attributes;
  58588. const viewFigure = conversionApi.mapper.toViewElement( data.item );
  58589. const linkInImage = Array.from( viewFigure.getChildren() ).find( child => child.name === 'a' );
  58590. // The <a> element was removed by the time this converter is executed.
  58591. // It may happen when the base `linkHref` and decorator attributes are removed
  58592. // at the same time (see #8401).
  58593. if ( !linkInImage ) {
  58594. return;
  58595. }
  58596. for ( const [ key, val ] of Object(ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_2__["toMap"])( attributes ) ) {
  58597. conversionApi.writer.setAttribute( key, val, linkInImage );
  58598. }
  58599. } );
  58600. };
  58601. }
  58602. // Returns a converter that checks whether manual decorators should be applied to the link.
  58603. //
  58604. // @private
  58605. // @returns {Function}
  58606. function upcastImageLinkManualDecorator( manualDecorators, decorator ) {
  58607. return dispatcher => {
  58608. dispatcher.on( 'element:a', ( evt, data, conversionApi ) => {
  58609. const viewLink = data.viewItem;
  58610. const imageInLink = getFirstImage( viewLink );
  58611. // We need to check whether an image is inside a link because the converter handles
  58612. // only manual decorators for linked images. See #7975.
  58613. if ( !imageInLink ) {
  58614. return;
  58615. }
  58616. const consumableAttributes = {
  58617. attributes: manualDecorators.get( decorator.id ).attributes
  58618. };
  58619. const matcher = new ckeditor5_src_engine__WEBPACK_IMPORTED_MODULE_1__["Matcher"]( consumableAttributes );
  58620. const result = matcher.match( viewLink );
  58621. // The link element does not have required attributes or/and proper values.
  58622. if ( !result ) {
  58623. return;
  58624. }
  58625. // Check whether we can consume those attributes.
  58626. if ( !conversionApi.consumable.consume( viewLink, result.match ) ) {
  58627. return;
  58628. }
  58629. // At this stage we can assume that we have the `<image>` element.
  58630. // `nodeBefore` comes after conversion: `<a><img></a>`.
  58631. // `parent` comes with full image definition: `<figure><a><img></a></figure>.
  58632. // See the body of the `upcastLink()` function.
  58633. const modelElement = data.modelCursor.nodeBefore || data.modelCursor.parent;
  58634. conversionApi.writer.setAttribute( decorator.id, true, modelElement );
  58635. }, { priority: 'high' } );
  58636. // Using the same priority that `upcastLink()` converter guarantees that the linked image was properly converted.
  58637. };
  58638. }
  58639. // Returns the first image in a given view element.
  58640. //
  58641. // @private
  58642. // @param {module:engine/view/element~Element}
  58643. // @returns {module:engine/view/element~Element|undefined}
  58644. function getFirstImage( viewElement ) {
  58645. return Array.from( viewElement.getChildren() ).find( child => child.name === 'img' );
  58646. }
  58647. /***/ }),
  58648. /***/ "./node_modules/@ckeditor/ckeditor5-link/src/linkimageui.js":
  58649. /*!******************************************************************!*\
  58650. !*** ./node_modules/@ckeditor/ckeditor5-link/src/linkimageui.js ***!
  58651. \******************************************************************/
  58652. /*! exports provided: default */
  58653. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  58654. "use strict";
  58655. __webpack_require__.r(__webpack_exports__);
  58656. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return LinkImageUI; });
  58657. /* harmony import */ var ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/ui */ "./node_modules/ckeditor5/src/ui.js");
  58658. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  58659. /* harmony import */ var _linkui__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./linkui */ "./node_modules/@ckeditor/ckeditor5-link/src/linkui.js");
  58660. /* harmony import */ var _linkediting__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./linkediting */ "./node_modules/@ckeditor/ckeditor5-link/src/linkediting.js");
  58661. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./utils */ "./node_modules/@ckeditor/ckeditor5-link/src/utils.js");
  58662. /* 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");
  58663. /**
  58664. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  58665. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  58666. */
  58667. /**
  58668. * @module link/linkimageui
  58669. */
  58670. /**
  58671. * The link image UI plugin.
  58672. *
  58673. * This plugin provides the `'linkImage'` button that can be displayed in the {@link module:image/imagetoolbar~ImageToolbar}.
  58674. * It can be used to wrap images in links.
  58675. *
  58676. * @extends module:core/plugin~Plugin
  58677. */
  58678. class LinkImageUI extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_1__["Plugin"] {
  58679. /**
  58680. * @inheritDoc
  58681. */
  58682. static get requires() {
  58683. return [ _linkediting__WEBPACK_IMPORTED_MODULE_3__["default"], _linkui__WEBPACK_IMPORTED_MODULE_2__["default"], 'Image' ];
  58684. }
  58685. /**
  58686. * @inheritDoc
  58687. */
  58688. static get pluginName() {
  58689. return 'LinkImageUI';
  58690. }
  58691. /**
  58692. * @inheritDoc
  58693. */
  58694. init() {
  58695. const editor = this.editor;
  58696. const viewDocument = editor.editing.view.document;
  58697. this.listenTo( viewDocument, 'click', ( evt, data ) => {
  58698. const hasLink = isImageLinked( viewDocument.selection.getSelectedElement(), editor.plugins.get( 'Image' ) );
  58699. if ( hasLink ) {
  58700. data.preventDefault();
  58701. }
  58702. } );
  58703. this._createToolbarLinkImageButton();
  58704. }
  58705. /**
  58706. * Creates a `LinkImageUI` button view.
  58707. *
  58708. * Clicking this button shows a {@link module:link/linkui~LinkUI#_balloon} attached to the selection.
  58709. * When an image is already linked, the view shows {@link module:link/linkui~LinkUI#actionsView} or
  58710. * {@link module:link/linkui~LinkUI#formView} if it is not.
  58711. *
  58712. * @private
  58713. */
  58714. _createToolbarLinkImageButton() {
  58715. const editor = this.editor;
  58716. const t = editor.t;
  58717. editor.ui.componentFactory.add( 'linkImage', locale => {
  58718. const button = new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_0__["ButtonView"]( locale );
  58719. const plugin = editor.plugins.get( 'LinkUI' );
  58720. const linkCommand = editor.commands.get( 'link' );
  58721. button.set( {
  58722. isEnabled: true,
  58723. label: t( 'Link image' ),
  58724. icon: _theme_icons_link_svg__WEBPACK_IMPORTED_MODULE_5__["default"],
  58725. keystroke: _utils__WEBPACK_IMPORTED_MODULE_4__["LINK_KEYSTROKE"],
  58726. tooltip: true,
  58727. isToggleable: true
  58728. } );
  58729. // Bind button to the command.
  58730. button.bind( 'isEnabled' ).to( linkCommand, 'isEnabled' );
  58731. button.bind( 'isOn' ).to( linkCommand, 'value', value => !!value );
  58732. // Show the actionsView or formView (both from LinkUI) on button click depending on whether the image is linked already.
  58733. this.listenTo( button, 'execute', () => {
  58734. const hasLink = isImageLinked( editor.editing.view.document.selection.getSelectedElement(), editor.plugins.get( 'Image' ) );
  58735. if ( hasLink ) {
  58736. plugin._addActionsView();
  58737. } else {
  58738. plugin._showUI( true );
  58739. }
  58740. } );
  58741. return button;
  58742. } );
  58743. }
  58744. }
  58745. // A helper function that checks whether the element is a linked image.
  58746. //
  58747. // @param {module:engine/model/element~Element} element
  58748. // @returns {Boolean}
  58749. function isImageLinked( element, image ) {
  58750. const isImage = element && image.isImageWidget( element );
  58751. if ( !isImage ) {
  58752. return false;
  58753. }
  58754. return element.getChild( 0 ).is( 'element', 'a' );
  58755. }
  58756. /***/ }),
  58757. /***/ "./node_modules/@ckeditor/ckeditor5-link/src/linkui.js":
  58758. /*!*************************************************************!*\
  58759. !*** ./node_modules/@ckeditor/ckeditor5-link/src/linkui.js ***!
  58760. \*************************************************************/
  58761. /*! exports provided: default */
  58762. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  58763. "use strict";
  58764. __webpack_require__.r(__webpack_exports__);
  58765. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return LinkUI; });
  58766. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  58767. /* harmony import */ var ckeditor5_src_engine__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/engine */ "./node_modules/ckeditor5/src/engine.js");
  58768. /* harmony import */ var ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ckeditor5/src/ui */ "./node_modules/ckeditor5/src/ui.js");
  58769. /* harmony import */ var _ui_linkformview__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./ui/linkformview */ "./node_modules/@ckeditor/ckeditor5-link/src/ui/linkformview.js");
  58770. /* harmony import */ var _ui_linkactionsview__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./ui/linkactionsview */ "./node_modules/@ckeditor/ckeditor5-link/src/ui/linkactionsview.js");
  58771. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./utils */ "./node_modules/@ckeditor/ckeditor5-link/src/utils.js");
  58772. /* harmony import */ var _theme_icons_link_svg__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../theme/icons/link.svg */ "./node_modules/@ckeditor/ckeditor5-link/theme/icons/link.svg");
  58773. /**
  58774. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  58775. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  58776. */
  58777. /**
  58778. * @module link/linkui
  58779. */
  58780. const VISUAL_SELECTION_MARKER_NAME = 'link-ui';
  58781. /**
  58782. * The link UI plugin. It introduces the `'link'` and `'unlink'` buttons and support for the <kbd>Ctrl+K</kbd> keystroke.
  58783. *
  58784. * It uses the
  58785. * {@link module:ui/panel/balloon/contextualballoon~ContextualBalloon contextual balloon plugin}.
  58786. *
  58787. * @extends module:core/plugin~Plugin
  58788. */
  58789. class LinkUI extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  58790. /**
  58791. * @inheritDoc
  58792. */
  58793. static get requires() {
  58794. return [ ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_2__["ContextualBalloon"] ];
  58795. }
  58796. /**
  58797. * @inheritDoc
  58798. */
  58799. static get pluginName() {
  58800. return 'LinkUI';
  58801. }
  58802. /**
  58803. * @inheritDoc
  58804. */
  58805. init() {
  58806. const editor = this.editor;
  58807. editor.editing.view.addObserver( ckeditor5_src_engine__WEBPACK_IMPORTED_MODULE_1__["ClickObserver"] );
  58808. /**
  58809. * The actions view displayed inside of the balloon.
  58810. *
  58811. * @member {module:link/ui/linkactionsview~LinkActionsView}
  58812. */
  58813. this.actionsView = this._createActionsView();
  58814. /**
  58815. * The form view displayed inside the balloon.
  58816. *
  58817. * @member {module:link/ui/linkformview~LinkFormView}
  58818. */
  58819. this.formView = this._createFormView();
  58820. /**
  58821. * The contextual balloon plugin instance.
  58822. *
  58823. * @private
  58824. * @member {module:ui/panel/balloon/contextualballoon~ContextualBalloon}
  58825. */
  58826. this._balloon = editor.plugins.get( ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_2__["ContextualBalloon"] );
  58827. // Create toolbar buttons.
  58828. this._createToolbarLinkButton();
  58829. // Attach lifecycle actions to the the balloon.
  58830. this._enableUserBalloonInteractions();
  58831. // Renders a fake visual selection marker on an expanded selection.
  58832. editor.conversion.for( 'editingDowncast' ).markerToHighlight( {
  58833. model: VISUAL_SELECTION_MARKER_NAME,
  58834. view: {
  58835. classes: [ 'ck-fake-link-selection' ]
  58836. }
  58837. } );
  58838. // Renders a fake visual selection marker on a collapsed selection.
  58839. editor.conversion.for( 'editingDowncast' ).markerToElement( {
  58840. model: VISUAL_SELECTION_MARKER_NAME,
  58841. view: {
  58842. name: 'span',
  58843. classes: [ 'ck-fake-link-selection', 'ck-fake-link-selection_collapsed' ]
  58844. }
  58845. } );
  58846. }
  58847. /**
  58848. * @inheritDoc
  58849. */
  58850. destroy() {
  58851. super.destroy();
  58852. // Destroy created UI components as they are not automatically destroyed (see ckeditor5#1341).
  58853. this.formView.destroy();
  58854. }
  58855. /**
  58856. * Creates the {@link module:link/ui/linkactionsview~LinkActionsView} instance.
  58857. *
  58858. * @private
  58859. * @returns {module:link/ui/linkactionsview~LinkActionsView} The link actions view instance.
  58860. */
  58861. _createActionsView() {
  58862. const editor = this.editor;
  58863. const actionsView = new _ui_linkactionsview__WEBPACK_IMPORTED_MODULE_4__["default"]( editor.locale );
  58864. const linkCommand = editor.commands.get( 'link' );
  58865. const unlinkCommand = editor.commands.get( 'unlink' );
  58866. actionsView.bind( 'href' ).to( linkCommand, 'value' );
  58867. actionsView.editButtonView.bind( 'isEnabled' ).to( linkCommand );
  58868. actionsView.unlinkButtonView.bind( 'isEnabled' ).to( unlinkCommand );
  58869. // Execute unlink command after clicking on the "Edit" button.
  58870. this.listenTo( actionsView, 'edit', () => {
  58871. this._addFormView();
  58872. } );
  58873. // Execute unlink command after clicking on the "Unlink" button.
  58874. this.listenTo( actionsView, 'unlink', () => {
  58875. editor.execute( 'unlink' );
  58876. this._hideUI();
  58877. } );
  58878. // Close the panel on esc key press when the **actions have focus**.
  58879. actionsView.keystrokes.set( 'Esc', ( data, cancel ) => {
  58880. this._hideUI();
  58881. cancel();
  58882. } );
  58883. // Open the form view on Ctrl+K when the **actions have focus**..
  58884. actionsView.keystrokes.set( _utils__WEBPACK_IMPORTED_MODULE_5__["LINK_KEYSTROKE"], ( data, cancel ) => {
  58885. this._addFormView();
  58886. cancel();
  58887. } );
  58888. return actionsView;
  58889. }
  58890. /**
  58891. * Creates the {@link module:link/ui/linkformview~LinkFormView} instance.
  58892. *
  58893. * @private
  58894. * @returns {module:link/ui/linkformview~LinkFormView} The link form view instance.
  58895. */
  58896. _createFormView() {
  58897. const editor = this.editor;
  58898. const linkCommand = editor.commands.get( 'link' );
  58899. const defaultProtocol = editor.config.get( 'link.defaultProtocol' );
  58900. const formView = new _ui_linkformview__WEBPACK_IMPORTED_MODULE_3__["default"]( editor.locale, linkCommand );
  58901. formView.urlInputView.fieldView.bind( 'value' ).to( linkCommand, 'value' );
  58902. // Form elements should be read-only when corresponding commands are disabled.
  58903. formView.urlInputView.bind( 'isReadOnly' ).to( linkCommand, 'isEnabled', value => !value );
  58904. formView.saveButtonView.bind( 'isEnabled' ).to( linkCommand );
  58905. // Execute link command after clicking the "Save" button.
  58906. this.listenTo( formView, 'submit', () => {
  58907. const { value } = formView.urlInputView.fieldView.element;
  58908. const parsedUrl = Object(_utils__WEBPACK_IMPORTED_MODULE_5__["addLinkProtocolIfApplicable"])( value, defaultProtocol );
  58909. editor.execute( 'link', parsedUrl, formView.getDecoratorSwitchesState() );
  58910. this._closeFormView();
  58911. } );
  58912. // Hide the panel after clicking the "Cancel" button.
  58913. this.listenTo( formView, 'cancel', () => {
  58914. this._closeFormView();
  58915. } );
  58916. // Close the panel on esc key press when the **form has focus**.
  58917. formView.keystrokes.set( 'Esc', ( data, cancel ) => {
  58918. this._closeFormView();
  58919. cancel();
  58920. } );
  58921. return formView;
  58922. }
  58923. /**
  58924. * Creates a toolbar Link button. Clicking this button will show
  58925. * a {@link #_balloon} attached to the selection.
  58926. *
  58927. * @private
  58928. */
  58929. _createToolbarLinkButton() {
  58930. const editor = this.editor;
  58931. const linkCommand = editor.commands.get( 'link' );
  58932. const t = editor.t;
  58933. // Handle the `Ctrl+K` keystroke and show the panel.
  58934. editor.keystrokes.set( _utils__WEBPACK_IMPORTED_MODULE_5__["LINK_KEYSTROKE"], ( keyEvtData, cancel ) => {
  58935. // Prevent focusing the search bar in FF, Chrome and Edge. See https://github.com/ckeditor/ckeditor5/issues/4811.
  58936. cancel();
  58937. if ( linkCommand.isEnabled ) {
  58938. this._showUI( true );
  58939. }
  58940. } );
  58941. editor.ui.componentFactory.add( 'link', locale => {
  58942. const button = new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_2__["ButtonView"]( locale );
  58943. button.isEnabled = true;
  58944. button.label = t( 'Link' );
  58945. button.icon = _theme_icons_link_svg__WEBPACK_IMPORTED_MODULE_6__["default"];
  58946. button.keystroke = _utils__WEBPACK_IMPORTED_MODULE_5__["LINK_KEYSTROKE"];
  58947. button.tooltip = true;
  58948. button.isToggleable = true;
  58949. // Bind button to the command.
  58950. button.bind( 'isEnabled' ).to( linkCommand, 'isEnabled' );
  58951. button.bind( 'isOn' ).to( linkCommand, 'value', value => !!value );
  58952. // Show the panel on button click.
  58953. this.listenTo( button, 'execute', () => this._showUI( true ) );
  58954. return button;
  58955. } );
  58956. }
  58957. /**
  58958. * Attaches actions that control whether the balloon panel containing the
  58959. * {@link #formView} is visible or not.
  58960. *
  58961. * @private
  58962. */
  58963. _enableUserBalloonInteractions() {
  58964. const viewDocument = this.editor.editing.view.document;
  58965. // Handle click on view document and show panel when selection is placed inside the link element.
  58966. // Keep panel open until selection will be inside the same link element.
  58967. this.listenTo( viewDocument, 'click', () => {
  58968. const parentLink = this._getSelectedLinkElement();
  58969. if ( parentLink ) {
  58970. // Then show panel but keep focus inside editor editable.
  58971. this._showUI();
  58972. }
  58973. } );
  58974. // Focus the form if the balloon is visible and the Tab key has been pressed.
  58975. this.editor.keystrokes.set( 'Tab', ( data, cancel ) => {
  58976. if ( this._areActionsVisible && !this.actionsView.focusTracker.isFocused ) {
  58977. this.actionsView.focus();
  58978. cancel();
  58979. }
  58980. }, {
  58981. // Use the high priority because the link UI navigation is more important
  58982. // than other feature's actions, e.g. list indentation.
  58983. // https://github.com/ckeditor/ckeditor5-link/issues/146
  58984. priority: 'high'
  58985. } );
  58986. // Close the panel on the Esc key press when the editable has focus and the balloon is visible.
  58987. this.editor.keystrokes.set( 'Esc', ( data, cancel ) => {
  58988. if ( this._isUIVisible ) {
  58989. this._hideUI();
  58990. cancel();
  58991. }
  58992. } );
  58993. // Close on click outside of balloon panel element.
  58994. Object(ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_2__["clickOutsideHandler"])( {
  58995. emitter: this.formView,
  58996. activator: () => this._isUIInPanel,
  58997. contextElements: [ this._balloon.view.element ],
  58998. callback: () => this._hideUI()
  58999. } );
  59000. }
  59001. /**
  59002. * Adds the {@link #actionsView} to the {@link #_balloon}.
  59003. *
  59004. * @protected
  59005. */
  59006. _addActionsView() {
  59007. if ( this._areActionsInPanel ) {
  59008. return;
  59009. }
  59010. this._balloon.add( {
  59011. view: this.actionsView,
  59012. position: this._getBalloonPositionData()
  59013. } );
  59014. }
  59015. /**
  59016. * Adds the {@link #formView} to the {@link #_balloon}.
  59017. *
  59018. * @protected
  59019. */
  59020. _addFormView() {
  59021. if ( this._isFormInPanel ) {
  59022. return;
  59023. }
  59024. const editor = this.editor;
  59025. const linkCommand = editor.commands.get( 'link' );
  59026. this.formView.disableCssTransitions();
  59027. this._balloon.add( {
  59028. view: this.formView,
  59029. position: this._getBalloonPositionData()
  59030. } );
  59031. // Select input when form view is currently visible.
  59032. if ( this._balloon.visibleView === this.formView ) {
  59033. this.formView.urlInputView.fieldView.select();
  59034. }
  59035. this.formView.enableCssTransitions();
  59036. // Make sure that each time the panel shows up, the URL field remains in sync with the value of
  59037. // the command. If the user typed in the input, then canceled the balloon (`urlInputView.fieldView#value` stays
  59038. // unaltered) and re-opened it without changing the value of the link command (e.g. because they
  59039. // clicked the same link), they would see the old value instead of the actual value of the command.
  59040. // https://github.com/ckeditor/ckeditor5-link/issues/78
  59041. // https://github.com/ckeditor/ckeditor5-link/issues/123
  59042. this.formView.urlInputView.fieldView.element.value = linkCommand.value || '';
  59043. }
  59044. /**
  59045. * Closes the form view. Decides whether the balloon should be hidden completely or if the action view should be shown. This is
  59046. * decided upon the link command value (which has a value if the document selection is in the link).
  59047. *
  59048. * Additionally, if any {@link module:link/link~LinkConfig#decorators} are defined in the editor configuration, the state of
  59049. * switch buttons responsible for manual decorator handling is restored.
  59050. *
  59051. * @private
  59052. */
  59053. _closeFormView() {
  59054. const linkCommand = this.editor.commands.get( 'link' );
  59055. // Restore manual decorator states to represent the current model state. This case is important to reset the switch buttons
  59056. // when the user cancels the editing form.
  59057. linkCommand.restoreManualDecoratorStates();
  59058. if ( linkCommand.value !== undefined ) {
  59059. this._removeFormView();
  59060. } else {
  59061. this._hideUI();
  59062. }
  59063. }
  59064. /**
  59065. * Removes the {@link #formView} from the {@link #_balloon}.
  59066. *
  59067. * @protected
  59068. */
  59069. _removeFormView() {
  59070. if ( this._isFormInPanel ) {
  59071. // Blur the input element before removing it from DOM to prevent issues in some browsers.
  59072. // See https://github.com/ckeditor/ckeditor5/issues/1501.
  59073. this.formView.saveButtonView.focus();
  59074. this._balloon.remove( this.formView );
  59075. // Because the form has an input which has focus, the focus must be brought back
  59076. // to the editor. Otherwise, it would be lost.
  59077. this.editor.editing.view.focus();
  59078. this._hideFakeVisualSelection();
  59079. }
  59080. }
  59081. /**
  59082. * Shows the correct UI type. It is either {@link #formView} or {@link #actionsView}.
  59083. *
  59084. * @param {Boolean} forceVisible
  59085. * @private
  59086. */
  59087. _showUI( forceVisible = false ) {
  59088. // When there's no link under the selection, go straight to the editing UI.
  59089. if ( !this._getSelectedLinkElement() ) {
  59090. // Show visual selection on a text without a link when the contextual balloon is displayed.
  59091. // See https://github.com/ckeditor/ckeditor5/issues/4721.
  59092. this._showFakeVisualSelection();
  59093. this._addActionsView();
  59094. // Be sure panel with link is visible.
  59095. if ( forceVisible ) {
  59096. this._balloon.showStack( 'main' );
  59097. }
  59098. this._addFormView();
  59099. }
  59100. // If there's a link under the selection...
  59101. else {
  59102. // Go to the editing UI if actions are already visible.
  59103. if ( this._areActionsVisible ) {
  59104. this._addFormView();
  59105. }
  59106. // Otherwise display just the actions UI.
  59107. else {
  59108. this._addActionsView();
  59109. }
  59110. // Be sure panel with link is visible.
  59111. if ( forceVisible ) {
  59112. this._balloon.showStack( 'main' );
  59113. }
  59114. }
  59115. // Begin responding to ui#update once the UI is added.
  59116. this._startUpdatingUI();
  59117. }
  59118. /**
  59119. * Removes the {@link #formView} from the {@link #_balloon}.
  59120. *
  59121. * See {@link #_addFormView}, {@link #_addActionsView}.
  59122. *
  59123. * @protected
  59124. */
  59125. _hideUI() {
  59126. if ( !this._isUIInPanel ) {
  59127. return;
  59128. }
  59129. const editor = this.editor;
  59130. this.stopListening( editor.ui, 'update' );
  59131. this.stopListening( this._balloon, 'change:visibleView' );
  59132. // Make sure the focus always gets back to the editable _before_ removing the focused form view.
  59133. // Doing otherwise causes issues in some browsers. See https://github.com/ckeditor/ckeditor5-link/issues/193.
  59134. editor.editing.view.focus();
  59135. // Remove form first because it's on top of the stack.
  59136. this._removeFormView();
  59137. // Then remove the actions view because it's beneath the form.
  59138. this._balloon.remove( this.actionsView );
  59139. this._hideFakeVisualSelection();
  59140. }
  59141. /**
  59142. * Makes the UI react to the {@link module:core/editor/editorui~EditorUI#event:update} event to
  59143. * reposition itself when the editor UI should be refreshed.
  59144. *
  59145. * See: {@link #_hideUI} to learn when the UI stops reacting to the `update` event.
  59146. *
  59147. * @protected
  59148. */
  59149. _startUpdatingUI() {
  59150. const editor = this.editor;
  59151. const viewDocument = editor.editing.view.document;
  59152. let prevSelectedLink = this._getSelectedLinkElement();
  59153. let prevSelectionParent = getSelectionParent();
  59154. const update = () => {
  59155. const selectedLink = this._getSelectedLinkElement();
  59156. const selectionParent = getSelectionParent();
  59157. // Hide the panel if:
  59158. //
  59159. // * the selection went out of the EXISTING link element. E.g. user moved the caret out
  59160. // of the link,
  59161. // * the selection went to a different parent when creating a NEW link. E.g. someone
  59162. // else modified the document.
  59163. // * the selection has expanded (e.g. displaying link actions then pressing SHIFT+Right arrow).
  59164. //
  59165. // Note: #_getSelectedLinkElement will return a link for a non-collapsed selection only
  59166. // when fully selected.
  59167. if ( ( prevSelectedLink && !selectedLink ) ||
  59168. ( !prevSelectedLink && selectionParent !== prevSelectionParent ) ) {
  59169. this._hideUI();
  59170. }
  59171. // Update the position of the panel when:
  59172. // * link panel is in the visible stack
  59173. // * the selection remains in the original link element,
  59174. // * there was no link element in the first place, i.e. creating a new link
  59175. else if ( this._isUIVisible ) {
  59176. // If still in a link element, simply update the position of the balloon.
  59177. // If there was no link (e.g. inserting one), the balloon must be moved
  59178. // to the new position in the editing view (a new native DOM range).
  59179. this._balloon.updatePosition( this._getBalloonPositionData() );
  59180. }
  59181. prevSelectedLink = selectedLink;
  59182. prevSelectionParent = selectionParent;
  59183. };
  59184. function getSelectionParent() {
  59185. return viewDocument.selection.focus.getAncestors()
  59186. .reverse()
  59187. .find( node => node.is( 'element' ) );
  59188. }
  59189. this.listenTo( editor.ui, 'update', update );
  59190. this.listenTo( this._balloon, 'change:visibleView', update );
  59191. }
  59192. /**
  59193. * Returns `true` when {@link #formView} is in the {@link #_balloon}.
  59194. *
  59195. * @readonly
  59196. * @protected
  59197. * @type {Boolean}
  59198. */
  59199. get _isFormInPanel() {
  59200. return this._balloon.hasView( this.formView );
  59201. }
  59202. /**
  59203. * Returns `true` when {@link #actionsView} is in the {@link #_balloon}.
  59204. *
  59205. * @readonly
  59206. * @protected
  59207. * @type {Boolean}
  59208. */
  59209. get _areActionsInPanel() {
  59210. return this._balloon.hasView( this.actionsView );
  59211. }
  59212. /**
  59213. * Returns `true` when {@link #actionsView} is in the {@link #_balloon} and it is
  59214. * currently visible.
  59215. *
  59216. * @readonly
  59217. * @protected
  59218. * @type {Boolean}
  59219. */
  59220. get _areActionsVisible() {
  59221. return this._balloon.visibleView === this.actionsView;
  59222. }
  59223. /**
  59224. * Returns `true` when {@link #actionsView} or {@link #formView} is in the {@link #_balloon}.
  59225. *
  59226. * @readonly
  59227. * @protected
  59228. * @type {Boolean}
  59229. */
  59230. get _isUIInPanel() {
  59231. return this._isFormInPanel || this._areActionsInPanel;
  59232. }
  59233. /**
  59234. * Returns `true` when {@link #actionsView} or {@link #formView} is in the {@link #_balloon} and it is
  59235. * currently visible.
  59236. *
  59237. * @readonly
  59238. * @protected
  59239. * @type {Boolean}
  59240. */
  59241. get _isUIVisible() {
  59242. const visibleView = this._balloon.visibleView;
  59243. return visibleView == this.formView || this._areActionsVisible;
  59244. }
  59245. /**
  59246. * Returns positioning options for the {@link #_balloon}. They control the way the balloon is attached
  59247. * to the target element or selection.
  59248. *
  59249. * If the selection is collapsed and inside a link element, the panel will be attached to the
  59250. * entire link element. Otherwise, it will be attached to the selection.
  59251. *
  59252. * @private
  59253. * @returns {module:utils/dom/position~Options}
  59254. */
  59255. _getBalloonPositionData() {
  59256. const view = this.editor.editing.view;
  59257. const model = this.editor.model;
  59258. const viewDocument = view.document;
  59259. let target = null;
  59260. if ( model.markers.has( VISUAL_SELECTION_MARKER_NAME ) ) {
  59261. // There are cases when we highlight selection using a marker (#7705, #4721).
  59262. const markerViewElements = Array.from( this.editor.editing.mapper.markerNameToElements( VISUAL_SELECTION_MARKER_NAME ) );
  59263. const newRange = view.createRange(
  59264. view.createPositionBefore( markerViewElements[ 0 ] ),
  59265. view.createPositionAfter( markerViewElements[ markerViewElements.length - 1 ] )
  59266. );
  59267. target = view.domConverter.viewRangeToDom( newRange );
  59268. } else {
  59269. const targetLink = this._getSelectedLinkElement();
  59270. const range = viewDocument.selection.getFirstRange();
  59271. target = targetLink ?
  59272. // When selection is inside link element, then attach panel to this element.
  59273. view.domConverter.mapViewToDom( targetLink ) :
  59274. // Otherwise attach panel to the selection.
  59275. view.domConverter.viewRangeToDom( range );
  59276. }
  59277. return { target };
  59278. }
  59279. /**
  59280. * Returns the link {@link module:engine/view/attributeelement~AttributeElement} under
  59281. * the {@link module:engine/view/document~Document editing view's} selection or `null`
  59282. * if there is none.
  59283. *
  59284. * **Note**: For a non–collapsed selection, the link element is only returned when **fully**
  59285. * selected and the **only** element within the selection boundaries.
  59286. *
  59287. * @private
  59288. * @returns {module:engine/view/attributeelement~AttributeElement|null}
  59289. */
  59290. _getSelectedLinkElement() {
  59291. const view = this.editor.editing.view;
  59292. const selection = view.document.selection;
  59293. if ( selection.isCollapsed ) {
  59294. return findLinkElementAncestor( selection.getFirstPosition() );
  59295. } else {
  59296. // The range for fully selected link is usually anchored in adjacent text nodes.
  59297. // Trim it to get closer to the actual link element.
  59298. const range = selection.getFirstRange().getTrimmed();
  59299. const startLink = findLinkElementAncestor( range.start );
  59300. const endLink = findLinkElementAncestor( range.end );
  59301. if ( !startLink || startLink != endLink ) {
  59302. return null;
  59303. }
  59304. // Check if the link element is fully selected.
  59305. if ( view.createRangeIn( startLink ).getTrimmed().isEqual( range ) ) {
  59306. return startLink;
  59307. } else {
  59308. return null;
  59309. }
  59310. }
  59311. }
  59312. /**
  59313. * Displays a fake visual selection when the contextual balloon is displayed.
  59314. *
  59315. * This adds a 'link-ui' marker into the document that is rendered as a highlight on selected text fragment.
  59316. *
  59317. * @private
  59318. */
  59319. _showFakeVisualSelection() {
  59320. const model = this.editor.model;
  59321. model.change( writer => {
  59322. const range = model.document.selection.getFirstRange();
  59323. if ( model.markers.has( VISUAL_SELECTION_MARKER_NAME ) ) {
  59324. writer.updateMarker( VISUAL_SELECTION_MARKER_NAME, { range } );
  59325. } else {
  59326. if ( range.start.isAtEnd ) {
  59327. const startPosition = range.start.getLastMatchingPosition(
  59328. ( { item } ) => !model.schema.isContent( item ),
  59329. { boundaries: range }
  59330. );
  59331. writer.addMarker( VISUAL_SELECTION_MARKER_NAME, {
  59332. usingOperation: false,
  59333. affectsData: false,
  59334. range: writer.createRange( startPosition, range.end )
  59335. } );
  59336. } else {
  59337. writer.addMarker( VISUAL_SELECTION_MARKER_NAME, {
  59338. usingOperation: false,
  59339. affectsData: false,
  59340. range
  59341. } );
  59342. }
  59343. }
  59344. } );
  59345. }
  59346. /**
  59347. * Hides the fake visual selection created in {@link #_showFakeVisualSelection}.
  59348. *
  59349. * @private
  59350. */
  59351. _hideFakeVisualSelection() {
  59352. const model = this.editor.model;
  59353. if ( model.markers.has( VISUAL_SELECTION_MARKER_NAME ) ) {
  59354. model.change( writer => {
  59355. writer.removeMarker( VISUAL_SELECTION_MARKER_NAME );
  59356. } );
  59357. }
  59358. }
  59359. }
  59360. // Returns a link element if there's one among the ancestors of the provided `Position`.
  59361. //
  59362. // @private
  59363. // @param {module:engine/view/position~Position} View position to analyze.
  59364. // @returns {module:engine/view/attributeelement~AttributeElement|null} Link element at the position or null.
  59365. function findLinkElementAncestor( position ) {
  59366. return position.getAncestors().find( ancestor => Object(_utils__WEBPACK_IMPORTED_MODULE_5__["isLinkElement"])( ancestor ) );
  59367. }
  59368. /***/ }),
  59369. /***/ "./node_modules/@ckeditor/ckeditor5-link/src/ui/linkactionsview.js":
  59370. /*!*************************************************************************!*\
  59371. !*** ./node_modules/@ckeditor/ckeditor5-link/src/ui/linkactionsview.js ***!
  59372. \*************************************************************************/
  59373. /*! exports provided: default */
  59374. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  59375. "use strict";
  59376. __webpack_require__.r(__webpack_exports__);
  59377. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return LinkActionsView; });
  59378. /* harmony import */ var ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/ui */ "./node_modules/ckeditor5/src/ui.js");
  59379. /* harmony import */ var ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/utils */ "./node_modules/ckeditor5/src/utils.js");
  59380. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  59381. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils */ "./node_modules/@ckeditor/ckeditor5-link/src/utils.js");
  59382. /* harmony import */ var _ckeditor_ckeditor5_ui_theme_components_responsive_form_responsiveform_css__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @ckeditor/ckeditor5-ui/theme/components/responsive-form/responsiveform.css */ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/responsive-form/responsiveform.css");
  59383. /* harmony import */ var _ckeditor_ckeditor5_ui_theme_components_responsive_form_responsiveform_css__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_ckeditor_ckeditor5_ui_theme_components_responsive_form_responsiveform_css__WEBPACK_IMPORTED_MODULE_4__);
  59384. /* harmony import */ var _theme_linkactions_css__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../theme/linkactions.css */ "./node_modules/@ckeditor/ckeditor5-link/theme/linkactions.css");
  59385. /* harmony import */ var _theme_linkactions_css__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_theme_linkactions_css__WEBPACK_IMPORTED_MODULE_5__);
  59386. /* harmony import */ var _theme_icons_unlink_svg__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../theme/icons/unlink.svg */ "./node_modules/@ckeditor/ckeditor5-link/theme/icons/unlink.svg");
  59387. /**
  59388. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  59389. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  59390. */
  59391. /**
  59392. * @module link/ui/linkactionsview
  59393. */
  59394. // See: #8833.
  59395. // eslint-disable-next-line ckeditor5-rules/ckeditor-imports
  59396. /**
  59397. * The link actions view class. This view displays the link preview, allows
  59398. * unlinking or editing the link.
  59399. *
  59400. * @extends module:ui/view~View
  59401. */
  59402. class LinkActionsView extends ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_0__["View"] {
  59403. /**
  59404. * @inheritDoc
  59405. */
  59406. constructor( locale ) {
  59407. super( locale );
  59408. const t = locale.t;
  59409. /**
  59410. * Tracks information about DOM focus in the actions.
  59411. *
  59412. * @readonly
  59413. * @member {module:utils/focustracker~FocusTracker}
  59414. */
  59415. this.focusTracker = new ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_1__["FocusTracker"]();
  59416. /**
  59417. * An instance of the {@link module:utils/keystrokehandler~KeystrokeHandler}.
  59418. *
  59419. * @readonly
  59420. * @member {module:utils/keystrokehandler~KeystrokeHandler}
  59421. */
  59422. this.keystrokes = new ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_1__["KeystrokeHandler"]();
  59423. /**
  59424. * The href preview view.
  59425. *
  59426. * @member {module:ui/view~View}
  59427. */
  59428. this.previewButtonView = this._createPreviewButton();
  59429. /**
  59430. * The unlink button view.
  59431. *
  59432. * @member {module:ui/button/buttonview~ButtonView}
  59433. */
  59434. this.unlinkButtonView = this._createButton( t( 'Unlink' ), _theme_icons_unlink_svg__WEBPACK_IMPORTED_MODULE_6__["default"], 'unlink' );
  59435. /**
  59436. * The edit link button view.
  59437. *
  59438. * @member {module:ui/button/buttonview~ButtonView}
  59439. */
  59440. this.editButtonView = this._createButton( t( 'Edit link' ), ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_2__["icons"].pencil, 'edit' );
  59441. /**
  59442. * The value of the "href" attribute of the link to use in the {@link #previewButtonView}.
  59443. *
  59444. * @observable
  59445. * @member {String}
  59446. */
  59447. this.set( 'href' );
  59448. /**
  59449. * A collection of views that can be focused in the view.
  59450. *
  59451. * @readonly
  59452. * @protected
  59453. * @member {module:ui/viewcollection~ViewCollection}
  59454. */
  59455. this._focusables = new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_0__["ViewCollection"]();
  59456. /**
  59457. * Helps cycling over {@link #_focusables} in the view.
  59458. *
  59459. * @readonly
  59460. * @protected
  59461. * @member {module:ui/focuscycler~FocusCycler}
  59462. */
  59463. this._focusCycler = new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_0__["FocusCycler"]( {
  59464. focusables: this._focusables,
  59465. focusTracker: this.focusTracker,
  59466. keystrokeHandler: this.keystrokes,
  59467. actions: {
  59468. // Navigate fields backwards using the Shift + Tab keystroke.
  59469. focusPrevious: 'shift + tab',
  59470. // Navigate fields forwards using the Tab key.
  59471. focusNext: 'tab'
  59472. }
  59473. } );
  59474. this.setTemplate( {
  59475. tag: 'div',
  59476. attributes: {
  59477. class: [
  59478. 'ck',
  59479. 'ck-link-actions',
  59480. 'ck-responsive-form'
  59481. ],
  59482. // https://github.com/ckeditor/ckeditor5-link/issues/90
  59483. tabindex: '-1'
  59484. },
  59485. children: [
  59486. this.previewButtonView,
  59487. this.editButtonView,
  59488. this.unlinkButtonView
  59489. ]
  59490. } );
  59491. }
  59492. /**
  59493. * @inheritDoc
  59494. */
  59495. render() {
  59496. super.render();
  59497. const childViews = [
  59498. this.previewButtonView,
  59499. this.editButtonView,
  59500. this.unlinkButtonView
  59501. ];
  59502. childViews.forEach( v => {
  59503. // Register the view as focusable.
  59504. this._focusables.add( v );
  59505. // Register the view in the focus tracker.
  59506. this.focusTracker.add( v.element );
  59507. } );
  59508. // Start listening for the keystrokes coming from #element.
  59509. this.keystrokes.listenTo( this.element );
  59510. }
  59511. /**
  59512. * Focuses the fist {@link #_focusables} in the actions.
  59513. */
  59514. focus() {
  59515. this._focusCycler.focusFirst();
  59516. }
  59517. /**
  59518. * Creates a button view.
  59519. *
  59520. * @private
  59521. * @param {String} label The button label.
  59522. * @param {String} icon The button icon.
  59523. * @param {String} [eventName] An event name that the `ButtonView#execute` event will be delegated to.
  59524. * @returns {module:ui/button/buttonview~ButtonView} The button view instance.
  59525. */
  59526. _createButton( label, icon, eventName ) {
  59527. const button = new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_0__["ButtonView"]( this.locale );
  59528. button.set( {
  59529. label,
  59530. icon,
  59531. tooltip: true
  59532. } );
  59533. button.delegate( 'execute' ).to( this, eventName );
  59534. return button;
  59535. }
  59536. /**
  59537. * Creates a link href preview button.
  59538. *
  59539. * @private
  59540. * @returns {module:ui/button/buttonview~ButtonView} The button view instance.
  59541. */
  59542. _createPreviewButton() {
  59543. const button = new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_0__["ButtonView"]( this.locale );
  59544. const bind = this.bindTemplate;
  59545. const t = this.t;
  59546. button.set( {
  59547. withText: true,
  59548. tooltip: t( 'Open link in new tab' )
  59549. } );
  59550. button.extendTemplate( {
  59551. attributes: {
  59552. class: [
  59553. 'ck',
  59554. 'ck-link-actions__preview'
  59555. ],
  59556. href: bind.to( 'href', href => href && Object(_utils__WEBPACK_IMPORTED_MODULE_3__["ensureSafeUrl"])( href ) ),
  59557. target: '_blank',
  59558. rel: 'noopener noreferrer'
  59559. }
  59560. } );
  59561. button.bind( 'label' ).to( this, 'href', href => {
  59562. return href || t( 'This link has no URL' );
  59563. } );
  59564. button.bind( 'isEnabled' ).to( this, 'href', href => !!href );
  59565. button.template.tag = 'a';
  59566. button.template.eventListeners = {};
  59567. return button;
  59568. }
  59569. }
  59570. /**
  59571. * Fired when the {@link #editButtonView} is clicked.
  59572. *
  59573. * @event edit
  59574. */
  59575. /**
  59576. * Fired when the {@link #unlinkButtonView} is clicked.
  59577. *
  59578. * @event unlink
  59579. */
  59580. /***/ }),
  59581. /***/ "./node_modules/@ckeditor/ckeditor5-link/src/ui/linkformview.js":
  59582. /*!**********************************************************************!*\
  59583. !*** ./node_modules/@ckeditor/ckeditor5-link/src/ui/linkformview.js ***!
  59584. \**********************************************************************/
  59585. /*! exports provided: default */
  59586. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  59587. "use strict";
  59588. __webpack_require__.r(__webpack_exports__);
  59589. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return LinkFormView; });
  59590. /* harmony import */ var ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/ui */ "./node_modules/ckeditor5/src/ui.js");
  59591. /* harmony import */ var ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/utils */ "./node_modules/ckeditor5/src/utils.js");
  59592. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  59593. /* harmony import */ var _ckeditor_ckeditor5_ui_theme_components_responsive_form_responsiveform_css__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-ui/theme/components/responsive-form/responsiveform.css */ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/responsive-form/responsiveform.css");
  59594. /* harmony import */ var _ckeditor_ckeditor5_ui_theme_components_responsive_form_responsiveform_css__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_ckeditor_ckeditor5_ui_theme_components_responsive_form_responsiveform_css__WEBPACK_IMPORTED_MODULE_3__);
  59595. /* harmony import */ var _theme_linkform_css__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../theme/linkform.css */ "./node_modules/@ckeditor/ckeditor5-link/theme/linkform.css");
  59596. /* harmony import */ var _theme_linkform_css__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_theme_linkform_css__WEBPACK_IMPORTED_MODULE_4__);
  59597. /**
  59598. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  59599. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  59600. */
  59601. /**
  59602. * @module link/ui/linkformview
  59603. */
  59604. // See: #8833.
  59605. // eslint-disable-next-line ckeditor5-rules/ckeditor-imports
  59606. /**
  59607. * The link form view controller class.
  59608. *
  59609. * See {@link module:link/ui/linkformview~LinkFormView}.
  59610. *
  59611. * @extends module:ui/view~View
  59612. */
  59613. class LinkFormView extends ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_0__["View"] {
  59614. /**
  59615. * Creates an instance of the {@link module:link/ui/linkformview~LinkFormView} class.
  59616. *
  59617. * Also see {@link #render}.
  59618. *
  59619. * @param {module:utils/locale~Locale} [locale] The localization services instance.
  59620. * @param {module:link/linkcommand~LinkCommand} linkCommand Reference to {@link module:link/linkcommand~LinkCommand}.
  59621. * @param {String} [protocol] A value of a protocol to be displayed in the input's placeholder.
  59622. */
  59623. constructor( locale, linkCommand ) {
  59624. super( locale );
  59625. const t = locale.t;
  59626. /**
  59627. * Tracks information about DOM focus in the form.
  59628. *
  59629. * @readonly
  59630. * @member {module:utils/focustracker~FocusTracker}
  59631. */
  59632. this.focusTracker = new ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_1__["FocusTracker"]();
  59633. /**
  59634. * An instance of the {@link module:utils/keystrokehandler~KeystrokeHandler}.
  59635. *
  59636. * @readonly
  59637. * @member {module:utils/keystrokehandler~KeystrokeHandler}
  59638. */
  59639. this.keystrokes = new ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_1__["KeystrokeHandler"]();
  59640. /**
  59641. * The URL input view.
  59642. *
  59643. * @member {module:ui/labeledfield/labeledfieldview~LabeledFieldView}
  59644. */
  59645. this.urlInputView = this._createUrlInput();
  59646. /**
  59647. * The Save button view.
  59648. *
  59649. * @member {module:ui/button/buttonview~ButtonView}
  59650. */
  59651. this.saveButtonView = this._createButton( t( 'Save' ), ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_2__["icons"].check, 'ck-button-save' );
  59652. this.saveButtonView.type = 'submit';
  59653. /**
  59654. * The Cancel button view.
  59655. *
  59656. * @member {module:ui/button/buttonview~ButtonView}
  59657. */
  59658. this.cancelButtonView = this._createButton( t( 'Cancel' ), ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_2__["icons"].cancel, 'ck-button-cancel', 'cancel' );
  59659. /**
  59660. * A collection of {@link module:ui/button/switchbuttonview~SwitchButtonView},
  59661. * which corresponds to {@link module:link/linkcommand~LinkCommand#manualDecorators manual decorators}
  59662. * configured in the editor.
  59663. *
  59664. * @private
  59665. * @readonly
  59666. * @type {module:ui/viewcollection~ViewCollection}
  59667. */
  59668. this._manualDecoratorSwitches = this._createManualDecoratorSwitches( linkCommand );
  59669. /**
  59670. * A collection of child views in the form.
  59671. *
  59672. * @readonly
  59673. * @type {module:ui/viewcollection~ViewCollection}
  59674. */
  59675. this.children = this._createFormChildren( linkCommand.manualDecorators );
  59676. /**
  59677. * A collection of views that can be focused in the form.
  59678. *
  59679. * @readonly
  59680. * @protected
  59681. * @member {module:ui/viewcollection~ViewCollection}
  59682. */
  59683. this._focusables = new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_0__["ViewCollection"]();
  59684. /**
  59685. * Helps cycling over {@link #_focusables} in the form.
  59686. *
  59687. * @readonly
  59688. * @protected
  59689. * @member {module:ui/focuscycler~FocusCycler}
  59690. */
  59691. this._focusCycler = new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_0__["FocusCycler"]( {
  59692. focusables: this._focusables,
  59693. focusTracker: this.focusTracker,
  59694. keystrokeHandler: this.keystrokes,
  59695. actions: {
  59696. // Navigate form fields backwards using the Shift + Tab keystroke.
  59697. focusPrevious: 'shift + tab',
  59698. // Navigate form fields forwards using the Tab key.
  59699. focusNext: 'tab'
  59700. }
  59701. } );
  59702. const classList = [ 'ck', 'ck-link-form', 'ck-responsive-form' ];
  59703. if ( linkCommand.manualDecorators.length ) {
  59704. classList.push( 'ck-link-form_layout-vertical', 'ck-vertical-form' );
  59705. }
  59706. this.setTemplate( {
  59707. tag: 'form',
  59708. attributes: {
  59709. class: classList,
  59710. // https://github.com/ckeditor/ckeditor5-link/issues/90
  59711. tabindex: '-1'
  59712. },
  59713. children: this.children
  59714. } );
  59715. Object(ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_0__["injectCssTransitionDisabler"])( this );
  59716. }
  59717. /**
  59718. * Obtains the state of the {@link module:ui/button/switchbuttonview~SwitchButtonView switch buttons} representing
  59719. * {@link module:link/linkcommand~LinkCommand#manualDecorators manual link decorators}
  59720. * in the {@link module:link/ui/linkformview~LinkFormView}.
  59721. *
  59722. * @returns {Object.<String,Boolean>} Key-value pairs, where the key is the name of the decorator and the value is
  59723. * its state.
  59724. */
  59725. getDecoratorSwitchesState() {
  59726. return Array.from( this._manualDecoratorSwitches ).reduce( ( accumulator, switchButton ) => {
  59727. accumulator[ switchButton.name ] = switchButton.isOn;
  59728. return accumulator;
  59729. }, {} );
  59730. }
  59731. /**
  59732. * @inheritDoc
  59733. */
  59734. render() {
  59735. super.render();
  59736. Object(ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_0__["submitHandler"])( {
  59737. view: this
  59738. } );
  59739. const childViews = [
  59740. this.urlInputView,
  59741. ...this._manualDecoratorSwitches,
  59742. this.saveButtonView,
  59743. this.cancelButtonView
  59744. ];
  59745. childViews.forEach( v => {
  59746. // Register the view as focusable.
  59747. this._focusables.add( v );
  59748. // Register the view in the focus tracker.
  59749. this.focusTracker.add( v.element );
  59750. } );
  59751. // Start listening for the keystrokes coming from #element.
  59752. this.keystrokes.listenTo( this.element );
  59753. }
  59754. /**
  59755. * Focuses the fist {@link #_focusables} in the form.
  59756. */
  59757. focus() {
  59758. this._focusCycler.focusFirst();
  59759. }
  59760. /**
  59761. * Creates a labeled input view.
  59762. *
  59763. * @private
  59764. * @returns {module:ui/labeledfield/labeledfieldview~LabeledFieldView} Labeled field view instance.
  59765. */
  59766. _createUrlInput() {
  59767. const t = this.locale.t;
  59768. const labeledInput = new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_0__["LabeledFieldView"]( this.locale, ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_0__["createLabeledInputText"] );
  59769. labeledInput.label = t( 'Link URL' );
  59770. return labeledInput;
  59771. }
  59772. /**
  59773. * Creates a button view.
  59774. *
  59775. * @private
  59776. * @param {String} label The button label.
  59777. * @param {String} icon The button icon.
  59778. * @param {String} className The additional button CSS class name.
  59779. * @param {String} [eventName] An event name that the `ButtonView#execute` event will be delegated to.
  59780. * @returns {module:ui/button/buttonview~ButtonView} The button view instance.
  59781. */
  59782. _createButton( label, icon, className, eventName ) {
  59783. const button = new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_0__["ButtonView"]( this.locale );
  59784. button.set( {
  59785. label,
  59786. icon,
  59787. tooltip: true
  59788. } );
  59789. button.extendTemplate( {
  59790. attributes: {
  59791. class: className
  59792. }
  59793. } );
  59794. if ( eventName ) {
  59795. button.delegate( 'execute' ).to( this, eventName );
  59796. }
  59797. return button;
  59798. }
  59799. /**
  59800. * Populates {@link module:ui/viewcollection~ViewCollection} of {@link module:ui/button/switchbuttonview~SwitchButtonView}
  59801. * made based on {@link module:link/linkcommand~LinkCommand#manualDecorators}.
  59802. *
  59803. * @private
  59804. * @param {module:link/linkcommand~LinkCommand} linkCommand A reference to the link command.
  59805. * @returns {module:ui/viewcollection~ViewCollection} of switch buttons.
  59806. */
  59807. _createManualDecoratorSwitches( linkCommand ) {
  59808. const switches = this.createCollection();
  59809. for ( const manualDecorator of linkCommand.manualDecorators ) {
  59810. const switchButton = new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_0__["SwitchButtonView"]( this.locale );
  59811. switchButton.set( {
  59812. name: manualDecorator.id,
  59813. label: manualDecorator.label,
  59814. withText: true
  59815. } );
  59816. switchButton.bind( 'isOn' ).toMany( [ manualDecorator, linkCommand ], 'value', ( decoratorValue, commandValue ) => {
  59817. return commandValue === undefined && decoratorValue === undefined ? manualDecorator.defaultValue : decoratorValue;
  59818. } );
  59819. switchButton.on( 'execute', () => {
  59820. manualDecorator.set( 'value', !switchButton.isOn );
  59821. } );
  59822. switches.add( switchButton );
  59823. }
  59824. return switches;
  59825. }
  59826. /**
  59827. * Populates the {@link #children} collection of the form.
  59828. *
  59829. * If {@link module:link/linkcommand~LinkCommand#manualDecorators manual decorators} are configured in the editor, it creates an
  59830. * additional `View` wrapping all {@link #_manualDecoratorSwitches} switch buttons corresponding
  59831. * to these decorators.
  59832. *
  59833. * @private
  59834. * @param {module:utils/collection~Collection} manualDecorators A reference to
  59835. * the collection of manual decorators stored in the link command.
  59836. * @returns {module:ui/viewcollection~ViewCollection} The children of link form view.
  59837. */
  59838. _createFormChildren( manualDecorators ) {
  59839. const children = this.createCollection();
  59840. children.add( this.urlInputView );
  59841. if ( manualDecorators.length ) {
  59842. const additionalButtonsView = new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_0__["View"]();
  59843. additionalButtonsView.setTemplate( {
  59844. tag: 'ul',
  59845. children: this._manualDecoratorSwitches.map( switchButton => ( {
  59846. tag: 'li',
  59847. children: [ switchButton ],
  59848. attributes: {
  59849. class: [
  59850. 'ck',
  59851. 'ck-list__item'
  59852. ]
  59853. }
  59854. } ) ),
  59855. attributes: {
  59856. class: [
  59857. 'ck',
  59858. 'ck-reset',
  59859. 'ck-list'
  59860. ]
  59861. }
  59862. } );
  59863. children.add( additionalButtonsView );
  59864. }
  59865. children.add( this.saveButtonView );
  59866. children.add( this.cancelButtonView );
  59867. return children;
  59868. }
  59869. }
  59870. /**
  59871. * Fired when the form view is submitted (when one of the children triggered the submit event),
  59872. * for example with a click on {@link #saveButtonView}.
  59873. *
  59874. * @event submit
  59875. */
  59876. /**
  59877. * Fired when the form view is canceled, for example with a click on {@link #cancelButtonView}.
  59878. *
  59879. * @event cancel
  59880. */
  59881. /***/ }),
  59882. /***/ "./node_modules/@ckeditor/ckeditor5-link/src/unlinkcommand.js":
  59883. /*!********************************************************************!*\
  59884. !*** ./node_modules/@ckeditor/ckeditor5-link/src/unlinkcommand.js ***!
  59885. \********************************************************************/
  59886. /*! exports provided: default */
  59887. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  59888. "use strict";
  59889. __webpack_require__.r(__webpack_exports__);
  59890. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return UnlinkCommand; });
  59891. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  59892. /* harmony import */ var ckeditor5_src_typing__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/typing */ "./node_modules/ckeditor5/src/typing.js");
  59893. /* harmony import */ var ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ckeditor5/src/utils */ "./node_modules/ckeditor5/src/utils.js");
  59894. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils */ "./node_modules/@ckeditor/ckeditor5-link/src/utils.js");
  59895. /**
  59896. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  59897. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  59898. */
  59899. /**
  59900. * @module link/unlinkcommand
  59901. */
  59902. /**
  59903. * The unlink command. It is used by the {@link module:link/link~Link link plugin}.
  59904. *
  59905. * @extends module:core/command~Command
  59906. */
  59907. class UnlinkCommand extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Command"] {
  59908. /**
  59909. * @inheritDoc
  59910. */
  59911. refresh() {
  59912. const model = this.editor.model;
  59913. const doc = model.document;
  59914. const selectedElement = Object(ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_2__["first"])( doc.selection.getSelectedBlocks() );
  59915. // A check for the `LinkImage` plugin. If the selection contains an image element, get values from the element.
  59916. // Currently the selection reads attributes from text nodes only. See #7429 and #7465.
  59917. if ( Object(_utils__WEBPACK_IMPORTED_MODULE_3__["isImageAllowed"])( selectedElement, model.schema ) ) {
  59918. this.isEnabled = model.schema.checkAttribute( selectedElement, 'linkHref' );
  59919. } else {
  59920. this.isEnabled = model.schema.checkAttributeInSelection( doc.selection, 'linkHref' );
  59921. }
  59922. }
  59923. /**
  59924. * Executes the command.
  59925. *
  59926. * When the selection is collapsed, it removes the `linkHref` attribute from each node with the same `linkHref` attribute value.
  59927. * When the selection is non-collapsed, it removes the `linkHref` attribute from each node in selected ranges.
  59928. *
  59929. * # Decorators
  59930. *
  59931. * If {@link module:link/link~LinkConfig#decorators `config.link.decorators`} is specified,
  59932. * all configured decorators are removed together with the `linkHref` attribute.
  59933. *
  59934. * @fires execute
  59935. */
  59936. execute() {
  59937. const editor = this.editor;
  59938. const model = this.editor.model;
  59939. const selection = model.document.selection;
  59940. const linkCommand = editor.commands.get( 'link' );
  59941. model.change( writer => {
  59942. // Get ranges to unlink.
  59943. const rangesToUnlink = selection.isCollapsed ?
  59944. [ Object(ckeditor5_src_typing__WEBPACK_IMPORTED_MODULE_1__["findAttributeRange"])(
  59945. selection.getFirstPosition(),
  59946. 'linkHref',
  59947. selection.getAttribute( 'linkHref' ),
  59948. model
  59949. ) ] :
  59950. model.schema.getValidRanges( selection.getRanges(), 'linkHref' );
  59951. // Remove `linkHref` attribute from specified ranges.
  59952. for ( const range of rangesToUnlink ) {
  59953. writer.removeAttribute( 'linkHref', range );
  59954. // If there are registered custom attributes, then remove them during unlink.
  59955. if ( linkCommand ) {
  59956. for ( const manualDecorator of linkCommand.manualDecorators ) {
  59957. writer.removeAttribute( manualDecorator.id, range );
  59958. }
  59959. }
  59960. }
  59961. } );
  59962. }
  59963. }
  59964. /***/ }),
  59965. /***/ "./node_modules/@ckeditor/ckeditor5-link/src/utils.js":
  59966. /*!************************************************************!*\
  59967. !*** ./node_modules/@ckeditor/ckeditor5-link/src/utils.js ***!
  59968. \************************************************************/
  59969. /*! exports provided: LINK_KEYSTROKE, isLinkElement, createLinkElement, ensureSafeUrl, getLocalizedDecorators, normalizeDecorators, isImageAllowed, isEmail, addLinkProtocolIfApplicable */
  59970. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  59971. "use strict";
  59972. __webpack_require__.r(__webpack_exports__);
  59973. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LINK_KEYSTROKE", function() { return LINK_KEYSTROKE; });
  59974. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isLinkElement", function() { return isLinkElement; });
  59975. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createLinkElement", function() { return createLinkElement; });
  59976. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ensureSafeUrl", function() { return ensureSafeUrl; });
  59977. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getLocalizedDecorators", function() { return getLocalizedDecorators; });
  59978. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "normalizeDecorators", function() { return normalizeDecorators; });
  59979. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isImageAllowed", function() { return isImageAllowed; });
  59980. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isEmail", function() { return isEmail; });
  59981. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addLinkProtocolIfApplicable", function() { return addLinkProtocolIfApplicable; });
  59982. /* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash-es */ "./node_modules/lodash-es/lodash.js");
  59983. /**
  59984. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  59985. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  59986. */
  59987. /**
  59988. * @module link/utils
  59989. */
  59990. const ATTRIBUTE_WHITESPACES = /[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g; // eslint-disable-line no-control-regex
  59991. const SAFE_URL = /^(?:(?:https?|ftps?|mailto):|[^a-z]|[a-z+.-]+(?:[^a-z+.:-]|$))/i;
  59992. // Simplified email test - should be run over previously found URL.
  59993. const EMAIL_REG_EXP = /^[\S]+@((?![-_])(?:[-\w\u00a1-\uffff]{0,63}[^-_]\.))+(?:[a-z\u00a1-\uffff]{2,})$/i;
  59994. // The regex checks for the protocol syntax ('xxxx://' or 'xxxx:')
  59995. // or non-word characters at the beginning of the link ('/', '#' etc.).
  59996. const PROTOCOL_REG_EXP = /^((\w+:(\/{2,})?)|(\W))/i;
  59997. /**
  59998. * A keystroke used by the {@link module:link/linkui~LinkUI link UI feature}.
  59999. */
  60000. const LINK_KEYSTROKE = 'Ctrl+K';
  60001. /**
  60002. * Returns `true` if a given view node is the link element.
  60003. *
  60004. * @param {module:engine/view/node~Node} node
  60005. * @returns {Boolean}
  60006. */
  60007. function isLinkElement( node ) {
  60008. return node.is( 'attributeElement' ) && !!node.getCustomProperty( 'link' );
  60009. }
  60010. /**
  60011. * Creates a link {@link module:engine/view/attributeelement~AttributeElement} with the provided `href` attribute.
  60012. *
  60013. * @param {String} href
  60014. * @param {module:engine/conversion/downcastdispatcher~DowncastConversionApi} conversionApi
  60015. * @returns {module:engine/view/attributeelement~AttributeElement}
  60016. */
  60017. function createLinkElement( href, { writer } ) {
  60018. // Priority 5 - https://github.com/ckeditor/ckeditor5-link/issues/121.
  60019. const linkElement = writer.createAttributeElement( 'a', { href }, { priority: 5 } );
  60020. writer.setCustomProperty( 'link', true, linkElement );
  60021. return linkElement;
  60022. }
  60023. /**
  60024. * Returns a safe URL based on a given value.
  60025. *
  60026. * A URL is considered safe if it is safe for the user (does not contain any malicious code).
  60027. *
  60028. * If a URL is considered unsafe, a simple `"#"` is returned.
  60029. *
  60030. * @protected
  60031. * @param {*} url
  60032. * @returns {String} Safe URL.
  60033. */
  60034. function ensureSafeUrl( url ) {
  60035. url = String( url );
  60036. return isSafeUrl( url ) ? url : '#';
  60037. }
  60038. // Checks whether the given URL is safe for the user (does not contain any malicious code).
  60039. //
  60040. // @param {String} url URL to check.
  60041. function isSafeUrl( url ) {
  60042. const normalizedUrl = url.replace( ATTRIBUTE_WHITESPACES, '' );
  60043. return normalizedUrl.match( SAFE_URL );
  60044. }
  60045. /**
  60046. * Returns the {@link module:link/link~LinkConfig#decorators `config.link.decorators`} configuration processed
  60047. * to respect the locale of the editor, i.e. to display the {@link module:link/link~LinkDecoratorManualDefinition label}
  60048. * in the correct language.
  60049. *
  60050. * **Note**: Only the few most commonly used labels are translated automatically. Other labels should be manually
  60051. * translated in the {@link module:link/link~LinkConfig#decorators `config.link.decorators`} configuration.
  60052. *
  60053. * @param {module:utils/locale~Locale#t} t shorthand for {@link module:utils/locale~Locale#t Locale#t}
  60054. * @param {Array.<module:link/link~LinkDecoratorDefinition>} The decorator reference
  60055. * where the label values should be localized.
  60056. * @returns {Array.<module:link/link~LinkDecoratorDefinition>}
  60057. */
  60058. function getLocalizedDecorators( t, decorators ) {
  60059. const localizedDecoratorsLabels = {
  60060. 'Open in a new tab': t( 'Open in a new tab' ),
  60061. 'Downloadable': t( 'Downloadable' )
  60062. };
  60063. decorators.forEach( decorator => {
  60064. if ( decorator.label && localizedDecoratorsLabels[ decorator.label ] ) {
  60065. decorator.label = localizedDecoratorsLabels[ decorator.label ];
  60066. }
  60067. return decorator;
  60068. } );
  60069. return decorators;
  60070. }
  60071. /**
  60072. * Converts an object with defined decorators to a normalized array of decorators. The `id` key is added for each decorator and
  60073. * is used as the attribute's name in the model.
  60074. *
  60075. * @param {Object.<String, module:link/link~LinkDecoratorDefinition>} decorators
  60076. * @returns {Array.<module:link/link~LinkDecoratorDefinition>}
  60077. */
  60078. function normalizeDecorators( decorators ) {
  60079. const retArray = [];
  60080. if ( decorators ) {
  60081. for ( const [ key, value ] of Object.entries( decorators ) ) {
  60082. const decorator = Object.assign(
  60083. {},
  60084. value,
  60085. { id: `link${ Object(lodash_es__WEBPACK_IMPORTED_MODULE_0__["upperFirst"])( key ) }` }
  60086. );
  60087. retArray.push( decorator );
  60088. }
  60089. }
  60090. return retArray;
  60091. }
  60092. /**
  60093. * Returns `true` if the specified `element` is an image and it can be linked (the element allows having the `linkHref` attribute).
  60094. *
  60095. * @params {module:engine/model/element~Element|null} element
  60096. * @params {module:engine/model/schema~Schema} schema
  60097. * @returns {Boolean}
  60098. */
  60099. function isImageAllowed( element, schema ) {
  60100. if ( !element ) {
  60101. return false;
  60102. }
  60103. return element.is( 'element', 'image' ) && schema.checkAttribute( 'image', 'linkHref' );
  60104. }
  60105. /**
  60106. * Returns `true` if the specified `value` is an email.
  60107. *
  60108. * @params {String} value
  60109. * @returns {Boolean}
  60110. */
  60111. function isEmail( value ) {
  60112. return EMAIL_REG_EXP.test( value );
  60113. }
  60114. /**
  60115. * Adds the protocol prefix to the specified `link` when:
  60116. *
  60117. * * it does not contain it already, and there is a {@link module:link/link~LinkConfig#defaultProtocol `defaultProtocol` }
  60118. * configuration value provided,
  60119. * * or the link is an email address.
  60120. *
  60121. *
  60122. * @params {String} link
  60123. * @params {String} defaultProtocol
  60124. * @returns {Boolean}
  60125. */
  60126. function addLinkProtocolIfApplicable( link, defaultProtocol ) {
  60127. const protocol = isEmail( link ) ? 'mailto:' : defaultProtocol;
  60128. const isProtocolNeeded = !!protocol && !PROTOCOL_REG_EXP.test( link );
  60129. return link && isProtocolNeeded ? protocol + link : link;
  60130. }
  60131. /***/ }),
  60132. /***/ "./node_modules/@ckeditor/ckeditor5-link/src/utils/automaticdecorators.js":
  60133. /*!********************************************************************************!*\
  60134. !*** ./node_modules/@ckeditor/ckeditor5-link/src/utils/automaticdecorators.js ***!
  60135. \********************************************************************************/
  60136. /*! exports provided: default */
  60137. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  60138. "use strict";
  60139. __webpack_require__.r(__webpack_exports__);
  60140. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return AutomaticDecorators; });
  60141. /* harmony import */ var ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/utils */ "./node_modules/ckeditor5/src/utils.js");
  60142. /**
  60143. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  60144. * For licensing, see LICENSE.md.
  60145. */
  60146. /**
  60147. * @module link/utils
  60148. */
  60149. /**
  60150. * Helper class that ties together all {@link module:link/link~LinkDecoratorAutomaticDefinition} and provides
  60151. * the {@link module:engine/conversion/downcasthelpers~DowncastHelpers#attributeToElement downcast dispatchers} for them.
  60152. */
  60153. class AutomaticDecorators {
  60154. constructor() {
  60155. /**
  60156. * Stores the definition of {@link module:link/link~LinkDecoratorAutomaticDefinition automatic decorators}.
  60157. * This data is used as a source for a downcast dispatcher to create a proper conversion to output data.
  60158. *
  60159. * @private
  60160. * @type {Set}
  60161. */
  60162. this._definitions = new Set();
  60163. }
  60164. /**
  60165. * Gives information about the number of decorators stored in the {@link module:link/utils~AutomaticDecorators} instance.
  60166. *
  60167. * @readonly
  60168. * @protected
  60169. * @type {Number}
  60170. */
  60171. get length() {
  60172. return this._definitions.size;
  60173. }
  60174. /**
  60175. * Adds automatic decorator objects or an array with them to be used during downcasting.
  60176. *
  60177. * @param {module:link/link~LinkDecoratorAutomaticDefinition|Array.<module:link/link~LinkDecoratorAutomaticDefinition>} item
  60178. * A configuration object of automatic rules for decorating links. It might also be an array of such objects.
  60179. */
  60180. add( item ) {
  60181. if ( Array.isArray( item ) ) {
  60182. item.forEach( item => this._definitions.add( item ) );
  60183. } else {
  60184. this._definitions.add( item );
  60185. }
  60186. }
  60187. /**
  60188. * Provides the conversion helper used in the {@link module:engine/conversion/downcasthelpers~DowncastHelpers#add} method.
  60189. *
  60190. * @returns {Function} A dispatcher function used as conversion helper
  60191. * in {@link module:engine/conversion/downcasthelpers~DowncastHelpers#add}.
  60192. */
  60193. getDispatcher() {
  60194. return dispatcher => {
  60195. dispatcher.on( 'attribute:linkHref', ( evt, data, conversionApi ) => {
  60196. // There is only test as this behavior decorates links and
  60197. // it is run before dispatcher which actually consumes this node.
  60198. // This allows on writing own dispatcher with highest priority,
  60199. // which blocks both native converter and this additional decoration.
  60200. if ( !conversionApi.consumable.test( data.item, 'attribute:linkHref' ) ) {
  60201. return;
  60202. }
  60203. const viewWriter = conversionApi.writer;
  60204. const viewSelection = viewWriter.document.selection;
  60205. for ( const item of this._definitions ) {
  60206. const viewElement = viewWriter.createAttributeElement( 'a', item.attributes, {
  60207. priority: 5
  60208. } );
  60209. viewWriter.setCustomProperty( 'link', true, viewElement );
  60210. if ( item.callback( data.attributeNewValue ) ) {
  60211. if ( data.item.is( 'selection' ) ) {
  60212. viewWriter.wrap( viewSelection.getFirstRange(), viewElement );
  60213. } else {
  60214. viewWriter.wrap( conversionApi.mapper.toViewRange( data.range ), viewElement );
  60215. }
  60216. } else {
  60217. viewWriter.unwrap( conversionApi.mapper.toViewRange( data.range ), viewElement );
  60218. }
  60219. }
  60220. }, { priority: 'high' } );
  60221. };
  60222. }
  60223. /**
  60224. * Provides the conversion helper used in the {@link module:engine/conversion/downcasthelpers~DowncastHelpers#add} method
  60225. * when linking images.
  60226. *
  60227. * @returns {Function} A dispatcher function used as conversion helper
  60228. * in {@link module:engine/conversion/downcasthelpers~DowncastHelpers#add}.
  60229. */
  60230. getDispatcherForLinkedImage() {
  60231. return dispatcher => {
  60232. dispatcher.on( 'attribute:linkHref:image', ( evt, data, conversionApi ) => {
  60233. const viewFigure = conversionApi.mapper.toViewElement( data.item );
  60234. const linkInImage = Array.from( viewFigure.getChildren() ).find( child => child.name === 'a' );
  60235. for ( const item of this._definitions ) {
  60236. const attributes = Object(ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_0__["toMap"])( item.attributes );
  60237. if ( item.callback( data.attributeNewValue ) ) {
  60238. for ( const [ key, val ] of attributes ) {
  60239. if ( key === 'class' ) {
  60240. conversionApi.writer.addClass( val, linkInImage );
  60241. } else {
  60242. conversionApi.writer.setAttribute( key, val, linkInImage );
  60243. }
  60244. }
  60245. } else {
  60246. for ( const [ key, val ] of attributes ) {
  60247. if ( key === 'class' ) {
  60248. conversionApi.writer.removeClass( val, linkInImage );
  60249. } else {
  60250. conversionApi.writer.removeAttribute( key, linkInImage );
  60251. }
  60252. }
  60253. }
  60254. }
  60255. } );
  60256. };
  60257. }
  60258. }
  60259. /***/ }),
  60260. /***/ "./node_modules/@ckeditor/ckeditor5-link/src/utils/manualdecorator.js":
  60261. /*!****************************************************************************!*\
  60262. !*** ./node_modules/@ckeditor/ckeditor5-link/src/utils/manualdecorator.js ***!
  60263. \****************************************************************************/
  60264. /*! exports provided: default */
  60265. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  60266. "use strict";
  60267. __webpack_require__.r(__webpack_exports__);
  60268. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ManualDecorator; });
  60269. /* harmony import */ var ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/utils */ "./node_modules/ckeditor5/src/utils.js");
  60270. /**
  60271. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  60272. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  60273. */
  60274. /**
  60275. * @module link/utils
  60276. */
  60277. /**
  60278. * Helper class that stores manual decorators with observable {@link module:link/utils~ManualDecorator#value}
  60279. * to support integration with the UI state. An instance of this class is a model with the state of individual manual decorators.
  60280. * These decorators are kept as collections in {@link module:link/linkcommand~LinkCommand#manualDecorators}.
  60281. *
  60282. * @mixes module:utils/observablemixin~ObservableMixin
  60283. */
  60284. class ManualDecorator {
  60285. /**
  60286. * Creates a new instance of {@link module:link/utils~ManualDecorator}.
  60287. *
  60288. * @param {Object} config
  60289. * @param {String} config.id The name of the attribute used in the model that represents a given manual decorator.
  60290. * For example: `'linkIsExternal'`.
  60291. * @param {String} config.label The label used in the user interface to toggle the manual decorator.
  60292. * @param {Object} config.attributes A set of attributes added to output data when the decorator is active for a specific link.
  60293. * Attributes should keep the format of attributes defined in {@link module:engine/view/elementdefinition~ElementDefinition}.
  60294. * @param {Boolean} [config.defaultValue] Controls whether the decorator is "on" by default.
  60295. */
  60296. constructor( { id, label, attributes, defaultValue } ) {
  60297. /**
  60298. * An ID of a manual decorator which is the name of the attribute in the model, for example: 'linkManualDecorator0'.
  60299. *
  60300. * @type {String}
  60301. */
  60302. this.id = id;
  60303. /**
  60304. * The value of the current manual decorator. It reflects its state from the UI.
  60305. *
  60306. * @observable
  60307. * @member {Boolean} module:link/utils~ManualDecorator#value
  60308. */
  60309. this.set( 'value' );
  60310. /**
  60311. * The default value of manual decorator.
  60312. *
  60313. * @type {Boolean}
  60314. */
  60315. this.defaultValue = defaultValue;
  60316. /**
  60317. * The label used in the user interface to toggle the manual decorator.
  60318. *
  60319. * @type {String}
  60320. */
  60321. this.label = label;
  60322. /**
  60323. * A set of attributes added to downcasted data when the decorator is activated for a specific link.
  60324. * Attributes should be added in a form of attributes defined in {@link module:engine/view/elementdefinition~ElementDefinition}.
  60325. *
  60326. * @type {Object}
  60327. */
  60328. this.attributes = attributes;
  60329. }
  60330. }
  60331. Object(ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_0__["mix"])( ManualDecorator, ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_0__["ObservableMixin"] );
  60332. /***/ }),
  60333. /***/ "./node_modules/@ckeditor/ckeditor5-link/theme/icons/link.svg":
  60334. /*!********************************************************************!*\
  60335. !*** ./node_modules/@ckeditor/ckeditor5-link/theme/icons/link.svg ***!
  60336. \********************************************************************/
  60337. /*! exports provided: default */
  60338. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  60339. "use strict";
  60340. __webpack_require__.r(__webpack_exports__);
  60341. /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"m11.077 15 .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>");
  60342. /***/ }),
  60343. /***/ "./node_modules/@ckeditor/ckeditor5-link/theme/icons/unlink.svg":
  60344. /*!**********************************************************************!*\
  60345. !*** ./node_modules/@ckeditor/ckeditor5-link/theme/icons/unlink.svg ***!
  60346. \**********************************************************************/
  60347. /*! exports provided: default */
  60348. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  60349. "use strict";
  60350. __webpack_require__.r(__webpack_exports__);
  60351. /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"m11.077 15 .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.562-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>");
  60352. /***/ }),
  60353. /***/ "./node_modules/@ckeditor/ckeditor5-link/theme/link.css":
  60354. /*!**************************************************************!*\
  60355. !*** ./node_modules/@ckeditor/ckeditor5-link/theme/link.css ***!
  60356. \**************************************************************/
  60357. /*! no static exports found */
  60358. /***/ (function(module, exports, __webpack_require__) {
  60359. var api = __webpack_require__(/*! ../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  60360. 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");
  60361. content = content.__esModule ? content.default : content;
  60362. if (typeof content === 'string') {
  60363. content = [[module.i, content, '']];
  60364. }
  60365. var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
  60366. options.insert = "head";
  60367. options.singleton = true;
  60368. var update = api(content, options);
  60369. module.exports = content.locals || {};
  60370. /***/ }),
  60371. /***/ "./node_modules/@ckeditor/ckeditor5-link/theme/linkactions.css":
  60372. /*!*********************************************************************!*\
  60373. !*** ./node_modules/@ckeditor/ckeditor5-link/theme/linkactions.css ***!
  60374. \*********************************************************************/
  60375. /*! no static exports found */
  60376. /***/ (function(module, exports, __webpack_require__) {
  60377. var api = __webpack_require__(/*! ../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  60378. 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");
  60379. content = content.__esModule ? content.default : content;
  60380. if (typeof content === 'string') {
  60381. content = [[module.i, content, '']];
  60382. }
  60383. var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
  60384. options.insert = "head";
  60385. options.singleton = true;
  60386. var update = api(content, options);
  60387. module.exports = content.locals || {};
  60388. /***/ }),
  60389. /***/ "./node_modules/@ckeditor/ckeditor5-link/theme/linkform.css":
  60390. /*!******************************************************************!*\
  60391. !*** ./node_modules/@ckeditor/ckeditor5-link/theme/linkform.css ***!
  60392. \******************************************************************/
  60393. /*! no static exports found */
  60394. /***/ (function(module, exports, __webpack_require__) {
  60395. var api = __webpack_require__(/*! ../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  60396. 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");
  60397. content = content.__esModule ? content.default : content;
  60398. if (typeof content === 'string') {
  60399. content = [[module.i, content, '']];
  60400. }
  60401. var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
  60402. options.insert = "head";
  60403. options.singleton = true;
  60404. var update = api(content, options);
  60405. module.exports = content.locals || {};
  60406. /***/ }),
  60407. /***/ "./node_modules/@ckeditor/ckeditor5-link/theme/linkimage.css":
  60408. /*!*******************************************************************!*\
  60409. !*** ./node_modules/@ckeditor/ckeditor5-link/theme/linkimage.css ***!
  60410. \*******************************************************************/
  60411. /*! no static exports found */
  60412. /***/ (function(module, exports, __webpack_require__) {
  60413. var api = __webpack_require__(/*! ../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  60414. 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");
  60415. content = content.__esModule ? content.default : content;
  60416. if (typeof content === 'string') {
  60417. content = [[module.i, content, '']];
  60418. }
  60419. var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
  60420. options.insert = "head";
  60421. options.singleton = true;
  60422. var update = api(content, options);
  60423. module.exports = content.locals || {};
  60424. /***/ }),
  60425. /***/ "./node_modules/@ckeditor/ckeditor5-list/src/converters.js":
  60426. /*!*****************************************************************!*\
  60427. !*** ./node_modules/@ckeditor/ckeditor5-list/src/converters.js ***!
  60428. \*****************************************************************/
  60429. /*! exports provided: modelViewInsertion, modelViewRemove, modelViewChangeType, modelViewMergeAfterChangeType, modelViewChangeIndent, modelViewSplitOnInsert, modelViewMergeAfter, viewModelConverter, cleanList, cleanListItem, modelToViewPosition, viewToModelPosition, modelChangePostFixer, modelIndentPasteFixer */
  60430. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  60431. "use strict";
  60432. __webpack_require__.r(__webpack_exports__);
  60433. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "modelViewInsertion", function() { return modelViewInsertion; });
  60434. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "modelViewRemove", function() { return modelViewRemove; });
  60435. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "modelViewChangeType", function() { return modelViewChangeType; });
  60436. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "modelViewMergeAfterChangeType", function() { return modelViewMergeAfterChangeType; });
  60437. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "modelViewChangeIndent", function() { return modelViewChangeIndent; });
  60438. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "modelViewSplitOnInsert", function() { return modelViewSplitOnInsert; });
  60439. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "modelViewMergeAfter", function() { return modelViewMergeAfter; });
  60440. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "viewModelConverter", function() { return viewModelConverter; });
  60441. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "cleanList", function() { return cleanList; });
  60442. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "cleanListItem", function() { return cleanListItem; });
  60443. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "modelToViewPosition", function() { return modelToViewPosition; });
  60444. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "viewToModelPosition", function() { return viewToModelPosition; });
  60445. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "modelChangePostFixer", function() { return modelChangePostFixer; });
  60446. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "modelIndentPasteFixer", function() { return modelIndentPasteFixer; });
  60447. /* harmony import */ var ckeditor5_src_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/engine */ "./node_modules/ckeditor5/src/engine.js");
  60448. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./utils */ "./node_modules/@ckeditor/ckeditor5-list/src/utils.js");
  60449. /**
  60450. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  60451. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  60452. */
  60453. /**
  60454. * @module list/converters
  60455. */
  60456. /**
  60457. * A model-to-view converter for the `listItem` model element insertion.
  60458. *
  60459. * It creates a `<ul><li></li><ul>` (or `<ol>`) view structure out of a `listItem` model element, inserts it at the correct
  60460. * position, and merges the list with surrounding lists (if available).
  60461. *
  60462. * @see module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:insert
  60463. * @param {module:engine/model/model~Model} model Model instance.
  60464. * @returns {Function} Returns a conversion callback.
  60465. */
  60466. function modelViewInsertion( model ) {
  60467. return ( evt, data, conversionApi ) => {
  60468. const consumable = conversionApi.consumable;
  60469. if ( !consumable.test( data.item, 'insert' ) ||
  60470. !consumable.test( data.item, 'attribute:listType' ) ||
  60471. !consumable.test( data.item, 'attribute:listIndent' )
  60472. ) {
  60473. return;
  60474. }
  60475. consumable.consume( data.item, 'insert' );
  60476. consumable.consume( data.item, 'attribute:listType' );
  60477. consumable.consume( data.item, 'attribute:listIndent' );
  60478. const modelItem = data.item;
  60479. const viewItem = Object(_utils__WEBPACK_IMPORTED_MODULE_1__["generateLiInUl"])( modelItem, conversionApi );
  60480. Object(_utils__WEBPACK_IMPORTED_MODULE_1__["injectViewList"])( modelItem, viewItem, conversionApi, model );
  60481. };
  60482. }
  60483. /**
  60484. * A model-to-view converter for the `listItem` model element removal.
  60485. *
  60486. * @see module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:remove
  60487. * @param {module:engine/model/model~Model} model Model instance.
  60488. * @returns {Function} Returns a conversion callback.
  60489. */
  60490. function modelViewRemove( model ) {
  60491. return ( evt, data, conversionApi ) => {
  60492. const viewPosition = conversionApi.mapper.toViewPosition( data.position );
  60493. const viewStart = viewPosition.getLastMatchingPosition( value => !value.item.is( 'element', 'li' ) );
  60494. const viewItem = viewStart.nodeAfter;
  60495. const viewWriter = conversionApi.writer;
  60496. // 1. Break the container after and before the list item.
  60497. // This will create a view list with one view list item - the one to remove.
  60498. viewWriter.breakContainer( viewWriter.createPositionBefore( viewItem ) );
  60499. viewWriter.breakContainer( viewWriter.createPositionAfter( viewItem ) );
  60500. // 2. Remove the list with the item to remove.
  60501. const viewList = viewItem.parent;
  60502. const viewListPrev = viewList.previousSibling;
  60503. const removeRange = viewWriter.createRangeOn( viewList );
  60504. const removed = viewWriter.remove( removeRange );
  60505. // 3. Merge the whole created by breaking and removing the list.
  60506. if ( viewListPrev && viewListPrev.nextSibling ) {
  60507. Object(_utils__WEBPACK_IMPORTED_MODULE_1__["mergeViewLists"])( viewWriter, viewListPrev, viewListPrev.nextSibling );
  60508. }
  60509. // 4. Bring back nested list that was in the removed <li>.
  60510. const modelItem = conversionApi.mapper.toModelElement( viewItem );
  60511. hoistNestedLists( modelItem.getAttribute( 'listIndent' ) + 1, data.position, removeRange.start, viewItem, conversionApi, model );
  60512. // 5. Unbind removed view item and all children.
  60513. for ( const child of viewWriter.createRangeIn( removed ).getItems() ) {
  60514. conversionApi.mapper.unbindViewElement( child );
  60515. }
  60516. evt.stop();
  60517. };
  60518. }
  60519. /**
  60520. * A model-to-view converter for the `type` attribute change on the `listItem` model element.
  60521. *
  60522. * This change means that the `<li>` element parent changes from `<ul>` to `<ol>` (or vice versa). This is accomplished
  60523. * by breaking view elements and changing their name. The next {@link module:list/converters~modelViewMergeAfterChangeType}
  60524. * converter will attempt to merge split nodes.
  60525. *
  60526. * Splitting this conversion into 2 steps makes it possible to add an additional conversion in the middle.
  60527. * Check {@link module:list/todolistconverters~modelViewChangeType} to see an example of it.
  60528. *
  60529. * @see module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:attribute
  60530. * @param {module:utils/eventinfo~EventInfo} evt An object containing information about the fired event.
  60531. * @param {Object} data Additional information about the change.
  60532. * @param {module:engine/conversion/downcastdispatcher~DowncastConversionApi} conversionApi Conversion interface.
  60533. */
  60534. function modelViewChangeType( evt, data, conversionApi ) {
  60535. if ( !conversionApi.consumable.consume( data.item, 'attribute:listType' ) ) {
  60536. return;
  60537. }
  60538. const viewItem = conversionApi.mapper.toViewElement( data.item );
  60539. const viewWriter = conversionApi.writer;
  60540. // Break the container after and before the list item.
  60541. // This will create a view list with one view list item -- the one that changed type.
  60542. viewWriter.breakContainer( viewWriter.createPositionBefore( viewItem ) );
  60543. viewWriter.breakContainer( viewWriter.createPositionAfter( viewItem ) );
  60544. // Change name of the view list that holds the changed view item.
  60545. // We cannot just change name property, because that would not render properly.
  60546. const viewList = viewItem.parent;
  60547. const listName = data.attributeNewValue == 'numbered' ? 'ol' : 'ul';
  60548. viewWriter.rename( listName, viewList );
  60549. }
  60550. /**
  60551. * A model-to-view converter that attempts to merge nodes split by {@link module:list/converters~modelViewChangeType}.
  60552. *
  60553. * @see module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:attribute
  60554. * @param {module:utils/eventinfo~EventInfo} evt An object containing information about the fired event.
  60555. * @param {Object} data Additional information about the change.
  60556. * @param {module:engine/conversion/downcastdispatcher~DowncastConversionApi} conversionApi Conversion interface.
  60557. */
  60558. function modelViewMergeAfterChangeType( evt, data, conversionApi ) {
  60559. const viewItem = conversionApi.mapper.toViewElement( data.item );
  60560. const viewList = viewItem.parent;
  60561. const viewWriter = conversionApi.writer;
  60562. // Merge the changed view list with other lists, if possible.
  60563. Object(_utils__WEBPACK_IMPORTED_MODULE_1__["mergeViewLists"])( viewWriter, viewList, viewList.nextSibling );
  60564. Object(_utils__WEBPACK_IMPORTED_MODULE_1__["mergeViewLists"])( viewWriter, viewList.previousSibling, viewList );
  60565. // Consumable insertion of children inside the item. They are already handled by re-building the item in view.
  60566. for ( const child of data.item.getChildren() ) {
  60567. conversionApi.consumable.consume( child, 'insert' );
  60568. }
  60569. }
  60570. /**
  60571. * A model-to-view converter for the `listIndent` attribute change on the `listItem` model element.
  60572. *
  60573. * @see module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:attribute
  60574. * @param {module:engine/model/model~Model} model Model instance.
  60575. * @returns {Function} Returns a conversion callback.
  60576. */
  60577. function modelViewChangeIndent( model ) {
  60578. return ( evt, data, conversionApi ) => {
  60579. if ( !conversionApi.consumable.consume( data.item, 'attribute:listIndent' ) ) {
  60580. return;
  60581. }
  60582. const viewItem = conversionApi.mapper.toViewElement( data.item );
  60583. const viewWriter = conversionApi.writer;
  60584. // 1. Break the container after and before the list item.
  60585. // This will create a view list with one view list item -- the one that changed type.
  60586. viewWriter.breakContainer( viewWriter.createPositionBefore( viewItem ) );
  60587. viewWriter.breakContainer( viewWriter.createPositionAfter( viewItem ) );
  60588. // 2. Extract view list with changed view list item and merge "hole" possibly created by breaking and removing elements.
  60589. const viewList = viewItem.parent;
  60590. const viewListPrev = viewList.previousSibling;
  60591. const removeRange = viewWriter.createRangeOn( viewList );
  60592. viewWriter.remove( removeRange );
  60593. if ( viewListPrev && viewListPrev.nextSibling ) {
  60594. Object(_utils__WEBPACK_IMPORTED_MODULE_1__["mergeViewLists"])( viewWriter, viewListPrev, viewListPrev.nextSibling );
  60595. }
  60596. // 3. Bring back nested list that was in the removed <li>.
  60597. hoistNestedLists( data.attributeOldValue + 1, data.range.start, removeRange.start, viewItem, conversionApi, model );
  60598. // 4. Inject view list like it is newly inserted.
  60599. Object(_utils__WEBPACK_IMPORTED_MODULE_1__["injectViewList"])( data.item, viewItem, conversionApi, model );
  60600. // 5. Consume insertion of children inside the item. They are already handled by re-building the item in view.
  60601. for ( const child of data.item.getChildren() ) {
  60602. conversionApi.consumable.consume( child, 'insert' );
  60603. }
  60604. };
  60605. }
  60606. /**
  60607. * A special model-to-view converter introduced by the {@link module:list/list~List list feature}. This converter is fired for
  60608. * insert change of every model item, and should be fired before the actual converter. The converter checks whether the inserted
  60609. * model item is a non-`listItem` element. If it is, and it is inserted inside a view list, the converter breaks the
  60610. * list so the model element is inserted to the view parent element corresponding to its model parent element.
  60611. *
  60612. * The converter prevents such situations:
  60613. *
  60614. * // Model: // View:
  60615. * <listItem>foo</listItem> <ul>
  60616. * <listItem>bar</listItem> <li>foo</li>
  60617. * <li>bar</li>
  60618. * </ul>
  60619. *
  60620. * // After change: // Correct view guaranteed by this converter:
  60621. * <listItem>foo</listItem> <ul><li>foo</li></ul><p>xxx</p><ul><li>bar</li></ul>
  60622. * <paragraph>xxx</paragraph> // Instead of this wrong view state:
  60623. * <listItem>bar</listItem> <ul><li>foo</li><p>xxx</p><li>bar</li></ul>
  60624. *
  60625. * @see module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:insert
  60626. * @param {module:utils/eventinfo~EventInfo} evt An object containing information about the fired event.
  60627. * @param {Object} data Additional information about the change.
  60628. * @param {module:engine/conversion/downcastdispatcher~DowncastConversionApi} conversionApi Conversion interface.
  60629. */
  60630. function modelViewSplitOnInsert( evt, data, conversionApi ) {
  60631. if ( data.item.name != 'listItem' ) {
  60632. let viewPosition = conversionApi.mapper.toViewPosition( data.range.start );
  60633. const viewWriter = conversionApi.writer;
  60634. const lists = [];
  60635. // Break multiple ULs/OLs if there are.
  60636. //
  60637. // Imagine following list:
  60638. //
  60639. // 1 --------
  60640. // 1.1 --------
  60641. // 1.1.1 --------
  60642. // 1.1.2 --------
  60643. // 1.1.3 --------
  60644. // 1.1.3.1 --------
  60645. // 1.2 --------
  60646. // 1.2.1 --------
  60647. // 2 --------
  60648. //
  60649. // Insert paragraph after item 1.1.1:
  60650. //
  60651. // 1 --------
  60652. // 1.1 --------
  60653. // 1.1.1 --------
  60654. //
  60655. // Lorem ipsum.
  60656. //
  60657. // 1.1.2 --------
  60658. // 1.1.3 --------
  60659. // 1.1.3.1 --------
  60660. // 1.2 --------
  60661. // 1.2.1 --------
  60662. // 2 --------
  60663. //
  60664. // In this case 1.1.2 has to become beginning of a new list.
  60665. // We need to break list before 1.1.2 (obvious), then we need to break list also before 1.2.
  60666. // Then we need to move those broken pieces one after another and merge:
  60667. //
  60668. // 1 --------
  60669. // 1.1 --------
  60670. // 1.1.1 --------
  60671. //
  60672. // Lorem ipsum.
  60673. //
  60674. // 1.1.2 --------
  60675. // 1.1.3 --------
  60676. // 1.1.3.1 --------
  60677. // 1.2 --------
  60678. // 1.2.1 --------
  60679. // 2 --------
  60680. //
  60681. while ( viewPosition.parent.name == 'ul' || viewPosition.parent.name == 'ol' ) {
  60682. viewPosition = viewWriter.breakContainer( viewPosition );
  60683. if ( viewPosition.parent.name != 'li' ) {
  60684. break;
  60685. }
  60686. // Remove lists that are after inserted element.
  60687. // They will be brought back later, below the inserted element.
  60688. const removeStart = viewPosition;
  60689. const removeEnd = viewWriter.createPositionAt( viewPosition.parent, 'end' );
  60690. // Don't remove if there is nothing to remove.
  60691. if ( !removeStart.isEqual( removeEnd ) ) {
  60692. const removed = viewWriter.remove( viewWriter.createRange( removeStart, removeEnd ) );
  60693. lists.push( removed );
  60694. }
  60695. viewPosition = viewWriter.createPositionAfter( viewPosition.parent );
  60696. }
  60697. // Bring back removed lists.
  60698. if ( lists.length > 0 ) {
  60699. for ( let i = 0; i < lists.length; i++ ) {
  60700. const previousList = viewPosition.nodeBefore;
  60701. const insertedRange = viewWriter.insert( viewPosition, lists[ i ] );
  60702. viewPosition = insertedRange.end;
  60703. // Don't merge first list! We want a split in that place (this is why this converter is introduced).
  60704. if ( i > 0 ) {
  60705. const mergePos = Object(_utils__WEBPACK_IMPORTED_MODULE_1__["mergeViewLists"])( viewWriter, previousList, previousList.nextSibling );
  60706. // If `mergePos` is in `previousList` it means that the lists got merged.
  60707. // In this case, we need to fix insert position.
  60708. if ( mergePos && mergePos.parent == previousList ) {
  60709. viewPosition.offset--;
  60710. }
  60711. }
  60712. }
  60713. // Merge last inserted list with element after it.
  60714. Object(_utils__WEBPACK_IMPORTED_MODULE_1__["mergeViewLists"])( viewWriter, viewPosition.nodeBefore, viewPosition.nodeAfter );
  60715. }
  60716. }
  60717. }
  60718. /**
  60719. * A special model-to-view converter introduced by the {@link module:list/list~List list feature}. This converter takes care of
  60720. * merging view lists after something is removed or moved from near them.
  60721. *
  60722. * Example:
  60723. *
  60724. * // Model: // View:
  60725. * <listItem>foo</listItem> <ul><li>foo</li></ul>
  60726. * <paragraph>xxx</paragraph> <p>xxx</p>
  60727. * <listItem>bar</listItem> <ul><li>bar</li></ul>
  60728. *
  60729. * // After change: // Correct view guaranteed by this converter:
  60730. * <listItem>foo</listItem> <ul>
  60731. * <listItem>bar</listItem> <li>foo</li>
  60732. * <li>bar</li>
  60733. * </ul>
  60734. *
  60735. * @see module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:remove
  60736. * @param {module:utils/eventinfo~EventInfo} evt An object containing information about the fired event.
  60737. * @param {Object} data Additional information about the change.
  60738. * @param {module:engine/conversion/downcastdispatcher~DowncastConversionApi} conversionApi Conversion interface.
  60739. */
  60740. function modelViewMergeAfter( evt, data, conversionApi ) {
  60741. const viewPosition = conversionApi.mapper.toViewPosition( data.position );
  60742. const viewItemPrev = viewPosition.nodeBefore;
  60743. const viewItemNext = viewPosition.nodeAfter;
  60744. // Merge lists if something (remove, move) was done from inside of list.
  60745. // Merging will be done only if both items are view lists of the same type.
  60746. // The check is done inside the helper function.
  60747. Object(_utils__WEBPACK_IMPORTED_MODULE_1__["mergeViewLists"])( conversionApi.writer, viewItemPrev, viewItemNext );
  60748. }
  60749. /**
  60750. * A view-to-model converter that converts the `<li>` view elements into the `listItem` model elements.
  60751. *
  60752. * To set correct values of the `listType` and `listIndent` attributes the converter:
  60753. * * checks `<li>`'s parent,
  60754. * * stores and increases the `conversionApi.store.indent` value when `<li>`'s sub-items are converted.
  60755. *
  60756. * @see module:engine/conversion/upcastdispatcher~UpcastDispatcher#event:element
  60757. * @param {module:utils/eventinfo~EventInfo} evt An object containing information about the fired event.
  60758. * @param {Object} data An object containing conversion input and a placeholder for conversion output and possibly other values.
  60759. * @param {module:engine/conversion/upcastdispatcher~UpcastConversionApi} conversionApi Conversion interface to be used by the callback.
  60760. */
  60761. function viewModelConverter( evt, data, conversionApi ) {
  60762. if ( conversionApi.consumable.consume( data.viewItem, { name: true } ) ) {
  60763. const writer = conversionApi.writer;
  60764. // 1. Create `listItem` model element.
  60765. const listItem = writer.createElement( 'listItem' );
  60766. // 2. Handle `listItem` model element attributes.
  60767. const indent = getIndent( data.viewItem );
  60768. writer.setAttribute( 'listIndent', indent, listItem );
  60769. // Set 'bulleted' as default. If this item is pasted into a context,
  60770. const type = data.viewItem.parent && data.viewItem.parent.name == 'ol' ? 'numbered' : 'bulleted';
  60771. writer.setAttribute( 'listType', type, listItem );
  60772. if ( !conversionApi.safeInsert( listItem, data.modelCursor ) ) {
  60773. return;
  60774. }
  60775. const nextPosition = viewToModelListItemChildrenConverter( listItem, data.viewItem.getChildren(), conversionApi );
  60776. // Result range starts before the first item and ends after the last.
  60777. data.modelRange = writer.createRange( data.modelCursor, nextPosition );
  60778. conversionApi.updateConversionResult( listItem, data );
  60779. }
  60780. }
  60781. /**
  60782. * A view-to-model converter for the `<ul>` and `<ol>` view elements that cleans the input view of garbage.
  60783. * This is mostly to clean whitespaces from between the `<li>` view elements inside the view list element, however, also
  60784. * incorrect data can be cleared if the view was incorrect.
  60785. *
  60786. * @see module:engine/conversion/upcastdispatcher~UpcastDispatcher#event:element
  60787. * @param {module:utils/eventinfo~EventInfo} evt An object containing information about the fired event.
  60788. * @param {Object} data An object containing conversion input and a placeholder for conversion output and possibly other values.
  60789. * @param {module:engine/conversion/upcastdispatcher~UpcastConversionApi} conversionApi Conversion interface to be used by the callback.
  60790. */
  60791. function cleanList( evt, data, conversionApi ) {
  60792. if ( conversionApi.consumable.test( data.viewItem, { name: true } ) ) {
  60793. // Caching children because when we start removing them iterating fails.
  60794. const children = Array.from( data.viewItem.getChildren() );
  60795. for ( const child of children ) {
  60796. const isWrongElement = !( child.is( 'element', 'li' ) || isList( child ) );
  60797. if ( isWrongElement ) {
  60798. child._remove();
  60799. }
  60800. }
  60801. }
  60802. }
  60803. /**
  60804. * A view-to-model converter for the `<li>` elements that cleans whitespace formatting from the input view.
  60805. *
  60806. * @see module:engine/conversion/upcastdispatcher~UpcastDispatcher#event:element
  60807. * @param {module:utils/eventinfo~EventInfo} evt An object containing information about the fired event.
  60808. * @param {Object} data An object containing conversion input and a placeholder for conversion output and possibly other values.
  60809. * @param {module:engine/conversion/upcastdispatcher~UpcastConversionApi} conversionApi Conversion interface to be used by the callback.
  60810. */
  60811. function cleanListItem( evt, data, conversionApi ) {
  60812. if ( conversionApi.consumable.test( data.viewItem, { name: true } ) ) {
  60813. if ( data.viewItem.childCount === 0 ) {
  60814. return;
  60815. }
  60816. const children = [ ...data.viewItem.getChildren() ];
  60817. let foundList = false;
  60818. let firstNode = true;
  60819. for ( const child of children ) {
  60820. if ( foundList && !isList( child ) ) {
  60821. child._remove();
  60822. }
  60823. if ( child.is( '$text' ) ) {
  60824. // If this is the first node and it's a text node, left-trim it.
  60825. if ( firstNode ) {
  60826. child._data = child.data.trimStart();
  60827. }
  60828. // If this is the last text node before <ul> or <ol>, right-trim it.
  60829. if ( !child.nextSibling || isList( child.nextSibling ) ) {
  60830. child._data = child.data.trimEnd();
  60831. }
  60832. } else if ( isList( child ) ) {
  60833. // If this is a <ul> or <ol>, do not process it, just mark that we already visited list element.
  60834. foundList = true;
  60835. }
  60836. firstNode = false;
  60837. }
  60838. }
  60839. }
  60840. /**
  60841. * Returns a callback for model position to view position mapping for {@link module:engine/conversion/mapper~Mapper}. The callback fixes
  60842. * positions between the `listItem` elements that would be incorrectly mapped because of how list items are represented in the model
  60843. * and in the view.
  60844. *
  60845. * @see module:engine/conversion/mapper~Mapper#event:modelToViewPosition
  60846. * @param {module:engine/view/view~View} view A view instance.
  60847. * @returns {Function}
  60848. */
  60849. function modelToViewPosition( view ) {
  60850. return ( evt, data ) => {
  60851. if ( data.isPhantom ) {
  60852. return;
  60853. }
  60854. const modelItem = data.modelPosition.nodeBefore;
  60855. if ( modelItem && modelItem.is( 'element', 'listItem' ) ) {
  60856. const viewItem = data.mapper.toViewElement( modelItem );
  60857. const topmostViewList = viewItem.getAncestors().find( isList );
  60858. const walker = view.createPositionAt( viewItem, 0 ).getWalker();
  60859. for ( const value of walker ) {
  60860. if ( value.type == 'elementStart' && value.item.is( 'element', 'li' ) ) {
  60861. data.viewPosition = value.previousPosition;
  60862. break;
  60863. } else if ( value.type == 'elementEnd' && value.item == topmostViewList ) {
  60864. data.viewPosition = value.nextPosition;
  60865. break;
  60866. }
  60867. }
  60868. }
  60869. };
  60870. }
  60871. /**
  60872. * The callback for view position to model position mapping for {@link module:engine/conversion/mapper~Mapper}. The callback fixes
  60873. * positions between the `<li>` elements that would be incorrectly mapped because of how list items are represented in the model
  60874. * and in the view.
  60875. *
  60876. * @see module:engine/conversion/mapper~Mapper#event:viewToModelPosition
  60877. * @param {module:engine/model/model~Model} model Model instance.
  60878. * @returns {Function} Returns a conversion callback.
  60879. */
  60880. function viewToModelPosition( model ) {
  60881. return ( evt, data ) => {
  60882. const viewPos = data.viewPosition;
  60883. const viewParent = viewPos.parent;
  60884. const mapper = data.mapper;
  60885. if ( viewParent.name == 'ul' || viewParent.name == 'ol' ) {
  60886. // Position is directly in <ul> or <ol>.
  60887. if ( !viewPos.isAtEnd ) {
  60888. // If position is not at the end, it must be before <li>.
  60889. // Get that <li>, map it to `listItem` and set model position before that `listItem`.
  60890. const modelNode = mapper.toModelElement( viewPos.nodeAfter );
  60891. data.modelPosition = model.createPositionBefore( modelNode );
  60892. } else {
  60893. // Position is at the end of <ul> or <ol>, so there is no <li> after it to be mapped.
  60894. // There is <li> before the position, but we cannot just map it to `listItem` and set model position after it,
  60895. // because that <li> may contain nested items.
  60896. // We will check "model length" of that <li>, in other words - how many `listItem`s are in that <li>.
  60897. const modelNode = mapper.toModelElement( viewPos.nodeBefore );
  60898. const modelLength = mapper.getModelLength( viewPos.nodeBefore );
  60899. // Then we get model position before mapped `listItem` and shift it accordingly.
  60900. data.modelPosition = model.createPositionBefore( modelNode ).getShiftedBy( modelLength );
  60901. }
  60902. evt.stop();
  60903. } else if (
  60904. viewParent.name == 'li' &&
  60905. viewPos.nodeBefore &&
  60906. ( viewPos.nodeBefore.name == 'ul' || viewPos.nodeBefore.name == 'ol' )
  60907. ) {
  60908. // In most cases when view position is in <li> it is in text and this is a correct position.
  60909. // However, if position is after <ul> or <ol> we have to fix it -- because in model <ul>/<ol> are not in the `listItem`.
  60910. const modelNode = mapper.toModelElement( viewParent );
  60911. // Check all <ul>s and <ol>s that are in the <li> but before mapped position.
  60912. // Get model length of those elements and then add it to the offset of `listItem` mapped to the original <li>.
  60913. let modelLength = 1; // Starts from 1 because the original <li> has to be counted in too.
  60914. let viewList = viewPos.nodeBefore;
  60915. while ( viewList && isList( viewList ) ) {
  60916. modelLength += mapper.getModelLength( viewList );
  60917. viewList = viewList.previousSibling;
  60918. }
  60919. data.modelPosition = model.createPositionBefore( modelNode ).getShiftedBy( modelLength );
  60920. evt.stop();
  60921. }
  60922. };
  60923. }
  60924. /**
  60925. * Post-fixer that reacts to changes on document and fixes incorrect model states.
  60926. *
  60927. * In the example below, there is a correct list structure.
  60928. * Then the middle element is removed so the list structure will become incorrect:
  60929. *
  60930. * <listItem listType="bulleted" listIndent=0>Item 1</listItem>
  60931. * <listItem listType="bulleted" listIndent=1>Item 2</listItem> <--- this is removed.
  60932. * <listItem listType="bulleted" listIndent=2>Item 3</listItem>
  60933. *
  60934. * The list structure after the middle element is removed:
  60935. *
  60936. * <listItem listType="bulleted" listIndent=0>Item 1</listItem>
  60937. * <listItem listType="bulleted" listIndent=2>Item 3</listItem>
  60938. *
  60939. * Should become:
  60940. *
  60941. * <listItem listType="bulleted" listIndent=0>Item 1</listItem>
  60942. * <listItem listType="bulleted" listIndent=1>Item 3</listItem> <--- note that indent got post-fixed.
  60943. *
  60944. * @param {module:engine/model/model~Model} model The data model.
  60945. * @param {module:engine/model/writer~Writer} writer The writer to do changes with.
  60946. * @returns {Boolean} `true` if any change has been applied, `false` otherwise.
  60947. */
  60948. function modelChangePostFixer( model, writer ) {
  60949. const changes = model.document.differ.getChanges();
  60950. const itemToListHead = new Map();
  60951. let applied = false;
  60952. for ( const entry of changes ) {
  60953. if ( entry.type == 'insert' && entry.name == 'listItem' ) {
  60954. _addListToFix( entry.position );
  60955. } else if ( entry.type == 'insert' && entry.name != 'listItem' ) {
  60956. if ( entry.name != '$text' ) {
  60957. // In case of renamed element.
  60958. const item = entry.position.nodeAfter;
  60959. if ( item.hasAttribute( 'listIndent' ) ) {
  60960. writer.removeAttribute( 'listIndent', item );
  60961. applied = true;
  60962. }
  60963. if ( item.hasAttribute( 'listType' ) ) {
  60964. writer.removeAttribute( 'listType', item );
  60965. applied = true;
  60966. }
  60967. if ( item.hasAttribute( 'listStyle' ) ) {
  60968. writer.removeAttribute( 'listStyle', item );
  60969. applied = true;
  60970. }
  60971. for ( const innerItem of Array.from( model.createRangeIn( item ) ).filter( e => e.item.is( 'element', 'listItem' ) ) ) {
  60972. _addListToFix( innerItem.previousPosition );
  60973. }
  60974. }
  60975. const posAfter = entry.position.getShiftedBy( entry.length );
  60976. _addListToFix( posAfter );
  60977. } else if ( entry.type == 'remove' && entry.name == 'listItem' ) {
  60978. _addListToFix( entry.position );
  60979. } else if ( entry.type == 'attribute' && entry.attributeKey == 'listIndent' ) {
  60980. _addListToFix( entry.range.start );
  60981. } else if ( entry.type == 'attribute' && entry.attributeKey == 'listType' ) {
  60982. _addListToFix( entry.range.start );
  60983. }
  60984. }
  60985. for ( const listHead of itemToListHead.values() ) {
  60986. _fixListIndents( listHead );
  60987. _fixListTypes( listHead );
  60988. }
  60989. return applied;
  60990. function _addListToFix( position ) {
  60991. const previousNode = position.nodeBefore;
  60992. if ( !previousNode || !previousNode.is( 'element', 'listItem' ) ) {
  60993. const item = position.nodeAfter;
  60994. if ( item && item.is( 'element', 'listItem' ) ) {
  60995. itemToListHead.set( item, item );
  60996. }
  60997. } else {
  60998. let listHead = previousNode;
  60999. if ( itemToListHead.has( listHead ) ) {
  61000. return;
  61001. }
  61002. for (
  61003. // Cache previousSibling and reuse for performance reasons. See #6581.
  61004. let previousSibling = listHead.previousSibling;
  61005. previousSibling && previousSibling.is( 'element', 'listItem' );
  61006. previousSibling = listHead.previousSibling
  61007. ) {
  61008. listHead = previousSibling;
  61009. if ( itemToListHead.has( listHead ) ) {
  61010. return;
  61011. }
  61012. }
  61013. itemToListHead.set( previousNode, listHead );
  61014. }
  61015. }
  61016. function _fixListIndents( item ) {
  61017. let maxIndent = 0;
  61018. let fixBy = null;
  61019. while ( item && item.is( 'element', 'listItem' ) ) {
  61020. const itemIndent = item.getAttribute( 'listIndent' );
  61021. if ( itemIndent > maxIndent ) {
  61022. let newIndent;
  61023. if ( fixBy === null ) {
  61024. fixBy = itemIndent - maxIndent;
  61025. newIndent = maxIndent;
  61026. } else {
  61027. if ( fixBy > itemIndent ) {
  61028. fixBy = itemIndent;
  61029. }
  61030. newIndent = itemIndent - fixBy;
  61031. }
  61032. writer.setAttribute( 'listIndent', newIndent, item );
  61033. applied = true;
  61034. } else {
  61035. fixBy = null;
  61036. maxIndent = item.getAttribute( 'listIndent' ) + 1;
  61037. }
  61038. item = item.nextSibling;
  61039. }
  61040. }
  61041. function _fixListTypes( item ) {
  61042. let typesStack = [];
  61043. let prev = null;
  61044. while ( item && item.is( 'element', 'listItem' ) ) {
  61045. const itemIndent = item.getAttribute( 'listIndent' );
  61046. if ( prev && prev.getAttribute( 'listIndent' ) > itemIndent ) {
  61047. typesStack = typesStack.slice( 0, itemIndent + 1 );
  61048. }
  61049. if ( itemIndent != 0 ) {
  61050. if ( typesStack[ itemIndent ] ) {
  61051. const type = typesStack[ itemIndent ];
  61052. if ( item.getAttribute( 'listType' ) != type ) {
  61053. writer.setAttribute( 'listType', type, item );
  61054. applied = true;
  61055. }
  61056. } else {
  61057. typesStack[ itemIndent ] = item.getAttribute( 'listType' );
  61058. }
  61059. }
  61060. prev = item;
  61061. item = item.nextSibling;
  61062. }
  61063. }
  61064. }
  61065. /**
  61066. * A fixer for pasted content that includes list items.
  61067. *
  61068. * It fixes indentation of pasted list items so the pasted items match correctly to the context they are pasted into.
  61069. *
  61070. * Example:
  61071. *
  61072. * <listItem listType="bulleted" listIndent=0>A</listItem>
  61073. * <listItem listType="bulleted" listIndent=1>B^</listItem>
  61074. * // At ^ paste: <listItem listType="bulleted" listIndent=4>X</listItem>
  61075. * // <listItem listType="bulleted" listIndent=5>Y</listItem>
  61076. * <listItem listType="bulleted" listIndent=2>C</listItem>
  61077. *
  61078. * Should become:
  61079. *
  61080. * <listItem listType="bulleted" listIndent=0>A</listItem>
  61081. * <listItem listType="bulleted" listIndent=1>BX</listItem>
  61082. * <listItem listType="bulleted" listIndent=2>Y/listItem>
  61083. * <listItem listType="bulleted" listIndent=2>C</listItem>
  61084. *
  61085. * @param {module:utils/eventinfo~EventInfo} evt An object containing information about the fired event.
  61086. * @param {Array} args Arguments of {@link module:engine/model/model~Model#insertContent}.
  61087. */
  61088. function modelIndentPasteFixer( evt, [ content, selectable ] ) {
  61089. // Check whether inserted content starts from a `listItem`. If it does not, it means that there are some other
  61090. // elements before it and there is no need to fix indents, because even if we insert that content into a list,
  61091. // that list will be broken.
  61092. // Note: we also need to handle singular elements because inserting item with indent 0 into 0,1,[],2
  61093. // would create incorrect model.
  61094. let item = content.is( 'documentFragment' ) ? content.getChild( 0 ) : content;
  61095. let selection;
  61096. if ( !selectable ) {
  61097. selection = this.document.selection;
  61098. } else {
  61099. selection = this.createSelection( selectable );
  61100. }
  61101. if ( item && item.is( 'element', 'listItem' ) ) {
  61102. // Get a reference list item. Inserted list items will be fixed according to that item.
  61103. const pos = selection.getFirstPosition();
  61104. let refItem = null;
  61105. if ( pos.parent.is( 'element', 'listItem' ) ) {
  61106. refItem = pos.parent;
  61107. } else if ( pos.nodeBefore && pos.nodeBefore.is( 'element', 'listItem' ) ) {
  61108. refItem = pos.nodeBefore;
  61109. }
  61110. // If there is `refItem` it means that we do insert list items into an existing list.
  61111. if ( refItem ) {
  61112. // First list item in `data` has indent equal to 0 (it is a first list item). It should have indent equal
  61113. // to the indent of reference item. We have to fix the first item and all of it's children and following siblings.
  61114. // Indent of all those items has to be adjusted to reference item.
  61115. const indentChange = refItem.getAttribute( 'listIndent' );
  61116. // Fix only if there is anything to fix.
  61117. if ( indentChange > 0 ) {
  61118. // Adjust indent of all "first" list items in inserted data.
  61119. while ( item && item.is( 'element', 'listItem' ) ) {
  61120. item._setAttribute( 'listIndent', item.getAttribute( 'listIndent' ) + indentChange );
  61121. item = item.nextSibling;
  61122. }
  61123. }
  61124. }
  61125. }
  61126. }
  61127. // Helper function that converts children of a given `<li>` view element into corresponding model elements.
  61128. // The function maintains proper order of elements if model `listItem` is split during the conversion
  61129. // due to block children conversion.
  61130. //
  61131. // @param {module:engine/model/element~Element} listItemModel List item model element to which converted children will be inserted.
  61132. // @param {Iterable.<module:engine/view/node~Node>} viewChildren View elements which will be converted.
  61133. // @param {module:engine/conversion/upcastdispatcher~UpcastConversionApi} conversionApi Conversion interface to be used by the callback.
  61134. // @returns {module:engine/model/position~Position} Position on which next elements should be inserted after children conversion.
  61135. function viewToModelListItemChildrenConverter( listItemModel, viewChildren, conversionApi ) {
  61136. const { writer, schema } = conversionApi;
  61137. // A position after the last inserted `listItem`.
  61138. let nextPosition = writer.createPositionAfter( listItemModel );
  61139. // Check all children of the converted `<li>`. At this point we assume there are no "whitespace" view text nodes
  61140. // in view list, between view list items. This should be handled by `<ul>` and `<ol>` converters.
  61141. for ( const child of viewChildren ) {
  61142. if ( child.name == 'ul' || child.name == 'ol' ) {
  61143. // If the children is a list, we will insert its conversion result after currently handled `listItem`.
  61144. // Then, next insertion position will be set after all the new list items (and maybe other elements if
  61145. // something split list item).
  61146. //
  61147. // If this is a list, we expect that some `listItem`s and possibly other blocks will be inserted, however `.modelCursor`
  61148. // should be set after last `listItem` (or block). This is why it feels safe to use it as `nextPosition`
  61149. nextPosition = conversionApi.convertItem( child, nextPosition ).modelCursor;
  61150. } else {
  61151. // If this is not a list, try inserting content at the end of the currently handled `listItem`.
  61152. const result = conversionApi.convertItem( child, writer.createPositionAt( listItemModel, 'end' ) );
  61153. // It may end up that the current `listItem` becomes split (if that content cannot be inside `listItem`). For example:
  61154. //
  61155. // <li><p>Foo</p></li>
  61156. //
  61157. // will be converted to:
  61158. //
  61159. // <listItem></listItem><paragraph>Foo</paragraph><listItem></listItem>
  61160. //
  61161. const convertedChild = result.modelRange.start.nodeAfter;
  61162. const wasSplit = convertedChild && convertedChild.is( 'element' ) && !schema.checkChild( listItemModel, convertedChild.name );
  61163. if ( wasSplit ) {
  61164. // As `lastListItem` got split, we need to update it to the second part of the split `listItem` element.
  61165. //
  61166. // `modelCursor` should be set to a position where the conversion should continue. There are multiple possible scenarios
  61167. // that may happen. Usually, `modelCursor` (marked as `#` below) would point to the second list item after conversion:
  61168. //
  61169. // `<li><p>Foo</p></li>` -> `<listItem></listItem><paragraph>Foo</paragraph><listItem>#</listItem>`
  61170. //
  61171. // However, in some cases, like auto-paragraphing, the position is placed at the end of the block element:
  61172. //
  61173. // `<li><div>Foo</div></li>` -> `<listItem></listItem><paragraph>Foo#</paragraph><listItem></listItem>`
  61174. //
  61175. // or after an element if another element broken auto-paragraphed element:
  61176. //
  61177. // `<li><div><h2>Foo</h2></div></li>` -> `<listItem></listItem><heading1>Foo</heading1>#<listItem></listItem>`
  61178. //
  61179. // We need to check for such cases and use proper list item and position based on it.
  61180. //
  61181. if ( result.modelCursor.parent.is( 'element', 'listItem' ) ) {
  61182. // (1).
  61183. listItemModel = result.modelCursor.parent;
  61184. } else {
  61185. // (2), (3).
  61186. listItemModel = findNextListItem( result.modelCursor );
  61187. }
  61188. nextPosition = writer.createPositionAfter( listItemModel );
  61189. }
  61190. }
  61191. }
  61192. return nextPosition;
  61193. }
  61194. // Helper function that seeks for a next list item starting from given `startPosition`.
  61195. function findNextListItem( startPosition ) {
  61196. const treeWalker = new ckeditor5_src_engine__WEBPACK_IMPORTED_MODULE_0__["TreeWalker"]( { startPosition } );
  61197. let value;
  61198. do {
  61199. value = treeWalker.next();
  61200. } while ( !value.value.item.is( 'element', 'listItem' ) );
  61201. return value.value.item;
  61202. }
  61203. // Helper function that takes all children of given `viewRemovedItem` and moves them in a correct place, according
  61204. // to other given parameters.
  61205. function hoistNestedLists( nextIndent, modelRemoveStartPosition, viewRemoveStartPosition, viewRemovedItem, conversionApi, model ) {
  61206. // Find correct previous model list item element.
  61207. // The element has to have either same or smaller indent than given reference indent.
  61208. // This will be the model element which will get nested items (if it has smaller indent) or sibling items (if it has same indent).
  61209. // Keep in mind that such element might not be found, if removed item was the first item.
  61210. const prevModelItem = Object(_utils__WEBPACK_IMPORTED_MODULE_1__["getSiblingListItem"])( modelRemoveStartPosition.nodeBefore, {
  61211. sameIndent: true,
  61212. smallerIndent: true,
  61213. listIndent: nextIndent,
  61214. foo: 'b'
  61215. } );
  61216. const mapper = conversionApi.mapper;
  61217. const viewWriter = conversionApi.writer;
  61218. // Indent of found element or `null` if the element has not been found.
  61219. const prevIndent = prevModelItem ? prevModelItem.getAttribute( 'listIndent' ) : null;
  61220. let insertPosition;
  61221. if ( !prevModelItem ) {
  61222. // If element has not been found, simply insert lists at the position where the removed item was:
  61223. //
  61224. // Lorem ipsum.
  61225. // 1 -------- <--- this is removed, no previous list item, put nested items in place of removed item.
  61226. // 1.1 -------- <--- this is reference indent.
  61227. // 1.1.1 --------
  61228. // 1.1.2 --------
  61229. // 1.2 --------
  61230. //
  61231. // Becomes:
  61232. //
  61233. // Lorem ipsum.
  61234. // 1.1 --------
  61235. // 1.1.1 --------
  61236. // 1.1.2 --------
  61237. // 1.2 --------
  61238. insertPosition = viewRemoveStartPosition;
  61239. } else if ( prevIndent == nextIndent ) {
  61240. // If element has been found and has same indent as reference indent it means that nested items should
  61241. // become siblings of found element:
  61242. //
  61243. // 1 --------
  61244. // 1.1 --------
  61245. // 1.2 -------- <--- this is `prevModelItem`.
  61246. // 2 -------- <--- this is removed, previous list item has indent same as reference indent.
  61247. // 2.1 -------- <--- this is reference indent, this and 2.2 should become siblings of 1.2.
  61248. // 2.2 --------
  61249. //
  61250. // Becomes:
  61251. //
  61252. // 1 --------
  61253. // 1.1 --------
  61254. // 1.2 --------
  61255. // 2.1 --------
  61256. // 2.2 --------
  61257. const prevViewList = mapper.toViewElement( prevModelItem ).parent;
  61258. insertPosition = viewWriter.createPositionAfter( prevViewList );
  61259. } else {
  61260. // If element has been found and has smaller indent as reference indent it means that nested items
  61261. // should become nested items of found item:
  61262. //
  61263. // 1 -------- <--- this is `prevModelItem`.
  61264. // 1.1 -------- <--- this is removed, previous list item has indent smaller than reference indent.
  61265. // 1.1.1 -------- <--- this is reference indent, this and 1.1.1 should become nested items of 1.
  61266. // 1.1.2 --------
  61267. // 1.2 --------
  61268. //
  61269. // Becomes:
  61270. //
  61271. // 1 --------
  61272. // 1.1.1 --------
  61273. // 1.1.2 --------
  61274. // 1.2 --------
  61275. //
  61276. // Note: in this case 1.1.1 have indent 2 while 1 have indent 0. In model that should not be possible,
  61277. // because following item may have indent bigger only by one. But this is fixed by postfixer.
  61278. const modelPosition = model.createPositionAt( prevModelItem, 'end' );
  61279. insertPosition = mapper.toViewPosition( modelPosition );
  61280. }
  61281. insertPosition = Object(_utils__WEBPACK_IMPORTED_MODULE_1__["positionAfterUiElements"])( insertPosition );
  61282. // Handle multiple lists. This happens if list item has nested numbered and bulleted lists. Following lists
  61283. // are inserted after the first list (no need to recalculate insertion position for them).
  61284. for ( const child of [ ...viewRemovedItem.getChildren() ] ) {
  61285. if ( isList( child ) ) {
  61286. insertPosition = viewWriter.move( viewWriter.createRangeOn( child ), insertPosition ).end;
  61287. Object(_utils__WEBPACK_IMPORTED_MODULE_1__["mergeViewLists"])( viewWriter, child, child.nextSibling );
  61288. Object(_utils__WEBPACK_IMPORTED_MODULE_1__["mergeViewLists"])( viewWriter, child.previousSibling, child );
  61289. }
  61290. }
  61291. }
  61292. // Checks if view element is a list type (ul or ol).
  61293. //
  61294. // @param {module:engine/view/element~Element} viewElement
  61295. // @returns {Boolean}
  61296. function isList( viewElement ) {
  61297. return viewElement.is( 'element', 'ol' ) || viewElement.is( 'element', 'ul' );
  61298. }
  61299. // Calculates the indent value for a list item. Handles HTML compliant and non-compliant lists.
  61300. //
  61301. // Also, fixes non HTML compliant lists indents:
  61302. //
  61303. // before: fixed list:
  61304. // OL OL
  61305. // |-> LI (parent LIs: 0) |-> LI (indent: 0)
  61306. // |-> OL |-> OL
  61307. // |-> OL |
  61308. // | |-> OL |
  61309. // | |-> OL |
  61310. // | |-> LI (parent LIs: 1) |-> LI (indent: 1)
  61311. // |-> LI (parent LIs: 1) |-> LI (indent: 1)
  61312. //
  61313. // before: fixed list:
  61314. // OL OL
  61315. // |-> OL |
  61316. // |-> OL |
  61317. // |-> OL |
  61318. // |-> LI (parent LIs: 0) |-> LI (indent: 0)
  61319. //
  61320. // before: fixed list:
  61321. // OL OL
  61322. // |-> LI (parent LIs: 0) |-> LI (indent: 0)
  61323. // |-> OL |-> OL
  61324. // |-> LI (parent LIs: 0) |-> LI (indent: 1)
  61325. //
  61326. // @param {module:engine/view/element~Element} listItem
  61327. // @param {Object} conversionStore
  61328. // @returns {Number}
  61329. function getIndent( listItem ) {
  61330. let indent = 0;
  61331. let parent = listItem.parent;
  61332. while ( parent ) {
  61333. // Each LI in the tree will result in an increased indent for HTML compliant lists.
  61334. if ( parent.is( 'element', 'li' ) ) {
  61335. indent++;
  61336. } else {
  61337. // If however the list is nested in other list we should check previous sibling of any of the list elements...
  61338. const previousSibling = parent.previousSibling;
  61339. // ...because the we might need increase its indent:
  61340. // before: fixed list:
  61341. // OL OL
  61342. // |-> LI (parent LIs: 0) |-> LI (indent: 0)
  61343. // |-> OL |-> OL
  61344. // |-> LI (parent LIs: 0) |-> LI (indent: 1)
  61345. if ( previousSibling && previousSibling.is( 'element', 'li' ) ) {
  61346. indent++;
  61347. }
  61348. }
  61349. parent = parent.parent;
  61350. }
  61351. return indent;
  61352. }
  61353. /***/ }),
  61354. /***/ "./node_modules/@ckeditor/ckeditor5-list/src/indentcommand.js":
  61355. /*!********************************************************************!*\
  61356. !*** ./node_modules/@ckeditor/ckeditor5-list/src/indentcommand.js ***!
  61357. \********************************************************************/
  61358. /*! exports provided: default */
  61359. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  61360. "use strict";
  61361. __webpack_require__.r(__webpack_exports__);
  61362. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return IndentCommand; });
  61363. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  61364. /* harmony import */ var ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/utils */ "./node_modules/ckeditor5/src/utils.js");
  61365. /**
  61366. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  61367. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  61368. */
  61369. /**
  61370. * @module list/indentcommand
  61371. */
  61372. /**
  61373. * The list indent command. It is used by the {@link module:list/list~List list feature}.
  61374. *
  61375. * @extends module:core/command~Command
  61376. */
  61377. class IndentCommand extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Command"] {
  61378. /**
  61379. * Creates an instance of the command.
  61380. *
  61381. * @param {module:core/editor/editor~Editor} editor The editor instance.
  61382. * @param {'forward'|'backward'} indentDirection The direction of indent. If it is equal to `backward`, the command
  61383. * will outdent a list item.
  61384. */
  61385. constructor( editor, indentDirection ) {
  61386. super( editor );
  61387. /**
  61388. * Determines by how much the command will change the list item's indent attribute.
  61389. *
  61390. * @readonly
  61391. * @private
  61392. * @member {Number}
  61393. */
  61394. this._indentBy = indentDirection == 'forward' ? 1 : -1;
  61395. }
  61396. /**
  61397. * @inheritDoc
  61398. */
  61399. refresh() {
  61400. this.isEnabled = this._checkEnabled();
  61401. }
  61402. /**
  61403. * Indents or outdents (depending on the {@link #constructor}'s `indentDirection` parameter) selected list items.
  61404. *
  61405. * @fires execute
  61406. * @fires _executeCleanup
  61407. */
  61408. execute() {
  61409. const model = this.editor.model;
  61410. const doc = model.document;
  61411. let itemsToChange = Array.from( doc.selection.getSelectedBlocks() );
  61412. model.change( writer => {
  61413. const lastItem = itemsToChange[ itemsToChange.length - 1 ];
  61414. // Indenting a list item should also indent all the items that are already sub-items of indented item.
  61415. let next = lastItem.nextSibling;
  61416. // Check all items after last indented item, as long as their indent is bigger than indent of that item.
  61417. while ( next && next.name == 'listItem' && next.getAttribute( 'listIndent' ) > lastItem.getAttribute( 'listIndent' ) ) {
  61418. itemsToChange.push( next );
  61419. next = next.nextSibling;
  61420. }
  61421. // We need to be sure to keep model in correct state after each small change, because converters
  61422. // bases on that state and assumes that model is correct.
  61423. // Because of that, if the command outdents items, we will outdent them starting from the last item, as
  61424. // it is safer.
  61425. if ( this._indentBy < 0 ) {
  61426. itemsToChange = itemsToChange.reverse();
  61427. }
  61428. for ( const item of itemsToChange ) {
  61429. const indent = item.getAttribute( 'listIndent' ) + this._indentBy;
  61430. // If indent is lower than 0, it means that the item got outdented when it was not indented.
  61431. // This means that we need to convert that list item to paragraph.
  61432. if ( indent < 0 ) {
  61433. // To keep the model as correct as possible, first rename listItem, then remove attributes,
  61434. // as listItem without attributes is very incorrect and will cause problems in converters.
  61435. // No need to remove attributes, will be removed by post fixer.
  61436. writer.rename( item, 'paragraph' );
  61437. }
  61438. // If indent is >= 0, change the attribute value.
  61439. else {
  61440. writer.setAttribute( 'listIndent', indent, item );
  61441. }
  61442. }
  61443. /**
  61444. * Event fired by the {@link #execute} method.
  61445. *
  61446. * It allows to execute an action after executing the {@link ~IndentCommand#execute} method, for example adjusting
  61447. * attributes of changed list items.
  61448. *
  61449. * @protected
  61450. * @event _executeCleanup
  61451. */
  61452. this.fire( '_executeCleanup', itemsToChange );
  61453. } );
  61454. }
  61455. /**
  61456. * Checks whether the command can be enabled in the current context.
  61457. *
  61458. * @private
  61459. * @returns {Boolean} Whether the command should be enabled.
  61460. */
  61461. _checkEnabled() {
  61462. // Check whether any of position's ancestor is a list item.
  61463. const listItem = Object(ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_1__["first"])( this.editor.model.document.selection.getSelectedBlocks() );
  61464. // If selection is not in a list item, the command is disabled.
  61465. if ( !listItem || !listItem.is( 'element', 'listItem' ) ) {
  61466. return false;
  61467. }
  61468. if ( this._indentBy > 0 ) {
  61469. // Cannot indent first item in it's list. Check if before `listItem` is a list item that is in same list.
  61470. // To be in the same list, the item has to have same attributes and cannot be "split" by an item with lower indent.
  61471. const indent = listItem.getAttribute( 'listIndent' );
  61472. const type = listItem.getAttribute( 'listType' );
  61473. let prev = listItem.previousSibling;
  61474. while ( prev && prev.is( 'element', 'listItem' ) && prev.getAttribute( 'listIndent' ) >= indent ) {
  61475. if ( prev.getAttribute( 'listIndent' ) == indent ) {
  61476. // The item is on the same level.
  61477. // If it has same type, it means that we found a preceding sibling from the same list.
  61478. // If it does not have same type, it means that `listItem` is on different list (this can happen only
  61479. // on top level lists, though).
  61480. return prev.getAttribute( 'listType' ) == type;
  61481. }
  61482. prev = prev.previousSibling;
  61483. }
  61484. // Could not find similar list item, this means that `listItem` is first in its list.
  61485. return false;
  61486. }
  61487. // If we are outdenting it is enough to be in list item. Every list item can always be outdented.
  61488. return true;
  61489. }
  61490. }
  61491. /***/ }),
  61492. /***/ "./node_modules/@ckeditor/ckeditor5-list/src/list.js":
  61493. /*!***********************************************************!*\
  61494. !*** ./node_modules/@ckeditor/ckeditor5-list/src/list.js ***!
  61495. \***********************************************************/
  61496. /*! exports provided: default */
  61497. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  61498. "use strict";
  61499. __webpack_require__.r(__webpack_exports__);
  61500. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return List; });
  61501. /* harmony import */ var _listediting__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./listediting */ "./node_modules/@ckeditor/ckeditor5-list/src/listediting.js");
  61502. /* harmony import */ var _listui__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./listui */ "./node_modules/@ckeditor/ckeditor5-list/src/listui.js");
  61503. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  61504. /**
  61505. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  61506. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  61507. */
  61508. /**
  61509. * @module list/list
  61510. */
  61511. /**
  61512. * The list feature.
  61513. *
  61514. * This is a "glue" plugin that loads the {@link module:list/listediting~ListEditing list editing feature}
  61515. * and {@link module:list/listui~ListUI list UI feature}.
  61516. *
  61517. * @extends module:core/plugin~Plugin
  61518. */
  61519. class List extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_2__["Plugin"] {
  61520. /**
  61521. * @inheritDoc
  61522. */
  61523. static get requires() {
  61524. return [ _listediting__WEBPACK_IMPORTED_MODULE_0__["default"], _listui__WEBPACK_IMPORTED_MODULE_1__["default"] ];
  61525. }
  61526. /**
  61527. * @inheritDoc
  61528. */
  61529. static get pluginName() {
  61530. return 'List';
  61531. }
  61532. }
  61533. /***/ }),
  61534. /***/ "./node_modules/@ckeditor/ckeditor5-list/src/listcommand.js":
  61535. /*!******************************************************************!*\
  61536. !*** ./node_modules/@ckeditor/ckeditor5-list/src/listcommand.js ***!
  61537. \******************************************************************/
  61538. /*! exports provided: default */
  61539. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  61540. "use strict";
  61541. __webpack_require__.r(__webpack_exports__);
  61542. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ListCommand; });
  61543. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  61544. /* harmony import */ var ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/utils */ "./node_modules/ckeditor5/src/utils.js");
  61545. /**
  61546. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  61547. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  61548. */
  61549. /**
  61550. * @module list/listcommand
  61551. */
  61552. /**
  61553. * The list command. It is used by the {@link module:list/list~List list feature}.
  61554. *
  61555. * @extends module:core/command~Command
  61556. */
  61557. class ListCommand extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Command"] {
  61558. /**
  61559. * Creates an instance of the command.
  61560. *
  61561. * @param {module:core/editor/editor~Editor} editor The editor instance.
  61562. * @param {'numbered'|'bulleted'} type List type that will be handled by this command.
  61563. */
  61564. constructor( editor, type ) {
  61565. super( editor );
  61566. /**
  61567. * The type of the list created by the command.
  61568. *
  61569. * @readonly
  61570. * @member {'numbered'|'bulleted'|'todo'}
  61571. */
  61572. this.type = type;
  61573. /**
  61574. * A flag indicating whether the command is active, which means that the selection starts in a list of the same type.
  61575. *
  61576. * @observable
  61577. * @readonly
  61578. * @member {Boolean} #value
  61579. */
  61580. }
  61581. /**
  61582. * @inheritDoc
  61583. */
  61584. refresh() {
  61585. this.value = this._getValue();
  61586. this.isEnabled = this._checkEnabled();
  61587. }
  61588. /**
  61589. * Executes the list command.
  61590. *
  61591. * @fires execute
  61592. * @param {Object} [options] Command options.
  61593. * @param {Boolean} [options.forceValue] If set, it will force the command behavior. If `true`, the command will try to convert the
  61594. * selected items and potentially the neighbor elements to the proper list items. If set to `false` it will convert selected elements
  61595. * to paragraphs. If not set, the command will toggle selected elements to list items or paragraphs, depending on the selection.
  61596. */
  61597. execute( options = {} ) {
  61598. const model = this.editor.model;
  61599. const document = model.document;
  61600. const blocks = Array.from( document.selection.getSelectedBlocks() )
  61601. .filter( block => checkCanBecomeListItem( block, model.schema ) );
  61602. // Whether we are turning off some items.
  61603. const turnOff = options.forceValue !== undefined ? !options.forceValue : this.value;
  61604. // If we are turning off items, we are going to rename them to paragraphs.
  61605. model.change( writer => {
  61606. // If part of a list got turned off, we need to handle (outdent) all of sub-items of the last turned-off item.
  61607. // To be sure that model is all the time in a good state, we first fix items below turned-off item.
  61608. if ( turnOff ) {
  61609. // Start from the model item that is just after the last turned-off item.
  61610. let next = blocks[ blocks.length - 1 ].nextSibling;
  61611. let currentIndent = Number.POSITIVE_INFINITY;
  61612. let changes = [];
  61613. // Correct indent of all items after the last turned off item.
  61614. // Rules that should be followed:
  61615. // 1. All direct sub-items of turned-off item should become indent 0, because the first item after it
  61616. // will be the first item of a new list. Other items are at the same level, so should have same 0 index.
  61617. // 2. All items with indent lower than indent of turned-off item should become indent 0, because they
  61618. // should not end up as a child of any of list items that they were not children of before.
  61619. // 3. All other items should have their indent changed relatively to it's parent.
  61620. //
  61621. // For example:
  61622. // 1 * --------
  61623. // 2 * --------
  61624. // 3 * -------- <-- this is turned off.
  61625. // 4 * -------- <-- this has to become indent = 0, because it will be first item on a new list.
  61626. // 5 * -------- <-- this should be still be a child of item above, so indent = 1.
  61627. // 6 * -------- <-- this has to become indent = 0, because it should not be a child of any of items above.
  61628. // 7 * -------- <-- this should be still be a child of item above, so indent = 1.
  61629. // 8 * -------- <-- this has to become indent = 0.
  61630. // 9 * -------- <-- this should still be a child of item above, so indent = 1.
  61631. // 10 * -------- <-- this should still be a child of item above, so indent = 2.
  61632. // 11 * -------- <-- this should still be at the same level as item above, so indent = 2.
  61633. // 12 * -------- <-- this and all below are left unchanged.
  61634. // 13 * --------
  61635. // 14 * --------
  61636. //
  61637. // After turning off 3 the list becomes:
  61638. //
  61639. // 1 * --------
  61640. // 2 * --------
  61641. //
  61642. // 3 --------
  61643. //
  61644. // 4 * --------
  61645. // 5 * --------
  61646. // 6 * --------
  61647. // 7 * --------
  61648. // 8 * --------
  61649. // 9 * --------
  61650. // 10 * --------
  61651. // 11 * --------
  61652. // 12 * --------
  61653. // 13 * --------
  61654. // 14 * --------
  61655. //
  61656. // Thanks to this algorithm no lists are mismatched and no items get unexpected children/parent, while
  61657. // those parent-child connection which are possible to maintain are still maintained. It's worth noting
  61658. // that this is the same effect that we would be get by multiple use of outdent command. However doing
  61659. // it like this is much more efficient because it's less operation (less memory usage, easier OT) and
  61660. // less conversion (faster).
  61661. while ( next && next.name == 'listItem' && next.getAttribute( 'listIndent' ) !== 0 ) {
  61662. // Check each next list item, as long as its indent is bigger than 0.
  61663. // If the indent is 0 we are not going to change anything anyway.
  61664. const indent = next.getAttribute( 'listIndent' );
  61665. // We check if that's item indent is lower as current relative indent.
  61666. if ( indent < currentIndent ) {
  61667. // If it is, current relative indent becomes that indent.
  61668. currentIndent = indent;
  61669. }
  61670. // Fix indent relatively to current relative indent.
  61671. // Note, that if we just changed the current relative indent, the newIndent will be equal to 0.
  61672. const newIndent = indent - currentIndent;
  61673. // Save the entry in changes array. We do not apply it at the moment, because we will need to
  61674. // reverse the changes so the last item is changed first.
  61675. // This is to keep model in correct state all the time.
  61676. changes.push( { element: next, listIndent: newIndent } );
  61677. // Find next item.
  61678. next = next.nextSibling;
  61679. }
  61680. changes = changes.reverse();
  61681. for ( const item of changes ) {
  61682. writer.setAttribute( 'listIndent', item.listIndent, item.element );
  61683. }
  61684. }
  61685. // If we are turning on, we might change some items that are already `listItem`s but with different type.
  61686. // Changing one nested list item to other type should also trigger changing all its siblings so the
  61687. // whole nested list is of the same type.
  61688. // Example (assume changing to numbered list):
  61689. // * ------ <-- do not fix, top level item
  61690. // * ------ <-- fix, because latter list item of this item's list is changed
  61691. // * ------ <-- do not fix, item is not affected (different list)
  61692. // * ------ <-- fix, because latter list item of this item's list is changed
  61693. // * ------ <-- fix, because latter list item of this item's list is changed
  61694. // * ---[-- <-- already in selection
  61695. // * ------ <-- already in selection
  61696. // * ------ <-- already in selection
  61697. // * ------ <-- already in selection, but does not cause other list items to change because is top-level
  61698. // * ---]-- <-- already in selection
  61699. // * ------ <-- fix, because preceding list item of this item's list is changed
  61700. // * ------ <-- do not fix, item is not affected (different list)
  61701. // * ------ <-- do not fix, top level item
  61702. if ( !turnOff ) {
  61703. // Find lowest indent among selected items. This will be indicator what is the indent of
  61704. // top-most list affected by the command.
  61705. let lowestIndent = Number.POSITIVE_INFINITY;
  61706. for ( const item of blocks ) {
  61707. if ( item.is( 'element', 'listItem' ) && item.getAttribute( 'listIndent' ) < lowestIndent ) {
  61708. lowestIndent = item.getAttribute( 'listIndent' );
  61709. }
  61710. }
  61711. // Do not execute the fix for top-level lists.
  61712. lowestIndent = lowestIndent === 0 ? 1 : lowestIndent;
  61713. // Fix types of list items that are "before" the selected blocks.
  61714. _fixType( blocks, true, lowestIndent );
  61715. // Fix types of list items that are "after" the selected blocks.
  61716. _fixType( blocks, false, lowestIndent );
  61717. }
  61718. // Phew! Now it will be easier :).
  61719. // For each block element that was in the selection, we will either: turn it to list item,
  61720. // turn it to paragraph, or change it's type. Or leave it as it is.
  61721. // Do it in reverse as there might be multiple blocks (same as with changing indents).
  61722. for ( const element of blocks.reverse() ) {
  61723. if ( turnOff && element.name == 'listItem' ) {
  61724. // We are turning off and the element is a `listItem` - it should be converted to `paragraph`.
  61725. // List item specific attributes are removed by post fixer.
  61726. writer.rename( element, 'paragraph' );
  61727. } else if ( !turnOff && element.name != 'listItem' ) {
  61728. // We are turning on and the element is not a `listItem` - it should be converted to `listItem`.
  61729. // The order of operations is important to keep model in correct state.
  61730. writer.setAttributes( { listType: this.type, listIndent: 0 }, element );
  61731. writer.rename( element, 'listItem' );
  61732. } else if ( !turnOff && element.name == 'listItem' && element.getAttribute( 'listType' ) != this.type ) {
  61733. // We are turning on and the element is a `listItem` but has different type - change it's type and
  61734. // type of it's all siblings that have same indent.
  61735. writer.setAttribute( 'listType', this.type, element );
  61736. }
  61737. }
  61738. /**
  61739. * Event fired by the {@link #execute} method.
  61740. *
  61741. * It allows to execute an action after executing the {@link ~ListCommand#execute} method, for example adjusting
  61742. * attributes of changed blocks.
  61743. *
  61744. * @protected
  61745. * @event _executeCleanup
  61746. */
  61747. this.fire( '_executeCleanup', blocks );
  61748. } );
  61749. }
  61750. /**
  61751. * Checks the command's {@link #value}.
  61752. *
  61753. * @private
  61754. * @returns {Boolean} The current value.
  61755. */
  61756. _getValue() {
  61757. // Check whether closest `listItem` ancestor of the position has a correct type.
  61758. const listItem = Object(ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_1__["first"])( this.editor.model.document.selection.getSelectedBlocks() );
  61759. return !!listItem && listItem.is( 'element', 'listItem' ) && listItem.getAttribute( 'listType' ) == this.type;
  61760. }
  61761. /**
  61762. * Checks whether the command can be enabled in the current context.
  61763. *
  61764. * @private
  61765. * @returns {Boolean} Whether the command should be enabled.
  61766. */
  61767. _checkEnabled() {
  61768. // If command value is true it means that we are in list item, so the command should be enabled.
  61769. if ( this.value ) {
  61770. return true;
  61771. }
  61772. const selection = this.editor.model.document.selection;
  61773. const schema = this.editor.model.schema;
  61774. const firstBlock = Object(ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_1__["first"])( selection.getSelectedBlocks() );
  61775. if ( !firstBlock ) {
  61776. return false;
  61777. }
  61778. // Otherwise, check if list item can be inserted at the position start.
  61779. return checkCanBecomeListItem( firstBlock, schema );
  61780. }
  61781. }
  61782. // Helper function used when one or more list item have their type changed. Fixes type of other list items
  61783. // that are affected by the change (are in same lists) but are not directly in selection. The function got extracted
  61784. // not to duplicated code, as same fix has to be performed before and after selection.
  61785. //
  61786. // @param {Array.<module:engine/model/node~Node>} blocks Blocks that are in selection.
  61787. // @param {Boolean} isBackward Specified whether fix will be applied for blocks before first selected block (`true`)
  61788. // or blocks after last selected block (`false`).
  61789. // @param {Number} lowestIndent Lowest indent among selected blocks.
  61790. function _fixType( blocks, isBackward, lowestIndent ) {
  61791. // We need to check previous sibling of first changed item and next siblings of last changed item.
  61792. const startingItem = isBackward ? blocks[ 0 ] : blocks[ blocks.length - 1 ];
  61793. if ( startingItem.is( 'element', 'listItem' ) ) {
  61794. let item = startingItem[ isBackward ? 'previousSibling' : 'nextSibling' ];
  61795. // During processing items, keeps the lowest indent of already processed items.
  61796. // This saves us from changing too many items.
  61797. // Following example is for going forward as it is easier to read, however same applies to going backward.
  61798. // * ------
  61799. // * ------
  61800. // * --[---
  61801. // * ------ <-- `lowestIndent` should be 1
  61802. // * --]--- <-- `startingItem`, `currentIndent` = 2, `lowestIndent` == 1
  61803. // * ------ <-- should be fixed, `indent` == 2 == `currentIndent`
  61804. // * ------ <-- should be fixed, set `currentIndent` to 1, `indent` == 1 == `currentIndent`
  61805. // * ------ <-- should not be fixed, item is in different list, `indent` = 2, `indent` != `currentIndent`
  61806. // * ------ <-- should be fixed, `indent` == 1 == `currentIndent`
  61807. // * ------ <-- break loop (`indent` < `lowestIndent`)
  61808. let currentIndent = startingItem.getAttribute( 'listIndent' );
  61809. // Look back until a list item with indent lower than reference `lowestIndent`.
  61810. // That would be the parent of nested sublist which contains item having `lowestIndent`.
  61811. while ( item && item.is( 'element', 'listItem' ) && item.getAttribute( 'listIndent' ) >= lowestIndent ) {
  61812. if ( currentIndent > item.getAttribute( 'listIndent' ) ) {
  61813. currentIndent = item.getAttribute( 'listIndent' );
  61814. }
  61815. // Found an item that is in the same nested sublist.
  61816. if ( item.getAttribute( 'listIndent' ) == currentIndent ) {
  61817. // Just add the item to selected blocks like it was selected by the user.
  61818. blocks[ isBackward ? 'unshift' : 'push' ]( item );
  61819. }
  61820. item = item[ isBackward ? 'previousSibling' : 'nextSibling' ];
  61821. }
  61822. }
  61823. }
  61824. // Checks whether the given block can be replaced by a listItem.
  61825. //
  61826. // @private
  61827. // @param {module:engine/model/element~Element} block A block to be tested.
  61828. // @param {module:engine/model/schema~Schema} schema The schema of the document.
  61829. // @returns {Boolean}
  61830. function checkCanBecomeListItem( block, schema ) {
  61831. return schema.checkChild( block.parent, 'listItem' ) && !schema.isObject( block );
  61832. }
  61833. /***/ }),
  61834. /***/ "./node_modules/@ckeditor/ckeditor5-list/src/listediting.js":
  61835. /*!******************************************************************!*\
  61836. !*** ./node_modules/@ckeditor/ckeditor5-list/src/listediting.js ***!
  61837. \******************************************************************/
  61838. /*! exports provided: default */
  61839. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  61840. "use strict";
  61841. __webpack_require__.r(__webpack_exports__);
  61842. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ListEditing; });
  61843. /* harmony import */ var _listcommand__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./listcommand */ "./node_modules/@ckeditor/ckeditor5-list/src/listcommand.js");
  61844. /* harmony import */ var _indentcommand__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./indentcommand */ "./node_modules/@ckeditor/ckeditor5-list/src/indentcommand.js");
  61845. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  61846. /* harmony import */ var ckeditor5_src_enter__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ckeditor5/src/enter */ "./node_modules/ckeditor5/src/enter.js");
  61847. /* harmony import */ var ckeditor5_src_typing__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ckeditor5/src/typing */ "./node_modules/ckeditor5/src/typing.js");
  61848. /* harmony import */ var _converters__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./converters */ "./node_modules/@ckeditor/ckeditor5-list/src/converters.js");
  61849. /**
  61850. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  61851. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  61852. */
  61853. /**
  61854. * @module list/listediting
  61855. */
  61856. /**
  61857. * The engine of the list feature. It handles creating, editing and removing lists and list items.
  61858. *
  61859. * It registers the `'numberedList'`, `'bulletedList'`, `'indentList'` and `'outdentList'` commands.
  61860. *
  61861. * @extends module:core/plugin~Plugin
  61862. */
  61863. class ListEditing extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_2__["Plugin"] {
  61864. /**
  61865. * @inheritDoc
  61866. */
  61867. static get pluginName() {
  61868. return 'ListEditing';
  61869. }
  61870. /**
  61871. * @inheritDoc
  61872. */
  61873. static get requires() {
  61874. return [ ckeditor5_src_enter__WEBPACK_IMPORTED_MODULE_3__["Enter"], ckeditor5_src_typing__WEBPACK_IMPORTED_MODULE_4__["Delete"] ];
  61875. }
  61876. /**
  61877. * @inheritDoc
  61878. */
  61879. init() {
  61880. const editor = this.editor;
  61881. // Schema.
  61882. // Note: in case `$block` will ever be allowed in `listItem`, keep in mind that this feature
  61883. // uses `Selection#getSelectedBlocks()` without any additional processing to obtain all selected list items.
  61884. // If there are blocks allowed inside list item, algorithms using `getSelectedBlocks()` will have to be modified.
  61885. editor.model.schema.register( 'listItem', {
  61886. inheritAllFrom: '$block',
  61887. allowAttributes: [ 'listType', 'listIndent' ]
  61888. } );
  61889. // Converters.
  61890. const data = editor.data;
  61891. const editing = editor.editing;
  61892. editor.model.document.registerPostFixer( writer => Object(_converters__WEBPACK_IMPORTED_MODULE_5__["modelChangePostFixer"])( editor.model, writer ) );
  61893. editing.mapper.registerViewToModelLength( 'li', getViewListItemLength );
  61894. data.mapper.registerViewToModelLength( 'li', getViewListItemLength );
  61895. editing.mapper.on( 'modelToViewPosition', Object(_converters__WEBPACK_IMPORTED_MODULE_5__["modelToViewPosition"])( editing.view ) );
  61896. editing.mapper.on( 'viewToModelPosition', Object(_converters__WEBPACK_IMPORTED_MODULE_5__["viewToModelPosition"])( editor.model ) );
  61897. data.mapper.on( 'modelToViewPosition', Object(_converters__WEBPACK_IMPORTED_MODULE_5__["modelToViewPosition"])( editing.view ) );
  61898. editor.conversion.for( 'editingDowncast' )
  61899. .add( dispatcher => {
  61900. dispatcher.on( 'insert', _converters__WEBPACK_IMPORTED_MODULE_5__["modelViewSplitOnInsert"], { priority: 'high' } );
  61901. dispatcher.on( 'insert:listItem', Object(_converters__WEBPACK_IMPORTED_MODULE_5__["modelViewInsertion"])( editor.model ) );
  61902. dispatcher.on( 'attribute:listType:listItem', _converters__WEBPACK_IMPORTED_MODULE_5__["modelViewChangeType"], { priority: 'high' } );
  61903. dispatcher.on( 'attribute:listType:listItem', _converters__WEBPACK_IMPORTED_MODULE_5__["modelViewMergeAfterChangeType"], { priority: 'low' } );
  61904. dispatcher.on( 'attribute:listIndent:listItem', Object(_converters__WEBPACK_IMPORTED_MODULE_5__["modelViewChangeIndent"])( editor.model ) );
  61905. dispatcher.on( 'remove:listItem', Object(_converters__WEBPACK_IMPORTED_MODULE_5__["modelViewRemove"])( editor.model ) );
  61906. dispatcher.on( 'remove', _converters__WEBPACK_IMPORTED_MODULE_5__["modelViewMergeAfter"], { priority: 'low' } );
  61907. } );
  61908. editor.conversion.for( 'dataDowncast' )
  61909. .add( dispatcher => {
  61910. dispatcher.on( 'insert', _converters__WEBPACK_IMPORTED_MODULE_5__["modelViewSplitOnInsert"], { priority: 'high' } );
  61911. dispatcher.on( 'insert:listItem', Object(_converters__WEBPACK_IMPORTED_MODULE_5__["modelViewInsertion"])( editor.model ) );
  61912. } );
  61913. editor.conversion.for( 'upcast' )
  61914. .add( dispatcher => {
  61915. dispatcher.on( 'element:ul', _converters__WEBPACK_IMPORTED_MODULE_5__["cleanList"], { priority: 'high' } );
  61916. dispatcher.on( 'element:ol', _converters__WEBPACK_IMPORTED_MODULE_5__["cleanList"], { priority: 'high' } );
  61917. dispatcher.on( 'element:li', _converters__WEBPACK_IMPORTED_MODULE_5__["cleanListItem"], { priority: 'high' } );
  61918. dispatcher.on( 'element:li', _converters__WEBPACK_IMPORTED_MODULE_5__["viewModelConverter"] );
  61919. } );
  61920. // Fix indentation of pasted items.
  61921. editor.model.on( 'insertContent', _converters__WEBPACK_IMPORTED_MODULE_5__["modelIndentPasteFixer"], { priority: 'high' } );
  61922. // Register commands for numbered and bulleted list.
  61923. editor.commands.add( 'numberedList', new _listcommand__WEBPACK_IMPORTED_MODULE_0__["default"]( editor, 'numbered' ) );
  61924. editor.commands.add( 'bulletedList', new _listcommand__WEBPACK_IMPORTED_MODULE_0__["default"]( editor, 'bulleted' ) );
  61925. // Register commands for indenting.
  61926. editor.commands.add( 'indentList', new _indentcommand__WEBPACK_IMPORTED_MODULE_1__["default"]( editor, 'forward' ) );
  61927. editor.commands.add( 'outdentList', new _indentcommand__WEBPACK_IMPORTED_MODULE_1__["default"]( editor, 'backward' ) );
  61928. const viewDocument = editing.view.document;
  61929. // Overwrite default Enter key behavior.
  61930. // If Enter key is pressed with selection collapsed in empty list item, outdent it instead of breaking it.
  61931. this.listenTo( viewDocument, 'enter', ( evt, data ) => {
  61932. const doc = this.editor.model.document;
  61933. const positionParent = doc.selection.getLastPosition().parent;
  61934. if ( doc.selection.isCollapsed && positionParent.name == 'listItem' && positionParent.isEmpty ) {
  61935. this.editor.execute( 'outdentList' );
  61936. data.preventDefault();
  61937. evt.stop();
  61938. }
  61939. }, { context: 'li' } );
  61940. // Overwrite default Backspace key behavior.
  61941. // If Backspace key is pressed with selection collapsed on first position in first list item, outdent it. #83
  61942. this.listenTo( viewDocument, 'delete', ( evt, data ) => {
  61943. // Check conditions from those that require less computations like those immediately available.
  61944. if ( data.direction !== 'backward' ) {
  61945. return;
  61946. }
  61947. const selection = this.editor.model.document.selection;
  61948. if ( !selection.isCollapsed ) {
  61949. return;
  61950. }
  61951. const firstPosition = selection.getFirstPosition();
  61952. if ( !firstPosition.isAtStart ) {
  61953. return;
  61954. }
  61955. const positionParent = firstPosition.parent;
  61956. if ( positionParent.name !== 'listItem' ) {
  61957. return;
  61958. }
  61959. const previousIsAListItem = positionParent.previousSibling && positionParent.previousSibling.name === 'listItem';
  61960. if ( previousIsAListItem ) {
  61961. return;
  61962. }
  61963. this.editor.execute( 'outdentList' );
  61964. data.preventDefault();
  61965. evt.stop();
  61966. }, { context: 'li' } );
  61967. const getCommandExecuter = commandName => {
  61968. return ( data, cancel ) => {
  61969. const command = this.editor.commands.get( commandName );
  61970. if ( command.isEnabled ) {
  61971. this.editor.execute( commandName );
  61972. cancel();
  61973. }
  61974. };
  61975. };
  61976. editor.keystrokes.set( 'Tab', getCommandExecuter( 'indentList' ) );
  61977. editor.keystrokes.set( 'Shift+Tab', getCommandExecuter( 'outdentList' ) );
  61978. }
  61979. /**
  61980. * @inheritDoc
  61981. */
  61982. afterInit() {
  61983. const commands = this.editor.commands;
  61984. const indent = commands.get( 'indent' );
  61985. const outdent = commands.get( 'outdent' );
  61986. if ( indent ) {
  61987. indent.registerChildCommand( commands.get( 'indentList' ) );
  61988. }
  61989. if ( outdent ) {
  61990. outdent.registerChildCommand( commands.get( 'outdentList' ) );
  61991. }
  61992. }
  61993. }
  61994. function getViewListItemLength( element ) {
  61995. let length = 1;
  61996. for ( const child of element.getChildren() ) {
  61997. if ( child.name == 'ul' || child.name == 'ol' ) {
  61998. for ( const item of child.getChildren() ) {
  61999. length += getViewListItemLength( item );
  62000. }
  62001. }
  62002. }
  62003. return length;
  62004. }
  62005. /***/ }),
  62006. /***/ "./node_modules/@ckeditor/ckeditor5-list/src/listui.js":
  62007. /*!*************************************************************!*\
  62008. !*** ./node_modules/@ckeditor/ckeditor5-list/src/listui.js ***!
  62009. \*************************************************************/
  62010. /*! exports provided: default */
  62011. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  62012. "use strict";
  62013. __webpack_require__.r(__webpack_exports__);
  62014. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ListUI; });
  62015. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils */ "./node_modules/@ckeditor/ckeditor5-list/src/utils.js");
  62016. /* 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");
  62017. /* 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");
  62018. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  62019. /**
  62020. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  62021. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  62022. */
  62023. /**
  62024. * @module list/listui
  62025. */
  62026. /**
  62027. * The list UI feature. It introduces the `'numberedList'` and `'bulletedList'` buttons that
  62028. * allow to convert paragraphs to and from list items and indent or outdent them.
  62029. *
  62030. * @extends module:core/plugin~Plugin
  62031. */
  62032. class ListUI extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_3__["Plugin"] {
  62033. /**
  62034. * @inheritDoc
  62035. */
  62036. static get pluginName() {
  62037. return 'ListUI';
  62038. }
  62039. /**
  62040. * @inheritDoc
  62041. */
  62042. init() {
  62043. const t = this.editor.t;
  62044. // Create two buttons and link them with numberedList and bulletedList commands.
  62045. Object(_utils__WEBPACK_IMPORTED_MODULE_0__["createUIComponent"])( this.editor, 'numberedList', t( 'Numbered List' ), _theme_icons_numberedlist_svg__WEBPACK_IMPORTED_MODULE_1__["default"] );
  62046. Object(_utils__WEBPACK_IMPORTED_MODULE_0__["createUIComponent"])( this.editor, 'bulletedList', t( 'Bulleted List' ), _theme_icons_bulletedlist_svg__WEBPACK_IMPORTED_MODULE_2__["default"] );
  62047. }
  62048. }
  62049. /***/ }),
  62050. /***/ "./node_modules/@ckeditor/ckeditor5-list/src/utils.js":
  62051. /*!************************************************************!*\
  62052. !*** ./node_modules/@ckeditor/ckeditor5-list/src/utils.js ***!
  62053. \************************************************************/
  62054. /*! exports provided: createViewListItemElement, generateLiInUl, injectViewList, mergeViewLists, positionAfterUiElements, getSiblingListItem, createUIComponent, findNestedList, getSiblingNodes */
  62055. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  62056. "use strict";
  62057. __webpack_require__.r(__webpack_exports__);
  62058. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createViewListItemElement", function() { return createViewListItemElement; });
  62059. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "generateLiInUl", function() { return generateLiInUl; });
  62060. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "injectViewList", function() { return injectViewList; });
  62061. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mergeViewLists", function() { return mergeViewLists; });
  62062. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "positionAfterUiElements", function() { return positionAfterUiElements; });
  62063. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getSiblingListItem", function() { return getSiblingListItem; });
  62064. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createUIComponent", function() { return createUIComponent; });
  62065. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "findNestedList", function() { return findNestedList; });
  62066. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getSiblingNodes", function() { return getSiblingNodes; });
  62067. /* harmony import */ var ckeditor5_src_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/engine */ "./node_modules/ckeditor5/src/engine.js");
  62068. /* harmony import */ var ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/ui */ "./node_modules/ckeditor5/src/ui.js");
  62069. /**
  62070. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  62071. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  62072. */
  62073. /**
  62074. * @module list/utils
  62075. */
  62076. /**
  62077. * Creates a list item {@link module:engine/view/containerelement~ContainerElement}.
  62078. *
  62079. * @param {module:engine/view/downcastwriter~DowncastWriter} writer The writer instance.
  62080. * @returns {module:engine/view/containerelement~ContainerElement}
  62081. */
  62082. function createViewListItemElement( writer ) {
  62083. const viewItem = writer.createContainerElement( 'li' );
  62084. viewItem.getFillerOffset = getListItemFillerOffset;
  62085. return viewItem;
  62086. }
  62087. /**
  62088. * Helper function that creates a `<ul><li></li></ul>` or (`<ol>`) structure out of the given `modelItem` model `listItem` element.
  62089. * Then, it binds the created view list item (`<li>`) with the model `listItem` element.
  62090. * The function then returns the created view list item (`<li>`).
  62091. *
  62092. * @param {module:engine/model/item~Item} modelItem Model list item.
  62093. * @param {module:engine/conversion/upcastdispatcher~UpcastConversionApi} conversionApi Conversion interface.
  62094. * @returns {module:engine/view/containerelement~ContainerElement} View list element.
  62095. */
  62096. function generateLiInUl( modelItem, conversionApi ) {
  62097. const mapper = conversionApi.mapper;
  62098. const viewWriter = conversionApi.writer;
  62099. const listType = modelItem.getAttribute( 'listType' ) == 'numbered' ? 'ol' : 'ul';
  62100. const viewItem = createViewListItemElement( viewWriter );
  62101. const viewList = viewWriter.createContainerElement( listType, null );
  62102. viewWriter.insert( viewWriter.createPositionAt( viewList, 0 ), viewItem );
  62103. mapper.bindElements( modelItem, viewItem );
  62104. return viewItem;
  62105. }
  62106. /**
  62107. * Helper function that inserts a view list at a correct place and merges it with its siblings.
  62108. * It takes a model list item element (`modelItem`) and a corresponding view list item element (`injectedItem`). The view list item
  62109. * should be in a view list element (`<ul>` or `<ol>`) and should be its only child.
  62110. * See comments below to better understand the algorithm.
  62111. *
  62112. * @param {module:engine/view/item~Item} modelItem Model list item.
  62113. * @param {module:engine/view/containerelement~ContainerElement} injectedItem
  62114. * @param {module:engine/conversion/upcastdispatcher~UpcastConversionApi} conversionApi Conversion interface.
  62115. * @param {module:engine/model/model~Model} model The model instance.
  62116. */
  62117. function injectViewList( modelItem, injectedItem, conversionApi, model ) {
  62118. const injectedList = injectedItem.parent;
  62119. const mapper = conversionApi.mapper;
  62120. const viewWriter = conversionApi.writer;
  62121. // The position where the view list will be inserted.
  62122. let insertPosition = mapper.toViewPosition( model.createPositionBefore( modelItem ) );
  62123. // 1. Find the previous list item that has the same or smaller indent. Basically we are looking for the first model item
  62124. // that is a "parent" or "sibling" of the injected model item.
  62125. // If there is no such list item, it means that the injected list item is the first item in "its list".
  62126. const refItem = getSiblingListItem( modelItem.previousSibling, {
  62127. sameIndent: true,
  62128. smallerIndent: true,
  62129. listIndent: modelItem.getAttribute( 'listIndent' )
  62130. } );
  62131. const prevItem = modelItem.previousSibling;
  62132. if ( refItem && refItem.getAttribute( 'listIndent' ) == modelItem.getAttribute( 'listIndent' ) ) {
  62133. // There is a list item with the same indent - we found the same-level sibling.
  62134. // Break the list after it. The inserted view item will be added in the broken space.
  62135. const viewItem = mapper.toViewElement( refItem );
  62136. insertPosition = viewWriter.breakContainer( viewWriter.createPositionAfter( viewItem ) );
  62137. } else {
  62138. // There is no list item with the same indent. Check the previous model item.
  62139. if ( prevItem && prevItem.name == 'listItem' ) {
  62140. // If it is a list item, it has to have a lower indent.
  62141. // It means that the inserted item should be added to it as its nested item.
  62142. insertPosition = mapper.toViewPosition( model.createPositionAt( prevItem, 'end' ) );
  62143. // There could be some not mapped elements (eg. span in to-do list) but we need to insert
  62144. // a nested list directly inside the li element.
  62145. const mappedViewAncestor = mapper.findMappedViewAncestor( insertPosition );
  62146. const nestedList = findNestedList( mappedViewAncestor );
  62147. // If there already is some nested list, then use it's position.
  62148. if ( nestedList ) {
  62149. insertPosition = viewWriter.createPositionBefore( nestedList );
  62150. } else {
  62151. // Else just put new list on the end of list item content.
  62152. insertPosition = viewWriter.createPositionAt( mappedViewAncestor, 'end' );
  62153. }
  62154. } else {
  62155. // The previous item is not a list item (or does not exist at all).
  62156. // Just map the position and insert the view item at the mapped position.
  62157. insertPosition = mapper.toViewPosition( model.createPositionBefore( modelItem ) );
  62158. }
  62159. }
  62160. insertPosition = positionAfterUiElements( insertPosition );
  62161. // Insert the view item.
  62162. viewWriter.insert( insertPosition, injectedList );
  62163. // 2. Handle possible children of the injected model item.
  62164. if ( prevItem && prevItem.name == 'listItem' ) {
  62165. const prevView = mapper.toViewElement( prevItem );
  62166. const walkerBoundaries = viewWriter.createRange( viewWriter.createPositionAt( prevView, 0 ), insertPosition );
  62167. const walker = walkerBoundaries.getWalker( { ignoreElementEnd: true } );
  62168. for ( const value of walker ) {
  62169. if ( value.item.is( 'element', 'li' ) ) {
  62170. const breakPosition = viewWriter.breakContainer( viewWriter.createPositionBefore( value.item ) );
  62171. const viewList = value.item.parent;
  62172. const targetPosition = viewWriter.createPositionAt( injectedItem, 'end' );
  62173. mergeViewLists( viewWriter, targetPosition.nodeBefore, targetPosition.nodeAfter );
  62174. viewWriter.move( viewWriter.createRangeOn( viewList ), targetPosition );
  62175. walker.position = breakPosition;
  62176. }
  62177. }
  62178. } else {
  62179. const nextViewList = injectedList.nextSibling;
  62180. if ( nextViewList && ( nextViewList.is( 'element', 'ul' ) || nextViewList.is( 'element', 'ol' ) ) ) {
  62181. let lastSubChild = null;
  62182. for ( const child of nextViewList.getChildren() ) {
  62183. const modelChild = mapper.toModelElement( child );
  62184. if ( modelChild && modelChild.getAttribute( 'listIndent' ) > modelItem.getAttribute( 'listIndent' ) ) {
  62185. lastSubChild = child;
  62186. } else {
  62187. break;
  62188. }
  62189. }
  62190. if ( lastSubChild ) {
  62191. viewWriter.breakContainer( viewWriter.createPositionAfter( lastSubChild ) );
  62192. viewWriter.move( viewWriter.createRangeOn( lastSubChild.parent ), viewWriter.createPositionAt( injectedItem, 'end' ) );
  62193. }
  62194. }
  62195. }
  62196. // Merge the inserted view list with its possible neighbor lists.
  62197. mergeViewLists( viewWriter, injectedList, injectedList.nextSibling );
  62198. mergeViewLists( viewWriter, injectedList.previousSibling, injectedList );
  62199. }
  62200. /**
  62201. * Helper function that takes two parameters that are expected to be view list elements, and merges them.
  62202. * The merge happens only if both parameters are list elements of the same type (the same element name and the same class attributes).
  62203. *
  62204. * @param {module:engine/view/downcastwriter~DowncastWriter} viewWriter The writer instance.
  62205. * @param {module:engine/view/item~Item} firstList The first element to compare.
  62206. * @param {module:engine/view/item~Item} secondList The second element to compare.
  62207. * @returns {module:engine/view/position~Position|null} The position after merge or `null` when there was no merge.
  62208. */
  62209. function mergeViewLists( viewWriter, firstList, secondList ) {
  62210. // Check if two lists are going to be merged.
  62211. if ( !firstList || !secondList || ( firstList.name != 'ul' && firstList.name != 'ol' ) ) {
  62212. return null;
  62213. }
  62214. // Both parameters are list elements, so compare types now.
  62215. if ( firstList.name != secondList.name || firstList.getAttribute( 'class' ) !== secondList.getAttribute( 'class' ) ) {
  62216. return null;
  62217. }
  62218. return viewWriter.mergeContainers( viewWriter.createPositionAfter( firstList ) );
  62219. }
  62220. /**
  62221. * Helper function that for a given `view.Position`, returns a `view.Position` that is after all `view.UIElement`s that
  62222. * are after the given position.
  62223. *
  62224. * For example:
  62225. * `<container:p>foo^<ui:span></ui:span><ui:span></ui:span>bar</container:p>`
  62226. * For position ^, the position before "bar" will be returned.
  62227. *
  62228. * @param {module:engine/view/position~Position} viewPosition
  62229. * @returns {module:engine/view/position~Position}
  62230. */
  62231. function positionAfterUiElements( viewPosition ) {
  62232. return viewPosition.getLastMatchingPosition( value => value.item.is( 'uiElement' ) );
  62233. }
  62234. /**
  62235. * Helper function that searches for a previous list item sibling of a given model item that meets the given criteria
  62236. * passed by the options object.
  62237. *
  62238. * @param {module:engine/model/item~Item} modelItem
  62239. * @param {Object} options Search criteria.
  62240. * @param {Boolean} [options.sameIndent=false] Whether the sought sibling should have the same indentation.
  62241. * @param {Boolean} [options.smallerIndent=false] Whether the sought sibling should have a smaller indentation.
  62242. * @param {Number} [options.listIndent] The reference indentation.
  62243. * @param {'forward'|'backward'} [options.direction='backward'] Walking direction.
  62244. * @returns {module:engine/model/item~Item|null}
  62245. */
  62246. function getSiblingListItem( modelItem, options ) {
  62247. const sameIndent = !!options.sameIndent;
  62248. const smallerIndent = !!options.smallerIndent;
  62249. const indent = options.listIndent;
  62250. let item = modelItem;
  62251. while ( item && item.name == 'listItem' ) {
  62252. const itemIndent = item.getAttribute( 'listIndent' );
  62253. if ( ( sameIndent && indent == itemIndent ) || ( smallerIndent && indent > itemIndent ) ) {
  62254. return item;
  62255. }
  62256. if ( options.direction === 'forward' ) {
  62257. item = item.nextSibling;
  62258. } else {
  62259. item = item.previousSibling;
  62260. }
  62261. }
  62262. return null;
  62263. }
  62264. /**
  62265. * Helper method for creating a UI button and linking it with an appropriate command.
  62266. *
  62267. * @private
  62268. * @param {module:core/editor/editor~Editor} editor The editor instance to which the UI component will be added.
  62269. * @param {String} commandName The name of the command.
  62270. * @param {Object} label The button label.
  62271. * @param {String} icon The source of the icon.
  62272. */
  62273. function createUIComponent( editor, commandName, label, icon ) {
  62274. editor.ui.componentFactory.add( commandName, locale => {
  62275. const command = editor.commands.get( commandName );
  62276. const buttonView = new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__["ButtonView"]( locale );
  62277. buttonView.set( {
  62278. label,
  62279. icon,
  62280. tooltip: true,
  62281. isToggleable: true
  62282. } );
  62283. // Bind button model to command.
  62284. buttonView.bind( 'isOn', 'isEnabled' ).to( command, 'value', 'isEnabled' );
  62285. // Execute command.
  62286. buttonView.on( 'execute', () => {
  62287. editor.execute( commandName );
  62288. editor.editing.view.focus();
  62289. } );
  62290. return buttonView;
  62291. } );
  62292. }
  62293. /**
  62294. * Returns a first list view element that is direct child of the given view element.
  62295. *
  62296. * @param {module:engine/view/element~Element} viewElement
  62297. * @return {module:engine/view/element~Element|null}
  62298. */
  62299. function findNestedList( viewElement ) {
  62300. for ( const node of viewElement.getChildren() ) {
  62301. if ( node.name == 'ul' || node.name == 'ol' ) {
  62302. return node;
  62303. }
  62304. }
  62305. return null;
  62306. }
  62307. /**
  62308. * Returns an array with all `listItem` elements that represents the same list.
  62309. *
  62310. * It means that values for `listIndent`, `listType`, and `listStyle` for all items are equal.
  62311. *
  62312. * @param {module:engine/model/position~Position} position Starting position.
  62313. * @param {'forward'|'backward'} direction Walking direction.
  62314. * @returns {Array.<module:engine/model/element~Element>}
  62315. */
  62316. function getSiblingNodes( position, direction ) {
  62317. const items = [];
  62318. const listItem = position.parent;
  62319. const walkerOptions = {
  62320. ignoreElementEnd: true,
  62321. startPosition: position,
  62322. shallow: true,
  62323. direction
  62324. };
  62325. const limitIndent = listItem.getAttribute( 'listIndent' );
  62326. const nodes = [ ...new ckeditor5_src_engine__WEBPACK_IMPORTED_MODULE_0__["TreeWalker"]( walkerOptions ) ]
  62327. .filter( value => value.item.is( 'element' ) )
  62328. .map( value => value.item );
  62329. for ( const element of nodes ) {
  62330. // If found something else than `listItem`, we're out of the list scope.
  62331. if ( !element.is( 'element', 'listItem' ) ) {
  62332. break;
  62333. }
  62334. // If current parsed item has lower indent that element that the element that was a starting point,
  62335. // it means we left a nested list. Abort searching items.
  62336. //
  62337. // ■ List item 1. [listIndent=0]
  62338. // ○ List item 2.[] [listIndent=1], limitIndent = 1,
  62339. // ○ List item 3. [listIndent=1]
  62340. // ■ List item 4. [listIndent=0]
  62341. //
  62342. // Abort searching when leave nested list.
  62343. if ( element.getAttribute( 'listIndent' ) < limitIndent ) {
  62344. break;
  62345. }
  62346. // ■ List item 1.[] [listIndent=0] limitIndent = 0,
  62347. // ○ List item 2. [listIndent=1]
  62348. // ○ List item 3. [listIndent=1]
  62349. // ■ List item 4. [listIndent=0]
  62350. //
  62351. // Ignore nested lists.
  62352. if ( element.getAttribute( 'listIndent' ) > limitIndent ) {
  62353. continue;
  62354. }
  62355. // ■ List item 1.[] [listType=bulleted]
  62356. // 1. List item 2. [listType=numbered]
  62357. // 2.List item 3. [listType=numbered]
  62358. //
  62359. // Abort searching when found a different kind of a list.
  62360. if ( element.getAttribute( 'listType' ) !== listItem.getAttribute( 'listType' ) ) {
  62361. break;
  62362. }
  62363. // ■ List item 1.[] [listType=bulleted]
  62364. // ■ List item 2. [listType=bulleted]
  62365. // ○ List item 3. [listType=bulleted]
  62366. // ○ List item 4. [listType=bulleted]
  62367. //
  62368. // Abort searching when found a different list style.
  62369. if ( element.getAttribute( 'listStyle' ) !== listItem.getAttribute( 'listStyle' ) ) {
  62370. break;
  62371. }
  62372. if ( direction === 'backward' ) {
  62373. items.unshift( element );
  62374. } else {
  62375. items.push( element );
  62376. }
  62377. }
  62378. return items;
  62379. }
  62380. // Implementation of getFillerOffset for view list item element.
  62381. //
  62382. // @returns {Number|null} Block filler offset or `null` if block filler is not needed.
  62383. function getListItemFillerOffset() {
  62384. const hasOnlyLists = !this.isEmpty && ( this.getChild( 0 ).name == 'ul' || this.getChild( 0 ).name == 'ol' );
  62385. if ( this.isEmpty || hasOnlyLists ) {
  62386. return 0;
  62387. }
  62388. return ckeditor5_src_engine__WEBPACK_IMPORTED_MODULE_0__["getFillerOffset"].call( this );
  62389. }
  62390. /***/ }),
  62391. /***/ "./node_modules/@ckeditor/ckeditor5-list/theme/icons/bulletedlist.svg":
  62392. /*!****************************************************************************!*\
  62393. !*** ./node_modules/@ckeditor/ckeditor5-list/theme/icons/bulletedlist.svg ***!
  62394. \****************************************************************************/
  62395. /*! exports provided: default */
  62396. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  62397. "use strict";
  62398. __webpack_require__.r(__webpack_exports__);
  62399. /* 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>");
  62400. /***/ }),
  62401. /***/ "./node_modules/@ckeditor/ckeditor5-list/theme/icons/numberedlist.svg":
  62402. /*!****************************************************************************!*\
  62403. !*** ./node_modules/@ckeditor/ckeditor5-list/theme/icons/numberedlist.svg ***!
  62404. \****************************************************************************/
  62405. /*! exports provided: default */
  62406. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  62407. "use strict";
  62408. __webpack_require__.r(__webpack_exports__);
  62409. /* 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>");
  62410. /***/ }),
  62411. /***/ "./node_modules/@ckeditor/ckeditor5-paragraph/src/index.js":
  62412. /*!*****************************************************************!*\
  62413. !*** ./node_modules/@ckeditor/ckeditor5-paragraph/src/index.js ***!
  62414. \*****************************************************************/
  62415. /*! exports provided: Paragraph, ParagraphButtonUI */
  62416. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  62417. "use strict";
  62418. __webpack_require__.r(__webpack_exports__);
  62419. /* harmony import */ var _paragraph__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./paragraph */ "./node_modules/@ckeditor/ckeditor5-paragraph/src/paragraph.js");
  62420. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Paragraph", function() { return _paragraph__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  62421. /* harmony import */ var _paragraphbuttonui__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./paragraphbuttonui */ "./node_modules/@ckeditor/ckeditor5-paragraph/src/paragraphbuttonui.js");
  62422. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ParagraphButtonUI", function() { return _paragraphbuttonui__WEBPACK_IMPORTED_MODULE_1__["default"]; });
  62423. /**
  62424. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  62425. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  62426. */
  62427. /**
  62428. * @module paragraph
  62429. */
  62430. /***/ }),
  62431. /***/ "./node_modules/@ckeditor/ckeditor5-paragraph/src/insertparagraphcommand.js":
  62432. /*!**********************************************************************************!*\
  62433. !*** ./node_modules/@ckeditor/ckeditor5-paragraph/src/insertparagraphcommand.js ***!
  62434. \**********************************************************************************/
  62435. /*! exports provided: default */
  62436. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  62437. "use strict";
  62438. __webpack_require__.r(__webpack_exports__);
  62439. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return InsertParagraphCommand; });
  62440. /* 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");
  62441. /**
  62442. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  62443. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  62444. */
  62445. /**
  62446. * @module paragraph/insertparagraphcommand
  62447. */
  62448. /**
  62449. * The insert paragraph command. It inserts a new paragraph at a specific
  62450. * {@link module:engine/model/position~Position document position}.
  62451. *
  62452. * // Insert a new paragraph before an element in the document.
  62453. * editor.execute( 'insertParagraph', {
  62454. * position: editor.model.createPositionBefore( element )
  62455. * } );
  62456. *
  62457. * If a paragraph is disallowed in the context of the specific position, the command
  62458. * will attempt to split position ancestors to find a place where it is possible
  62459. * to insert a paragraph.
  62460. *
  62461. * **Note**: This command moves the selection to the inserted paragraph.
  62462. *
  62463. * @extends module:core/command~Command
  62464. */
  62465. class InsertParagraphCommand extends _ckeditor_ckeditor5_core_src_command__WEBPACK_IMPORTED_MODULE_0__["default"] {
  62466. /**
  62467. * Executes the command.
  62468. *
  62469. * @param {Object} options Options for the executed command.
  62470. * @param {module:engine/model/position~Position} options.position The model position at which
  62471. * the new paragraph will be inserted.
  62472. * @fires execute
  62473. */
  62474. execute( options ) {
  62475. const model = this.editor.model;
  62476. let position = options.position;
  62477. model.change( writer => {
  62478. const paragraph = writer.createElement( 'paragraph' );
  62479. if ( !model.schema.checkChild( position.parent, paragraph ) ) {
  62480. const allowedParent = model.schema.findAllowedParent( position, paragraph );
  62481. // It could be there's no ancestor limit that would allow paragraph.
  62482. // In theory, "paragraph" could be disallowed even in the "$root".
  62483. if ( !allowedParent ) {
  62484. return;
  62485. }
  62486. position = writer.split( position, allowedParent ).position;
  62487. }
  62488. model.insertContent( paragraph, position );
  62489. writer.setSelection( paragraph, 'in' );
  62490. } );
  62491. }
  62492. }
  62493. /***/ }),
  62494. /***/ "./node_modules/@ckeditor/ckeditor5-paragraph/src/paragraph.js":
  62495. /*!*********************************************************************!*\
  62496. !*** ./node_modules/@ckeditor/ckeditor5-paragraph/src/paragraph.js ***!
  62497. \*********************************************************************/
  62498. /*! exports provided: default */
  62499. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  62500. "use strict";
  62501. __webpack_require__.r(__webpack_exports__);
  62502. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Paragraph; });
  62503. /* harmony import */ var _paragraphcommand__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./paragraphcommand */ "./node_modules/@ckeditor/ckeditor5-paragraph/src/paragraphcommand.js");
  62504. /* harmony import */ var _insertparagraphcommand__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./insertparagraphcommand */ "./node_modules/@ckeditor/ckeditor5-paragraph/src/insertparagraphcommand.js");
  62505. /* 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");
  62506. /**
  62507. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  62508. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  62509. */
  62510. /**
  62511. * @module paragraph/paragraph
  62512. */
  62513. /**
  62514. * The paragraph feature for the editor.
  62515. *
  62516. * It introduces the `<paragraph>` element in the model which renders as a `<p>` element in the DOM and data.
  62517. *
  62518. * It also brings two editors commands:
  62519. *
  62520. * * The {@link module:paragraph/paragraphcommand~ParagraphCommand `'paragraph'`} command that converts all
  62521. * blocks in the model selection into paragraphs.
  62522. * * The {@link module:paragraph/insertparagraphcommand~InsertParagraphCommand `'insertParagraph'`} command
  62523. * that inserts a new paragraph at a specified location in the model.
  62524. *
  62525. * @extends module:core/plugin~Plugin
  62526. */
  62527. class Paragraph extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_2__["default"] {
  62528. /**
  62529. * @inheritDoc
  62530. */
  62531. static get pluginName() {
  62532. return 'Paragraph';
  62533. }
  62534. /**
  62535. * @inheritDoc
  62536. */
  62537. init() {
  62538. const editor = this.editor;
  62539. const model = editor.model;
  62540. editor.commands.add( 'paragraph', new _paragraphcommand__WEBPACK_IMPORTED_MODULE_0__["default"]( editor ) );
  62541. editor.commands.add( 'insertParagraph', new _insertparagraphcommand__WEBPACK_IMPORTED_MODULE_1__["default"]( editor ) );
  62542. // Schema.
  62543. model.schema.register( 'paragraph', { inheritAllFrom: '$block' } );
  62544. editor.conversion.elementToElement( { model: 'paragraph', view: 'p' } );
  62545. // Conversion for paragraph-like elements which has not been converted by any plugin.
  62546. editor.conversion.for( 'upcast' ).elementToElement( {
  62547. model: ( viewElement, { writer } ) => {
  62548. if ( !Paragraph.paragraphLikeElements.has( viewElement.name ) ) {
  62549. return null;
  62550. }
  62551. // Do not auto-paragraph empty elements.
  62552. if ( viewElement.isEmpty ) {
  62553. return null;
  62554. }
  62555. return writer.createElement( 'paragraph' );
  62556. },
  62557. view: /.+/,
  62558. converterPriority: 'low'
  62559. } );
  62560. }
  62561. }
  62562. /**
  62563. * A list of element names which should be treated by the autoparagraphing algorithms as
  62564. * paragraph-like. This means that e.g. the following content:
  62565. *
  62566. * <h1>Foo</h1>
  62567. * <table>
  62568. * <tr>
  62569. * <td>X</td>
  62570. * <td>
  62571. * <ul>
  62572. * <li>Y</li>
  62573. * <li>Z</li>
  62574. * </ul>
  62575. * </td>
  62576. * </tr>
  62577. * </table>
  62578. *
  62579. * contains five paragraph-like elements: `<h1>`, two `<td>`s and two `<li>`s.
  62580. * Hence, if none of the features is going to convert those elements the above content will be automatically handled
  62581. * by the paragraph feature and converted to:
  62582. *
  62583. * <p>Foo</p>
  62584. * <p>X</p>
  62585. * <p>Y</p>
  62586. * <p>Z</p>
  62587. *
  62588. * Note: The `<td>` containing two `<li>` elements was ignored as the innermost paragraph-like elements
  62589. * have a priority upon conversion.
  62590. *
  62591. * @member {Set.<String>} module:paragraph/paragraph~Paragraph.paragraphLikeElements
  62592. */
  62593. Paragraph.paragraphLikeElements = new Set( [
  62594. 'blockquote',
  62595. 'dd',
  62596. 'div',
  62597. 'dt',
  62598. 'h1',
  62599. 'h2',
  62600. 'h3',
  62601. 'h4',
  62602. 'h5',
  62603. 'h6',
  62604. 'li',
  62605. 'p',
  62606. 'td',
  62607. 'th'
  62608. ] );
  62609. /***/ }),
  62610. /***/ "./node_modules/@ckeditor/ckeditor5-paragraph/src/paragraphbuttonui.js":
  62611. /*!*****************************************************************************!*\
  62612. !*** ./node_modules/@ckeditor/ckeditor5-paragraph/src/paragraphbuttonui.js ***!
  62613. \*****************************************************************************/
  62614. /*! exports provided: default */
  62615. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  62616. "use strict";
  62617. __webpack_require__.r(__webpack_exports__);
  62618. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ParagraphButtonUI; });
  62619. /* 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");
  62620. /* 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");
  62621. /* harmony import */ var _theme_icons_paragraph_svg__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../theme/icons/paragraph.svg */ "./node_modules/@ckeditor/ckeditor5-paragraph/theme/icons/paragraph.svg");
  62622. /**
  62623. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  62624. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  62625. */
  62626. /**
  62627. * @module paragraph/paragraphbuttonui
  62628. */
  62629. /**
  62630. * This plugin defines the `'paragraph'` button. It can be used together with
  62631. * {@link module:heading/headingbuttonsui~HeadingButtonsUI} to replace the standard heading dropdown.
  62632. *
  62633. * This plugin is not loaded automatically by the {@link module:paragraph/paragraph~Paragraph} plugin. It must
  62634. * be added manually.
  62635. *
  62636. * ClassicEditor
  62637. * .create( {
  62638. * plugins: [ ..., Heading, Paragraph, HeadingButtonsUI, ParagraphButtonUI ]
  62639. * toolbar: [ 'paragraph', 'heading1', 'heading2', 'heading3' ]
  62640. * } )
  62641. * .then( ... )
  62642. * .catch( ... );
  62643. *
  62644. * @extends module:core/plugin~Plugin
  62645. */
  62646. class ParagraphButtonUI extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
  62647. init() {
  62648. const editor = this.editor;
  62649. const t = editor.t;
  62650. editor.ui.componentFactory.add( 'paragraph', locale => {
  62651. const view = new _ckeditor_ckeditor5_ui_src_button_buttonview__WEBPACK_IMPORTED_MODULE_1__["default"]( locale );
  62652. const command = editor.commands.get( 'paragraph' );
  62653. view.label = t( 'Paragraph' );
  62654. view.icon = _theme_icons_paragraph_svg__WEBPACK_IMPORTED_MODULE_2__["default"];
  62655. view.tooltip = true;
  62656. view.isToggleable = true;
  62657. view.bind( 'isEnabled' ).to( command );
  62658. view.bind( 'isOn' ).to( command, 'value' );
  62659. view.on( 'execute', () => {
  62660. editor.execute( 'paragraph' );
  62661. } );
  62662. return view;
  62663. } );
  62664. }
  62665. }
  62666. /***/ }),
  62667. /***/ "./node_modules/@ckeditor/ckeditor5-paragraph/src/paragraphcommand.js":
  62668. /*!****************************************************************************!*\
  62669. !*** ./node_modules/@ckeditor/ckeditor5-paragraph/src/paragraphcommand.js ***!
  62670. \****************************************************************************/
  62671. /*! exports provided: default */
  62672. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  62673. "use strict";
  62674. __webpack_require__.r(__webpack_exports__);
  62675. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ParagraphCommand; });
  62676. /* 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");
  62677. /* 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");
  62678. /**
  62679. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  62680. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  62681. */
  62682. /**
  62683. * @module paragraph/paragraphcommand
  62684. */
  62685. /**
  62686. * The paragraph command.
  62687. *
  62688. * @extends module:core/command~Command
  62689. */
  62690. class ParagraphCommand extends _ckeditor_ckeditor5_core_src_command__WEBPACK_IMPORTED_MODULE_0__["default"] {
  62691. /**
  62692. * The value of the command. Indicates whether the selection start is placed in a paragraph.
  62693. *
  62694. * @readonly
  62695. * @observable
  62696. * @member {Boolean} #value
  62697. */
  62698. /**
  62699. * @inheritDoc
  62700. */
  62701. refresh() {
  62702. const model = this.editor.model;
  62703. const document = model.document;
  62704. const block = Object(_ckeditor_ckeditor5_utils_src_first__WEBPACK_IMPORTED_MODULE_1__["default"])( document.selection.getSelectedBlocks() );
  62705. this.value = !!block && block.is( 'element', 'paragraph' );
  62706. this.isEnabled = !!block && checkCanBecomeParagraph( block, model.schema );
  62707. }
  62708. /**
  62709. * Executes the command. All the blocks (see {@link module:engine/model/schema~Schema}) in the selection
  62710. * will be turned to paragraphs.
  62711. *
  62712. * @fires execute
  62713. * @param {Object} [options] Options for the executed command.
  62714. * @param {module:engine/model/selection~Selection|module:engine/model/documentselection~DocumentSelection} [options.selection]
  62715. * The selection that the command should be applied to.
  62716. * By default, if not provided, the command is applied to the {@link module:engine/model/document~Document#selection}.
  62717. */
  62718. execute( options = {} ) {
  62719. const model = this.editor.model;
  62720. const document = model.document;
  62721. model.change( writer => {
  62722. const blocks = ( options.selection || document.selection ).getSelectedBlocks();
  62723. for ( const block of blocks ) {
  62724. if ( !block.is( 'element', 'paragraph' ) && checkCanBecomeParagraph( block, model.schema ) ) {
  62725. writer.rename( block, 'paragraph' );
  62726. }
  62727. }
  62728. } );
  62729. }
  62730. }
  62731. // Checks whether the given block can be replaced by a paragraph.
  62732. //
  62733. // @private
  62734. // @param {module:engine/model/element~Element} block A block to be tested.
  62735. // @param {module:engine/model/schema~Schema} schema The schema of the document.
  62736. // @returns {Boolean}
  62737. function checkCanBecomeParagraph( block, schema ) {
  62738. return schema.checkChild( block.parent, 'paragraph' ) && !schema.isObject( block );
  62739. }
  62740. /***/ }),
  62741. /***/ "./node_modules/@ckeditor/ckeditor5-paragraph/theme/icons/paragraph.svg":
  62742. /*!******************************************************************************!*\
  62743. !*** ./node_modules/@ckeditor/ckeditor5-paragraph/theme/icons/paragraph.svg ***!
  62744. \******************************************************************************/
  62745. /*! exports provided: default */
  62746. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  62747. "use strict";
  62748. __webpack_require__.r(__webpack_exports__);
  62749. /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M10.5 5.5H7v5h3.5a2.5 2.5 0 1 0 0-5zM5 3h6.5v.025a5 5 0 0 1 0 9.95V13H7v4a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1z\"/></svg>");
  62750. /***/ }),
  62751. /***/ "./node_modules/@ckeditor/ckeditor5-paste-from-office/src/filters/image.js":
  62752. /*!*********************************************************************************!*\
  62753. !*** ./node_modules/@ckeditor/ckeditor5-paste-from-office/src/filters/image.js ***!
  62754. \*********************************************************************************/
  62755. /*! exports provided: replaceImagesSourceWithBase64, _convertHexToBase64 */
  62756. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  62757. "use strict";
  62758. __webpack_require__.r(__webpack_exports__);
  62759. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "replaceImagesSourceWithBase64", function() { return replaceImagesSourceWithBase64; });
  62760. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_convertHexToBase64", function() { return _convertHexToBase64; });
  62761. /* harmony import */ var ckeditor5_src_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/engine */ "./node_modules/ckeditor5/src/engine.js");
  62762. /**
  62763. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  62764. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  62765. */
  62766. /**
  62767. * @module paste-from-office/filters/image
  62768. */
  62769. /* globals btoa */
  62770. /**
  62771. * Replaces source attribute of all `<img>` elements representing regular
  62772. * images (not the Word shapes) with inlined base64 image representation extracted from RTF or Blob data.
  62773. *
  62774. * @param {module:engine/view/documentfragment~DocumentFragment} documentFragment Document fragment on which transform images.
  62775. * @param {String} rtfData The RTF data from which images representation will be used.
  62776. */
  62777. function replaceImagesSourceWithBase64( documentFragment, rtfData ) {
  62778. if ( !documentFragment.childCount ) {
  62779. return;
  62780. }
  62781. const upcastWriter = new ckeditor5_src_engine__WEBPACK_IMPORTED_MODULE_0__["UpcastWriter"]();
  62782. const shapesIds = findAllShapesIds( documentFragment, upcastWriter );
  62783. removeAllImgElementsRepresentingShapes( shapesIds, documentFragment, upcastWriter );
  62784. removeAllShapeElements( documentFragment, upcastWriter );
  62785. const images = findAllImageElementsWithLocalSource( documentFragment, upcastWriter );
  62786. if ( images.length ) {
  62787. replaceImagesFileSourceWithInlineRepresentation( images, extractImageDataFromRtf( rtfData ), upcastWriter );
  62788. }
  62789. }
  62790. /**
  62791. * Converts given HEX string to base64 representation.
  62792. *
  62793. * @protected
  62794. * @param {String} hexString The HEX string to be converted.
  62795. * @returns {String} Base64 representation of a given HEX string.
  62796. */
  62797. function _convertHexToBase64( hexString ) {
  62798. return btoa( hexString.match( /\w{2}/g ).map( char => {
  62799. return String.fromCharCode( parseInt( char, 16 ) );
  62800. } ).join( '' ) );
  62801. }
  62802. // Finds all shapes (`<v:*>...</v:*>`) ids. Shapes can represent images (canvas)
  62803. // or Word shapes (which does not have RTF or Blob representation).
  62804. //
  62805. // @param {module:engine/view/documentfragment~DocumentFragment} documentFragment Document fragment
  62806. // from which to extract shape ids.
  62807. // @param {module:engine/view/upcastwriter~UpcastWriter} writer
  62808. // @returns {Array.<String>} Array of shape ids.
  62809. function findAllShapesIds( documentFragment, writer ) {
  62810. const range = writer.createRangeIn( documentFragment );
  62811. const shapeElementsMatcher = new ckeditor5_src_engine__WEBPACK_IMPORTED_MODULE_0__["Matcher"]( {
  62812. name: /v:(.+)/
  62813. } );
  62814. const shapesIds = [];
  62815. for ( const value of range ) {
  62816. const el = value.item;
  62817. const prevSiblingName = el.previousSibling && el.previousSibling.name || null;
  62818. // If shape element have 'o:gfxdata' attribute and is not directly before `<v:shapetype>` element it means it represent Word shape.
  62819. if ( shapeElementsMatcher.match( el ) && el.getAttribute( 'o:gfxdata' ) && prevSiblingName !== 'v:shapetype' ) {
  62820. shapesIds.push( value.item.getAttribute( 'id' ) );
  62821. }
  62822. }
  62823. return shapesIds;
  62824. }
  62825. // Removes all `<img>` elements which represents Word shapes and not regular images.
  62826. //
  62827. // @param {Array.<String>} shapesIds Shape ids which will be checked against `<img>` elements.
  62828. // @param {module:engine/view/documentfragment~DocumentFragment} documentFragment Document fragment from which to remove `<img>` elements.
  62829. // @param {module:engine/view/upcastwriter~UpcastWriter} writer
  62830. function removeAllImgElementsRepresentingShapes( shapesIds, documentFragment, writer ) {
  62831. const range = writer.createRangeIn( documentFragment );
  62832. const imageElementsMatcher = new ckeditor5_src_engine__WEBPACK_IMPORTED_MODULE_0__["Matcher"]( {
  62833. name: 'img'
  62834. } );
  62835. const imgs = [];
  62836. for ( const value of range ) {
  62837. if ( imageElementsMatcher.match( value.item ) ) {
  62838. const el = value.item;
  62839. const shapes = el.getAttribute( 'v:shapes' ) ? el.getAttribute( 'v:shapes' ).split( ' ' ) : [];
  62840. if ( shapes.length && shapes.every( shape => shapesIds.indexOf( shape ) > -1 ) ) {
  62841. imgs.push( el );
  62842. // Shapes may also have empty source while content is paste in some browsers (Safari).
  62843. } else if ( !el.getAttribute( 'src' ) ) {
  62844. imgs.push( el );
  62845. }
  62846. }
  62847. }
  62848. for ( const img of imgs ) {
  62849. writer.remove( img );
  62850. }
  62851. }
  62852. // Removes all shape elements (`<v:*>...</v:*>`) so they do not pollute the output structure.
  62853. //
  62854. // @param {module:engine/view/documentfragment~DocumentFragment} documentFragment Document fragment from which to remove shape elements.
  62855. // @param {module:engine/view/upcastwriter~UpcastWriter} writer
  62856. function removeAllShapeElements( documentFragment, writer ) {
  62857. const range = writer.createRangeIn( documentFragment );
  62858. const shapeElementsMatcher = new ckeditor5_src_engine__WEBPACK_IMPORTED_MODULE_0__["Matcher"]( {
  62859. name: /v:(.+)/
  62860. } );
  62861. const shapes = [];
  62862. for ( const value of range ) {
  62863. if ( shapeElementsMatcher.match( value.item ) ) {
  62864. shapes.push( value.item );
  62865. }
  62866. }
  62867. for ( const shape of shapes ) {
  62868. writer.remove( shape );
  62869. }
  62870. }
  62871. // Finds all `<img>` elements in a given document fragment which have source pointing to local `file://` resource.
  62872. //
  62873. // @param {module:engine/view/documentfragment~DocumentFragment} documentFragment Document fragment in which to look for `<img>` elements.
  62874. // @param {module:engine/view/upcastwriter~UpcastWriter} writer
  62875. // @returns {Object} result All found images grouped by source type.
  62876. // @returns {Array.<module:engine/view/element~Element>} result.file Array of found `<img>` elements with `file://` source.
  62877. // @returns {Array.<module:engine/view/element~Element>} result.blob Array of found `<img>` elements with `blob:` source.
  62878. function findAllImageElementsWithLocalSource( documentFragment, writer ) {
  62879. const range = writer.createRangeIn( documentFragment );
  62880. const imageElementsMatcher = new ckeditor5_src_engine__WEBPACK_IMPORTED_MODULE_0__["Matcher"]( {
  62881. name: 'img'
  62882. } );
  62883. const imgs = [];
  62884. for ( const value of range ) {
  62885. if ( imageElementsMatcher.match( value.item ) ) {
  62886. if ( value.item.getAttribute( 'src' ).startsWith( 'file://' ) ) {
  62887. imgs.push( value.item );
  62888. }
  62889. }
  62890. }
  62891. return imgs;
  62892. }
  62893. // Extracts all images HEX representations from a given RTF data.
  62894. //
  62895. // @param {String} rtfData The RTF data from which to extract images HEX representation.
  62896. // @returns {Array.<Object>} Array of found HEX representations. Each array item is an object containing:
  62897. //
  62898. // * {String} hex Image representation in HEX format.
  62899. // * {string} type Type of image, `image/png` or `image/jpeg`.
  62900. function extractImageDataFromRtf( rtfData ) {
  62901. if ( !rtfData ) {
  62902. return [];
  62903. }
  62904. const regexPictureHeader = /{\\pict[\s\S]+?\\bliptag-?\d+(\\blipupi-?\d+)?({\\\*\\blipuid\s?[\da-fA-F]+)?[\s}]*?/;
  62905. const regexPicture = new RegExp( '(?:(' + regexPictureHeader.source + '))([\\da-fA-F\\s]+)\\}', 'g' );
  62906. const images = rtfData.match( regexPicture );
  62907. const result = [];
  62908. if ( images ) {
  62909. for ( const image of images ) {
  62910. let imageType = false;
  62911. if ( image.includes( '\\pngblip' ) ) {
  62912. imageType = 'image/png';
  62913. } else if ( image.includes( '\\jpegblip' ) ) {
  62914. imageType = 'image/jpeg';
  62915. }
  62916. if ( imageType ) {
  62917. result.push( {
  62918. hex: image.replace( regexPictureHeader, '' ).replace( /[^\da-fA-F]/g, '' ),
  62919. type: imageType
  62920. } );
  62921. }
  62922. }
  62923. }
  62924. return result;
  62925. }
  62926. // Replaces `src` attribute value of all given images with the corresponding base64 image representation.
  62927. //
  62928. // @param {Array.<module:engine/view/element~Element>} imageElements Array of image elements which will have its source replaced.
  62929. // @param {Array.<Object>} imagesHexSources Array of images hex sources (usually the result of `extractImageDataFromRtf()` function).
  62930. // The array should be the same length as `imageElements` parameter.
  62931. // @param {module:engine/view/upcastwriter~UpcastWriter} writer
  62932. function replaceImagesFileSourceWithInlineRepresentation( imageElements, imagesHexSources, writer ) {
  62933. // Assume there is an equal amount of image elements and images HEX sources so they can be matched accordingly based on existing order.
  62934. if ( imageElements.length === imagesHexSources.length ) {
  62935. for ( let i = 0; i < imageElements.length; i++ ) {
  62936. const newSrc = `data:${ imagesHexSources[ i ].type };base64,${ _convertHexToBase64( imagesHexSources[ i ].hex ) }`;
  62937. writer.setAttribute( 'src', newSrc, imageElements[ i ] );
  62938. }
  62939. }
  62940. }
  62941. /***/ }),
  62942. /***/ "./node_modules/@ckeditor/ckeditor5-paste-from-office/src/filters/list.js":
  62943. /*!********************************************************************************!*\
  62944. !*** ./node_modules/@ckeditor/ckeditor5-paste-from-office/src/filters/list.js ***!
  62945. \********************************************************************************/
  62946. /*! exports provided: transformListItemLikeElementsIntoLists, unwrapParagraphInListItem */
  62947. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  62948. "use strict";
  62949. __webpack_require__.r(__webpack_exports__);
  62950. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "transformListItemLikeElementsIntoLists", function() { return transformListItemLikeElementsIntoLists; });
  62951. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "unwrapParagraphInListItem", function() { return unwrapParagraphInListItem; });
  62952. /* harmony import */ var ckeditor5_src_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/engine */ "./node_modules/ckeditor5/src/engine.js");
  62953. /**
  62954. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  62955. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  62956. */
  62957. /**
  62958. * @module paste-from-office/filters/list
  62959. */
  62960. /**
  62961. * Transforms Word specific list-like elements to the semantic HTML lists.
  62962. *
  62963. * Lists in Word are represented by block elements with special attributes like:
  62964. *
  62965. * <p class=MsoListParagraphCxSpFirst style='mso-list:l1 level1 lfo1'>...</p> // Paragraph based list.
  62966. * <h1 style='mso-list:l0 level1 lfo1'>...</h1> // Heading 1 based list.
  62967. *
  62968. * @param {module:engine/view/documentfragment~DocumentFragment} documentFragment The view structure to be transformed.
  62969. * @param {String} stylesString Styles from which list-like elements styling will be extracted.
  62970. */
  62971. function transformListItemLikeElementsIntoLists( documentFragment, stylesString ) {
  62972. if ( !documentFragment.childCount ) {
  62973. return;
  62974. }
  62975. const writer = new ckeditor5_src_engine__WEBPACK_IMPORTED_MODULE_0__["UpcastWriter"]( documentFragment.document );
  62976. const itemLikeElements = findAllItemLikeElements( documentFragment, writer );
  62977. if ( !itemLikeElements.length ) {
  62978. return;
  62979. }
  62980. let currentList = null;
  62981. let currentIndentation = 1;
  62982. itemLikeElements.forEach( ( itemLikeElement, i ) => {
  62983. const isDifferentList = isNewListNeeded( itemLikeElements[ i - 1 ], itemLikeElement );
  62984. const previousItemLikeElement = isDifferentList ? null : itemLikeElements[ i - 1 ];
  62985. const indentationDifference = getIndentationDifference( previousItemLikeElement, itemLikeElement );
  62986. if ( isDifferentList ) {
  62987. currentList = null;
  62988. currentIndentation = 1;
  62989. }
  62990. if ( !currentList || indentationDifference !== 0 ) {
  62991. const listStyle = detectListStyle( itemLikeElement, stylesString );
  62992. if ( !currentList ) {
  62993. currentList = insertNewEmptyList( listStyle, itemLikeElement.element, writer );
  62994. } else if ( itemLikeElement.indent > currentIndentation ) {
  62995. const lastListItem = currentList.getChild( currentList.childCount - 1 );
  62996. const lastListItemChild = lastListItem.getChild( lastListItem.childCount - 1 );
  62997. currentList = insertNewEmptyList( listStyle, lastListItemChild, writer );
  62998. currentIndentation += 1;
  62999. } else if ( itemLikeElement.indent < currentIndentation ) {
  63000. const differentIndentation = currentIndentation - itemLikeElement.indent;
  63001. currentList = findParentListAtLevel( currentList, differentIndentation );
  63002. currentIndentation = parseInt( itemLikeElement.indent );
  63003. }
  63004. if ( itemLikeElement.indent <= currentIndentation ) {
  63005. if ( !currentList.is( 'element', listStyle.type ) ) {
  63006. currentList = writer.rename( listStyle.type, currentList );
  63007. }
  63008. }
  63009. }
  63010. const listItem = transformElementIntoListItem( itemLikeElement.element, writer );
  63011. writer.appendChild( listItem, currentList );
  63012. } );
  63013. }
  63014. /**
  63015. * Removes paragraph wrapping content inside a list item.
  63016. *
  63017. * @param {module:engine/view/documentfragment~DocumentFragment} documentFragment
  63018. * @param {module:engine/view/upcastwriter~UpcastWriter} writer
  63019. */
  63020. function unwrapParagraphInListItem( documentFragment, writer ) {
  63021. for ( const value of writer.createRangeIn( documentFragment ) ) {
  63022. const element = value.item;
  63023. if ( element.is( 'element', 'li' ) ) {
  63024. // Google Docs allows on single paragraph inside LI.
  63025. const firstChild = element.getChild( 0 );
  63026. if ( firstChild && firstChild.is( 'element', 'p' ) ) {
  63027. writer.unwrapElement( firstChild );
  63028. }
  63029. }
  63030. }
  63031. }
  63032. // Finds all list-like elements in a given document fragment.
  63033. //
  63034. // @param {module:engine/view/documentfragment~DocumentFragment} documentFragment Document fragment
  63035. // in which to look for list-like nodes.
  63036. // @param {module:engine/view/upcastwriter~UpcastWriter} writer
  63037. // @returns {Array.<Object>} Array of found list-like items. Each item is an object containing:
  63038. //
  63039. // * {module:engine/src/view/element~Element} element List-like element.
  63040. // * {Number} id List item id parsed from `mso-list` style (see `getListItemData()` function).
  63041. // * {Number} order List item creation order parsed from `mso-list` style (see `getListItemData()` function).
  63042. // * {Number} indent List item indentation level parsed from `mso-list` style (see `getListItemData()` function).
  63043. function findAllItemLikeElements( documentFragment, writer ) {
  63044. const range = writer.createRangeIn( documentFragment );
  63045. // Matcher for finding list-like elements.
  63046. const itemLikeElementsMatcher = new ckeditor5_src_engine__WEBPACK_IMPORTED_MODULE_0__["Matcher"]( {
  63047. name: /^p|h\d+$/,
  63048. styles: {
  63049. 'mso-list': /.*/
  63050. }
  63051. } );
  63052. const itemLikeElements = [];
  63053. for ( const value of range ) {
  63054. if ( value.type === 'elementStart' && itemLikeElementsMatcher.match( value.item ) ) {
  63055. const itemData = getListItemData( value.item );
  63056. itemLikeElements.push( {
  63057. element: value.item,
  63058. id: itemData.id,
  63059. order: itemData.order,
  63060. indent: itemData.indent
  63061. } );
  63062. }
  63063. }
  63064. return itemLikeElements;
  63065. }
  63066. // Extracts list item style from the provided CSS.
  63067. //
  63068. // List item style is extracted from the CSS stylesheet. Each list with its specific style attribute
  63069. // value (`mso-list:l1 level1 lfo1`) has its dedicated properties in a CSS stylesheet defined with a selector like:
  63070. //
  63071. // @list l1:level1 { ... }
  63072. //
  63073. // It contains `mso-level-number-format` property which defines list numbering/bullet style. If this property
  63074. // is not defined it means default `decimal` numbering.
  63075. //
  63076. // Here CSS string representation is used as `mso-level-number-format` property is an invalid CSS property
  63077. // and will be removed during CSS parsing.
  63078. //
  63079. // @param {Object} listLikeItem List-like item for which list style will be searched for. Usually
  63080. // a result of `findAllItemLikeElements()` function.
  63081. // @param {String} stylesString CSS stylesheet.
  63082. // @returns {Object} result
  63083. // @returns {String} result.type List type, could be `ul` or `ol`.
  63084. // @returns {String|null} result.style List style, for example: `decimal`, `lower-roman`, etc. It is extracted
  63085. // directly from Word stylesheet and adjusted to represent proper values for the CSS `list-style-type` property.
  63086. // If it cannot be adjusted, the `null` value is returned.
  63087. function detectListStyle( listLikeItem, stylesString ) {
  63088. const listStyleRegexp = new RegExp( `@list l${ listLikeItem.id }:level${ listLikeItem.indent }\\s*({[^}]*)`, 'gi' );
  63089. const listStyleTypeRegex = /mso-level-number-format:([^;]{0,100});/gi;
  63090. const listStyleMatch = listStyleRegexp.exec( stylesString );
  63091. let listStyleType = 'decimal'; // Decimal is default one.
  63092. let type = 'ol'; // <ol> is default list.
  63093. if ( listStyleMatch && listStyleMatch[ 1 ] ) {
  63094. const listStyleTypeMatch = listStyleTypeRegex.exec( listStyleMatch[ 1 ] );
  63095. if ( listStyleTypeMatch && listStyleTypeMatch[ 1 ] ) {
  63096. listStyleType = listStyleTypeMatch[ 1 ].trim();
  63097. type = listStyleType !== 'bullet' && listStyleType !== 'image' ? 'ol' : 'ul';
  63098. }
  63099. // Styles for the numbered lists are always defined in the Word CSS stylesheet.
  63100. // Unordered lists MAY contain a value for the Word CSS definition `mso-level-text` but sometimes
  63101. // this tag is missing. And because of that, we cannot depend on that. We need to predict the list style value
  63102. // based on the list style marker element.
  63103. if ( listStyleType === 'bullet' ) {
  63104. const bulletedStyle = findBulletedListStyle( listLikeItem.element );
  63105. if ( bulletedStyle ) {
  63106. listStyleType = bulletedStyle;
  63107. }
  63108. }
  63109. }
  63110. return {
  63111. type,
  63112. style: mapListStyleDefinition( listStyleType )
  63113. };
  63114. }
  63115. // Tries to extract the `list-style-type` value based on the marker element for bulleted list.
  63116. //
  63117. // @param {module:engine/view/element~Element} element
  63118. // @returns {module:engine/view/element~Element|null}
  63119. function findBulletedListStyle( element ) {
  63120. const listMarkerElement = findListMarkerNode( element );
  63121. if ( !listMarkerElement ) {
  63122. return null;
  63123. }
  63124. const listMarker = listMarkerElement._data;
  63125. if ( listMarker === 'o' ) {
  63126. return 'circle';
  63127. } else if ( listMarker === '·' ) {
  63128. return 'disc';
  63129. }
  63130. // Word returns '§' instead of '■' for the square list style.
  63131. else if ( listMarker === '§' ) {
  63132. return 'square';
  63133. }
  63134. return null;
  63135. }
  63136. // Tries to find a text node that represents the marker element (list-style-type).
  63137. //
  63138. // @param {module:engine/view/element~Element} element
  63139. // @returns {module:engine/view/text~Text|null}
  63140. function findListMarkerNode( element ) {
  63141. // If the first child is a text node, it is a value for the element.
  63142. if ( element.getChild( 0 ).is( '$text' ) ) {
  63143. return null;
  63144. }
  63145. const textNodeOrElement = element.getChild( 0 ).getChild( 0 );
  63146. if ( textNodeOrElement.is( '$text' ) ) {
  63147. return textNodeOrElement;
  63148. }
  63149. return textNodeOrElement.getChild( 0 );
  63150. }
  63151. // Parses the `list-style-type` value extracted directly from the Word CSS stylesheet and returns proper CSS definition.
  63152. //
  63153. // @param {String|null} value
  63154. // @returns {String|null}
  63155. function mapListStyleDefinition( value ) {
  63156. switch ( value ) {
  63157. case 'arabic-leading-zero':
  63158. return 'decimal-leading-zero';
  63159. case 'alpha-upper':
  63160. return 'upper-alpha';
  63161. case 'alpha-lower':
  63162. return 'lower-alpha';
  63163. case 'roman-upper':
  63164. return 'upper-roman';
  63165. case 'roman-lower':
  63166. return 'lower-roman';
  63167. case 'circle':
  63168. case 'disc':
  63169. case 'square':
  63170. return value;
  63171. default:
  63172. return null;
  63173. }
  63174. }
  63175. // Creates empty list of a given type and inserts it after a specified element.
  63176. //
  63177. // @param {Object} listStyle List style object which determines the type of newly created list.
  63178. // Usually a result of `detectListStyle()` function.
  63179. // @param {module:engine/view/element~Element} element Element after which list is inserted.
  63180. // @param {module:engine/view/upcastwriter~UpcastWriter} writer
  63181. // @returns {module:engine/view/element~Element} Newly created list element.
  63182. function insertNewEmptyList( listStyle, element, writer ) {
  63183. const parent = element.parent;
  63184. const list = writer.createElement( listStyle.type );
  63185. const position = parent.getChildIndex( element ) + 1;
  63186. writer.insertChild( position, list, parent );
  63187. // We do not support modifying the marker for a particular list item.
  63188. // Set the value for the `list-style-type` property directly to the list container.
  63189. if ( listStyle.style ) {
  63190. writer.setStyle( 'list-style-type', listStyle.style, list );
  63191. }
  63192. return list;
  63193. }
  63194. // Transforms a given element into a semantic list item. As the function operates on a provided
  63195. // {module:engine/src/view/element~Element element} it will modify the view structure to which this element belongs.
  63196. //
  63197. // @param {module:engine/view/element~Element} element Element which will be transformed into a list item.
  63198. // @param {module:engine/view/upcastwriter~UpcastWriter} writer
  63199. // @returns {module:engine/view/element~Element} New element to which the given one was transformed. It is
  63200. // inserted in place of the old element (the reference to the old element is lost due to renaming).
  63201. function transformElementIntoListItem( element, writer ) {
  63202. removeBulletElement( element, writer );
  63203. return writer.rename( 'li', element );
  63204. }
  63205. // Extracts list item information from Word specific list-like element style:
  63206. //
  63207. // `style="mso-list:l1 level1 lfo1"`
  63208. //
  63209. // where:
  63210. //
  63211. // * `l1` is a list id (however it does not mean this is a continuous list - see #43),
  63212. // * `level1` is a list item indentation level,
  63213. // * `lfo1` is a list insertion order in a document.
  63214. //
  63215. // @param {module:engine/view/element~Element} element Element from which style data is extracted.
  63216. // @returns {Object} result
  63217. // @returns {Number} result.id Parent list id.
  63218. // @returns {Number} result.order List item creation order.
  63219. // @returns {Number} result.indent List item indentation level.
  63220. function getListItemData( element ) {
  63221. const data = {};
  63222. const listStyle = element.getStyle( 'mso-list' );
  63223. if ( listStyle ) {
  63224. const idMatch = listStyle.match( /(^|\s{1,100})l(\d+)/i );
  63225. const orderMatch = listStyle.match( /\s{0,100}lfo(\d+)/i );
  63226. const indentMatch = listStyle.match( /\s{0,100}level(\d+)/i );
  63227. if ( idMatch && orderMatch && indentMatch ) {
  63228. data.id = idMatch[ 2 ];
  63229. data.order = orderMatch[ 1 ];
  63230. data.indent = indentMatch[ 1 ];
  63231. }
  63232. }
  63233. return data;
  63234. }
  63235. // Removes span with a numbering/bullet from a given element.
  63236. //
  63237. // @param {module:engine/view/element~Element} element
  63238. // @param {module:engine/view/upcastwriter~UpcastWriter} writer
  63239. function removeBulletElement( element, writer ) {
  63240. // Matcher for finding `span` elements holding lists numbering/bullets.
  63241. const bulletMatcher = new ckeditor5_src_engine__WEBPACK_IMPORTED_MODULE_0__["Matcher"]( {
  63242. name: 'span',
  63243. styles: {
  63244. 'mso-list': 'Ignore'
  63245. }
  63246. } );
  63247. const range = writer.createRangeIn( element );
  63248. for ( const value of range ) {
  63249. if ( value.type === 'elementStart' && bulletMatcher.match( value.item ) ) {
  63250. writer.remove( value.item );
  63251. }
  63252. }
  63253. }
  63254. // Whether the previous and current items belong to the same list. It is determined based on `item.id`
  63255. // (extracted from `mso-list` style, see #getListItemData) and a previous sibling of the current item.
  63256. //
  63257. // However, it's quite easy to change the `id` attribute for nested lists in Word. It will break the list feature while pasting.
  63258. // Let's check also the `indent` attribute. If the difference between those two elements is equal to 1, we can assume that
  63259. // the `currentItem` is a beginning of the nested list because lists in CKEditor 5 always start with the `indent=0` attribute.
  63260. // See: https://github.com/ckeditor/ckeditor5/issues/7805.
  63261. //
  63262. // @param {Object} previousItem
  63263. // @param {Object} currentItem
  63264. // @returns {Boolean}
  63265. function isNewListNeeded( previousItem, currentItem ) {
  63266. if ( !previousItem ) {
  63267. return true;
  63268. }
  63269. if ( previousItem.id !== currentItem.id ) {
  63270. // See: https://github.com/ckeditor/ckeditor5/issues/7805.
  63271. //
  63272. // * List item 1.
  63273. // - Nested list item 1.
  63274. if ( currentItem.indent - previousItem.indent === 1 ) {
  63275. return false;
  63276. }
  63277. return true;
  63278. }
  63279. const previousSibling = currentItem.element.previousSibling;
  63280. if ( !previousSibling ) {
  63281. return true;
  63282. }
  63283. // Even with the same id the list does not have to be continuous (#43).
  63284. return !isList( previousSibling );
  63285. }
  63286. function isList( element ) {
  63287. return element.is( 'element', 'ol' ) || element.is( 'element', 'ul' );
  63288. }
  63289. // Calculates the indentation difference between two given list items (based on the indent attribute
  63290. // extracted from the `mso-list` style, see #getListItemData).
  63291. //
  63292. // @param {Object} previousItem
  63293. // @param {Object} currentItem
  63294. // @returns {Number}
  63295. function getIndentationDifference( previousItem, currentItem ) {
  63296. return previousItem ? currentItem.indent - previousItem.indent : currentItem.indent - 1;
  63297. }
  63298. // Finds the parent list element (ul/ol) of a given list element with indentation level lower by a given value.
  63299. //
  63300. // @param {module:engine/view/element~Element} listElement List element from which to start looking for a parent list.
  63301. // @param {Number} indentationDifference Indentation difference between lists.
  63302. // @returns {module:engine/view/element~Element} Found list element with indentation level lower by a given value.
  63303. function findParentListAtLevel( listElement, indentationDifference ) {
  63304. const ancestors = listElement.getAncestors( { parentFirst: true } );
  63305. let parentList = null;
  63306. let levelChange = 0;
  63307. for ( const ancestor of ancestors ) {
  63308. if ( ancestor.name === 'ul' || ancestor.name === 'ol' ) {
  63309. levelChange++;
  63310. }
  63311. if ( levelChange === indentationDifference ) {
  63312. parentList = ancestor;
  63313. break;
  63314. }
  63315. }
  63316. return parentList;
  63317. }
  63318. /***/ }),
  63319. /***/ "./node_modules/@ckeditor/ckeditor5-paste-from-office/src/filters/parse.js":
  63320. /*!*********************************************************************************!*\
  63321. !*** ./node_modules/@ckeditor/ckeditor5-paste-from-office/src/filters/parse.js ***!
  63322. \*********************************************************************************/
  63323. /*! exports provided: parseHtml */
  63324. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  63325. "use strict";
  63326. __webpack_require__.r(__webpack_exports__);
  63327. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "parseHtml", function() { return parseHtml; });
  63328. /* harmony import */ var ckeditor5_src_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/engine */ "./node_modules/ckeditor5/src/engine.js");
  63329. /* harmony import */ var _space__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./space */ "./node_modules/@ckeditor/ckeditor5-paste-from-office/src/filters/space.js");
  63330. /**
  63331. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  63332. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  63333. */
  63334. /**
  63335. * @module paste-from-office/filters/parse
  63336. */
  63337. /* globals DOMParser */
  63338. /**
  63339. * Parses provided HTML extracting contents of `<body>` and `<style>` tags.
  63340. *
  63341. * @param {String} htmlString HTML string to be parsed.
  63342. * @param {module:engine/view/stylesmap~StylesProcessor} stylesProcessor
  63343. * @returns {Object} result
  63344. * @returns {module:engine/view/documentfragment~DocumentFragment} result.body Parsed body
  63345. * content as a traversable structure.
  63346. * @returns {String} result.bodyString Entire body content as a string.
  63347. * @returns {Array.<CSSStyleSheet>} result.styles Array of native `CSSStyleSheet` objects, each representing
  63348. * separate `style` tag from the source HTML.
  63349. * @returns {String} result.stylesString All `style` tags contents combined in the order of occurrence into one string.
  63350. */
  63351. function parseHtml( htmlString, stylesProcessor ) {
  63352. const domParser = new DOMParser();
  63353. // Remove Word specific "if comments" so content inside is not omitted by the parser.
  63354. htmlString = htmlString.replace( /<!--\[if gte vml 1]>/g, '' );
  63355. const normalizedHtml = Object(_space__WEBPACK_IMPORTED_MODULE_1__["normalizeSpacing"])( cleanContentAfterBody( htmlString ) );
  63356. // Parse htmlString as native Document object.
  63357. const htmlDocument = domParser.parseFromString( normalizedHtml, 'text/html' );
  63358. Object(_space__WEBPACK_IMPORTED_MODULE_1__["normalizeSpacerunSpans"])( htmlDocument );
  63359. // Get `innerHTML` first as transforming to View modifies the source document.
  63360. const bodyString = htmlDocument.body.innerHTML;
  63361. // Transform document.body to View.
  63362. const bodyView = documentToView( htmlDocument, stylesProcessor );
  63363. // Extract stylesheets.
  63364. const stylesObject = extractStyles( htmlDocument );
  63365. return {
  63366. body: bodyView,
  63367. bodyString,
  63368. styles: stylesObject.styles,
  63369. stylesString: stylesObject.stylesString
  63370. };
  63371. }
  63372. // Transforms native `Document` object into {@link module:engine/view/documentfragment~DocumentFragment}.
  63373. //
  63374. // @param {Document} htmlDocument Native `Document` object to be transformed.
  63375. // @param {module:engine/view/stylesmap~StylesProcessor} stylesProcessor
  63376. // @returns {module:engine/view/documentfragment~DocumentFragment}
  63377. function documentToView( htmlDocument, stylesProcessor ) {
  63378. const viewDocument = new ckeditor5_src_engine__WEBPACK_IMPORTED_MODULE_0__["ViewDocument"]( stylesProcessor );
  63379. const domConverter = new ckeditor5_src_engine__WEBPACK_IMPORTED_MODULE_0__["DomConverter"]( viewDocument, { blockFillerMode: 'nbsp' } );
  63380. const fragment = htmlDocument.createDocumentFragment();
  63381. const nodes = htmlDocument.body.childNodes;
  63382. while ( nodes.length > 0 ) {
  63383. fragment.appendChild( nodes[ 0 ] );
  63384. }
  63385. return domConverter.domToView( fragment );
  63386. }
  63387. // Extracts both `CSSStyleSheet` and string representation from all `style` elements available in a provided `htmlDocument`.
  63388. //
  63389. // @param {Document} htmlDocument Native `Document` object from which styles will be extracted.
  63390. // @returns {Object} result
  63391. // @returns {Array.<CSSStyleSheet>} result.styles Array of native `CSSStyleSheet` object, each representing
  63392. // separate `style` tag from the source object.
  63393. // @returns {String} result.stylesString All `style` tags contents combined in the order of occurrence as one string.
  63394. function extractStyles( htmlDocument ) {
  63395. const styles = [];
  63396. const stylesString = [];
  63397. const styleTags = Array.from( htmlDocument.getElementsByTagName( 'style' ) );
  63398. for ( const style of styleTags ) {
  63399. if ( style.sheet && style.sheet.cssRules && style.sheet.cssRules.length ) {
  63400. styles.push( style.sheet );
  63401. stylesString.push( style.innerHTML );
  63402. }
  63403. }
  63404. return {
  63405. styles,
  63406. stylesString: stylesString.join( ' ' )
  63407. };
  63408. }
  63409. // Removes leftover content from between closing </body> and closing </html> tag:
  63410. //
  63411. // <html><body><p>Foo Bar</p></body><span>Fo</span></html> -> <html><body><p>Foo Bar</p></body></html>
  63412. //
  63413. // This function is used as specific browsers (Edge) add some random content after `body` tag when pasting from Word.
  63414. // @param {String} htmlString The HTML string to be cleaned.
  63415. // @returns {String} The HTML string with leftover content removed.
  63416. function cleanContentAfterBody( htmlString ) {
  63417. const bodyCloseTag = '</body>';
  63418. const htmlCloseTag = '</html>';
  63419. const bodyCloseIndex = htmlString.indexOf( bodyCloseTag );
  63420. if ( bodyCloseIndex < 0 ) {
  63421. return htmlString;
  63422. }
  63423. const htmlCloseIndex = htmlString.indexOf( htmlCloseTag, bodyCloseIndex + bodyCloseTag.length );
  63424. return htmlString.substring( 0, bodyCloseIndex + bodyCloseTag.length ) +
  63425. ( htmlCloseIndex >= 0 ? htmlString.substring( htmlCloseIndex ) : '' );
  63426. }
  63427. /***/ }),
  63428. /***/ "./node_modules/@ckeditor/ckeditor5-paste-from-office/src/filters/removeboldwrapper.js":
  63429. /*!*********************************************************************************************!*\
  63430. !*** ./node_modules/@ckeditor/ckeditor5-paste-from-office/src/filters/removeboldwrapper.js ***!
  63431. \*********************************************************************************************/
  63432. /*! exports provided: default */
  63433. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  63434. "use strict";
  63435. __webpack_require__.r(__webpack_exports__);
  63436. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return removeBoldWrapper; });
  63437. /**
  63438. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  63439. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  63440. */
  63441. /**
  63442. * @module paste-from-office/filters/removeboldwrapper
  63443. */
  63444. /**
  63445. * Removes `<b>` tag wrapper added by Google Docs to a copied content.
  63446. *
  63447. * @param {module:engine/view/documentfragment~DocumentFragment} documentFragment element `data.content` obtained from clipboard
  63448. * @param {module:engine/view/upcastwriter~UpcastWriter} writer
  63449. */
  63450. function removeBoldWrapper( documentFragment, writer ) {
  63451. for ( const child of documentFragment.getChildren() ) {
  63452. if ( child.is( 'element', 'b' ) && child.getStyle( 'font-weight' ) === 'normal' ) {
  63453. const childIndex = documentFragment.getChildIndex( child );
  63454. writer.remove( child );
  63455. writer.insertChild( childIndex, child.getChildren(), documentFragment );
  63456. }
  63457. }
  63458. }
  63459. /***/ }),
  63460. /***/ "./node_modules/@ckeditor/ckeditor5-paste-from-office/src/filters/space.js":
  63461. /*!*********************************************************************************!*\
  63462. !*** ./node_modules/@ckeditor/ckeditor5-paste-from-office/src/filters/space.js ***!
  63463. \*********************************************************************************/
  63464. /*! exports provided: normalizeSpacing, normalizeSpacerunSpans */
  63465. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  63466. "use strict";
  63467. __webpack_require__.r(__webpack_exports__);
  63468. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "normalizeSpacing", function() { return normalizeSpacing; });
  63469. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "normalizeSpacerunSpans", function() { return normalizeSpacerunSpans; });
  63470. /**
  63471. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  63472. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  63473. */
  63474. /**
  63475. * @module paste-from-office/filters/space
  63476. */
  63477. /**
  63478. * Replaces last space preceding elements closing tag with `&nbsp;`. Such operation prevents spaces from being removed
  63479. * during further DOM/View processing (see especially {@link module:engine/view/domconverter~DomConverter#_processDataFromDomText}).
  63480. * This method also takes into account Word specific `<o:p></o:p>` empty tags.
  63481. * Additionally multiline sequences of spaces and new lines between tags are removed (see #39 and #40).
  63482. *
  63483. * @param {String} htmlString HTML string in which spacing should be normalized.
  63484. * @returns {String} Input HTML with spaces normalized.
  63485. */
  63486. function normalizeSpacing( htmlString ) {
  63487. // Run normalizeSafariSpaceSpans() two times to cover nested spans.
  63488. return normalizeSafariSpaceSpans( normalizeSafariSpaceSpans( htmlString ) )
  63489. // Remove all \r\n from "spacerun spans" so the last replace line doesn't strip all whitespaces.
  63490. .replace( /(<span\s+style=['"]mso-spacerun:yes['"]>[^\S\r\n]*?)[\r\n]+([^\S\r\n]*<\/span>)/g, '$1$2' )
  63491. .replace( /<span\s+style=['"]mso-spacerun:yes['"]><\/span>/g, '' )
  63492. .replace( / <\//g, '\u00A0</' )
  63493. .replace( / <o:p><\/o:p>/g, '\u00A0<o:p></o:p>' )
  63494. // Remove <o:p> block filler from empty paragraph. Safari uses \u00A0 instead of &nbsp;.
  63495. .replace( /<o:p>(&nbsp;|\u00A0)<\/o:p>/g, '' )
  63496. // Remove all whitespaces when they contain any \r or \n.
  63497. .replace( />([^\S\r\n]*[\r\n]\s*)</g, '><' );
  63498. }
  63499. /**
  63500. * Normalizes spacing in special Word `spacerun spans` (`<span style='mso-spacerun:yes'>\s+</span>`) by replacing
  63501. * all spaces with `&nbsp; ` pairs. This prevents spaces from being removed during further DOM/View processing
  63502. * (see especially {@link module:engine/view/domconverter~DomConverter#_processDataFromDomText}).
  63503. *
  63504. * @param {Document} htmlDocument Native `Document` object in which spacing should be normalized.
  63505. */
  63506. function normalizeSpacerunSpans( htmlDocument ) {
  63507. htmlDocument.querySelectorAll( 'span[style*=spacerun]' ).forEach( el => {
  63508. const innerTextLength = el.innerText.length || 0;
  63509. el.innerHTML = Array( innerTextLength + 1 ).join( '\u00A0 ' ).substr( 0, innerTextLength );
  63510. } );
  63511. }
  63512. // Normalizes specific spacing generated by Safari when content pasted from Word (`<span class="Apple-converted-space"> </span>`)
  63513. // by replacing all spaces sequences longer than 1 space with `&nbsp; ` pairs. This prevents spaces from being removed during
  63514. // further DOM/View processing (see especially {@link module:engine/view/domconverter~DomConverter#_processDataFromDomText}).
  63515. //
  63516. // This function is similar to {@link module:clipboard/utils/normalizeclipboarddata normalizeClipboardData util} but uses
  63517. // regular spaces / &nbsp; sequence for replacement.
  63518. //
  63519. // @param {String} htmlString HTML string in which spacing should be normalized
  63520. // @returns {String} Input HTML with spaces normalized.
  63521. function normalizeSafariSpaceSpans( htmlString ) {
  63522. return htmlString.replace( /<span(?: class="Apple-converted-space"|)>(\s+)<\/span>/g, ( fullMatch, spaces ) => {
  63523. return spaces.length === 1 ? ' ' : Array( spaces.length + 1 ).join( '\u00A0 ' ).substr( 0, spaces.length );
  63524. } );
  63525. }
  63526. /***/ }),
  63527. /***/ "./node_modules/@ckeditor/ckeditor5-paste-from-office/src/normalizers/googledocsnormalizer.js":
  63528. /*!****************************************************************************************************!*\
  63529. !*** ./node_modules/@ckeditor/ckeditor5-paste-from-office/src/normalizers/googledocsnormalizer.js ***!
  63530. \****************************************************************************************************/
  63531. /*! exports provided: default */
  63532. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  63533. "use strict";
  63534. __webpack_require__.r(__webpack_exports__);
  63535. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return GoogleDocsNormalizer; });
  63536. /* harmony import */ var ckeditor5_src_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/engine */ "./node_modules/ckeditor5/src/engine.js");
  63537. /* harmony import */ var _filters_removeboldwrapper__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../filters/removeboldwrapper */ "./node_modules/@ckeditor/ckeditor5-paste-from-office/src/filters/removeboldwrapper.js");
  63538. /* harmony import */ var _filters_list__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../filters/list */ "./node_modules/@ckeditor/ckeditor5-paste-from-office/src/filters/list.js");
  63539. /**
  63540. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  63541. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  63542. */
  63543. /**
  63544. * @module paste-from-office/normalizers/googledocsnormalizer
  63545. */
  63546. const googleDocsMatch = /id=("|')docs-internal-guid-[-0-9a-f]+("|')/i;
  63547. /**
  63548. * Normalizer for the content pasted from Google Docs.
  63549. *
  63550. * @implements module:paste-from-office/normalizer~Normalizer
  63551. */
  63552. class GoogleDocsNormalizer {
  63553. /**
  63554. * Creates a new `GoogleDocsNormalizer` instance.
  63555. *
  63556. * @param {module:engine/view/document~Document} document View document.
  63557. */
  63558. constructor( document ) {
  63559. /**
  63560. * @readonly
  63561. * @type {module:engine/view/document~Document}
  63562. */
  63563. this.document = document;
  63564. }
  63565. /**
  63566. * @inheritDoc
  63567. */
  63568. isActive( htmlString ) {
  63569. return googleDocsMatch.test( htmlString );
  63570. }
  63571. /**
  63572. * @inheritDoc
  63573. */
  63574. execute( data ) {
  63575. const writer = new ckeditor5_src_engine__WEBPACK_IMPORTED_MODULE_0__["UpcastWriter"]( this.document );
  63576. Object(_filters_removeboldwrapper__WEBPACK_IMPORTED_MODULE_1__["default"])( data.content, writer );
  63577. Object(_filters_list__WEBPACK_IMPORTED_MODULE_2__["unwrapParagraphInListItem"])( data.content, writer );
  63578. }
  63579. }
  63580. /***/ }),
  63581. /***/ "./node_modules/@ckeditor/ckeditor5-paste-from-office/src/normalizers/mswordnormalizer.js":
  63582. /*!************************************************************************************************!*\
  63583. !*** ./node_modules/@ckeditor/ckeditor5-paste-from-office/src/normalizers/mswordnormalizer.js ***!
  63584. \************************************************************************************************/
  63585. /*! exports provided: default */
  63586. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  63587. "use strict";
  63588. __webpack_require__.r(__webpack_exports__);
  63589. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return MSWordNormalizer; });
  63590. /* harmony import */ var _filters_parse__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../filters/parse */ "./node_modules/@ckeditor/ckeditor5-paste-from-office/src/filters/parse.js");
  63591. /* harmony import */ var _filters_list__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../filters/list */ "./node_modules/@ckeditor/ckeditor5-paste-from-office/src/filters/list.js");
  63592. /* harmony import */ var _filters_image__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../filters/image */ "./node_modules/@ckeditor/ckeditor5-paste-from-office/src/filters/image.js");
  63593. /**
  63594. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  63595. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  63596. */
  63597. /**
  63598. * @module paste-from-office/normalizers/mswordnormalizer
  63599. */
  63600. const msWordMatch1 = /<meta\s*name="?generator"?\s*content="?microsoft\s*word\s*\d+"?\/?>/i;
  63601. const msWordMatch2 = /xmlns:o="urn:schemas-microsoft-com/i;
  63602. /**
  63603. * Normalizer for the content pasted from Microsoft Word.
  63604. *
  63605. * @implements module:paste-from-office/normalizer~Normalizer
  63606. */
  63607. class MSWordNormalizer {
  63608. /**
  63609. * Creates a new `MSWordNormalizer` instance.
  63610. *
  63611. * @param {module:engine/view/document~Document} document View document.
  63612. */
  63613. constructor( document ) {
  63614. /**
  63615. * @readonly
  63616. * @type {module:engine/view/document~Document}
  63617. */
  63618. this.document = document;
  63619. }
  63620. /**
  63621. * @inheritDoc
  63622. */
  63623. isActive( htmlString ) {
  63624. return msWordMatch1.test( htmlString ) || msWordMatch2.test( htmlString );
  63625. }
  63626. /**
  63627. * @inheritDoc
  63628. */
  63629. execute( data ) {
  63630. const { body, stylesString } = Object(_filters_parse__WEBPACK_IMPORTED_MODULE_0__["parseHtml"])( data.dataTransfer.getData( 'text/html' ), this.document.stylesProcessor );
  63631. Object(_filters_list__WEBPACK_IMPORTED_MODULE_1__["transformListItemLikeElementsIntoLists"])( body, stylesString );
  63632. Object(_filters_image__WEBPACK_IMPORTED_MODULE_2__["replaceImagesSourceWithBase64"])( body, data.dataTransfer.getData( 'text/rtf' ) );
  63633. data.content = body;
  63634. }
  63635. }
  63636. /***/ }),
  63637. /***/ "./node_modules/@ckeditor/ckeditor5-paste-from-office/src/pastefromoffice.js":
  63638. /*!***********************************************************************************!*\
  63639. !*** ./node_modules/@ckeditor/ckeditor5-paste-from-office/src/pastefromoffice.js ***!
  63640. \***********************************************************************************/
  63641. /*! exports provided: default */
  63642. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  63643. "use strict";
  63644. __webpack_require__.r(__webpack_exports__);
  63645. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return PasteFromOffice; });
  63646. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  63647. /* harmony import */ var ckeditor5_src_clipboard__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/clipboard */ "./node_modules/ckeditor5/src/clipboard.js");
  63648. /* harmony import */ var _normalizers_googledocsnormalizer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./normalizers/googledocsnormalizer */ "./node_modules/@ckeditor/ckeditor5-paste-from-office/src/normalizers/googledocsnormalizer.js");
  63649. /* harmony import */ var _normalizers_mswordnormalizer__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./normalizers/mswordnormalizer */ "./node_modules/@ckeditor/ckeditor5-paste-from-office/src/normalizers/mswordnormalizer.js");
  63650. /**
  63651. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  63652. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  63653. */
  63654. /**
  63655. * @module paste-from-office/pastefromoffice
  63656. */
  63657. /**
  63658. * The Paste from Office plugin.
  63659. *
  63660. * This plugin handles content pasted from Office apps and transforms it (if necessary)
  63661. * to a valid structure which can then be understood by the editor features.
  63662. *
  63663. * Transformation is made by a set of predefined {@link module:paste-from-office/normalizer~Normalizer normalizers}.
  63664. * This plugin includes following normalizers:
  63665. * * {@link module:paste-from-office/normalizers/mswordnormalizer~MSWordNormalizer Microsoft Word normalizer}
  63666. * * {@link module:paste-from-office/normalizers/googledocsnormalizer~GoogleDocsNormalizer Google Docs normalizer}
  63667. *
  63668. * For more information about this feature check the {@glink api/paste-from-office package page}.
  63669. *
  63670. * @extends module:core/plugin~Plugin
  63671. */
  63672. class PasteFromOffice extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  63673. /**
  63674. * @inheritDoc
  63675. */
  63676. static get pluginName() {
  63677. return 'PasteFromOffice';
  63678. }
  63679. /**
  63680. * @inheritDoc
  63681. */
  63682. static get requires() {
  63683. return [ ckeditor5_src_clipboard__WEBPACK_IMPORTED_MODULE_1__["ClipboardPipeline"] ];
  63684. }
  63685. /**
  63686. * @inheritDoc
  63687. */
  63688. init() {
  63689. const editor = this.editor;
  63690. const viewDocument = editor.editing.view.document;
  63691. const normalizers = [];
  63692. normalizers.push( new _normalizers_mswordnormalizer__WEBPACK_IMPORTED_MODULE_3__["default"]( viewDocument ) );
  63693. normalizers.push( new _normalizers_googledocsnormalizer__WEBPACK_IMPORTED_MODULE_2__["default"]( viewDocument ) );
  63694. editor.plugins.get( 'ClipboardPipeline' ).on(
  63695. 'inputTransformation',
  63696. ( evt, data ) => {
  63697. if ( data.isTransformedWithPasteFromOffice ) {
  63698. return;
  63699. }
  63700. const htmlString = data.dataTransfer.getData( 'text/html' );
  63701. const activeNormalizer = normalizers.find( normalizer => normalizer.isActive( htmlString ) );
  63702. if ( activeNormalizer ) {
  63703. activeNormalizer.execute( data );
  63704. data.isTransformedWithPasteFromOffice = true;
  63705. }
  63706. },
  63707. { priority: 'high' }
  63708. );
  63709. }
  63710. }
  63711. /***/ }),
  63712. /***/ "./node_modules/@ckeditor/ckeditor5-remove-format/src/removeformat.js":
  63713. /*!****************************************************************************!*\
  63714. !*** ./node_modules/@ckeditor/ckeditor5-remove-format/src/removeformat.js ***!
  63715. \****************************************************************************/
  63716. /*! exports provided: default */
  63717. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  63718. "use strict";
  63719. __webpack_require__.r(__webpack_exports__);
  63720. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return RemoveFormat; });
  63721. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  63722. /* harmony import */ var _removeformatui__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./removeformatui */ "./node_modules/@ckeditor/ckeditor5-remove-format/src/removeformatui.js");
  63723. /* harmony import */ var _removeformatediting__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./removeformatediting */ "./node_modules/@ckeditor/ckeditor5-remove-format/src/removeformatediting.js");
  63724. /**
  63725. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  63726. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  63727. */
  63728. /**
  63729. * @module remove-format/removeformat
  63730. */
  63731. /**
  63732. * The remove format plugin.
  63733. *
  63734. * This is a "glue" plugin which loads the {@link module:remove-format/removeformatediting~RemoveFormatEditing}
  63735. * and {@link module:remove-format/removeformatui~RemoveFormatUI} plugins.
  63736. *
  63737. * For a detailed overview, check out the {@glink features/remove-format remove format} feature documentation.
  63738. *
  63739. * @extends module:core/plugin~Plugin
  63740. */
  63741. class RemoveFormat extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  63742. /**
  63743. * @inheritDoc
  63744. */
  63745. static get requires() {
  63746. return [ _removeformatediting__WEBPACK_IMPORTED_MODULE_2__["default"], _removeformatui__WEBPACK_IMPORTED_MODULE_1__["default"] ];
  63747. }
  63748. /**
  63749. * @inheritDoc
  63750. */
  63751. static get pluginName() {
  63752. return 'RemoveFormat';
  63753. }
  63754. }
  63755. /***/ }),
  63756. /***/ "./node_modules/@ckeditor/ckeditor5-remove-format/src/removeformatcommand.js":
  63757. /*!***********************************************************************************!*\
  63758. !*** ./node_modules/@ckeditor/ckeditor5-remove-format/src/removeformatcommand.js ***!
  63759. \***********************************************************************************/
  63760. /*! exports provided: default */
  63761. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  63762. "use strict";
  63763. __webpack_require__.r(__webpack_exports__);
  63764. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return RemoveFormatCommand; });
  63765. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  63766. /* harmony import */ var ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/utils */ "./node_modules/ckeditor5/src/utils.js");
  63767. /**
  63768. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  63769. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  63770. */
  63771. /**
  63772. * @module remove-format/removeformatcommand
  63773. */
  63774. /**
  63775. * The remove format command.
  63776. *
  63777. * It is used by the {@link module:remove-format/removeformat~RemoveFormat remove format feature}
  63778. * to clear the formatting in the selection.
  63779. *
  63780. * editor.execute( 'removeFormat' );
  63781. *
  63782. * @extends module:core/command~Command
  63783. */
  63784. class RemoveFormatCommand extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Command"] {
  63785. /**
  63786. * @inheritDoc
  63787. */
  63788. refresh() {
  63789. const model = this.editor.model;
  63790. this.isEnabled = !!Object(ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_1__["first"])( this._getFormattingItems( model.document.selection, model.schema ) );
  63791. }
  63792. /**
  63793. * @inheritDoc
  63794. */
  63795. execute() {
  63796. const model = this.editor.model;
  63797. const schema = model.schema;
  63798. model.change( writer => {
  63799. for ( const item of this._getFormattingItems( model.document.selection, schema ) ) {
  63800. if ( item.is( 'selection' ) ) {
  63801. for ( const attributeName of this._getFormattingAttributes( item, schema ) ) {
  63802. writer.removeSelectionAttribute( attributeName );
  63803. }
  63804. } else {
  63805. // Workaround for items with multiple removable attributes. See
  63806. // https://github.com/ckeditor/ckeditor5-remove-format/pull/1#pullrequestreview-220515609
  63807. const itemRange = writer.createRangeOn( item );
  63808. for ( const attributeName of this._getFormattingAttributes( item, schema ) ) {
  63809. writer.removeAttribute( attributeName, itemRange );
  63810. }
  63811. }
  63812. }
  63813. } );
  63814. }
  63815. /**
  63816. * Returns an iterable of items in a selection (including the selection itself) that have formatting model
  63817. * attributes to be removed by the feature.
  63818. *
  63819. * @protected
  63820. * @param {module:engine/model/documentselection~DocumentSelection} selection
  63821. * @param {module:engine/model/schema~Schema} schema The schema describing the item.
  63822. * @returns {Iterable.<module:engine/model/item~Item>|Iterable.<module:engine/model/documentselection~DocumentSelection>}
  63823. */
  63824. * _getFormattingItems( selection, schema ) {
  63825. const itemHasRemovableFormatting = item => {
  63826. return !!Object(ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_1__["first"])( this._getFormattingAttributes( item, schema ) );
  63827. };
  63828. // Check formatting on selected items that are not blocks.
  63829. for ( const curRange of selection.getRanges() ) {
  63830. for ( const item of curRange.getItems() ) {
  63831. if ( !schema.isBlock( item ) && itemHasRemovableFormatting( item ) ) {
  63832. yield item;
  63833. }
  63834. }
  63835. }
  63836. // Check formatting from selected blocks.
  63837. for ( const block of selection.getSelectedBlocks() ) {
  63838. if ( itemHasRemovableFormatting( block ) ) {
  63839. yield block;
  63840. }
  63841. }
  63842. // Finally the selection might be formatted as well, so make sure to check it.
  63843. if ( itemHasRemovableFormatting( selection ) ) {
  63844. yield selection;
  63845. }
  63846. }
  63847. /**
  63848. * Returns an iterable of formatting attributes of a given model item.
  63849. *
  63850. * **Note:** Formatting items have the `isFormatting` property set to `true`.
  63851. *
  63852. * @protected
  63853. * @param {module:engine/model/item~Item|module:engine/model/documentselection~DocumentSelection} item
  63854. * @param {module:engine/model/schema~Schema} schema The schema describing the item.
  63855. * @returns {Iterable.<String>} The names of formatting attributes found in a given item.
  63856. */
  63857. * _getFormattingAttributes( item, schema ) {
  63858. for ( const [ attributeName ] of item.getAttributes() ) {
  63859. const attributeProperties = schema.getAttributeProperties( attributeName );
  63860. if ( attributeProperties && attributeProperties.isFormatting ) {
  63861. yield attributeName;
  63862. }
  63863. }
  63864. }
  63865. }
  63866. /***/ }),
  63867. /***/ "./node_modules/@ckeditor/ckeditor5-remove-format/src/removeformatediting.js":
  63868. /*!***********************************************************************************!*\
  63869. !*** ./node_modules/@ckeditor/ckeditor5-remove-format/src/removeformatediting.js ***!
  63870. \***********************************************************************************/
  63871. /*! exports provided: default */
  63872. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  63873. "use strict";
  63874. __webpack_require__.r(__webpack_exports__);
  63875. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return RemoveFormatEditing; });
  63876. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  63877. /* harmony import */ var _removeformatcommand__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./removeformatcommand */ "./node_modules/@ckeditor/ckeditor5-remove-format/src/removeformatcommand.js");
  63878. /**
  63879. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  63880. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  63881. */
  63882. /**
  63883. * @module remove-format/removeformatediting
  63884. */
  63885. /**
  63886. * The remove format editing plugin.
  63887. *
  63888. * It registers the {@link module:remove-format/removeformatcommand~RemoveFormatCommand removeFormat} command.
  63889. *
  63890. * @extends module:core/plugin~Plugin
  63891. */
  63892. class RemoveFormatEditing extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  63893. /**
  63894. * @inheritDoc
  63895. */
  63896. static get pluginName() {
  63897. return 'RemoveFormatEditing';
  63898. }
  63899. /**
  63900. * @inheritDoc
  63901. */
  63902. init() {
  63903. const editor = this.editor;
  63904. editor.commands.add( 'removeFormat', new _removeformatcommand__WEBPACK_IMPORTED_MODULE_1__["default"]( editor ) );
  63905. }
  63906. }
  63907. /***/ }),
  63908. /***/ "./node_modules/@ckeditor/ckeditor5-remove-format/src/removeformatui.js":
  63909. /*!******************************************************************************!*\
  63910. !*** ./node_modules/@ckeditor/ckeditor5-remove-format/src/removeformatui.js ***!
  63911. \******************************************************************************/
  63912. /*! exports provided: default */
  63913. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  63914. "use strict";
  63915. __webpack_require__.r(__webpack_exports__);
  63916. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return RemoveFormatUI; });
  63917. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  63918. /* harmony import */ var ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/ui */ "./node_modules/ckeditor5/src/ui.js");
  63919. /* harmony import */ var _theme_icons_remove_format_svg__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../theme/icons/remove-format.svg */ "./node_modules/@ckeditor/ckeditor5-remove-format/theme/icons/remove-format.svg");
  63920. /**
  63921. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  63922. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  63923. */
  63924. /**
  63925. * @module remove-format/removeformatui
  63926. */
  63927. const REMOVE_FORMAT = 'removeFormat';
  63928. /**
  63929. * The remove format UI plugin. It registers the `'removeFormat'` button which can be
  63930. * used in the toolbar.
  63931. *
  63932. * @extends module:core/plugin~Plugin
  63933. */
  63934. class RemoveFormatUI extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  63935. /**
  63936. * @inheritDoc
  63937. */
  63938. static get pluginName() {
  63939. return 'RemoveFormatUI';
  63940. }
  63941. /**
  63942. * @inheritDoc
  63943. */
  63944. init() {
  63945. const editor = this.editor;
  63946. const t = editor.t;
  63947. editor.ui.componentFactory.add( REMOVE_FORMAT, locale => {
  63948. const command = editor.commands.get( REMOVE_FORMAT );
  63949. const view = new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__["ButtonView"]( locale );
  63950. view.set( {
  63951. label: t( 'Remove Format' ),
  63952. icon: _theme_icons_remove_format_svg__WEBPACK_IMPORTED_MODULE_2__["default"],
  63953. tooltip: true
  63954. } );
  63955. view.bind( 'isOn', 'isEnabled' ).to( command, 'value', 'isEnabled' );
  63956. // Execute the command.
  63957. this.listenTo( view, 'execute', () => {
  63958. editor.execute( REMOVE_FORMAT );
  63959. editor.editing.view.focus();
  63960. } );
  63961. return view;
  63962. } );
  63963. }
  63964. }
  63965. /***/ }),
  63966. /***/ "./node_modules/@ckeditor/ckeditor5-remove-format/theme/icons/remove-format.svg":
  63967. /*!**************************************************************************************!*\
  63968. !*** ./node_modules/@ckeditor/ckeditor5-remove-format/theme/icons/remove-format.svg ***!
  63969. \**************************************************************************************/
  63970. /*! exports provided: default */
  63971. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  63972. "use strict";
  63973. __webpack_require__.r(__webpack_exports__);
  63974. /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M8.69 14.915c.053.052.173.083.36.093a.366.366 0 0 1 .345.485l-.003.01a.738.738 0 0 1-.697.497h-2.67a.374.374 0 0 1-.353-.496l.013-.038a.681.681 0 0 1 .644-.458c.197-.012.325-.043.386-.093a.28.28 0 0 0 .072-.11L9.592 4.5H6.269c-.359-.017-.609.013-.75.09-.142.078-.289.265-.442.563-.192.29-.516.464-.864.464H4.17a.43.43 0 0 1-.407-.569L4.46 3h13.08l-.62 2.043a.81.81 0 0 1-.775.574h-.114a.486.486 0 0 1-.486-.486c.001-.284-.054-.464-.167-.54-.112-.076-.367-.106-.766-.091h-3.28l-2.68 10.257c-.006.074.007.127.038.158zM3 17h8a.5.5 0 1 1 0 1H3a.5.5 0 1 1 0-1zm11.299 1.17a.75.75 0 1 1-1.06-1.06l1.414-1.415-1.415-1.414a.75.75 0 0 1 1.06-1.06l1.415 1.414 1.414-1.415a.75.75 0 1 1 1.06 1.06l-1.413 1.415 1.414 1.415a.75.75 0 0 1-1.06 1.06l-1.415-1.414-1.414 1.414z\"/></svg>");
  63975. /***/ }),
  63976. /***/ "./node_modules/@ckeditor/ckeditor5-select-all/src/index.js":
  63977. /*!******************************************************************!*\
  63978. !*** ./node_modules/@ckeditor/ckeditor5-select-all/src/index.js ***!
  63979. \******************************************************************/
  63980. /*! exports provided: SelectAll, SelectAllEditing, SelectAllUI */
  63981. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  63982. "use strict";
  63983. __webpack_require__.r(__webpack_exports__);
  63984. /* harmony import */ var _selectall__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./selectall */ "./node_modules/@ckeditor/ckeditor5-select-all/src/selectall.js");
  63985. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SelectAll", function() { return _selectall__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  63986. /* harmony import */ var _selectallediting__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./selectallediting */ "./node_modules/@ckeditor/ckeditor5-select-all/src/selectallediting.js");
  63987. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SelectAllEditing", function() { return _selectallediting__WEBPACK_IMPORTED_MODULE_1__["default"]; });
  63988. /* harmony import */ var _selectallui__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./selectallui */ "./node_modules/@ckeditor/ckeditor5-select-all/src/selectallui.js");
  63989. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SelectAllUI", function() { return _selectallui__WEBPACK_IMPORTED_MODULE_2__["default"]; });
  63990. /**
  63991. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  63992. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  63993. */
  63994. /**
  63995. * @module select-all
  63996. */
  63997. /***/ }),
  63998. /***/ "./node_modules/@ckeditor/ckeditor5-select-all/src/selectall.js":
  63999. /*!**********************************************************************!*\
  64000. !*** ./node_modules/@ckeditor/ckeditor5-select-all/src/selectall.js ***!
  64001. \**********************************************************************/
  64002. /*! exports provided: default */
  64003. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  64004. "use strict";
  64005. __webpack_require__.r(__webpack_exports__);
  64006. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return SelectAll; });
  64007. /* 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");
  64008. /* harmony import */ var _selectallediting__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./selectallediting */ "./node_modules/@ckeditor/ckeditor5-select-all/src/selectallediting.js");
  64009. /* harmony import */ var _selectallui__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./selectallui */ "./node_modules/@ckeditor/ckeditor5-select-all/src/selectallui.js");
  64010. /**
  64011. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  64012. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  64013. */
  64014. /**
  64015. * @module select-all/selectall
  64016. */
  64017. /**
  64018. * The select all feature.
  64019. *
  64020. * This is a "glue" plugin which loads the {@link module:select-all/selectallediting~SelectAllEditing select all editing feature}
  64021. * and the {@link module:select-all/selectallui~SelectAllUI select all UI feature}.
  64022. *
  64023. * Please refer to the documentation of individual features to learn more.
  64024. *
  64025. * @extends module:core/plugin~Plugin
  64026. */
  64027. class SelectAll extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
  64028. /**
  64029. * @inheritDoc
  64030. */
  64031. static get requires() {
  64032. return [ _selectallediting__WEBPACK_IMPORTED_MODULE_1__["default"], _selectallui__WEBPACK_IMPORTED_MODULE_2__["default"] ];
  64033. }
  64034. /**
  64035. * @inheritDoc
  64036. */
  64037. static get pluginName() {
  64038. return 'SelectAll';
  64039. }
  64040. }
  64041. /***/ }),
  64042. /***/ "./node_modules/@ckeditor/ckeditor5-select-all/src/selectallcommand.js":
  64043. /*!*****************************************************************************!*\
  64044. !*** ./node_modules/@ckeditor/ckeditor5-select-all/src/selectallcommand.js ***!
  64045. \*****************************************************************************/
  64046. /*! exports provided: default */
  64047. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  64048. "use strict";
  64049. __webpack_require__.r(__webpack_exports__);
  64050. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return SelectAllCommand; });
  64051. /* 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");
  64052. /**
  64053. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  64054. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  64055. */
  64056. /**
  64057. * @module select-all/selectallcommand
  64058. */
  64059. /**
  64060. * The select all command.
  64061. *
  64062. * It is used by the {@link module:select-all/selectallediting~SelectAllEditing select all editing feature} to handle
  64063. * the <kbd>Ctrl/⌘</kbd>+<kbd>A</kbd> keystroke.
  64064. *
  64065. * Executing this command changes the {@glink framework/guides/architecture/editing-engine#model model}
  64066. * selection so it contains the entire content of the editable root of the editor the selection is
  64067. * {@link module:engine/model/selection~Selection#anchor anchored} in.
  64068. *
  64069. * If the selection was anchored in a {@glink framework/guides/tutorials/implementing-a-block-widget nested editable}
  64070. * (e.g. a caption of an image), the new selection will contain its entire content. Successive executions of this command
  64071. * will expand the selection to encompass more and more content up to the entire editable root of the editor.
  64072. *
  64073. * @extends module:core/command~Command
  64074. */
  64075. class SelectAllCommand extends _ckeditor_ckeditor5_core_src_command__WEBPACK_IMPORTED_MODULE_0__["default"] {
  64076. /**
  64077. * @inheritDoc
  64078. */
  64079. execute() {
  64080. const model = this.editor.model;
  64081. const selection = model.document.selection;
  64082. let scopeElement = model.schema.getLimitElement( selection );
  64083. // If an entire scope is selected, or the selection's ancestor is not a scope yet,
  64084. // browse through ancestors to find the enclosing parent scope.
  64085. if ( selection.containsEntireContent( scopeElement ) || !isSelectAllScope( model.schema, scopeElement ) ) {
  64086. do {
  64087. scopeElement = scopeElement.parent;
  64088. // Do nothing, if the entire `root` is already selected.
  64089. if ( !scopeElement ) {
  64090. return;
  64091. }
  64092. } while ( !isSelectAllScope( model.schema, scopeElement ) );
  64093. }
  64094. model.change( writer => {
  64095. writer.setSelection( scopeElement, 'in' );
  64096. } );
  64097. }
  64098. }
  64099. // Checks whether the element is a valid select-all scope.
  64100. // Returns true, if the element is a {@link module:engine/model/schema~Schema#isLimit limit},
  64101. // and can contain any text or paragraph.
  64102. //
  64103. // @param {module:engine/model/schema~Schema} schema The schema to check against.
  64104. // @param {module:engine/model/element~Element} element
  64105. // @return {Boolean}
  64106. function isSelectAllScope( schema, element ) {
  64107. return schema.isLimit( element ) && ( schema.checkChild( element, '$text' ) || schema.checkChild( element, 'paragraph' ) );
  64108. }
  64109. /***/ }),
  64110. /***/ "./node_modules/@ckeditor/ckeditor5-select-all/src/selectallediting.js":
  64111. /*!*****************************************************************************!*\
  64112. !*** ./node_modules/@ckeditor/ckeditor5-select-all/src/selectallediting.js ***!
  64113. \*****************************************************************************/
  64114. /*! exports provided: default */
  64115. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  64116. "use strict";
  64117. __webpack_require__.r(__webpack_exports__);
  64118. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return SelectAllEditing; });
  64119. /* 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");
  64120. /* 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");
  64121. /* harmony import */ var _selectallcommand__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./selectallcommand */ "./node_modules/@ckeditor/ckeditor5-select-all/src/selectallcommand.js");
  64122. /**
  64123. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  64124. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  64125. */
  64126. /**
  64127. * @module select-all/selectallediting
  64128. */
  64129. const SELECT_ALL_KEYSTROKE = Object(_ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_1__["parseKeystroke"])( 'Ctrl+A' );
  64130. /**
  64131. * The select all editing feature.
  64132. *
  64133. * It registers the `'selectAll'` {@link module:select-all/selectallcommand~SelectAllCommand command}
  64134. * and the <kbd>Ctrl/⌘</kbd>+<kbd>A</kbd> keystroke listener which executes it.
  64135. *
  64136. * @extends module:core/plugin~Plugin
  64137. */
  64138. class SelectAllEditing extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
  64139. /**
  64140. * @inheritDoc
  64141. */
  64142. static get pluginName() {
  64143. return 'SelectAllEditing';
  64144. }
  64145. /**
  64146. * @inheritDoc
  64147. */
  64148. init() {
  64149. const editor = this.editor;
  64150. const view = editor.editing.view;
  64151. const viewDocument = view.document;
  64152. editor.commands.add( 'selectAll', new _selectallcommand__WEBPACK_IMPORTED_MODULE_2__["default"]( editor ) );
  64153. this.listenTo( viewDocument, 'keydown', ( eventInfo, domEventData ) => {
  64154. if ( Object(_ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_1__["getCode"])( domEventData ) === SELECT_ALL_KEYSTROKE ) {
  64155. editor.execute( 'selectAll' );
  64156. domEventData.preventDefault();
  64157. }
  64158. } );
  64159. }
  64160. }
  64161. /***/ }),
  64162. /***/ "./node_modules/@ckeditor/ckeditor5-select-all/src/selectallui.js":
  64163. /*!************************************************************************!*\
  64164. !*** ./node_modules/@ckeditor/ckeditor5-select-all/src/selectallui.js ***!
  64165. \************************************************************************/
  64166. /*! exports provided: default */
  64167. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  64168. "use strict";
  64169. __webpack_require__.r(__webpack_exports__);
  64170. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return SelectAllUI; });
  64171. /* 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");
  64172. /* 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");
  64173. /* 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");
  64174. /**
  64175. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  64176. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  64177. */
  64178. /**
  64179. * @module select-all/selectallui
  64180. */
  64181. /**
  64182. * The select all UI feature.
  64183. *
  64184. * It registers the `'selectAll'` UI button in the editor's
  64185. * {@link module:ui/componentfactory~ComponentFactory component factory}. When clicked, the button
  64186. * executes the {@link module:select-all/selectallcommand~SelectAllCommand select all command}.
  64187. *
  64188. * @extends module:core/plugin~Plugin
  64189. */
  64190. class SelectAllUI extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
  64191. /**
  64192. * @inheritDoc
  64193. */
  64194. static get pluginName() {
  64195. return 'SelectAllUI';
  64196. }
  64197. /**
  64198. * @inheritDoc
  64199. */
  64200. init() {
  64201. const editor = this.editor;
  64202. editor.ui.componentFactory.add( 'selectAll', locale => {
  64203. const command = editor.commands.get( 'selectAll' );
  64204. const view = new _ckeditor_ckeditor5_ui_src_button_buttonview__WEBPACK_IMPORTED_MODULE_1__["default"]( locale );
  64205. const t = locale.t;
  64206. view.set( {
  64207. label: t( 'Select all' ),
  64208. icon: _theme_icons_select_all_svg__WEBPACK_IMPORTED_MODULE_2__["default"],
  64209. keystroke: 'Ctrl+A',
  64210. tooltip: true
  64211. } );
  64212. view.bind( 'isOn', 'isEnabled' ).to( command, 'value', 'isEnabled' );
  64213. // Execute the command.
  64214. this.listenTo( view, 'execute', () => {
  64215. editor.execute( 'selectAll' );
  64216. editor.editing.view.focus();
  64217. } );
  64218. return view;
  64219. } );
  64220. }
  64221. }
  64222. /***/ }),
  64223. /***/ "./node_modules/@ckeditor/ckeditor5-select-all/theme/icons/select-all.svg":
  64224. /*!********************************************************************************!*\
  64225. !*** ./node_modules/@ckeditor/ckeditor5-select-all/theme/icons/select-all.svg ***!
  64226. \********************************************************************************/
  64227. /*! exports provided: default */
  64228. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  64229. "use strict";
  64230. __webpack_require__.r(__webpack_exports__);
  64231. /* harmony default export */ __webpack_exports__["default"] = ("<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 20 20\"><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>");
  64232. /***/ }),
  64233. /***/ "./node_modules/@ckeditor/ckeditor5-table/src/commands/insertcolumncommand.js":
  64234. /*!************************************************************************************!*\
  64235. !*** ./node_modules/@ckeditor/ckeditor5-table/src/commands/insertcolumncommand.js ***!
  64236. \************************************************************************************/
  64237. /*! exports provided: default */
  64238. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  64239. "use strict";
  64240. __webpack_require__.r(__webpack_exports__);
  64241. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return InsertColumnCommand; });
  64242. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  64243. /* harmony import */ var _utils_selection__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils/selection */ "./node_modules/@ckeditor/ckeditor5-table/src/utils/selection.js");
  64244. /**
  64245. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  64246. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  64247. */
  64248. /**
  64249. * @module table/commands/insertcolumncommand
  64250. */
  64251. /**
  64252. * The insert column command.
  64253. *
  64254. * The command is registered by {@link module:table/tableediting~TableEditing} as the `'insertTableColumnLeft'` and
  64255. * `'insertTableColumnRight'` editor commands.
  64256. *
  64257. * To insert a column to the left of the selected cell, execute the following command:
  64258. *
  64259. * editor.execute( 'insertTableColumnLeft' );
  64260. *
  64261. * To insert a column to the right of the selected cell, execute the following command:
  64262. *
  64263. * editor.execute( 'insertTableColumnRight' );
  64264. *
  64265. * @extends module:core/command~Command
  64266. */
  64267. class InsertColumnCommand extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Command"] {
  64268. /**
  64269. * Creates a new `InsertColumnCommand` instance.
  64270. *
  64271. * @param {module:core/editor/editor~Editor} editor An editor on which this command will be used.
  64272. * @param {Object} options
  64273. * @param {String} [options.order="right"] The order of insertion relative to the column in which the caret is located.
  64274. * Possible values: `"left"` and `"right"`.
  64275. */
  64276. constructor( editor, options = {} ) {
  64277. super( editor );
  64278. /**
  64279. * The order of insertion relative to the column in which the caret is located.
  64280. *
  64281. * @readonly
  64282. * @member {String} module:table/commands/insertcolumncommand~InsertColumnCommand#order
  64283. */
  64284. this.order = options.order || 'right';
  64285. }
  64286. /**
  64287. * @inheritDoc
  64288. */
  64289. refresh() {
  64290. const selection = this.editor.model.document.selection;
  64291. const isAnyCellSelected = !!Object(_utils_selection__WEBPACK_IMPORTED_MODULE_1__["getSelectionAffectedTableCells"])( selection ).length;
  64292. this.isEnabled = isAnyCellSelected;
  64293. }
  64294. /**
  64295. * Executes the command.
  64296. *
  64297. * Depending on the command's {@link #order} value, it inserts a column to the `'left'` or `'right'` of the column
  64298. * in which the selection is set.
  64299. *
  64300. * @fires execute
  64301. */
  64302. execute() {
  64303. const editor = this.editor;
  64304. const selection = editor.model.document.selection;
  64305. const tableUtils = editor.plugins.get( 'TableUtils' );
  64306. const insertBefore = this.order === 'left';
  64307. const affectedTableCells = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_1__["getSelectionAffectedTableCells"])( selection );
  64308. const columnIndexes = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_1__["getColumnIndexes"])( affectedTableCells );
  64309. const column = insertBefore ? columnIndexes.first : columnIndexes.last;
  64310. const table = affectedTableCells[ 0 ].findAncestor( 'table' );
  64311. tableUtils.insertColumns( table, { columns: 1, at: insertBefore ? column : column + 1 } );
  64312. }
  64313. }
  64314. /***/ }),
  64315. /***/ "./node_modules/@ckeditor/ckeditor5-table/src/commands/insertrowcommand.js":
  64316. /*!*********************************************************************************!*\
  64317. !*** ./node_modules/@ckeditor/ckeditor5-table/src/commands/insertrowcommand.js ***!
  64318. \*********************************************************************************/
  64319. /*! exports provided: default */
  64320. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  64321. "use strict";
  64322. __webpack_require__.r(__webpack_exports__);
  64323. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return InsertRowCommand; });
  64324. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  64325. /* harmony import */ var _utils_selection__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils/selection */ "./node_modules/@ckeditor/ckeditor5-table/src/utils/selection.js");
  64326. /**
  64327. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  64328. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  64329. */
  64330. /**
  64331. * @module table/commands/insertrowcommand
  64332. */
  64333. /**
  64334. * The insert row command.
  64335. *
  64336. * The command is registered by {@link module:table/tableediting~TableEditing} as the `'insertTableRowBelow'` and
  64337. * `'insertTableRowAbove'` editor commands.
  64338. *
  64339. * To insert a row below the selected cell, execute the following command:
  64340. *
  64341. * editor.execute( 'insertTableRowBelow' );
  64342. *
  64343. * To insert a row above the selected cell, execute the following command:
  64344. *
  64345. * editor.execute( 'insertTableRowAbove' );
  64346. *
  64347. * @extends module:core/command~Command
  64348. */
  64349. class InsertRowCommand extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Command"] {
  64350. /**
  64351. * Creates a new `InsertRowCommand` instance.
  64352. *
  64353. * @param {module:core/editor/editor~Editor} editor The editor on which this command will be used.
  64354. * @param {Object} options
  64355. * @param {String} [options.order="below"] The order of insertion relative to the row in which the caret is located.
  64356. * Possible values: `"above"` and `"below"`.
  64357. */
  64358. constructor( editor, options = {} ) {
  64359. super( editor );
  64360. /**
  64361. * The order of insertion relative to the row in which the caret is located.
  64362. *
  64363. * @readonly
  64364. * @member {String} module:table/commands/insertrowcommand~InsertRowCommand#order
  64365. */
  64366. this.order = options.order || 'below';
  64367. }
  64368. /**
  64369. * @inheritDoc
  64370. */
  64371. refresh() {
  64372. const selection = this.editor.model.document.selection;
  64373. const isAnyCellSelected = !!Object(_utils_selection__WEBPACK_IMPORTED_MODULE_1__["getSelectionAffectedTableCells"])( selection ).length;
  64374. this.isEnabled = isAnyCellSelected;
  64375. }
  64376. /**
  64377. * Executes the command.
  64378. *
  64379. * Depending on the command's {@link #order} value, it inserts a row `'below'` or `'above'` the row in which selection is set.
  64380. *
  64381. * @fires execute
  64382. */
  64383. execute() {
  64384. const editor = this.editor;
  64385. const selection = editor.model.document.selection;
  64386. const tableUtils = editor.plugins.get( 'TableUtils' );
  64387. const insertAbove = this.order === 'above';
  64388. const affectedTableCells = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_1__["getSelectionAffectedTableCells"])( selection );
  64389. const rowIndexes = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_1__["getRowIndexes"])( affectedTableCells );
  64390. const row = insertAbove ? rowIndexes.first : rowIndexes.last;
  64391. const table = affectedTableCells[ 0 ].findAncestor( 'table' );
  64392. tableUtils.insertRows( table, { at: insertAbove ? row : row + 1, copyStructureFromAbove: !insertAbove } );
  64393. }
  64394. }
  64395. /***/ }),
  64396. /***/ "./node_modules/@ckeditor/ckeditor5-table/src/commands/inserttablecommand.js":
  64397. /*!***********************************************************************************!*\
  64398. !*** ./node_modules/@ckeditor/ckeditor5-table/src/commands/inserttablecommand.js ***!
  64399. \***********************************************************************************/
  64400. /*! exports provided: default */
  64401. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  64402. "use strict";
  64403. __webpack_require__.r(__webpack_exports__);
  64404. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return InsertTableCommand; });
  64405. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  64406. /* harmony import */ var ckeditor5_src_widget__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/widget */ "./node_modules/ckeditor5/src/widget.js");
  64407. /**
  64408. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  64409. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  64410. */
  64411. /**
  64412. * @module table/commands/inserttablecommand
  64413. */
  64414. /**
  64415. * The insert table command.
  64416. *
  64417. * The command is registered by {@link module:table/tableediting~TableEditing} as the `'insertTable'` editor command.
  64418. *
  64419. * To insert a table at the current selection, execute the command and specify the dimensions:
  64420. *
  64421. * editor.execute( 'insertTable', { rows: 20, columns: 5 } );
  64422. *
  64423. * @extends module:core/command~Command
  64424. */
  64425. class InsertTableCommand extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Command"] {
  64426. /**
  64427. * @inheritDoc
  64428. */
  64429. refresh() {
  64430. const model = this.editor.model;
  64431. const selection = model.document.selection;
  64432. const schema = model.schema;
  64433. this.isEnabled = isAllowedInParent( selection, schema ) &&
  64434. !Object(ckeditor5_src_widget__WEBPACK_IMPORTED_MODULE_1__["checkSelectionOnObject"])( selection, schema );
  64435. }
  64436. /**
  64437. * Executes the command.
  64438. *
  64439. * Inserts a table with the given number of rows and columns into the editor.
  64440. *
  64441. * @param {Object} options
  64442. * @param {Number} [options.rows=2] The number of rows to create in the inserted table.
  64443. * @param {Number} [options.columns=2] The number of columns to create in the inserted table.
  64444. * @param {Number} [options.headingRows=0] The number of heading rows.
  64445. * @param {Number} [options.headingColumns=0] The number of heading columns.
  64446. * @fires execute
  64447. */
  64448. execute( options = {} ) {
  64449. const model = this.editor.model;
  64450. const selection = model.document.selection;
  64451. const tableUtils = this.editor.plugins.get( 'TableUtils' );
  64452. const insertPosition = Object(ckeditor5_src_widget__WEBPACK_IMPORTED_MODULE_1__["findOptimalInsertionPosition"])( selection, model );
  64453. model.change( writer => {
  64454. const table = tableUtils.createTable( writer, options );
  64455. model.insertContent( table, insertPosition );
  64456. writer.setSelection( writer.createPositionAt( table.getNodeByPath( [ 0, 0, 0 ] ), 0 ) );
  64457. } );
  64458. }
  64459. }
  64460. // Checks if the table is allowed in the parent.
  64461. //
  64462. // @param {module:engine/model/selection~Selection|module:engine/model/documentselection~DocumentSelection} selection
  64463. // @param {module:engine/model/schema~Schema} schema
  64464. // @returns {Boolean}
  64465. function isAllowedInParent( selection, schema ) {
  64466. const positionParent = selection.getFirstPosition().parent;
  64467. const validParent = positionParent === positionParent.root ? positionParent : positionParent.parent;
  64468. return schema.checkChild( validParent, 'table' );
  64469. }
  64470. /***/ }),
  64471. /***/ "./node_modules/@ckeditor/ckeditor5-table/src/commands/mergecellcommand.js":
  64472. /*!*********************************************************************************!*\
  64473. !*** ./node_modules/@ckeditor/ckeditor5-table/src/commands/mergecellcommand.js ***!
  64474. \*********************************************************************************/
  64475. /*! exports provided: default */
  64476. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  64477. "use strict";
  64478. __webpack_require__.r(__webpack_exports__);
  64479. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return MergeCellCommand; });
  64480. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  64481. /* harmony import */ var _tablewalker__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../tablewalker */ "./node_modules/@ckeditor/ckeditor5-table/src/tablewalker.js");
  64482. /* harmony import */ var _utils_selection__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils/selection */ "./node_modules/@ckeditor/ckeditor5-table/src/utils/selection.js");
  64483. /* harmony import */ var _utils_common__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils/common */ "./node_modules/@ckeditor/ckeditor5-table/src/utils/common.js");
  64484. /* harmony import */ var _utils_structure__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../utils/structure */ "./node_modules/@ckeditor/ckeditor5-table/src/utils/structure.js");
  64485. /**
  64486. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  64487. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  64488. */
  64489. /**
  64490. * @module table/commands/mergecellcommand
  64491. */
  64492. /**
  64493. * The merge cell command.
  64494. *
  64495. * The command is registered by {@link module:table/tableediting~TableEditing} as the `'mergeTableCellRight'`, `'mergeTableCellLeft'`,
  64496. * `'mergeTableCellUp'` and `'mergeTableCellDown'` editor commands.
  64497. *
  64498. * To merge a table cell at the current selection with another cell, execute the command corresponding with the preferred direction.
  64499. *
  64500. * For example, to merge with a cell to the right:
  64501. *
  64502. * editor.execute( 'mergeTableCellRight' );
  64503. *
  64504. * **Note**: If a table cell has a different [`rowspan`](https://www.w3.org/TR/html50/tabular-data.html#attr-tdth-rowspan)
  64505. * (for `'mergeTableCellRight'` and `'mergeTableCellLeft'`) or [`colspan`](https://www.w3.org/TR/html50/tabular-data.html#attr-tdth-colspan)
  64506. * (for `'mergeTableCellUp'` and `'mergeTableCellDown'`), the command will be disabled.
  64507. *
  64508. * @extends module:core/command~Command
  64509. */
  64510. class MergeCellCommand extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Command"] {
  64511. /**
  64512. * Creates a new `MergeCellCommand` instance.
  64513. *
  64514. * @param {module:core/editor/editor~Editor} editor The editor on which this command will be used.
  64515. * @param {Object} options
  64516. * @param {String} options.direction Indicates which cell to merge with the currently selected one.
  64517. * Possible values are: `'left'`, `'right'`, `'up'` and `'down'`.
  64518. */
  64519. constructor( editor, options ) {
  64520. super( editor );
  64521. /**
  64522. * The direction that indicates which cell will be merged with the currently selected one.
  64523. *
  64524. * @readonly
  64525. * @member {String} #direction
  64526. */
  64527. this.direction = options.direction;
  64528. /**
  64529. * Whether the merge is horizontal (left/right) or vertical (up/down).
  64530. *
  64531. * @readonly
  64532. * @member {Boolean} #isHorizontal
  64533. */
  64534. this.isHorizontal = this.direction == 'right' || this.direction == 'left';
  64535. }
  64536. /**
  64537. * @inheritDoc
  64538. */
  64539. refresh() {
  64540. const cellToMerge = this._getMergeableCell();
  64541. this.value = cellToMerge;
  64542. this.isEnabled = !!cellToMerge;
  64543. }
  64544. /**
  64545. * Executes the command.
  64546. *
  64547. * Depending on the command's {@link #direction} value, it will merge the cell that is to the `'left'`, `'right'`, `'up'` or `'down'`.
  64548. *
  64549. * @fires execute
  64550. */
  64551. execute() {
  64552. const model = this.editor.model;
  64553. const doc = model.document;
  64554. const tableCell = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_2__["getTableCellsContainingSelection"])( doc.selection )[ 0 ];
  64555. const cellToMerge = this.value;
  64556. const direction = this.direction;
  64557. model.change( writer => {
  64558. const isMergeNext = direction == 'right' || direction == 'down';
  64559. // The merge mechanism is always the same so sort cells to be merged.
  64560. const cellToExpand = isMergeNext ? tableCell : cellToMerge;
  64561. const cellToRemove = isMergeNext ? cellToMerge : tableCell;
  64562. // Cache the parent of cell to remove for later check.
  64563. const removedTableCellRow = cellToRemove.parent;
  64564. mergeTableCells( cellToRemove, cellToExpand, writer );
  64565. const spanAttribute = this.isHorizontal ? 'colspan' : 'rowspan';
  64566. const cellSpan = parseInt( tableCell.getAttribute( spanAttribute ) || 1 );
  64567. const cellToMergeSpan = parseInt( cellToMerge.getAttribute( spanAttribute ) || 1 );
  64568. // Update table cell span attribute and merge set selection on merged contents.
  64569. writer.setAttribute( spanAttribute, cellSpan + cellToMergeSpan, cellToExpand );
  64570. writer.setSelection( writer.createRangeIn( cellToExpand ) );
  64571. const tableUtils = this.editor.plugins.get( 'TableUtils' );
  64572. const table = removedTableCellRow.findAncestor( 'table' );
  64573. // Remove empty rows and columns after merging.
  64574. Object(_utils_structure__WEBPACK_IMPORTED_MODULE_4__["removeEmptyRowsColumns"])( table, tableUtils );
  64575. } );
  64576. }
  64577. /**
  64578. * Returns a cell that can be merged with the current cell depending on the command's direction.
  64579. *
  64580. * @returns {module:engine/model/element~Element|undefined}
  64581. * @private
  64582. */
  64583. _getMergeableCell() {
  64584. const model = this.editor.model;
  64585. const doc = model.document;
  64586. const tableCell = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_2__["getTableCellsContainingSelection"])( doc.selection )[ 0 ];
  64587. if ( !tableCell ) {
  64588. return;
  64589. }
  64590. const tableUtils = this.editor.plugins.get( 'TableUtils' );
  64591. // First get the cell on proper direction.
  64592. const cellToMerge = this.isHorizontal ?
  64593. getHorizontalCell( tableCell, this.direction, tableUtils ) :
  64594. getVerticalCell( tableCell, this.direction, tableUtils );
  64595. if ( !cellToMerge ) {
  64596. return;
  64597. }
  64598. // If found check if the span perpendicular to merge direction is equal on both cells.
  64599. const spanAttribute = this.isHorizontal ? 'rowspan' : 'colspan';
  64600. const span = parseInt( tableCell.getAttribute( spanAttribute ) || 1 );
  64601. const cellToMergeSpan = parseInt( cellToMerge.getAttribute( spanAttribute ) || 1 );
  64602. if ( cellToMergeSpan === span ) {
  64603. return cellToMerge;
  64604. }
  64605. }
  64606. }
  64607. // Returns the cell that can be merged horizontally.
  64608. //
  64609. // @param {module:engine/model/element~Element} tableCell
  64610. // @param {String} direction
  64611. // @param {module:table/tableutils~TableUtils} tableUtils
  64612. // @returns {module:engine/model/node~Node|null}
  64613. function getHorizontalCell( tableCell, direction, tableUtils ) {
  64614. const tableRow = tableCell.parent;
  64615. const table = tableRow.parent;
  64616. const horizontalCell = direction == 'right' ? tableCell.nextSibling : tableCell.previousSibling;
  64617. const hasHeadingColumns = ( table.getAttribute( 'headingColumns' ) || 0 ) > 0;
  64618. if ( !horizontalCell ) {
  64619. return;
  64620. }
  64621. // Sort cells:
  64622. const cellOnLeft = direction == 'right' ? tableCell : horizontalCell;
  64623. const cellOnRight = direction == 'right' ? horizontalCell : tableCell;
  64624. // Get their column indexes:
  64625. const { column: leftCellColumn } = tableUtils.getCellLocation( cellOnLeft );
  64626. const { column: rightCellColumn } = tableUtils.getCellLocation( cellOnRight );
  64627. const leftCellSpan = parseInt( cellOnLeft.getAttribute( 'colspan' ) || 1 );
  64628. const isCellOnLeftInHeadingColumn = Object(_utils_common__WEBPACK_IMPORTED_MODULE_3__["isHeadingColumnCell"])( tableUtils, cellOnLeft, table );
  64629. const isCellOnRightInHeadingColumn = Object(_utils_common__WEBPACK_IMPORTED_MODULE_3__["isHeadingColumnCell"])( tableUtils, cellOnRight, table );
  64630. // We cannot merge heading columns cells with regular cells.
  64631. if ( hasHeadingColumns && isCellOnLeftInHeadingColumn != isCellOnRightInHeadingColumn ) {
  64632. return;
  64633. }
  64634. // The cell on the right must have index that is distant to the cell on the left by the left cell's width (colspan).
  64635. const cellsAreTouching = leftCellColumn + leftCellSpan === rightCellColumn;
  64636. // If the right cell's column index is different it means that there are rowspanned cells between them.
  64637. return cellsAreTouching ? horizontalCell : undefined;
  64638. }
  64639. // Returns the cell that can be merged vertically.
  64640. //
  64641. // @param {module:engine/model/element~Element} tableCell
  64642. // @param {String} direction
  64643. // @param {module:table/tableutils~TableUtils} tableUtils
  64644. // @returns {module:engine/model/node~Node|null}
  64645. function getVerticalCell( tableCell, direction, tableUtils ) {
  64646. const tableRow = tableCell.parent;
  64647. const table = tableRow.parent;
  64648. const rowIndex = table.getChildIndex( tableRow );
  64649. // Don't search for mergeable cell if direction points out of the table.
  64650. if ( ( direction == 'down' && rowIndex === tableUtils.getRows( table ) - 1 ) || ( direction == 'up' && rowIndex === 0 ) ) {
  64651. return;
  64652. }
  64653. const rowspan = parseInt( tableCell.getAttribute( 'rowspan' ) || 1 );
  64654. const headingRows = table.getAttribute( 'headingRows' ) || 0;
  64655. const isMergeWithBodyCell = direction == 'down' && ( rowIndex + rowspan ) === headingRows;
  64656. const isMergeWithHeadCell = direction == 'up' && rowIndex === headingRows;
  64657. // Don't search for mergeable cell if direction points out of the current table section.
  64658. if ( headingRows && ( isMergeWithBodyCell || isMergeWithHeadCell ) ) {
  64659. return;
  64660. }
  64661. const currentCellRowSpan = parseInt( tableCell.getAttribute( 'rowspan' ) || 1 );
  64662. const rowOfCellToMerge = direction == 'down' ? rowIndex + currentCellRowSpan : rowIndex;
  64663. const tableMap = [ ...new _tablewalker__WEBPACK_IMPORTED_MODULE_1__["default"]( table, { endRow: rowOfCellToMerge } ) ];
  64664. const currentCellData = tableMap.find( value => value.cell === tableCell );
  64665. const mergeColumn = currentCellData.column;
  64666. const cellToMergeData = tableMap.find( ( { row, cellHeight, column } ) => {
  64667. if ( column !== mergeColumn ) {
  64668. return false;
  64669. }
  64670. if ( direction == 'down' ) {
  64671. // If merging a cell below the mergeRow is already calculated.
  64672. return row === rowOfCellToMerge;
  64673. } else {
  64674. // If merging a cell above calculate if it spans to mergeRow.
  64675. return rowOfCellToMerge === row + cellHeight;
  64676. }
  64677. } );
  64678. return cellToMergeData && cellToMergeData.cell;
  64679. }
  64680. // Merges two table cells. It will ensure that after merging cells with an empty paragraph, the resulting table cell will only have one
  64681. // paragraph. If one of the merged table cells is empty, the merged table cell will have the contents of the non-empty table cell.
  64682. // If both are empty, the merged table cell will have only one empty paragraph.
  64683. //
  64684. // @param {module:engine/model/element~Element} cellToRemove
  64685. // @param {module:engine/model/element~Element} cellToExpand
  64686. // @param {module:engine/model/writer~Writer} writer
  64687. function mergeTableCells( cellToRemove, cellToExpand, writer ) {
  64688. if ( !isEmpty( cellToRemove ) ) {
  64689. if ( isEmpty( cellToExpand ) ) {
  64690. writer.remove( writer.createRangeIn( cellToExpand ) );
  64691. }
  64692. writer.move( writer.createRangeIn( cellToRemove ), writer.createPositionAt( cellToExpand, 'end' ) );
  64693. }
  64694. // Remove merged table cell.
  64695. writer.remove( cellToRemove );
  64696. }
  64697. // Checks if the passed table cell contains an empty paragraph.
  64698. //
  64699. // @param {module:engine/model/element~Element} tableCell
  64700. // @returns {Boolean}
  64701. function isEmpty( tableCell ) {
  64702. return tableCell.childCount == 1 && tableCell.getChild( 0 ).is( 'element', 'paragraph' ) && tableCell.getChild( 0 ).isEmpty;
  64703. }
  64704. /***/ }),
  64705. /***/ "./node_modules/@ckeditor/ckeditor5-table/src/commands/mergecellscommand.js":
  64706. /*!**********************************************************************************!*\
  64707. !*** ./node_modules/@ckeditor/ckeditor5-table/src/commands/mergecellscommand.js ***!
  64708. \**********************************************************************************/
  64709. /*! exports provided: default */
  64710. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  64711. "use strict";
  64712. __webpack_require__.r(__webpack_exports__);
  64713. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return MergeCellsCommand; });
  64714. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  64715. /* harmony import */ var _tableutils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../tableutils */ "./node_modules/@ckeditor/ckeditor5-table/src/tableutils.js");
  64716. /* harmony import */ var _utils_selection__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils/selection */ "./node_modules/@ckeditor/ckeditor5-table/src/utils/selection.js");
  64717. /* harmony import */ var _utils_common__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils/common */ "./node_modules/@ckeditor/ckeditor5-table/src/utils/common.js");
  64718. /* harmony import */ var _utils_structure__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../utils/structure */ "./node_modules/@ckeditor/ckeditor5-table/src/utils/structure.js");
  64719. /**
  64720. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  64721. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  64722. */
  64723. /**
  64724. * @module table/commands/mergecellscommand
  64725. */
  64726. /**
  64727. * The merge cells command.
  64728. *
  64729. * The command is registered by {@link module:table/tableediting~TableEditing} as the `'mergeTableCells'` editor command.
  64730. *
  64731. * For example, to merge selected table cells:
  64732. *
  64733. * editor.execute( 'mergeTableCells' );
  64734. *
  64735. * @extends module:core/command~Command
  64736. */
  64737. class MergeCellsCommand extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Command"] {
  64738. /**
  64739. * @inheritDoc
  64740. */
  64741. refresh() {
  64742. const selectedTableCells = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_2__["getSelectedTableCells"])( this.editor.model.document.selection );
  64743. this.isEnabled = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_2__["isSelectionRectangular"])( selectedTableCells, this.editor.plugins.get( _tableutils__WEBPACK_IMPORTED_MODULE_1__["default"] ) );
  64744. }
  64745. /**
  64746. * Executes the command.
  64747. *
  64748. * @fires execute
  64749. */
  64750. execute() {
  64751. const model = this.editor.model;
  64752. const tableUtils = this.editor.plugins.get( _tableutils__WEBPACK_IMPORTED_MODULE_1__["default"] );
  64753. model.change( writer => {
  64754. const selectedTableCells = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_2__["getSelectedTableCells"])( model.document.selection );
  64755. // All cells will be merged into the first one.
  64756. const firstTableCell = selectedTableCells.shift();
  64757. // Update target cell dimensions.
  64758. const { mergeWidth, mergeHeight } = getMergeDimensions( firstTableCell, selectedTableCells, tableUtils );
  64759. Object(_utils_common__WEBPACK_IMPORTED_MODULE_3__["updateNumericAttribute"])( 'colspan', mergeWidth, firstTableCell, writer );
  64760. Object(_utils_common__WEBPACK_IMPORTED_MODULE_3__["updateNumericAttribute"])( 'rowspan', mergeHeight, firstTableCell, writer );
  64761. for ( const tableCell of selectedTableCells ) {
  64762. mergeTableCells( tableCell, firstTableCell, writer );
  64763. }
  64764. const table = firstTableCell.findAncestor( 'table' );
  64765. // Remove rows and columns that become empty (have no anchored cells).
  64766. Object(_utils_structure__WEBPACK_IMPORTED_MODULE_4__["removeEmptyRowsColumns"])( table, tableUtils );
  64767. writer.setSelection( firstTableCell, 'in' );
  64768. } );
  64769. }
  64770. }
  64771. // Merges two table cells. It will ensure that after merging cells with empty paragraphs the resulting table cell will only have one
  64772. // paragraph. If one of the merged table cells is empty, the merged table cell will have contents of the non-empty table cell.
  64773. // If both are empty, the merged table cell will have only one empty paragraph.
  64774. //
  64775. // @param {module:engine/model/element~Element} cellBeingMerged
  64776. // @param {module:engine/model/element~Element} targetCell
  64777. // @param {module:engine/model/writer~Writer} writer
  64778. function mergeTableCells( cellBeingMerged, targetCell, writer ) {
  64779. if ( !isEmpty( cellBeingMerged ) ) {
  64780. if ( isEmpty( targetCell ) ) {
  64781. writer.remove( writer.createRangeIn( targetCell ) );
  64782. }
  64783. writer.move( writer.createRangeIn( cellBeingMerged ), writer.createPositionAt( targetCell, 'end' ) );
  64784. }
  64785. // Remove merged table cell.
  64786. writer.remove( cellBeingMerged );
  64787. }
  64788. // Checks if the passed table cell contains an empty paragraph.
  64789. //
  64790. // @param {module:engine/model/element~Element} tableCell
  64791. // @returns {Boolean}
  64792. function isEmpty( tableCell ) {
  64793. return tableCell.childCount == 1 && tableCell.getChild( 0 ).is( 'element', 'paragraph' ) && tableCell.getChild( 0 ).isEmpty;
  64794. }
  64795. function getMergeDimensions( firstTableCell, selectedTableCells, tableUtils ) {
  64796. let maxWidthOffset = 0;
  64797. let maxHeightOffset = 0;
  64798. for ( const tableCell of selectedTableCells ) {
  64799. const { row, column } = tableUtils.getCellLocation( tableCell );
  64800. maxWidthOffset = getMaxOffset( tableCell, column, maxWidthOffset, 'colspan' );
  64801. maxHeightOffset = getMaxOffset( tableCell, row, maxHeightOffset, 'rowspan' );
  64802. }
  64803. // Update table cell span attribute and merge set selection on a merged contents.
  64804. const { row: firstCellRow, column: firstCellColumn } = tableUtils.getCellLocation( firstTableCell );
  64805. const mergeWidth = maxWidthOffset - firstCellColumn;
  64806. const mergeHeight = maxHeightOffset - firstCellRow;
  64807. return { mergeWidth, mergeHeight };
  64808. }
  64809. function getMaxOffset( tableCell, start, currentMaxOffset, which ) {
  64810. const dimensionValue = parseInt( tableCell.getAttribute( which ) || 1 );
  64811. return Math.max( currentMaxOffset, start + dimensionValue );
  64812. }
  64813. /***/ }),
  64814. /***/ "./node_modules/@ckeditor/ckeditor5-table/src/commands/removecolumncommand.js":
  64815. /*!************************************************************************************!*\
  64816. !*** ./node_modules/@ckeditor/ckeditor5-table/src/commands/removecolumncommand.js ***!
  64817. \************************************************************************************/
  64818. /*! exports provided: default */
  64819. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  64820. "use strict";
  64821. __webpack_require__.r(__webpack_exports__);
  64822. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return RemoveColumnCommand; });
  64823. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  64824. /* harmony import */ var _tablewalker__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../tablewalker */ "./node_modules/@ckeditor/ckeditor5-table/src/tablewalker.js");
  64825. /* harmony import */ var _utils_selection__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils/selection */ "./node_modules/@ckeditor/ckeditor5-table/src/utils/selection.js");
  64826. /**
  64827. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  64828. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  64829. */
  64830. /**
  64831. * @module table/commands/removecolumncommand
  64832. */
  64833. /**
  64834. * The remove column command.
  64835. *
  64836. * The command is registered by {@link module:table/tableediting~TableEditing} as the `'removeTableColumn'` editor command.
  64837. *
  64838. * To remove the column containing the selected cell, execute the command:
  64839. *
  64840. * editor.execute( 'removeTableColumn' );
  64841. *
  64842. * @extends module:core/command~Command
  64843. */
  64844. class RemoveColumnCommand extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Command"] {
  64845. /**
  64846. * @inheritDoc
  64847. */
  64848. refresh() {
  64849. const selectedCells = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_2__["getSelectionAffectedTableCells"])( this.editor.model.document.selection );
  64850. const firstCell = selectedCells[ 0 ];
  64851. if ( firstCell ) {
  64852. const table = firstCell.findAncestor( 'table' );
  64853. const tableColumnCount = this.editor.plugins.get( 'TableUtils' ).getColumns( table );
  64854. const { first, last } = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_2__["getColumnIndexes"])( selectedCells );
  64855. this.isEnabled = last - first < ( tableColumnCount - 1 );
  64856. } else {
  64857. this.isEnabled = false;
  64858. }
  64859. }
  64860. /**
  64861. * @inheritDoc
  64862. */
  64863. execute() {
  64864. const [ firstCell, lastCell ] = getBoundaryCells( this.editor.model.document.selection );
  64865. const table = firstCell.parent.parent;
  64866. // Cache the table before removing or updating colspans.
  64867. const tableMap = [ ...new _tablewalker__WEBPACK_IMPORTED_MODULE_1__["default"]( table ) ];
  64868. // Store column indexes of removed columns.
  64869. const removedColumnIndexes = {
  64870. first: tableMap.find( value => value.cell === firstCell ).column,
  64871. last: tableMap.find( value => value.cell === lastCell ).column
  64872. };
  64873. const cellToFocus = getCellToFocus( tableMap, firstCell, lastCell, removedColumnIndexes );
  64874. this.editor.model.change( writer => {
  64875. const columnsToRemove = removedColumnIndexes.last - removedColumnIndexes.first + 1;
  64876. this.editor.plugins.get( 'TableUtils' ).removeColumns( table, {
  64877. at: removedColumnIndexes.first,
  64878. columns: columnsToRemove
  64879. } );
  64880. writer.setSelection( writer.createPositionAt( cellToFocus, 0 ) );
  64881. } );
  64882. }
  64883. }
  64884. // Returns a proper table cell to focus after removing a column.
  64885. // - selection is on last table cell it will return previous cell.
  64886. function getCellToFocus( tableMap, firstCell, lastCell, removedColumnIndexes ) {
  64887. const colspan = parseInt( lastCell.getAttribute( 'colspan' ) || 1 );
  64888. // If the table cell is spanned over 2+ columns - it will be truncated so the selection should
  64889. // stay in that cell.
  64890. if ( colspan > 1 ) {
  64891. return lastCell;
  64892. }
  64893. // Normally, look for the cell in the same row that precedes the first cell to put selection there ("column on the left").
  64894. // If the deleted column is the first column of the table, there will be no predecessor: use the cell
  64895. // from the column that follows then (also in the same row).
  64896. else if ( firstCell.previousSibling || lastCell.nextSibling ) {
  64897. return lastCell.nextSibling || firstCell.previousSibling;
  64898. }
  64899. // It can happen that table cells have no siblings in a row, for instance, when there are row spans
  64900. // in the table (in the previous row). Then just look for the closest cell that is in a column
  64901. // that will not be removed to put the selection there.
  64902. else {
  64903. // Look for any cell in a column that precedes the first removed column.
  64904. if ( removedColumnIndexes.first ) {
  64905. return tableMap.reverse().find( ( { column } ) => {
  64906. return column < removedColumnIndexes.first;
  64907. } ).cell;
  64908. }
  64909. // If the first removed column is the first column of the table, then
  64910. // look for any cell that is in a column that follows the last removed column.
  64911. else {
  64912. return tableMap.reverse().find( ( { column } ) => {
  64913. return column > removedColumnIndexes.last;
  64914. } ).cell;
  64915. }
  64916. }
  64917. }
  64918. // Returns helper object returning the first and the last cell contained in given selection, based on DOM order.
  64919. function getBoundaryCells( selection ) {
  64920. const referenceCells = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_2__["getSelectionAffectedTableCells"])( selection );
  64921. const firstCell = referenceCells[ 0 ];
  64922. const lastCell = referenceCells.pop();
  64923. const returnValue = [ firstCell, lastCell ];
  64924. return firstCell.isBefore( lastCell ) ? returnValue : returnValue.reverse();
  64925. }
  64926. /***/ }),
  64927. /***/ "./node_modules/@ckeditor/ckeditor5-table/src/commands/removerowcommand.js":
  64928. /*!*********************************************************************************!*\
  64929. !*** ./node_modules/@ckeditor/ckeditor5-table/src/commands/removerowcommand.js ***!
  64930. \*********************************************************************************/
  64931. /*! exports provided: default */
  64932. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  64933. "use strict";
  64934. __webpack_require__.r(__webpack_exports__);
  64935. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return RemoveRowCommand; });
  64936. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  64937. /* harmony import */ var _utils_selection__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils/selection */ "./node_modules/@ckeditor/ckeditor5-table/src/utils/selection.js");
  64938. /**
  64939. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  64940. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  64941. */
  64942. /**
  64943. * @module table/commands/removerowcommand
  64944. */
  64945. /**
  64946. * The remove row command.
  64947. *
  64948. * The command is registered by {@link module:table/tableediting~TableEditing} as the `'removeTableRow'` editor command.
  64949. *
  64950. * To remove the row containing the selected cell, execute the command:
  64951. *
  64952. * editor.execute( 'removeTableRow' );
  64953. *
  64954. * @extends module:core/command~Command
  64955. */
  64956. class RemoveRowCommand extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Command"] {
  64957. /**
  64958. * @inheritDoc
  64959. */
  64960. refresh() {
  64961. const selectedCells = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_1__["getSelectionAffectedTableCells"])( this.editor.model.document.selection );
  64962. const firstCell = selectedCells[ 0 ];
  64963. if ( firstCell ) {
  64964. const table = firstCell.findAncestor( 'table' );
  64965. const tableRowCount = this.editor.plugins.get( 'TableUtils' ).getRows( table );
  64966. const lastRowIndex = tableRowCount - 1;
  64967. const selectedRowIndexes = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_1__["getRowIndexes"])( selectedCells );
  64968. const areAllRowsSelected = selectedRowIndexes.first === 0 && selectedRowIndexes.last === lastRowIndex;
  64969. // Disallow selecting whole table -> delete whole table should be used instead.
  64970. this.isEnabled = !areAllRowsSelected;
  64971. } else {
  64972. this.isEnabled = false;
  64973. }
  64974. }
  64975. /**
  64976. * @inheritDoc
  64977. */
  64978. execute() {
  64979. const model = this.editor.model;
  64980. const tableUtils = this.editor.plugins.get( 'TableUtils' );
  64981. const referenceCells = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_1__["getSelectionAffectedTableCells"])( model.document.selection );
  64982. const removedRowIndexes = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_1__["getRowIndexes"])( referenceCells );
  64983. const firstCell = referenceCells[ 0 ];
  64984. const table = firstCell.findAncestor( 'table' );
  64985. const columnIndexToFocus = tableUtils.getCellLocation( firstCell ).column;
  64986. model.change( writer => {
  64987. const rowsToRemove = removedRowIndexes.last - removedRowIndexes.first + 1;
  64988. tableUtils.removeRows( table, {
  64989. at: removedRowIndexes.first,
  64990. rows: rowsToRemove
  64991. } );
  64992. const cellToFocus = getCellToFocus( table, removedRowIndexes.first, columnIndexToFocus, tableUtils.getRows( table ) );
  64993. writer.setSelection( writer.createPositionAt( cellToFocus, 0 ) );
  64994. } );
  64995. }
  64996. }
  64997. // Returns a cell that should be focused before removing the row, belonging to the same column as the currently focused cell.
  64998. // * If the row was not the last one, the cell to focus will be in the row that followed it (before removal).
  64999. // * If the row was the last one, the cell to focus will be in the row that preceded it (before removal).
  65000. function getCellToFocus( table, removedRowIndex, columnToFocus, tableRowCount ) {
  65001. // Don't go beyond last row's index.
  65002. const row = table.getChild( Math.min( removedRowIndex, tableRowCount - 1 ) );
  65003. // Default to first table cell.
  65004. let cellToFocus = row.getChild( 0 );
  65005. let column = 0;
  65006. for ( const tableCell of row.getChildren() ) {
  65007. if ( column > columnToFocus ) {
  65008. return cellToFocus;
  65009. }
  65010. cellToFocus = tableCell;
  65011. column += parseInt( tableCell.getAttribute( 'colspan' ) || 1 );
  65012. }
  65013. return cellToFocus;
  65014. }
  65015. /***/ }),
  65016. /***/ "./node_modules/@ckeditor/ckeditor5-table/src/commands/selectcolumncommand.js":
  65017. /*!************************************************************************************!*\
  65018. !*** ./node_modules/@ckeditor/ckeditor5-table/src/commands/selectcolumncommand.js ***!
  65019. \************************************************************************************/
  65020. /*! exports provided: default */
  65021. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  65022. "use strict";
  65023. __webpack_require__.r(__webpack_exports__);
  65024. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return SelectColumnCommand; });
  65025. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  65026. /* harmony import */ var _tablewalker__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../tablewalker */ "./node_modules/@ckeditor/ckeditor5-table/src/tablewalker.js");
  65027. /* harmony import */ var _utils_selection__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils/selection */ "./node_modules/@ckeditor/ckeditor5-table/src/utils/selection.js");
  65028. /**
  65029. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  65030. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  65031. */
  65032. /**
  65033. * @module table/commands/selectcolumncommand
  65034. */
  65035. /**
  65036. * The select column command.
  65037. *
  65038. * The command is registered by {@link module:table/tableediting~TableEditing} as the `'selectTableColumn'` editor command.
  65039. *
  65040. * To select the columns containing the selected cells, execute the command:
  65041. *
  65042. * editor.execute( 'selectTableColumn' );
  65043. *
  65044. * @extends module:core/command~Command
  65045. */
  65046. class SelectColumnCommand extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Command"] {
  65047. /**
  65048. * @inheritDoc
  65049. */
  65050. refresh() {
  65051. const selectedCells = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_2__["getSelectionAffectedTableCells"])( this.editor.model.document.selection );
  65052. this.isEnabled = selectedCells.length > 0;
  65053. }
  65054. /**
  65055. * @inheritDoc
  65056. */
  65057. execute() {
  65058. const model = this.editor.model;
  65059. const referenceCells = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_2__["getSelectionAffectedTableCells"])( model.document.selection );
  65060. const firstCell = referenceCells[ 0 ];
  65061. const lastCell = referenceCells.pop();
  65062. const table = firstCell.findAncestor( 'table' );
  65063. const tableUtils = this.editor.plugins.get( 'TableUtils' );
  65064. const startLocation = tableUtils.getCellLocation( firstCell );
  65065. const endLocation = tableUtils.getCellLocation( lastCell );
  65066. const startColumn = Math.min( startLocation.column, endLocation.column );
  65067. const endColumn = Math.max( startLocation.column, endLocation.column );
  65068. const rangesToSelect = [];
  65069. for ( const cellInfo of new _tablewalker__WEBPACK_IMPORTED_MODULE_1__["default"]( table, { startColumn, endColumn } ) ) {
  65070. rangesToSelect.push( model.createRangeOn( cellInfo.cell ) );
  65071. }
  65072. model.change( writer => {
  65073. writer.setSelection( rangesToSelect );
  65074. } );
  65075. }
  65076. }
  65077. /***/ }),
  65078. /***/ "./node_modules/@ckeditor/ckeditor5-table/src/commands/selectrowcommand.js":
  65079. /*!*********************************************************************************!*\
  65080. !*** ./node_modules/@ckeditor/ckeditor5-table/src/commands/selectrowcommand.js ***!
  65081. \*********************************************************************************/
  65082. /*! exports provided: default */
  65083. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  65084. "use strict";
  65085. __webpack_require__.r(__webpack_exports__);
  65086. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return SelectRowCommand; });
  65087. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  65088. /* harmony import */ var _utils_selection__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils/selection */ "./node_modules/@ckeditor/ckeditor5-table/src/utils/selection.js");
  65089. /**
  65090. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  65091. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  65092. */
  65093. /**
  65094. * @module table/commands/selectrowcommand
  65095. */
  65096. /**
  65097. * The select row command.
  65098. *
  65099. * The command is registered by {@link module:table/tableediting~TableEditing} as the `'selectTableRow'` editor command.
  65100. *
  65101. * To select the rows containing the selected cells, execute the command:
  65102. *
  65103. * editor.execute( 'selectTableRow' );
  65104. *
  65105. * @extends module:core/command~Command
  65106. */
  65107. class SelectRowCommand extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Command"] {
  65108. /**
  65109. * @inheritDoc
  65110. */
  65111. refresh() {
  65112. const selectedCells = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_1__["getSelectionAffectedTableCells"])( this.editor.model.document.selection );
  65113. this.isEnabled = selectedCells.length > 0;
  65114. }
  65115. /**
  65116. * @inheritDoc
  65117. */
  65118. execute() {
  65119. const model = this.editor.model;
  65120. const referenceCells = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_1__["getSelectionAffectedTableCells"])( model.document.selection );
  65121. const rowIndexes = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_1__["getRowIndexes"])( referenceCells );
  65122. const table = referenceCells[ 0 ].findAncestor( 'table' );
  65123. const rangesToSelect = [];
  65124. for ( let rowIndex = rowIndexes.first; rowIndex <= rowIndexes.last; rowIndex++ ) {
  65125. for ( const cell of table.getChild( rowIndex ).getChildren() ) {
  65126. rangesToSelect.push( model.createRangeOn( cell ) );
  65127. }
  65128. }
  65129. model.change( writer => {
  65130. writer.setSelection( rangesToSelect );
  65131. } );
  65132. }
  65133. }
  65134. /***/ }),
  65135. /***/ "./node_modules/@ckeditor/ckeditor5-table/src/commands/setheadercolumncommand.js":
  65136. /*!***************************************************************************************!*\
  65137. !*** ./node_modules/@ckeditor/ckeditor5-table/src/commands/setheadercolumncommand.js ***!
  65138. \***************************************************************************************/
  65139. /*! exports provided: default */
  65140. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  65141. "use strict";
  65142. __webpack_require__.r(__webpack_exports__);
  65143. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return SetHeaderColumnCommand; });
  65144. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  65145. /* harmony import */ var _utils_common__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils/common */ "./node_modules/@ckeditor/ckeditor5-table/src/utils/common.js");
  65146. /* harmony import */ var _utils_selection__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils/selection */ "./node_modules/@ckeditor/ckeditor5-table/src/utils/selection.js");
  65147. /* harmony import */ var _utils_structure__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils/structure */ "./node_modules/@ckeditor/ckeditor5-table/src/utils/structure.js");
  65148. /**
  65149. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  65150. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  65151. */
  65152. /**
  65153. * @module table/commands/setheadercolumncommand
  65154. */
  65155. /**
  65156. * The header column command.
  65157. *
  65158. * The command is registered by {@link module:table/tableediting~TableEditing} as the `'setTableColumnHeader'` editor command.
  65159. *
  65160. * You can make the column containing the selected cell a [header](https://www.w3.org/TR/html50/tabular-data.html#the-th-element)
  65161. * by executing:
  65162. *
  65163. * editor.execute( 'setTableColumnHeader' );
  65164. *
  65165. * **Note:** All preceding columns will also become headers. If the current column is already a header, executing this command
  65166. * will make it a regular column back again (including the following columns).
  65167. *
  65168. * @extends module:core/command~Command
  65169. */
  65170. class SetHeaderColumnCommand extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Command"] {
  65171. /**
  65172. * @inheritDoc
  65173. */
  65174. refresh() {
  65175. const model = this.editor.model;
  65176. const selectedCells = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_2__["getSelectionAffectedTableCells"])( model.document.selection );
  65177. const tableUtils = this.editor.plugins.get( 'TableUtils' );
  65178. const isInTable = selectedCells.length > 0;
  65179. this.isEnabled = isInTable;
  65180. /**
  65181. * Flag indicating whether the command is active. The command is active when the
  65182. * {@link module:engine/model/selection~Selection} is in a header column.
  65183. *
  65184. * @observable
  65185. * @readonly
  65186. * @member {Boolean} #value
  65187. */
  65188. this.value = isInTable && selectedCells.every( cell => Object(_utils_common__WEBPACK_IMPORTED_MODULE_1__["isHeadingColumnCell"])( tableUtils, cell ) );
  65189. }
  65190. /**
  65191. * Executes the command.
  65192. *
  65193. * When the selection is in a non-header column, the command will set the `headingColumns` table attribute to cover that column.
  65194. *
  65195. * When the selection is already in a header column, it will set `headingColumns` so the heading section will end before that column.
  65196. *
  65197. * @fires execute
  65198. * @param {Object} [options]
  65199. * @param {Boolean} [options.forceValue] If set, the command will set (`true`) or unset (`false`) the header columns according to
  65200. * the `forceValue` parameter instead of the current model state.
  65201. */
  65202. execute( options = {} ) {
  65203. if ( options.forceValue === this.value ) {
  65204. return;
  65205. }
  65206. const model = this.editor.model;
  65207. const selectedCells = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_2__["getSelectionAffectedTableCells"])( model.document.selection );
  65208. const table = selectedCells[ 0 ].findAncestor( 'table' );
  65209. const { first, last } = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_2__["getColumnIndexes"])( selectedCells );
  65210. const headingColumnsToSet = this.value ? first : last + 1;
  65211. model.change( writer => {
  65212. if ( headingColumnsToSet ) {
  65213. // Changing heading columns requires to check if any of a heading cell is overlapping horizontally the table head.
  65214. // Any table cell that has a colspan attribute > 1 will not exceed the table head so we need to fix it in columns before.
  65215. const overlappingCells = Object(_utils_structure__WEBPACK_IMPORTED_MODULE_3__["getHorizontallyOverlappingCells"])( table, headingColumnsToSet );
  65216. for ( const { cell, column } of overlappingCells ) {
  65217. Object(_utils_structure__WEBPACK_IMPORTED_MODULE_3__["splitVertically"])( cell, column, headingColumnsToSet, writer );
  65218. }
  65219. }
  65220. Object(_utils_common__WEBPACK_IMPORTED_MODULE_1__["updateNumericAttribute"])( 'headingColumns', headingColumnsToSet, table, writer, 0 );
  65221. } );
  65222. }
  65223. }
  65224. /***/ }),
  65225. /***/ "./node_modules/@ckeditor/ckeditor5-table/src/commands/setheaderrowcommand.js":
  65226. /*!************************************************************************************!*\
  65227. !*** ./node_modules/@ckeditor/ckeditor5-table/src/commands/setheaderrowcommand.js ***!
  65228. \************************************************************************************/
  65229. /*! exports provided: default */
  65230. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  65231. "use strict";
  65232. __webpack_require__.r(__webpack_exports__);
  65233. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return SetHeaderRowCommand; });
  65234. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  65235. /* harmony import */ var _utils_common__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils/common */ "./node_modules/@ckeditor/ckeditor5-table/src/utils/common.js");
  65236. /* harmony import */ var _utils_selection__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils/selection */ "./node_modules/@ckeditor/ckeditor5-table/src/utils/selection.js");
  65237. /* harmony import */ var _utils_structure__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils/structure */ "./node_modules/@ckeditor/ckeditor5-table/src/utils/structure.js");
  65238. /**
  65239. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  65240. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  65241. */
  65242. /**
  65243. * @module table/commands/setheaderrowcommand
  65244. */
  65245. /**
  65246. * The header row command.
  65247. *
  65248. * The command is registered by {@link module:table/tableediting~TableEditing} as the `'setTableColumnHeader'` editor command.
  65249. *
  65250. * 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:
  65251. *
  65252. * editor.execute( 'setTableRowHeader' );
  65253. *
  65254. * **Note:** All preceding rows will also become headers. If the current row is already a header, executing this command
  65255. * will make it a regular row back again (including the following rows).
  65256. *
  65257. * @extends module:core/command~Command
  65258. */
  65259. class SetHeaderRowCommand extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Command"] {
  65260. /**
  65261. * @inheritDoc
  65262. */
  65263. refresh() {
  65264. const model = this.editor.model;
  65265. const selectedCells = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_2__["getSelectionAffectedTableCells"])( model.document.selection );
  65266. const isInTable = selectedCells.length > 0;
  65267. this.isEnabled = isInTable;
  65268. /**
  65269. * Flag indicating whether the command is active. The command is active when the
  65270. * {@link module:engine/model/selection~Selection} is in a header row.
  65271. *
  65272. * @observable
  65273. * @readonly
  65274. * @member {Boolean} #value
  65275. */
  65276. this.value = isInTable && selectedCells.every( cell => this._isInHeading( cell, cell.parent.parent ) );
  65277. }
  65278. /**
  65279. * Executes the command.
  65280. *
  65281. * When the selection is in a non-header row, the command will set the `headingRows` table attribute to cover that row.
  65282. *
  65283. * When the selection is already in a header row, it will set `headingRows` so the heading section will end before that row.
  65284. *
  65285. * @fires execute
  65286. * @param {Object} options
  65287. * @param {Boolean} [options.forceValue] If set, the command will set (`true`) or unset (`false`) the header rows according to
  65288. * the `forceValue` parameter instead of the current model state.
  65289. */
  65290. execute( options = {} ) {
  65291. if ( options.forceValue === this.value ) {
  65292. return;
  65293. }
  65294. const model = this.editor.model;
  65295. const selectedCells = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_2__["getSelectionAffectedTableCells"])( model.document.selection );
  65296. const table = selectedCells[ 0 ].findAncestor( 'table' );
  65297. const { first, last } = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_2__["getRowIndexes"])( selectedCells );
  65298. const headingRowsToSet = this.value ? first : last + 1;
  65299. const currentHeadingRows = table.getAttribute( 'headingRows' ) || 0;
  65300. model.change( writer => {
  65301. if ( headingRowsToSet ) {
  65302. // Changing heading rows requires to check if any of a heading cell is overlapping vertically the table head.
  65303. // Any table cell that has a rowspan attribute > 1 will not exceed the table head so we need to fix it in rows below.
  65304. const startRow = headingRowsToSet > currentHeadingRows ? currentHeadingRows : 0;
  65305. const overlappingCells = Object(_utils_structure__WEBPACK_IMPORTED_MODULE_3__["getVerticallyOverlappingCells"])( table, headingRowsToSet, startRow );
  65306. for ( const { cell } of overlappingCells ) {
  65307. Object(_utils_structure__WEBPACK_IMPORTED_MODULE_3__["splitHorizontally"])( cell, headingRowsToSet, writer );
  65308. }
  65309. }
  65310. Object(_utils_common__WEBPACK_IMPORTED_MODULE_1__["updateNumericAttribute"])( 'headingRows', headingRowsToSet, table, writer, 0 );
  65311. } );
  65312. }
  65313. /**
  65314. * Checks if a table cell is in the heading section.
  65315. *
  65316. * @param {module:engine/model/element~Element} tableCell
  65317. * @param {module:engine/model/element~Element} table
  65318. * @returns {Boolean}
  65319. * @private
  65320. */
  65321. _isInHeading( tableCell, table ) {
  65322. const headingRows = parseInt( table.getAttribute( 'headingRows' ) || 0 );
  65323. return !!headingRows && tableCell.parent.index < headingRows;
  65324. }
  65325. }
  65326. /***/ }),
  65327. /***/ "./node_modules/@ckeditor/ckeditor5-table/src/commands/splitcellcommand.js":
  65328. /*!*********************************************************************************!*\
  65329. !*** ./node_modules/@ckeditor/ckeditor5-table/src/commands/splitcellcommand.js ***!
  65330. \*********************************************************************************/
  65331. /*! exports provided: default */
  65332. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  65333. "use strict";
  65334. __webpack_require__.r(__webpack_exports__);
  65335. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return SplitCellCommand; });
  65336. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  65337. /* harmony import */ var _utils_selection__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils/selection */ "./node_modules/@ckeditor/ckeditor5-table/src/utils/selection.js");
  65338. /**
  65339. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  65340. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  65341. */
  65342. /**
  65343. * @module table/commands/splitcellcommand
  65344. */
  65345. /**
  65346. * The split cell command.
  65347. *
  65348. * The command is registered by {@link module:table/tableediting~TableEditing} as the `'splitTableCellVertically'`
  65349. * and `'splitTableCellHorizontally'` editor commands.
  65350. *
  65351. * You can split any cell vertically or horizontally by executing this command. For example, to split the selected table cell vertically:
  65352. *
  65353. * editor.execute( 'splitTableCellVertically' );
  65354. *
  65355. * @extends module:core/command~Command
  65356. */
  65357. class SplitCellCommand extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Command"] {
  65358. /**
  65359. * Creates a new `SplitCellCommand` instance.
  65360. *
  65361. * @param {module:core/editor/editor~Editor} editor The editor on which this command will be used.
  65362. * @param {Object} options
  65363. * @param {String} options.direction Indicates whether the command should split cells `'horizontally'` or `'vertically'`.
  65364. */
  65365. constructor( editor, options = {} ) {
  65366. super( editor );
  65367. /**
  65368. * The direction that indicates which cell will be split.
  65369. *
  65370. * @readonly
  65371. * @member {String} #direction
  65372. */
  65373. this.direction = options.direction || 'horizontally';
  65374. }
  65375. /**
  65376. * @inheritDoc
  65377. */
  65378. refresh() {
  65379. const selectedCells = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_1__["getSelectionAffectedTableCells"])( this.editor.model.document.selection );
  65380. this.isEnabled = selectedCells.length === 1;
  65381. }
  65382. /**
  65383. * @inheritDoc
  65384. */
  65385. execute() {
  65386. const tableCell = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_1__["getSelectionAffectedTableCells"])( this.editor.model.document.selection )[ 0 ];
  65387. const isHorizontal = this.direction === 'horizontally';
  65388. const tableUtils = this.editor.plugins.get( 'TableUtils' );
  65389. if ( isHorizontal ) {
  65390. tableUtils.splitCellHorizontally( tableCell, 2 );
  65391. } else {
  65392. tableUtils.splitCellVertically( tableCell, 2 );
  65393. }
  65394. }
  65395. }
  65396. /***/ }),
  65397. /***/ "./node_modules/@ckeditor/ckeditor5-table/src/converters/downcast.js":
  65398. /*!***************************************************************************!*\
  65399. !*** ./node_modules/@ckeditor/ckeditor5-table/src/converters/downcast.js ***!
  65400. \***************************************************************************/
  65401. /*! exports provided: downcastInsertTable, downcastInsertRow, downcastInsertCell, downcastTableHeadingColumnsChange, downcastRemoveRow, convertParagraphInTableCell, isSingleParagraphWithoutAttributes */
  65402. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  65403. "use strict";
  65404. __webpack_require__.r(__webpack_exports__);
  65405. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "downcastInsertTable", function() { return downcastInsertTable; });
  65406. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "downcastInsertRow", function() { return downcastInsertRow; });
  65407. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "downcastInsertCell", function() { return downcastInsertCell; });
  65408. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "downcastTableHeadingColumnsChange", function() { return downcastTableHeadingColumnsChange; });
  65409. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "downcastRemoveRow", function() { return downcastRemoveRow; });
  65410. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "convertParagraphInTableCell", function() { return convertParagraphInTableCell; });
  65411. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isSingleParagraphWithoutAttributes", function() { return isSingleParagraphWithoutAttributes; });
  65412. /* harmony import */ var _tablewalker__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./../tablewalker */ "./node_modules/@ckeditor/ckeditor5-table/src/tablewalker.js");
  65413. /* harmony import */ var ckeditor5_src_widget__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/widget */ "./node_modules/ckeditor5/src/widget.js");
  65414. /* harmony import */ var ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ckeditor5/src/utils */ "./node_modules/ckeditor5/src/utils.js");
  65415. /**
  65416. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  65417. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  65418. */
  65419. /**
  65420. * @module table/converters/downcast
  65421. */
  65422. /**
  65423. * Model table element to view table element conversion helper.
  65424. *
  65425. * This conversion helper creates the whole table element with child elements.
  65426. *
  65427. * @param {Object} options
  65428. * @param {Boolean} options.asWidget If set to `true`, the downcast conversion will produce a widget.
  65429. * @returns {Function} Conversion helper.
  65430. */
  65431. function downcastInsertTable( options = {} ) {
  65432. return dispatcher => dispatcher.on( 'insert:table', ( evt, data, conversionApi ) => {
  65433. const table = data.item;
  65434. if ( !conversionApi.consumable.consume( table, 'insert' ) ) {
  65435. return;
  65436. }
  65437. // Consume attributes if present to not fire attribute change downcast
  65438. conversionApi.consumable.consume( table, 'attribute:headingRows:table' );
  65439. conversionApi.consumable.consume( table, 'attribute:headingColumns:table' );
  65440. const asWidget = options && options.asWidget;
  65441. const figureElement = conversionApi.writer.createContainerElement( 'figure', { class: 'table' } );
  65442. const tableElement = conversionApi.writer.createContainerElement( 'table' );
  65443. conversionApi.writer.insert( conversionApi.writer.createPositionAt( figureElement, 0 ), tableElement );
  65444. let tableWidget;
  65445. if ( asWidget ) {
  65446. tableWidget = toTableWidget( figureElement, conversionApi.writer );
  65447. }
  65448. const tableWalker = new _tablewalker__WEBPACK_IMPORTED_MODULE_0__["default"]( table );
  65449. const tableAttributes = {
  65450. headingRows: table.getAttribute( 'headingRows' ) || 0,
  65451. headingColumns: table.getAttribute( 'headingColumns' ) || 0
  65452. };
  65453. // Cache for created table rows.
  65454. const viewRows = new Map();
  65455. for ( const tableSlot of tableWalker ) {
  65456. const { row, cell } = tableSlot;
  65457. const tableRow = table.getChild( row );
  65458. const trElement = viewRows.get( row ) || createTr( tableElement, tableRow, row, tableAttributes, conversionApi );
  65459. viewRows.set( row, trElement );
  65460. // Consume table cell - it will be always consumed as we convert whole table at once.
  65461. conversionApi.consumable.consume( cell, 'insert' );
  65462. const insertPosition = conversionApi.writer.createPositionAt( trElement, 'end' );
  65463. createViewTableCellElement( tableSlot, tableAttributes, insertPosition, conversionApi, options );
  65464. }
  65465. // Insert empty TR elements if there are any rows without anchored cells. Since the model is always normalized
  65466. // this can happen only in the document fragment that only part of the table is down-casted.
  65467. for ( const tableRow of table.getChildren() ) {
  65468. const rowIndex = tableRow.index;
  65469. // Make sure that this is a table row and not some other element (i.e., caption).
  65470. if ( tableRow.is( 'element', 'tableRow' ) && !viewRows.has( rowIndex ) ) {
  65471. viewRows.set( rowIndex, createTr( tableElement, tableRow, rowIndex, tableAttributes, conversionApi ) );
  65472. }
  65473. }
  65474. const viewPosition = conversionApi.mapper.toViewPosition( data.range.start );
  65475. conversionApi.mapper.bindElements( table, asWidget ? tableWidget : figureElement );
  65476. conversionApi.writer.insert( viewPosition, asWidget ? tableWidget : figureElement );
  65477. } );
  65478. }
  65479. /**
  65480. * Model row element to view `<tr>` element conversion helper.
  65481. *
  65482. * This conversion helper creates the whole `<tr>` element with child elements.
  65483. *
  65484. * @returns {Function} Conversion helper.
  65485. */
  65486. function downcastInsertRow() {
  65487. return dispatcher => dispatcher.on( 'insert:tableRow', ( evt, data, conversionApi ) => {
  65488. const tableRow = data.item;
  65489. if ( !conversionApi.consumable.consume( tableRow, 'insert' ) ) {
  65490. return;
  65491. }
  65492. const table = tableRow.parent;
  65493. const figureElement = conversionApi.mapper.toViewElement( table );
  65494. const tableElement = getViewTable( figureElement );
  65495. const row = table.getChildIndex( tableRow );
  65496. const tableWalker = new _tablewalker__WEBPACK_IMPORTED_MODULE_0__["default"]( table, { row } );
  65497. const tableAttributes = {
  65498. headingRows: table.getAttribute( 'headingRows' ) || 0,
  65499. headingColumns: table.getAttribute( 'headingColumns' ) || 0
  65500. };
  65501. // Cache for created table rows.
  65502. const viewRows = new Map();
  65503. for ( const tableSlot of tableWalker ) {
  65504. const trElement = viewRows.get( row ) || createTr( tableElement, tableRow, row, tableAttributes, conversionApi );
  65505. viewRows.set( row, trElement );
  65506. // Consume table cell - it will be always consumed as we convert whole row at once.
  65507. conversionApi.consumable.consume( tableSlot.cell, 'insert' );
  65508. const insertPosition = conversionApi.writer.createPositionAt( trElement, 'end' );
  65509. createViewTableCellElement( tableSlot, tableAttributes, insertPosition, conversionApi, { asWidget: true } );
  65510. }
  65511. } );
  65512. }
  65513. /**
  65514. * Model table cell element to view `<td>` or `<th>` element conversion helper.
  65515. *
  65516. * This conversion helper will create proper `<th>` elements for table cells that are in the heading section (heading row or column)
  65517. * and `<td>` otherwise.
  65518. *
  65519. * @returns {Function} Conversion helper.
  65520. */
  65521. function downcastInsertCell() {
  65522. return dispatcher => dispatcher.on( 'insert:tableCell', ( evt, data, conversionApi ) => {
  65523. const tableCell = data.item;
  65524. if ( !conversionApi.consumable.consume( tableCell, 'insert' ) ) {
  65525. return;
  65526. }
  65527. const tableRow = tableCell.parent;
  65528. const table = tableRow.parent;
  65529. const rowIndex = table.getChildIndex( tableRow );
  65530. const tableWalker = new _tablewalker__WEBPACK_IMPORTED_MODULE_0__["default"]( table, { row: rowIndex } );
  65531. const tableAttributes = {
  65532. headingRows: table.getAttribute( 'headingRows' ) || 0,
  65533. headingColumns: table.getAttribute( 'headingColumns' ) || 0
  65534. };
  65535. // We need to iterate over a table in order to get proper row & column values from a walker
  65536. for ( const tableSlot of tableWalker ) {
  65537. if ( tableSlot.cell === tableCell ) {
  65538. const trElement = conversionApi.mapper.toViewElement( tableRow );
  65539. const insertPosition = conversionApi.writer.createPositionAt( trElement, tableRow.getChildIndex( tableCell ) );
  65540. createViewTableCellElement( tableSlot, tableAttributes, insertPosition, conversionApi, { asWidget: true } );
  65541. // No need to iterate further.
  65542. return;
  65543. }
  65544. }
  65545. } );
  65546. }
  65547. /**
  65548. * Conversion helper that acts on heading column table attribute change.
  65549. *
  65550. * Depending on changed attributes this converter will rename `<td` to `<th>` elements or vice versa depending on the cell column index.
  65551. *
  65552. * @returns {Function} Conversion helper.
  65553. */
  65554. function downcastTableHeadingColumnsChange() {
  65555. return dispatcher => dispatcher.on( 'attribute:headingColumns:table', ( evt, data, conversionApi ) => {
  65556. const table = data.item;
  65557. if ( !conversionApi.consumable.consume( data.item, evt.name ) ) {
  65558. return;
  65559. }
  65560. const tableAttributes = {
  65561. headingRows: table.getAttribute( 'headingRows' ) || 0,
  65562. headingColumns: table.getAttribute( 'headingColumns' ) || 0
  65563. };
  65564. const oldColumns = data.attributeOldValue;
  65565. const newColumns = data.attributeNewValue;
  65566. const lastColumnToCheck = ( oldColumns > newColumns ? oldColumns : newColumns ) - 1;
  65567. for ( const tableSlot of new _tablewalker__WEBPACK_IMPORTED_MODULE_0__["default"]( table, { endColumn: lastColumnToCheck } ) ) {
  65568. renameViewTableCellIfRequired( tableSlot, tableAttributes, conversionApi );
  65569. }
  65570. } );
  65571. }
  65572. /**
  65573. * Conversion helper that acts on a removed row.
  65574. *
  65575. * @returns {Function} Conversion helper.
  65576. */
  65577. function downcastRemoveRow() {
  65578. return dispatcher => dispatcher.on( 'remove:tableRow', ( evt, data, conversionApi ) => {
  65579. // Prevent default remove converter.
  65580. evt.stop();
  65581. const viewWriter = conversionApi.writer;
  65582. const mapper = conversionApi.mapper;
  65583. const viewStart = mapper.toViewPosition( data.position ).getLastMatchingPosition( value => !value.item.is( 'element', 'tr' ) );
  65584. const viewItem = viewStart.nodeAfter;
  65585. const tableSection = viewItem.parent;
  65586. const viewTable = tableSection.parent;
  65587. // Remove associated <tr> from the view.
  65588. const removeRange = viewWriter.createRangeOn( viewItem );
  65589. const removed = viewWriter.remove( removeRange );
  65590. for ( const child of viewWriter.createRangeIn( removed ).getItems() ) {
  65591. mapper.unbindViewElement( child );
  65592. }
  65593. // Cleanup: Ensure that thead & tbody sections are removed if left empty after removing rows. See #6437, #6391.
  65594. removeTableSectionIfEmpty( 'thead', viewTable, conversionApi );
  65595. removeTableSectionIfEmpty( 'tbody', viewTable, conversionApi );
  65596. }, { priority: 'higher' } );
  65597. }
  65598. /**
  65599. * Overrides paragraph inside table cell conversion.
  65600. *
  65601. * This converter:
  65602. * * should be used to override default paragraph conversion in the editing view.
  65603. * * It will only convert <paragraph> placed directly inside <tableCell>.
  65604. * * For a single paragraph without attributes it returns `<span>` to simulate data table.
  65605. * * For all other cases it returns `<p>` element.
  65606. *
  65607. * @param {module:engine/model/element~Element} modelElement
  65608. * @param {module:engine/conversion/downcastdispatcher~DowncastConversionApi} conversionApi
  65609. * @returns {module:engine/view/containerelement~ContainerElement|undefined}
  65610. */
  65611. function convertParagraphInTableCell( modelElement, conversionApi ) {
  65612. const { writer } = conversionApi;
  65613. if ( !modelElement.parent.is( 'element', 'tableCell' ) ) {
  65614. return;
  65615. }
  65616. if ( isSingleParagraphWithoutAttributes( modelElement ) ) {
  65617. // Use display:inline-block to force Chrome/Safari to limit text mutations to this element.
  65618. // See #6062.
  65619. return writer.createContainerElement( 'span', { style: 'display:inline-block' } );
  65620. } else {
  65621. return writer.createContainerElement( 'p' );
  65622. }
  65623. }
  65624. /**
  65625. * Checks if given model `<paragraph>` is an only child of a parent (`<tableCell>`) and if it has any attribute set.
  65626. *
  65627. * The paragraph should be converted in the editing view to:
  65628. *
  65629. * * If returned `true` - to a `<span style="display:inline-block">`
  65630. * * If returned `false` - to a `<p>`
  65631. *
  65632. * @param {module:engine/model/element~Element} modelElement
  65633. * @returns {Boolean}
  65634. */
  65635. function isSingleParagraphWithoutAttributes( modelElement ) {
  65636. const tableCell = modelElement.parent;
  65637. const isSingleParagraph = tableCell.childCount === 1;
  65638. return isSingleParagraph && !hasAnyAttribute( modelElement );
  65639. }
  65640. // Converts a given {@link module:engine/view/element~Element} to a table widget:
  65641. // * Adds a {@link module:engine/view/element~Element#_setCustomProperty custom property} allowing to recognize the table widget element.
  65642. // * Calls the {@link module:widget/utils~toWidget} function with the proper element's label creator.
  65643. //
  65644. // @param {module:engine/view/element~Element} viewElement
  65645. // @param {module:engine/view/downcastwriter~DowncastWriter} writer An instance of the view writer.
  65646. // @param {String} label The element's label. It will be concatenated with the table `alt` attribute if one is present.
  65647. // @returns {module:engine/view/element~Element}
  65648. function toTableWidget( viewElement, writer ) {
  65649. writer.setCustomProperty( 'table', true, viewElement );
  65650. return Object(ckeditor5_src_widget__WEBPACK_IMPORTED_MODULE_1__["toWidget"])( viewElement, writer, { hasSelectionHandle: true } );
  65651. }
  65652. // Renames an existing table cell in the view to a given element name.
  65653. //
  65654. // **Note** This method will not do anything if a view table cell has not been converted yet.
  65655. //
  65656. // @param {module:engine/model/element~Element} tableCell
  65657. // @param {String} desiredCellElementName
  65658. // @param {module:engine/conversion/downcastdispatcher~DowncastConversionApi} conversionApi
  65659. function renameViewTableCell( tableCell, desiredCellElementName, conversionApi ) {
  65660. const viewWriter = conversionApi.writer;
  65661. const viewCell = conversionApi.mapper.toViewElement( tableCell );
  65662. const editable = viewWriter.createEditableElement( desiredCellElementName, viewCell.getAttributes() );
  65663. const renamedCell = Object(ckeditor5_src_widget__WEBPACK_IMPORTED_MODULE_1__["toWidgetEditable"])( editable, viewWriter );
  65664. Object(ckeditor5_src_widget__WEBPACK_IMPORTED_MODULE_1__["setHighlightHandling"])(
  65665. renamedCell,
  65666. viewWriter,
  65667. ( element, descriptor, writer ) => writer.addClass( Object(ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_2__["toArray"])( descriptor.classes ), element ),
  65668. ( element, descriptor, writer ) => writer.removeClass( Object(ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_2__["toArray"])( descriptor.classes ), element )
  65669. );
  65670. viewWriter.insert( viewWriter.createPositionAfter( viewCell ), renamedCell );
  65671. viewWriter.move( viewWriter.createRangeIn( viewCell ), viewWriter.createPositionAt( renamedCell, 0 ) );
  65672. viewWriter.remove( viewWriter.createRangeOn( viewCell ) );
  65673. conversionApi.mapper.unbindViewElement( viewCell );
  65674. conversionApi.mapper.bindElements( tableCell, renamedCell );
  65675. }
  65676. // Renames a table cell element in the view according to its location in the table.
  65677. //
  65678. // @param {module:table/tablewalker~TableSlot} tableSlot
  65679. // @param {{headingColumns, headingRows}} tableAttributes
  65680. // @param {module:engine/conversion/downcastdispatcher~DowncastConversionApi} conversionApi
  65681. function renameViewTableCellIfRequired( tableSlot, tableAttributes, conversionApi ) {
  65682. const { cell } = tableSlot;
  65683. // Check whether current columnIndex is overlapped by table cells from previous rows.
  65684. const desiredCellElementName = getCellElementName( tableSlot, tableAttributes );
  65685. const viewCell = conversionApi.mapper.toViewElement( cell );
  65686. // If in single change we're converting attribute changes and inserting cell the table cell might not be inserted into view
  65687. // because of child conversion is done after parent.
  65688. if ( viewCell && viewCell.name !== desiredCellElementName ) {
  65689. renameViewTableCell( cell, desiredCellElementName, conversionApi );
  65690. }
  65691. }
  65692. // Creates a table cell element in the view.
  65693. //
  65694. // @param {module:table/tablewalker~TableSlot} tableSlot
  65695. // @param {module:engine/view/position~Position} insertPosition
  65696. // @param {module:engine/conversion/downcastdispatcher~DowncastConversionApi} conversionApi
  65697. function createViewTableCellElement( tableSlot, tableAttributes, insertPosition, conversionApi, options ) {
  65698. const asWidget = options && options.asWidget;
  65699. const cellElementName = getCellElementName( tableSlot, tableAttributes );
  65700. const cellElement = asWidget ?
  65701. Object(ckeditor5_src_widget__WEBPACK_IMPORTED_MODULE_1__["toWidgetEditable"])( conversionApi.writer.createEditableElement( cellElementName ), conversionApi.writer ) :
  65702. conversionApi.writer.createContainerElement( cellElementName );
  65703. if ( asWidget ) {
  65704. Object(ckeditor5_src_widget__WEBPACK_IMPORTED_MODULE_1__["setHighlightHandling"])(
  65705. cellElement,
  65706. conversionApi.writer,
  65707. ( element, descriptor, writer ) => writer.addClass( Object(ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_2__["toArray"])( descriptor.classes ), element ),
  65708. ( element, descriptor, writer ) => writer.removeClass( Object(ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_2__["toArray"])( descriptor.classes ), element )
  65709. );
  65710. }
  65711. const tableCell = tableSlot.cell;
  65712. const firstChild = tableCell.getChild( 0 );
  65713. const isSingleParagraph = tableCell.childCount === 1 && firstChild.name === 'paragraph';
  65714. conversionApi.writer.insert( insertPosition, cellElement );
  65715. conversionApi.mapper.bindElements( tableCell, cellElement );
  65716. // Additional requirement for data pipeline to have backward compatible data tables.
  65717. if ( !asWidget && isSingleParagraph && !hasAnyAttribute( firstChild ) ) {
  65718. const innerParagraph = tableCell.getChild( 0 );
  65719. conversionApi.consumable.consume( innerParagraph, 'insert' );
  65720. conversionApi.mapper.bindElements( innerParagraph, cellElement );
  65721. }
  65722. }
  65723. // Creates a `<tr>` view element.
  65724. //
  65725. // @param {module:engine/view/element~Element} tableElement
  65726. // @param {module:engine/model/element~Element} tableRow
  65727. // @param {Number} rowIndex
  65728. // @param {{headingColumns, headingRows}} tableAttributes
  65729. // @param {module:engine/conversion/downcastdispatcher~DowncastConversionApi} conversionApi
  65730. // @returns {module:engine/view/element~Element}
  65731. function createTr( tableElement, tableRow, rowIndex, tableAttributes, conversionApi ) {
  65732. // Will always consume since we're converting <tableRow> element from a parent <table>.
  65733. conversionApi.consumable.consume( tableRow, 'insert' );
  65734. const trElement = tableRow.isEmpty ?
  65735. conversionApi.writer.createEmptyElement( 'tr' ) :
  65736. conversionApi.writer.createContainerElement( 'tr' );
  65737. conversionApi.mapper.bindElements( tableRow, trElement );
  65738. const headingRows = tableAttributes.headingRows;
  65739. const tableSection = getOrCreateTableSection( getSectionName( rowIndex, tableAttributes ), tableElement, conversionApi );
  65740. const offset = headingRows > 0 && rowIndex >= headingRows ? rowIndex - headingRows : rowIndex;
  65741. const position = conversionApi.writer.createPositionAt( tableSection, offset );
  65742. conversionApi.writer.insert( position, trElement );
  65743. return trElement;
  65744. }
  65745. // Returns `th` for heading cells and `td` for other cells for the current table walker value.
  65746. //
  65747. // @param {module:table/tablewalker~TableSlot} tableSlot
  65748. // @param {{headingColumns, headingRows}} tableAttributes
  65749. // @returns {String}
  65750. function getCellElementName( tableSlot, tableAttributes ) {
  65751. const { row, column } = tableSlot;
  65752. const { headingColumns, headingRows } = tableAttributes;
  65753. // Column heading are all tableCells in the first `columnHeading` rows.
  65754. const isColumnHeading = headingRows && headingRows > row;
  65755. // So a whole row gets <th> element.
  65756. if ( isColumnHeading ) {
  65757. return 'th';
  65758. }
  65759. // Row heading are tableCells which columnIndex is lower then headingColumns.
  65760. const isRowHeading = headingColumns && headingColumns > column;
  65761. return isRowHeading ? 'th' : 'td';
  65762. }
  65763. // Returns the table section name for the current table walker value.
  65764. //
  65765. // @param {Number} row
  65766. // @param {{headingColumns, headingRows}} tableAttributes
  65767. // @returns {String}
  65768. function getSectionName( row, tableAttributes ) {
  65769. return row < tableAttributes.headingRows ? 'thead' : 'tbody';
  65770. }
  65771. // Creates or returns an existing `<tbody>` or `<thead>` element with caching.
  65772. //
  65773. // @param {String} sectionName
  65774. // @param {module:engine/view/element~Element} viewTable
  65775. // @param {module:engine/conversion/downcastdispatcher~DowncastConversionApi} conversionApi
  65776. // @param {Object} cachedTableSection An object that stores cached elements.
  65777. // @returns {module:engine/view/containerelement~ContainerElement}
  65778. function getOrCreateTableSection( sectionName, viewTable, conversionApi ) {
  65779. const viewTableSection = getExistingTableSectionElement( sectionName, viewTable );
  65780. return viewTableSection ? viewTableSection : createTableSection( sectionName, viewTable, conversionApi );
  65781. }
  65782. // Finds an existing `<tbody>` or `<thead>` element or returns undefined.
  65783. //
  65784. // @param {String} sectionName
  65785. // @param {module:engine/view/element~Element} tableElement
  65786. // @param {module:engine/conversion/downcastdispatcher~DowncastConversionApi} conversionApi
  65787. function getExistingTableSectionElement( sectionName, tableElement ) {
  65788. for ( const tableSection of tableElement.getChildren() ) {
  65789. if ( tableSection.name == sectionName ) {
  65790. return tableSection;
  65791. }
  65792. }
  65793. }
  65794. // Creates a table section at the end of the table.
  65795. //
  65796. // @param {String} sectionName
  65797. // @param {module:engine/view/element~Element} tableElement
  65798. // @param {module:engine/conversion/downcastdispatcher~DowncastConversionApi} conversionApi
  65799. // @returns {module:engine/view/containerelement~ContainerElement}
  65800. function createTableSection( sectionName, tableElement, conversionApi ) {
  65801. const tableChildElement = conversionApi.writer.createContainerElement( sectionName );
  65802. const insertPosition = conversionApi.writer.createPositionAt( tableElement, sectionName == 'tbody' ? 'end' : 0 );
  65803. conversionApi.writer.insert( insertPosition, tableChildElement );
  65804. return tableChildElement;
  65805. }
  65806. // Removes an existing `<tbody>` or `<thead>` element if it is empty.
  65807. //
  65808. // @param {String} sectionName
  65809. // @param {module:engine/view/element~Element} tableElement
  65810. // @param {module:engine/conversion/downcastdispatcher~DowncastConversionApi} conversionApi
  65811. function removeTableSectionIfEmpty( sectionName, tableElement, conversionApi ) {
  65812. const tableSection = getExistingTableSectionElement( sectionName, tableElement );
  65813. if ( tableSection && tableSection.childCount === 0 ) {
  65814. conversionApi.writer.remove( conversionApi.writer.createRangeOn( tableSection ) );
  65815. }
  65816. }
  65817. // Finds a '<table>' element inside the `<figure>` widget.
  65818. //
  65819. // @param {module:engine/view/element~Element} viewFigure
  65820. function getViewTable( viewFigure ) {
  65821. for ( const child of viewFigure.getChildren() ) {
  65822. if ( child.name === 'table' ) {
  65823. return child;
  65824. }
  65825. }
  65826. }
  65827. // Checks if an element has any attributes set.
  65828. //
  65829. // @param {module:engine/model/element~Element element
  65830. // @returns {Boolean}
  65831. function hasAnyAttribute( element ) {
  65832. return !![ ...element.getAttributeKeys() ].length;
  65833. }
  65834. /***/ }),
  65835. /***/ "./node_modules/@ckeditor/ckeditor5-table/src/converters/table-cell-paragraph-post-fixer.js":
  65836. /*!**************************************************************************************************!*\
  65837. !*** ./node_modules/@ckeditor/ckeditor5-table/src/converters/table-cell-paragraph-post-fixer.js ***!
  65838. \**************************************************************************************************/
  65839. /*! exports provided: default */
  65840. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  65841. "use strict";
  65842. __webpack_require__.r(__webpack_exports__);
  65843. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return injectTableCellParagraphPostFixer; });
  65844. /**
  65845. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  65846. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  65847. */
  65848. /**
  65849. * @module table/converters/table-cell-paragraph-post-fixer
  65850. */
  65851. /**
  65852. * Injects a table cell post-fixer into the model which inserts a `paragraph` element into empty table cells.
  65853. *
  65854. * 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.
  65855. *
  65856. * <table>
  65857. * <tableRow>
  65858. * <tableCell></tableCell>
  65859. * </tableRow>
  65860. * </table>
  65861. *
  65862. * Will be fixed to:
  65863. *
  65864. * <table>
  65865. * <tableRow>
  65866. * <tableCell><paragraph></paragraph></tableCell>
  65867. * </tableRow>
  65868. * </table>
  65869. *
  65870. * @param {module:engine/model/model~Model} model
  65871. */
  65872. function injectTableCellParagraphPostFixer( model ) {
  65873. model.document.registerPostFixer( writer => tableCellContentsPostFixer( writer, model ) );
  65874. }
  65875. // The table cell contents post-fixer.
  65876. //
  65877. // @param {module:engine/model/writer~Writer} writer
  65878. // @param {module:engine/model/model~Model} model
  65879. function tableCellContentsPostFixer( writer, model ) {
  65880. const changes = model.document.differ.getChanges();
  65881. let wasFixed = false;
  65882. for ( const entry of changes ) {
  65883. if ( entry.type == 'insert' && entry.name == 'table' ) {
  65884. wasFixed = fixTable( entry.position.nodeAfter, writer ) || wasFixed;
  65885. }
  65886. if ( entry.type == 'insert' && entry.name == 'tableRow' ) {
  65887. wasFixed = fixTableRow( entry.position.nodeAfter, writer ) || wasFixed;
  65888. }
  65889. if ( entry.type == 'insert' && entry.name == 'tableCell' ) {
  65890. wasFixed = fixTableCellContent( entry.position.nodeAfter, writer ) || wasFixed;
  65891. }
  65892. if ( checkTableCellChange( entry ) ) {
  65893. wasFixed = fixTableCellContent( entry.position.parent, writer ) || wasFixed;
  65894. }
  65895. }
  65896. return wasFixed;
  65897. }
  65898. // Fixes all table cells in a table.
  65899. //
  65900. // @param {module:engine/model/element~Element} table
  65901. // @param {module:engine/model/writer~Writer} writer
  65902. function fixTable( table, writer ) {
  65903. let wasFixed = false;
  65904. for ( const row of table.getChildren() ) {
  65905. if ( row.is( 'element', 'tableRow' ) ) {
  65906. wasFixed = fixTableRow( row, writer ) || wasFixed;
  65907. }
  65908. }
  65909. return wasFixed;
  65910. }
  65911. // Fixes all table cells in a table row.
  65912. //
  65913. // @param {module:engine/model/element~Element} tableRow
  65914. // @param {module:engine/model/writer~Writer} writer
  65915. function fixTableRow( tableRow, writer ) {
  65916. let wasFixed = false;
  65917. for ( const tableCell of tableRow.getChildren() ) {
  65918. wasFixed = fixTableCellContent( tableCell, writer ) || wasFixed;
  65919. }
  65920. return wasFixed;
  65921. }
  65922. // Fixes all table cell content by:
  65923. // - Adding a paragraph to a table cell without any child.
  65924. // - Wrapping direct $text in a `<paragraph>`.
  65925. //
  65926. // @param {module:engine/model/element~Element} table
  65927. // @param {module:engine/model/writer~Writer} writer
  65928. // @returns {Boolean}
  65929. function fixTableCellContent( tableCell, writer ) {
  65930. // Insert paragraph to an empty table cell.
  65931. if ( tableCell.childCount == 0 ) {
  65932. // @if CK_DEBUG_TABLE // console.log( 'Post-fixing table: insert paragraph in empty cell.' );
  65933. writer.insertElement( 'paragraph', tableCell );
  65934. return true;
  65935. }
  65936. // Check table cell children for directly placed text nodes.
  65937. // Temporary solution. See https://github.com/ckeditor/ckeditor5/issues/1464.
  65938. const textNodes = Array.from( tableCell.getChildren() ).filter( child => child.is( '$text' ) );
  65939. // @if CK_DEBUG_TABLE // textNodes.length && console.log( 'Post-fixing table: wrap cell content with paragraph.' );
  65940. for ( const child of textNodes ) {
  65941. writer.wrap( writer.createRangeOn( child ), 'paragraph' );
  65942. }
  65943. // Return true when there were text nodes to fix.
  65944. return !!textNodes.length;
  65945. }
  65946. // Checks if a differ change should fix the table cell. This happens on:
  65947. // - Removing content from the table cell (i.e. `tableCell` can be left empty).
  65948. // - Adding a text node directly into a table cell.
  65949. //
  65950. // @param {Object} differ change entry
  65951. // @returns {Boolean}
  65952. function checkTableCellChange( entry ) {
  65953. if ( !entry.position || !entry.position.parent.is( 'element', 'tableCell' ) ) {
  65954. return false;
  65955. }
  65956. return entry.type == 'insert' && entry.name == '$text' || entry.type == 'remove';
  65957. }
  65958. /***/ }),
  65959. /***/ "./node_modules/@ckeditor/ckeditor5-table/src/converters/table-cell-refresh-post-fixer.js":
  65960. /*!************************************************************************************************!*\
  65961. !*** ./node_modules/@ckeditor/ckeditor5-table/src/converters/table-cell-refresh-post-fixer.js ***!
  65962. \************************************************************************************************/
  65963. /*! exports provided: default */
  65964. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  65965. "use strict";
  65966. __webpack_require__.r(__webpack_exports__);
  65967. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return injectTableCellRefreshPostFixer; });
  65968. /* harmony import */ var _downcast__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./downcast */ "./node_modules/@ckeditor/ckeditor5-table/src/converters/downcast.js");
  65969. /**
  65970. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  65971. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  65972. */
  65973. /**
  65974. * @module table/converters/table-cell-refresh-post-fixer
  65975. */
  65976. /**
  65977. * Injects a table cell post-fixer into the model which marks the table cell in the differ to have it re-rendered.
  65978. *
  65979. * Model `paragraph` inside a table cell can be rendered as `<span>` or `<p>`. It is rendered as `<span>` if this is the only block
  65980. * element in that table cell and it does not have any attributes. It is rendered as `<p>` otherwise.
  65981. *
  65982. * When table cell content changes, for example a second `paragraph` element is added, we need to ensure that the first `paragraph` is
  65983. * re-rendered so it changes from `<span>` to `<p>`. The easiest way to do it is to re-render the entire table cell.
  65984. *
  65985. * @param {module:engine/model/model~Model} model
  65986. * @param {module:engine/conversion/mapper~Mapper} mapper
  65987. */
  65988. function injectTableCellRefreshPostFixer( model, mapper ) {
  65989. model.document.registerPostFixer( () => tableCellRefreshPostFixer( model.document.differ, mapper ) );
  65990. }
  65991. function tableCellRefreshPostFixer( differ, mapper ) {
  65992. // Stores cells to be refreshed, so the table cell will be refreshed once for multiple changes.
  65993. // 1. Gather all changes inside table cell.
  65994. const cellsToCheck = new Set();
  65995. for ( const change of differ.getChanges() ) {
  65996. const parent = change.type == 'attribute' ? change.range.start.parent : change.position.parent;
  65997. if ( parent.is( 'element', 'tableCell' ) ) {
  65998. cellsToCheck.add( parent );
  65999. }
  66000. }
  66001. // @if CK_DEBUG_TABLE // console.log( `Post-fixing table: Checking table cell to refresh (${ cellsToCheck.size }).` );
  66002. // @if CK_DEBUG_TABLE // let paragraphsRefreshed = 0;
  66003. for ( const tableCell of cellsToCheck.values() ) {
  66004. for ( const paragraph of [ ...tableCell.getChildren() ].filter( child => shouldRefresh( child, mapper ) ) ) {
  66005. // @if CK_DEBUG_TABLE // console.log( `Post-fixing table: refreshing paragraph in table cell (${++paragraphsRefreshed}).` );
  66006. differ.refreshItem( paragraph );
  66007. }
  66008. }
  66009. // Always return false to prevent the refresh post-fixer from re-running on the same set of changes and going into an infinite loop.
  66010. // This "post-fixer" does not change the model structure so there shouldn't be need to run other post-fixers again.
  66011. // See https://github.com/ckeditor/ckeditor5/issues/1936 & https://github.com/ckeditor/ckeditor5/issues/8200.
  66012. return false;
  66013. }
  66014. // Check if given model element needs refreshing.
  66015. //
  66016. // @param {module:engine/model/element~Element} modelElement
  66017. // @param {module:engine/conversion/mapper~Mapper} mapper
  66018. // @returns {Boolean}
  66019. function shouldRefresh( child, mapper ) {
  66020. if ( !child.is( 'element', 'paragraph' ) ) {
  66021. return false;
  66022. }
  66023. const viewElement = mapper.toViewElement( child );
  66024. if ( !viewElement ) {
  66025. return false;
  66026. }
  66027. return Object(_downcast__WEBPACK_IMPORTED_MODULE_0__["isSingleParagraphWithoutAttributes"])( child ) !== viewElement.is( 'element', 'span' );
  66028. }
  66029. /***/ }),
  66030. /***/ "./node_modules/@ckeditor/ckeditor5-table/src/converters/table-heading-rows-refresh-post-fixer.js":
  66031. /*!********************************************************************************************************!*\
  66032. !*** ./node_modules/@ckeditor/ckeditor5-table/src/converters/table-heading-rows-refresh-post-fixer.js ***!
  66033. \********************************************************************************************************/
  66034. /*! exports provided: default */
  66035. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  66036. "use strict";
  66037. __webpack_require__.r(__webpack_exports__);
  66038. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return injectTableHeadingRowsRefreshPostFixer; });
  66039. /**
  66040. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  66041. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  66042. */
  66043. /**
  66044. * @module table/converters/table-heading-rows-refresh-post-fixer
  66045. */
  66046. /**
  66047. * Injects a table post-fixer into the model which marks the table in the differ to have it re-rendered.
  66048. *
  66049. * Table heading rows are represented in the model by a `headingRows` attribute. However, in the view, it's represented as separate
  66050. * sections of the table (`<thead>` or `<tbody>`) and changing `headingRows` attribute requires moving table rows between two sections.
  66051. * This causes problems with structural changes in a table (like adding and removing rows) thus atomic converters cannot be used.
  66052. *
  66053. * When table `headingRows` attribute changes, the entire table is re-rendered.
  66054. *
  66055. * @param {module:engine/model/model~Model} model
  66056. */
  66057. function injectTableHeadingRowsRefreshPostFixer( model ) {
  66058. model.document.registerPostFixer( () => tableHeadingRowsRefreshPostFixer( model ) );
  66059. }
  66060. function tableHeadingRowsRefreshPostFixer( model ) {
  66061. const differ = model.document.differ;
  66062. // Stores tables to be refreshed so the table will be refreshed once for multiple changes.
  66063. const tablesToRefresh = new Set();
  66064. for ( const change of differ.getChanges() ) {
  66065. if ( change.type != 'attribute' ) {
  66066. continue;
  66067. }
  66068. const element = change.range.start.nodeAfter;
  66069. if ( element && element.is( 'element', 'table' ) && change.attributeKey == 'headingRows' ) {
  66070. tablesToRefresh.add( element );
  66071. }
  66072. }
  66073. if ( tablesToRefresh.size ) {
  66074. // @if CK_DEBUG_TABLE // console.log( `Post-fixing table: refreshing heading rows (${ tablesToRefresh.size }).` );
  66075. for ( const table of tablesToRefresh.values() ) {
  66076. // Should be handled by a `triggerBy` configuration. See: https://github.com/ckeditor/ckeditor5/issues/8138.
  66077. differ.refreshItem( table );
  66078. }
  66079. return true;
  66080. }
  66081. return false;
  66082. }
  66083. /***/ }),
  66084. /***/ "./node_modules/@ckeditor/ckeditor5-table/src/converters/table-layout-post-fixer.js":
  66085. /*!******************************************************************************************!*\
  66086. !*** ./node_modules/@ckeditor/ckeditor5-table/src/converters/table-layout-post-fixer.js ***!
  66087. \******************************************************************************************/
  66088. /*! exports provided: default */
  66089. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  66090. "use strict";
  66091. __webpack_require__.r(__webpack_exports__);
  66092. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return injectTableLayoutPostFixer; });
  66093. /* harmony import */ var _tablewalker__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./../tablewalker */ "./node_modules/@ckeditor/ckeditor5-table/src/tablewalker.js");
  66094. /* harmony import */ var _utils_common__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils/common */ "./node_modules/@ckeditor/ckeditor5-table/src/utils/common.js");
  66095. /**
  66096. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  66097. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  66098. */
  66099. /**
  66100. * @module table/converters/table-layout-post-fixer
  66101. */
  66102. /**
  66103. * Injects a table layout post-fixer into the model.
  66104. *
  66105. * The role of the table layout post-fixer is to ensure that the table rows have the correct structure
  66106. * after a {@link module:engine/model/model~Model#change `change()`} block was executed.
  66107. *
  66108. * The correct structure means that:
  66109. *
  66110. * * All table rows have the same size.
  66111. * * None of the table cells extend vertically beyond their section (either header or body).
  66112. * * A table cell has always at least one element as a child.
  66113. *
  66114. * If the table structure is not correct, the post-fixer will automatically correct it in two steps:
  66115. *
  66116. * 1. It will clip table cells that extend beyond their section.
  66117. * 2. It will add empty table cells to the rows that are narrower than the widest table row.
  66118. *
  66119. * ## Clipping overlapping table cells
  66120. *
  66121. * Such situation may occur when pasting a table (or a part of a table) to the editor from external sources.
  66122. *
  66123. * For example, see the following table which has a cell (FOO) with the rowspan attribute (2):
  66124. *
  66125. * <table headingRows="1">
  66126. * <tableRow>
  66127. * <tableCell rowspan="2"><paragraph>FOO</paragraph></tableCell>
  66128. * <tableCell colspan="2"><paragraph>BAR</paragraph></tableCell>
  66129. * </tableRow>
  66130. * <tableRow>
  66131. * <tableCell><paragraph>BAZ</paragraph></tableCell>
  66132. * <tableCell><paragraph>XYZ</paragraph></tableCell>
  66133. * </tableRow>
  66134. * </table>
  66135. *
  66136. * It will be rendered in the view as:
  66137. *
  66138. * <table>
  66139. * <thead>
  66140. * <tr>
  66141. * <td rowspan="2">FOO</td>
  66142. * <td colspan="2">BAR</td>
  66143. * </tr>
  66144. * </thead>
  66145. * <tbody>
  66146. * <tr>
  66147. * <td>BAZ</td>
  66148. * <td>XYZ</td>
  66149. * </tr>
  66150. * </tbody>
  66151. * </table>
  66152. *
  66153. * 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.
  66154. * The table cell (FOO) cannot span over multiple rows as it would extend from the header to the body section.
  66155. * The `rowspan` attribute must be changed to (1). The value (1) is the default value of the `rowspan` attribute
  66156. * so the `rowspan` attribute will be removed from the model.
  66157. *
  66158. * The table cell with BAZ in the content will be in the first column of the table.
  66159. *
  66160. * ## Adding missing table cells
  66161. *
  66162. * The table post-fixer will insert empty table cells to equalize table row sizes (the number of columns).
  66163. * The size of a table row is calculated by counting column spans of table cells, both horizontal (from the same row) and
  66164. * vertical (from the rows above).
  66165. *
  66166. * 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
  66167. * with the default colspan (1). The header row has one cell with colspan (1) and the second with colspan (2).
  66168. * 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).
  66169. * The post-fixer will add a missing table cell to the row in the body section of the table.
  66170. *
  66171. * The table from the above example will be fixed and rendered to the view as below:
  66172. *
  66173. * <table>
  66174. * <thead>
  66175. * <tr>
  66176. * <td rowspan="2">FOO</td>
  66177. * <td colspan="2">BAR</td>
  66178. * </tr>
  66179. * </thead>
  66180. * <tbody>
  66181. * <tr>
  66182. * <td>BAZ</td>
  66183. * <td>XYZ</td>
  66184. * </tr>
  66185. * </tbody>
  66186. * </table>
  66187. *
  66188. * ## Collaboration and undo - Expectations vs post-fixer results
  66189. *
  66190. * The table post-fixer only ensures proper structure without a deeper analysis of the nature of the change. As such, it might lead
  66191. * to a structure which was not intended by the user. In particular, it will also fix undo steps (in conjunction with collaboration)
  66192. * in which the editor content might not return to the original state.
  66193. *
  66194. * This will usually happen when one or more users change the size of the table.
  66195. *
  66196. * As an example see the table below:
  66197. *
  66198. * <table>
  66199. * <tbody>
  66200. * <tr>
  66201. * <td>11</td>
  66202. * <td>12</td>
  66203. * </tr>
  66204. * <tr>
  66205. * <td>21</td>
  66206. * <td>22</td>
  66207. * </tr>
  66208. * </tbody>
  66209. * </table>
  66210. *
  66211. * and the user actions:
  66212. *
  66213. * 1. Both users have a table with two rows and two columns.
  66214. * 2. User A adds a column at the end of the table. This will insert empty table cells to two rows.
  66215. * 3. User B adds a row at the end of the table. This will insert a row with two empty table cells.
  66216. * 4. Both users will have a table as below:
  66217. *
  66218. *
  66219. * <table>
  66220. * <tbody>
  66221. * <tr>
  66222. * <td>11</td>
  66223. * <td>12</td>
  66224. * <td>(empty, inserted by A)</td>
  66225. * </tr>
  66226. * <tr>
  66227. * <td>21</td>
  66228. * <td>22</td>
  66229. * <td>(empty, inserted by A)</td>
  66230. * </tr>
  66231. * <tr>
  66232. * <td>(empty, inserted by B)</td>
  66233. * <td>(empty, inserted by B)</td>
  66234. * </tr>
  66235. * </tbody>
  66236. * </table>
  66237. *
  66238. * The last row is shorter then others so the table post-fixer will add an empty row to the last row:
  66239. *
  66240. * <table>
  66241. * <tbody>
  66242. * <tr>
  66243. * <td>11</td>
  66244. * <td>12</td>
  66245. * <td>(empty, inserted by A)</td>
  66246. * </tr>
  66247. * <tr>
  66248. * <td>21</td>
  66249. * <td>22</td>
  66250. * <td>(empty, inserted by A)</td>
  66251. * </tr>
  66252. * <tr>
  66253. * <td>(empty, inserted by B)</td>
  66254. * <td>(empty, inserted by B)</td>
  66255. * <td>(empty, inserted by the post-fixer)</td>
  66256. * </tr>
  66257. * </tbody>
  66258. * </table>
  66259. *
  66260. * Unfortunately undo does not know the nature of the changes and depending on which user applies the post-fixer changes, undoing them
  66261. * 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
  66262. * inserting empty cells to rows from the initial table state (row 1 and 2) but the cell in the post-fixed row will remain:
  66263. *
  66264. * <table>
  66265. * <tbody>
  66266. * <tr>
  66267. * <td>11</td>
  66268. * <td>12</td>
  66269. * </tr>
  66270. * <tr>
  66271. * <td>21</td>
  66272. * <td>22</td>
  66273. * </tr>
  66274. * <tr>
  66275. * <td>(empty, inserted by B)</td>
  66276. * <td>(empty, inserted by B)</td>
  66277. * <td>(empty, inserted by a post-fixer)</td>
  66278. * </tr>
  66279. * </tbody>
  66280. * </table>
  66281. *
  66282. * After undo, the table post-fixer will detect that two rows are shorter than others and will fix the table to:
  66283. *
  66284. * <table>
  66285. * <tbody>
  66286. * <tr>
  66287. * <td>11</td>
  66288. * <td>12</td>
  66289. * <td>(empty, inserted by a post-fixer after undo)</td>
  66290. * </tr>
  66291. * <tr>
  66292. * <td>21</td>
  66293. * <td>22</td>
  66294. * <td>(empty, inserted by a post-fixer after undo)</td>
  66295. * </tr>
  66296. * <tr>
  66297. * <td>(empty, inserted by B)</td>
  66298. * <td>(empty, inserted by B)</td>
  66299. * <td>(empty, inserted by a post-fixer)</td>
  66300. * </tr>
  66301. * </tbody>
  66302. * </table>
  66303. * @param {module:engine/model/model~Model} model
  66304. */
  66305. function injectTableLayoutPostFixer( model ) {
  66306. model.document.registerPostFixer( writer => tableLayoutPostFixer( writer, model ) );
  66307. }
  66308. // The table layout post-fixer.
  66309. //
  66310. // @param {module:engine/model/writer~Writer} writer
  66311. // @param {module:engine/model/model~Model} model
  66312. function tableLayoutPostFixer( writer, model ) {
  66313. const changes = model.document.differ.getChanges();
  66314. let wasFixed = false;
  66315. // Do not analyze the same table more then once - may happen for multiple changes in the same table.
  66316. const analyzedTables = new Set();
  66317. for ( const entry of changes ) {
  66318. let table;
  66319. if ( entry.name == 'table' && entry.type == 'insert' ) {
  66320. table = entry.position.nodeAfter;
  66321. }
  66322. // Fix table on adding/removing table cells and rows.
  66323. if ( entry.name == 'tableRow' || entry.name == 'tableCell' ) {
  66324. table = entry.position.findAncestor( 'table' );
  66325. }
  66326. // Fix table on any table's attribute change - including attributes of table cells.
  66327. if ( isTableAttributeEntry( entry ) ) {
  66328. table = entry.range.start.findAncestor( 'table' );
  66329. }
  66330. if ( table && !analyzedTables.has( table ) ) {
  66331. // Step 1: correct rowspans of table cells if necessary.
  66332. // The wasFixed flag should be true if any of tables in batch was fixed - might be more then one.
  66333. wasFixed = fixTableCellsRowspan( table, writer ) || wasFixed;
  66334. // Step 2: fix table rows sizes.
  66335. wasFixed = fixTableRowsSizes( table, writer ) || wasFixed;
  66336. analyzedTables.add( table );
  66337. }
  66338. }
  66339. return wasFixed;
  66340. }
  66341. // Fixes the invalid value of the `rowspan` attribute because a table cell cannot vertically extend beyond the table section it belongs to.
  66342. //
  66343. // @param {module:engine/model/element~Element} table
  66344. // @param {module:engine/model/writer~Writer} writer
  66345. // @returns {Boolean} Returns `true` if the table was fixed.
  66346. function fixTableCellsRowspan( table, writer ) {
  66347. let wasFixed = false;
  66348. const cellsToTrim = findCellsToTrim( table );
  66349. if ( cellsToTrim.length ) {
  66350. // @if CK_DEBUG_TABLE // console.log( `Post-fixing table: trimming cells row-spans (${ cellsToTrim.length }).` );
  66351. wasFixed = true;
  66352. for ( const data of cellsToTrim ) {
  66353. Object(_utils_common__WEBPACK_IMPORTED_MODULE_1__["updateNumericAttribute"])( 'rowspan', data.rowspan, data.cell, writer, 1 );
  66354. }
  66355. }
  66356. return wasFixed;
  66357. }
  66358. // Makes all table rows in a table the same size.
  66359. //
  66360. // @param {module:engine/model/element~Element} table
  66361. // @param {module:engine/model/writer~Writer} writer
  66362. // @returns {Boolean} Returns `true` if the table was fixed.
  66363. function fixTableRowsSizes( table, writer ) {
  66364. let wasFixed = false;
  66365. const childrenLengths = getChildrenLengths( table );
  66366. const rowsToRemove = [];
  66367. // Find empty rows.
  66368. for ( const [ rowIndex, size ] of childrenLengths.entries() ) {
  66369. // Ignore all non-row models.
  66370. if ( !size && table.getChild( rowIndex ).is( 'element', 'tableRow' ) ) {
  66371. rowsToRemove.push( rowIndex );
  66372. }
  66373. }
  66374. // Remove empty rows.
  66375. if ( rowsToRemove.length ) {
  66376. // @if CK_DEBUG_TABLE // console.log( `Post-fixing table: remove empty rows (${ rowsToRemove.length }).` );
  66377. wasFixed = true;
  66378. for ( const rowIndex of rowsToRemove.reverse() ) {
  66379. writer.remove( table.getChild( rowIndex ) );
  66380. childrenLengths.splice( rowIndex, 1 );
  66381. }
  66382. }
  66383. // Filter out everything that's not a table row.
  66384. const rowsLengths = childrenLengths.filter( ( row, rowIndex ) => table.getChild( rowIndex ).is( 'element', 'tableRow' ) );
  66385. // Verify if all the rows have the same number of columns.
  66386. const tableSize = rowsLengths[ 0 ];
  66387. const isValid = rowsLengths.every( length => length === tableSize );
  66388. if ( !isValid ) {
  66389. // @if CK_DEBUG_TABLE // console.log( 'Post-fixing table: adding missing cells.' );
  66390. // Find the maximum number of columns.
  66391. const maxColumns = rowsLengths.reduce( ( prev, current ) => current > prev ? current : prev, 0 );
  66392. for ( const [ rowIndex, size ] of rowsLengths.entries() ) {
  66393. const columnsToInsert = maxColumns - size;
  66394. if ( columnsToInsert ) {
  66395. for ( let i = 0; i < columnsToInsert; i++ ) {
  66396. Object(_utils_common__WEBPACK_IMPORTED_MODULE_1__["createEmptyTableCell"])( writer, writer.createPositionAt( table.getChild( rowIndex ), 'end' ) );
  66397. }
  66398. wasFixed = true;
  66399. }
  66400. }
  66401. }
  66402. return wasFixed;
  66403. }
  66404. // Searches for table cells that extend beyond the table section to which they belong to. It will return an array of objects
  66405. // that stores table cells to be trimmed and the correct value of the `rowspan` attribute to set.
  66406. //
  66407. // @param {module:engine/model/element~Element} table
  66408. // @returns {Array.<{{cell, rowspan}}>}
  66409. function findCellsToTrim( table ) {
  66410. const headingRows = parseInt( table.getAttribute( 'headingRows' ) || 0 );
  66411. const maxRows = Array.from( table.getChildren() )
  66412. .reduce( ( count, row ) => row.is( 'element', 'tableRow' ) ? count + 1 : count, 0 );
  66413. const cellsToTrim = [];
  66414. for ( const { row, cell, cellHeight } of new _tablewalker__WEBPACK_IMPORTED_MODULE_0__["default"]( table ) ) {
  66415. // Skip cells that do not expand over its row.
  66416. if ( cellHeight < 2 ) {
  66417. continue;
  66418. }
  66419. const isInHeader = row < headingRows;
  66420. // Row limit is either end of header section or whole table as table body is after the header.
  66421. const rowLimit = isInHeader ? headingRows : maxRows;
  66422. // If table cell expands over its limit reduce it height to proper value.
  66423. if ( row + cellHeight > rowLimit ) {
  66424. const newRowspan = rowLimit - row;
  66425. cellsToTrim.push( { cell, rowspan: newRowspan } );
  66426. }
  66427. }
  66428. return cellsToTrim;
  66429. }
  66430. // Returns an array with lengths of rows assigned to the corresponding row index.
  66431. //
  66432. // @param {module:engine/model/element~Element} table
  66433. // @returns {Array.<Number>}
  66434. function getChildrenLengths( table ) {
  66435. // TableWalker will not provide items for the empty rows, we need to pre-fill this array.
  66436. const lengths = new Array( table.childCount ).fill( 0 );
  66437. for ( const { rowIndex } of new _tablewalker__WEBPACK_IMPORTED_MODULE_0__["default"]( table, { includeAllSlots: true } ) ) {
  66438. lengths[ rowIndex ]++;
  66439. }
  66440. return lengths;
  66441. }
  66442. // Checks if the differ entry for an attribute change is one of the table's attributes.
  66443. //
  66444. // @param entry
  66445. // @returns {Boolean}
  66446. function isTableAttributeEntry( entry ) {
  66447. const isAttributeType = entry.type === 'attribute';
  66448. const key = entry.attributeKey;
  66449. return isAttributeType && ( key === 'headingRows' || key === 'colspan' || key === 'rowspan' );
  66450. }
  66451. /***/ }),
  66452. /***/ "./node_modules/@ckeditor/ckeditor5-table/src/converters/upcasttable.js":
  66453. /*!******************************************************************************!*\
  66454. !*** ./node_modules/@ckeditor/ckeditor5-table/src/converters/upcasttable.js ***!
  66455. \******************************************************************************/
  66456. /*! exports provided: upcastTableFigure, default, skipEmptyTableRow, ensureParagraphInTableCell */
  66457. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  66458. "use strict";
  66459. __webpack_require__.r(__webpack_exports__);
  66460. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "upcastTableFigure", function() { return upcastTableFigure; });
  66461. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return upcastTable; });
  66462. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "skipEmptyTableRow", function() { return skipEmptyTableRow; });
  66463. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ensureParagraphInTableCell", function() { return ensureParagraphInTableCell; });
  66464. /* harmony import */ var _utils_common__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils/common */ "./node_modules/@ckeditor/ckeditor5-table/src/utils/common.js");
  66465. /* harmony import */ var ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/utils */ "./node_modules/ckeditor5/src/utils.js");
  66466. /**
  66467. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  66468. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  66469. */
  66470. /**
  66471. * @module table/converters/upcasttable
  66472. */
  66473. /**
  66474. * Returns a function that converts the table view representation:
  66475. *
  66476. * <figure class="table"><table>...</table></figure>
  66477. *
  66478. * to the model representation:
  66479. *
  66480. * <table></table>
  66481. *
  66482. * @returns {Function}
  66483. */
  66484. function upcastTableFigure() {
  66485. return dispatcher => {
  66486. dispatcher.on( 'element:figure', ( evt, data, conversionApi ) => {
  66487. // Do not convert if this is not a "table figure".
  66488. if ( !conversionApi.consumable.test( data.viewItem, { name: true, classes: 'table' } ) ) {
  66489. return;
  66490. }
  66491. // Find an table element inside the figure element.
  66492. const viewTable = getViewTableFromFigure( data.viewItem );
  66493. // Do not convert if table element is absent or was already converted.
  66494. if ( !viewTable || !conversionApi.consumable.test( viewTable, { name: true } ) ) {
  66495. return;
  66496. }
  66497. // Convert view table to model table.
  66498. const conversionResult = conversionApi.convertItem( viewTable, data.modelCursor );
  66499. // Get table element from conversion result.
  66500. const modelTable = Object(ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_1__["first"])( conversionResult.modelRange.getItems() );
  66501. // When table wasn't successfully converted then finish conversion.
  66502. if ( !modelTable ) {
  66503. return;
  66504. }
  66505. conversionApi.convertChildren( data.viewItem, conversionApi.writer.createPositionAt( modelTable, 'end' ) );
  66506. conversionApi.updateConversionResult( modelTable, data );
  66507. } );
  66508. };
  66509. }
  66510. /**
  66511. * View table element to model table element conversion helper.
  66512. *
  66513. * This conversion helper converts the table element as well as table rows.
  66514. *
  66515. * @returns {Function} Conversion helper.
  66516. */
  66517. function upcastTable() {
  66518. return dispatcher => {
  66519. dispatcher.on( 'element:table', ( evt, data, conversionApi ) => {
  66520. const viewTable = data.viewItem;
  66521. // When element was already consumed then skip it.
  66522. if ( !conversionApi.consumable.test( viewTable, { name: true } ) ) {
  66523. return;
  66524. }
  66525. const { rows, headingRows, headingColumns } = scanTable( viewTable );
  66526. // Only set attributes if values is greater then 0.
  66527. const attributes = {};
  66528. if ( headingColumns ) {
  66529. attributes.headingColumns = headingColumns;
  66530. }
  66531. if ( headingRows ) {
  66532. attributes.headingRows = headingRows;
  66533. }
  66534. const table = conversionApi.writer.createElement( 'table', attributes );
  66535. if ( !conversionApi.safeInsert( table, data.modelCursor ) ) {
  66536. return;
  66537. }
  66538. conversionApi.consumable.consume( viewTable, { name: true } );
  66539. // Upcast table rows in proper order (heading rows first).
  66540. rows.forEach( row => conversionApi.convertItem( row, conversionApi.writer.createPositionAt( table, 'end' ) ) );
  66541. // Convert everything else.
  66542. conversionApi.convertChildren( viewTable, conversionApi.writer.createPositionAt( table, 'end' ) );
  66543. // Create one row and one table cell for empty table.
  66544. if ( table.isEmpty ) {
  66545. const row = conversionApi.writer.createElement( 'tableRow' );
  66546. conversionApi.writer.insert( row, conversionApi.writer.createPositionAt( table, 'end' ) );
  66547. Object(_utils_common__WEBPACK_IMPORTED_MODULE_0__["createEmptyTableCell"])( conversionApi.writer, conversionApi.writer.createPositionAt( row, 'end' ) );
  66548. }
  66549. conversionApi.updateConversionResult( table, data );
  66550. } );
  66551. };
  66552. }
  66553. /**
  66554. * A conversion helper that skips empty <tr> elements from upcasting at the beginning of the table.
  66555. *
  66556. * An empty row is considered a table model error but when handling clipboard data there could be rows that contain only row-spanned cells
  66557. * and empty TR-s are used to maintain the table structure (also {@link module:table/tablewalker~TableWalker} assumes that there are only
  66558. * rows that have related `tableRow` elements).
  66559. *
  66560. * *Note:* Only the first empty rows are removed because they have no meaning and it solves the issue
  66561. * of an improper table with all empty rows.
  66562. *
  66563. * @returns {Function} Conversion helper.
  66564. */
  66565. function skipEmptyTableRow() {
  66566. return dispatcher => {
  66567. dispatcher.on( 'element:tr', ( evt, data ) => {
  66568. if ( data.viewItem.isEmpty && data.modelCursor.index == 0 ) {
  66569. evt.stop();
  66570. }
  66571. }, { priority: 'high' } );
  66572. };
  66573. }
  66574. /**
  66575. * A converter that ensures an empty paragraph is inserted in a table cell if no other content was converted.
  66576. *
  66577. * @returns {Function} Conversion helper.
  66578. */
  66579. function ensureParagraphInTableCell( elementName ) {
  66580. return dispatcher => {
  66581. dispatcher.on( `element:${ elementName }`, ( evt, data, conversionApi ) => {
  66582. // The default converter will create a model range on converted table cell.
  66583. if ( !data.modelRange ) {
  66584. return;
  66585. }
  66586. // Ensure a paragraph in the model for empty table cells for converted table cells.
  66587. if ( data.viewItem.isEmpty ) {
  66588. const tableCell = data.modelRange.start.nodeAfter;
  66589. const modelCursor = conversionApi.writer.createPositionAt( tableCell, 0 );
  66590. conversionApi.writer.insertElement( 'paragraph', modelCursor );
  66591. }
  66592. }, { priority: 'low' } );
  66593. };
  66594. }
  66595. // Get view `<table>` element from the view widget (`<figure>`).
  66596. //
  66597. // @private
  66598. // @param {module:engine/view/element~Element} figureView
  66599. // @returns {module:engine/view/element~Element}
  66600. function getViewTableFromFigure( figureView ) {
  66601. for ( const figureChild of figureView.getChildren() ) {
  66602. if ( figureChild.is( 'element', 'table' ) ) {
  66603. return figureChild;
  66604. }
  66605. }
  66606. }
  66607. // Scans table rows and extracts required metadata from the table:
  66608. //
  66609. // headingRows - The number of rows that go as table headers.
  66610. // headingColumns - The maximum number of row headings.
  66611. // rows - Sorted `<tr>` elements as they should go into the model - ie. if `<thead>` is inserted after `<tbody>` in the view.
  66612. //
  66613. // @private
  66614. // @param {module:engine/view/element~Element} viewTable
  66615. // @returns {{headingRows, headingColumns, rows}}
  66616. function scanTable( viewTable ) {
  66617. const tableMeta = {
  66618. headingRows: 0,
  66619. headingColumns: 0
  66620. };
  66621. // The `<tbody>` and `<thead>` sections in the DOM do not have to be in order `<thead>` -> `<tbody>` and there might be more than one
  66622. // of them.
  66623. // As the model does not have these sections, rows from different sections must be sorted.
  66624. // For example, below is a valid HTML table:
  66625. //
  66626. // <table>
  66627. // <tbody><tr><td>2</td></tr></tbody>
  66628. // <thead><tr><td>1</td></tr></thead>
  66629. // <tbody><tr><td>3</td></tr></tbody>
  66630. // </table>
  66631. //
  66632. // But browsers will render rows in order as: 1 as the heading and 2 and 3 as the body.
  66633. const headRows = [];
  66634. const bodyRows = [];
  66635. // Currently the editor does not support more then one <thead> section.
  66636. // Only the first <thead> from the view will be used as a heading row and the others will be converted to body rows.
  66637. let firstTheadElement;
  66638. for ( const tableChild of Array.from( viewTable.getChildren() ) ) {
  66639. // Only `<thead>`, `<tbody>` & `<tfoot>` from allowed table children can have `<tr>`s.
  66640. // The else is for future purposes (mainly `<caption>`).
  66641. if ( tableChild.name === 'tbody' || tableChild.name === 'thead' || tableChild.name === 'tfoot' ) {
  66642. // Save the first `<thead>` in the table as table header - all other ones will be converted to table body rows.
  66643. if ( tableChild.name === 'thead' && !firstTheadElement ) {
  66644. firstTheadElement = tableChild;
  66645. }
  66646. // There might be some extra empty text nodes between the `<tr>`s.
  66647. // Make sure further code operates on `tr`s only. (#145)
  66648. const trs = Array.from( tableChild.getChildren() ).filter( el => el.is( 'element', 'tr' ) );
  66649. for ( const tr of trs ) {
  66650. // This <tr> is a child of a first <thead> element.
  66651. if ( tr.parent.name === 'thead' && tr.parent === firstTheadElement ) {
  66652. tableMeta.headingRows++;
  66653. headRows.push( tr );
  66654. } else {
  66655. bodyRows.push( tr );
  66656. // For other rows check how many column headings this row has.
  66657. const headingCols = scanRowForHeadingColumns( tr, tableMeta, firstTheadElement );
  66658. if ( headingCols > tableMeta.headingColumns ) {
  66659. tableMeta.headingColumns = headingCols;
  66660. }
  66661. }
  66662. }
  66663. }
  66664. }
  66665. tableMeta.rows = [ ...headRows, ...bodyRows ];
  66666. return tableMeta;
  66667. }
  66668. // Scans a `<tr>` element and its children for metadata:
  66669. // - For heading row:
  66670. // - Adds this row to either the heading or the body rows.
  66671. // - Updates the number of heading rows.
  66672. // - For body rows:
  66673. // - Calculates the number of column headings.
  66674. //
  66675. // @private
  66676. // @param {module:engine/view/element~Element} tr
  66677. // @returns {Number}
  66678. function scanRowForHeadingColumns( tr ) {
  66679. let headingColumns = 0;
  66680. let index = 0;
  66681. // Filter out empty text nodes from tr children.
  66682. const children = Array.from( tr.getChildren() )
  66683. .filter( child => child.name === 'th' || child.name === 'td' );
  66684. // Count starting adjacent <th> elements of a <tr>.
  66685. while ( index < children.length && children[ index ].name === 'th' ) {
  66686. const th = children[ index ];
  66687. // Adjust columns calculation by the number of spanned columns.
  66688. const colspan = parseInt( th.getAttribute( 'colspan' ) || 1 );
  66689. headingColumns = headingColumns + colspan;
  66690. index++;
  66691. }
  66692. return headingColumns;
  66693. }
  66694. /***/ }),
  66695. /***/ "./node_modules/@ckeditor/ckeditor5-table/src/table.js":
  66696. /*!*************************************************************!*\
  66697. !*** ./node_modules/@ckeditor/ckeditor5-table/src/table.js ***!
  66698. \*************************************************************/
  66699. /*! exports provided: default */
  66700. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  66701. "use strict";
  66702. __webpack_require__.r(__webpack_exports__);
  66703. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Table; });
  66704. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  66705. /* harmony import */ var ckeditor5_src_widget__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/widget */ "./node_modules/ckeditor5/src/widget.js");
  66706. /* harmony import */ var _tableediting__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./tableediting */ "./node_modules/@ckeditor/ckeditor5-table/src/tableediting.js");
  66707. /* harmony import */ var _tableui__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./tableui */ "./node_modules/@ckeditor/ckeditor5-table/src/tableui.js");
  66708. /* harmony import */ var _tableselection__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./tableselection */ "./node_modules/@ckeditor/ckeditor5-table/src/tableselection.js");
  66709. /* harmony import */ var _tableclipboard__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./tableclipboard */ "./node_modules/@ckeditor/ckeditor5-table/src/tableclipboard.js");
  66710. /* harmony import */ var _tablekeyboard__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./tablekeyboard */ "./node_modules/@ckeditor/ckeditor5-table/src/tablekeyboard.js");
  66711. /* harmony import */ var _tablemouse__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./tablemouse */ "./node_modules/@ckeditor/ckeditor5-table/src/tablemouse.js");
  66712. /* harmony import */ var _theme_table_css__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../theme/table.css */ "./node_modules/@ckeditor/ckeditor5-table/theme/table.css");
  66713. /* harmony import */ var _theme_table_css__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_theme_table_css__WEBPACK_IMPORTED_MODULE_8__);
  66714. /**
  66715. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  66716. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  66717. */
  66718. /**
  66719. * @module table/table
  66720. */
  66721. /**
  66722. * The table plugin.
  66723. *
  66724. * For a detailed overview, check the {@glink features/table Table feature documentation}.
  66725. *
  66726. * This is a "glue" plugin that loads the following table features:
  66727. *
  66728. * * {@link module:table/tableediting~TableEditing editing feature},
  66729. * * {@link module:table/tableselection~TableSelection selection feature},
  66730. * * {@link module:table/tablekeyboard~TableKeyboard keyboard navigation feature},
  66731. * * {@link module:table/tablemouse~TableMouse mouse selection feature},
  66732. * * {@link module:table/tableclipboard~TableClipboard clipboard feature},
  66733. * * {@link module:table/tableui~TableUI UI feature}.
  66734. *
  66735. * @extends module:core/plugin~Plugin
  66736. */
  66737. class Table extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  66738. /**
  66739. * @inheritDoc
  66740. */
  66741. static get requires() {
  66742. return [ _tableediting__WEBPACK_IMPORTED_MODULE_2__["default"], _tableui__WEBPACK_IMPORTED_MODULE_3__["default"], _tableselection__WEBPACK_IMPORTED_MODULE_4__["default"], _tablemouse__WEBPACK_IMPORTED_MODULE_7__["default"], _tablekeyboard__WEBPACK_IMPORTED_MODULE_6__["default"], _tableclipboard__WEBPACK_IMPORTED_MODULE_5__["default"], ckeditor5_src_widget__WEBPACK_IMPORTED_MODULE_1__["Widget"] ];
  66743. }
  66744. /**
  66745. * @inheritDoc
  66746. */
  66747. static get pluginName() {
  66748. return 'Table';
  66749. }
  66750. }
  66751. /**
  66752. * The configuration of the table feature. Used by the table feature in the `@ckeditor/ckeditor5-table` package.
  66753. *
  66754. * ClassicEditor
  66755. * .create( editorElement, {
  66756. * table: ... // Table feature options.
  66757. * } )
  66758. * .then( ... )
  66759. * .catch( ... );
  66760. *
  66761. * See {@link module:core/editor/editorconfig~EditorConfig all editor options}.
  66762. *
  66763. * @interface TableConfig
  66764. */
  66765. /**
  66766. * The configuration of the {@link module:table/table~Table} feature.
  66767. *
  66768. * Read more in {@link module:table/table~TableConfig}.
  66769. *
  66770. * @member {module:table/table~TableConfig} module:core/editor/editorconfig~EditorConfig#table
  66771. */
  66772. /**
  66773. * An array of color definitions (either strings or objects).
  66774. *
  66775. * const colors = [
  66776. * {
  66777. * color: 'hsl(0, 0%, 60%)',
  66778. * label: 'Grey'
  66779. * },
  66780. * 'hsl(0, 0%, 80%)',
  66781. * {
  66782. * color: 'hsl(0, 0%, 90%)',
  66783. * label: 'Light grey'
  66784. * },
  66785. * {
  66786. * color: 'hsl(0, 0%, 100%)',
  66787. * label: 'White',
  66788. * hasBorder: true
  66789. * },
  66790. * '#FF0000'
  66791. * ]
  66792. *
  66793. * Usually used as a configuration parameter, for instance in
  66794. * {@link module:table/table~TableConfig#tableProperties `config.table.tableProperties`}
  66795. * or {@link module:table/table~TableConfig#tableCellProperties `config.table.tableCellProperties`}.
  66796. *
  66797. * @typedef {Array.<String|Object>} module:table/table~TableColorConfig
  66798. */
  66799. /***/ }),
  66800. /***/ "./node_modules/@ckeditor/ckeditor5-table/src/tableclipboard.js":
  66801. /*!**********************************************************************!*\
  66802. !*** ./node_modules/@ckeditor/ckeditor5-table/src/tableclipboard.js ***!
  66803. \**********************************************************************/
  66804. /*! exports provided: default, getTableIfOnlyTableInContent */
  66805. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  66806. "use strict";
  66807. __webpack_require__.r(__webpack_exports__);
  66808. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return TableClipboard; });
  66809. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getTableIfOnlyTableInContent", function() { return getTableIfOnlyTableInContent; });
  66810. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  66811. /* harmony import */ var _tableselection__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./tableselection */ "./node_modules/@ckeditor/ckeditor5-table/src/tableselection.js");
  66812. /* harmony import */ var _tablewalker__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./tablewalker */ "./node_modules/@ckeditor/ckeditor5-table/src/tablewalker.js");
  66813. /* harmony import */ var _tableutils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./tableutils */ "./node_modules/@ckeditor/ckeditor5-table/src/tableutils.js");
  66814. /* harmony import */ var _utils_selection__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./utils/selection */ "./node_modules/@ckeditor/ckeditor5-table/src/utils/selection.js");
  66815. /* harmony import */ var _utils_structure__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./utils/structure */ "./node_modules/@ckeditor/ckeditor5-table/src/utils/structure.js");
  66816. /**
  66817. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  66818. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  66819. */
  66820. /**
  66821. * @module table/tableclipboard
  66822. */
  66823. /**
  66824. * This plugin adds support for copying/cutting/pasting fragments of tables.
  66825. * It is loaded automatically by the {@link module:table/table~Table} plugin.
  66826. *
  66827. * @extends module:core/plugin~Plugin
  66828. */
  66829. class TableClipboard extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  66830. /**
  66831. * @inheritDoc
  66832. */
  66833. static get pluginName() {
  66834. return 'TableClipboard';
  66835. }
  66836. /**
  66837. * @inheritDoc
  66838. */
  66839. static get requires() {
  66840. return [ _tableselection__WEBPACK_IMPORTED_MODULE_1__["default"], _tableutils__WEBPACK_IMPORTED_MODULE_3__["default"] ];
  66841. }
  66842. /**
  66843. * @inheritDoc
  66844. */
  66845. init() {
  66846. const editor = this.editor;
  66847. const viewDocument = editor.editing.view.document;
  66848. this.listenTo( viewDocument, 'copy', ( evt, data ) => this._onCopyCut( evt, data ) );
  66849. this.listenTo( viewDocument, 'cut', ( evt, data ) => this._onCopyCut( evt, data ) );
  66850. this.listenTo( editor.model, 'insertContent', ( evt, args ) => this._onInsertContent( evt, ...args ), { priority: 'high' } );
  66851. this.decorate( '_replaceTableSlotCell' );
  66852. }
  66853. /**
  66854. * Copies table content to a clipboard on "copy" & "cut" events.
  66855. *
  66856. * @private
  66857. * @param {module:utils/eventinfo~EventInfo} evt An object containing information about the handled event.
  66858. * @param {Object} data Clipboard event data.
  66859. */
  66860. _onCopyCut( evt, data ) {
  66861. const tableSelection = this.editor.plugins.get( _tableselection__WEBPACK_IMPORTED_MODULE_1__["default"] );
  66862. if ( !tableSelection.getSelectedTableCells() ) {
  66863. return;
  66864. }
  66865. if ( evt.name == 'cut' && this.editor.isReadOnly ) {
  66866. return;
  66867. }
  66868. data.preventDefault();
  66869. evt.stop();
  66870. const dataController = this.editor.data;
  66871. const viewDocument = this.editor.editing.view.document;
  66872. const content = dataController.toView( tableSelection.getSelectionAsFragment() );
  66873. viewDocument.fire( 'clipboardOutput', {
  66874. dataTransfer: data.dataTransfer,
  66875. content,
  66876. method: evt.name
  66877. } );
  66878. }
  66879. /**
  66880. * Overrides default {@link module:engine/model/model~Model#insertContent `model.insertContent()`} method to handle pasting table inside
  66881. * selected table fragment.
  66882. *
  66883. * Depending on selected table fragment:
  66884. * - If a selected table fragment is smaller than paste table it will crop pasted table to match dimensions.
  66885. * - If dimensions are equal it will replace selected table fragment with a pasted table contents.
  66886. *
  66887. * @private
  66888. * @param evt
  66889. * @param {module:engine/model/documentfragment~DocumentFragment|module:engine/model/item~Item} content The content to insert.
  66890. * @param {module:engine/model/selection~Selectable} [selectable=model.document.selection]
  66891. * The selection into which the content should be inserted. If not provided the current model document selection will be used.
  66892. */
  66893. _onInsertContent( evt, content, selectable ) {
  66894. if ( selectable && !selectable.is( 'documentSelection' ) ) {
  66895. return;
  66896. }
  66897. const model = this.editor.model;
  66898. const tableUtils = this.editor.plugins.get( _tableutils__WEBPACK_IMPORTED_MODULE_3__["default"] );
  66899. // We might need to crop table before inserting so reference might change.
  66900. let pastedTable = getTableIfOnlyTableInContent( content, model );
  66901. if ( !pastedTable ) {
  66902. return;
  66903. }
  66904. const selectedTableCells = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_4__["getSelectionAffectedTableCells"])( model.document.selection );
  66905. if ( !selectedTableCells.length ) {
  66906. Object(_utils_structure__WEBPACK_IMPORTED_MODULE_5__["removeEmptyRowsColumns"])( pastedTable, tableUtils );
  66907. return;
  66908. }
  66909. // Override default model.insertContent() handling at this point.
  66910. evt.stop();
  66911. model.change( writer => {
  66912. const pastedDimensions = {
  66913. width: tableUtils.getColumns( pastedTable ),
  66914. height: tableUtils.getRows( pastedTable )
  66915. };
  66916. // Prepare the table for pasting.
  66917. const selection = prepareTableForPasting( selectedTableCells, pastedDimensions, writer, tableUtils );
  66918. // Beyond this point we operate on a fixed content table with rectangular selection and proper last row/column values.
  66919. const selectionHeight = selection.lastRow - selection.firstRow + 1;
  66920. const selectionWidth = selection.lastColumn - selection.firstColumn + 1;
  66921. // Crop pasted table if:
  66922. // - Pasted table dimensions exceeds selection area.
  66923. // - Pasted table has broken layout (ie some cells sticks out by the table dimensions established by the first and last row).
  66924. //
  66925. // Note: The table dimensions are established by the width of the first row and the total number of rows.
  66926. // It is possible to programmatically create a table that has rows which would have cells anchored beyond first row width but
  66927. // such table will not be created by other editing solutions.
  66928. const cropDimensions = {
  66929. startRow: 0,
  66930. startColumn: 0,
  66931. endRow: Math.min( selectionHeight, pastedDimensions.height ) - 1,
  66932. endColumn: Math.min( selectionWidth, pastedDimensions.width ) - 1
  66933. };
  66934. pastedTable = Object(_utils_structure__WEBPACK_IMPORTED_MODULE_5__["cropTableToDimensions"])( pastedTable, cropDimensions, writer );
  66935. // Content table to which we insert a pasted table.
  66936. const selectedTable = selectedTableCells[ 0 ].findAncestor( 'table' );
  66937. const cellsToSelect = this._replaceSelectedCellsWithPasted( pastedTable, pastedDimensions, selectedTable, selection, writer );
  66938. if ( this.editor.plugins.get( 'TableSelection' ).isEnabled ) {
  66939. // Selection ranges must be sorted because the first and last selection ranges are considered
  66940. // as anchor/focus cell ranges for multi-cell selection.
  66941. const selectionRanges = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_4__["sortRanges"])( cellsToSelect.map( cell => writer.createRangeOn( cell ) ) );
  66942. writer.setSelection( selectionRanges );
  66943. } else {
  66944. // Set selection inside first cell if multi-cell selection is disabled.
  66945. writer.setSelection( cellsToSelect[ 0 ], 0 );
  66946. }
  66947. } );
  66948. }
  66949. /**
  66950. * Replaces the part of selectedTable with pastedTable.
  66951. *
  66952. * @private
  66953. * @param {module:engine/model/element~Element} pastedTable
  66954. * @param {Object} pastedDimensions
  66955. * @param {Number} pastedDimensions.height
  66956. * @param {Number} pastedDimensions.width
  66957. * @param {module:engine/model/element~Element} selectedTable
  66958. * @param {Object} selection
  66959. * @param {Number} selection.firstColumn
  66960. * @param {Number} selection.firstRow
  66961. * @param {Number} selection.lastColumn
  66962. * @param {Number} selection.lastRow
  66963. * @param {module:engine/model/writer~Writer} writer
  66964. * @returns {Array.<module:engine/model/element~Element>}
  66965. */
  66966. _replaceSelectedCellsWithPasted( pastedTable, pastedDimensions, selectedTable, selection, writer ) {
  66967. const { width: pastedWidth, height: pastedHeight } = pastedDimensions;
  66968. // Holds two-dimensional array that is addressed by [ row ][ column ] that stores cells anchored at given location.
  66969. const pastedTableLocationMap = createLocationMap( pastedTable, pastedWidth, pastedHeight );
  66970. const selectedTableMap = [ ...new _tablewalker__WEBPACK_IMPORTED_MODULE_2__["default"]( selectedTable, {
  66971. startRow: selection.firstRow,
  66972. endRow: selection.lastRow,
  66973. startColumn: selection.firstColumn,
  66974. endColumn: selection.lastColumn,
  66975. includeAllSlots: true
  66976. } ) ];
  66977. // Selection must be set to pasted cells (some might be removed or new created).
  66978. const cellsToSelect = [];
  66979. // Store next cell insert position.
  66980. let insertPosition;
  66981. // Content table replace cells algorithm iterates over a selected table fragment and:
  66982. //
  66983. // - Removes existing table cells at current slot (location).
  66984. // - Inserts cell from a pasted table for a matched slots.
  66985. //
  66986. // This ensures proper table geometry after the paste
  66987. for ( const tableSlot of selectedTableMap ) {
  66988. const { row, column } = tableSlot;
  66989. // Save the insert position for current row start.
  66990. if ( column === selection.firstColumn ) {
  66991. insertPosition = tableSlot.getPositionBefore();
  66992. }
  66993. // Map current table slot location to an pasted table slot location.
  66994. const pastedRow = row - selection.firstRow;
  66995. const pastedColumn = column - selection.firstColumn;
  66996. const pastedCell = pastedTableLocationMap[ pastedRow % pastedHeight ][ pastedColumn % pastedWidth ];
  66997. // Clone cell to insert (to duplicate its attributes and children).
  66998. // Cloning is required to support repeating pasted table content when inserting to a bigger selection.
  66999. const cellToInsert = pastedCell ? writer.cloneElement( pastedCell ) : null;
  67000. // Replace the cell from the current slot with new table cell.
  67001. const newTableCell = this._replaceTableSlotCell( tableSlot, cellToInsert, insertPosition, writer );
  67002. // The cell was only removed.
  67003. if ( !newTableCell ) {
  67004. continue;
  67005. }
  67006. // Trim the cell if it's row/col-spans would exceed selection area.
  67007. Object(_utils_structure__WEBPACK_IMPORTED_MODULE_5__["trimTableCellIfNeeded"])( newTableCell, row, column, selection.lastRow, selection.lastColumn, writer );
  67008. cellsToSelect.push( newTableCell );
  67009. insertPosition = writer.createPositionAfter( newTableCell );
  67010. }
  67011. // If there are any headings, all the cells that overlap from heading must be splitted.
  67012. const headingRows = parseInt( selectedTable.getAttribute( 'headingRows' ) || 0 );
  67013. const headingColumns = parseInt( selectedTable.getAttribute( 'headingColumns' ) || 0 );
  67014. const areHeadingRowsIntersectingSelection = selection.firstRow < headingRows && headingRows <= selection.lastRow;
  67015. const areHeadingColumnsIntersectingSelection = selection.firstColumn < headingColumns && headingColumns <= selection.lastColumn;
  67016. if ( areHeadingRowsIntersectingSelection ) {
  67017. const columnsLimit = { first: selection.firstColumn, last: selection.lastColumn };
  67018. const newCells = doHorizontalSplit( selectedTable, headingRows, columnsLimit, writer, selection.firstRow );
  67019. cellsToSelect.push( ...newCells );
  67020. }
  67021. if ( areHeadingColumnsIntersectingSelection ) {
  67022. const rowsLimit = { first: selection.firstRow, last: selection.lastRow };
  67023. const newCells = doVerticalSplit( selectedTable, headingColumns, rowsLimit, writer );
  67024. cellsToSelect.push( ...newCells );
  67025. }
  67026. return cellsToSelect;
  67027. }
  67028. /**
  67029. * Replaces a single table slot.
  67030. *
  67031. * @private
  67032. * @param {module:table/tablewalker~TableSlot} tableSlot
  67033. * @param {module:engine/model/element~Element} cellToInsert
  67034. * @param {module:engine/model/position~Position} insertPosition
  67035. * @param {module:engine/model/writer~Writer} writer
  67036. * @returns {module:engine/model/element~Element|null} Inserted table cell or null if slot should remain empty.
  67037. */
  67038. _replaceTableSlotCell( tableSlot, cellToInsert, insertPosition, writer ) {
  67039. const { cell, isAnchor } = tableSlot;
  67040. // If the slot is occupied by a cell in a selected table - remove it.
  67041. // The slot of this cell will be either:
  67042. // - Replaced by a pasted table cell.
  67043. // - Spanned by a previously pasted table cell.
  67044. if ( isAnchor ) {
  67045. writer.remove( cell );
  67046. }
  67047. // There is no cell to insert (might be spanned by other cell in a pasted table) - advance to the next content table slot.
  67048. if ( !cellToInsert ) {
  67049. return null;
  67050. }
  67051. writer.insert( cellToInsert, insertPosition );
  67052. return cellToInsert;
  67053. }
  67054. }
  67055. /**
  67056. * Extract table for pasting into table.
  67057. *
  67058. * @private
  67059. * @param {module:engine/model/documentfragment~DocumentFragment|module:engine/model/item~Item} content The content to insert.
  67060. * @param {module:engine/model/model~Model} model The editor model.
  67061. * @returns {module:engine/model/element~Element|null}
  67062. */
  67063. function getTableIfOnlyTableInContent( content, model ) {
  67064. if ( !content.is( 'documentFragment' ) && !content.is( 'element' ) ) {
  67065. return null;
  67066. }
  67067. // Table passed directly.
  67068. if ( content.is( 'element', 'table' ) ) {
  67069. return content;
  67070. }
  67071. // We do not support mixed content when pasting table into table.
  67072. // See: https://github.com/ckeditor/ckeditor5/issues/6817.
  67073. if ( content.childCount == 1 && content.getChild( 0 ).is( 'element', 'table' ) ) {
  67074. return content.getChild( 0 );
  67075. }
  67076. // If there are only whitespaces around a table then use that table for pasting.
  67077. const contentRange = model.createRangeIn( content );
  67078. for ( const element of contentRange.getItems() ) {
  67079. if ( element.is( 'element', 'table' ) ) {
  67080. // Stop checking if there is some content before table.
  67081. const rangeBefore = model.createRange( contentRange.start, model.createPositionBefore( element ) );
  67082. if ( model.hasContent( rangeBefore, { ignoreWhitespaces: true } ) ) {
  67083. return null;
  67084. }
  67085. // Stop checking if there is some content after table.
  67086. const rangeAfter = model.createRange( model.createPositionAfter( element ), contentRange.end );
  67087. if ( model.hasContent( rangeAfter, { ignoreWhitespaces: true } ) ) {
  67088. return null;
  67089. }
  67090. // There wasn't any content neither before nor after.
  67091. return element;
  67092. }
  67093. }
  67094. return null;
  67095. }
  67096. // Prepares a table for pasting and returns adjusted selection dimensions.
  67097. //
  67098. // @param {Array.<module:engine/model/element~Element>} selectedTableCells
  67099. // @param {Object} pastedDimensions
  67100. // @param {Number} pastedDimensions.height
  67101. // @param {Number} pastedDimensions.width
  67102. // @param {module:engine/model/writer~Writer} writer
  67103. // @param {module:table/tableutils~TableUtils} tableUtils
  67104. // @returns {Object} selection
  67105. // @returns {Number} selection.firstColumn
  67106. // @returns {Number} selection.firstRow
  67107. // @returns {Number} selection.lastColumn
  67108. // @returns {Number} selection.lastRow
  67109. function prepareTableForPasting( selectedTableCells, pastedDimensions, writer, tableUtils ) {
  67110. const selectedTable = selectedTableCells[ 0 ].findAncestor( 'table' );
  67111. const columnIndexes = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_4__["getColumnIndexes"])( selectedTableCells );
  67112. const rowIndexes = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_4__["getRowIndexes"])( selectedTableCells );
  67113. const selection = {
  67114. firstColumn: columnIndexes.first,
  67115. lastColumn: columnIndexes.last,
  67116. firstRow: rowIndexes.first,
  67117. lastRow: rowIndexes.last
  67118. };
  67119. // Single cell selected - expand selection to pasted table dimensions.
  67120. const shouldExpandSelection = selectedTableCells.length === 1;
  67121. if ( shouldExpandSelection ) {
  67122. selection.lastRow += pastedDimensions.height - 1;
  67123. selection.lastColumn += pastedDimensions.width - 1;
  67124. expandTableSize( selectedTable, selection.lastRow + 1, selection.lastColumn + 1, tableUtils );
  67125. }
  67126. // In case of expanding selection we do not reset the selection so in this case we will always try to fix selection
  67127. // like in the case of a non-rectangular area. This might be fixed by re-setting selected cells array but this shortcut is safe.
  67128. if ( shouldExpandSelection || !Object(_utils_selection__WEBPACK_IMPORTED_MODULE_4__["isSelectionRectangular"])( selectedTableCells, tableUtils ) ) {
  67129. // For a non-rectangular selection (ie in which some cells sticks out from a virtual selection rectangle) we need to create
  67130. // a table layout that has a rectangular selection. This will split cells so the selection become rectangular.
  67131. // Beyond this point we will operate on fixed content table.
  67132. splitCellsToRectangularSelection( selectedTable, selection, writer );
  67133. }
  67134. // However a selected table fragment might be invalid if examined alone. Ie such table fragment:
  67135. //
  67136. // +---+---+---+---+
  67137. // 0 | a | b | c | d |
  67138. // + + +---+---+
  67139. // 1 | | e | f | g |
  67140. // + +---+ +---+
  67141. // 2 | | h | | i | <- last row, each cell has rowspan = 2,
  67142. // + + + + + so we need to return 3, not 2
  67143. // 3 | | | | |
  67144. // +---+---+---+---+
  67145. //
  67146. // is invalid as the cells "h" and "i" have rowspans.
  67147. // This case needs only adjusting the selection dimension as the rest of the algorithm operates on empty slots also.
  67148. else {
  67149. selection.lastRow = Object(_utils_structure__WEBPACK_IMPORTED_MODULE_5__["adjustLastRowIndex"])( selectedTable, selection );
  67150. selection.lastColumn = Object(_utils_structure__WEBPACK_IMPORTED_MODULE_5__["adjustLastColumnIndex"])( selectedTable, selection );
  67151. }
  67152. return selection;
  67153. }
  67154. // Expand table (in place) to expected size.
  67155. function expandTableSize( table, expectedHeight, expectedWidth, tableUtils ) {
  67156. const tableWidth = tableUtils.getColumns( table );
  67157. const tableHeight = tableUtils.getRows( table );
  67158. if ( expectedWidth > tableWidth ) {
  67159. tableUtils.insertColumns( table, {
  67160. at: tableWidth,
  67161. columns: expectedWidth - tableWidth
  67162. } );
  67163. }
  67164. if ( expectedHeight > tableHeight ) {
  67165. tableUtils.insertRows( table, {
  67166. at: tableHeight,
  67167. rows: expectedHeight - tableHeight
  67168. } );
  67169. }
  67170. }
  67171. // Returns two-dimensional array that is addressed by [ row ][ column ] that stores cells anchored at given location.
  67172. //
  67173. // At given row & column location it might be one of:
  67174. //
  67175. // * cell - cell from pasted table anchored at this location.
  67176. // * null - if no cell is anchored at this location.
  67177. //
  67178. // For instance, from a table below:
  67179. //
  67180. // +----+----+----+----+
  67181. // | 00 | 01 | 02 | 03 |
  67182. // + +----+----+----+
  67183. // | | 11 | 13 |
  67184. // +----+ +----+
  67185. // | 20 | | 23 |
  67186. // +----+----+----+----+
  67187. //
  67188. // The method will return an array (numbers represents cell element):
  67189. //
  67190. // const map = [
  67191. // [ '00', '01', '02', '03' ],
  67192. // [ null, '11', null, '13' ],
  67193. // [ '20', null, null, '23' ]
  67194. // ]
  67195. //
  67196. // This allows for a quick access to table at give row & column. For instance to access table cell "13" from pasted table call:
  67197. //
  67198. // const cell = map[ 1 ][ 3 ]
  67199. //
  67200. function createLocationMap( table, width, height ) {
  67201. // Create height x width (row x column) two-dimensional table to store cells.
  67202. const map = new Array( height ).fill( null )
  67203. .map( () => new Array( width ).fill( null ) );
  67204. for ( const { column, row, cell } of new _tablewalker__WEBPACK_IMPORTED_MODULE_2__["default"]( table ) ) {
  67205. map[ row ][ column ] = cell;
  67206. }
  67207. return map;
  67208. }
  67209. // Make selected cells rectangular by splitting the cells that stand out from a rectangular selection.
  67210. //
  67211. // In the table below a selection is shown with "::" and slots with anchor cells are named.
  67212. //
  67213. // +----+----+----+----+----+ +----+----+----+----+----+
  67214. // | 00 | 01 | 02 | 03 | | 00 | 01 | 02 | 03 |
  67215. // + +----+ +----+----+ | ::::::::::::::::----+
  67216. // | | 11 | | 13 | 14 | | ::11 | | 13:: 14 | <- first row
  67217. // +----+----+ + +----+ +----::---| | ::----+
  67218. // | 20 | 21 | | | 24 | select cells: | 20 ::21 | | :: 24 |
  67219. // +----+----+ +----+----+ 11 -> 33 +----::---| |---::----+
  67220. // | 30 | | 33 | 34 | | 30 :: | | 33:: 34 | <- last row
  67221. // + + +----+ + | :::::::::::::::: +
  67222. // | | | 43 | | | | | 43 | |
  67223. // +----+----+----+----+----+ +----+----+----+----+----+
  67224. // ^ ^
  67225. // first & last columns
  67226. //
  67227. // Will update table to:
  67228. //
  67229. // +----+----+----+----+----+
  67230. // | 00 | 01 | 02 | 03 |
  67231. // + +----+----+----+----+
  67232. // | | 11 | | 13 | 14 |
  67233. // +----+----+ + +----+
  67234. // | 20 | 21 | | | 24 |
  67235. // +----+----+ +----+----+
  67236. // | 30 | | | 33 | 34 |
  67237. // + +----+----+----+ +
  67238. // | | | | 43 | |
  67239. // +----+----+----+----+----+
  67240. //
  67241. // In th example above:
  67242. // - Cell "02" which have `rowspan = 4` must be trimmed at first and at after last row.
  67243. // - Cell "03" which have `rowspan = 2` and `colspan = 2` must be trimmed at first column and after last row.
  67244. // - Cells "00", "03" & "30" which cannot be cut by this algorithm as they are outside the trimmed area.
  67245. // - Cell "13" cannot be cut as it is inside the trimmed area.
  67246. function splitCellsToRectangularSelection( table, dimensions, writer ) {
  67247. const { firstRow, lastRow, firstColumn, lastColumn } = dimensions;
  67248. const rowIndexes = { first: firstRow, last: lastRow };
  67249. const columnIndexes = { first: firstColumn, last: lastColumn };
  67250. // 1. Split cells vertically in two steps as first step might create cells that needs to split again.
  67251. doVerticalSplit( table, firstColumn, rowIndexes, writer );
  67252. doVerticalSplit( table, lastColumn + 1, rowIndexes, writer );
  67253. // 2. Split cells horizontally in two steps as first step might create cells that needs to split again.
  67254. doHorizontalSplit( table, firstRow, columnIndexes, writer );
  67255. doHorizontalSplit( table, lastRow + 1, columnIndexes, writer, firstRow );
  67256. }
  67257. function doHorizontalSplit( table, splitRow, limitColumns, writer, startRow = 0 ) {
  67258. // If selection starts at first row then no split is needed.
  67259. if ( splitRow < 1 ) {
  67260. return;
  67261. }
  67262. const overlappingCells = Object(_utils_structure__WEBPACK_IMPORTED_MODULE_5__["getVerticallyOverlappingCells"])( table, splitRow, startRow );
  67263. // Filter out cells that are not touching insides of the rectangular selection.
  67264. const cellsToSplit = overlappingCells.filter( ( { column, cellWidth } ) => isAffectedBySelection( column, cellWidth, limitColumns ) );
  67265. return cellsToSplit.map( ( { cell } ) => Object(_utils_structure__WEBPACK_IMPORTED_MODULE_5__["splitHorizontally"])( cell, splitRow, writer ) );
  67266. }
  67267. function doVerticalSplit( table, splitColumn, limitRows, writer ) {
  67268. // If selection starts at first column then no split is needed.
  67269. if ( splitColumn < 1 ) {
  67270. return;
  67271. }
  67272. const overlappingCells = Object(_utils_structure__WEBPACK_IMPORTED_MODULE_5__["getHorizontallyOverlappingCells"])( table, splitColumn );
  67273. // Filter out cells that are not touching insides of the rectangular selection.
  67274. const cellsToSplit = overlappingCells.filter( ( { row, cellHeight } ) => isAffectedBySelection( row, cellHeight, limitRows ) );
  67275. return cellsToSplit.map( ( { cell, column } ) => Object(_utils_structure__WEBPACK_IMPORTED_MODULE_5__["splitVertically"])( cell, column, splitColumn, writer ) );
  67276. }
  67277. // Checks if cell at given row (column) is affected by a rectangular selection defined by first/last column (row).
  67278. //
  67279. // The same check is used for row as for column.
  67280. function isAffectedBySelection( index, span, limit ) {
  67281. const endIndex = index + span - 1;
  67282. const { first, last } = limit;
  67283. const isInsideSelection = index >= first && index <= last;
  67284. const overlapsSelectionFromOutside = index < first && endIndex >= first;
  67285. return isInsideSelection || overlapsSelectionFromOutside;
  67286. }
  67287. /***/ }),
  67288. /***/ "./node_modules/@ckeditor/ckeditor5-table/src/tableediting.js":
  67289. /*!********************************************************************!*\
  67290. !*** ./node_modules/@ckeditor/ckeditor5-table/src/tableediting.js ***!
  67291. \********************************************************************/
  67292. /*! exports provided: default */
  67293. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  67294. "use strict";
  67295. __webpack_require__.r(__webpack_exports__);
  67296. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return TableEditing; });
  67297. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  67298. /* harmony import */ var _converters_upcasttable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./converters/upcasttable */ "./node_modules/@ckeditor/ckeditor5-table/src/converters/upcasttable.js");
  67299. /* harmony import */ var _converters_downcast__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./converters/downcast */ "./node_modules/@ckeditor/ckeditor5-table/src/converters/downcast.js");
  67300. /* harmony import */ var _commands_inserttablecommand__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./commands/inserttablecommand */ "./node_modules/@ckeditor/ckeditor5-table/src/commands/inserttablecommand.js");
  67301. /* harmony import */ var _commands_insertrowcommand__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./commands/insertrowcommand */ "./node_modules/@ckeditor/ckeditor5-table/src/commands/insertrowcommand.js");
  67302. /* harmony import */ var _commands_insertcolumncommand__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./commands/insertcolumncommand */ "./node_modules/@ckeditor/ckeditor5-table/src/commands/insertcolumncommand.js");
  67303. /* harmony import */ var _commands_splitcellcommand__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./commands/splitcellcommand */ "./node_modules/@ckeditor/ckeditor5-table/src/commands/splitcellcommand.js");
  67304. /* harmony import */ var _commands_mergecellcommand__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./commands/mergecellcommand */ "./node_modules/@ckeditor/ckeditor5-table/src/commands/mergecellcommand.js");
  67305. /* harmony import */ var _commands_removerowcommand__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./commands/removerowcommand */ "./node_modules/@ckeditor/ckeditor5-table/src/commands/removerowcommand.js");
  67306. /* harmony import */ var _commands_removecolumncommand__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./commands/removecolumncommand */ "./node_modules/@ckeditor/ckeditor5-table/src/commands/removecolumncommand.js");
  67307. /* harmony import */ var _commands_setheaderrowcommand__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./commands/setheaderrowcommand */ "./node_modules/@ckeditor/ckeditor5-table/src/commands/setheaderrowcommand.js");
  67308. /* harmony import */ var _commands_setheadercolumncommand__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./commands/setheadercolumncommand */ "./node_modules/@ckeditor/ckeditor5-table/src/commands/setheadercolumncommand.js");
  67309. /* harmony import */ var _commands_mergecellscommand__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./commands/mergecellscommand */ "./node_modules/@ckeditor/ckeditor5-table/src/commands/mergecellscommand.js");
  67310. /* harmony import */ var _commands_selectrowcommand__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./commands/selectrowcommand */ "./node_modules/@ckeditor/ckeditor5-table/src/commands/selectrowcommand.js");
  67311. /* harmony import */ var _commands_selectcolumncommand__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./commands/selectcolumncommand */ "./node_modules/@ckeditor/ckeditor5-table/src/commands/selectcolumncommand.js");
  67312. /* harmony import */ var _src_tableutils__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../src/tableutils */ "./node_modules/@ckeditor/ckeditor5-table/src/tableutils.js");
  67313. /* 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");
  67314. /* 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");
  67315. /* 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");
  67316. /* 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");
  67317. /* harmony import */ var _theme_tableediting_css__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ../theme/tableediting.css */ "./node_modules/@ckeditor/ckeditor5-table/theme/tableediting.css");
  67318. /* harmony import */ var _theme_tableediting_css__WEBPACK_IMPORTED_MODULE_20___default = /*#__PURE__*/__webpack_require__.n(_theme_tableediting_css__WEBPACK_IMPORTED_MODULE_20__);
  67319. /**
  67320. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  67321. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  67322. */
  67323. /**
  67324. * @module table/tableediting
  67325. */
  67326. /**
  67327. * The table editing feature.
  67328. *
  67329. * @extends module:core/plugin~Plugin
  67330. */
  67331. class TableEditing extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  67332. /**
  67333. * @inheritDoc
  67334. */
  67335. static get pluginName() {
  67336. return 'TableEditing';
  67337. }
  67338. /**
  67339. * @inheritDoc
  67340. */
  67341. init() {
  67342. const editor = this.editor;
  67343. const model = editor.model;
  67344. const schema = model.schema;
  67345. const conversion = editor.conversion;
  67346. schema.register( 'table', {
  67347. allowWhere: '$block',
  67348. allowAttributes: [ 'headingRows', 'headingColumns' ],
  67349. isObject: true,
  67350. isBlock: true
  67351. } );
  67352. schema.register( 'tableRow', {
  67353. allowIn: 'table',
  67354. isLimit: true
  67355. } );
  67356. schema.register( 'tableCell', {
  67357. allowIn: 'tableRow',
  67358. allowChildren: '$block',
  67359. allowAttributes: [ 'colspan', 'rowspan' ],
  67360. isLimit: true,
  67361. isSelectable: true
  67362. } );
  67363. // Figure conversion.
  67364. conversion.for( 'upcast' ).add( Object(_converters_upcasttable__WEBPACK_IMPORTED_MODULE_1__["upcastTableFigure"])() );
  67365. // Table conversion.
  67366. conversion.for( 'upcast' ).add( Object(_converters_upcasttable__WEBPACK_IMPORTED_MODULE_1__["default"])() );
  67367. conversion.for( 'editingDowncast' ).add( Object(_converters_downcast__WEBPACK_IMPORTED_MODULE_2__["downcastInsertTable"])( { asWidget: true } ) );
  67368. conversion.for( 'dataDowncast' ).add( Object(_converters_downcast__WEBPACK_IMPORTED_MODULE_2__["downcastInsertTable"])() );
  67369. // Table row conversion.
  67370. conversion.for( 'upcast' ).elementToElement( { model: 'tableRow', view: 'tr' } );
  67371. conversion.for( 'upcast' ).add( Object(_converters_upcasttable__WEBPACK_IMPORTED_MODULE_1__["skipEmptyTableRow"])() );
  67372. conversion.for( 'editingDowncast' ).add( Object(_converters_downcast__WEBPACK_IMPORTED_MODULE_2__["downcastInsertRow"])() );
  67373. conversion.for( 'editingDowncast' ).add( Object(_converters_downcast__WEBPACK_IMPORTED_MODULE_2__["downcastRemoveRow"])() );
  67374. // Table cell conversion.
  67375. conversion.for( 'upcast' ).elementToElement( { model: 'tableCell', view: 'td' } );
  67376. conversion.for( 'upcast' ).elementToElement( { model: 'tableCell', view: 'th' } );
  67377. conversion.for( 'upcast' ).add( Object(_converters_upcasttable__WEBPACK_IMPORTED_MODULE_1__["ensureParagraphInTableCell"])( 'td' ) );
  67378. conversion.for( 'upcast' ).add( Object(_converters_upcasttable__WEBPACK_IMPORTED_MODULE_1__["ensureParagraphInTableCell"])( 'th' ) );
  67379. conversion.for( 'editingDowncast' ).add( Object(_converters_downcast__WEBPACK_IMPORTED_MODULE_2__["downcastInsertCell"])() );
  67380. // Duplicates code - needed to properly refresh paragraph inside a table cell.
  67381. conversion.for( 'editingDowncast' ).elementToElement( {
  67382. model: 'paragraph',
  67383. view: _converters_downcast__WEBPACK_IMPORTED_MODULE_2__["convertParagraphInTableCell"],
  67384. converterPriority: 'high'
  67385. } );
  67386. // Table attributes conversion.
  67387. conversion.attributeToAttribute( { model: 'colspan', view: 'colspan' } );
  67388. conversion.attributeToAttribute( { model: 'rowspan', view: 'rowspan' } );
  67389. // Table heading columns conversion (a change of heading rows requires a reconversion of the whole table).
  67390. conversion.for( 'editingDowncast' ).add( Object(_converters_downcast__WEBPACK_IMPORTED_MODULE_2__["downcastTableHeadingColumnsChange"])() );
  67391. // Define all the commands.
  67392. editor.commands.add( 'insertTable', new _commands_inserttablecommand__WEBPACK_IMPORTED_MODULE_3__["default"]( editor ) );
  67393. editor.commands.add( 'insertTableRowAbove', new _commands_insertrowcommand__WEBPACK_IMPORTED_MODULE_4__["default"]( editor, { order: 'above' } ) );
  67394. editor.commands.add( 'insertTableRowBelow', new _commands_insertrowcommand__WEBPACK_IMPORTED_MODULE_4__["default"]( editor, { order: 'below' } ) );
  67395. editor.commands.add( 'insertTableColumnLeft', new _commands_insertcolumncommand__WEBPACK_IMPORTED_MODULE_5__["default"]( editor, { order: 'left' } ) );
  67396. editor.commands.add( 'insertTableColumnRight', new _commands_insertcolumncommand__WEBPACK_IMPORTED_MODULE_5__["default"]( editor, { order: 'right' } ) );
  67397. editor.commands.add( 'removeTableRow', new _commands_removerowcommand__WEBPACK_IMPORTED_MODULE_8__["default"]( editor ) );
  67398. editor.commands.add( 'removeTableColumn', new _commands_removecolumncommand__WEBPACK_IMPORTED_MODULE_9__["default"]( editor ) );
  67399. editor.commands.add( 'splitTableCellVertically', new _commands_splitcellcommand__WEBPACK_IMPORTED_MODULE_6__["default"]( editor, { direction: 'vertically' } ) );
  67400. editor.commands.add( 'splitTableCellHorizontally', new _commands_splitcellcommand__WEBPACK_IMPORTED_MODULE_6__["default"]( editor, { direction: 'horizontally' } ) );
  67401. editor.commands.add( 'mergeTableCells', new _commands_mergecellscommand__WEBPACK_IMPORTED_MODULE_12__["default"]( editor ) );
  67402. editor.commands.add( 'mergeTableCellRight', new _commands_mergecellcommand__WEBPACK_IMPORTED_MODULE_7__["default"]( editor, { direction: 'right' } ) );
  67403. editor.commands.add( 'mergeTableCellLeft', new _commands_mergecellcommand__WEBPACK_IMPORTED_MODULE_7__["default"]( editor, { direction: 'left' } ) );
  67404. editor.commands.add( 'mergeTableCellDown', new _commands_mergecellcommand__WEBPACK_IMPORTED_MODULE_7__["default"]( editor, { direction: 'down' } ) );
  67405. editor.commands.add( 'mergeTableCellUp', new _commands_mergecellcommand__WEBPACK_IMPORTED_MODULE_7__["default"]( editor, { direction: 'up' } ) );
  67406. editor.commands.add( 'setTableColumnHeader', new _commands_setheadercolumncommand__WEBPACK_IMPORTED_MODULE_11__["default"]( editor ) );
  67407. editor.commands.add( 'setTableRowHeader', new _commands_setheaderrowcommand__WEBPACK_IMPORTED_MODULE_10__["default"]( editor ) );
  67408. editor.commands.add( 'selectTableRow', new _commands_selectrowcommand__WEBPACK_IMPORTED_MODULE_13__["default"]( editor ) );
  67409. editor.commands.add( 'selectTableColumn', new _commands_selectcolumncommand__WEBPACK_IMPORTED_MODULE_14__["default"]( editor ) );
  67410. Object(_converters_table_heading_rows_refresh_post_fixer__WEBPACK_IMPORTED_MODULE_19__["default"])( model );
  67411. Object(_converters_table_layout_post_fixer__WEBPACK_IMPORTED_MODULE_16__["default"])( model );
  67412. Object(_converters_table_cell_refresh_post_fixer__WEBPACK_IMPORTED_MODULE_18__["default"])( model, editor.editing.mapper );
  67413. Object(_converters_table_cell_paragraph_post_fixer__WEBPACK_IMPORTED_MODULE_17__["default"])( model );
  67414. }
  67415. /**
  67416. * @inheritDoc
  67417. */
  67418. static get requires() {
  67419. return [ _src_tableutils__WEBPACK_IMPORTED_MODULE_15__["default"] ];
  67420. }
  67421. }
  67422. /***/ }),
  67423. /***/ "./node_modules/@ckeditor/ckeditor5-table/src/tablekeyboard.js":
  67424. /*!*********************************************************************!*\
  67425. !*** ./node_modules/@ckeditor/ckeditor5-table/src/tablekeyboard.js ***!
  67426. \*********************************************************************/
  67427. /*! exports provided: default */
  67428. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  67429. "use strict";
  67430. __webpack_require__.r(__webpack_exports__);
  67431. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return TableKeyboard; });
  67432. /* harmony import */ var _tableselection__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./tableselection */ "./node_modules/@ckeditor/ckeditor5-table/src/tableselection.js");
  67433. /* harmony import */ var _tablewalker__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./tablewalker */ "./node_modules/@ckeditor/ckeditor5-table/src/tablewalker.js");
  67434. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  67435. /* harmony import */ var ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ckeditor5/src/utils */ "./node_modules/ckeditor5/src/utils.js");
  67436. /* harmony import */ var _utils_selection__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./utils/selection */ "./node_modules/@ckeditor/ckeditor5-table/src/utils/selection.js");
  67437. /**
  67438. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  67439. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  67440. */
  67441. /**
  67442. * @module table/tablekeyboard
  67443. */
  67444. /**
  67445. * This plugin enables keyboard navigation for tables.
  67446. * It is loaded automatically by the {@link module:table/table~Table} plugin.
  67447. *
  67448. * @extends module:core/plugin~Plugin
  67449. */
  67450. class TableKeyboard extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_2__["Plugin"] {
  67451. /**
  67452. * @inheritDoc
  67453. */
  67454. static get pluginName() {
  67455. return 'TableKeyboard';
  67456. }
  67457. /**
  67458. * @inheritDoc
  67459. */
  67460. static get requires() {
  67461. return [ _tableselection__WEBPACK_IMPORTED_MODULE_0__["default"] ];
  67462. }
  67463. /**
  67464. * @inheritDoc
  67465. */
  67466. init() {
  67467. const view = this.editor.editing.view;
  67468. const viewDocument = view.document;
  67469. // Handle Tab key navigation.
  67470. this.editor.keystrokes.set( 'Tab', ( ...args ) => this._handleTabOnSelectedTable( ...args ), { priority: 'low' } );
  67471. this.editor.keystrokes.set( 'Tab', this._getTabHandler( true ), { priority: 'low' } );
  67472. this.editor.keystrokes.set( 'Shift+Tab', this._getTabHandler( false ), { priority: 'low' } );
  67473. this.listenTo( viewDocument, 'arrowKey', ( ...args ) => this._onArrowKey( ...args ), { context: 'table' } );
  67474. }
  67475. /**
  67476. * Handles {@link module:engine/view/document~Document#event:keydown keydown} events for the <kbd>Tab</kbd> key executed
  67477. * when the table widget is selected.
  67478. *
  67479. * @private
  67480. * @param {module:engine/view/observer/keyobserver~KeyEventData} data Key event data.
  67481. * @param {Function} cancel The stop/stopPropagation/preventDefault function.
  67482. */
  67483. _handleTabOnSelectedTable( data, cancel ) {
  67484. const editor = this.editor;
  67485. const selection = editor.model.document.selection;
  67486. const selectedElement = selection.getSelectedElement();
  67487. if ( !selectedElement || !selectedElement.is( 'element', 'table' ) ) {
  67488. return;
  67489. }
  67490. cancel();
  67491. editor.model.change( writer => {
  67492. writer.setSelection( writer.createRangeIn( selectedElement.getChild( 0 ).getChild( 0 ) ) );
  67493. } );
  67494. }
  67495. /**
  67496. * Returns a handler for {@link module:engine/view/document~Document#event:keydown keydown} events for the <kbd>Tab</kbd> key executed
  67497. * inside table cells.
  67498. *
  67499. * @private
  67500. * @param {Boolean} isForward Whether this handler will move the selection to the next or the previous cell.
  67501. */
  67502. _getTabHandler( isForward ) {
  67503. const editor = this.editor;
  67504. return ( domEventData, cancel ) => {
  67505. const selection = editor.model.document.selection;
  67506. let tableCell = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_4__["getTableCellsContainingSelection"])( selection )[ 0 ];
  67507. if ( !tableCell ) {
  67508. tableCell = this.editor.plugins.get( 'TableSelection' ).getFocusCell();
  67509. }
  67510. if ( !tableCell ) {
  67511. return;
  67512. }
  67513. cancel();
  67514. const tableRow = tableCell.parent;
  67515. const table = tableRow.parent;
  67516. const currentRowIndex = table.getChildIndex( tableRow );
  67517. const currentCellIndex = tableRow.getChildIndex( tableCell );
  67518. const isFirstCellInRow = currentCellIndex === 0;
  67519. if ( !isForward && isFirstCellInRow && currentRowIndex === 0 ) {
  67520. // Set the selection over the whole table if the selection was in the first table cell.
  67521. editor.model.change( writer => {
  67522. writer.setSelection( writer.createRangeOn( table ) );
  67523. } );
  67524. return;
  67525. }
  67526. const tableUtils = this.editor.plugins.get( 'TableUtils' );
  67527. const isLastCellInRow = currentCellIndex === tableRow.childCount - 1;
  67528. const isLastRow = currentRowIndex === tableUtils.getRows( table ) - 1;
  67529. if ( isForward && isLastRow && isLastCellInRow ) {
  67530. editor.execute( 'insertTableRowBelow' );
  67531. // Check if the command actually added a row. If `insertTableRowBelow` execution didn't add a row (because it was disabled
  67532. // or it got overwritten) set the selection over the whole table to mirror the first cell case.
  67533. if ( currentRowIndex === tableUtils.getRows( table ) - 1 ) {
  67534. editor.model.change( writer => {
  67535. writer.setSelection( writer.createRangeOn( table ) );
  67536. } );
  67537. return;
  67538. }
  67539. }
  67540. let cellToFocus;
  67541. // Move to the first cell in the next row.
  67542. if ( isForward && isLastCellInRow ) {
  67543. const nextRow = table.getChild( currentRowIndex + 1 );
  67544. cellToFocus = nextRow.getChild( 0 );
  67545. }
  67546. // Move to the last cell in the previous row.
  67547. else if ( !isForward && isFirstCellInRow ) {
  67548. const previousRow = table.getChild( currentRowIndex - 1 );
  67549. cellToFocus = previousRow.getChild( previousRow.childCount - 1 );
  67550. }
  67551. // Move to the next/previous cell.
  67552. else {
  67553. cellToFocus = tableRow.getChild( currentCellIndex + ( isForward ? 1 : -1 ) );
  67554. }
  67555. editor.model.change( writer => {
  67556. writer.setSelection( writer.createRangeIn( cellToFocus ) );
  67557. } );
  67558. };
  67559. }
  67560. /**
  67561. * Handles {@link module:engine/view/document~Document#event:keydown keydown} events.
  67562. *
  67563. * @private
  67564. * @param {module:utils/eventinfo~EventInfo} eventInfo
  67565. * @param {module:engine/view/observer/domeventdata~DomEventData} domEventData
  67566. */
  67567. _onArrowKey( eventInfo, domEventData ) {
  67568. const editor = this.editor;
  67569. const keyCode = domEventData.keyCode;
  67570. const direction = Object(ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_3__["getLocalizedArrowKeyCodeDirection"])( keyCode, editor.locale.contentLanguageDirection );
  67571. const wasHandled = this._handleArrowKeys( direction, domEventData.shiftKey );
  67572. if ( wasHandled ) {
  67573. domEventData.preventDefault();
  67574. domEventData.stopPropagation();
  67575. eventInfo.stop();
  67576. }
  67577. }
  67578. /**
  67579. * Handles arrow keys to move the selection around the table.
  67580. *
  67581. * @private
  67582. * @param {'left'|'up'|'right'|'down'} direction The direction of the arrow key.
  67583. * @param {Boolean} expandSelection If the current selection should be expanded.
  67584. * @returns {Boolean} Returns `true` if key was handled.
  67585. */
  67586. _handleArrowKeys( direction, expandSelection ) {
  67587. const model = this.editor.model;
  67588. const selection = model.document.selection;
  67589. const isForward = [ 'right', 'down' ].includes( direction );
  67590. // In case one or more table cells are selected (from outside),
  67591. // move the selection to a cell adjacent to the selected table fragment.
  67592. const selectedCells = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_4__["getSelectedTableCells"])( selection );
  67593. if ( selectedCells.length ) {
  67594. let focusCell;
  67595. if ( expandSelection ) {
  67596. focusCell = this.editor.plugins.get( 'TableSelection' ).getFocusCell();
  67597. } else {
  67598. focusCell = isForward ? selectedCells[ selectedCells.length - 1 ] : selectedCells[ 0 ];
  67599. }
  67600. this._navigateFromCellInDirection( focusCell, direction, expandSelection );
  67601. return true;
  67602. }
  67603. // Abort if we're not in a table cell.
  67604. const tableCell = selection.focus.findAncestor( 'tableCell' );
  67605. /* istanbul ignore if: paranoid check */
  67606. if ( !tableCell ) {
  67607. return false;
  67608. }
  67609. // Navigation is in the opposite direction than the selection direction so this is shrinking of the selection.
  67610. // Selection for sure will not approach cell edge.
  67611. if ( expandSelection && !selection.isCollapsed && selection.isBackward == isForward ) {
  67612. return false;
  67613. }
  67614. // Let's check if the selection is at the beginning/end of the cell.
  67615. if ( this._isSelectionAtCellEdge( selection, tableCell, isForward ) ) {
  67616. this._navigateFromCellInDirection( tableCell, direction, expandSelection );
  67617. return true;
  67618. }
  67619. return false;
  67620. }
  67621. /**
  67622. * Returns `true` if the selection is at the boundary of a table cell according to the navigation direction.
  67623. *
  67624. * @private
  67625. * @param {module:engine/model/selection~Selection} selection The current selection.
  67626. * @param {module:engine/model/element~Element} tableCell The current table cell element.
  67627. * @param {Boolean} isForward The expected navigation direction.
  67628. * @returns {Boolean}
  67629. */
  67630. _isSelectionAtCellEdge( selection, tableCell, isForward ) {
  67631. const model = this.editor.model;
  67632. const schema = this.editor.model.schema;
  67633. const focus = isForward ? selection.getLastPosition() : selection.getFirstPosition();
  67634. // If the current limit element is not table cell we are for sure not at the cell edge.
  67635. // Also `modifySelection` will not let us out of it.
  67636. if ( !schema.getLimitElement( focus ).is( 'element', 'tableCell' ) ) {
  67637. const boundaryPosition = model.createPositionAt( tableCell, isForward ? 'end' : 0 );
  67638. return boundaryPosition.isTouching( focus );
  67639. }
  67640. const probe = model.createSelection( focus );
  67641. model.modifySelection( probe, { direction: isForward ? 'forward' : 'backward' } );
  67642. // If there was no change in the focus position, then it's not possible to move the selection there.
  67643. return focus.isEqual( probe.focus );
  67644. }
  67645. /**
  67646. * Moves the selection from the given table cell in the specified direction.
  67647. *
  67648. * @protected
  67649. * @param {module:engine/model/element~Element} focusCell The table cell that is current multi-cell selection focus.
  67650. * @param {'left'|'up'|'right'|'down'} direction Direction in which selection should move.
  67651. * @param {Boolean} [expandSelection=false] If the current selection should be expanded.
  67652. */
  67653. _navigateFromCellInDirection( focusCell, direction, expandSelection = false ) {
  67654. const model = this.editor.model;
  67655. const table = focusCell.findAncestor( 'table' );
  67656. const tableMap = [ ...new _tablewalker__WEBPACK_IMPORTED_MODULE_1__["default"]( table, { includeAllSlots: true } ) ];
  67657. const { row: lastRow, column: lastColumn } = tableMap[ tableMap.length - 1 ];
  67658. const currentCellInfo = tableMap.find( ( { cell } ) => cell == focusCell );
  67659. let { row, column } = currentCellInfo;
  67660. switch ( direction ) {
  67661. case 'left':
  67662. column--;
  67663. break;
  67664. case 'up':
  67665. row--;
  67666. break;
  67667. case 'right':
  67668. column += currentCellInfo.cellWidth;
  67669. break;
  67670. case 'down':
  67671. row += currentCellInfo.cellHeight;
  67672. break;
  67673. }
  67674. const isOutsideVertically = row < 0 || row > lastRow;
  67675. const isBeforeFirstCell = column < 0 && row <= 0;
  67676. const isAfterLastCell = column > lastColumn && row >= lastRow;
  67677. // Note that if the table cell at the end of a row is row-spanned then isAfterLastCell will never be true.
  67678. // However, we don't know if user was navigating on the last row or not, so let's stay in the table.
  67679. if ( isOutsideVertically || isBeforeFirstCell || isAfterLastCell ) {
  67680. model.change( writer => {
  67681. writer.setSelection( writer.createRangeOn( table ) );
  67682. } );
  67683. return;
  67684. }
  67685. if ( column < 0 ) {
  67686. column = expandSelection ? 0 : lastColumn;
  67687. row--;
  67688. } else if ( column > lastColumn ) {
  67689. column = expandSelection ? lastColumn : 0;
  67690. row++;
  67691. }
  67692. const cellToSelect = tableMap.find( cellInfo => cellInfo.row == row && cellInfo.column == column ).cell;
  67693. const isForward = [ 'right', 'down' ].includes( direction );
  67694. const tableSelection = this.editor.plugins.get( 'TableSelection' );
  67695. if ( expandSelection && tableSelection.isEnabled ) {
  67696. const anchorCell = tableSelection.getAnchorCell() || focusCell;
  67697. tableSelection.setCellSelection( anchorCell, cellToSelect );
  67698. } else {
  67699. const positionToSelect = model.createPositionAt( cellToSelect, isForward ? 0 : 'end' );
  67700. model.change( writer => {
  67701. writer.setSelection( positionToSelect );
  67702. } );
  67703. }
  67704. }
  67705. }
  67706. /***/ }),
  67707. /***/ "./node_modules/@ckeditor/ckeditor5-table/src/tablemouse.js":
  67708. /*!******************************************************************!*\
  67709. !*** ./node_modules/@ckeditor/ckeditor5-table/src/tablemouse.js ***!
  67710. \******************************************************************/
  67711. /*! exports provided: default */
  67712. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  67713. "use strict";
  67714. __webpack_require__.r(__webpack_exports__);
  67715. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return TableMouse; });
  67716. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  67717. /* harmony import */ var _tableselection__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./tableselection */ "./node_modules/@ckeditor/ckeditor5-table/src/tableselection.js");
  67718. /* harmony import */ var _tablemouse_mouseeventsobserver__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./tablemouse/mouseeventsobserver */ "./node_modules/@ckeditor/ckeditor5-table/src/tablemouse/mouseeventsobserver.js");
  67719. /* harmony import */ var _utils_selection__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils/selection */ "./node_modules/@ckeditor/ckeditor5-table/src/utils/selection.js");
  67720. /**
  67721. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  67722. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  67723. */
  67724. /**
  67725. * @module table/tablemouse
  67726. */
  67727. /**
  67728. * This plugin enables a table cells' selection with the mouse.
  67729. * It is loaded automatically by the {@link module:table/table~Table} plugin.
  67730. *
  67731. * @extends module:core/plugin~Plugin
  67732. */
  67733. class TableMouse extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  67734. /**
  67735. * @inheritDoc
  67736. */
  67737. static get pluginName() {
  67738. return 'TableMouse';
  67739. }
  67740. /**
  67741. * @inheritDoc
  67742. */
  67743. static get requires() {
  67744. return [ _tableselection__WEBPACK_IMPORTED_MODULE_1__["default"] ];
  67745. }
  67746. /**
  67747. * @inheritDoc
  67748. */
  67749. init() {
  67750. const editor = this.editor;
  67751. // Currently the MouseObserver only handles `mousedown` and `mouseup` events.
  67752. // TODO move to the engine?
  67753. editor.editing.view.addObserver( _tablemouse_mouseeventsobserver__WEBPACK_IMPORTED_MODULE_2__["default"] );
  67754. this._enableShiftClickSelection();
  67755. this._enableMouseDragSelection();
  67756. }
  67757. /**
  67758. * Enables making cells selection by <kbd>Shift</kbd>+click. Creates a selection from the cell which previously held
  67759. * the selection to the cell which was clicked. It can be the same cell, in which case it selects a single cell.
  67760. *
  67761. * @private
  67762. */
  67763. _enableShiftClickSelection() {
  67764. const editor = this.editor;
  67765. let blockSelectionChange = false;
  67766. const tableSelection = editor.plugins.get( _tableselection__WEBPACK_IMPORTED_MODULE_1__["default"] );
  67767. this.listenTo( editor.editing.view.document, 'mousedown', ( evt, domEventData ) => {
  67768. if ( !this.isEnabled || !tableSelection.isEnabled ) {
  67769. return;
  67770. }
  67771. if ( !domEventData.domEvent.shiftKey ) {
  67772. return;
  67773. }
  67774. const anchorCell = tableSelection.getAnchorCell() || Object(_utils_selection__WEBPACK_IMPORTED_MODULE_3__["getTableCellsContainingSelection"])( editor.model.document.selection )[ 0 ];
  67775. if ( !anchorCell ) {
  67776. return;
  67777. }
  67778. const targetCell = this._getModelTableCellFromDomEvent( domEventData );
  67779. if ( targetCell && haveSameTableParent( anchorCell, targetCell ) ) {
  67780. blockSelectionChange = true;
  67781. tableSelection.setCellSelection( anchorCell, targetCell );
  67782. domEventData.preventDefault();
  67783. }
  67784. } );
  67785. this.listenTo( editor.editing.view.document, 'mouseup', () => {
  67786. blockSelectionChange = false;
  67787. } );
  67788. // We need to ignore a `selectionChange` event that is fired after we render our new table cells selection.
  67789. // When downcasting table cells selection to the view, we put the view selection in the last selected cell
  67790. // in a place that may not be natively a "correct" location. This is – we put it directly in the `<td>` element.
  67791. // All browsers fire the native `selectionchange` event.
  67792. // However, all browsers except Safari return the selection in the exact place where we put it
  67793. // (even though it's visually normalized). Safari returns `<td><p>^foo` that makes our selection observer
  67794. // fire our `selectionChange` event (because the view selection that we set in the first step differs from the DOM selection).
  67795. // Since `selectionChange` is fired, we automatically update the model selection that moves it that paragraph.
  67796. // This breaks our dear cells selection.
  67797. //
  67798. // Theoretically this issue concerns only Safari that is the only browser that do normalize the selection.
  67799. // However, to avoid code branching and to have a good coverage for this event blocker, I enabled it for all browsers.
  67800. //
  67801. // Note: I'm keeping the `blockSelectionChange` state separately for shift+click and mouse drag (exact same logic)
  67802. // so I don't have to try to analyze whether they don't overlap in some weird cases. Probably they don't.
  67803. // But I have other things to do, like writing this comment.
  67804. this.listenTo( editor.editing.view.document, 'selectionChange', evt => {
  67805. if ( blockSelectionChange ) {
  67806. // @if CK_DEBUG // console.log( 'Blocked selectionChange to avoid breaking table cells selection.' );
  67807. evt.stop();
  67808. }
  67809. }, { priority: 'highest' } );
  67810. }
  67811. /**
  67812. * Enables making cells selection by dragging.
  67813. *
  67814. * The selection is made only on mousemove. Mouse tracking is started on mousedown.
  67815. * However, the cells selection is enabled only after the mouse cursor left the anchor cell.
  67816. * Thanks to that normal text selection within one cell works just fine. However, you can still select
  67817. * just one cell by leaving the anchor cell and moving back to it.
  67818. *
  67819. * @private
  67820. */
  67821. _enableMouseDragSelection() {
  67822. const editor = this.editor;
  67823. let anchorCell, targetCell;
  67824. let beganCellSelection = false;
  67825. let blockSelectionChange = false;
  67826. const tableSelection = editor.plugins.get( _tableselection__WEBPACK_IMPORTED_MODULE_1__["default"] );
  67827. this.listenTo( editor.editing.view.document, 'mousedown', ( evt, domEventData ) => {
  67828. if ( !this.isEnabled || !tableSelection.isEnabled ) {
  67829. return;
  67830. }
  67831. // Make sure to not conflict with the shift+click listener and any other possible handler.
  67832. if ( domEventData.domEvent.shiftKey || domEventData.domEvent.ctrlKey || domEventData.domEvent.altKey ) {
  67833. return;
  67834. }
  67835. anchorCell = this._getModelTableCellFromDomEvent( domEventData );
  67836. } );
  67837. this.listenTo( editor.editing.view.document, 'mousemove', ( evt, domEventData ) => {
  67838. if ( !domEventData.domEvent.buttons ) {
  67839. return;
  67840. }
  67841. if ( !anchorCell ) {
  67842. return;
  67843. }
  67844. const newTargetCell = this._getModelTableCellFromDomEvent( domEventData );
  67845. if ( newTargetCell && haveSameTableParent( anchorCell, newTargetCell ) ) {
  67846. targetCell = newTargetCell;
  67847. // Switch to the cell selection mode after the mouse cursor left the anchor cell.
  67848. // Switch off only on mouseup (makes selecting a single cell possible).
  67849. if ( !beganCellSelection && targetCell != anchorCell ) {
  67850. beganCellSelection = true;
  67851. }
  67852. }
  67853. // Yep, not making a cell selection yet. See method docs.
  67854. if ( !beganCellSelection ) {
  67855. return;
  67856. }
  67857. blockSelectionChange = true;
  67858. tableSelection.setCellSelection( anchorCell, targetCell );
  67859. domEventData.preventDefault();
  67860. } );
  67861. this.listenTo( editor.editing.view.document, 'mouseup', () => {
  67862. beganCellSelection = false;
  67863. blockSelectionChange = false;
  67864. anchorCell = null;
  67865. targetCell = null;
  67866. } );
  67867. // See the explanation in `_enableShiftClickSelection()`.
  67868. this.listenTo( editor.editing.view.document, 'selectionChange', evt => {
  67869. if ( blockSelectionChange ) {
  67870. // @if CK_DEBUG // console.log( 'Blocked selectionChange to avoid breaking table cells selection.' );
  67871. evt.stop();
  67872. }
  67873. }, { priority: 'highest' } );
  67874. }
  67875. /**
  67876. * Returns the model table cell element based on the target element of the passed DOM event.
  67877. *
  67878. * @private
  67879. * @param {module:engine/view/observer/domeventdata~DomEventData} domEventData
  67880. * @returns {module:engine/model/element~Element|undefined} Returns the table cell or `undefined`.
  67881. */
  67882. _getModelTableCellFromDomEvent( domEventData ) {
  67883. // Note: Work with positions (not element mapping) because the target element can be an attribute or other non-mapped element.
  67884. const viewTargetElement = domEventData.target;
  67885. const viewPosition = this.editor.editing.view.createPositionAt( viewTargetElement, 0 );
  67886. const modelPosition = this.editor.editing.mapper.toModelPosition( viewPosition );
  67887. const modelElement = modelPosition.parent;
  67888. return modelElement.findAncestor( 'tableCell', { includeSelf: true } );
  67889. }
  67890. }
  67891. function haveSameTableParent( cellA, cellB ) {
  67892. return cellA.parent.parent == cellB.parent.parent;
  67893. }
  67894. /***/ }),
  67895. /***/ "./node_modules/@ckeditor/ckeditor5-table/src/tablemouse/mouseeventsobserver.js":
  67896. /*!**************************************************************************************!*\
  67897. !*** ./node_modules/@ckeditor/ckeditor5-table/src/tablemouse/mouseeventsobserver.js ***!
  67898. \**************************************************************************************/
  67899. /*! exports provided: default */
  67900. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  67901. "use strict";
  67902. __webpack_require__.r(__webpack_exports__);
  67903. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return MouseEventsObserver; });
  67904. /* harmony import */ var ckeditor5_src_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/engine */ "./node_modules/ckeditor5/src/engine.js");
  67905. /**
  67906. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  67907. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  67908. */
  67909. /**
  67910. * @module table/tableselection/mouseeventsobserver
  67911. */
  67912. /**
  67913. * The mouse selection event observer.
  67914. *
  67915. * It registers listeners for the following DOM events:
  67916. *
  67917. * - `'mousemove'`
  67918. * - `'mouseup'`
  67919. * - `'mouseleave'`
  67920. *
  67921. * Note that this observer is disabled by default. To enable this observer, it needs to be added to
  67922. * {@link module:engine/view/view~View} using the {@link module:engine/view/view~View#addObserver} method.
  67923. *
  67924. * The observer is registered by the {@link module:table/tableselection~TableSelection} plugin.
  67925. *
  67926. * @extends module:engine/view/observer/domeventobserver~DomEventObserver
  67927. */
  67928. class MouseEventsObserver extends ckeditor5_src_engine__WEBPACK_IMPORTED_MODULE_0__["DomEventObserver"] {
  67929. /**
  67930. * @inheritDoc
  67931. */
  67932. constructor( view ) {
  67933. super( view );
  67934. this.domEventType = [ 'mousemove', 'mouseleave' ];
  67935. }
  67936. /**
  67937. * @inheritDoc
  67938. */
  67939. onDomEvent( domEvent ) {
  67940. this.fire( domEvent.type, domEvent );
  67941. }
  67942. }
  67943. /**
  67944. * Fired when the mouse is moved over one of the editables.
  67945. *
  67946. * Introduced by {@link module:table/tableselection/mouseeventsobserver~MouseEventsObserver}.
  67947. *
  67948. * Note that this event is not available by default. To make it available,
  67949. * {@link module:table/tableselection/mouseeventsobserver~MouseEventsObserver} needs to be added
  67950. * to {@link module:engine/view/view~View} using the {@link module:engine/view/view~View#addObserver} method.
  67951. *
  67952. * @see module:table/tableselection/mouseeventsobserver~MouseEventsObserver
  67953. * @event module:engine/view/document~Document#event:mousemove
  67954. * @param {module:engine/view/observer/domeventdata~DomEventData} data Event data.
  67955. */
  67956. /**
  67957. * Fired when the mouse is moved out of one of the editables.
  67958. *
  67959. * Introduced by {@link module:table/tableselection/mouseeventsobserver~MouseEventsObserver}.
  67960. *
  67961. * Note that this event is not available by default. To make it available,
  67962. * {@link module:table/tableselection/mouseeventsobserver~MouseEventsObserver} needs to be added
  67963. * to {@link module:engine/view/view~View} using the {@link module:engine/view/view~View#addObserver} method.
  67964. *
  67965. * @see module:table/tableselection/mouseeventsobserver~MouseEventsObserver
  67966. * @event module:engine/view/document~Document#event:mouseleave
  67967. * @param {module:engine/view/observer/domeventdata~DomEventData} data Event data.
  67968. */
  67969. /***/ }),
  67970. /***/ "./node_modules/@ckeditor/ckeditor5-table/src/tableselection.js":
  67971. /*!**********************************************************************!*\
  67972. !*** ./node_modules/@ckeditor/ckeditor5-table/src/tableselection.js ***!
  67973. \**********************************************************************/
  67974. /*! exports provided: default */
  67975. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  67976. "use strict";
  67977. __webpack_require__.r(__webpack_exports__);
  67978. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return TableSelection; });
  67979. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  67980. /* harmony import */ var ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/utils */ "./node_modules/ckeditor5/src/utils.js");
  67981. /* harmony import */ var _tablewalker__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./tablewalker */ "./node_modules/@ckeditor/ckeditor5-table/src/tablewalker.js");
  67982. /* harmony import */ var _tableutils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./tableutils */ "./node_modules/@ckeditor/ckeditor5-table/src/tableutils.js");
  67983. /* harmony import */ var _utils_structure__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./utils/structure */ "./node_modules/@ckeditor/ckeditor5-table/src/utils/structure.js");
  67984. /* harmony import */ var _utils_selection__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./utils/selection */ "./node_modules/@ckeditor/ckeditor5-table/src/utils/selection.js");
  67985. /* harmony import */ var _theme_tableselection_css__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../theme/tableselection.css */ "./node_modules/@ckeditor/ckeditor5-table/theme/tableselection.css");
  67986. /* harmony import */ var _theme_tableselection_css__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_theme_tableselection_css__WEBPACK_IMPORTED_MODULE_6__);
  67987. /**
  67988. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  67989. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  67990. */
  67991. /**
  67992. * @module table/tableselection
  67993. */
  67994. /**
  67995. * This plugin enables the advanced table cells, rows and columns selection.
  67996. * It is loaded automatically by the {@link module:table/table~Table} plugin.
  67997. *
  67998. * @extends module:core/plugin~Plugin
  67999. */
  68000. class TableSelection extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  68001. /**
  68002. * @inheritDoc
  68003. */
  68004. static get pluginName() {
  68005. return 'TableSelection';
  68006. }
  68007. /**
  68008. * @inheritDoc
  68009. */
  68010. static get requires() {
  68011. return [ _tableutils__WEBPACK_IMPORTED_MODULE_3__["default"] ];
  68012. }
  68013. /**
  68014. * @inheritDoc
  68015. */
  68016. init() {
  68017. const editor = this.editor;
  68018. const model = editor.model;
  68019. this.listenTo( model, 'deleteContent', ( evt, args ) => this._handleDeleteContent( evt, args ), { priority: 'high' } );
  68020. this._defineSelectionConverter();
  68021. this._enablePluginDisabling(); // sic!
  68022. }
  68023. /**
  68024. * Returns the currently selected table cells or `null` if it is not a table cells selection.
  68025. *
  68026. * @returns {Array.<module:engine/model/element~Element>|null}
  68027. */
  68028. getSelectedTableCells() {
  68029. const selection = this.editor.model.document.selection;
  68030. const selectedCells = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_5__["getSelectedTableCells"])( selection );
  68031. if ( selectedCells.length == 0 ) {
  68032. return null;
  68033. }
  68034. // This should never happen, but let's know if it ever happens.
  68035. // @if CK_DEBUG // /* istanbul ignore next */
  68036. // @if CK_DEBUG // if ( selectedCells.length != selection.rangeCount ) {
  68037. // @if CK_DEBUG // console.warn( 'Mixed selection warning. The selection contains table cells and some other ranges.' );
  68038. // @if CK_DEBUG // }
  68039. return selectedCells;
  68040. }
  68041. /**
  68042. * Returns the selected table fragment as a document fragment.
  68043. *
  68044. * @returns {module:engine/model/documentfragment~DocumentFragment|null}
  68045. */
  68046. getSelectionAsFragment() {
  68047. const selectedCells = this.getSelectedTableCells();
  68048. if ( !selectedCells ) {
  68049. return null;
  68050. }
  68051. return this.editor.model.change( writer => {
  68052. const documentFragment = writer.createDocumentFragment();
  68053. const tableUtils = this.editor.plugins.get( 'TableUtils' );
  68054. const { first: firstColumn, last: lastColumn } = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_5__["getColumnIndexes"])( selectedCells );
  68055. const { first: firstRow, last: lastRow } = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_5__["getRowIndexes"])( selectedCells );
  68056. const sourceTable = selectedCells[ 0 ].findAncestor( 'table' );
  68057. let adjustedLastRow = lastRow;
  68058. let adjustedLastColumn = lastColumn;
  68059. // If the selection is rectangular there could be a case of all cells in the last row/column spanned over
  68060. // next row/column so the real lastRow/lastColumn should be updated.
  68061. if ( Object(_utils_selection__WEBPACK_IMPORTED_MODULE_5__["isSelectionRectangular"])( selectedCells, tableUtils ) ) {
  68062. const dimensions = {
  68063. firstColumn,
  68064. lastColumn,
  68065. firstRow,
  68066. lastRow
  68067. };
  68068. adjustedLastRow = Object(_utils_structure__WEBPACK_IMPORTED_MODULE_4__["adjustLastRowIndex"])( sourceTable, dimensions );
  68069. adjustedLastColumn = Object(_utils_structure__WEBPACK_IMPORTED_MODULE_4__["adjustLastColumnIndex"])( sourceTable, dimensions );
  68070. }
  68071. const cropDimensions = {
  68072. startRow: firstRow,
  68073. startColumn: firstColumn,
  68074. endRow: adjustedLastRow,
  68075. endColumn: adjustedLastColumn
  68076. };
  68077. const table = Object(_utils_structure__WEBPACK_IMPORTED_MODULE_4__["cropTableToDimensions"])( sourceTable, cropDimensions, writer );
  68078. writer.insert( table, documentFragment, 0 );
  68079. return documentFragment;
  68080. } );
  68081. }
  68082. /**
  68083. * Sets the model selection based on given anchor and target cells (can be the same cell).
  68084. * Takes care of setting the backward flag.
  68085. *
  68086. * const modelRoot = editor.model.document.getRoot();
  68087. * const firstCell = modelRoot.getNodeByPath( [ 0, 0, 0 ] );
  68088. * const lastCell = modelRoot.getNodeByPath( [ 0, 0, 1 ] );
  68089. *
  68090. * const tableSelection = editor.plugins.get( 'TableSelection' );
  68091. * tableSelection.setCellSelection( firstCell, lastCell );
  68092. *
  68093. * @param {module:engine/model/element~Element} anchorCell
  68094. * @param {module:engine/model/element~Element} targetCell
  68095. */
  68096. setCellSelection( anchorCell, targetCell ) {
  68097. const cellsToSelect = this._getCellsToSelect( anchorCell, targetCell );
  68098. this.editor.model.change( writer => {
  68099. writer.setSelection(
  68100. cellsToSelect.cells.map( cell => writer.createRangeOn( cell ) ),
  68101. { backward: cellsToSelect.backward }
  68102. );
  68103. } );
  68104. }
  68105. /**
  68106. * Returns the focus cell from the current selection.
  68107. *
  68108. * @returns {module:engine/model/element~Element}
  68109. */
  68110. getFocusCell() {
  68111. const selection = this.editor.model.document.selection;
  68112. const focusCellRange = [ ...selection.getRanges() ].pop();
  68113. const element = focusCellRange.getContainedElement();
  68114. if ( element && element.is( 'element', 'tableCell' ) ) {
  68115. return element;
  68116. }
  68117. return null;
  68118. }
  68119. /**
  68120. * Returns the anchor cell from the current selection.
  68121. *
  68122. * @returns {module:engine/model/element~Element} anchorCell
  68123. */
  68124. getAnchorCell() {
  68125. const selection = this.editor.model.document.selection;
  68126. const anchorCellRange = Object(ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_1__["first"])( selection.getRanges() );
  68127. const element = anchorCellRange.getContainedElement();
  68128. if ( element && element.is( 'element', 'tableCell' ) ) {
  68129. return element;
  68130. }
  68131. return null;
  68132. }
  68133. /**
  68134. * Defines a selection converter which marks the selected cells with a specific class.
  68135. *
  68136. * The real DOM selection is put in the last cell. Since the order of ranges is dependent on whether the
  68137. * selection is backward or not, the last cell will usually be close to the "focus" end of the selection
  68138. * (a selection has anchor and focus).
  68139. *
  68140. * The real DOM selection is then hidden with CSS.
  68141. *
  68142. * @private
  68143. */
  68144. _defineSelectionConverter() {
  68145. const editor = this.editor;
  68146. const highlighted = new Set();
  68147. editor.conversion.for( 'editingDowncast' ).add( dispatcher => dispatcher.on( 'selection', ( evt, data, conversionApi ) => {
  68148. const viewWriter = conversionApi.writer;
  68149. clearHighlightedTableCells( viewWriter );
  68150. const selectedCells = this.getSelectedTableCells();
  68151. if ( !selectedCells ) {
  68152. return;
  68153. }
  68154. for ( const tableCell of selectedCells ) {
  68155. const viewElement = conversionApi.mapper.toViewElement( tableCell );
  68156. viewWriter.addClass( 'ck-editor__editable_selected', viewElement );
  68157. highlighted.add( viewElement );
  68158. }
  68159. const lastViewCell = conversionApi.mapper.toViewElement( selectedCells[ selectedCells.length - 1 ] );
  68160. viewWriter.setSelection( lastViewCell, 0 );
  68161. }, { priority: 'lowest' } ) );
  68162. function clearHighlightedTableCells( writer ) {
  68163. for ( const previouslyHighlighted of highlighted ) {
  68164. writer.removeClass( 'ck-editor__editable_selected', previouslyHighlighted );
  68165. }
  68166. highlighted.clear();
  68167. }
  68168. }
  68169. /**
  68170. * Creates a listener that reacts to changes in {@link #isEnabled} and, if the plugin was disabled,
  68171. * it collapses the multi-cell selection to a regular selection placed inside a table cell.
  68172. *
  68173. * This listener helps features that disable the table selection plugin bring the selection
  68174. * to a clear state they can work with (for instance, because they don't support multiple cell selection).
  68175. */
  68176. _enablePluginDisabling() {
  68177. const editor = this.editor;
  68178. this.on( 'change:isEnabled', () => {
  68179. if ( !this.isEnabled ) {
  68180. const selectedCells = this.getSelectedTableCells();
  68181. if ( !selectedCells ) {
  68182. return;
  68183. }
  68184. editor.model.change( writer => {
  68185. const position = writer.createPositionAt( selectedCells[ 0 ], 0 );
  68186. const range = editor.model.schema.getNearestSelectionRange( position );
  68187. writer.setSelection( range );
  68188. } );
  68189. }
  68190. } );
  68191. }
  68192. /**
  68193. * Overrides the default `model.deleteContent()` behavior over a selected table fragment.
  68194. *
  68195. * @private
  68196. * @param {module:utils/eventinfo~EventInfo} event
  68197. * @param {Array.<*>} args Delete content method arguments.
  68198. */
  68199. _handleDeleteContent( event, args ) {
  68200. const [ selection, options ] = args;
  68201. const model = this.editor.model;
  68202. const isBackward = !options || options.direction == 'backward';
  68203. const selectedTableCells = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_5__["getSelectedTableCells"])( selection );
  68204. if ( !selectedTableCells.length ) {
  68205. return;
  68206. }
  68207. event.stop();
  68208. model.change( writer => {
  68209. const tableCellToSelect = selectedTableCells[ isBackward ? selectedTableCells.length - 1 : 0 ];
  68210. model.change( writer => {
  68211. for ( const tableCell of selectedTableCells ) {
  68212. model.deleteContent( writer.createSelection( tableCell, 'in' ) );
  68213. }
  68214. } );
  68215. const rangeToSelect = model.schema.getNearestSelectionRange( writer.createPositionAt( tableCellToSelect, 0 ) );
  68216. // Note: we ignore the case where rangeToSelect may be null because deleteContent() will always (unless someone broke it)
  68217. // create an empty paragraph to accommodate the selection.
  68218. if ( selection.is( 'documentSelection' ) ) {
  68219. writer.setSelection( rangeToSelect );
  68220. } else {
  68221. selection.setTo( rangeToSelect );
  68222. }
  68223. } );
  68224. }
  68225. /**
  68226. * Returns an array of table cells that should be selected based on the
  68227. * given anchor cell and target (focus) cell.
  68228. *
  68229. * The cells are returned in a reverse direction if the selection is backward.
  68230. *
  68231. * @private
  68232. * @param {module:engine/model/element~Element} anchorCell
  68233. * @param {module:engine/model/element~Element} targetCell
  68234. * @returns {Array.<module:engine/model/element~Element>}
  68235. */
  68236. _getCellsToSelect( anchorCell, targetCell ) {
  68237. const tableUtils = this.editor.plugins.get( 'TableUtils' );
  68238. const startLocation = tableUtils.getCellLocation( anchorCell );
  68239. const endLocation = tableUtils.getCellLocation( targetCell );
  68240. const startRow = Math.min( startLocation.row, endLocation.row );
  68241. const endRow = Math.max( startLocation.row, endLocation.row );
  68242. const startColumn = Math.min( startLocation.column, endLocation.column );
  68243. const endColumn = Math.max( startLocation.column, endLocation.column );
  68244. // 2-dimensional array of the selected cells to ease flipping the order of cells for backward selections.
  68245. const selectionMap = new Array( endRow - startRow + 1 ).fill( null ).map( () => [] );
  68246. const walkerOptions = {
  68247. startRow,
  68248. endRow,
  68249. startColumn,
  68250. endColumn
  68251. };
  68252. for ( const { row, cell } of new _tablewalker__WEBPACK_IMPORTED_MODULE_2__["default"]( anchorCell.findAncestor( 'table' ), walkerOptions ) ) {
  68253. selectionMap[ row - startRow ].push( cell );
  68254. }
  68255. const flipVertically = endLocation.row < startLocation.row;
  68256. const flipHorizontally = endLocation.column < startLocation.column;
  68257. if ( flipVertically ) {
  68258. selectionMap.reverse();
  68259. }
  68260. if ( flipHorizontally ) {
  68261. selectionMap.forEach( row => row.reverse() );
  68262. }
  68263. return {
  68264. cells: selectionMap.flat(),
  68265. backward: flipVertically || flipHorizontally
  68266. };
  68267. }
  68268. }
  68269. /***/ }),
  68270. /***/ "./node_modules/@ckeditor/ckeditor5-table/src/tabletoolbar.js":
  68271. /*!********************************************************************!*\
  68272. !*** ./node_modules/@ckeditor/ckeditor5-table/src/tabletoolbar.js ***!
  68273. \********************************************************************/
  68274. /*! exports provided: default */
  68275. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  68276. "use strict";
  68277. __webpack_require__.r(__webpack_exports__);
  68278. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return TableToolbar; });
  68279. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  68280. /* harmony import */ var ckeditor5_src_widget__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/widget */ "./node_modules/ckeditor5/src/widget.js");
  68281. /* 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");
  68282. /**
  68283. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  68284. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  68285. */
  68286. /**
  68287. * @module table/tabletoolbar
  68288. */
  68289. /**
  68290. * The table toolbar class. It creates toolbars for the table feature and its content (for now only for the table cell content).
  68291. *
  68292. * The table toolbar shows up when a table widget is selected. Its components (e.g. buttons) are created based on the
  68293. * {@link module:table/table~TableConfig#tableToolbar `table.tableToolbar` configuration option}.
  68294. *
  68295. * Table content toolbar shows up when the selection is inside the content of a table. It creates its component based on the
  68296. * {@link module:table/table~TableConfig#contentToolbar `table.contentToolbar` configuration option}.
  68297. *
  68298. * @extends module:core/plugin~Plugin
  68299. */
  68300. class TableToolbar extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  68301. /**
  68302. * @inheritDoc
  68303. */
  68304. static get requires() {
  68305. return [ ckeditor5_src_widget__WEBPACK_IMPORTED_MODULE_1__["WidgetToolbarRepository"] ];
  68306. }
  68307. /**
  68308. * @inheritDoc
  68309. */
  68310. static get pluginName() {
  68311. return 'TableToolbar';
  68312. }
  68313. /**
  68314. * @inheritDoc
  68315. */
  68316. afterInit() {
  68317. const editor = this.editor;
  68318. const t = editor.t;
  68319. const widgetToolbarRepository = editor.plugins.get( ckeditor5_src_widget__WEBPACK_IMPORTED_MODULE_1__["WidgetToolbarRepository"] );
  68320. const tableContentToolbarItems = editor.config.get( 'table.contentToolbar' );
  68321. const tableToolbarItems = editor.config.get( 'table.tableToolbar' );
  68322. if ( tableContentToolbarItems ) {
  68323. widgetToolbarRepository.register( 'tableContent', {
  68324. ariaLabel: t( 'Table toolbar' ),
  68325. items: tableContentToolbarItems,
  68326. getRelatedElement: _utils_ui_widget__WEBPACK_IMPORTED_MODULE_2__["getTableWidgetAncestor"]
  68327. } );
  68328. }
  68329. if ( tableToolbarItems ) {
  68330. widgetToolbarRepository.register( 'table', {
  68331. ariaLabel: t( 'Table toolbar' ),
  68332. items: tableToolbarItems,
  68333. getRelatedElement: _utils_ui_widget__WEBPACK_IMPORTED_MODULE_2__["getSelectedTableWidget"]
  68334. } );
  68335. }
  68336. }
  68337. }
  68338. /**
  68339. * Items to be placed in the table content toolbar.
  68340. * The {@link module:table/tabletoolbar~TableToolbar} plugin is required to make this toolbar work.
  68341. *
  68342. * Assuming that you use the {@link module:table/tableui~TableUI} feature, the following toolbar items will be available
  68343. * in {@link module:ui/componentfactory~ComponentFactory}:
  68344. *
  68345. * * `'tableRow'`,
  68346. * * `'tableColumn'`,
  68347. * * `'mergeTableCells'`.
  68348. *
  68349. * You can thus configure the toolbar like this:
  68350. *
  68351. * const tableConfig = {
  68352. * contentToolbar: [ 'tableRow', 'tableColumn', 'mergeTableCells' ]
  68353. * };
  68354. *
  68355. * Of course, the same buttons can also be used in the
  68356. * {@link module:core/editor/editorconfig~EditorConfig#toolbar main editor toolbar}.
  68357. *
  68358. * Read more about configuring the toolbar in {@link module:core/editor/editorconfig~EditorConfig#toolbar}.
  68359. *
  68360. * @member {Array.<String>} module:table/table~TableConfig#contentToolbar
  68361. */
  68362. /**
  68363. * Items to be placed in the table toolbar.
  68364. * The {@link module:table/tabletoolbar~TableToolbar} plugin is required to make this toolbar work.
  68365. *
  68366. * You can thus configure the toolbar like this:
  68367. *
  68368. * const tableConfig = {
  68369. * tableToolbar: [ 'blockQuote' ]
  68370. * };
  68371. *
  68372. * Of course, the same buttons can also be used in the
  68373. * {@link module:core/editor/editorconfig~EditorConfig#toolbar main editor toolbar}.
  68374. *
  68375. * Read more about configuring the toolbar in {@link module:core/editor/editorconfig~EditorConfig#toolbar}.
  68376. *
  68377. * @member {Array.<String>} module:table/table~TableConfig#tableToolbar
  68378. */
  68379. /***/ }),
  68380. /***/ "./node_modules/@ckeditor/ckeditor5-table/src/tableui.js":
  68381. /*!***************************************************************!*\
  68382. !*** ./node_modules/@ckeditor/ckeditor5-table/src/tableui.js ***!
  68383. \***************************************************************/
  68384. /*! exports provided: default */
  68385. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  68386. "use strict";
  68387. __webpack_require__.r(__webpack_exports__);
  68388. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return TableUI; });
  68389. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  68390. /* harmony import */ var ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/ui */ "./node_modules/ckeditor5/src/ui.js");
  68391. /* harmony import */ var ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ckeditor5/src/utils */ "./node_modules/ckeditor5/src/utils.js");
  68392. /* harmony import */ var _ui_inserttableview__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./ui/inserttableview */ "./node_modules/@ckeditor/ckeditor5-table/src/ui/inserttableview.js");
  68393. /* harmony import */ var _theme_icons_table_svg__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./../theme/icons/table.svg */ "./node_modules/@ckeditor/ckeditor5-table/theme/icons/table.svg");
  68394. /* harmony import */ var _theme_icons_table_column_svg__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./../theme/icons/table-column.svg */ "./node_modules/@ckeditor/ckeditor5-table/theme/icons/table-column.svg");
  68395. /* harmony import */ var _theme_icons_table_row_svg__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./../theme/icons/table-row.svg */ "./node_modules/@ckeditor/ckeditor5-table/theme/icons/table-row.svg");
  68396. /* harmony import */ var _theme_icons_table_merge_cell_svg__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./../theme/icons/table-merge-cell.svg */ "./node_modules/@ckeditor/ckeditor5-table/theme/icons/table-merge-cell.svg");
  68397. /**
  68398. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  68399. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  68400. */
  68401. /**
  68402. * @module table/tableui
  68403. */
  68404. /**
  68405. * The table UI plugin. It introduces:
  68406. *
  68407. * * The `'insertTable'` dropdown,
  68408. * * The `'tableColumn'` dropdown,
  68409. * * The `'tableRow'` dropdown,
  68410. * * The `'mergeTableCells'` split button.
  68411. *
  68412. * The `'tableColumn'`, `'tableRow'` and `'mergeTableCells'` dropdowns work best with {@link module:table/tabletoolbar~TableToolbar}.
  68413. *
  68414. * @extends module:core/plugin~Plugin
  68415. */
  68416. class TableUI extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  68417. /**
  68418. * @inheritDoc
  68419. */
  68420. static get pluginName() {
  68421. return 'TableUI';
  68422. }
  68423. /**
  68424. * @inheritDoc
  68425. */
  68426. init() {
  68427. const editor = this.editor;
  68428. const t = this.editor.t;
  68429. const contentLanguageDirection = editor.locale.contentLanguageDirection;
  68430. const isContentLtr = contentLanguageDirection === 'ltr';
  68431. editor.ui.componentFactory.add( 'insertTable', locale => {
  68432. const command = editor.commands.get( 'insertTable' );
  68433. const dropdownView = Object(ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__["createDropdown"])( locale );
  68434. dropdownView.bind( 'isEnabled' ).to( command );
  68435. // Decorate dropdown's button.
  68436. dropdownView.buttonView.set( {
  68437. icon: _theme_icons_table_svg__WEBPACK_IMPORTED_MODULE_4__["default"],
  68438. label: t( 'Insert table' ),
  68439. tooltip: true
  68440. } );
  68441. let insertTableView;
  68442. dropdownView.on( 'change:isOpen', () => {
  68443. if ( insertTableView ) {
  68444. return;
  68445. }
  68446. // Prepare custom view for dropdown's panel.
  68447. insertTableView = new _ui_inserttableview__WEBPACK_IMPORTED_MODULE_3__["default"]( locale );
  68448. dropdownView.panelView.children.add( insertTableView );
  68449. insertTableView.delegate( 'execute' ).to( dropdownView );
  68450. dropdownView.buttonView.on( 'open', () => {
  68451. // Reset the chooser before showing it to the user.
  68452. insertTableView.rows = 0;
  68453. insertTableView.columns = 0;
  68454. } );
  68455. dropdownView.on( 'execute', () => {
  68456. editor.execute( 'insertTable', { rows: insertTableView.rows, columns: insertTableView.columns } );
  68457. editor.editing.view.focus();
  68458. } );
  68459. } );
  68460. return dropdownView;
  68461. } );
  68462. editor.ui.componentFactory.add( 'tableColumn', locale => {
  68463. const options = [
  68464. {
  68465. type: 'switchbutton',
  68466. model: {
  68467. commandName: 'setTableColumnHeader',
  68468. label: t( 'Header column' ),
  68469. bindIsOn: true
  68470. }
  68471. },
  68472. { type: 'separator' },
  68473. {
  68474. type: 'button',
  68475. model: {
  68476. commandName: isContentLtr ? 'insertTableColumnLeft' : 'insertTableColumnRight',
  68477. label: t( 'Insert column left' )
  68478. }
  68479. },
  68480. {
  68481. type: 'button',
  68482. model: {
  68483. commandName: isContentLtr ? 'insertTableColumnRight' : 'insertTableColumnLeft',
  68484. label: t( 'Insert column right' )
  68485. }
  68486. },
  68487. {
  68488. type: 'button',
  68489. model: {
  68490. commandName: 'removeTableColumn',
  68491. label: t( 'Delete column' )
  68492. }
  68493. },
  68494. {
  68495. type: 'button',
  68496. model: {
  68497. commandName: 'selectTableColumn',
  68498. label: t( 'Select column' )
  68499. }
  68500. }
  68501. ];
  68502. return this._prepareDropdown( t( 'Column' ), _theme_icons_table_column_svg__WEBPACK_IMPORTED_MODULE_5__["default"], options, locale );
  68503. } );
  68504. editor.ui.componentFactory.add( 'tableRow', locale => {
  68505. const options = [
  68506. {
  68507. type: 'switchbutton',
  68508. model: {
  68509. commandName: 'setTableRowHeader',
  68510. label: t( 'Header row' ),
  68511. bindIsOn: true
  68512. }
  68513. },
  68514. { type: 'separator' },
  68515. {
  68516. type: 'button',
  68517. model: {
  68518. commandName: 'insertTableRowAbove',
  68519. label: t( 'Insert row above' )
  68520. }
  68521. },
  68522. {
  68523. type: 'button',
  68524. model: {
  68525. commandName: 'insertTableRowBelow',
  68526. label: t( 'Insert row below' )
  68527. }
  68528. },
  68529. {
  68530. type: 'button',
  68531. model: {
  68532. commandName: 'removeTableRow',
  68533. label: t( 'Delete row' )
  68534. }
  68535. },
  68536. {
  68537. type: 'button',
  68538. model: {
  68539. commandName: 'selectTableRow',
  68540. label: t( 'Select row' )
  68541. }
  68542. }
  68543. ];
  68544. return this._prepareDropdown( t( 'Row' ), _theme_icons_table_row_svg__WEBPACK_IMPORTED_MODULE_6__["default"], options, locale );
  68545. } );
  68546. editor.ui.componentFactory.add( 'mergeTableCells', locale => {
  68547. const options = [
  68548. {
  68549. type: 'button',
  68550. model: {
  68551. commandName: 'mergeTableCellUp',
  68552. label: t( 'Merge cell up' )
  68553. }
  68554. },
  68555. {
  68556. type: 'button',
  68557. model: {
  68558. commandName: isContentLtr ? 'mergeTableCellRight' : 'mergeTableCellLeft',
  68559. label: t( 'Merge cell right' )
  68560. }
  68561. },
  68562. {
  68563. type: 'button',
  68564. model: {
  68565. commandName: 'mergeTableCellDown',
  68566. label: t( 'Merge cell down' )
  68567. }
  68568. },
  68569. {
  68570. type: 'button',
  68571. model: {
  68572. commandName: isContentLtr ? 'mergeTableCellLeft' : 'mergeTableCellRight',
  68573. label: t( 'Merge cell left' )
  68574. }
  68575. },
  68576. { type: 'separator' },
  68577. {
  68578. type: 'button',
  68579. model: {
  68580. commandName: 'splitTableCellVertically',
  68581. label: t( 'Split cell vertically' )
  68582. }
  68583. },
  68584. {
  68585. type: 'button',
  68586. model: {
  68587. commandName: 'splitTableCellHorizontally',
  68588. label: t( 'Split cell horizontally' )
  68589. }
  68590. }
  68591. ];
  68592. return this._prepareMergeSplitButtonDropdown( t( 'Merge cells' ), _theme_icons_table_merge_cell_svg__WEBPACK_IMPORTED_MODULE_7__["default"], options, locale );
  68593. } );
  68594. }
  68595. /**
  68596. * Creates a dropdown view from a set of options.
  68597. *
  68598. * @private
  68599. * @param {String} label The dropdown button label.
  68600. * @param {String} icon An icon for the dropdown button.
  68601. * @param {Array.<module:ui/dropdown/utils~ListDropdownItemDefinition>} options The list of options for the dropdown.
  68602. * @param {module:utils/locale~Locale} locale
  68603. * @returns {module:ui/dropdown/dropdownview~DropdownView}
  68604. */
  68605. _prepareDropdown( label, icon, options, locale ) {
  68606. const editor = this.editor;
  68607. const dropdownView = Object(ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__["createDropdown"])( locale );
  68608. const commands = this._fillDropdownWithListOptions( dropdownView, options );
  68609. // Decorate dropdown's button.
  68610. dropdownView.buttonView.set( {
  68611. label,
  68612. icon,
  68613. tooltip: true
  68614. } );
  68615. // Make dropdown button disabled when all options are disabled.
  68616. dropdownView.bind( 'isEnabled' ).toMany( commands, 'isEnabled', ( ...areEnabled ) => {
  68617. return areEnabled.some( isEnabled => isEnabled );
  68618. } );
  68619. this.listenTo( dropdownView, 'execute', evt => {
  68620. editor.execute( evt.source.commandName );
  68621. editor.editing.view.focus();
  68622. } );
  68623. return dropdownView;
  68624. }
  68625. /**
  68626. * Creates a dropdown view with a {@link module:ui/dropdown/button/splitbuttonview~SplitButtonView} for
  68627. * merge (and split)–related commands.
  68628. *
  68629. * @private
  68630. * @param {String} label The dropdown button label.
  68631. * @param {String} icon An icon for the dropdown button.
  68632. * @param {Array.<module:ui/dropdown/utils~ListDropdownItemDefinition>} options The list of options for the dropdown.
  68633. * @param {module:utils/locale~Locale} locale
  68634. * @returns {module:ui/dropdown/dropdownview~DropdownView}
  68635. */
  68636. _prepareMergeSplitButtonDropdown( label, icon, options, locale ) {
  68637. const editor = this.editor;
  68638. const dropdownView = Object(ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__["createDropdown"])( locale, ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__["SplitButtonView"] );
  68639. const mergeCommandName = 'mergeTableCells';
  68640. // Main command.
  68641. const mergeCommand = editor.commands.get( mergeCommandName );
  68642. // Subcommands in the dropdown.
  68643. const commands = this._fillDropdownWithListOptions( dropdownView, options );
  68644. dropdownView.buttonView.set( {
  68645. label,
  68646. icon,
  68647. tooltip: true,
  68648. isEnabled: true
  68649. } );
  68650. // Make dropdown button disabled when all options are disabled together with the main command.
  68651. dropdownView.bind( 'isEnabled' ).toMany( [ mergeCommand, ...commands ], 'isEnabled', ( ...areEnabled ) => {
  68652. return areEnabled.some( isEnabled => isEnabled );
  68653. } );
  68654. // Merge selected table cells when the main part of the split button is clicked.
  68655. this.listenTo( dropdownView.buttonView, 'execute', () => {
  68656. editor.execute( mergeCommandName );
  68657. editor.editing.view.focus();
  68658. } );
  68659. // Execute commands for events coming from the list in the dropdown panel.
  68660. this.listenTo( dropdownView, 'execute', evt => {
  68661. editor.execute( evt.source.commandName );
  68662. editor.editing.view.focus();
  68663. } );
  68664. return dropdownView;
  68665. }
  68666. /**
  68667. * Injects a {@link module:ui/list/listview~ListView} into the passed dropdown with buttons
  68668. * which execute editor commands as configured in passed options.
  68669. *
  68670. * @private
  68671. * @param {module:ui/dropdown/dropdownview~DropdownView} dropdownView
  68672. * @param {Array.<module:ui/dropdown/utils~ListDropdownItemDefinition>} options The list of options for the dropdown.
  68673. * @returns {Array.<module:core/command~Command>} Commands the list options are interacting with.
  68674. */
  68675. _fillDropdownWithListOptions( dropdownView, options ) {
  68676. const editor = this.editor;
  68677. const commands = [];
  68678. const itemDefinitions = new ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_2__["Collection"]();
  68679. for ( const option of options ) {
  68680. addListOption( option, editor, commands, itemDefinitions );
  68681. }
  68682. Object(ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__["addListToDropdown"])( dropdownView, itemDefinitions, editor.ui.componentFactory );
  68683. return commands;
  68684. }
  68685. }
  68686. // Adds an option to a list view.
  68687. //
  68688. // @param {module:table/tableui~DropdownOption} option A configuration option.
  68689. // @param {module:core/editor/editor~Editor} editor
  68690. // @param {Array.<module:core/command~Command>} commands The list of commands to update.
  68691. // @param {Iterable.<module:ui/dropdown/utils~ListDropdownItemDefinition>} itemDefinitions
  68692. // A collection of dropdown items to update with the given option.
  68693. function addListOption( option, editor, commands, itemDefinitions ) {
  68694. const model = option.model = new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__["Model"]( option.model );
  68695. const { commandName, bindIsOn } = option.model;
  68696. if ( option.type === 'button' || option.type === 'switchbutton' ) {
  68697. const command = editor.commands.get( commandName );
  68698. commands.push( command );
  68699. model.set( { commandName } );
  68700. model.bind( 'isEnabled' ).to( command );
  68701. if ( bindIsOn ) {
  68702. model.bind( 'isOn' ).to( command, 'value' );
  68703. }
  68704. }
  68705. model.set( {
  68706. withText: true
  68707. } );
  68708. itemDefinitions.add( option );
  68709. }
  68710. /***/ }),
  68711. /***/ "./node_modules/@ckeditor/ckeditor5-table/src/tableutils.js":
  68712. /*!******************************************************************!*\
  68713. !*** ./node_modules/@ckeditor/ckeditor5-table/src/tableutils.js ***!
  68714. \******************************************************************/
  68715. /*! exports provided: default */
  68716. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  68717. "use strict";
  68718. __webpack_require__.r(__webpack_exports__);
  68719. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return TableUtils; });
  68720. /* harmony import */ var ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/utils */ "./node_modules/ckeditor5/src/utils.js");
  68721. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  68722. /* harmony import */ var _tablewalker__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./tablewalker */ "./node_modules/@ckeditor/ckeditor5-table/src/tablewalker.js");
  68723. /* harmony import */ var _utils_common__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils/common */ "./node_modules/@ckeditor/ckeditor5-table/src/utils/common.js");
  68724. /* harmony import */ var _utils_structure__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./utils/structure */ "./node_modules/@ckeditor/ckeditor5-table/src/utils/structure.js");
  68725. /**
  68726. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  68727. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  68728. */
  68729. /**
  68730. * @module table/tableutils
  68731. */
  68732. /**
  68733. * The table utilities plugin.
  68734. *
  68735. * @extends module:core/plugin~Plugin
  68736. */
  68737. class TableUtils extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_1__["Plugin"] {
  68738. /**
  68739. * @inheritDoc
  68740. */
  68741. static get pluginName() {
  68742. return 'TableUtils';
  68743. }
  68744. /**
  68745. * @inheritDoc
  68746. */
  68747. init() {
  68748. this.decorate( 'insertColumns' );
  68749. this.decorate( 'insertRows' );
  68750. }
  68751. /**
  68752. * Returns the table cell location as an object with table row and table column indexes.
  68753. *
  68754. * For instance, in the table below:
  68755. *
  68756. * 0 1 2 3
  68757. * +---+---+---+---+
  68758. * 0 | a | b | c |
  68759. * + + +---+
  68760. * 1 | | | d |
  68761. * +---+---+ +---+
  68762. * 2 | e | | f |
  68763. * +---+---+---+---+
  68764. *
  68765. * the method will return:
  68766. *
  68767. * const cellA = table.getNodeByPath( [ 0, 0 ] );
  68768. * editor.plugins.get( 'TableUtils' ).getCellLocation( cellA );
  68769. * // will return { row: 0, column: 0 }
  68770. *
  68771. * const cellD = table.getNodeByPath( [ 1, 0 ] );
  68772. * editor.plugins.get( 'TableUtils' ).getCellLocation( cellD );
  68773. * // will return { row: 1, column: 3 }
  68774. *
  68775. * @param {module:engine/model/element~Element} tableCell
  68776. * @returns {Object} Returns a `{row, column}` object.
  68777. */
  68778. getCellLocation( tableCell ) {
  68779. const tableRow = tableCell.parent;
  68780. const table = tableRow.parent;
  68781. const rowIndex = table.getChildIndex( tableRow );
  68782. const tableWalker = new _tablewalker__WEBPACK_IMPORTED_MODULE_2__["default"]( table, { row: rowIndex } );
  68783. for ( const { cell, row, column } of tableWalker ) {
  68784. if ( cell === tableCell ) {
  68785. return { row, column };
  68786. }
  68787. }
  68788. }
  68789. /**
  68790. * Creates an empty table with a proper structure. The table needs to be inserted into the model,
  68791. * for example, by using the {@link module:engine/model/model~Model#insertContent} function.
  68792. *
  68793. * model.change( ( writer ) => {
  68794. * // Create a table of 2 rows and 7 columns:
  68795. * const table = tableUtils.createTable( writer, { rows: 2, columns: 7 } );
  68796. *
  68797. * // Insert a table to the model at the best position taking the current selection:
  68798. * model.insertContent( table );
  68799. * }
  68800. *
  68801. * @param {module:engine/model/writer~Writer} writer The model writer.
  68802. * @param {Object} options
  68803. * @param {Number} [options.rows=2] The number of rows to create.
  68804. * @param {Number} [options.columns=2] The number of columns to create.
  68805. * @param {Number} [options.headingRows=0] The number of heading rows.
  68806. * @param {Number} [options.headingColumns=0] The number of heading columns.
  68807. * @returns {module:engine/model/element~Element} The created table element.
  68808. */
  68809. createTable( writer, options ) {
  68810. const table = writer.createElement( 'table' );
  68811. const rows = parseInt( options.rows ) || 2;
  68812. const columns = parseInt( options.columns ) || 2;
  68813. createEmptyRows( writer, table, 0, rows, columns );
  68814. if ( options.headingRows ) {
  68815. Object(_utils_common__WEBPACK_IMPORTED_MODULE_3__["updateNumericAttribute"])( 'headingRows', options.headingRows, table, writer, 0 );
  68816. }
  68817. if ( options.headingColumns ) {
  68818. Object(_utils_common__WEBPACK_IMPORTED_MODULE_3__["updateNumericAttribute"])( 'headingColumns', options.headingColumns, table, writer, 0 );
  68819. }
  68820. return table;
  68821. }
  68822. /**
  68823. * Inserts rows into a table.
  68824. *
  68825. * editor.plugins.get( 'TableUtils' ).insertRows( table, { at: 1, rows: 2 } );
  68826. *
  68827. * Assuming the table on the left, the above code will transform it to the table on the right:
  68828. *
  68829. * row index
  68830. * 0 +---+---+---+ `at` = 1, +---+---+---+ 0
  68831. * | a | b | c | `rows` = 2, | a | b | c |
  68832. * 1 + +---+---+ <-- insert here + +---+---+ 1
  68833. * | | d | e | | | | |
  68834. * 2 + +---+---+ will give: + +---+---+ 2
  68835. * | | f | g | | | | |
  68836. * 3 +---+---+---+ + +---+---+ 3
  68837. * | | d | e |
  68838. * + +---+---+ 4
  68839. * + + f | g |
  68840. * +---+---+---+ 5
  68841. *
  68842. * @param {module:engine/model/element~Element} table The table model element where the rows will be inserted.
  68843. * @param {Object} options
  68844. * @param {Number} [options.at=0] The row index at which the rows will be inserted.
  68845. * @param {Number} [options.rows=1] The number of rows to insert.
  68846. * @param {Boolean|undefined} [options.copyStructureFromAbove] The flag for copying row structure. Note that
  68847. * the row structure will not be copied if this option is not provided.
  68848. */
  68849. insertRows( table, options = {} ) {
  68850. const model = this.editor.model;
  68851. const insertAt = options.at || 0;
  68852. const rowsToInsert = options.rows || 1;
  68853. const isCopyStructure = options.copyStructureFromAbove !== undefined;
  68854. const copyStructureFrom = options.copyStructureFromAbove ? insertAt - 1 : insertAt;
  68855. const rows = this.getRows( table );
  68856. const columns = this.getColumns( table );
  68857. if ( insertAt > rows ) {
  68858. /**
  68859. * The `options.at` points at a row position that does not exist.
  68860. *
  68861. * @error tableutils-insertrows-insert-out-of-range
  68862. */
  68863. throw new ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_0__["CKEditorError"](
  68864. 'tableutils-insertrows-insert-out-of-range',
  68865. this,
  68866. { options }
  68867. );
  68868. }
  68869. model.change( writer => {
  68870. const headingRows = table.getAttribute( 'headingRows' ) || 0;
  68871. // Inserting rows inside heading section requires to update `headingRows` attribute as the heading section will grow.
  68872. if ( headingRows > insertAt ) {
  68873. Object(_utils_common__WEBPACK_IMPORTED_MODULE_3__["updateNumericAttribute"])( 'headingRows', headingRows + rowsToInsert, table, writer, 0 );
  68874. }
  68875. // Inserting at the end or at the beginning of a table doesn't require to calculate anything special.
  68876. if ( !isCopyStructure && ( insertAt === 0 || insertAt === rows ) ) {
  68877. createEmptyRows( writer, table, insertAt, rowsToInsert, columns );
  68878. return;
  68879. }
  68880. // Iterate over all the rows above the inserted rows in order to check for the row-spanned cells.
  68881. const walkerEndRow = isCopyStructure ? Math.max( insertAt, copyStructureFrom ) : insertAt;
  68882. const tableIterator = new _tablewalker__WEBPACK_IMPORTED_MODULE_2__["default"]( table, { endRow: walkerEndRow } );
  68883. // Store spans of the reference row to reproduce it's structure. This array is column number indexed.
  68884. const rowColSpansMap = new Array( columns ).fill( 1 );
  68885. for ( const { row, column, cellHeight, cellWidth, cell } of tableIterator ) {
  68886. const lastCellRow = row + cellHeight - 1;
  68887. const isOverlappingInsertedRow = row < insertAt && insertAt <= lastCellRow;
  68888. const isReferenceRow = row <= copyStructureFrom && copyStructureFrom <= lastCellRow;
  68889. // If the cell is row-spanned and overlaps the inserted row, then reserve space for it in the row map.
  68890. if ( isOverlappingInsertedRow ) {
  68891. // This cell overlaps the inserted rows so we need to expand it further.
  68892. writer.setAttribute( 'rowspan', cellHeight + rowsToInsert, cell );
  68893. // Mark this cell with negative number to indicate how many cells should be skipped when adding the new cells.
  68894. rowColSpansMap[ column ] = -cellWidth;
  68895. }
  68896. // Store the colspan from reference row.
  68897. else if ( isCopyStructure && isReferenceRow ) {
  68898. rowColSpansMap[ column ] = cellWidth;
  68899. }
  68900. }
  68901. for ( let rowIndex = 0; rowIndex < rowsToInsert; rowIndex++ ) {
  68902. const tableRow = writer.createElement( 'tableRow' );
  68903. writer.insert( tableRow, table, insertAt );
  68904. for ( let cellIndex = 0; cellIndex < rowColSpansMap.length; cellIndex++ ) {
  68905. const colspan = rowColSpansMap[ cellIndex ];
  68906. const insertPosition = writer.createPositionAt( tableRow, 'end' );
  68907. // Insert the empty cell only if this slot is not row-spanned from any other cell.
  68908. if ( colspan > 0 ) {
  68909. Object(_utils_common__WEBPACK_IMPORTED_MODULE_3__["createEmptyTableCell"])( writer, insertPosition, colspan > 1 ? { colspan } : null );
  68910. }
  68911. // Skip the col-spanned slots, there won't be any cells.
  68912. cellIndex += Math.abs( colspan ) - 1;
  68913. }
  68914. }
  68915. } );
  68916. }
  68917. /**
  68918. * Inserts columns into a table.
  68919. *
  68920. * editor.plugins.get( 'TableUtils' ).insertColumns( table, { at: 1, columns: 2 } );
  68921. *
  68922. * Assuming the table on the left, the above code will transform it to the table on the right:
  68923. *
  68924. * 0 1 2 3 0 1 2 3 4 5
  68925. * +---+---+---+ +---+---+---+---+---+
  68926. * | a | b | | a | b |
  68927. * + +---+ + +---+
  68928. * | | c | | | c |
  68929. * +---+---+---+ will give: +---+---+---+---+---+
  68930. * | d | e | f | | d | | | e | f |
  68931. * +---+ +---+ +---+---+---+ +---+
  68932. * | g | | h | | g | | | | h |
  68933. * +---+---+---+ +---+---+---+---+---+
  68934. * | i | | i |
  68935. * +---+---+---+ +---+---+---+---+---+
  68936. * ^---- insert here, `at` = 1, `columns` = 2
  68937. *
  68938. * @param {module:engine/model/element~Element} table The table model element where the columns will be inserted.
  68939. * @param {Object} options
  68940. * @param {Number} [options.at=0] The column index at which the columns will be inserted.
  68941. * @param {Number} [options.columns=1] The number of columns to insert.
  68942. */
  68943. insertColumns( table, options = {} ) {
  68944. const model = this.editor.model;
  68945. const insertAt = options.at || 0;
  68946. const columnsToInsert = options.columns || 1;
  68947. model.change( writer => {
  68948. const headingColumns = table.getAttribute( 'headingColumns' );
  68949. // Inserting columns inside heading section requires to update `headingColumns` attribute as the heading section will grow.
  68950. if ( insertAt < headingColumns ) {
  68951. writer.setAttribute( 'headingColumns', headingColumns + columnsToInsert, table );
  68952. }
  68953. const tableColumns = this.getColumns( table );
  68954. // Inserting at the end and at the beginning of a table doesn't require to calculate anything special.
  68955. if ( insertAt === 0 || tableColumns === insertAt ) {
  68956. for ( const tableRow of table.getChildren() ) {
  68957. // Ignore non-row elements inside the table (e.g. caption).
  68958. if ( !tableRow.is( 'element', 'tableRow' ) ) {
  68959. continue;
  68960. }
  68961. createCells( columnsToInsert, writer, writer.createPositionAt( tableRow, insertAt ? 'end' : 0 ) );
  68962. }
  68963. return;
  68964. }
  68965. const tableWalker = new _tablewalker__WEBPACK_IMPORTED_MODULE_2__["default"]( table, { column: insertAt, includeAllSlots: true } );
  68966. for ( const tableSlot of tableWalker ) {
  68967. const { row, cell, cellAnchorColumn, cellAnchorRow, cellWidth, cellHeight } = tableSlot;
  68968. // When iterating over column the table walker outputs either:
  68969. // - cells at given column index (cell "e" from method docs),
  68970. // - spanned columns (spanned cell from row between cells "g" and "h" - spanned by "e", only if `includeAllSlots: true`),
  68971. // - or a cell from the same row which spans over this column (cell "a").
  68972. if ( cellAnchorColumn < insertAt ) {
  68973. // If cell is anchored in previous column, it is a cell that spans over an inserted column (cell "a" & "i").
  68974. // For such cells expand them by a number of columns inserted.
  68975. writer.setAttribute( 'colspan', cellWidth + columnsToInsert, cell );
  68976. // This cell will overlap cells in rows below so skip them (because of `includeAllSlots` option) - (cell "a")
  68977. const lastCellRow = cellAnchorRow + cellHeight - 1;
  68978. for ( let i = row; i <= lastCellRow; i++ ) {
  68979. tableWalker.skipRow( i );
  68980. }
  68981. } else {
  68982. // It's either cell at this column index or spanned cell by a row-spanned cell from row above.
  68983. // In table above it's cell "e" and a spanned position from row below (empty cell between cells "g" and "h")
  68984. createCells( columnsToInsert, writer, tableSlot.getPositionBefore() );
  68985. }
  68986. }
  68987. } );
  68988. }
  68989. /**
  68990. * Removes rows from the given `table`.
  68991. *
  68992. * This method re-calculates the table geometry including `rowspan` attribute of table cells overlapping removed rows
  68993. * and table headings values.
  68994. *
  68995. * editor.plugins.get( 'TableUtils' ).removeRows( table, { at: 1, rows: 2 } );
  68996. *
  68997. * Executing the above code in the context of the table on the left will transform its structure as presented on the right:
  68998. *
  68999. * row index
  69000. * ┌───┬───┬───┐ `at` = 1 ┌───┬───┬───┐
  69001. * 0 │ a │ b │ c │ `rows` = 2 │ a │ b │ c │ 0
  69002. * │ ├───┼───┤ │ ├───┼───┤
  69003. * 1 │ │ d │ e │ <-- remove from here │ │ d │ g │ 1
  69004. * │ │ ├───┤ will give: ├───┼───┼───┤
  69005. * 2 │ │ │ f │ │ h │ i │ j │ 2
  69006. * │ │ ├───┤ └───┴───┴───┘
  69007. * 3 │ │ │ g │
  69008. * ├───┼───┼───┤
  69009. * 4 │ h │ i │ j │
  69010. * └───┴───┴───┘
  69011. *
  69012. * @param {module:engine/model/element~Element} table
  69013. * @param {Object} options
  69014. * @param {Number} options.at The row index at which the removing rows will start.
  69015. * @param {Number} [options.rows=1] The number of rows to remove.
  69016. */
  69017. removeRows( table, options ) {
  69018. const model = this.editor.model;
  69019. const rowsToRemove = options.rows || 1;
  69020. const rowCount = this.getRows( table );
  69021. const first = options.at;
  69022. const last = first + rowsToRemove - 1;
  69023. if ( last > rowCount - 1 ) {
  69024. /**
  69025. * The `options.at` param must point at existing row and `options.rows` must not exceed the rows in the table.
  69026. *
  69027. * @error tableutils-removerows-row-index-out-of-range
  69028. */
  69029. throw new ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_0__["CKEditorError"](
  69030. 'tableutils-removerows-row-index-out-of-range',
  69031. this,
  69032. { table, options }
  69033. );
  69034. }
  69035. model.change( writer => {
  69036. // Removing rows from the table require that most calculations to be done prior to changing table structure.
  69037. // Preparations must be done in the same enqueueChange callback to use the current table structure.
  69038. // 1. Preparation - get row-spanned cells that have to be modified after removing rows.
  69039. const { cellsToMove, cellsToTrim } = getCellsToMoveAndTrimOnRemoveRow( table, first, last );
  69040. // 2. Execution
  69041. // 2a. Move cells from removed rows that extends over a removed section - must be done before removing rows.
  69042. // This will fill any gaps in a rows below that previously were empty because of row-spanned cells.
  69043. if ( cellsToMove.size ) {
  69044. const rowAfterRemovedSection = last + 1;
  69045. moveCellsToRow( table, rowAfterRemovedSection, cellsToMove, writer );
  69046. }
  69047. // 2b. Remove all required rows.
  69048. for ( let i = last; i >= first; i-- ) {
  69049. writer.remove( table.getChild( i ) );
  69050. }
  69051. // 2c. Update cells from rows above that overlap removed section. Similar to step 2 but does not involve moving cells.
  69052. for ( const { rowspan, cell } of cellsToTrim ) {
  69053. Object(_utils_common__WEBPACK_IMPORTED_MODULE_3__["updateNumericAttribute"])( 'rowspan', rowspan, cell, writer );
  69054. }
  69055. // 2d. Adjust heading rows if removed rows were in a heading section.
  69056. updateHeadingRows( table, first, last, writer );
  69057. // 2e. Remove empty columns (without anchored cells) if there are any.
  69058. if ( !Object(_utils_structure__WEBPACK_IMPORTED_MODULE_4__["removeEmptyColumns"])( table, this ) ) {
  69059. // If there wasn't any empty columns then we still need to check if this wasn't called
  69060. // because of cleaning empty rows and we only removed one of them.
  69061. Object(_utils_structure__WEBPACK_IMPORTED_MODULE_4__["removeEmptyRows"])( table, this );
  69062. }
  69063. } );
  69064. }
  69065. /**
  69066. * Removes columns from the given `table`.
  69067. *
  69068. * This method re-calculates the table geometry including the `colspan` attribute of table cells overlapping removed columns
  69069. * and table headings values.
  69070. *
  69071. * editor.plugins.get( 'TableUtils' ).removeColumns( table, { at: 1, columns: 2 } );
  69072. *
  69073. * Executing the above code in the context of the table on the left will transform its structure as presented on the right:
  69074. *
  69075. * 0 1 2 3 4 0 1 2
  69076. * ┌───────────────┬───┐ ┌───────┬───┐
  69077. * │ a │ b │ │ a │ b │
  69078. * │ ├───┤ │ ├───┤
  69079. * │ │ c │ │ │ c │
  69080. * ├───┬───┬───┬───┼───┤ will give: ├───┬───┼───┤
  69081. * │ d │ e │ f │ g │ h │ │ d │ g │ h │
  69082. * ├───┼───┼───┤ ├───┤ ├───┤ ├───┤
  69083. * │ i │ j │ k │ │ l │ │ i │ │ l │
  69084. * ├───┴───┴───┴───┴───┤ ├───┴───┴───┤
  69085. * │ m │ │ m │
  69086. * └───────────────────┘ └───────────┘
  69087. * ^---- remove from here, `at` = 1, `columns` = 2
  69088. *
  69089. * @param {module:engine/model/element~Element} table
  69090. * @param {Object} options
  69091. * @param {Number} options.at The row index at which the removing columns will start.
  69092. * @param {Number} [options.columns=1] The number of columns to remove.
  69093. */
  69094. removeColumns( table, options ) {
  69095. const model = this.editor.model;
  69096. const first = options.at;
  69097. const columnsToRemove = options.columns || 1;
  69098. const last = options.at + columnsToRemove - 1;
  69099. model.change( writer => {
  69100. adjustHeadingColumns( table, { first, last }, writer );
  69101. for ( let removedColumnIndex = last; removedColumnIndex >= first; removedColumnIndex-- ) {
  69102. for ( const { cell, column, cellWidth } of [ ...new _tablewalker__WEBPACK_IMPORTED_MODULE_2__["default"]( table ) ] ) {
  69103. // If colspaned cell overlaps removed column decrease its span.
  69104. if ( column <= removedColumnIndex && cellWidth > 1 && column + cellWidth > removedColumnIndex ) {
  69105. Object(_utils_common__WEBPACK_IMPORTED_MODULE_3__["updateNumericAttribute"])( 'colspan', cellWidth - 1, cell, writer );
  69106. } else if ( column === removedColumnIndex ) {
  69107. // The cell in removed column has colspan of 1.
  69108. writer.remove( cell );
  69109. }
  69110. }
  69111. }
  69112. // Remove empty rows that could appear after removing columns.
  69113. if ( !Object(_utils_structure__WEBPACK_IMPORTED_MODULE_4__["removeEmptyRows"])( table, this ) ) {
  69114. // If there wasn't any empty rows then we still need to check if this wasn't called
  69115. // because of cleaning empty columns and we only removed one of them.
  69116. Object(_utils_structure__WEBPACK_IMPORTED_MODULE_4__["removeEmptyColumns"])( table, this );
  69117. }
  69118. } );
  69119. }
  69120. /**
  69121. * Divides a table cell vertically into several ones.
  69122. *
  69123. * The cell will be visually split into more cells by updating colspans of other cells in a column
  69124. * and inserting cells (columns) after that cell.
  69125. *
  69126. * In the table below, if cell "a" is split into 3 cells:
  69127. *
  69128. * +---+---+---+
  69129. * | a | b | c |
  69130. * +---+---+---+
  69131. * | d | e | f |
  69132. * +---+---+---+
  69133. *
  69134. * it will result in the table below:
  69135. *
  69136. * +---+---+---+---+---+
  69137. * | a | | | b | c |
  69138. * +---+---+---+---+---+
  69139. * | d | e | f |
  69140. * +---+---+---+---+---+
  69141. *
  69142. * So cell "d" will get its `colspan` updated to `3` and 2 cells will be added (2 columns will be created).
  69143. *
  69144. * Splitting a cell that already has a `colspan` attribute set will distribute the cell `colspan` evenly and the remainder
  69145. * will be left to the original cell:
  69146. *
  69147. * +---+---+---+
  69148. * | a |
  69149. * +---+---+---+
  69150. * | b | c | d |
  69151. * +---+---+---+
  69152. *
  69153. * 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`:
  69154. *
  69155. * +---+---+---+
  69156. * | a | |
  69157. * +---+---+---+
  69158. * | b | c | d |
  69159. * +---+---+---+
  69160. *
  69161. * @param {module:engine/model/element~Element} tableCell
  69162. * @param {Number} numberOfCells
  69163. */
  69164. splitCellVertically( tableCell, numberOfCells = 2 ) {
  69165. const model = this.editor.model;
  69166. const tableRow = tableCell.parent;
  69167. const table = tableRow.parent;
  69168. const rowspan = parseInt( tableCell.getAttribute( 'rowspan' ) || 1 );
  69169. const colspan = parseInt( tableCell.getAttribute( 'colspan' ) || 1 );
  69170. model.change( writer => {
  69171. // First check - the cell spans over multiple rows so before doing anything else just split this cell.
  69172. if ( colspan > 1 ) {
  69173. // Get spans of new (inserted) cells and span to update of split cell.
  69174. const { newCellsSpan, updatedSpan } = breakSpanEvenly( colspan, numberOfCells );
  69175. Object(_utils_common__WEBPACK_IMPORTED_MODULE_3__["updateNumericAttribute"])( 'colspan', updatedSpan, tableCell, writer );
  69176. // Each inserted cell will have the same attributes:
  69177. const newCellsAttributes = {};
  69178. // Do not store default value in the model.
  69179. if ( newCellsSpan > 1 ) {
  69180. newCellsAttributes.colspan = newCellsSpan;
  69181. }
  69182. // Copy rowspan of split cell.
  69183. if ( rowspan > 1 ) {
  69184. newCellsAttributes.rowspan = rowspan;
  69185. }
  69186. const cellsToInsert = colspan > numberOfCells ? numberOfCells - 1 : colspan - 1;
  69187. createCells( cellsToInsert, writer, writer.createPositionAfter( tableCell ), newCellsAttributes );
  69188. }
  69189. // Second check - the cell has colspan of 1 or we need to create more cells then the currently one spans over.
  69190. if ( colspan < numberOfCells ) {
  69191. const cellsToInsert = numberOfCells - colspan;
  69192. // First step: expand cells on the same column as split cell.
  69193. const tableMap = [ ...new _tablewalker__WEBPACK_IMPORTED_MODULE_2__["default"]( table ) ];
  69194. // Get the column index of split cell.
  69195. const { column: splitCellColumn } = tableMap.find( ( { cell } ) => cell === tableCell );
  69196. // Find cells which needs to be expanded vertically - those on the same column or those that spans over split cell's column.
  69197. const cellsToUpdate = tableMap.filter( ( { cell, cellWidth, column } ) => {
  69198. const isOnSameColumn = cell !== tableCell && column === splitCellColumn;
  69199. const spansOverColumn = ( column < splitCellColumn && column + cellWidth > splitCellColumn );
  69200. return isOnSameColumn || spansOverColumn;
  69201. } );
  69202. // Expand cells vertically.
  69203. for ( const { cell, cellWidth } of cellsToUpdate ) {
  69204. writer.setAttribute( 'colspan', cellWidth + cellsToInsert, cell );
  69205. }
  69206. // Second step: create columns after split cell.
  69207. // Each inserted cell will have the same attributes:
  69208. const newCellsAttributes = {};
  69209. // Do not store default value in the model.
  69210. // Copy rowspan of split cell.
  69211. if ( rowspan > 1 ) {
  69212. newCellsAttributes.rowspan = rowspan;
  69213. }
  69214. createCells( cellsToInsert, writer, writer.createPositionAfter( tableCell ), newCellsAttributes );
  69215. const headingColumns = table.getAttribute( 'headingColumns' ) || 0;
  69216. // Update heading section if split cell is in heading section.
  69217. if ( headingColumns > splitCellColumn ) {
  69218. Object(_utils_common__WEBPACK_IMPORTED_MODULE_3__["updateNumericAttribute"])( 'headingColumns', headingColumns + cellsToInsert, table, writer );
  69219. }
  69220. }
  69221. } );
  69222. }
  69223. /**
  69224. * Divides a table cell horizontally into several ones.
  69225. *
  69226. * 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
  69227. * below.
  69228. *
  69229. * If in the table below cell "b" is split into 3 cells:
  69230. *
  69231. * +---+---+---+
  69232. * | a | b | c |
  69233. * +---+---+---+
  69234. * | d | e | f |
  69235. * +---+---+---+
  69236. *
  69237. * It will result in the table below:
  69238. *
  69239. * +---+---+---+
  69240. * | a | b | c |
  69241. * + +---+ +
  69242. * | | | |
  69243. * + +---+ +
  69244. * | | | |
  69245. * +---+---+---+
  69246. * | d | e | f |
  69247. * +---+---+---+
  69248. *
  69249. * So cells "a" and "b" will get their `rowspan` updated to `3` and 2 rows with a single cell will be added.
  69250. *
  69251. * Splitting a cell that already has a `rowspan` attribute set will distribute the cell `rowspan` evenly and the remainder
  69252. * will be left to the original cell:
  69253. *
  69254. * +---+---+---+
  69255. * | a | b | c |
  69256. * + +---+---+
  69257. * | | d | e |
  69258. * + +---+---+
  69259. * | | f | g |
  69260. * + +---+---+
  69261. * | | h | i |
  69262. * +---+---+---+
  69263. *
  69264. * Splitting cell "a" with `rowspan=4` into 3 cells will create 2 cells with a `rowspan=1` and cell "a" will have `rowspan=2`:
  69265. *
  69266. * +---+---+---+
  69267. * | a | b | c |
  69268. * + +---+---+
  69269. * | | d | e |
  69270. * +---+---+---+
  69271. * | | f | g |
  69272. * +---+---+---+
  69273. * | | h | i |
  69274. * +---+---+---+
  69275. *
  69276. * @param {module:engine/model/element~Element} tableCell
  69277. * @param {Number} numberOfCells
  69278. */
  69279. splitCellHorizontally( tableCell, numberOfCells = 2 ) {
  69280. const model = this.editor.model;
  69281. const tableRow = tableCell.parent;
  69282. const table = tableRow.parent;
  69283. const splitCellRow = table.getChildIndex( tableRow );
  69284. const rowspan = parseInt( tableCell.getAttribute( 'rowspan' ) || 1 );
  69285. const colspan = parseInt( tableCell.getAttribute( 'colspan' ) || 1 );
  69286. model.change( writer => {
  69287. // First check - the cell spans over multiple rows so before doing anything else just split this cell.
  69288. if ( rowspan > 1 ) {
  69289. // Cache table map before updating table.
  69290. const tableMap = [ ...new _tablewalker__WEBPACK_IMPORTED_MODULE_2__["default"]( table, {
  69291. startRow: splitCellRow,
  69292. endRow: splitCellRow + rowspan - 1,
  69293. includeAllSlots: true
  69294. } ) ];
  69295. // Get spans of new (inserted) cells and span to update of split cell.
  69296. const { newCellsSpan, updatedSpan } = breakSpanEvenly( rowspan, numberOfCells );
  69297. Object(_utils_common__WEBPACK_IMPORTED_MODULE_3__["updateNumericAttribute"])( 'rowspan', updatedSpan, tableCell, writer );
  69298. const { column: cellColumn } = tableMap.find( ( { cell } ) => cell === tableCell );
  69299. // Each inserted cell will have the same attributes:
  69300. const newCellsAttributes = {};
  69301. // Do not store default value in the model.
  69302. if ( newCellsSpan > 1 ) {
  69303. newCellsAttributes.rowspan = newCellsSpan;
  69304. }
  69305. // Copy colspan of split cell.
  69306. if ( colspan > 1 ) {
  69307. newCellsAttributes.colspan = colspan;
  69308. }
  69309. for ( const tableSlot of tableMap ) {
  69310. const { column, row } = tableSlot;
  69311. // As both newly created cells and the split cell might have rowspan,
  69312. // the insertion of new cells must go to appropriate rows:
  69313. //
  69314. // 1. It's a row after split cell + it's height.
  69315. const isAfterSplitCell = row >= splitCellRow + updatedSpan;
  69316. // 2. Is on the same column.
  69317. const isOnSameColumn = column === cellColumn;
  69318. // 3. And it's row index is after previous cell height.
  69319. const isInEvenlySplitRow = ( row + splitCellRow + updatedSpan ) % newCellsSpan === 0;
  69320. if ( isAfterSplitCell && isOnSameColumn && isInEvenlySplitRow ) {
  69321. createCells( 1, writer, tableSlot.getPositionBefore(), newCellsAttributes );
  69322. }
  69323. }
  69324. }
  69325. // Second check - the cell has rowspan of 1 or we need to create more cells than the current cell spans over.
  69326. if ( rowspan < numberOfCells ) {
  69327. // We already split the cell in check one so here we split to the remaining number of cells only.
  69328. const cellsToInsert = numberOfCells - rowspan;
  69329. // This check is needed since we need to check if there are any cells from previous rows than spans over this cell's row.
  69330. const tableMap = [ ...new _tablewalker__WEBPACK_IMPORTED_MODULE_2__["default"]( table, { startRow: 0, endRow: splitCellRow } ) ];
  69331. // First step: expand cells.
  69332. for ( const { cell, cellHeight, row } of tableMap ) {
  69333. // Expand rowspan of cells that are either:
  69334. // - on the same row as current cell,
  69335. // - or are below split cell row and overlaps that row.
  69336. if ( cell !== tableCell && row + cellHeight > splitCellRow ) {
  69337. const rowspanToSet = cellHeight + cellsToInsert;
  69338. writer.setAttribute( 'rowspan', rowspanToSet, cell );
  69339. }
  69340. }
  69341. // Second step: create rows with single cell below split cell.
  69342. const newCellsAttributes = {};
  69343. // Copy colspan of split cell.
  69344. if ( colspan > 1 ) {
  69345. newCellsAttributes.colspan = colspan;
  69346. }
  69347. createEmptyRows( writer, table, splitCellRow + 1, cellsToInsert, 1, newCellsAttributes );
  69348. // Update heading section if split cell is in heading section.
  69349. const headingRows = table.getAttribute( 'headingRows' ) || 0;
  69350. if ( headingRows > splitCellRow ) {
  69351. Object(_utils_common__WEBPACK_IMPORTED_MODULE_3__["updateNumericAttribute"])( 'headingRows', headingRows + cellsToInsert, table, writer );
  69352. }
  69353. }
  69354. } );
  69355. }
  69356. /**
  69357. * Returns the number of columns for a given table.
  69358. *
  69359. * editor.plugins.get( 'TableUtils' ).getColumns( table );
  69360. *
  69361. * @param {module:engine/model/element~Element} table The table to analyze.
  69362. * @returns {Number}
  69363. */
  69364. getColumns( table ) {
  69365. // Analyze first row only as all the rows should have the same width.
  69366. // Using the first row without checking if it's a tableRow because we expect
  69367. // that table will have only tableRow model elements at the beginning.
  69368. const row = table.getChild( 0 );
  69369. return [ ...row.getChildren() ].reduce( ( columns, row ) => {
  69370. const columnWidth = parseInt( row.getAttribute( 'colspan' ) || 1 );
  69371. return columns + columnWidth;
  69372. }, 0 );
  69373. }
  69374. /**
  69375. * Returns the number of rows for a given table. Any other element present in the table model is omitted.
  69376. *
  69377. * editor.plugins.get( 'TableUtils' ).getRows( table );
  69378. *
  69379. * @param {module:engine/model/element~Element} table The table to analyze.
  69380. * @returns {Number}
  69381. */
  69382. getRows( table ) {
  69383. // Rowspan not included due to #6427.
  69384. return Array.from( table.getChildren() )
  69385. .reduce( ( rowCount, child ) => child.is( 'element', 'tableRow' ) ? rowCount + 1 : rowCount, 0 );
  69386. }
  69387. }
  69388. // Creates empty rows at the given index in an existing table.
  69389. //
  69390. // @param {module:engine/model/writer~Writer} writer
  69391. // @param {module:engine/model/element~Element} table
  69392. // @param {Number} insertAt The row index of row insertion.
  69393. // @param {Number} rows The number of rows to create.
  69394. // @param {Number} tableCellToInsert The number of cells to insert in each row.
  69395. function createEmptyRows( writer, table, insertAt, rows, tableCellToInsert, attributes = {} ) {
  69396. for ( let i = 0; i < rows; i++ ) {
  69397. const tableRow = writer.createElement( 'tableRow' );
  69398. writer.insert( tableRow, table, insertAt );
  69399. createCells( tableCellToInsert, writer, writer.createPositionAt( tableRow, 'end' ), attributes );
  69400. }
  69401. }
  69402. // Creates cells at a given position.
  69403. //
  69404. // @param {Number} columns The number of columns to create
  69405. // @param {module:engine/model/writer~Writer} writer
  69406. // @param {module:engine/model/position~Position} insertPosition
  69407. function createCells( cells, writer, insertPosition, attributes = {} ) {
  69408. for ( let i = 0; i < cells; i++ ) {
  69409. Object(_utils_common__WEBPACK_IMPORTED_MODULE_3__["createEmptyTableCell"])( writer, insertPosition, attributes );
  69410. }
  69411. }
  69412. // Evenly distributes the span of a cell to a number of provided cells.
  69413. // The resulting spans will always be integer values.
  69414. //
  69415. // For instance breaking a span of 7 into 3 cells will return:
  69416. //
  69417. // { newCellsSpan: 2, updatedSpan: 3 }
  69418. //
  69419. // as two cells will have a span of 2 and the remainder will go the first cell so its span will change to 3.
  69420. //
  69421. // @param {Number} span The span value do break.
  69422. // @param {Number} numberOfCells The number of resulting spans.
  69423. // @returns {{newCellsSpan: Number, updatedSpan: Number}}
  69424. function breakSpanEvenly( span, numberOfCells ) {
  69425. if ( span < numberOfCells ) {
  69426. return { newCellsSpan: 1, updatedSpan: 1 };
  69427. }
  69428. const newCellsSpan = Math.floor( span / numberOfCells );
  69429. const updatedSpan = ( span - newCellsSpan * numberOfCells ) + newCellsSpan;
  69430. return { newCellsSpan, updatedSpan };
  69431. }
  69432. // Updates heading columns attribute if removing a row from head section.
  69433. function adjustHeadingColumns( table, removedColumnIndexes, writer ) {
  69434. const headingColumns = table.getAttribute( 'headingColumns' ) || 0;
  69435. if ( headingColumns && removedColumnIndexes.first < headingColumns ) {
  69436. const headingsRemoved = Math.min( headingColumns - 1 /* Other numbers are 0-based */, removedColumnIndexes.last ) -
  69437. removedColumnIndexes.first + 1;
  69438. writer.setAttribute( 'headingColumns', headingColumns - headingsRemoved, table );
  69439. }
  69440. }
  69441. // Calculates a new heading rows value for removing rows from heading section.
  69442. function updateHeadingRows( table, first, last, writer ) {
  69443. const headingRows = table.getAttribute( 'headingRows' ) || 0;
  69444. if ( first < headingRows ) {
  69445. const newRows = last < headingRows ? headingRows - ( last - first + 1 ) : first;
  69446. Object(_utils_common__WEBPACK_IMPORTED_MODULE_3__["updateNumericAttribute"])( 'headingRows', newRows, table, writer, 0 );
  69447. }
  69448. }
  69449. // Finds cells that will be:
  69450. // - trimmed - Cells that are "above" removed rows sections and overlap the removed section - their rowspan must be trimmed.
  69451. // - moved - Cells from removed rows section might stick out of. These cells are moved to the next row after a removed section.
  69452. //
  69453. // Sample table with overlapping & sticking out cells:
  69454. //
  69455. // +----+----+----+----+----+
  69456. // | 00 | 01 | 02 | 03 | 04 |
  69457. // +----+ + + + +
  69458. // | 10 | | | | |
  69459. // +----+----+ + + +
  69460. // | 20 | 21 | | | | <-- removed row
  69461. // + + +----+ + +
  69462. // | | | 32 | | | <-- removed row
  69463. // +----+ + +----+ +
  69464. // | 40 | | | 43 | |
  69465. // +----+----+----+----+----+
  69466. //
  69467. // In a table above:
  69468. // - cells to trim: '02', '03' & '04'.
  69469. // - cells to move: '21' & '32'.
  69470. function getCellsToMoveAndTrimOnRemoveRow( table, first, last ) {
  69471. const cellsToMove = new Map();
  69472. const cellsToTrim = [];
  69473. for ( const { row, column, cellHeight, cell } of new _tablewalker__WEBPACK_IMPORTED_MODULE_2__["default"]( table, { endRow: last } ) ) {
  69474. const lastRowOfCell = row + cellHeight - 1;
  69475. const isCellStickingOutFromRemovedRows = row >= first && row <= last && lastRowOfCell > last;
  69476. if ( isCellStickingOutFromRemovedRows ) {
  69477. const rowspanInRemovedSection = last - row + 1;
  69478. const rowSpanToSet = cellHeight - rowspanInRemovedSection;
  69479. cellsToMove.set( column, {
  69480. cell,
  69481. rowspan: rowSpanToSet
  69482. } );
  69483. }
  69484. const isCellOverlappingRemovedRows = row < first && lastRowOfCell >= first;
  69485. if ( isCellOverlappingRemovedRows ) {
  69486. let rowspanAdjustment;
  69487. // Cell fully covers removed section - trim it by removed rows count.
  69488. if ( lastRowOfCell >= last ) {
  69489. rowspanAdjustment = last - first + 1;
  69490. }
  69491. // Cell partially overlaps removed section - calculate cell's span that is in removed section.
  69492. else {
  69493. rowspanAdjustment = lastRowOfCell - first + 1;
  69494. }
  69495. cellsToTrim.push( {
  69496. cell,
  69497. rowspan: cellHeight - rowspanAdjustment
  69498. } );
  69499. }
  69500. }
  69501. return { cellsToMove, cellsToTrim };
  69502. }
  69503. function moveCellsToRow( table, targetRowIndex, cellsToMove, writer ) {
  69504. const tableWalker = new _tablewalker__WEBPACK_IMPORTED_MODULE_2__["default"]( table, {
  69505. includeAllSlots: true,
  69506. row: targetRowIndex
  69507. } );
  69508. const tableRowMap = [ ...tableWalker ];
  69509. const row = table.getChild( targetRowIndex );
  69510. let previousCell;
  69511. for ( const { column, cell, isAnchor } of tableRowMap ) {
  69512. if ( cellsToMove.has( column ) ) {
  69513. const { cell: cellToMove, rowspan } = cellsToMove.get( column );
  69514. const targetPosition = previousCell ?
  69515. writer.createPositionAfter( previousCell ) :
  69516. writer.createPositionAt( row, 0 );
  69517. writer.move( writer.createRangeOn( cellToMove ), targetPosition );
  69518. Object(_utils_common__WEBPACK_IMPORTED_MODULE_3__["updateNumericAttribute"])( 'rowspan', rowspan, cellToMove, writer );
  69519. previousCell = cellToMove;
  69520. } else if ( isAnchor ) {
  69521. // If cell is spanned then `cell` holds reference to overlapping cell. See ckeditor/ckeditor5#6502.
  69522. previousCell = cell;
  69523. }
  69524. }
  69525. }
  69526. /***/ }),
  69527. /***/ "./node_modules/@ckeditor/ckeditor5-table/src/tablewalker.js":
  69528. /*!*******************************************************************!*\
  69529. !*** ./node_modules/@ckeditor/ckeditor5-table/src/tablewalker.js ***!
  69530. \*******************************************************************/
  69531. /*! exports provided: default */
  69532. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  69533. "use strict";
  69534. __webpack_require__.r(__webpack_exports__);
  69535. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return TableWalker; });
  69536. /**
  69537. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  69538. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  69539. */
  69540. /**
  69541. * @module table/tablewalker
  69542. */
  69543. // @if CK_DEBUG // import { CKEditorError } from 'ckeditor5/src/utils';
  69544. /**
  69545. * The table iterator class. It allows to iterate over table cells. For each cell the iterator yields
  69546. * {@link module:table/tablewalker~TableSlot} with proper table cell attributes.
  69547. */
  69548. class TableWalker {
  69549. /**
  69550. * Creates an instance of the table walker.
  69551. *
  69552. * The table walker iterates internally by traversing the table from row index = 0 and column index = 0.
  69553. * It walks row by row and column by column in order to output values defined in the constructor.
  69554. * By default it will output only the locations that are occupied by a cell. To include also spanned rows and columns,
  69555. * pass the `includeAllSlots` option to the constructor.
  69556. *
  69557. * The most important values of the iterator are column and row indexes of a cell.
  69558. *
  69559. * See {@link module:table/tablewalker~TableSlot} what values are returned by the table walker.
  69560. *
  69561. * To iterate over a given row:
  69562. *
  69563. * const tableWalker = new TableWalker( table, { startRow: 1, endRow: 2 } );
  69564. *
  69565. * for ( const tableSlot of tableWalker ) {
  69566. * console.log( 'A cell at row', tableSlot.row, 'and column', tableSlot.column );
  69567. * }
  69568. *
  69569. * For instance the code above for the following table:
  69570. *
  69571. * +----+----+----+----+----+----+
  69572. * | 00 | 02 | 03 | 04 | 05 |
  69573. * | +----+----+----+----+
  69574. * | | 12 | 14 | 15 |
  69575. * | +----+----+----+ +
  69576. * | | 22 | |
  69577. * |----+----+----+----+----+ +
  69578. * | 30 | 31 | 32 | 33 | 34 | |
  69579. * +----+----+----+----+----+----+
  69580. *
  69581. * will log in the console:
  69582. *
  69583. * 'A cell at row 1 and column 2'
  69584. * 'A cell at row 1 and column 4'
  69585. * 'A cell at row 1 and column 5'
  69586. * 'A cell at row 2 and column 2'
  69587. *
  69588. * To also iterate over spanned cells:
  69589. *
  69590. * const tableWalker = new TableWalker( table, { row: 1, includeAllSlots: true } );
  69591. *
  69592. * for ( const tableSlot of tableWalker ) {
  69593. * console.log( 'Slot at', tableSlot.row, 'x', tableSlot.column, ':', tableSlot.isAnchor ? 'is anchored' : 'is spanned' );
  69594. * }
  69595. *
  69596. * will log in the console for the table from the previous example:
  69597. *
  69598. * 'Cell at 1 x 0 : is spanned'
  69599. * 'Cell at 1 x 1 : is spanned'
  69600. * 'Cell at 1 x 2 : is anchored'
  69601. * 'Cell at 1 x 3 : is spanned'
  69602. * 'Cell at 1 x 4 : is anchored'
  69603. * 'Cell at 1 x 5 : is anchored'
  69604. *
  69605. * **Note**: Option `row` is a shortcut that sets both `startRow` and `endRow` to the same row.
  69606. * (Use either `row` or `startRow` and `endRow` but never together). Similarly the `column` option sets both `startColumn`
  69607. * and `endColumn` to the same column (Use either `column` or `startColumn` and `endColumn` but never together).
  69608. *
  69609. * @constructor
  69610. * @param {module:engine/model/element~Element} table A table over which the walker iterates.
  69611. * @param {Object} [options={}] An object with configuration.
  69612. * @param {Number} [options.row] A row index for which this iterator will output cells.
  69613. * Can't be used together with `startRow` and `endRow`.
  69614. * @param {Number} [options.startRow=0] A row index from which this iterator should start. Can't be used together with `row`.
  69615. * @param {Number} [options.endRow] A row index at which this iterator should end. Can't be used together with `row`.
  69616. * @param {Number} [options.column] A column index for which this iterator will output cells.
  69617. * Can't be used together with `startColumn` and `endColumn`.
  69618. * @param {Number} [options.startColumn=0] A column index from which this iterator should start. Can't be used together with `column`.
  69619. * @param {Number} [options.endColumn] A column index at which this iterator should end. Can't be used together with `column`.
  69620. * @param {Boolean} [options.includeAllSlots=false] Also return values for spanned cells.
  69621. */
  69622. constructor( table, options = {} ) {
  69623. /**
  69624. * The walker's table element.
  69625. *
  69626. * @readonly
  69627. * @member {module:engine/model/element~Element}
  69628. * @protected
  69629. */
  69630. this._table = table;
  69631. /**
  69632. * A row index from which this iterator will start.
  69633. *
  69634. * @readonly
  69635. * @member {Number}
  69636. * @private
  69637. */
  69638. this._startRow = options.row !== undefined ? options.row : options.startRow || 0;
  69639. /**
  69640. * A row index at which this iterator will end.
  69641. *
  69642. * @readonly
  69643. * @member {Number}
  69644. * @private
  69645. */
  69646. this._endRow = options.row !== undefined ? options.row : options.endRow;
  69647. /**
  69648. * If set, the table walker will only output cells from a given column and following ones or cells that overlap them.
  69649. *
  69650. * @readonly
  69651. * @member {Number}
  69652. * @private
  69653. */
  69654. this._startColumn = options.column !== undefined ? options.column : options.startColumn || 0;
  69655. /**
  69656. * If set, the table walker will only output cells up to a given column.
  69657. *
  69658. * @readonly
  69659. * @member {Number}
  69660. * @private
  69661. */
  69662. this._endColumn = options.column !== undefined ? options.column : options.endColumn;
  69663. /**
  69664. * Enables output of spanned cells that are normally not yielded.
  69665. *
  69666. * @readonly
  69667. * @member {Boolean}
  69668. * @private
  69669. */
  69670. this._includeAllSlots = !!options.includeAllSlots;
  69671. /**
  69672. * Row indexes to skip from the iteration.
  69673. *
  69674. * @readonly
  69675. * @member {Set<Number>}
  69676. * @private
  69677. */
  69678. this._skipRows = new Set();
  69679. /**
  69680. * The current row index.
  69681. *
  69682. * @member {Number}
  69683. * @protected
  69684. */
  69685. this._row = 0;
  69686. /**
  69687. * The index of the current row element in the table.
  69688. *
  69689. * @type {Number}
  69690. * @protected
  69691. */
  69692. this._rowIndex = 0;
  69693. /**
  69694. * The current column index.
  69695. *
  69696. * @member {Number}
  69697. * @protected
  69698. */
  69699. this._column = 0;
  69700. /**
  69701. * The cell index in a parent row. For spanned cells when {@link #_includeAllSlots} is set to `true`,
  69702. * this represents the index of the next table cell.
  69703. *
  69704. * @member {Number}
  69705. * @protected
  69706. */
  69707. this._cellIndex = 0;
  69708. /**
  69709. * Holds a map of spanned cells in a table.
  69710. *
  69711. * @readonly
  69712. * @member {Map.<Number, Map.<Number, Object>>}
  69713. * @private
  69714. */
  69715. this._spannedCells = new Map();
  69716. /**
  69717. * Index of the next column where a cell is anchored.
  69718. *
  69719. * @member {Number}
  69720. * @private
  69721. */
  69722. this._nextCellAtColumn = -1;
  69723. }
  69724. /**
  69725. * Iterable interface.
  69726. *
  69727. * @returns {Iterable.<module:table/tablewalker~TableSlot>}
  69728. */
  69729. [ Symbol.iterator ]() {
  69730. return this;
  69731. }
  69732. /**
  69733. * Gets the next table walker's value.
  69734. *
  69735. * @returns {module:table/tablewalker~TableSlot} The next table walker's value.
  69736. */
  69737. next() {
  69738. const row = this._table.getChild( this._rowIndex );
  69739. // Iterator is done when there's no row (table ended) or the row is after `endRow` limit.
  69740. if ( !row || this._isOverEndRow() ) {
  69741. return { done: true };
  69742. }
  69743. // We step over current element when it is not a tableRow instance.
  69744. if ( !row.is( 'element', 'tableRow' ) ) {
  69745. this._rowIndex++;
  69746. return this.next();
  69747. }
  69748. if ( this._isOverEndColumn() ) {
  69749. return this._advanceToNextRow();
  69750. }
  69751. let outValue = null;
  69752. const spanData = this._getSpanned();
  69753. if ( spanData ) {
  69754. if ( this._includeAllSlots && !this._shouldSkipSlot() ) {
  69755. outValue = this._formatOutValue( spanData.cell, spanData.row, spanData.column );
  69756. }
  69757. } else {
  69758. const cell = row.getChild( this._cellIndex );
  69759. if ( !cell ) {
  69760. // If there are no more cells left in row advance to the next row.
  69761. return this._advanceToNextRow();
  69762. }
  69763. const colspan = parseInt( cell.getAttribute( 'colspan' ) || 1 );
  69764. const rowspan = parseInt( cell.getAttribute( 'rowspan' ) || 1 );
  69765. // Record this cell spans if it's not 1x1 cell.
  69766. if ( colspan > 1 || rowspan > 1 ) {
  69767. this._recordSpans( cell, rowspan, colspan );
  69768. }
  69769. if ( !this._shouldSkipSlot() ) {
  69770. outValue = this._formatOutValue( cell );
  69771. }
  69772. this._nextCellAtColumn = this._column + colspan;
  69773. }
  69774. // Advance to the next column before returning value.
  69775. this._column++;
  69776. if ( this._column == this._nextCellAtColumn ) {
  69777. this._cellIndex++;
  69778. }
  69779. // The current value will be returned only if current row and column are not skipped.
  69780. return outValue || this.next();
  69781. }
  69782. /**
  69783. * 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
  69784. * to output.
  69785. *
  69786. * @param {Number} row The row index to skip.
  69787. */
  69788. skipRow( row ) {
  69789. this._skipRows.add( row );
  69790. }
  69791. /**
  69792. * Advances internal cursor to the next row.
  69793. *
  69794. * @private
  69795. * @returns {module:table/tablewalker~TableSlot}
  69796. */
  69797. _advanceToNextRow() {
  69798. this._row++;
  69799. this._rowIndex++;
  69800. this._column = 0;
  69801. this._cellIndex = 0;
  69802. this._nextCellAtColumn = -1;
  69803. return this.next();
  69804. }
  69805. /**
  69806. * Checks if the current row is over {@link #_endRow}.
  69807. *
  69808. * @private
  69809. * @returns {Boolean}
  69810. */
  69811. _isOverEndRow() {
  69812. // If #_endRow is defined skip all rows after it.
  69813. return this._endRow !== undefined && this._row > this._endRow;
  69814. }
  69815. /**
  69816. * Checks if the current cell is over {@link #_endColumn}
  69817. *
  69818. * @private
  69819. * @returns {Boolean}
  69820. */
  69821. _isOverEndColumn() {
  69822. // If #_endColumn is defined skip all cells after it.
  69823. return this._endColumn !== undefined && this._column > this._endColumn;
  69824. }
  69825. /**
  69826. * A common method for formatting the iterator's output value.
  69827. *
  69828. * @private
  69829. * @param {module:engine/model/element~Element} cell The table cell to output.
  69830. * @param {Number} [anchorRow] The row index of a cell anchor slot.
  69831. * @param {Number} [anchorColumn] The column index of a cell anchor slot.
  69832. * @returns {{done: Boolean, value: {cell: *, row: Number, column: *, rowspan: *, colspan: *, cellIndex: Number}}}
  69833. */
  69834. _formatOutValue( cell, anchorRow = this._row, anchorColumn = this._column ) {
  69835. return {
  69836. done: false,
  69837. value: new TableSlot( this, cell, anchorRow, anchorColumn )
  69838. };
  69839. }
  69840. /**
  69841. * Checks if the current slot should be skipped.
  69842. *
  69843. * @private
  69844. * @returns {Boolean}
  69845. */
  69846. _shouldSkipSlot() {
  69847. const rowIsMarkedAsSkipped = this._skipRows.has( this._row );
  69848. const rowIsBeforeStartRow = this._row < this._startRow;
  69849. const columnIsBeforeStartColumn = this._column < this._startColumn;
  69850. const columnIsAfterEndColumn = this._endColumn !== undefined && this._column > this._endColumn;
  69851. return rowIsMarkedAsSkipped || rowIsBeforeStartRow || columnIsBeforeStartColumn || columnIsAfterEndColumn;
  69852. }
  69853. /**
  69854. * Returns the cell element that is spanned over the current cell location.
  69855. *
  69856. * @private
  69857. * @returns {module:engine/model/element~Element}
  69858. */
  69859. _getSpanned() {
  69860. const rowMap = this._spannedCells.get( this._row );
  69861. // No spans for given row.
  69862. if ( !rowMap ) {
  69863. return null;
  69864. }
  69865. // If spans for given rows has entry for column it means that this location if spanned by other cell.
  69866. return rowMap.get( this._column ) || null;
  69867. }
  69868. /**
  69869. * Updates spanned cells map relative to the current cell location and its span dimensions.
  69870. *
  69871. * @private
  69872. * @param {module:engine/model/element~Element} cell A cell that is spanned.
  69873. * @param {Number} rowspan Cell height.
  69874. * @param {Number} colspan Cell width.
  69875. */
  69876. _recordSpans( cell, rowspan, colspan ) {
  69877. const data = {
  69878. cell,
  69879. row: this._row,
  69880. column: this._column
  69881. };
  69882. for ( let rowToUpdate = this._row; rowToUpdate < this._row + rowspan; rowToUpdate++ ) {
  69883. for ( let columnToUpdate = this._column; columnToUpdate < this._column + colspan; columnToUpdate++ ) {
  69884. if ( rowToUpdate != this._row || columnToUpdate != this._column ) {
  69885. this._markSpannedCell( rowToUpdate, columnToUpdate, data );
  69886. }
  69887. }
  69888. }
  69889. }
  69890. /**
  69891. * Marks the cell location as spanned by another cell.
  69892. *
  69893. * @private
  69894. * @param {Number} row The row index of the cell location.
  69895. * @param {Number} column The column index of the cell location.
  69896. * @param {Object} data A spanned cell details (cell element, anchor row and column).
  69897. */
  69898. _markSpannedCell( row, column, data ) {
  69899. if ( !this._spannedCells.has( row ) ) {
  69900. this._spannedCells.set( row, new Map() );
  69901. }
  69902. const rowSpans = this._spannedCells.get( row );
  69903. rowSpans.set( column, data );
  69904. }
  69905. }
  69906. /**
  69907. * An object returned by {@link module:table/tablewalker~TableWalker} when traversing table cells.
  69908. */
  69909. class TableSlot {
  69910. /**
  69911. * Creates an instance of the table walker value.
  69912. *
  69913. * @protected
  69914. * @param {module:table/tablewalker~TableWalker} tableWalker The table walker instance.
  69915. * @param {module:engine/model/element~Element} cell The current table cell.
  69916. * @param {Number} anchorRow The row index of a cell anchor slot.
  69917. * @param {Number} anchorColumn The column index of a cell anchor slot.
  69918. */
  69919. constructor( tableWalker, cell, anchorRow, anchorColumn ) {
  69920. /**
  69921. * The current table cell.
  69922. *
  69923. * @readonly
  69924. * @member {module:engine/model/element~Element}
  69925. */
  69926. this.cell = cell;
  69927. /**
  69928. * The row index of a table slot.
  69929. *
  69930. * @readonly
  69931. * @member {Number}
  69932. */
  69933. this.row = tableWalker._row;
  69934. /**
  69935. * The column index of a table slot.
  69936. *
  69937. * @readonly
  69938. * @member {Number}
  69939. */
  69940. this.column = tableWalker._column;
  69941. /**
  69942. * The row index of a cell anchor slot.
  69943. *
  69944. * @readonly
  69945. * @member {Number}
  69946. */
  69947. this.cellAnchorRow = anchorRow;
  69948. /**
  69949. * The column index of a cell anchor slot.
  69950. *
  69951. * @readonly
  69952. * @member {Number}
  69953. */
  69954. this.cellAnchorColumn = anchorColumn;
  69955. /**
  69956. * The index of the current cell in the parent row.
  69957. *
  69958. * @readonly
  69959. * @member {Number}
  69960. * @private
  69961. */
  69962. this._cellIndex = tableWalker._cellIndex;
  69963. /**
  69964. * The index of the current row element in the table.
  69965. *
  69966. * @readonly
  69967. * @member {Number}
  69968. * @private
  69969. */
  69970. this._rowIndex = tableWalker._rowIndex;
  69971. /**
  69972. * The table element.
  69973. *
  69974. * @readonly
  69975. * @member {module:engine/model/element~Element}
  69976. * @private
  69977. */
  69978. this._table = tableWalker._table;
  69979. }
  69980. /**
  69981. * Whether the cell is anchored in the current slot.
  69982. *
  69983. * @readonly
  69984. * @returns {Boolean}
  69985. */
  69986. get isAnchor() {
  69987. return this.row === this.cellAnchorRow && this.column === this.cellAnchorColumn;
  69988. }
  69989. /**
  69990. * The width of a cell defined by a `colspan` attribute. If the model attribute is not present, it is set to `1`.
  69991. *
  69992. * @readonly
  69993. * @returns {Number}
  69994. */
  69995. get cellWidth() {
  69996. return parseInt( this.cell.getAttribute( 'colspan' ) || 1 );
  69997. }
  69998. /**
  69999. * The height of a cell defined by a `rowspan` attribute. If the model attribute is not present, it is set to `1`.
  70000. *
  70001. * @readonly
  70002. * @returns {Number}
  70003. */
  70004. get cellHeight() {
  70005. return parseInt( this.cell.getAttribute( 'rowspan' ) || 1 );
  70006. }
  70007. /**
  70008. * The index of the current row element in the table.
  70009. *
  70010. * @readonly
  70011. * @returns {Number}
  70012. */
  70013. get rowIndex() {
  70014. return this._rowIndex;
  70015. }
  70016. /**
  70017. * Returns the {@link module:engine/model/position~Position} before the table slot.
  70018. *
  70019. * @returns {module:engine/model/position~Position}
  70020. */
  70021. getPositionBefore() {
  70022. const model = this._table.root.document.model;
  70023. return model.createPositionAt( this._table.getChild( this.row ), this._cellIndex );
  70024. }
  70025. // @if CK_DEBUG // get isSpanned() { throwMissingGetterError( 'isSpanned' ); }
  70026. // @if CK_DEBUG // get colspan() { throwMissingGetterError( 'colspan' ); }
  70027. // @if CK_DEBUG // get rowspan() { throwMissingGetterError( 'rowspan' ); }
  70028. // @if CK_DEBUG // get cellIndex() { throwMissingGetterError( 'cellIndex' ); }
  70029. }
  70030. /**
  70031. * This `TableSlot`'s getter (property) was removed in CKEditor 5 v20.0.0.
  70032. *
  70033. * Check out the new `TableWalker`'s API in the documentation.
  70034. *
  70035. * @error tableslot-getter-removed
  70036. * @param {String} getterName
  70037. */
  70038. // @if CK_DEBUG // function throwMissingGetterError( getterName ) {
  70039. // @if CK_DEBUG // throw new CKEditorError( 'tableslot-getter-removed', this, {
  70040. // @if CK_DEBUG // getterName
  70041. // @if CK_DEBUG // } );
  70042. // @if CK_DEBUG // }
  70043. /***/ }),
  70044. /***/ "./node_modules/@ckeditor/ckeditor5-table/src/ui/inserttableview.js":
  70045. /*!**************************************************************************!*\
  70046. !*** ./node_modules/@ckeditor/ckeditor5-table/src/ui/inserttableview.js ***!
  70047. \**************************************************************************/
  70048. /*! exports provided: default */
  70049. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  70050. "use strict";
  70051. __webpack_require__.r(__webpack_exports__);
  70052. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return InsertTableView; });
  70053. /* harmony import */ var ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/ui */ "./node_modules/ckeditor5/src/ui.js");
  70054. /* harmony import */ var _theme_inserttable_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./../../theme/inserttable.css */ "./node_modules/@ckeditor/ckeditor5-table/theme/inserttable.css");
  70055. /* harmony import */ var _theme_inserttable_css__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_theme_inserttable_css__WEBPACK_IMPORTED_MODULE_1__);
  70056. /**
  70057. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  70058. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  70059. */
  70060. /**
  70061. * @module table/ui/inserttableview
  70062. */
  70063. /**
  70064. * The table size view.
  70065. *
  70066. * It renders a 10x10 grid to choose the inserted table size.
  70067. *
  70068. * @extends module:ui/view~View
  70069. * @implements module:ui/dropdown/dropdownpanelfocusable~DropdownPanelFocusable
  70070. */
  70071. class InsertTableView extends ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_0__["View"] {
  70072. /**
  70073. * @inheritDoc
  70074. */
  70075. constructor( locale ) {
  70076. super( locale );
  70077. const bind = this.bindTemplate;
  70078. /**
  70079. * A collection of table size box items.
  70080. *
  70081. * @readonly
  70082. * @member {module:ui/viewcollection~ViewCollection}
  70083. */
  70084. this.items = this._createGridCollection();
  70085. /**
  70086. * The currently selected number of rows of the new table.
  70087. *
  70088. * @observable
  70089. * @member {Number} #rows
  70090. */
  70091. this.set( 'rows', 0 );
  70092. /**
  70093. * The currently selected number of columns of the new table.
  70094. *
  70095. * @observable
  70096. * @member {Number} #columns
  70097. */
  70098. this.set( 'columns', 0 );
  70099. /**
  70100. * The label text displayed under the boxes.
  70101. *
  70102. * @observable
  70103. * @member {String} #label
  70104. */
  70105. this.bind( 'label' )
  70106. .to( this, 'columns', this, 'rows', ( columns, rows ) => `${ rows } × ${ columns }` );
  70107. this.setTemplate( {
  70108. tag: 'div',
  70109. attributes: {
  70110. class: [ 'ck' ]
  70111. },
  70112. children: [
  70113. {
  70114. tag: 'div',
  70115. attributes: {
  70116. class: [ 'ck-insert-table-dropdown__grid' ]
  70117. },
  70118. on: {
  70119. 'mouseover@.ck-insert-table-dropdown-grid-box': bind.to( 'boxover' )
  70120. },
  70121. children: this.items
  70122. },
  70123. {
  70124. tag: 'div',
  70125. attributes: {
  70126. class: [ 'ck-insert-table-dropdown__label' ]
  70127. },
  70128. children: [
  70129. {
  70130. text: bind.to( 'label' )
  70131. }
  70132. ]
  70133. }
  70134. ],
  70135. on: {
  70136. mousedown: bind.to( evt => {
  70137. evt.preventDefault();
  70138. } ),
  70139. click: bind.to( () => {
  70140. this.fire( 'execute' );
  70141. } )
  70142. }
  70143. } );
  70144. this.on( 'boxover', ( evt, domEvt ) => {
  70145. const { row, column } = domEvt.target.dataset;
  70146. // As row & column indexes are zero-based transform it to number of selected rows & columns.
  70147. this.set( {
  70148. rows: parseInt( row ),
  70149. columns: parseInt( column )
  70150. } );
  70151. } );
  70152. this.on( 'change:columns', () => {
  70153. this._highlightGridBoxes();
  70154. } );
  70155. this.on( 'change:rows', () => {
  70156. this._highlightGridBoxes();
  70157. } );
  70158. }
  70159. /**
  70160. * @inheritDoc
  70161. */
  70162. focus() {
  70163. // The dropdown panel expects DropdownPanelFocusable interface on views passed to dropdown panel. See #30.
  70164. // The method should be implemented while working on keyboard support for this view. See #22.
  70165. }
  70166. /**
  70167. * @inheritDoc
  70168. */
  70169. focusLast() {
  70170. // The dropdown panel expects DropdownPanelFocusable interface on views passed to dropdown panel. See #30.
  70171. // The method should be implemented while working on keyboard support for this view. See #22.
  70172. }
  70173. /**
  70174. * Highlights grid boxes depending on rows and columns selected.
  70175. *
  70176. * @private
  70177. */
  70178. _highlightGridBoxes() {
  70179. const rows = this.rows;
  70180. const columns = this.columns;
  70181. this.items.map( ( boxView, index ) => {
  70182. // Translate box index to the row & column index.
  70183. const itemRow = Math.floor( index / 10 );
  70184. const itemColumn = index % 10;
  70185. // Grid box is highlighted when its row & column index belongs to selected number of rows & columns.
  70186. const isOn = itemRow < rows && itemColumn < columns;
  70187. boxView.set( 'isOn', isOn );
  70188. } );
  70189. }
  70190. /**
  70191. * @private
  70192. * @returns {module:ui/viewcollection~ViewCollection} A view collection containing boxes to be placed in a table grid.
  70193. */
  70194. _createGridCollection() {
  70195. const boxes = [];
  70196. // Add grid boxes to table selection view.
  70197. for ( let index = 0; index < 100; index++ ) {
  70198. const row = Math.floor( index / 10 );
  70199. const column = index % 10;
  70200. boxes.push( new TableSizeGridBoxView( this.locale, row + 1, column + 1 ) );
  70201. }
  70202. return this.createCollection( boxes );
  70203. }
  70204. /**
  70205. * Fired when the mouse hover over one of the {@link #items child grid boxes}.
  70206. *
  70207. * @event boxover
  70208. */
  70209. }
  70210. /**
  70211. * A single grid box view element.
  70212. *
  70213. * This class is used to render the table size selection grid in {@link module:table/ui/inserttableview~InsertTableView}.
  70214. *
  70215. * @private
  70216. */
  70217. class TableSizeGridBoxView extends ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_0__["View"] {
  70218. /**
  70219. * @inheritDoc
  70220. */
  70221. constructor( locale, row, column ) {
  70222. super( locale );
  70223. const bind = this.bindTemplate;
  70224. /**
  70225. * Controls whether the grid box view is "on".
  70226. *
  70227. * @observable
  70228. * @member {Boolean} #isOn
  70229. */
  70230. this.set( 'isOn', false );
  70231. this.setTemplate( {
  70232. tag: 'div',
  70233. attributes: {
  70234. class: [
  70235. 'ck-insert-table-dropdown-grid-box',
  70236. bind.if( 'isOn', 'ck-on' )
  70237. ],
  70238. 'data-row': row,
  70239. 'data-column': column
  70240. }
  70241. } );
  70242. }
  70243. }
  70244. /***/ }),
  70245. /***/ "./node_modules/@ckeditor/ckeditor5-table/src/utils/common.js":
  70246. /*!********************************************************************!*\
  70247. !*** ./node_modules/@ckeditor/ckeditor5-table/src/utils/common.js ***!
  70248. \********************************************************************/
  70249. /*! exports provided: updateNumericAttribute, createEmptyTableCell, isHeadingColumnCell */
  70250. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  70251. "use strict";
  70252. __webpack_require__.r(__webpack_exports__);
  70253. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "updateNumericAttribute", function() { return updateNumericAttribute; });
  70254. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createEmptyTableCell", function() { return createEmptyTableCell; });
  70255. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isHeadingColumnCell", function() { return isHeadingColumnCell; });
  70256. /**
  70257. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  70258. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  70259. */
  70260. /**
  70261. * @module table/utils/common
  70262. */
  70263. /**
  70264. * A common method to update the numeric value. If a value is the default one, it will be unset.
  70265. *
  70266. * @param {String} key An attribute key.
  70267. * @param {*} value The new attribute value.
  70268. * @param {module:engine/model/item~Item} item A model item on which the attribute will be set.
  70269. * @param {module:engine/model/writer~Writer} writer
  70270. * @param {*} defaultValue The default attribute value. If a value is lower or equal, it will be unset.
  70271. */
  70272. function updateNumericAttribute( key, value, item, writer, defaultValue = 1 ) {
  70273. if ( value > defaultValue ) {
  70274. writer.setAttribute( key, value, item );
  70275. } else {
  70276. writer.removeAttribute( key, item );
  70277. }
  70278. }
  70279. /**
  70280. * 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.
  70281. *
  70282. * @param {module:engine/model/writer~Writer} writer The model writer.
  70283. * @param {module:engine/model/position~Position} insertPosition The position at which the table cell should be inserted.
  70284. * @param {Object} attributes The element attributes.
  70285. * @returns {module:engine/model/element~Element} Created table cell.
  70286. */
  70287. function createEmptyTableCell( writer, insertPosition, attributes = {} ) {
  70288. const tableCell = writer.createElement( 'tableCell', attributes );
  70289. writer.insertElement( 'paragraph', tableCell );
  70290. writer.insert( tableCell, insertPosition );
  70291. return tableCell;
  70292. }
  70293. /**
  70294. * Checks if a table cell belongs to the heading column section.
  70295. *
  70296. * @param {module:table/tableutils~TableUtils} tableUtils
  70297. * @param {module:engine/model/element~Element} tableCell
  70298. * @returns {Boolean}
  70299. */
  70300. function isHeadingColumnCell( tableUtils, tableCell ) {
  70301. const table = tableCell.parent.parent;
  70302. const headingColumns = parseInt( table.getAttribute( 'headingColumns' ) || 0 );
  70303. const { column } = tableUtils.getCellLocation( tableCell );
  70304. return !!headingColumns && column < headingColumns;
  70305. }
  70306. /***/ }),
  70307. /***/ "./node_modules/@ckeditor/ckeditor5-table/src/utils/selection.js":
  70308. /*!***********************************************************************!*\
  70309. !*** ./node_modules/@ckeditor/ckeditor5-table/src/utils/selection.js ***!
  70310. \***********************************************************************/
  70311. /*! exports provided: getSelectedTableCells, getTableCellsContainingSelection, getSelectionAffectedTableCells, getRowIndexes, getColumnIndexes, isSelectionRectangular, sortRanges */
  70312. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  70313. "use strict";
  70314. __webpack_require__.r(__webpack_exports__);
  70315. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getSelectedTableCells", function() { return getSelectedTableCells; });
  70316. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getTableCellsContainingSelection", function() { return getTableCellsContainingSelection; });
  70317. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getSelectionAffectedTableCells", function() { return getSelectionAffectedTableCells; });
  70318. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getRowIndexes", function() { return getRowIndexes; });
  70319. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getColumnIndexes", function() { return getColumnIndexes; });
  70320. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isSelectionRectangular", function() { return isSelectionRectangular; });
  70321. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "sortRanges", function() { return sortRanges; });
  70322. /* harmony import */ var _tablewalker__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../tablewalker */ "./node_modules/@ckeditor/ckeditor5-table/src/tablewalker.js");
  70323. /**
  70324. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  70325. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  70326. */
  70327. /**
  70328. * @module table/utils/selection
  70329. */
  70330. /**
  70331. * Returns all model table cells that are fully selected (from the outside)
  70332. * within the provided model selection's ranges.
  70333. *
  70334. * To obtain the cells selected from the inside, use
  70335. * {@link module:table/utils/selection~getTableCellsContainingSelection}.
  70336. *
  70337. * @param {module:engine/model/selection~Selection} selection
  70338. * @returns {Array.<module:engine/model/element~Element>}
  70339. */
  70340. function getSelectedTableCells( selection ) {
  70341. const cells = [];
  70342. for ( const range of sortRanges( selection.getRanges() ) ) {
  70343. const element = range.getContainedElement();
  70344. if ( element && element.is( 'element', 'tableCell' ) ) {
  70345. cells.push( element );
  70346. }
  70347. }
  70348. return cells;
  70349. }
  70350. /**
  70351. * Returns all model table cells that the provided model selection's ranges
  70352. * {@link module:engine/model/range~Range#start} inside.
  70353. *
  70354. * To obtain the cells selected from the outside, use
  70355. * {@link module:table/utils/selection~getSelectedTableCells}.
  70356. *
  70357. * @param {module:engine/model/selection~Selection} selection
  70358. * @returns {Array.<module:engine/model/element~Element>}
  70359. */
  70360. function getTableCellsContainingSelection( selection ) {
  70361. const cells = [];
  70362. for ( const range of selection.getRanges() ) {
  70363. const cellWithSelection = range.start.findAncestor( 'tableCell' );
  70364. if ( cellWithSelection ) {
  70365. cells.push( cellWithSelection );
  70366. }
  70367. }
  70368. return cells;
  70369. }
  70370. /**
  70371. * Returns all model table cells that are either completely selected
  70372. * by selection ranges or host selection range
  70373. * {@link module:engine/model/range~Range#start start positions} inside them.
  70374. *
  70375. * Combines {@link module:table/utils/selection~getTableCellsContainingSelection} and
  70376. * {@link module:table/utils/selection~getSelectedTableCells}.
  70377. *
  70378. * @param {module:engine/model/selection~Selection} selection
  70379. * @returns {Array.<module:engine/model/element~Element>}
  70380. */
  70381. function getSelectionAffectedTableCells( selection ) {
  70382. const selectedCells = getSelectedTableCells( selection );
  70383. if ( selectedCells.length ) {
  70384. return selectedCells;
  70385. }
  70386. return getTableCellsContainingSelection( selection );
  70387. }
  70388. /**
  70389. * Returns an object with the `first` and `last` row index contained in the given `tableCells`.
  70390. *
  70391. * const selectedTableCells = getSelectedTableCells( editor.model.document.selection );
  70392. *
  70393. * const { first, last } = getRowIndexes( selectedTableCells );
  70394. *
  70395. * console.log( `Selected rows: ${ first } to ${ last }` );
  70396. *
  70397. * @param {Array.<module:engine/model/element~Element>} tableCells
  70398. * @returns {Object} Returns an object with the `first` and `last` table row indexes.
  70399. */
  70400. function getRowIndexes( tableCells ) {
  70401. const indexes = tableCells.map( cell => cell.parent.index );
  70402. return getFirstLastIndexesObject( indexes );
  70403. }
  70404. /**
  70405. * Returns an object with the `first` and `last` column index contained in the given `tableCells`.
  70406. *
  70407. * const selectedTableCells = getSelectedTableCells( editor.model.document.selection );
  70408. *
  70409. * const { first, last } = getColumnIndexes( selectedTableCells );
  70410. *
  70411. * console.log( `Selected columns: ${ first } to ${ last }` );
  70412. *
  70413. * @param {Array.<module:engine/model/element~Element>} tableCells
  70414. * @returns {Object} Returns an object with the `first` and `last` table column indexes.
  70415. */
  70416. function getColumnIndexes( tableCells ) {
  70417. const table = tableCells[ 0 ].findAncestor( 'table' );
  70418. const tableMap = [ ...new _tablewalker__WEBPACK_IMPORTED_MODULE_0__["default"]( table ) ];
  70419. const indexes = tableMap
  70420. .filter( entry => tableCells.includes( entry.cell ) )
  70421. .map( entry => entry.column );
  70422. return getFirstLastIndexesObject( indexes );
  70423. }
  70424. /**
  70425. * Checks if the selection contains cells that do not exceed rectangular selection.
  70426. *
  70427. * In a table below:
  70428. *
  70429. * ┌───┬───┬───┬───┐
  70430. * │ a │ b │ c │ d │
  70431. * ├───┴───┼───┤ │
  70432. * │ e │ f │ │
  70433. * │ ├───┼───┤
  70434. * │ │ g │ h │
  70435. * └───────┴───┴───┘
  70436. *
  70437. * Valid selections are these which create a solid rectangle (without gaps), such as:
  70438. * - a, b (two horizontal cells)
  70439. * - c, f (two vertical cells)
  70440. * - a, b, e (cell "e" spans over four cells)
  70441. * - c, d, f (cell d spans over a cell in the row below)
  70442. *
  70443. * While an invalid selection would be:
  70444. * - a, c (the unselected cell "b" creates a gap)
  70445. * - f, g, h (cell "d" spans over a cell from the row of "f" cell - thus creates a gap)
  70446. *
  70447. * @param {Array.<module:engine/model/element~Element>} selectedTableCells
  70448. * @param {module:table/tableutils~TableUtils} tableUtils
  70449. * @returns {Boolean}
  70450. */
  70451. function isSelectionRectangular( selectedTableCells, tableUtils ) {
  70452. if ( selectedTableCells.length < 2 || !areCellInTheSameTableSection( selectedTableCells ) ) {
  70453. return false;
  70454. }
  70455. // A valid selection is a fully occupied rectangle composed of table cells.
  70456. // Below we will calculate the area of a selected table cells and the area of valid selection.
  70457. // The area of a valid selection is defined by top-left and bottom-right cells.
  70458. const rows = new Set();
  70459. const columns = new Set();
  70460. let areaOfSelectedCells = 0;
  70461. for ( const tableCell of selectedTableCells ) {
  70462. const { row, column } = tableUtils.getCellLocation( tableCell );
  70463. const rowspan = parseInt( tableCell.getAttribute( 'rowspan' ) || 1 );
  70464. const colspan = parseInt( tableCell.getAttribute( 'colspan' ) || 1 );
  70465. // Record row & column indexes of current cell.
  70466. rows.add( row );
  70467. columns.add( column );
  70468. // For cells that spans over multiple rows add also the last row that this cell spans over.
  70469. if ( rowspan > 1 ) {
  70470. rows.add( row + rowspan - 1 );
  70471. }
  70472. // For cells that spans over multiple columns add also the last column that this cell spans over.
  70473. if ( colspan > 1 ) {
  70474. columns.add( column + colspan - 1 );
  70475. }
  70476. areaOfSelectedCells += ( rowspan * colspan );
  70477. }
  70478. // We can only merge table cells that are in adjacent rows...
  70479. const areaOfValidSelection = getBiggestRectangleArea( rows, columns );
  70480. return areaOfValidSelection == areaOfSelectedCells;
  70481. }
  70482. /**
  70483. * Returns array of sorted ranges.
  70484. *
  70485. * @param {Iterable.<module:engine/model/range~Range>} ranges
  70486. * @return {Array.<module:engine/model/range~Range>}
  70487. */
  70488. function sortRanges( ranges ) {
  70489. return Array.from( ranges ).sort( compareRangeOrder );
  70490. }
  70491. // Helper method to get an object with `first` and `last` indexes from an unsorted array of indexes.
  70492. function getFirstLastIndexesObject( indexes ) {
  70493. const allIndexesSorted = indexes.sort( ( indexA, indexB ) => indexA - indexB );
  70494. const first = allIndexesSorted[ 0 ];
  70495. const last = allIndexesSorted[ allIndexesSorted.length - 1 ];
  70496. return { first, last };
  70497. }
  70498. function compareRangeOrder( rangeA, rangeB ) {
  70499. // Since table cell ranges are disjoint, it's enough to check their start positions.
  70500. const posA = rangeA.start;
  70501. const posB = rangeB.start;
  70502. // Checking for equal position (returning 0) is not needed because this would be either:
  70503. // a. Intersecting range (not allowed by model)
  70504. // b. Collapsed range on the same position (allowed by model but should not happen).
  70505. return posA.isBefore( posB ) ? -1 : 1;
  70506. }
  70507. // Calculates the area of a maximum rectangle that can span over the provided row & column indexes.
  70508. //
  70509. // @param {Array.<Number>} rows
  70510. // @param {Array.<Number>} columns
  70511. // @returns {Number}
  70512. function getBiggestRectangleArea( rows, columns ) {
  70513. const rowsIndexes = Array.from( rows.values() );
  70514. const columnIndexes = Array.from( columns.values() );
  70515. const lastRow = Math.max( ...rowsIndexes );
  70516. const firstRow = Math.min( ...rowsIndexes );
  70517. const lastColumn = Math.max( ...columnIndexes );
  70518. const firstColumn = Math.min( ...columnIndexes );
  70519. return ( lastRow - firstRow + 1 ) * ( lastColumn - firstColumn + 1 );
  70520. }
  70521. // Checks if the selection does not mix a header (column or row) with other cells.
  70522. //
  70523. // For instance, in the table below valid selections consist of cells with the same letter only.
  70524. // So, a-a (same heading row and column) or d-d (body cells) are valid while c-d or a-b are not.
  70525. //
  70526. // header columns
  70527. // ↓ ↓
  70528. // ┌───┬───┬───┬───┐
  70529. // │ a │ a │ b │ b │ ← header row
  70530. // ├───┼───┼───┼───┤
  70531. // │ c │ c │ d │ d │
  70532. // ├───┼───┼───┼───┤
  70533. // │ c │ c │ d │ d │
  70534. // └───┴───┴───┴───┘
  70535. function areCellInTheSameTableSection( tableCells ) {
  70536. const table = tableCells[ 0 ].findAncestor( 'table' );
  70537. const rowIndexes = getRowIndexes( tableCells );
  70538. const headingRows = parseInt( table.getAttribute( 'headingRows' ) || 0 );
  70539. // Calculating row indexes is a bit cheaper so if this check fails we can't merge.
  70540. if ( !areIndexesInSameSection( rowIndexes, headingRows ) ) {
  70541. return false;
  70542. }
  70543. const headingColumns = parseInt( table.getAttribute( 'headingColumns' ) || 0 );
  70544. const columnIndexes = getColumnIndexes( tableCells );
  70545. // Similarly cells must be in same column section.
  70546. return areIndexesInSameSection( columnIndexes, headingColumns );
  70547. }
  70548. // Unified check if table rows/columns indexes are in the same heading/body section.
  70549. function areIndexesInSameSection( { first, last }, headingSectionSize ) {
  70550. const firstCellIsInHeading = first < headingSectionSize;
  70551. const lastCellIsInHeading = last < headingSectionSize;
  70552. return firstCellIsInHeading === lastCellIsInHeading;
  70553. }
  70554. /***/ }),
  70555. /***/ "./node_modules/@ckeditor/ckeditor5-table/src/utils/structure.js":
  70556. /*!***********************************************************************!*\
  70557. !*** ./node_modules/@ckeditor/ckeditor5-table/src/utils/structure.js ***!
  70558. \***********************************************************************/
  70559. /*! exports provided: cropTableToDimensions, getVerticallyOverlappingCells, splitHorizontally, getHorizontallyOverlappingCells, splitVertically, trimTableCellIfNeeded, removeEmptyColumns, removeEmptyRows, removeEmptyRowsColumns, adjustLastRowIndex, adjustLastColumnIndex */
  70560. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  70561. "use strict";
  70562. __webpack_require__.r(__webpack_exports__);
  70563. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "cropTableToDimensions", function() { return cropTableToDimensions; });
  70564. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getVerticallyOverlappingCells", function() { return getVerticallyOverlappingCells; });
  70565. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "splitHorizontally", function() { return splitHorizontally; });
  70566. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getHorizontallyOverlappingCells", function() { return getHorizontallyOverlappingCells; });
  70567. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "splitVertically", function() { return splitVertically; });
  70568. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "trimTableCellIfNeeded", function() { return trimTableCellIfNeeded; });
  70569. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "removeEmptyColumns", function() { return removeEmptyColumns; });
  70570. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "removeEmptyRows", function() { return removeEmptyRows; });
  70571. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "removeEmptyRowsColumns", function() { return removeEmptyRowsColumns; });
  70572. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "adjustLastRowIndex", function() { return adjustLastRowIndex; });
  70573. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "adjustLastColumnIndex", function() { return adjustLastColumnIndex; });
  70574. /* harmony import */ var _tablewalker__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../tablewalker */ "./node_modules/@ckeditor/ckeditor5-table/src/tablewalker.js");
  70575. /* harmony import */ var _common__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./common */ "./node_modules/@ckeditor/ckeditor5-table/src/utils/common.js");
  70576. /**
  70577. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  70578. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  70579. */
  70580. /**
  70581. * @module table/utils/structure
  70582. */
  70583. /**
  70584. * Returns a cropped table according to given dimensions.
  70585. * To return a cropped table that starts at first row and first column and end in third row and column:
  70586. *
  70587. * const croppedTable = cropTableToDimensions( table, {
  70588. * startRow: 1,
  70589. * endRow: 3,
  70590. * startColumn: 1,
  70591. * endColumn: 3
  70592. * }, writer );
  70593. *
  70594. * Calling the code above for the table below:
  70595. *
  70596. * 0 1 2 3 4 0 1 2
  70597. * ┌───┬───┬───┬───┬───┐
  70598. * 0 │ a │ b │ c │ d │ e │
  70599. * ├───┴───┤ ├───┴───┤ ┌───┬───┬───┐
  70600. * 1 │ f │ │ g │ │ │ │ g │ 0
  70601. * ├───┬───┴───┼───┬───┤ will return: ├───┴───┼───┤
  70602. * 2 │ h │ i │ j │ k │ │ i │ j │ 1
  70603. * ├───┤ ├───┤ │ │ ├───┤
  70604. * 3 │ l │ │ m │ │ │ │ m │ 2
  70605. * ├───┼───┬───┤ ├───┤ └───────┴───┘
  70606. * 4 │ n │ o │ p │ │ q │
  70607. * └───┴───┴───┴───┴───┘
  70608. *
  70609. * @param {module:engine/model/element~Element} sourceTable
  70610. * @param {Object} cropDimensions
  70611. * @param {Number} cropDimensions.startRow
  70612. * @param {Number} cropDimensions.startColumn
  70613. * @param {Number} cropDimensions.endRow
  70614. * @param {Number} cropDimensions.endColumn
  70615. * @param {module:engine/model/writer~Writer} writer
  70616. * @returns {module:engine/model/element~Element}
  70617. */
  70618. function cropTableToDimensions( sourceTable, cropDimensions, writer ) {
  70619. const { startRow, startColumn, endRow, endColumn } = cropDimensions;
  70620. // Create empty table with empty rows equal to crop height.
  70621. const croppedTable = writer.createElement( 'table' );
  70622. const cropHeight = endRow - startRow + 1;
  70623. for ( let i = 0; i < cropHeight; i++ ) {
  70624. writer.insertElement( 'tableRow', croppedTable, 'end' );
  70625. }
  70626. const tableMap = [ ...new _tablewalker__WEBPACK_IMPORTED_MODULE_0__["default"]( sourceTable, { startRow, endRow, startColumn, endColumn, includeAllSlots: true } ) ];
  70627. // Iterate over source table slots (including empty - spanned - ones).
  70628. for ( const { row: sourceRow, column: sourceColumn, cell: tableCell, isAnchor, cellAnchorRow, cellAnchorColumn } of tableMap ) {
  70629. // Row index in cropped table.
  70630. const rowInCroppedTable = sourceRow - startRow;
  70631. const row = croppedTable.getChild( rowInCroppedTable );
  70632. // For empty slots: fill the gap with empty table cell.
  70633. if ( !isAnchor ) {
  70634. // But fill the gap only if the spanning cell is anchored outside cropped area.
  70635. // In the table from method jsdoc those cells are: "c" & "f".
  70636. if ( cellAnchorRow < startRow || cellAnchorColumn < startColumn ) {
  70637. Object(_common__WEBPACK_IMPORTED_MODULE_1__["createEmptyTableCell"])( writer, writer.createPositionAt( row, 'end' ) );
  70638. }
  70639. }
  70640. // Otherwise clone the cell with all children and trim if it exceeds cropped area.
  70641. else {
  70642. const tableCellCopy = writer.cloneElement( tableCell );
  70643. writer.append( tableCellCopy, row );
  70644. // Trim table if it exceeds cropped area.
  70645. // In the table from method jsdoc those cells are: "g" & "m".
  70646. trimTableCellIfNeeded( tableCellCopy, sourceRow, sourceColumn, endRow, endColumn, writer );
  70647. }
  70648. }
  70649. // Adjust heading rows & columns in cropped table if crop selection includes headings parts.
  70650. addHeadingsToCroppedTable( croppedTable, sourceTable, startRow, startColumn, writer );
  70651. return croppedTable;
  70652. }
  70653. /**
  70654. * Returns slot info of cells that starts above and overlaps a given row.
  70655. *
  70656. * In a table below, passing `overlapRow = 3`
  70657. *
  70658. * ┌───┬───┬───┬───┬───┐
  70659. * 0 │ a │ b │ c │ d │ e │
  70660. * │ ├───┼───┼───┼───┤
  70661. * 1 │ │ f │ g │ h │ i │
  70662. * ├───┤ ├───┼───┤ │
  70663. * 2 │ j │ │ k │ l │ │
  70664. * │ │ │ ├───┼───┤
  70665. * 3 │ │ │ │ m │ n │ <- overlap row to check
  70666. * ├───┼───┤ │ ├───│
  70667. * 4 │ o │ p │ │ │ q │
  70668. * └───┴───┴───┴───┴───┘
  70669. *
  70670. * will return slot info for cells: "j", "f", "k".
  70671. *
  70672. * @param {module:engine/model/element~Element} table The table to check.
  70673. * @param {Number} overlapRow The index of the row to check.
  70674. * @param {Number} [startRow=0] A row to start analysis. Use it when it is known that the cells above that row will not overlap.
  70675. * @returns {Array.<module:table/tablewalker~TableSlot>}
  70676. */
  70677. function getVerticallyOverlappingCells( table, overlapRow, startRow = 0 ) {
  70678. const cells = [];
  70679. const tableWalker = new _tablewalker__WEBPACK_IMPORTED_MODULE_0__["default"]( table, { startRow, endRow: overlapRow - 1 } );
  70680. for ( const slotInfo of tableWalker ) {
  70681. const { row, cellHeight } = slotInfo;
  70682. const cellEndRow = row + cellHeight - 1;
  70683. if ( row < overlapRow && overlapRow <= cellEndRow ) {
  70684. cells.push( slotInfo );
  70685. }
  70686. }
  70687. return cells;
  70688. }
  70689. /**
  70690. * Splits the table cell horizontally.
  70691. *
  70692. * @param {module:engine/model/element~Element} tableCell
  70693. * @param {Number} splitRow
  70694. * @param {module:engine/model/writer~Writer} writer
  70695. * @returns {module:engine/model/element~Element} Created table cell.
  70696. */
  70697. function splitHorizontally( tableCell, splitRow, writer ) {
  70698. const tableRow = tableCell.parent;
  70699. const table = tableRow.parent;
  70700. const rowIndex = tableRow.index;
  70701. const rowspan = parseInt( tableCell.getAttribute( 'rowspan' ) );
  70702. const newRowspan = splitRow - rowIndex;
  70703. const newCellAttributes = {};
  70704. const newCellRowSpan = rowspan - newRowspan;
  70705. if ( newCellRowSpan > 1 ) {
  70706. newCellAttributes.rowspan = newCellRowSpan;
  70707. }
  70708. const colspan = parseInt( tableCell.getAttribute( 'colspan' ) || 1 );
  70709. if ( colspan > 1 ) {
  70710. newCellAttributes.colspan = colspan;
  70711. }
  70712. const startRow = rowIndex;
  70713. const endRow = startRow + newRowspan;
  70714. const tableMap = [ ...new _tablewalker__WEBPACK_IMPORTED_MODULE_0__["default"]( table, { startRow, endRow, includeAllSlots: true } ) ];
  70715. let newCell = null;
  70716. let columnIndex;
  70717. for ( const tableSlot of tableMap ) {
  70718. const { row, column, cell } = tableSlot;
  70719. if ( cell === tableCell && columnIndex === undefined ) {
  70720. columnIndex = column;
  70721. }
  70722. if ( columnIndex !== undefined && columnIndex === column && row === endRow ) {
  70723. newCell = Object(_common__WEBPACK_IMPORTED_MODULE_1__["createEmptyTableCell"])( writer, tableSlot.getPositionBefore(), newCellAttributes );
  70724. }
  70725. }
  70726. // Update the rowspan attribute after updating table.
  70727. Object(_common__WEBPACK_IMPORTED_MODULE_1__["updateNumericAttribute"])( 'rowspan', newRowspan, tableCell, writer );
  70728. return newCell;
  70729. }
  70730. /**
  70731. * Returns slot info of cells that starts before and overlaps a given column.
  70732. *
  70733. * In a table below, passing `overlapColumn = 3`
  70734. *
  70735. * 0 1 2 3 4
  70736. * ┌───────┬───────┬───┐
  70737. * │ a │ b │ c │
  70738. * │───┬───┴───────┼───┤
  70739. * │ d │ e │ f │
  70740. * ├───┼───┬───────┴───┤
  70741. * │ g │ h │ i │
  70742. * ├───┼───┼───┬───────┤
  70743. * │ j │ k │ l │ m │
  70744. * ├───┼───┴───┼───┬───┤
  70745. * │ n │ o │ p │ q │
  70746. * └───┴───────┴───┴───┘
  70747. * ^
  70748. * Overlap column to check
  70749. *
  70750. * will return slot info for cells: "b", "e", "i".
  70751. *
  70752. * @param {module:engine/model/element~Element} table The table to check.
  70753. * @param {Number} overlapColumn The index of the column to check.
  70754. * @returns {Array.<module:table/tablewalker~TableSlot>}
  70755. */
  70756. function getHorizontallyOverlappingCells( table, overlapColumn ) {
  70757. const cellsToSplit = [];
  70758. const tableWalker = new _tablewalker__WEBPACK_IMPORTED_MODULE_0__["default"]( table );
  70759. for ( const slotInfo of tableWalker ) {
  70760. const { column, cellWidth } = slotInfo;
  70761. const cellEndColumn = column + cellWidth - 1;
  70762. if ( column < overlapColumn && overlapColumn <= cellEndColumn ) {
  70763. cellsToSplit.push( slotInfo );
  70764. }
  70765. }
  70766. return cellsToSplit;
  70767. }
  70768. /**
  70769. * Splits the table cell vertically.
  70770. *
  70771. * @param {module:engine/model/element~Element} tableCell
  70772. * @param {Number} columnIndex The table cell column index.
  70773. * @param {Number} splitColumn The index of column to split cell on.
  70774. * @param {module:engine/model/writer~Writer} writer
  70775. * @returns {module:engine/model/element~Element} Created table cell.
  70776. */
  70777. function splitVertically( tableCell, columnIndex, splitColumn, writer ) {
  70778. const colspan = parseInt( tableCell.getAttribute( 'colspan' ) );
  70779. const newColspan = splitColumn - columnIndex;
  70780. const newCellAttributes = {};
  70781. const newCellColSpan = colspan - newColspan;
  70782. if ( newCellColSpan > 1 ) {
  70783. newCellAttributes.colspan = newCellColSpan;
  70784. }
  70785. const rowspan = parseInt( tableCell.getAttribute( 'rowspan' ) || 1 );
  70786. if ( rowspan > 1 ) {
  70787. newCellAttributes.rowspan = rowspan;
  70788. }
  70789. const newCell = Object(_common__WEBPACK_IMPORTED_MODULE_1__["createEmptyTableCell"])( writer, writer.createPositionAfter( tableCell ), newCellAttributes );
  70790. // Update the colspan attribute after updating table.
  70791. Object(_common__WEBPACK_IMPORTED_MODULE_1__["updateNumericAttribute"])( 'colspan', newColspan, tableCell, writer );
  70792. return newCell;
  70793. }
  70794. /**
  70795. * Adjusts table cell dimensions to not exceed limit row and column.
  70796. *
  70797. * If table cell width (or height) covers a column (or row) that is after a limit column (or row)
  70798. * this method will trim "colspan" (or "rowspan") attribute so the table cell will fit in a defined limits.
  70799. *
  70800. * @param {module:engine/model/element~Element} tableCell
  70801. * @param {Number} cellRow
  70802. * @param {Number} cellColumn
  70803. * @param {Number} limitRow
  70804. * @param {Number} limitColumn
  70805. * @param {module:engine/model/writer~Writer} writer
  70806. */
  70807. function trimTableCellIfNeeded( tableCell, cellRow, cellColumn, limitRow, limitColumn, writer ) {
  70808. const colspan = parseInt( tableCell.getAttribute( 'colspan' ) || 1 );
  70809. const rowspan = parseInt( tableCell.getAttribute( 'rowspan' ) || 1 );
  70810. const endColumn = cellColumn + colspan - 1;
  70811. if ( endColumn > limitColumn ) {
  70812. const trimmedSpan = limitColumn - cellColumn + 1;
  70813. Object(_common__WEBPACK_IMPORTED_MODULE_1__["updateNumericAttribute"])( 'colspan', trimmedSpan, tableCell, writer, 1 );
  70814. }
  70815. const endRow = cellRow + rowspan - 1;
  70816. if ( endRow > limitRow ) {
  70817. const trimmedSpan = limitRow - cellRow + 1;
  70818. Object(_common__WEBPACK_IMPORTED_MODULE_1__["updateNumericAttribute"])( 'rowspan', trimmedSpan, tableCell, writer, 1 );
  70819. }
  70820. }
  70821. // Sets proper heading attributes to a cropped table.
  70822. function addHeadingsToCroppedTable( croppedTable, sourceTable, startRow, startColumn, writer ) {
  70823. const headingRows = parseInt( sourceTable.getAttribute( 'headingRows' ) || 0 );
  70824. if ( headingRows > 0 ) {
  70825. const headingRowsInCrop = headingRows - startRow;
  70826. Object(_common__WEBPACK_IMPORTED_MODULE_1__["updateNumericAttribute"])( 'headingRows', headingRowsInCrop, croppedTable, writer, 0 );
  70827. }
  70828. const headingColumns = parseInt( sourceTable.getAttribute( 'headingColumns' ) || 0 );
  70829. if ( headingColumns > 0 ) {
  70830. const headingColumnsInCrop = headingColumns - startColumn;
  70831. Object(_common__WEBPACK_IMPORTED_MODULE_1__["updateNumericAttribute"])( 'headingColumns', headingColumnsInCrop, croppedTable, writer, 0 );
  70832. }
  70833. }
  70834. /**
  70835. * Removes columns that have no cells anchored.
  70836. *
  70837. * In table below:
  70838. *
  70839. * +----+----+----+----+----+----+----+
  70840. * | 00 | 01 | 03 | 04 | 06 |
  70841. * +----+----+----+----+ +----+
  70842. * | 10 | 11 | 13 | | 16 |
  70843. * +----+----+----+----+----+----+----+
  70844. * | 20 | 21 | 23 | 24 | 26 |
  70845. * +----+----+----+----+----+----+----+
  70846. * ^--- empty ---^
  70847. *
  70848. * Will remove columns 2 and 5.
  70849. *
  70850. * **Note:** This is a low-level helper method for clearing invalid model state when doing table modifications.
  70851. * To remove a column from a table use {@link module:table/tableutils~TableUtils#removeColumns `TableUtils.removeColumns()`}.
  70852. *
  70853. * @protected
  70854. * @param {module:engine/model/element~Element} table
  70855. * @param {module:table/tableutils~TableUtils} tableUtils
  70856. * @returns {Boolean} True if removed some columns.
  70857. */
  70858. function removeEmptyColumns( table, tableUtils ) {
  70859. const width = tableUtils.getColumns( table );
  70860. const columnsMap = new Array( width ).fill( 0 );
  70861. for ( const { column } of new _tablewalker__WEBPACK_IMPORTED_MODULE_0__["default"]( table ) ) {
  70862. columnsMap[ column ]++;
  70863. }
  70864. const emptyColumns = columnsMap.reduce( ( result, cellsCount, column ) => {
  70865. return cellsCount ? result : [ ...result, column ];
  70866. }, [] );
  70867. if ( emptyColumns.length > 0 ) {
  70868. // Remove only last empty column because it will recurrently trigger removing empty rows.
  70869. const emptyColumn = emptyColumns[ emptyColumns.length - 1 ];
  70870. // @if CK_DEBUG_TABLE // console.log( `Removing empty column: ${ emptyColumn }.` );
  70871. tableUtils.removeColumns( table, { at: emptyColumn } );
  70872. return true;
  70873. }
  70874. return false;
  70875. }
  70876. /**
  70877. * Removes rows that have no cells anchored.
  70878. *
  70879. * In table below:
  70880. *
  70881. * +----+----+----+
  70882. * | 00 | 01 | 02 |
  70883. * +----+----+----+
  70884. * | 10 | 11 | 12 |
  70885. * + + + +
  70886. * | | | | <-- empty
  70887. * +----+----+----+
  70888. * | 30 | 31 | 32 |
  70889. * +----+----+----+
  70890. * | 40 | 42 |
  70891. * + + +
  70892. * | | | <-- empty
  70893. * +----+----+----+
  70894. * | 60 | 61 | 62 |
  70895. * +----+----+----+
  70896. *
  70897. * Will remove rows 2 and 5.
  70898. *
  70899. * **Note:** This is a low-level helper method for clearing invalid model state when doing table modifications.
  70900. * To remove a row from a table use {@link module:table/tableutils~TableUtils#removeRows `TableUtils.removeRows()`}.
  70901. *
  70902. * @protected
  70903. * @param {module:engine/model/element~Element} table
  70904. * @param {module:table/tableutils~TableUtils} tableUtils
  70905. * @returns {Boolean} True if removed some rows.
  70906. */
  70907. function removeEmptyRows( table, tableUtils ) {
  70908. const emptyRows = [];
  70909. const tableRowCount = tableUtils.getRows( table );
  70910. for ( let rowIndex = 0; rowIndex < tableRowCount; rowIndex++ ) {
  70911. const tableRow = table.getChild( rowIndex );
  70912. if ( tableRow.isEmpty ) {
  70913. emptyRows.push( rowIndex );
  70914. }
  70915. }
  70916. if ( emptyRows.length > 0 ) {
  70917. // Remove only last empty row because it will recurrently trigger removing empty columns.
  70918. const emptyRow = emptyRows[ emptyRows.length - 1 ];
  70919. // @if CK_DEBUG_TABLE // console.log( `Removing empty row: ${ emptyRow }.` );
  70920. tableUtils.removeRows( table, { at: emptyRow } );
  70921. return true;
  70922. }
  70923. return false;
  70924. }
  70925. /**
  70926. * Removes rows and columns that have no cells anchored.
  70927. *
  70928. * In table below:
  70929. *
  70930. * +----+----+----+----+
  70931. * | 00 | 02 |
  70932. * +----+----+ +
  70933. * | 10 | |
  70934. * +----+----+----+----+
  70935. * | 20 | 22 | 23 |
  70936. * + + + +
  70937. * | | | | <-- empty row
  70938. * +----+----+----+----+
  70939. * ^--- empty column
  70940. *
  70941. * Will remove row 3 and column 1.
  70942. *
  70943. * **Note:** This is a low-level helper method for clearing invalid model state when doing table modifications.
  70944. * To remove a rows from a table use {@link module:table/tableutils~TableUtils#removeRows `TableUtils.removeRows()`} and
  70945. * {@link module:table/tableutils~TableUtils#removeColumns `TableUtils.removeColumns()`} to remove a column.
  70946. *
  70947. * @protected
  70948. * @param {module:engine/model/element~Element} table
  70949. * @param {module:table/tableutils~TableUtils} tableUtils
  70950. */
  70951. function removeEmptyRowsColumns( table, tableUtils ) {
  70952. const removedColumns = removeEmptyColumns( table, tableUtils );
  70953. // If there was some columns removed then cleaning empty rows was already triggered.
  70954. if ( !removedColumns ) {
  70955. removeEmptyRows( table, tableUtils );
  70956. }
  70957. }
  70958. /**
  70959. * Returns adjusted last row index if selection covers part of a row with empty slots (spanned by other cells).
  70960. * The `dimensions.lastRow` is equal to last row index but selection might be bigger.
  70961. *
  70962. * This happens *only* on rectangular selection so we analyze a case like this:
  70963. *
  70964. * +---+---+---+---+
  70965. * 0 | a | b | c | d |
  70966. * + + +---+---+
  70967. * 1 | | e | f | g |
  70968. * + +---+ +---+
  70969. * 2 | | h | | i | <- last row, each cell has rowspan = 2,
  70970. * + + + + + so we need to return 3, not 2
  70971. * 3 | | | | |
  70972. * +---+---+---+---+
  70973. *
  70974. * @param {module:engine/model/element~Element} table
  70975. * @param {Object} dimensions
  70976. * @param {Number} dimensions.firstRow
  70977. * @param {Number} dimensions.firstColumn
  70978. * @param {Number} dimensions.lastRow
  70979. * @param {Number} dimensions.lastColumn
  70980. * @returns {Number} Adjusted last row index.
  70981. */
  70982. function adjustLastRowIndex( table, dimensions ) {
  70983. const lastRowMap = Array.from( new _tablewalker__WEBPACK_IMPORTED_MODULE_0__["default"]( table, {
  70984. startColumn: dimensions.firstColumn,
  70985. endColumn: dimensions.lastColumn,
  70986. row: dimensions.lastRow
  70987. } ) );
  70988. const everyCellHasSingleRowspan = lastRowMap.every( ( { cellHeight } ) => cellHeight === 1 );
  70989. // It is a "flat" row, so the last row index is OK.
  70990. if ( everyCellHasSingleRowspan ) {
  70991. return dimensions.lastRow;
  70992. }
  70993. // Otherwise get any cell's rowspan and adjust the last row index.
  70994. const rowspanAdjustment = lastRowMap[ 0 ].cellHeight - 1;
  70995. return dimensions.lastRow + rowspanAdjustment;
  70996. }
  70997. /**
  70998. * Returns adjusted last column index if selection covers part of a column with empty slots (spanned by other cells).
  70999. * The `dimensions.lastColumn` is equal to last column index but selection might be bigger.
  71000. *
  71001. * This happens *only* on rectangular selection so we analyze a case like this:
  71002. *
  71003. * 0 1 2 3
  71004. * +---+---+---+---+
  71005. * | a |
  71006. * +---+---+---+---+
  71007. * | b | c | d |
  71008. * +---+---+---+---+
  71009. * | e | f |
  71010. * +---+---+---+---+
  71011. * | g | h |
  71012. * +---+---+---+---+
  71013. * ^
  71014. * last column, each cell has colspan = 2, so we need to return 3, not 2
  71015. *
  71016. * @param {module:engine/model/element~Element} table
  71017. * @param {Object} dimensions
  71018. * @param {Number} dimensions.firstRow
  71019. * @param {Number} dimensions.firstColumn
  71020. * @param {Number} dimensions.lastRow
  71021. * @param {Number} dimensions.lastColumn
  71022. * @returns {Number} Adjusted last column index.
  71023. */
  71024. function adjustLastColumnIndex( table, dimensions ) {
  71025. const lastColumnMap = Array.from( new _tablewalker__WEBPACK_IMPORTED_MODULE_0__["default"]( table, {
  71026. startRow: dimensions.firstRow,
  71027. endRow: dimensions.lastRow,
  71028. column: dimensions.lastColumn
  71029. } ) );
  71030. const everyCellHasSingleColspan = lastColumnMap.every( ( { cellWidth } ) => cellWidth === 1 );
  71031. // It is a "flat" column, so the last column index is OK.
  71032. if ( everyCellHasSingleColspan ) {
  71033. return dimensions.lastColumn;
  71034. }
  71035. // Otherwise get any cell's colspan and adjust the last column index.
  71036. const colspanAdjustment = lastColumnMap[ 0 ].cellWidth - 1;
  71037. return dimensions.lastColumn + colspanAdjustment;
  71038. }
  71039. /***/ }),
  71040. /***/ "./node_modules/@ckeditor/ckeditor5-table/src/utils/ui/widget.js":
  71041. /*!***********************************************************************!*\
  71042. !*** ./node_modules/@ckeditor/ckeditor5-table/src/utils/ui/widget.js ***!
  71043. \***********************************************************************/
  71044. /*! exports provided: getSelectedTableWidget, getTableWidgetAncestor */
  71045. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  71046. "use strict";
  71047. __webpack_require__.r(__webpack_exports__);
  71048. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getSelectedTableWidget", function() { return getSelectedTableWidget; });
  71049. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getTableWidgetAncestor", function() { return getTableWidgetAncestor; });
  71050. /* harmony import */ var ckeditor5_src_widget__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/widget */ "./node_modules/ckeditor5/src/widget.js");
  71051. /**
  71052. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  71053. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  71054. */
  71055. /**
  71056. * @module table/utils/ui/widget
  71057. */
  71058. /**
  71059. * Returns a table widget editing view element if one is selected.
  71060. *
  71061. * @param {module:engine/view/selection~Selection|module:engine/view/documentselection~DocumentSelection} selection
  71062. * @returns {module:engine/view/element~Element|null}
  71063. */
  71064. function getSelectedTableWidget( selection ) {
  71065. const viewElement = selection.getSelectedElement();
  71066. if ( viewElement && isTableWidget( viewElement ) ) {
  71067. return viewElement;
  71068. }
  71069. return null;
  71070. }
  71071. /**
  71072. * Returns a table widget editing view element if one is among the selection's ancestors.
  71073. *
  71074. * @param {module:engine/view/selection~Selection|module:engine/view/documentselection~DocumentSelection} selection
  71075. * @returns {module:engine/view/element~Element|null}
  71076. */
  71077. function getTableWidgetAncestor( selection ) {
  71078. let parent = selection.getFirstPosition().parent;
  71079. while ( parent ) {
  71080. if ( parent.is( 'element' ) && isTableWidget( parent ) ) {
  71081. return parent;
  71082. }
  71083. parent = parent.parent;
  71084. }
  71085. return null;
  71086. }
  71087. // Checks if a given view element is a table widget.
  71088. //
  71089. // @param {module:engine/view/element~Element} viewElement
  71090. // @returns {Boolean}
  71091. function isTableWidget( viewElement ) {
  71092. return !!viewElement.getCustomProperty( 'table' ) && Object(ckeditor5_src_widget__WEBPACK_IMPORTED_MODULE_0__["isWidget"])( viewElement );
  71093. }
  71094. /***/ }),
  71095. /***/ "./node_modules/@ckeditor/ckeditor5-table/theme/icons/table-column.svg":
  71096. /*!*****************************************************************************!*\
  71097. !*** ./node_modules/@ckeditor/ckeditor5-table/theme/icons/table-column.svg ***!
  71098. \*****************************************************************************/
  71099. /*! exports provided: default */
  71100. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  71101. "use strict";
  71102. __webpack_require__.r(__webpack_exports__);
  71103. /* 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>");
  71104. /***/ }),
  71105. /***/ "./node_modules/@ckeditor/ckeditor5-table/theme/icons/table-merge-cell.svg":
  71106. /*!*********************************************************************************!*\
  71107. !*** ./node_modules/@ckeditor/ckeditor5-table/theme/icons/table-merge-cell.svg ***!
  71108. \*********************************************************************************/
  71109. /*! exports provided: default */
  71110. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  71111. "use strict";
  71112. __webpack_require__.r(__webpack_exports__);
  71113. /* 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>");
  71114. /***/ }),
  71115. /***/ "./node_modules/@ckeditor/ckeditor5-table/theme/icons/table-row.svg":
  71116. /*!**************************************************************************!*\
  71117. !*** ./node_modules/@ckeditor/ckeditor5-table/theme/icons/table-row.svg ***!
  71118. \**************************************************************************/
  71119. /*! exports provided: default */
  71120. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  71121. "use strict";
  71122. __webpack_require__.r(__webpack_exports__);
  71123. /* 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>");
  71124. /***/ }),
  71125. /***/ "./node_modules/@ckeditor/ckeditor5-table/theme/icons/table.svg":
  71126. /*!**********************************************************************!*\
  71127. !*** ./node_modules/@ckeditor/ckeditor5-table/theme/icons/table.svg ***!
  71128. \**********************************************************************/
  71129. /*! exports provided: default */
  71130. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  71131. "use strict";
  71132. __webpack_require__.r(__webpack_exports__);
  71133. /* 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>");
  71134. /***/ }),
  71135. /***/ "./node_modules/@ckeditor/ckeditor5-table/theme/inserttable.css":
  71136. /*!**********************************************************************!*\
  71137. !*** ./node_modules/@ckeditor/ckeditor5-table/theme/inserttable.css ***!
  71138. \**********************************************************************/
  71139. /*! no static exports found */
  71140. /***/ (function(module, exports, __webpack_require__) {
  71141. var api = __webpack_require__(/*! ../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  71142. 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");
  71143. content = content.__esModule ? content.default : content;
  71144. if (typeof content === 'string') {
  71145. content = [[module.i, content, '']];
  71146. }
  71147. var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
  71148. options.insert = "head";
  71149. options.singleton = true;
  71150. var update = api(content, options);
  71151. module.exports = content.locals || {};
  71152. /***/ }),
  71153. /***/ "./node_modules/@ckeditor/ckeditor5-table/theme/table.css":
  71154. /*!****************************************************************!*\
  71155. !*** ./node_modules/@ckeditor/ckeditor5-table/theme/table.css ***!
  71156. \****************************************************************/
  71157. /*! no static exports found */
  71158. /***/ (function(module, exports, __webpack_require__) {
  71159. var api = __webpack_require__(/*! ../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  71160. 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");
  71161. content = content.__esModule ? content.default : content;
  71162. if (typeof content === 'string') {
  71163. content = [[module.i, content, '']];
  71164. }
  71165. var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
  71166. options.insert = "head";
  71167. options.singleton = true;
  71168. var update = api(content, options);
  71169. module.exports = content.locals || {};
  71170. /***/ }),
  71171. /***/ "./node_modules/@ckeditor/ckeditor5-table/theme/tableediting.css":
  71172. /*!***********************************************************************!*\
  71173. !*** ./node_modules/@ckeditor/ckeditor5-table/theme/tableediting.css ***!
  71174. \***********************************************************************/
  71175. /*! no static exports found */
  71176. /***/ (function(module, exports, __webpack_require__) {
  71177. var api = __webpack_require__(/*! ../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  71178. 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");
  71179. content = content.__esModule ? content.default : content;
  71180. if (typeof content === 'string') {
  71181. content = [[module.i, content, '']];
  71182. }
  71183. var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
  71184. options.insert = "head";
  71185. options.singleton = true;
  71186. var update = api(content, options);
  71187. module.exports = content.locals || {};
  71188. /***/ }),
  71189. /***/ "./node_modules/@ckeditor/ckeditor5-table/theme/tableselection.css":
  71190. /*!*************************************************************************!*\
  71191. !*** ./node_modules/@ckeditor/ckeditor5-table/theme/tableselection.css ***!
  71192. \*************************************************************************/
  71193. /*! no static exports found */
  71194. /***/ (function(module, exports, __webpack_require__) {
  71195. var api = __webpack_require__(/*! ../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  71196. 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");
  71197. content = content.__esModule ? content.default : content;
  71198. if (typeof content === 'string') {
  71199. content = [[module.i, content, '']];
  71200. }
  71201. var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
  71202. options.insert = "head";
  71203. options.singleton = true;
  71204. var update = api(content, options);
  71205. module.exports = content.locals || {};
  71206. /***/ }),
  71207. /***/ "./node_modules/@ckeditor/ckeditor5-typing/src/delete.js":
  71208. /*!***************************************************************!*\
  71209. !*** ./node_modules/@ckeditor/ckeditor5-typing/src/delete.js ***!
  71210. \***************************************************************/
  71211. /*! exports provided: default */
  71212. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  71213. "use strict";
  71214. __webpack_require__.r(__webpack_exports__);
  71215. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Delete; });
  71216. /* 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");
  71217. /* harmony import */ var _deletecommand__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./deletecommand */ "./node_modules/@ckeditor/ckeditor5-typing/src/deletecommand.js");
  71218. /* harmony import */ var _deleteobserver__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./deleteobserver */ "./node_modules/@ckeditor/ckeditor5-typing/src/deleteobserver.js");
  71219. /* 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");
  71220. /**
  71221. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  71222. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  71223. */
  71224. /**
  71225. * @module typing/delete
  71226. */
  71227. /**
  71228. * The delete and backspace feature. Handles the <kbd>Delete</kbd> and <kbd>Backspace</kbd> keys in the editor.
  71229. *
  71230. * @extends module:core/plugin~Plugin
  71231. */
  71232. class Delete extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
  71233. /**
  71234. * @inheritDoc
  71235. */
  71236. static get pluginName() {
  71237. return 'Delete';
  71238. }
  71239. init() {
  71240. const editor = this.editor;
  71241. const view = editor.editing.view;
  71242. const viewDocument = view.document;
  71243. view.addObserver( _deleteobserver__WEBPACK_IMPORTED_MODULE_2__["default"] );
  71244. const deleteForwardCommand = new _deletecommand__WEBPACK_IMPORTED_MODULE_1__["default"]( editor, 'forward' );
  71245. // Register `deleteForward` command and add `forwardDelete` command as an alias for backward compatibility.
  71246. editor.commands.add( 'deleteForward', deleteForwardCommand );
  71247. editor.commands.add( 'forwardDelete', deleteForwardCommand );
  71248. editor.commands.add( 'delete', new _deletecommand__WEBPACK_IMPORTED_MODULE_1__["default"]( editor, 'backward' ) );
  71249. this.listenTo( viewDocument, 'delete', ( evt, data ) => {
  71250. const deleteCommandParams = { unit: data.unit, sequence: data.sequence };
  71251. // If a specific (view) selection to remove was set, convert it to a model selection and set as a parameter for `DeleteCommand`.
  71252. if ( data.selectionToRemove ) {
  71253. const modelSelection = editor.model.createSelection();
  71254. const ranges = [];
  71255. for ( const viewRange of data.selectionToRemove.getRanges() ) {
  71256. ranges.push( editor.editing.mapper.toModelRange( viewRange ) );
  71257. }
  71258. modelSelection.setTo( ranges );
  71259. deleteCommandParams.selection = modelSelection;
  71260. }
  71261. editor.execute( data.direction == 'forward' ? 'deleteForward' : 'delete', deleteCommandParams );
  71262. data.preventDefault();
  71263. view.scrollToTheSelection();
  71264. }, { priority: 'low' } );
  71265. // Android IMEs have a quirk - they change DOM selection after the input changes were performed by the browser.
  71266. // This happens on `keyup` event. Android doesn't know anything about our deletion and selection handling. Even if the selection
  71267. // was changed during input events, IME remembers the position where the selection "should" be placed and moves it there.
  71268. //
  71269. // To prevent incorrect selection, we save the selection after deleting here and then re-set it on `keyup`. This has to be done
  71270. // on DOM selection level, because on `keyup` the model selection is still the same as it was just after deletion, so it
  71271. // wouldn't be changed and the fix would do nothing.
  71272. //
  71273. if ( _ckeditor_ckeditor5_utils_src_env__WEBPACK_IMPORTED_MODULE_3__["default"].isAndroid ) {
  71274. let domSelectionAfterDeletion = null;
  71275. this.listenTo( viewDocument, 'delete', ( evt, data ) => {
  71276. const domSelection = data.domTarget.ownerDocument.defaultView.getSelection();
  71277. domSelectionAfterDeletion = {
  71278. anchorNode: domSelection.anchorNode,
  71279. anchorOffset: domSelection.anchorOffset,
  71280. focusNode: domSelection.focusNode,
  71281. focusOffset: domSelection.focusOffset
  71282. };
  71283. }, { priority: 'lowest' } );
  71284. this.listenTo( viewDocument, 'keyup', ( evt, data ) => {
  71285. if ( domSelectionAfterDeletion ) {
  71286. const domSelection = data.domTarget.ownerDocument.defaultView.getSelection();
  71287. domSelection.collapse( domSelectionAfterDeletion.anchorNode, domSelectionAfterDeletion.anchorOffset );
  71288. domSelection.extend( domSelectionAfterDeletion.focusNode, domSelectionAfterDeletion.focusOffset );
  71289. domSelectionAfterDeletion = null;
  71290. }
  71291. } );
  71292. }
  71293. }
  71294. }
  71295. /***/ }),
  71296. /***/ "./node_modules/@ckeditor/ckeditor5-typing/src/deletecommand.js":
  71297. /*!**********************************************************************!*\
  71298. !*** ./node_modules/@ckeditor/ckeditor5-typing/src/deletecommand.js ***!
  71299. \**********************************************************************/
  71300. /*! exports provided: default */
  71301. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  71302. "use strict";
  71303. __webpack_require__.r(__webpack_exports__);
  71304. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return DeleteCommand; });
  71305. /* 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");
  71306. /* 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");
  71307. /* harmony import */ var _utils_changebuffer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils/changebuffer */ "./node_modules/@ckeditor/ckeditor5-typing/src/utils/changebuffer.js");
  71308. /**
  71309. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  71310. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  71311. */
  71312. /**
  71313. * @module typing/deletecommand
  71314. */
  71315. /**
  71316. * The delete command. Used by the {@link module:typing/delete~Delete delete feature} to handle the <kbd>Delete</kbd> and
  71317. * <kbd>Backspace</kbd> keys.
  71318. *
  71319. * @extends module:core/command~Command
  71320. */
  71321. class DeleteCommand extends _ckeditor_ckeditor5_core_src_command__WEBPACK_IMPORTED_MODULE_0__["default"] {
  71322. /**
  71323. * Creates an instance of the command.
  71324. *
  71325. * @param {module:core/editor/editor~Editor} editor
  71326. * @param {'forward'|'backward'} direction The directionality of the delete describing in what direction it
  71327. * should consume the content when the selection is collapsed.
  71328. */
  71329. constructor( editor, direction ) {
  71330. super( editor );
  71331. /**
  71332. * The directionality of the delete describing in what direction it should
  71333. * consume the content when the selection is collapsed.
  71334. *
  71335. * @readonly
  71336. * @member {'forward'|'backward'} #direction
  71337. */
  71338. this.direction = direction;
  71339. /**
  71340. * Delete's change buffer used to group subsequent changes into batches.
  71341. *
  71342. * @readonly
  71343. * @private
  71344. * @type {module:typing/utils/changebuffer~ChangeBuffer}
  71345. */
  71346. this._buffer = new _utils_changebuffer__WEBPACK_IMPORTED_MODULE_2__["default"]( editor.model, editor.config.get( 'typing.undoStep' ) );
  71347. }
  71348. /**
  71349. * The current change buffer.
  71350. *
  71351. * @type {module:typing/utils/changebuffer~ChangeBuffer}
  71352. */
  71353. get buffer() {
  71354. return this._buffer;
  71355. }
  71356. /**
  71357. * Executes the delete command. Depending on whether the selection is collapsed or not, deletes its content
  71358. * or a piece of content in the {@link #direction defined direction}.
  71359. *
  71360. * @fires execute
  71361. * @param {Object} [options] The command options.
  71362. * @param {'character'} [options.unit='character'] See {@link module:engine/model/utils/modifyselection~modifySelection}'s options.
  71363. * @param {Number} [options.sequence=1] A number describing which subsequent delete event it is without the key being released.
  71364. * See the {@link module:engine/view/document~Document#event:delete} event data.
  71365. * @param {module:engine/model/selection~Selection} [options.selection] Selection to remove. If not set, current model selection
  71366. * will be used.
  71367. */
  71368. execute( options = {} ) {
  71369. const model = this.editor.model;
  71370. const doc = model.document;
  71371. model.enqueueChange( this._buffer.batch, writer => {
  71372. this._buffer.lock();
  71373. const selection = writer.createSelection( options.selection || doc.selection );
  71374. const sequence = options.sequence || 1;
  71375. // Do not replace the whole selected content if selection was collapsed.
  71376. // This prevents such situation:
  71377. //
  71378. // <h1></h1><p>[]</p> --> <h1>[</h1><p>]</p> --> <p></p>
  71379. // starting content --> after `modifySelection` --> after `deleteContent`.
  71380. const doNotResetEntireContent = selection.isCollapsed;
  71381. // Try to extend the selection in the specified direction.
  71382. if ( selection.isCollapsed ) {
  71383. model.modifySelection( selection, { direction: this.direction, unit: options.unit } );
  71384. }
  71385. // Check if deleting in an empty editor. See #61.
  71386. if ( this._shouldEntireContentBeReplacedWithParagraph( sequence ) ) {
  71387. this._replaceEntireContentWithParagraph( writer );
  71388. return;
  71389. }
  71390. // Check if deleting in the first empty block.
  71391. // See https://github.com/ckeditor/ckeditor5/issues/8137.
  71392. if ( this._shouldReplaceFirstBlockWithParagraph( selection, sequence ) ) {
  71393. this.editor.execute( 'paragraph', { selection } );
  71394. return;
  71395. }
  71396. // If selection is still collapsed, then there's nothing to delete.
  71397. if ( selection.isCollapsed ) {
  71398. return;
  71399. }
  71400. let changeCount = 0;
  71401. selection.getFirstRange().getMinimalFlatRanges().forEach( range => {
  71402. changeCount += Object(_ckeditor_ckeditor5_utils_src_count__WEBPACK_IMPORTED_MODULE_1__["default"])(
  71403. range.getWalker( { singleCharacters: true, ignoreElementEnd: true, shallow: true } )
  71404. );
  71405. } );
  71406. model.deleteContent( selection, {
  71407. doNotResetEntireContent,
  71408. direction: this.direction
  71409. } );
  71410. this._buffer.input( changeCount );
  71411. writer.setSelection( selection );
  71412. this._buffer.unlock();
  71413. } );
  71414. }
  71415. /**
  71416. * If the user keeps <kbd>Backspace</kbd> or <kbd>Delete</kbd> key pressed, the content of the current
  71417. * editable will be cleared. However, this will not yet lead to resetting the remaining block to a paragraph
  71418. * (which happens e.g. when the user does <kbd>Ctrl</kbd> + <kbd>A</kbd>, <kbd>Backspace</kbd>).
  71419. *
  71420. * But, if the user pressed the key in an empty editable for the first time,
  71421. * we want to replace the entire content with a paragraph if:
  71422. *
  71423. * * the current limit element is empty,
  71424. * * the paragraph is allowed in the limit element,
  71425. * * the limit doesn't already have a paragraph inside.
  71426. *
  71427. * See https://github.com/ckeditor/ckeditor5-typing/issues/61.
  71428. *
  71429. * @private
  71430. * @param {Number} sequence A number describing which subsequent delete event it is without the key being released.
  71431. * @returns {Boolean}
  71432. */
  71433. _shouldEntireContentBeReplacedWithParagraph( sequence ) {
  71434. // Does nothing if user pressed and held the "Backspace" or "Delete" key.
  71435. if ( sequence > 1 ) {
  71436. return false;
  71437. }
  71438. const model = this.editor.model;
  71439. const doc = model.document;
  71440. const selection = doc.selection;
  71441. const limitElement = model.schema.getLimitElement( selection );
  71442. // If a collapsed selection contains the whole content it means that the content is empty
  71443. // (from the user perspective).
  71444. const limitElementIsEmpty = selection.isCollapsed && selection.containsEntireContent( limitElement );
  71445. if ( !limitElementIsEmpty ) {
  71446. return false;
  71447. }
  71448. if ( !model.schema.checkChild( limitElement, 'paragraph' ) ) {
  71449. return false;
  71450. }
  71451. const limitElementFirstChild = limitElement.getChild( 0 );
  71452. // Does nothing if the limit element already contains only a paragraph.
  71453. // We ignore the case when paragraph might have some inline elements (<p><inlineWidget>[]</inlineWidget></p>)
  71454. // because we don't support such cases yet and it's unclear whether inlineWidget shouldn't be a limit itself.
  71455. if ( limitElementFirstChild && limitElementFirstChild.name === 'paragraph' ) {
  71456. return false;
  71457. }
  71458. return true;
  71459. }
  71460. /**
  71461. * The entire content is replaced with the paragraph. Selection is moved inside the paragraph.
  71462. *
  71463. * @private
  71464. * @param {module:engine/model/writer~Writer} writer The model writer.
  71465. */
  71466. _replaceEntireContentWithParagraph( writer ) {
  71467. const model = this.editor.model;
  71468. const doc = model.document;
  71469. const selection = doc.selection;
  71470. const limitElement = model.schema.getLimitElement( selection );
  71471. const paragraph = writer.createElement( 'paragraph' );
  71472. writer.remove( writer.createRangeIn( limitElement ) );
  71473. writer.insert( paragraph, limitElement );
  71474. writer.setSelection( paragraph, 0 );
  71475. }
  71476. /**
  71477. * Checks if the selection is inside an empty element that is the first child of the limit element
  71478. * and should be replaced with a paragraph.
  71479. *
  71480. * @private
  71481. * @param {module:engine/model/selection~Selection} selection The selection.
  71482. * @param {Number} sequence A number describing which subsequent delete event it is without the key being released.
  71483. * @returns {Boolean}
  71484. */
  71485. _shouldReplaceFirstBlockWithParagraph( selection, sequence ) {
  71486. const model = this.editor.model;
  71487. // Does nothing if user pressed and held the "Backspace" key or it was a "Delete" button.
  71488. if ( sequence > 1 || this.direction != 'backward' ) {
  71489. return false;
  71490. }
  71491. if ( !selection.isCollapsed ) {
  71492. return false;
  71493. }
  71494. const position = selection.getFirstPosition();
  71495. const limitElement = model.schema.getLimitElement( position );
  71496. const limitElementFirstChild = limitElement.getChild( 0 );
  71497. // Only elements that are direct children of the limit element can be replaced.
  71498. // Unwrapping from a block quote should be handled in a dedicated feature.
  71499. if ( position.parent != limitElementFirstChild ) {
  71500. return false;
  71501. }
  71502. // A block should be replaced only if it was empty.
  71503. if ( !selection.containsEntireContent( limitElementFirstChild ) ) {
  71504. return false;
  71505. }
  71506. // Replace with a paragraph only if it's allowed there.
  71507. if ( !model.schema.checkChild( limitElement, 'paragraph' ) ) {
  71508. return false;
  71509. }
  71510. // Does nothing if the limit element already contains only a paragraph.
  71511. if ( limitElementFirstChild.name == 'paragraph' ) {
  71512. return false;
  71513. }
  71514. return true;
  71515. }
  71516. }
  71517. /***/ }),
  71518. /***/ "./node_modules/@ckeditor/ckeditor5-typing/src/deleteobserver.js":
  71519. /*!***********************************************************************!*\
  71520. !*** ./node_modules/@ckeditor/ckeditor5-typing/src/deleteobserver.js ***!
  71521. \***********************************************************************/
  71522. /*! exports provided: default */
  71523. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  71524. "use strict";
  71525. __webpack_require__.r(__webpack_exports__);
  71526. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return DeleteObserver; });
  71527. /* 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");
  71528. /* 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");
  71529. /* harmony import */ var _ckeditor_ckeditor5_engine_src_view_observer_bubblingeventinfo__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-engine/src/view/observer/bubblingeventinfo */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/bubblingeventinfo.js");
  71530. /* 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");
  71531. /* harmony import */ var _ckeditor_ckeditor5_utils_src_env__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/env */ "./node_modules/@ckeditor/ckeditor5-utils/src/env.js");
  71532. /**
  71533. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  71534. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  71535. */
  71536. /**
  71537. * @module typing/deleteobserver
  71538. */
  71539. /**
  71540. * Delete observer introduces the {@link module:engine/view/document~Document#event:delete} event.
  71541. *
  71542. * @extends module:engine/view/observer/observer~Observer
  71543. */
  71544. class DeleteObserver extends _ckeditor_ckeditor5_engine_src_view_observer_observer__WEBPACK_IMPORTED_MODULE_0__["default"] {
  71545. /**
  71546. * @inheritDoc
  71547. */
  71548. constructor( view ) {
  71549. super( view );
  71550. const document = view.document;
  71551. let sequence = 0;
  71552. document.on( 'keyup', ( evt, data ) => {
  71553. if ( data.keyCode == _ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_3__["keyCodes"].delete || data.keyCode == _ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_3__["keyCodes"].backspace ) {
  71554. sequence = 0;
  71555. }
  71556. } );
  71557. document.on( 'keydown', ( evt, data ) => {
  71558. const deleteData = {};
  71559. if ( data.keyCode == _ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_3__["keyCodes"].delete ) {
  71560. deleteData.direction = 'forward';
  71561. deleteData.unit = 'character';
  71562. } else if ( data.keyCode == _ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_3__["keyCodes"].backspace ) {
  71563. deleteData.direction = 'backward';
  71564. deleteData.unit = 'codePoint';
  71565. } else {
  71566. return;
  71567. }
  71568. const hasWordModifier = _ckeditor_ckeditor5_utils_src_env__WEBPACK_IMPORTED_MODULE_4__["default"].isMac ? data.altKey : data.ctrlKey;
  71569. deleteData.unit = hasWordModifier ? 'word' : deleteData.unit;
  71570. deleteData.sequence = ++sequence;
  71571. fireViewDeleteEvent( evt, data.domEvent, deleteData );
  71572. } );
  71573. // `beforeinput` is handled only for Android devices. Desktop Chrome and iOS are skipped because they are working fine now.
  71574. if ( _ckeditor_ckeditor5_utils_src_env__WEBPACK_IMPORTED_MODULE_4__["default"].isAndroid ) {
  71575. document.on( 'beforeinput', ( evt, data ) => {
  71576. // If event type is other than `deleteContentBackward` then this is not deleting.
  71577. if ( data.domEvent.inputType != 'deleteContentBackward' ) {
  71578. return;
  71579. }
  71580. const deleteData = {
  71581. unit: 'codepoint',
  71582. direction: 'backward',
  71583. sequence: 1
  71584. };
  71585. // Android IMEs may change the DOM selection on `beforeinput` event so that the selection contains all the text
  71586. // that the IME wants to remove. We will pass this information to `delete` event so proper part of the content is removed.
  71587. //
  71588. // Sometimes it is only expanding by a one character (in case of collapsed selection). In this case we don't need to
  71589. // set a different selection to remove, it will work just fine.
  71590. const domSelection = data.domTarget.ownerDocument.defaultView.getSelection();
  71591. if ( domSelection.anchorNode == domSelection.focusNode && domSelection.anchorOffset + 1 != domSelection.focusOffset ) {
  71592. deleteData.selectionToRemove = view.domConverter.domSelectionToView( domSelection );
  71593. }
  71594. fireViewDeleteEvent( evt, data.domEvent, deleteData );
  71595. } );
  71596. }
  71597. function fireViewDeleteEvent( originalEvent, domEvent, deleteData ) {
  71598. const event = new _ckeditor_ckeditor5_engine_src_view_observer_bubblingeventinfo__WEBPACK_IMPORTED_MODULE_2__["default"]( document, 'delete', document.selection.getFirstRange() );
  71599. document.fire( event, new _ckeditor_ckeditor5_engine_src_view_observer_domeventdata__WEBPACK_IMPORTED_MODULE_1__["default"]( document, domEvent, deleteData ) );
  71600. // Stop the original event if `delete` event was stopped.
  71601. // https://github.com/ckeditor/ckeditor5/issues/753
  71602. if ( event.stop.called ) {
  71603. originalEvent.stop();
  71604. }
  71605. }
  71606. }
  71607. /**
  71608. * @inheritDoc
  71609. */
  71610. observe() {}
  71611. }
  71612. /**
  71613. * Event fired when the user tries to delete content (e.g. presses <kbd>Delete</kbd> or <kbd>Backspace</kbd>).
  71614. *
  71615. * Note: This event is fired by the {@link module:typing/deleteobserver~DeleteObserver observer}
  71616. * (usually registered by the {@link module:typing/delete~Delete delete feature}).
  71617. *
  71618. * @event module:engine/view/document~Document#event:delete
  71619. * @param {module:engine/view/observer/domeventdata~DomEventData} data
  71620. * @param {'forward'|'delete'} data.direction The direction in which the deletion should happen.
  71621. * @param {'character'|'word'} data.unit The "amount" of content that should be deleted.
  71622. * @param {Number} data.sequence A number describing which subsequent delete event it is without the key being released.
  71623. * If it's 2 or more it means that the key was pressed and hold.
  71624. * @param {module:engine/view/selection~Selection} [data.selectionToRemove] View selection which content should be removed. If not set,
  71625. * current selection should be used.
  71626. */
  71627. /***/ }),
  71628. /***/ "./node_modules/@ckeditor/ckeditor5-typing/src/index.js":
  71629. /*!**************************************************************!*\
  71630. !*** ./node_modules/@ckeditor/ckeditor5-typing/src/index.js ***!
  71631. \**************************************************************/
  71632. /*! exports provided: Typing, Input, Delete, TextWatcher, TwoStepCaretMovement, TextTransformation, inlineHighlight, findAttributeRange, getLastTextLine, isNonTypingKeystroke */
  71633. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  71634. "use strict";
  71635. __webpack_require__.r(__webpack_exports__);
  71636. /* harmony import */ var _typing__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./typing */ "./node_modules/@ckeditor/ckeditor5-typing/src/typing.js");
  71637. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Typing", function() { return _typing__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  71638. /* harmony import */ var _input__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./input */ "./node_modules/@ckeditor/ckeditor5-typing/src/input.js");
  71639. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Input", function() { return _input__WEBPACK_IMPORTED_MODULE_1__["default"]; });
  71640. /* harmony import */ var _delete__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./delete */ "./node_modules/@ckeditor/ckeditor5-typing/src/delete.js");
  71641. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Delete", function() { return _delete__WEBPACK_IMPORTED_MODULE_2__["default"]; });
  71642. /* harmony import */ var _textwatcher__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./textwatcher */ "./node_modules/@ckeditor/ckeditor5-typing/src/textwatcher.js");
  71643. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TextWatcher", function() { return _textwatcher__WEBPACK_IMPORTED_MODULE_3__["default"]; });
  71644. /* harmony import */ var _twostepcaretmovement__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./twostepcaretmovement */ "./node_modules/@ckeditor/ckeditor5-typing/src/twostepcaretmovement.js");
  71645. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TwoStepCaretMovement", function() { return _twostepcaretmovement__WEBPACK_IMPORTED_MODULE_4__["default"]; });
  71646. /* harmony import */ var _texttransformation__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./texttransformation */ "./node_modules/@ckeditor/ckeditor5-typing/src/texttransformation.js");
  71647. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TextTransformation", function() { return _texttransformation__WEBPACK_IMPORTED_MODULE_5__["default"]; });
  71648. /* harmony import */ var _utils_inlinehighlight__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./utils/inlinehighlight */ "./node_modules/@ckeditor/ckeditor5-typing/src/utils/inlinehighlight.js");
  71649. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "inlineHighlight", function() { return _utils_inlinehighlight__WEBPACK_IMPORTED_MODULE_6__["default"]; });
  71650. /* harmony import */ var _utils_findattributerange__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./utils/findattributerange */ "./node_modules/@ckeditor/ckeditor5-typing/src/utils/findattributerange.js");
  71651. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "findAttributeRange", function() { return _utils_findattributerange__WEBPACK_IMPORTED_MODULE_7__["default"]; });
  71652. /* harmony import */ var _utils_getlasttextline__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./utils/getlasttextline */ "./node_modules/@ckeditor/ckeditor5-typing/src/utils/getlasttextline.js");
  71653. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getLastTextLine", function() { return _utils_getlasttextline__WEBPACK_IMPORTED_MODULE_8__["default"]; });
  71654. /* harmony import */ var _utils_injectunsafekeystrokeshandling__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./utils/injectunsafekeystrokeshandling */ "./node_modules/@ckeditor/ckeditor5-typing/src/utils/injectunsafekeystrokeshandling.js");
  71655. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isNonTypingKeystroke", function() { return _utils_injectunsafekeystrokeshandling__WEBPACK_IMPORTED_MODULE_9__["isNonTypingKeystroke"]; });
  71656. /**
  71657. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  71658. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  71659. */
  71660. /**
  71661. * @module typing
  71662. */
  71663. /***/ }),
  71664. /***/ "./node_modules/@ckeditor/ckeditor5-typing/src/input.js":
  71665. /*!**************************************************************!*\
  71666. !*** ./node_modules/@ckeditor/ckeditor5-typing/src/input.js ***!
  71667. \**************************************************************/
  71668. /*! exports provided: default */
  71669. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  71670. "use strict";
  71671. __webpack_require__.r(__webpack_exports__);
  71672. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Input; });
  71673. /* 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");
  71674. /* harmony import */ var _inputcommand__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./inputcommand */ "./node_modules/@ckeditor/ckeditor5-typing/src/inputcommand.js");
  71675. /* harmony import */ var _utils_injectunsafekeystrokeshandling__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils/injectunsafekeystrokeshandling */ "./node_modules/@ckeditor/ckeditor5-typing/src/utils/injectunsafekeystrokeshandling.js");
  71676. /* harmony import */ var _utils_injecttypingmutationshandling__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils/injecttypingmutationshandling */ "./node_modules/@ckeditor/ckeditor5-typing/src/utils/injecttypingmutationshandling.js");
  71677. /**
  71678. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  71679. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  71680. */
  71681. /**
  71682. * @module typing/input
  71683. */
  71684. /**
  71685. * Handles text input coming from the keyboard or other input methods.
  71686. *
  71687. * @extends module:core/plugin~Plugin
  71688. */
  71689. class Input extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
  71690. /**
  71691. * @inheritDoc
  71692. */
  71693. static get pluginName() {
  71694. return 'Input';
  71695. }
  71696. /**
  71697. * @inheritDoc
  71698. */
  71699. init() {
  71700. const editor = this.editor;
  71701. // TODO The above default configuration value should be defined using editor.config.define() once it's fixed.
  71702. const inputCommand = new _inputcommand__WEBPACK_IMPORTED_MODULE_1__["default"]( editor, editor.config.get( 'typing.undoStep' ) || 20 );
  71703. editor.commands.add( 'input', inputCommand );
  71704. Object(_utils_injectunsafekeystrokeshandling__WEBPACK_IMPORTED_MODULE_2__["default"])( editor );
  71705. Object(_utils_injecttypingmutationshandling__WEBPACK_IMPORTED_MODULE_3__["default"])( editor );
  71706. }
  71707. /**
  71708. * Checks batch if it is a result of user input - e.g. typing.
  71709. *
  71710. * const input = editor.plugins.get( 'Input' );
  71711. *
  71712. * editor.model.document.on( 'change:data', ( evt, batch ) => {
  71713. * if ( input.isInput( batch ) ) {
  71714. * console.log( 'The user typed something...' );
  71715. * }
  71716. * } );
  71717. *
  71718. * **Note:** This method checks if the batch was created using {@link module:typing/inputcommand~InputCommand 'input'}
  71719. * command as typing changes coming from user input are inserted to the document using that command.
  71720. *
  71721. * @param {module:engine/model/batch~Batch} batch A batch to check.
  71722. * @returns {Boolean}
  71723. */
  71724. isInput( batch ) {
  71725. const inputCommand = this.editor.commands.get( 'input' );
  71726. return inputCommand._batches.has( batch );
  71727. }
  71728. }
  71729. /***/ }),
  71730. /***/ "./node_modules/@ckeditor/ckeditor5-typing/src/inputcommand.js":
  71731. /*!*********************************************************************!*\
  71732. !*** ./node_modules/@ckeditor/ckeditor5-typing/src/inputcommand.js ***!
  71733. \*********************************************************************/
  71734. /*! exports provided: default */
  71735. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  71736. "use strict";
  71737. __webpack_require__.r(__webpack_exports__);
  71738. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return InputCommand; });
  71739. /* 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");
  71740. /* harmony import */ var _utils_changebuffer__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./utils/changebuffer */ "./node_modules/@ckeditor/ckeditor5-typing/src/utils/changebuffer.js");
  71741. /**
  71742. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  71743. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  71744. */
  71745. /**
  71746. * @module typing/inputcommand
  71747. */
  71748. /**
  71749. * The input command. Used by the {@link module:typing/input~Input input feature} to handle typing.
  71750. *
  71751. * @extends module:core/command~Command
  71752. */
  71753. class InputCommand extends _ckeditor_ckeditor5_core_src_command__WEBPACK_IMPORTED_MODULE_0__["default"] {
  71754. /**
  71755. * Creates an instance of the command.
  71756. *
  71757. * @param {module:core/editor/editor~Editor} editor
  71758. * @param {Number} undoStepSize The maximum number of atomic changes
  71759. * which can be contained in one batch in the command buffer.
  71760. */
  71761. constructor( editor, undoStepSize ) {
  71762. super( editor );
  71763. /**
  71764. * Typing's change buffer used to group subsequent changes into batches.
  71765. *
  71766. * @readonly
  71767. * @private
  71768. * @member {module:typing/utils/changebuffer~ChangeBuffer} #_buffer
  71769. */
  71770. this._buffer = new _utils_changebuffer__WEBPACK_IMPORTED_MODULE_1__["default"]( editor.model, undoStepSize );
  71771. /**
  71772. * Stores batches created by the input command. The batches are used to differentiate input batches from other batches using
  71773. * {@link module:typing/input~Input#isInput} method.
  71774. *
  71775. * @type {WeakSet<module:engine/model/batch~Batch>}
  71776. * @protected
  71777. */
  71778. this._batches = new WeakSet();
  71779. }
  71780. /**
  71781. * The current change buffer.
  71782. *
  71783. * @type {module:typing/utils/changebuffer~ChangeBuffer}
  71784. */
  71785. get buffer() {
  71786. return this._buffer;
  71787. }
  71788. /**
  71789. * @inheritDoc
  71790. */
  71791. destroy() {
  71792. super.destroy();
  71793. this._buffer.destroy();
  71794. }
  71795. /**
  71796. * Executes the input command. It replaces the content within the given range with the given text.
  71797. * Replacing is a two step process, first the content within the range is removed and then the new text is inserted
  71798. * at the beginning of the range (which after the removal is a collapsed range).
  71799. *
  71800. * @fires execute
  71801. * @param {Object} [options] The command options.
  71802. * @param {String} [options.text=''] The text to be inserted.
  71803. * @param {module:engine/model/range~Range} [options.range] The range in which the text is inserted. Defaults
  71804. * to the first range in the current selection.
  71805. * @param {module:engine/model/range~Range} [options.resultRange] The range where the selection
  71806. * should be placed after the insertion. If not specified, the selection will be placed right after
  71807. * the inserted text.
  71808. */
  71809. execute( options = {} ) {
  71810. const model = this.editor.model;
  71811. const doc = model.document;
  71812. const text = options.text || '';
  71813. const textInsertions = text.length;
  71814. const selection = options.range ? model.createSelection( options.range ) : doc.selection;
  71815. const resultRange = options.resultRange;
  71816. model.enqueueChange( this._buffer.batch, writer => {
  71817. this._buffer.lock();
  71818. // Store the batch as an 'input' batch for the Input.isInput( batch ) check.
  71819. this._batches.add( this._buffer.batch );
  71820. model.deleteContent( selection );
  71821. if ( text ) {
  71822. model.insertContent( writer.createText( text, doc.selection.getAttributes() ), selection );
  71823. }
  71824. if ( resultRange ) {
  71825. writer.setSelection( resultRange );
  71826. } else if ( !selection.is( 'documentSelection' ) ) {
  71827. writer.setSelection( selection );
  71828. }
  71829. this._buffer.unlock();
  71830. this._buffer.input( textInsertions );
  71831. } );
  71832. }
  71833. }
  71834. /***/ }),
  71835. /***/ "./node_modules/@ckeditor/ckeditor5-typing/src/texttransformation.js":
  71836. /*!***************************************************************************!*\
  71837. !*** ./node_modules/@ckeditor/ckeditor5-typing/src/texttransformation.js ***!
  71838. \***************************************************************************/
  71839. /*! exports provided: default */
  71840. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  71841. "use strict";
  71842. __webpack_require__.r(__webpack_exports__);
  71843. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return TextTransformation; });
  71844. /* 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");
  71845. /* harmony import */ var _textwatcher__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./textwatcher */ "./node_modules/@ckeditor/ckeditor5-typing/src/textwatcher.js");
  71846. /* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lodash-es */ "./node_modules/lodash-es/lodash.js");
  71847. /**
  71848. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  71849. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  71850. */
  71851. /**
  71852. * @module typing/texttransformation
  71853. */
  71854. // All named transformations.
  71855. const TRANSFORMATIONS = {
  71856. // Common symbols:
  71857. copyright: { from: '(c)', to: '©' },
  71858. registeredTrademark: { from: '(r)', to: '®' },
  71859. trademark: { from: '(tm)', to: '™' },
  71860. // Mathematical:
  71861. oneHalf: { from: '1/2', to: '½' },
  71862. oneThird: { from: '1/3', to: '⅓' },
  71863. twoThirds: { from: '2/3', to: '⅔' },
  71864. oneForth: { from: '1/4', to: '¼' },
  71865. threeQuarters: { from: '3/4', to: '¾' },
  71866. lessThanOrEqual: { from: '<=', to: '≤' },
  71867. greaterThanOrEqual: { from: '>=', to: '≥' },
  71868. notEqual: { from: '!=', to: '≠' },
  71869. arrowLeft: { from: '<-', to: '←' },
  71870. arrowRight: { from: '->', to: '→' },
  71871. // Typography:
  71872. horizontalEllipsis: { from: '...', to: '…' },
  71873. enDash: { from: /(^| )(--)( )$/, to: [ null, '–', null ] },
  71874. emDash: { from: /(^| )(---)( )$/, to: [ null, '—', null ] },
  71875. // Quotations:
  71876. // English, US
  71877. quotesPrimary: { from: buildQuotesRegExp( '"' ), to: [ null, '“', null, '”' ] },
  71878. quotesSecondary: { from: buildQuotesRegExp( '\'' ), to: [ null, '‘', null, '’' ] },
  71879. // English, UK
  71880. quotesPrimaryEnGb: { from: buildQuotesRegExp( '\'' ), to: [ null, '‘', null, '’' ] },
  71881. quotesSecondaryEnGb: { from: buildQuotesRegExp( '"' ), to: [ null, '“', null, '”' ] },
  71882. // Polish
  71883. quotesPrimaryPl: { from: buildQuotesRegExp( '"' ), to: [ null, '„', null, '”' ] },
  71884. quotesSecondaryPl: { from: buildQuotesRegExp( '\'' ), to: [ null, '‚', null, '’' ] }
  71885. };
  71886. // Transformation groups.
  71887. const TRANSFORMATION_GROUPS = {
  71888. symbols: [ 'copyright', 'registeredTrademark', 'trademark' ],
  71889. mathematical: [
  71890. 'oneHalf', 'oneThird', 'twoThirds', 'oneForth', 'threeQuarters',
  71891. 'lessThanOrEqual', 'greaterThanOrEqual', 'notEqual',
  71892. 'arrowLeft', 'arrowRight'
  71893. ],
  71894. typography: [ 'horizontalEllipsis', 'enDash', 'emDash' ],
  71895. quotes: [ 'quotesPrimary', 'quotesSecondary' ]
  71896. };
  71897. // A set of default transformations provided by the feature.
  71898. const DEFAULT_TRANSFORMATIONS = [
  71899. 'symbols',
  71900. 'mathematical',
  71901. 'typography',
  71902. 'quotes'
  71903. ];
  71904. /**
  71905. * The text transformation plugin.
  71906. *
  71907. * @extends module:core/plugin~Plugin
  71908. */
  71909. class TextTransformation extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
  71910. /**
  71911. * @inheritDoc
  71912. */
  71913. static get pluginName() {
  71914. return 'TextTransformation';
  71915. }
  71916. /**
  71917. * @inheritDoc
  71918. */
  71919. constructor( editor ) {
  71920. super( editor );
  71921. editor.config.define( 'typing', {
  71922. transformations: {
  71923. include: DEFAULT_TRANSFORMATIONS
  71924. }
  71925. } );
  71926. }
  71927. /**
  71928. * @inheritDoc
  71929. */
  71930. init() {
  71931. const model = this.editor.model;
  71932. const modelSelection = model.document.selection;
  71933. modelSelection.on( 'change:range', () => {
  71934. // Disable plugin when selection is inside a code block.
  71935. this.isEnabled = !modelSelection.anchor.parent.is( 'element', 'codeBlock' );
  71936. } );
  71937. this._enableTransformationWatchers();
  71938. }
  71939. /**
  71940. * Create new TextWatcher listening to the editor for typing and selection events.
  71941. *
  71942. * @private
  71943. */
  71944. _enableTransformationWatchers() {
  71945. const editor = this.editor;
  71946. const model = editor.model;
  71947. const input = editor.plugins.get( 'Input' );
  71948. const normalizedTransformations = normalizeTransformations( editor.config.get( 'typing.transformations' ) );
  71949. const testCallback = text => {
  71950. for ( const normalizedTransformation of normalizedTransformations ) {
  71951. const from = normalizedTransformation.from;
  71952. const match = from.test( text );
  71953. if ( match ) {
  71954. return { normalizedTransformation };
  71955. }
  71956. }
  71957. };
  71958. const watcherCallback = ( evt, data ) => {
  71959. if ( !input.isInput( data.batch ) ) {
  71960. return;
  71961. }
  71962. const { from, to } = data.normalizedTransformation;
  71963. const matches = from.exec( data.text );
  71964. const replaces = to( matches.slice( 1 ) );
  71965. const matchedRange = data.range;
  71966. let changeIndex = matches.index;
  71967. model.enqueueChange( writer => {
  71968. for ( let i = 1; i < matches.length; i++ ) {
  71969. const match = matches[ i ];
  71970. const replaceWith = replaces[ i - 1 ];
  71971. if ( replaceWith == null ) {
  71972. changeIndex += match.length;
  71973. continue;
  71974. }
  71975. const replacePosition = matchedRange.start.getShiftedBy( changeIndex );
  71976. const replaceRange = model.createRange( replacePosition, replacePosition.getShiftedBy( match.length ) );
  71977. const attributes = getTextAttributesAfterPosition( replacePosition );
  71978. model.insertContent( writer.createText( replaceWith, attributes ), replaceRange );
  71979. changeIndex += replaceWith.length;
  71980. }
  71981. } );
  71982. };
  71983. const watcher = new _textwatcher__WEBPACK_IMPORTED_MODULE_1__["default"]( editor.model, testCallback );
  71984. watcher.on( 'matched:data', watcherCallback );
  71985. watcher.bind( 'isEnabled' ).to( this );
  71986. }
  71987. }
  71988. // Normalizes the configuration `from` parameter value.
  71989. // The normalized value for the `from` parameter is a RegExp instance. If the passed `from` is already a RegExp instance,
  71990. // it is returned unchanged.
  71991. //
  71992. // @param {String|RegExp} from
  71993. // @returns {RegExp}
  71994. function normalizeFrom( from ) {
  71995. if ( typeof from == 'string' ) {
  71996. return new RegExp( `(${ Object(lodash_es__WEBPACK_IMPORTED_MODULE_2__["escapeRegExp"])( from ) })$` );
  71997. }
  71998. // `from` is already a regular expression.
  71999. return from;
  72000. }
  72001. // Normalizes the configuration `to` parameter value.
  72002. // The normalized value for the `to` parameter is a function that takes an array and returns an array. See more in the
  72003. // configuration description. If the passed `to` is already a function, it is returned unchanged.
  72004. //
  72005. // @param {String|Array.<null|String>|Function} to
  72006. // @returns {Function}
  72007. function normalizeTo( to ) {
  72008. if ( typeof to == 'string' ) {
  72009. return () => [ to ];
  72010. } else if ( to instanceof Array ) {
  72011. return () => to;
  72012. }
  72013. // `to` is already a function.
  72014. return to;
  72015. }
  72016. // For given `position` returns attributes for the text that is after that position.
  72017. // 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>`).
  72018. //
  72019. // @param {module:engine/model/position~Position} position
  72020. // @returns {Iterable.<*>}
  72021. function getTextAttributesAfterPosition( position ) {
  72022. const textNode = position.textNode ? position.textNode : position.nodeAfter;
  72023. return textNode.getAttributes();
  72024. }
  72025. // Returns a RegExp pattern string that detects a sentence inside a quote.
  72026. //
  72027. // @param {String} quoteCharacter The character to create a pattern for.
  72028. // @returns {String}
  72029. function buildQuotesRegExp( quoteCharacter ) {
  72030. return new RegExp( `(^|\\s)(${ quoteCharacter })([^${ quoteCharacter }]*)(${ quoteCharacter })$` );
  72031. }
  72032. // Reads text transformation config and returns normalized array of transformations objects.
  72033. //
  72034. // @param {module:typing/texttransformation~TextTransformationDescription} config
  72035. // @returns {Array.<{from:String,to:Function}>}
  72036. function normalizeTransformations( config ) {
  72037. const extra = config.extra || [];
  72038. const remove = config.remove || [];
  72039. const isNotRemoved = transformation => !remove.includes( transformation );
  72040. const configured = config.include.concat( extra ).filter( isNotRemoved );
  72041. return expandGroupsAndRemoveDuplicates( configured )
  72042. .filter( isNotRemoved ) // Filter out 'remove' transformations as they might be set in group
  72043. .map( transformation => TRANSFORMATIONS[ transformation ] || transformation )
  72044. .map( transformation => ( {
  72045. from: normalizeFrom( transformation.from ),
  72046. to: normalizeTo( transformation.to )
  72047. } ) );
  72048. }
  72049. // Reads definitions and expands named groups if needed to transformation names.
  72050. // This method also removes duplicated named transformations if any.
  72051. //
  72052. // @param {Array.<String|Object>} definitions
  72053. // @returns {Array.<String|Object>}
  72054. function expandGroupsAndRemoveDuplicates( definitions ) {
  72055. // Set is using to make sure that transformation names are not duplicated.
  72056. const definedTransformations = new Set();
  72057. for ( const transformationOrGroup of definitions ) {
  72058. if ( TRANSFORMATION_GROUPS[ transformationOrGroup ] ) {
  72059. for ( const transformation of TRANSFORMATION_GROUPS[ transformationOrGroup ] ) {
  72060. definedTransformations.add( transformation );
  72061. }
  72062. } else {
  72063. definedTransformations.add( transformationOrGroup );
  72064. }
  72065. }
  72066. return Array.from( definedTransformations );
  72067. }
  72068. /**
  72069. * The text transformation definition object. It describes what should be replaced with what.
  72070. *
  72071. * The input value (`from`) can be passed either as a string or as a regular expression.
  72072. *
  72073. * * If a string is passed, it will be simply checked if the end of the input matches it.
  72074. * * If a regular expression is passed, its entire length must be covered with capturing groups (e.g. `/(foo)(bar)$/`).
  72075. * Also, since it is compared against the end of the input, it has to end with `$` to be correctly matched.
  72076. * See examples below.
  72077. *
  72078. * The output value (`to`) can be passed as a string, as an array or as a function.
  72079. *
  72080. * * 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
  72081. * the input value is a string, too.
  72082. * * 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.
  72083. * Each capture group will be replaced with a corresponding string from the passed array. If a given capturing group should not be replaced,
  72084. * use `null` instead of passing a string.
  72085. * * If a function is used, it should return an array as described above. The function is passed one parameter &mdash; an array with matches
  72086. * by the regular expression. See the examples below.
  72087. *
  72088. * A simple string-to-string replacement:
  72089. *
  72090. * { from: '(c)', to: '©' }
  72091. *
  72092. * Change quote styles using a regular expression. Note how all the parts are in separate capturing groups and the space at the beginning
  72093. * and the text inside quotes are not replaced (`null` passed as the first and the third value in the `to` parameter):
  72094. *
  72095. * {
  72096. * from: /(^|\s)(")([^"]*)(")$/,
  72097. * to: [ null, '“', null, '”' ]
  72098. * }
  72099. *
  72100. * Automatic uppercase after a dot using a callback:
  72101. *
  72102. * {
  72103. * from: /(\. )([a-z])$/,
  72104. * to: matches => [ null, matches[ 1 ].toUpperCase() ]
  72105. * }
  72106. *
  72107. * @typedef {Object} module:typing/texttransformation~TextTransformationDescription
  72108. * @property {String|RegExp} from The string or regular expression to transform.
  72109. * @property {String} to The text to transform compatible with `String.replace()`.
  72110. */
  72111. /**
  72112. * The configuration of the {@link module:typing/texttransformation~TextTransformation} feature.
  72113. *
  72114. * Read more in {@link module:typing/texttransformation~TextTransformationConfig}.
  72115. *
  72116. * @member {module:typing/texttransformation~TextTransformationConfig} module:typing/typing~TypingConfig#transformations
  72117. */
  72118. /**
  72119. * The configuration of the text transformation feature.
  72120. *
  72121. * ClassicEditor
  72122. * .create( editorElement, {
  72123. * typing: {
  72124. * transformations: ... // Text transformation feature options.
  72125. * }
  72126. * } )
  72127. * .then( ... )
  72128. * .catch( ... );
  72129. *
  72130. * By default, the feature comes pre-configured
  72131. * (via {@link module:typing/texttransformation~TextTransformationConfig#include `config.typing.transformations.include`}) with the
  72132. * following groups of transformations:
  72133. *
  72134. * * Typography (group name: `typography`)
  72135. * - `ellipsis`: transforms `...` to `…`
  72136. * - `enDash`: transforms ` -- ` to ` – `
  72137. * - `emDash`: transforms ` --- ` to ` — `
  72138. * * Quotations (group name: `quotes`)
  72139. * - `quotesPrimary`: transforms `"Foo bar"` to `“Foo bar”`
  72140. * - `quotesSecondary`: transforms `'Foo bar'` to `‘Foo bar’`
  72141. * * Symbols (group name: `symbols`)
  72142. * - `trademark`: transforms `(tm)` to `™`
  72143. * - `registeredTrademark`: transforms `(r)` to `®`
  72144. * - `copyright`: transforms `(c)` to `©`
  72145. * * Mathematical (group name: `mathematical`)
  72146. * - `oneHalf`: transforms `1/2` to: `½`
  72147. * - `oneThird`: transforms `1/3` to: `⅓`
  72148. * - `twoThirds`: transforms `2/3` to: `⅔`
  72149. * - `oneForth`: transforms `1/4` to: `¼`
  72150. * - `threeQuarters`: transforms `3/4` to: `¾`
  72151. * - `lessThanOrEqual`: transforms `<=` to: `≤`
  72152. * - `greaterThanOrEqual`: transforms `>=` to: `≥`
  72153. * - `notEqual`: transforms `!=` to: `≠`
  72154. * - `arrowLeft`: transforms `<-` to: `←`
  72155. * - `arrowRight`: transforms `->` to: `→`
  72156. * * Misc:
  72157. * - `quotesPrimaryEnGb`: transforms `'Foo bar'` to `‘Foo bar’`
  72158. * - `quotesSecondaryEnGb`: transforms `"Foo bar"` to `“Foo bar”`
  72159. * - `quotesPrimaryPl`: transforms `"Foo bar"` to `„Foo bar”`
  72160. * - `quotesSecondaryPl`: transforms `'Foo bar'` to `‚Foo bar’`
  72161. *
  72162. * In order to load additional transformations, use the
  72163. * {@link module:typing/texttransformation~TextTransformationConfig#extra `transformations.extra` option}.
  72164. *
  72165. * In order to narrow down the list of transformations, use the
  72166. * {@link module:typing/texttransformation~TextTransformationConfig#remove `transformations.remove` option}.
  72167. *
  72168. * In order to completely override the supported transformations, use the
  72169. * {@link module:typing/texttransformation~TextTransformationConfig#include `transformations.include` option}.
  72170. *
  72171. * Examples:
  72172. *
  72173. * const transformationsConfig = {
  72174. * include: [
  72175. * // Use only the 'quotes' and 'typography' groups.
  72176. * 'quotes',
  72177. * 'typography',
  72178. *
  72179. * // Plus, some custom transformation.
  72180. * { from: 'CKE', to: 'CKEditor' }
  72181. * ]
  72182. * };
  72183. *
  72184. * const transformationsConfig = {
  72185. * // Remove the 'ellipsis' transformation loaded by the 'typography' group.
  72186. * remove: [ 'ellipsis' ]
  72187. * }
  72188. *
  72189. * @interface TextTransformationConfig
  72190. */
  72191. /* eslint-disable max-len */
  72192. /**
  72193. * The standard list of text transformations supported by the editor. By default it comes pre-configured with a couple dozen of them
  72194. * (see {@link module:typing/texttransformation~TextTransformationConfig} for the full list). You can override this list completely
  72195. * by setting this option or use the other two options
  72196. * ({@link module:typing/texttransformation~TextTransformationConfig#extra `transformations.extra`},
  72197. * {@link module:typing/texttransformation~TextTransformationConfig#remove `transformations.remove`}) to fine-tune the default list.
  72198. *
  72199. * @member {Array.<module:typing/texttransformation~TextTransformationDescription>} module:typing/texttransformation~TextTransformationConfig#include
  72200. */
  72201. /**
  72202. * Additional text transformations that are added to the transformations defined in
  72203. * {@link module:typing/texttransformation~TextTransformationConfig#include `transformations.include`}.
  72204. *
  72205. * const transformationsConfig = {
  72206. * extra: [
  72207. * { from: 'CKE', to: 'CKEditor' }
  72208. * ]
  72209. * };
  72210. *
  72211. * @member {Array.<module:typing/texttransformation~TextTransformationDescription>} module:typing/texttransformation~TextTransformationConfig#extra
  72212. */
  72213. /**
  72214. * The text transformation names that are removed from transformations defined in
  72215. * {@link module:typing/texttransformation~TextTransformationConfig#include `transformations.include`} or
  72216. * {@link module:typing/texttransformation~TextTransformationConfig#extra `transformations.extra`}.
  72217. *
  72218. * const transformationsConfig = {
  72219. * remove: [
  72220. * 'ellipsis', // Remove only 'ellipsis' from the 'typography' group.
  72221. * 'mathematical' // Remove all transformations from the 'mathematical' group.
  72222. * ]
  72223. * }
  72224. *
  72225. * @member {Array.<module:typing/texttransformation~TextTransformationDescription>} module:typing/texttransformation~TextTransformationConfig#remove
  72226. */
  72227. /* eslint-enable max-len */
  72228. /***/ }),
  72229. /***/ "./node_modules/@ckeditor/ckeditor5-typing/src/textwatcher.js":
  72230. /*!********************************************************************!*\
  72231. !*** ./node_modules/@ckeditor/ckeditor5-typing/src/textwatcher.js ***!
  72232. \********************************************************************/
  72233. /*! exports provided: default */
  72234. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  72235. "use strict";
  72236. __webpack_require__.r(__webpack_exports__);
  72237. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return TextWatcher; });
  72238. /* 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");
  72239. /* 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");
  72240. /* harmony import */ var _utils_getlasttextline__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils/getlasttextline */ "./node_modules/@ckeditor/ckeditor5-typing/src/utils/getlasttextline.js");
  72241. /**
  72242. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  72243. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  72244. */
  72245. /**
  72246. * @module typing/textwatcher
  72247. */
  72248. /**
  72249. * The text watcher feature.
  72250. *
  72251. * Fires the {@link module:typing/textwatcher~TextWatcher#event:matched:data `matched:data`},
  72252. * {@link module:typing/textwatcher~TextWatcher#event:matched:selection `matched:selection`} and
  72253. * {@link module:typing/textwatcher~TextWatcher#event:unmatched `unmatched`} events on typing or selection changes.
  72254. *
  72255. * @private
  72256. * @mixes module:utils/observablemixin~ObservableMixin
  72257. */
  72258. class TextWatcher {
  72259. /**
  72260. * Creates a text watcher instance.
  72261. *
  72262. * @param {module:engine/model/model~Model} model
  72263. * @param {Function} testCallback See {@link module:typing/textwatcher~TextWatcher#testCallback}.
  72264. */
  72265. constructor( model, testCallback ) {
  72266. /**
  72267. * The editor's model.
  72268. *
  72269. * @readonly
  72270. * @member {module:engine/model/model~Model}
  72271. */
  72272. this.model = model;
  72273. /**
  72274. * The function used to match the text.
  72275. *
  72276. * The test callback can return 3 values:
  72277. *
  72278. * * `false` if there is no match,
  72279. * * `true` if there is a match,
  72280. * * an object if there is a match and we want to pass some additional information to the {@link #event:matched:data} event.
  72281. *
  72282. * @member {Function} #testCallback
  72283. * @returns {Object} testResult
  72284. */
  72285. this.testCallback = testCallback;
  72286. /**
  72287. * Whether there is a match currently.
  72288. *
  72289. * @readonly
  72290. * @member {Boolean}
  72291. */
  72292. this.hasMatch = false;
  72293. /**
  72294. * Flag indicating whether the `TextWatcher` instance is enabled or disabled.
  72295. * A disabled TextWatcher will not evaluate text.
  72296. *
  72297. * To disable TextWatcher:
  72298. *
  72299. * const watcher = new TextWatcher( editor.model, testCallback );
  72300. *
  72301. * // After this a testCallback will not be called.
  72302. * watcher.isEnabled = false;
  72303. *
  72304. * @observable
  72305. * @member {Boolean} #isEnabled
  72306. */
  72307. this.set( 'isEnabled', true );
  72308. // Toggle text watching on isEnabled state change.
  72309. this.on( 'change:isEnabled', () => {
  72310. if ( this.isEnabled ) {
  72311. this._startListening();
  72312. } else {
  72313. this.stopListening( model.document.selection );
  72314. this.stopListening( model.document );
  72315. }
  72316. } );
  72317. this._startListening();
  72318. }
  72319. /**
  72320. * Starts listening to the editor for typing and selection events.
  72321. *
  72322. * @private
  72323. */
  72324. _startListening() {
  72325. const model = this.model;
  72326. const document = model.document;
  72327. this.listenTo( document.selection, 'change:range', ( evt, { directChange } ) => {
  72328. // Indirect changes (i.e. when the user types or external changes are applied) are handled in the document's change event.
  72329. if ( !directChange ) {
  72330. return;
  72331. }
  72332. // Act only on collapsed selection.
  72333. if ( !document.selection.isCollapsed ) {
  72334. if ( this.hasMatch ) {
  72335. this.fire( 'unmatched' );
  72336. this.hasMatch = false;
  72337. }
  72338. return;
  72339. }
  72340. this._evaluateTextBeforeSelection( 'selection' );
  72341. } );
  72342. this.listenTo( document, 'change:data', ( evt, batch ) => {
  72343. if ( batch.type == 'transparent' ) {
  72344. return;
  72345. }
  72346. this._evaluateTextBeforeSelection( 'data', { batch } );
  72347. } );
  72348. }
  72349. /**
  72350. * Checks the editor content for matched text.
  72351. *
  72352. * @fires matched:data
  72353. * @fires matched:selection
  72354. * @fires unmatched
  72355. *
  72356. * @private
  72357. * @param {'data'|'selection'} suffix A suffix used for generating the event name.
  72358. * @param {Object} data Data object for event.
  72359. */
  72360. _evaluateTextBeforeSelection( suffix, data = {} ) {
  72361. const model = this.model;
  72362. const document = model.document;
  72363. const selection = document.selection;
  72364. const rangeBeforeSelection = model.createRange( model.createPositionAt( selection.focus.parent, 0 ), selection.focus );
  72365. const { text, range } = Object(_utils_getlasttextline__WEBPACK_IMPORTED_MODULE_2__["default"])( rangeBeforeSelection, model );
  72366. const testResult = this.testCallback( text );
  72367. if ( !testResult && this.hasMatch ) {
  72368. this.fire( 'unmatched' );
  72369. }
  72370. this.hasMatch = !!testResult;
  72371. if ( testResult ) {
  72372. const eventData = Object.assign( data, { text, range } );
  72373. // If the test callback returns an object with additional data, assign the data as well.
  72374. if ( typeof testResult == 'object' ) {
  72375. Object.assign( eventData, testResult );
  72376. }
  72377. this.fire( `matched:${ suffix }`, eventData );
  72378. }
  72379. }
  72380. }
  72381. Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_0__["default"])( TextWatcher, _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_1__["default"] );
  72382. /**
  72383. * Fired whenever the text watcher found a match for data changes.
  72384. *
  72385. * @event matched:data
  72386. * @param {Object} data Event data.
  72387. * @param {String} data.text The full text before selection to which the regexp was applied.
  72388. * @param {module:engine/model/range~Range} data.range The range representing the position of the `data.text`.
  72389. * @param {Object} [data.testResult] The additional data returned from the {@link module:typing/textwatcher~TextWatcher#testCallback}.
  72390. */
  72391. /**
  72392. * Fired whenever the text watcher found a match for selection changes.
  72393. *
  72394. * @event matched:selection
  72395. * @param {Object} data Event data.
  72396. * @param {String} data.text The full text before selection.
  72397. * @param {module:engine/model/range~Range} data.range The range representing the position of the `data.text`.
  72398. * @param {Object} [data.testResult] The additional data returned from the {@link module:typing/textwatcher~TextWatcher#testCallback}.
  72399. */
  72400. /**
  72401. * Fired whenever the text does not match anymore. Fired only when the text watcher found a match.
  72402. *
  72403. * @event unmatched
  72404. */
  72405. /***/ }),
  72406. /***/ "./node_modules/@ckeditor/ckeditor5-typing/src/twostepcaretmovement.js":
  72407. /*!*****************************************************************************!*\
  72408. !*** ./node_modules/@ckeditor/ckeditor5-typing/src/twostepcaretmovement.js ***!
  72409. \*****************************************************************************/
  72410. /*! exports provided: default */
  72411. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  72412. "use strict";
  72413. __webpack_require__.r(__webpack_exports__);
  72414. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return TwoStepCaretMovement; });
  72415. /* 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");
  72416. /* 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");
  72417. /**
  72418. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  72419. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  72420. */
  72421. /**
  72422. * @module typing/twostepcaretmovement
  72423. */
  72424. /**
  72425. * This plugin enables the two-step caret (phantom) movement behavior for
  72426. * {@link module:typing/twostepcaretmovement~TwoStepCaretMovement#registerAttribute registered attributes}
  72427. * on arrow right (<kbd>→</kbd>) and left (<kbd>←</kbd>) key press.
  72428. *
  72429. * Thanks to this (phantom) caret movement the user is able to type before/after as well as at the
  72430. * beginning/end of an attribute.
  72431. *
  72432. * **Note:** This plugin support right–to–left (Arabic, Hebrew, etc.) content by mirroring its behavior
  72433. * but for the sake of simplicity examples showcase only left–to–right use–cases.
  72434. *
  72435. * # Forward movement
  72436. *
  72437. * ## "Entering" an attribute:
  72438. *
  72439. * When this plugin is enabled and registered for the `a` attribute and the selection is right before it
  72440. * (at the attribute boundary), pressing the right arrow key will not move the selection but update its
  72441. * attributes accordingly:
  72442. *
  72443. * * When enabled:
  72444. *
  72445. * foo{}<$text a="true">bar</$text>
  72446. *
  72447. * <kbd>→</kbd>
  72448. *
  72449. * foo<$text a="true">{}bar</$text>
  72450. *
  72451. * * When disabled:
  72452. *
  72453. * foo{}<$text a="true">bar</$text>
  72454. *
  72455. * <kbd>→</kbd>
  72456. *
  72457. * foo<$text a="true">b{}ar</$text>
  72458. *
  72459. *
  72460. * ## "Leaving" an attribute:
  72461. *
  72462. * * When enabled:
  72463. *
  72464. * <$text a="true">bar{}</$text>baz
  72465. *
  72466. * <kbd>→</kbd>
  72467. *
  72468. * <$text a="true">bar</$text>{}baz
  72469. *
  72470. * * When disabled:
  72471. *
  72472. * <$text a="true">bar{}</$text>baz
  72473. *
  72474. * <kbd>→</kbd>
  72475. *
  72476. * <$text a="true">bar</$text>b{}az
  72477. *
  72478. * # Backward movement
  72479. *
  72480. * * When enabled:
  72481. *
  72482. * <$text a="true">bar</$text>{}baz
  72483. *
  72484. * <kbd>←</kbd>
  72485. *
  72486. * <$text a="true">bar{}</$text>baz
  72487. *
  72488. * * When disabled:
  72489. *
  72490. * <$text a="true">bar</$text>{}baz
  72491. *
  72492. * <kbd>←</kbd>
  72493. *
  72494. * <$text a="true">ba{}r</$text>b{}az
  72495. *
  72496. * # Multiple attributes
  72497. *
  72498. * * When enabled and many attributes starts or ends at the same position:
  72499. *
  72500. * <$text a="true" b="true">bar</$text>{}baz
  72501. *
  72502. * <kbd>←</kbd>
  72503. *
  72504. * <$text a="true" b="true">bar{}</$text>baz
  72505. *
  72506. * * When enabled and one procedes another:
  72507. *
  72508. * <$text a="true">bar</$text><$text b="true">{}bar</$text>
  72509. *
  72510. * <kbd>←</kbd>
  72511. *
  72512. * <$text a="true">bar{}</$text><$text b="true">bar</$text>
  72513. *
  72514. */
  72515. class TwoStepCaretMovement extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
  72516. /**
  72517. * @inheritDoc
  72518. */
  72519. static get pluginName() {
  72520. return 'TwoStepCaretMovement';
  72521. }
  72522. /**
  72523. * @inheritDoc
  72524. */
  72525. constructor( editor ) {
  72526. super( editor );
  72527. /**
  72528. * A set of attributes to handle.
  72529. *
  72530. * @protected
  72531. * @property {module:typing/twostepcaretmovement~TwoStepCaretMovement}
  72532. */
  72533. this.attributes = new Set();
  72534. /**
  72535. * The current UID of the overridden gravity, as returned by
  72536. * {@link module:engine/model/writer~Writer#overrideSelectionGravity}.
  72537. *
  72538. * @private
  72539. * @member {String}
  72540. */
  72541. this._overrideUid = null;
  72542. }
  72543. /**
  72544. * @inheritDoc
  72545. */
  72546. init() {
  72547. const editor = this.editor;
  72548. const model = editor.model;
  72549. const view = editor.editing.view;
  72550. const locale = editor.locale;
  72551. const modelSelection = model.document.selection;
  72552. // Listen to keyboard events and handle the caret movement according to the 2-step caret logic.
  72553. this.listenTo( view.document, 'arrowKey', ( evt, data ) => {
  72554. // This implementation works only for collapsed selection.
  72555. if ( !modelSelection.isCollapsed ) {
  72556. return;
  72557. }
  72558. // When user tries to expand the selection or jump over the whole word or to the beginning/end then
  72559. // two-steps movement is not necessary.
  72560. if ( data.shiftKey || data.altKey || data.ctrlKey ) {
  72561. return;
  72562. }
  72563. const arrowRightPressed = data.keyCode == _ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_1__["keyCodes"].arrowright;
  72564. const arrowLeftPressed = data.keyCode == _ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_1__["keyCodes"].arrowleft;
  72565. // When neither left or right arrow has been pressed then do noting.
  72566. if ( !arrowRightPressed && !arrowLeftPressed ) {
  72567. return;
  72568. }
  72569. const contentDirection = locale.contentLanguageDirection;
  72570. let isMovementHandled = false;
  72571. if ( ( contentDirection === 'ltr' && arrowRightPressed ) || ( contentDirection === 'rtl' && arrowLeftPressed ) ) {
  72572. isMovementHandled = this._handleForwardMovement( data );
  72573. } else {
  72574. isMovementHandled = this._handleBackwardMovement( data );
  72575. }
  72576. // Stop the keydown event if the two-step caret movement handled it. Avoid collisions
  72577. // with other features which may also take over the caret movement (e.g. Widget).
  72578. if ( isMovementHandled === true ) {
  72579. evt.stop();
  72580. }
  72581. }, { context: '$text', priority: 'highest' } );
  72582. /**
  72583. * A flag indicating that the automatic gravity restoration should not happen upon the next
  72584. * gravity restoration.
  72585. * {@link module:engine/model/selection~Selection#event:change:range} event.
  72586. *
  72587. * @private
  72588. * @member {String}
  72589. */
  72590. this._isNextGravityRestorationSkipped = false;
  72591. // The automatic gravity restoration logic.
  72592. this.listenTo( modelSelection, 'change:range', ( evt, data ) => {
  72593. // Skipping the automatic restoration is needed if the selection should change
  72594. // but the gravity must remain overridden afterwards. See the #handleBackwardMovement
  72595. // to learn more.
  72596. if ( this._isNextGravityRestorationSkipped ) {
  72597. this._isNextGravityRestorationSkipped = false;
  72598. return;
  72599. }
  72600. // Skip automatic restore when the gravity is not overridden — simply, there's nothing to restore
  72601. // at this moment.
  72602. if ( !this._isGravityOverridden ) {
  72603. return;
  72604. }
  72605. // Skip automatic restore when the change is indirect AND the selection is at the attribute boundary.
  72606. // It means that e.g. if the change was external (collaboration) and the user had their
  72607. // selection around the link, its gravity should remain intact in this change:range event.
  72608. if ( !data.directChange && isBetweenDifferentAttributes( modelSelection.getFirstPosition(), this.attributes ) ) {
  72609. return;
  72610. }
  72611. this._restoreGravity();
  72612. } );
  72613. }
  72614. /**
  72615. * Registers a given attribute for the two-step caret movement.
  72616. *
  72617. * @param {String} attribute Name of the attribute to handle.
  72618. */
  72619. registerAttribute( attribute ) {
  72620. this.attributes.add( attribute );
  72621. }
  72622. /**
  72623. * Updates the document selection and the view according to the two–step caret movement state
  72624. * when moving **forwards**. Executed upon `keypress` in the {@link module:engine/view/view~View}.
  72625. *
  72626. * @private
  72627. * @param {module:engine/view/observer/domeventdata~DomEventData} data Data of the key press.
  72628. * @returns {Boolean} `true` when the handler prevented caret movement
  72629. */
  72630. _handleForwardMovement( data ) {
  72631. const attributes = this.attributes;
  72632. const model = this.editor.model;
  72633. const selection = model.document.selection;
  72634. const position = selection.getFirstPosition();
  72635. // DON'T ENGAGE 2-SCM if gravity is already overridden. It means that we just entered
  72636. //
  72637. // <paragraph>foo<$text attribute>{}bar</$text>baz</paragraph>
  72638. //
  72639. // or left the attribute
  72640. //
  72641. // <paragraph>foo<$text attribute>bar</$text>{}baz</paragraph>
  72642. //
  72643. // and the gravity will be restored automatically.
  72644. if ( this._isGravityOverridden ) {
  72645. return false;
  72646. }
  72647. // DON'T ENGAGE 2-SCM when the selection is at the beginning of the block AND already has the
  72648. // attribute:
  72649. // * when the selection was initially set there using the mouse,
  72650. // * when the editor has just started
  72651. //
  72652. // <paragraph><$text attribute>{}bar</$text>baz</paragraph>
  72653. //
  72654. if ( position.isAtStart && hasAnyAttribute( selection, attributes ) ) {
  72655. return false;
  72656. }
  72657. // ENGAGE 2-SCM When at least one of the observed attributes changes its value (incl. starts, ends).
  72658. //
  72659. // <paragraph>foo<$text attribute>bar{}</$text>baz</paragraph>
  72660. // <paragraph>foo<$text attribute>bar{}</$text><$text otherAttribute>baz</$text></paragraph>
  72661. // <paragraph>foo<$text attribute=1>bar{}</$text><$text attribute=2>baz</$text></paragraph>
  72662. // <paragraph>foo{}<$text attribute>bar</$text>baz</paragraph>
  72663. //
  72664. if ( isBetweenDifferentAttributes( position, attributes ) ) {
  72665. preventCaretMovement( data );
  72666. this._overrideGravity();
  72667. return true;
  72668. }
  72669. }
  72670. /**
  72671. * Updates the document selection and the view according to the two–step caret movement state
  72672. * when moving **backwards**. Executed upon `keypress` in the {@link module:engine/view/view~View}.
  72673. *
  72674. * @private
  72675. * @param {module:engine/view/observer/domeventdata~DomEventData} data Data of the key press.
  72676. * @returns {Boolean} `true` when the handler prevented caret movement
  72677. */
  72678. _handleBackwardMovement( data ) {
  72679. const attributes = this.attributes;
  72680. const model = this.editor.model;
  72681. const selection = model.document.selection;
  72682. const position = selection.getFirstPosition();
  72683. // When the gravity is already overridden (by this plugin), it means we are on the two-step position.
  72684. // Prevent the movement, restore the gravity and update selection attributes.
  72685. //
  72686. // <paragraph>foo<$text attribute=1>bar</$text><$text attribute=2>{}baz</$text></paragraph>
  72687. // <paragraph>foo<$text attribute>bar</$text><$text otherAttribute>{}baz</$text></paragraph>
  72688. // <paragraph>foo<$text attribute>{}bar</$text>baz</paragraph>
  72689. // <paragraph>foo<$text attribute>bar</$text>{}baz</paragraph>
  72690. //
  72691. if ( this._isGravityOverridden ) {
  72692. preventCaretMovement( data );
  72693. this._restoreGravity();
  72694. setSelectionAttributesFromTheNodeBefore( model, attributes, position );
  72695. return true;
  72696. } else {
  72697. // REMOVE SELECTION ATTRIBUTE when restoring gravity towards a non-existent content at the
  72698. // beginning of the block.
  72699. //
  72700. // <paragraph>{}<$text attribute>bar</$text></paragraph>
  72701. //
  72702. if ( position.isAtStart ) {
  72703. if ( hasAnyAttribute( selection, attributes ) ) {
  72704. preventCaretMovement( data );
  72705. setSelectionAttributesFromTheNodeBefore( model, attributes, position );
  72706. return true;
  72707. }
  72708. return false;
  72709. }
  72710. // When we are moving from natural gravity, to the position of the 2SCM, we need to override the gravity,
  72711. // and make sure it won't be restored. Unless it's at the end of the block and an observed attribute.
  72712. // We need to check if the caret is a one position before the attribute boundary:
  72713. //
  72714. // <paragraph>foo<$text attribute=1>bar</$text><$text attribute=2>b{}az</$text></paragraph>
  72715. // <paragraph>foo<$text attribute>bar</$text><$text otherAttribute>b{}az</$text></paragraph>
  72716. // <paragraph>foo<$text attribute>b{}ar</$text>baz</paragraph>
  72717. // <paragraph>foo<$text attribute>bar</$text>b{}az</paragraph>
  72718. //
  72719. if ( isStepAfterAnyAttributeBoundary( position, attributes ) ) {
  72720. // ENGAGE 2-SCM if the selection has no attribute. This may happen when the user
  72721. // left the attribute using a FORWARD 2-SCM.
  72722. //
  72723. // <paragraph><$text attribute>bar</$text>{}</paragraph>
  72724. //
  72725. if (
  72726. position.isAtEnd &&
  72727. !hasAnyAttribute( selection, attributes ) &&
  72728. isBetweenDifferentAttributes( position, attributes )
  72729. ) {
  72730. preventCaretMovement( data );
  72731. setSelectionAttributesFromTheNodeBefore( model, attributes, position );
  72732. return true;
  72733. }
  72734. // Skip the automatic gravity restore upon the next selection#change:range event.
  72735. // If not skipped, it would automatically restore the gravity, which should remain
  72736. // overridden.
  72737. this._isNextGravityRestorationSkipped = true;
  72738. this._overrideGravity();
  72739. // Don't return "true" here because we didn't call _preventCaretMovement.
  72740. // Returning here will destabilize the filler logic, which also listens to
  72741. // keydown (and the event would be stopped).
  72742. return false;
  72743. }
  72744. }
  72745. }
  72746. /**
  72747. * `true` when the gravity is overridden for the plugin.
  72748. *
  72749. * @readonly
  72750. * @private
  72751. * @type {Boolean}
  72752. */
  72753. get _isGravityOverridden() {
  72754. return !!this._overrideUid;
  72755. }
  72756. /**
  72757. * Overrides the gravity using the {@link module:engine/model/writer~Writer model writer}
  72758. * and stores the information about this fact in the {@link #_overrideUid}.
  72759. *
  72760. * A shorthand for {@link module:engine/model/writer~Writer#overrideSelectionGravity}.
  72761. *
  72762. * @private
  72763. */
  72764. _overrideGravity() {
  72765. this._overrideUid = this.editor.model.change( writer => {
  72766. return writer.overrideSelectionGravity();
  72767. } );
  72768. }
  72769. /**
  72770. * Restores the gravity using the {@link module:engine/model/writer~Writer model writer}.
  72771. *
  72772. * A shorthand for {@link module:engine/model/writer~Writer#restoreSelectionGravity}.
  72773. *
  72774. * @private
  72775. */
  72776. _restoreGravity() {
  72777. this.editor.model.change( writer => {
  72778. writer.restoreSelectionGravity( this._overrideUid );
  72779. this._overrideUid = null;
  72780. } );
  72781. }
  72782. }
  72783. // Checks whether the selection has any of given attributes.
  72784. //
  72785. // @param {module:engine/model/documentselection~DocumentSelection} selection
  72786. // @param {Iterable.<String>} attributes
  72787. function hasAnyAttribute( selection, attributes ) {
  72788. for ( const observedAttribute of attributes ) {
  72789. if ( selection.hasAttribute( observedAttribute ) ) {
  72790. return true;
  72791. }
  72792. }
  72793. return false;
  72794. }
  72795. // Applies the given attributes to the current selection using using the
  72796. // values from the node before the current position. Uses
  72797. // the {@link module:engine/model/writer~Writer model writer}.
  72798. //
  72799. // @param {module:engine/model/model~Model}
  72800. // @param {Iterable.<String>} attributess
  72801. // @param {module:engine/model/position~Position} position
  72802. function setSelectionAttributesFromTheNodeBefore( model, attributes, position ) {
  72803. const nodeBefore = position.nodeBefore;
  72804. model.change( writer => {
  72805. if ( nodeBefore ) {
  72806. writer.setSelectionAttribute( nodeBefore.getAttributes() );
  72807. } else {
  72808. writer.removeSelectionAttribute( attributes );
  72809. }
  72810. } );
  72811. }
  72812. // Prevents the caret movement in the view by calling `preventDefault` on the event data.
  72813. //
  72814. // @alias data.preventDefault
  72815. function preventCaretMovement( data ) {
  72816. data.preventDefault();
  72817. }
  72818. // Checks whether the step before `isBetweenDifferentAttributes()`.
  72819. //
  72820. // @param {module:engine/model/position~Position} position
  72821. // @param {String} attribute
  72822. function isStepAfterAnyAttributeBoundary( position, attributes ) {
  72823. const positionBefore = position.getShiftedBy( -1 );
  72824. return isBetweenDifferentAttributes( positionBefore, attributes );
  72825. }
  72826. // Checks whether the given position is between different values of given attributes.
  72827. //
  72828. // @param {module:engine/model/position~Position} position
  72829. // @param {Iterable.<String>} attributes
  72830. function isBetweenDifferentAttributes( position, attributes ) {
  72831. const { nodeBefore, nodeAfter } = position;
  72832. for ( const observedAttribute of attributes ) {
  72833. const attrBefore = nodeBefore ? nodeBefore.getAttribute( observedAttribute ) : undefined;
  72834. const attrAfter = nodeAfter ? nodeAfter.getAttribute( observedAttribute ) : undefined;
  72835. if ( attrAfter !== attrBefore ) {
  72836. return true;
  72837. }
  72838. }
  72839. return false;
  72840. }
  72841. /***/ }),
  72842. /***/ "./node_modules/@ckeditor/ckeditor5-typing/src/typing.js":
  72843. /*!***************************************************************!*\
  72844. !*** ./node_modules/@ckeditor/ckeditor5-typing/src/typing.js ***!
  72845. \***************************************************************/
  72846. /*! exports provided: default */
  72847. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  72848. "use strict";
  72849. __webpack_require__.r(__webpack_exports__);
  72850. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Typing; });
  72851. /* 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");
  72852. /* harmony import */ var _input__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./input */ "./node_modules/@ckeditor/ckeditor5-typing/src/input.js");
  72853. /* harmony import */ var _delete__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./delete */ "./node_modules/@ckeditor/ckeditor5-typing/src/delete.js");
  72854. /**
  72855. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  72856. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  72857. */
  72858. /**
  72859. * @module typing/typing
  72860. */
  72861. /**
  72862. * The typing feature. It handles typing.
  72863. *
  72864. * This is a "glue" plugin which loads the {@link module:typing/input~Input} and {@link module:typing/delete~Delete}
  72865. * plugins.
  72866. *
  72867. * @extends module:core/plugin~Plugin
  72868. */
  72869. class Typing extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
  72870. static get requires() {
  72871. return [ _input__WEBPACK_IMPORTED_MODULE_1__["default"], _delete__WEBPACK_IMPORTED_MODULE_2__["default"] ];
  72872. }
  72873. /**
  72874. * @inheritDoc
  72875. */
  72876. static get pluginName() {
  72877. return 'Typing';
  72878. }
  72879. }
  72880. /**
  72881. * The configuration of the typing features. Used by the features from the `@ckeditor/ckeditor5-typing` package.
  72882. *
  72883. * Read more in {@link module:typing/typing~TypingConfig}.
  72884. *
  72885. * @member {module:typing/typing~TypingConfig} module:core/editor/editorconfig~EditorConfig#typing
  72886. */
  72887. /**
  72888. * The configuration of the typing features. Used by the typing features in `@ckeditor/ckeditor5-typing` package.
  72889. *
  72890. * ClassicEditor
  72891. * .create( editorElement, {
  72892. * typing: ... // Typing feature options.
  72893. * } )
  72894. * .then( ... )
  72895. * .catch( ... );
  72896. *
  72897. * See {@link module:core/editor/editorconfig~EditorConfig all editor options}.
  72898. *
  72899. * @interface TypingConfig
  72900. */
  72901. /**
  72902. * The granularity of undo/redo for typing and deleting. The value `20` means (more or less) that a new undo step
  72903. * is created every 20 characters are inserted or deleted.
  72904. *
  72905. * @member {Number} [module:typing/typing~TypingConfig#undoStep=20]
  72906. */
  72907. /***/ }),
  72908. /***/ "./node_modules/@ckeditor/ckeditor5-typing/src/utils/changebuffer.js":
  72909. /*!***************************************************************************!*\
  72910. !*** ./node_modules/@ckeditor/ckeditor5-typing/src/utils/changebuffer.js ***!
  72911. \***************************************************************************/
  72912. /*! exports provided: default */
  72913. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  72914. "use strict";
  72915. __webpack_require__.r(__webpack_exports__);
  72916. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ChangeBuffer; });
  72917. /**
  72918. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  72919. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  72920. */
  72921. /**
  72922. * @module typing/utils/changebuffer
  72923. */
  72924. /**
  72925. * Change buffer allows to group atomic changes (like characters that have been typed) into
  72926. * {@link module:engine/model/batch~Batch batches}.
  72927. *
  72928. * Batches represent single undo steps, hence changes added to one single batch are undone together.
  72929. *
  72930. * The buffer has a configurable limit of atomic changes that it can accommodate. After the limit was
  72931. * exceeded (see {@link ~ChangeBuffer#input}), a new batch is created in {@link ~ChangeBuffer#batch}.
  72932. *
  72933. * To use the change buffer you need to let it know about the number of changes that were added to the batch:
  72934. *
  72935. * const buffer = new ChangeBuffer( model, LIMIT );
  72936. *
  72937. * // Later on in your feature:
  72938. * buffer.batch.insert( pos, insertedCharacters );
  72939. * buffer.input( insertedCharacters.length );
  72940. *
  72941. */
  72942. class ChangeBuffer {
  72943. /**
  72944. * Creates a new instance of the change buffer.
  72945. *
  72946. * @param {module:engine/model/model~Model} model
  72947. * @param {Number} [limit=20] The maximum number of atomic changes which can be contained in one batch.
  72948. */
  72949. constructor( model, limit = 20 ) {
  72950. /**
  72951. * The model instance.
  72952. *
  72953. * @readonly
  72954. * @member {module:engine/model/model~Model} #model
  72955. */
  72956. this.model = model;
  72957. /**
  72958. * The number of atomic changes in the buffer. Once it exceeds the {@link #limit},
  72959. * the {@link #batch batch} is set to a new one.
  72960. *
  72961. * @readonly
  72962. * @member {Number} #size
  72963. */
  72964. this.size = 0;
  72965. /**
  72966. * The maximum number of atomic changes which can be contained in one batch.
  72967. *
  72968. * @readonly
  72969. * @member {Number} #limit
  72970. */
  72971. this.limit = limit;
  72972. /**
  72973. * Whether the buffer is locked. A locked buffer cannot be reset unless it gets unlocked.
  72974. *
  72975. * @readonly
  72976. * @member {Boolean} #isLocked
  72977. */
  72978. this.isLocked = false;
  72979. // The function to be called in order to notify the buffer about batches which appeared in the document.
  72980. // The callback will check whether it is a new batch and in that case the buffer will be flushed.
  72981. //
  72982. // The reason why the buffer needs to be flushed whenever a new batch appears is that the changes added afterwards
  72983. // should be added to a new batch. For instance, when the user types, then inserts an image, and then types again,
  72984. // the characters typed after inserting the image should be added to a different batch than the characters typed before.
  72985. this._changeCallback = ( evt, batch ) => {
  72986. if ( batch.type != 'transparent' && batch !== this._batch ) {
  72987. this._reset( true );
  72988. }
  72989. };
  72990. this._selectionChangeCallback = () => {
  72991. this._reset();
  72992. };
  72993. this.model.document.on( 'change', this._changeCallback );
  72994. this.model.document.selection.on( 'change:range', this._selectionChangeCallback );
  72995. this.model.document.selection.on( 'change:attribute', this._selectionChangeCallback );
  72996. /**
  72997. * The current batch instance.
  72998. *
  72999. * @private
  73000. * @member #_batch
  73001. */
  73002. /**
  73003. * The callback to document the change event which later needs to be removed.
  73004. *
  73005. * @private
  73006. * @member #_changeCallback
  73007. */
  73008. /**
  73009. * The callback to document selection `change:attribute` and `change:range` events which resets the buffer.
  73010. *
  73011. * @private
  73012. * @member #_selectionChangeCallback
  73013. */
  73014. }
  73015. /**
  73016. * The current batch to which a feature should add its operations. Once the {@link #size}
  73017. * is reached or exceeds the {@link #limit}, the batch is set to a new instance and the size is reset.
  73018. *
  73019. * @type {module:engine/model/batch~Batch}
  73020. */
  73021. get batch() {
  73022. if ( !this._batch ) {
  73023. this._batch = this.model.createBatch();
  73024. }
  73025. return this._batch;
  73026. }
  73027. /**
  73028. * The input number of changes into the buffer. Once the {@link #size} is
  73029. * reached or exceeds the {@link #limit}, the batch is set to a new instance and the size is reset.
  73030. *
  73031. * @param {Number} changeCount The number of atomic changes to input.
  73032. */
  73033. input( changeCount ) {
  73034. this.size += changeCount;
  73035. if ( this.size >= this.limit ) {
  73036. this._reset( true );
  73037. }
  73038. }
  73039. /**
  73040. * Locks the buffer.
  73041. */
  73042. lock() {
  73043. this.isLocked = true;
  73044. }
  73045. /**
  73046. * Unlocks the buffer.
  73047. */
  73048. unlock() {
  73049. this.isLocked = false;
  73050. }
  73051. /**
  73052. * Destroys the buffer.
  73053. */
  73054. destroy() {
  73055. this.model.document.off( 'change', this._changeCallback );
  73056. this.model.document.selection.off( 'change:range', this._selectionChangeCallback );
  73057. this.model.document.selection.off( 'change:attribute', this._selectionChangeCallback );
  73058. }
  73059. /**
  73060. * Resets the change buffer.
  73061. *
  73062. * @private
  73063. * @param {Boolean} [ignoreLock] Whether internal lock {@link #isLocked} should be ignored.
  73064. */
  73065. _reset( ignoreLock ) {
  73066. if ( !this.isLocked || ignoreLock ) {
  73067. this._batch = null;
  73068. this.size = 0;
  73069. }
  73070. }
  73071. }
  73072. /***/ }),
  73073. /***/ "./node_modules/@ckeditor/ckeditor5-typing/src/utils/findattributerange.js":
  73074. /*!*********************************************************************************!*\
  73075. !*** ./node_modules/@ckeditor/ckeditor5-typing/src/utils/findattributerange.js ***!
  73076. \*********************************************************************************/
  73077. /*! exports provided: default */
  73078. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  73079. "use strict";
  73080. __webpack_require__.r(__webpack_exports__);
  73081. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return findAttributeRange; });
  73082. /**
  73083. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  73084. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  73085. */
  73086. /**
  73087. * @module typing/utils/findattributerange
  73088. */
  73089. /**
  73090. * Returns a model range that covers all consecutive nodes with the same `attributeName` and its `value`
  73091. * that intersect the given `position`.
  73092. *
  73093. * It can be used e.g. to get the entire range on which the `linkHref` attribute needs to be changed when having a
  73094. * selection inside a link.
  73095. *
  73096. * @param {module:engine/model/position~Position} position The start position.
  73097. * @param {String} attributeName The attribute name.
  73098. * @param {String} value The attribute value.
  73099. * @param {module:engine/model/model~Model} model The model instance.
  73100. * @returns {module:engine/model/range~Range} The link range.
  73101. */
  73102. function findAttributeRange( position, attributeName, value, model ) {
  73103. return model.createRange(
  73104. _findBound( position, attributeName, value, true, model ),
  73105. _findBound( position, attributeName, value, false, model )
  73106. );
  73107. }
  73108. // Walks forward or backward (depends on the `lookBack` flag), node by node, as long as they have the same attribute value
  73109. // and returns a position just before or after (depends on the `lookBack` flag) the last matched node.
  73110. //
  73111. // @param {module:engine/model/position~Position} position The start position.
  73112. // @param {String} attributeName The attribute name.
  73113. // @param {String} value The attribute value.
  73114. // @param {Boolean} lookBack Whether the walk direction is forward (`false`) or backward (`true`).
  73115. // @returns {module:engine/model/position~Position} The position just before the last matched node.
  73116. function _findBound( position, attributeName, value, lookBack, model ) {
  73117. // Get node before or after position (depends on `lookBack` flag).
  73118. // When position is inside text node then start searching from text node.
  73119. let node = position.textNode || ( lookBack ? position.nodeBefore : position.nodeAfter );
  73120. let lastNode = null;
  73121. while ( node && node.getAttribute( attributeName ) == value ) {
  73122. lastNode = node;
  73123. node = lookBack ? node.previousSibling : node.nextSibling;
  73124. }
  73125. return lastNode ? model.createPositionAt( lastNode, lookBack ? 'before' : 'after' ) : position;
  73126. }
  73127. /***/ }),
  73128. /***/ "./node_modules/@ckeditor/ckeditor5-typing/src/utils/getlasttextline.js":
  73129. /*!******************************************************************************!*\
  73130. !*** ./node_modules/@ckeditor/ckeditor5-typing/src/utils/getlasttextline.js ***!
  73131. \******************************************************************************/
  73132. /*! exports provided: default */
  73133. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  73134. "use strict";
  73135. __webpack_require__.r(__webpack_exports__);
  73136. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return getLastTextLine; });
  73137. /**
  73138. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  73139. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  73140. */
  73141. /**
  73142. * @module typing/utils/getlasttextline
  73143. */
  73144. /**
  73145. * Returns the last text line from the given range.
  73146. *
  73147. * "The last text line" is understood as text (from one or more text nodes) which is limited either by a parent block
  73148. * or by inline elements (e.g. `<softBreak>`).
  73149. *
  73150. * const rangeToCheck = model.createRange(
  73151. * model.createPositionAt( paragraph, 0 ),
  73152. * model.createPositionAt( paragraph, 'end' )
  73153. * );
  73154. *
  73155. * const { text, range } = getLastTextLine( rangeToCheck, model );
  73156. *
  73157. * For model below, the returned `text` will be "Foo bar baz" and `range` will be set on whole `<paragraph>` content:
  73158. *
  73159. * <paragraph>Foo bar baz<paragraph>
  73160. *
  73161. * However, in below case, `text` will be set to "baz" and `range` will be set only on "baz".
  73162. *
  73163. * <paragraph>Foo<softBreak></softBreak>bar<softBreak></softBreak>baz<paragraph>
  73164. *
  73165. * @protected
  73166. * @param {module:engine/model/range~Range} range
  73167. * @param {module:engine/model/model~Model} model
  73168. * @returns {module:typing/utils/getlasttextline~LastTextLineData}
  73169. */
  73170. function getLastTextLine( range, model ) {
  73171. let start = range.start;
  73172. const text = Array.from( range.getItems() ).reduce( ( rangeText, node ) => {
  73173. // Trim text to a last occurrence of an inline element and update range start.
  73174. if ( !( node.is( '$text' ) || node.is( '$textProxy' ) ) ) {
  73175. start = model.createPositionAfter( node );
  73176. return '';
  73177. }
  73178. return rangeText + node.data;
  73179. }, '' );
  73180. return { text, range: model.createRange( start, range.end ) };
  73181. }
  73182. /**
  73183. * The value returned by {@link module:typing/utils/getlasttextline~getLastTextLine}.
  73184. *
  73185. * @typedef {Object} module:typing/utils/getlasttextline~LastTextLineData
  73186. *
  73187. * @property {String} text The text from the text nodes in the last text line.
  73188. * @property {module:engine/model/range~Range} range The range set on the text nodes in the last text line.
  73189. */
  73190. /***/ }),
  73191. /***/ "./node_modules/@ckeditor/ckeditor5-typing/src/utils/injecttypingmutationshandling.js":
  73192. /*!********************************************************************************************!*\
  73193. !*** ./node_modules/@ckeditor/ckeditor5-typing/src/utils/injecttypingmutationshandling.js ***!
  73194. \********************************************************************************************/
  73195. /*! exports provided: default */
  73196. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  73197. "use strict";
  73198. __webpack_require__.r(__webpack_exports__);
  73199. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return injectTypingMutationsHandling; });
  73200. /* 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");
  73201. /* 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");
  73202. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils */ "./node_modules/@ckeditor/ckeditor5-typing/src/utils/utils.js");
  73203. /**
  73204. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  73205. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  73206. */
  73207. /**
  73208. * @module typing/utils/injecttypingmutationshandling
  73209. */
  73210. /**
  73211. * Handles mutations caused by normal typing.
  73212. *
  73213. * @param {module:core/editor/editor~Editor} editor The editor instance.
  73214. */
  73215. function injectTypingMutationsHandling( editor ) {
  73216. editor.editing.view.document.on( 'mutations', ( evt, mutations, viewSelection ) => {
  73217. new MutationHandler( editor ).handle( mutations, viewSelection );
  73218. } );
  73219. }
  73220. /**
  73221. * Helper class for translating DOM mutations into model changes.
  73222. *
  73223. * @private
  73224. */
  73225. class MutationHandler {
  73226. /**
  73227. * Creates an instance of the mutation handler.
  73228. *
  73229. * @param {module:core/editor/editor~Editor} editor
  73230. */
  73231. constructor( editor ) {
  73232. /**
  73233. * Editor instance for which mutations are handled.
  73234. *
  73235. * @readonly
  73236. * @member {module:core/editor/editor~Editor} #editor
  73237. */
  73238. this.editor = editor;
  73239. /**
  73240. * The editing controller.
  73241. *
  73242. * @readonly
  73243. * @member {module:engine/controller/editingcontroller~EditingController} #editing
  73244. */
  73245. this.editing = this.editor.editing;
  73246. }
  73247. /**
  73248. * Handles given mutations.
  73249. *
  73250. * @param {Array.<module:engine/view/observer/mutationobserver~MutatedText|
  73251. * module:engine/view/observer/mutationobserver~MutatedChildren>} mutations
  73252. * @param {module:engine/view/selection~Selection|null} viewSelection
  73253. */
  73254. handle( mutations, viewSelection ) {
  73255. if ( Object(_utils__WEBPACK_IMPORTED_MODULE_2__["containerChildrenMutated"])( mutations ) ) {
  73256. this._handleContainerChildrenMutations( mutations, viewSelection );
  73257. } else {
  73258. for ( const mutation of mutations ) {
  73259. // Fortunately it will never be both.
  73260. this._handleTextMutation( mutation, viewSelection );
  73261. this._handleTextNodeInsertion( mutation );
  73262. }
  73263. }
  73264. }
  73265. /**
  73266. * Handles situations when container's children mutated during input. This can happen when
  73267. * the browser is trying to "fix" DOM in certain situations. For example, when the user starts to type
  73268. * in `<p><a href=""><i>Link{}</i></a></p>`, the browser might change the order of elements
  73269. * to `<p><i><a href="">Link</a>x{}</i></p>`. A similar situation happens when the spell checker
  73270. * replaces a word wrapped with `<strong>` with a word wrapped with a `<b>` element.
  73271. *
  73272. * To handle such situations, the common DOM ancestor of all mutations is converted to the model representation
  73273. * and then compared with the current model to calculate the proper text change.
  73274. *
  73275. * Note: Single text node insertion is handled in {@link #_handleTextNodeInsertion} and text node mutation is handled
  73276. * in {@link #_handleTextMutation}).
  73277. *
  73278. * @private
  73279. * @param {Array.<module:engine/view/observer/mutationobserver~MutatedText|
  73280. * module:engine/view/observer/mutationobserver~MutatedChildren>} mutations
  73281. * @param {module:engine/view/selection~Selection|null} viewSelection
  73282. */
  73283. _handleContainerChildrenMutations( mutations, viewSelection ) {
  73284. // Get common ancestor of all mutations.
  73285. const mutationsCommonAncestor = getMutationsContainer( mutations );
  73286. // Quit if there is no common ancestor.
  73287. if ( !mutationsCommonAncestor ) {
  73288. return;
  73289. }
  73290. const domConverter = this.editor.editing.view.domConverter;
  73291. // Get common ancestor in DOM.
  73292. const domMutationCommonAncestor = domConverter.mapViewToDom( mutationsCommonAncestor );
  73293. // Create fresh DomConverter so it will not use existing mapping and convert current DOM to model.
  73294. // This wouldn't be needed if DomConverter would allow to create fresh view without checking any mappings.
  73295. const freshDomConverter = new _ckeditor_ckeditor5_engine_src_view_domconverter__WEBPACK_IMPORTED_MODULE_1__["default"]( this.editor.editing.view.document );
  73296. const modelFromCurrentDom = this.editor.data.toModel(
  73297. freshDomConverter.domToView( domMutationCommonAncestor )
  73298. ).getChild( 0 );
  73299. // Current model.
  73300. const currentModel = this.editor.editing.mapper.toModelElement( mutationsCommonAncestor );
  73301. // If common ancestor is not mapped, do not do anything. It probably is a parent of another view element.
  73302. // That means that we would need to diff model elements (see `if` below). Better return early instead of
  73303. // trying to get a reasonable model ancestor. It will fell into the `if` below anyway.
  73304. // This situation happens for example for lists. If `<ul>` is a common ancestor, `currentModel` is `undefined`
  73305. // because `<ul>` is not mapped (`<li>`s are).
  73306. // See https://github.com/ckeditor/ckeditor5/issues/718.
  73307. if ( !currentModel ) {
  73308. return;
  73309. }
  73310. // Get children from both ancestors.
  73311. const modelFromDomChildren = Array.from( modelFromCurrentDom.getChildren() );
  73312. const currentModelChildren = Array.from( currentModel.getChildren() );
  73313. // Remove the last `<softBreak>` from the end of `modelFromDomChildren` if there is no `<softBreak>` in current model.
  73314. // If the described scenario happened, it means that this is a bogus `<br />` added by a browser.
  73315. const lastDomChild = modelFromDomChildren[ modelFromDomChildren.length - 1 ];
  73316. const lastCurrentChild = currentModelChildren[ currentModelChildren.length - 1 ];
  73317. const isLastDomChildSoftBreak = lastDomChild && lastDomChild.is( 'element', 'softBreak' );
  73318. const isLastCurrentChildSoftBreak = lastCurrentChild && !lastCurrentChild.is( 'element', 'softBreak' );
  73319. if ( isLastDomChildSoftBreak && isLastCurrentChildSoftBreak ) {
  73320. modelFromDomChildren.pop();
  73321. }
  73322. const schema = this.editor.model.schema;
  73323. // Skip situations when common ancestor has any container elements.
  73324. if ( !isSafeForTextMutation( modelFromDomChildren, schema ) || !isSafeForTextMutation( currentModelChildren, schema ) ) {
  73325. return;
  73326. }
  73327. // Replace &nbsp; inserted by the browser with normal space. See comment in `_handleTextMutation`.
  73328. // Replace non-texts with any character. This is potentially dangerous but passes in manual tests. The thing is
  73329. // that we need to take care of proper indexes so we cannot simply remove non-text elements from the content.
  73330. // By inserting a character we keep all the real texts on their indexes.
  73331. const newText = modelFromDomChildren.map( item => item.is( '$text' ) ? item.data : '@' ).join( '' ).replace( /\u00A0/g, ' ' );
  73332. const oldText = currentModelChildren.map( item => item.is( '$text' ) ? item.data : '@' ).join( '' ).replace( /\u00A0/g, ' ' );
  73333. // Do nothing if mutations created same text.
  73334. if ( oldText === newText ) {
  73335. return;
  73336. }
  73337. const diffResult = Object(_ckeditor_ckeditor5_utils_src_diff__WEBPACK_IMPORTED_MODULE_0__["default"])( oldText, newText );
  73338. const { firstChangeAt, insertions, deletions } = calculateChanges( diffResult );
  73339. // Try setting new model selection according to passed view selection.
  73340. let modelSelectionRange = null;
  73341. if ( viewSelection ) {
  73342. modelSelectionRange = this.editing.mapper.toModelRange( viewSelection.getFirstRange() );
  73343. }
  73344. const insertText = newText.substr( firstChangeAt, insertions );
  73345. const removeRange = this.editor.model.createRange(
  73346. this.editor.model.createPositionAt( currentModel, firstChangeAt ),
  73347. this.editor.model.createPositionAt( currentModel, firstChangeAt + deletions )
  73348. );
  73349. this.editor.execute( 'input', {
  73350. text: insertText,
  73351. range: removeRange,
  73352. resultRange: modelSelectionRange
  73353. } );
  73354. }
  73355. /**
  73356. * @private
  73357. */
  73358. _handleTextMutation( mutation, viewSelection ) {
  73359. if ( mutation.type != 'text' ) {
  73360. return;
  73361. }
  73362. // Replace &nbsp; inserted by the browser with normal space.
  73363. // We want only normal spaces in the model and in the view. Renderer and DOM Converter will be then responsible
  73364. // for rendering consecutive spaces using &nbsp;, but the model and the view has to be clear.
  73365. // Other feature may introduce inserting non-breakable space on specific key stroke (for example shift + space).
  73366. // However then it will be handled outside of mutations, like enter key is.
  73367. // The replacing is here because it has to be done before `diff` and `diffToChanges` functions, as they
  73368. // take `newText` and compare it to (cleaned up) view.
  73369. // It could also be done in mutation observer too, however if any outside plugin would like to
  73370. // introduce additional events for mutations, they would get already cleaned up version (this may be good or not).
  73371. const newText = mutation.newText.replace( /\u00A0/g, ' ' );
  73372. // To have correct `diffResult`, we also compare view node text data with &nbsp; replaced by space.
  73373. const oldText = mutation.oldText.replace( /\u00A0/g, ' ' );
  73374. // Do nothing if mutations created same text.
  73375. if ( oldText === newText ) {
  73376. return;
  73377. }
  73378. const diffResult = Object(_ckeditor_ckeditor5_utils_src_diff__WEBPACK_IMPORTED_MODULE_0__["default"])( oldText, newText );
  73379. const { firstChangeAt, insertions, deletions } = calculateChanges( diffResult );
  73380. // Try setting new model selection according to passed view selection.
  73381. let modelSelectionRange = null;
  73382. if ( viewSelection ) {
  73383. modelSelectionRange = this.editing.mapper.toModelRange( viewSelection.getFirstRange() );
  73384. }
  73385. // Get the position in view and model where the changes will happen.
  73386. const viewPos = this.editing.view.createPositionAt( mutation.node, firstChangeAt );
  73387. const modelPos = this.editing.mapper.toModelPosition( viewPos );
  73388. const removeRange = this.editor.model.createRange( modelPos, modelPos.getShiftedBy( deletions ) );
  73389. const insertText = newText.substr( firstChangeAt, insertions );
  73390. this.editor.execute( 'input', {
  73391. text: insertText,
  73392. range: removeRange,
  73393. resultRange: modelSelectionRange
  73394. } );
  73395. }
  73396. /**
  73397. * @private
  73398. */
  73399. _handleTextNodeInsertion( mutation ) {
  73400. if ( mutation.type != 'children' ) {
  73401. return;
  73402. }
  73403. const change = Object(_utils__WEBPACK_IMPORTED_MODULE_2__["getSingleTextNodeChange"])( mutation );
  73404. const viewPos = this.editing.view.createPositionAt( mutation.node, change.index );
  73405. const modelPos = this.editing.mapper.toModelPosition( viewPos );
  73406. const insertedText = change.values[ 0 ].data;
  73407. this.editor.execute( 'input', {
  73408. // Replace &nbsp; inserted by the browser with normal space.
  73409. // See comment in `_handleTextMutation`.
  73410. // In this case we don't need to do this before `diff` because we diff whole nodes.
  73411. // Just change &nbsp; in case there are some.
  73412. text: insertedText.replace( /\u00A0/g, ' ' ),
  73413. range: this.editor.model.createRange( modelPos )
  73414. } );
  73415. }
  73416. }
  73417. // Returns first common ancestor of all mutations that is either {@link module:engine/view/containerelement~ContainerElement}
  73418. // or {@link module:engine/view/rootelement~RootElement}.
  73419. //
  73420. // @private
  73421. // @param {Array.<module:engine/view/observer/mutationobserver~MutatedText|
  73422. // module:engine/view/observer/mutationobserver~MutatedChildren>} mutations
  73423. // @returns {module:engine/view/containerelement~ContainerElement|engine/view/rootelement~RootElement|undefined}
  73424. function getMutationsContainer( mutations ) {
  73425. const lca = mutations
  73426. .map( mutation => mutation.node )
  73427. .reduce( ( commonAncestor, node ) => {
  73428. return commonAncestor.getCommonAncestor( node, { includeSelf: true } );
  73429. } );
  73430. if ( !lca ) {
  73431. return;
  73432. }
  73433. // We need to look for container and root elements only, so check all LCA's
  73434. // ancestors (starting from itself).
  73435. return lca.getAncestors( { includeSelf: true, parentFirst: true } )
  73436. .find( element => element.is( 'containerElement' ) || element.is( 'rootElement' ) );
  73437. }
  73438. // Returns true if provided array contains content that won't be problematic during diffing and text mutation handling.
  73439. //
  73440. // @param {Array.<module:engine/model/node~Node>} children
  73441. // @param {module:engine/model/schema~Schema} schema
  73442. // @returns {Boolean}
  73443. function isSafeForTextMutation( children, schema ) {
  73444. return children.every( child => schema.isInline( child ) );
  73445. }
  73446. // Calculates first change index and number of characters that should be inserted and deleted starting from that index.
  73447. //
  73448. // @private
  73449. // @param diffResult
  73450. // @returns {{insertions: number, deletions: number, firstChangeAt: *}}
  73451. function calculateChanges( diffResult ) {
  73452. // Index where the first change happens. Used to set the position from which nodes will be removed and where will be inserted.
  73453. let firstChangeAt = null;
  73454. // Index where the last change happens. Used to properly count how many characters have to be removed and inserted.
  73455. let lastChangeAt = null;
  73456. // Get `firstChangeAt` and `lastChangeAt`.
  73457. for ( let i = 0; i < diffResult.length; i++ ) {
  73458. const change = diffResult[ i ];
  73459. if ( change != 'equal' ) {
  73460. firstChangeAt = firstChangeAt === null ? i : firstChangeAt;
  73461. lastChangeAt = i;
  73462. }
  73463. }
  73464. // How many characters, starting from `firstChangeAt`, should be removed.
  73465. let deletions = 0;
  73466. // How many characters, starting from `firstChangeAt`, should be inserted.
  73467. let insertions = 0;
  73468. for ( let i = firstChangeAt; i <= lastChangeAt; i++ ) {
  73469. // If there is no change (equal) or delete, the character is existing in `oldText`. We count it for removing.
  73470. if ( diffResult[ i ] != 'insert' ) {
  73471. deletions++;
  73472. }
  73473. // If there is no change (equal) or insert, the character is existing in `newText`. We count it for inserting.
  73474. if ( diffResult[ i ] != 'delete' ) {
  73475. insertions++;
  73476. }
  73477. }
  73478. return { insertions, deletions, firstChangeAt };
  73479. }
  73480. /***/ }),
  73481. /***/ "./node_modules/@ckeditor/ckeditor5-typing/src/utils/injectunsafekeystrokeshandling.js":
  73482. /*!*********************************************************************************************!*\
  73483. !*** ./node_modules/@ckeditor/ckeditor5-typing/src/utils/injectunsafekeystrokeshandling.js ***!
  73484. \*********************************************************************************************/
  73485. /*! exports provided: default, isNonTypingKeystroke */
  73486. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  73487. "use strict";
  73488. __webpack_require__.r(__webpack_exports__);
  73489. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return injectUnsafeKeystrokesHandling; });
  73490. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isNonTypingKeystroke", function() { return isNonTypingKeystroke; });
  73491. /* 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");
  73492. /* 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");
  73493. /**
  73494. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  73495. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  73496. */
  73497. /**
  73498. * @module typing/utils/injectunsafekeystrokeshandling
  73499. */
  73500. /**
  73501. * Handles keystrokes which are unsafe for typing. This handler's logic is explained
  73502. * in https://github.com/ckeditor/ckeditor5-typing/issues/83#issuecomment-398690251.
  73503. *
  73504. * @param {module:core/editor/editor~Editor} editor The editor instance.
  73505. */
  73506. function injectUnsafeKeystrokesHandling( editor ) {
  73507. let latestCompositionSelection = null;
  73508. const model = editor.model;
  73509. const view = editor.editing.view;
  73510. const inputCommand = editor.commands.get( 'input' );
  73511. // For Android, we want to handle keystrokes on `beforeinput` to be sure that code in `DeleteObserver` already had a chance to be fired.
  73512. if ( _ckeditor_ckeditor5_utils_src_env__WEBPACK_IMPORTED_MODULE_1__["default"].isAndroid ) {
  73513. view.document.on( 'beforeinput', ( evt, evtData ) => handleUnsafeKeystroke( evtData ), { priority: 'lowest' } );
  73514. } else {
  73515. view.document.on( 'keydown', ( evt, evtData ) => handleUnsafeKeystroke( evtData ), { priority: 'lowest' } );
  73516. }
  73517. view.document.on( 'compositionstart', handleCompositionStart, { priority: 'lowest' } );
  73518. view.document.on( 'compositionend', () => {
  73519. latestCompositionSelection = model.createSelection( model.document.selection );
  73520. }, { priority: 'lowest' } );
  73521. // Handles the keydown event. We need to guess whether such keystroke is going to result
  73522. // in typing. If so, then before character insertion happens, any selected content needs
  73523. // to be deleted. Otherwise the default browser deletion mechanism would be
  73524. // triggered, resulting in:
  73525. //
  73526. // * Hundreds of mutations which could not be handled.
  73527. // * But most importantly, loss of control over how the content is being deleted.
  73528. //
  73529. // The method is used in a low-priority listener, hence allowing other listeners (e.g. delete or enter features)
  73530. // to handle the event.
  73531. //
  73532. // @param {module:engine/view/observer/keyobserver~KeyEventData} evtData
  73533. function handleUnsafeKeystroke( evtData ) {
  73534. const doc = model.document;
  73535. const isComposing = view.document.isComposing;
  73536. const isSelectionUnchanged = latestCompositionSelection && latestCompositionSelection.isEqual( doc.selection );
  73537. // Reset stored composition selection.
  73538. latestCompositionSelection = null;
  73539. // By relying on the state of the input command we allow disabling the entire input easily
  73540. // by just disabling the input command. We could’ve used here the delete command but that
  73541. // would mean requiring the delete feature which would block loading one without the other.
  73542. // We could also check the editor.isReadOnly property, but that wouldn't allow to block
  73543. // the input without blocking other features.
  73544. if ( !inputCommand.isEnabled ) {
  73545. return;
  73546. }
  73547. if ( isNonTypingKeystroke( evtData ) || doc.selection.isCollapsed ) {
  73548. return;
  73549. }
  73550. // If during composition, deletion should be prevented as it may remove composed sequence (#83).
  73551. if ( isComposing && evtData.keyCode === 229 ) {
  73552. return;
  73553. }
  73554. // If there is a `keydown` event fired with '229' keycode it might be related
  73555. // to recent composition. Check if selection is the same as upon ending recent composition,
  73556. // if so do not remove selected content as it will remove composed sequence (#83).
  73557. if ( !isComposing && evtData.keyCode === 229 && isSelectionUnchanged ) {
  73558. return;
  73559. }
  73560. deleteSelectionContent();
  73561. }
  73562. // Handles the `compositionstart` event. It is used only in special cases to remove the contents
  73563. // of a non-collapsed selection so composition itself does not result in complex mutations.
  73564. //
  73565. // The special case mentioned above is a situation in which the `keydown` event is fired after
  73566. // `compositionstart` event. In such cases {@link #handleKeydown} cannot clear current selection
  73567. // contents (because it is too late and will break the composition) so the composition handler takes care of it.
  73568. function handleCompositionStart() {
  73569. const doc = model.document;
  73570. const isFlatSelection = doc.selection.rangeCount === 1 ? doc.selection.getFirstRange().isFlat : true;
  73571. // If on `compositionstart` there is a non-collapsed selection which start and end have different parents
  73572. // it means the `handleKeydown()` method did not remove its contents. It happens usually because
  73573. // of different order of events (`compositionstart` before `keydown` - in Safari). In such cases
  73574. // we need to remove selection contents on composition start (#83).
  73575. if ( doc.selection.isCollapsed || isFlatSelection ) {
  73576. return;
  73577. }
  73578. deleteSelectionContent();
  73579. }
  73580. function deleteSelectionContent() {
  73581. const buffer = inputCommand.buffer;
  73582. buffer.lock();
  73583. const batch = buffer.batch;
  73584. inputCommand._batches.add( batch );
  73585. model.enqueueChange( batch, () => {
  73586. model.deleteContent( model.document.selection );
  73587. } );
  73588. buffer.unlock();
  73589. }
  73590. }
  73591. const safeKeycodes = [
  73592. Object(_ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_0__["getCode"])( 'arrowUp' ),
  73593. Object(_ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_0__["getCode"])( 'arrowRight' ),
  73594. Object(_ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_0__["getCode"])( 'arrowDown' ),
  73595. Object(_ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_0__["getCode"])( 'arrowLeft' ),
  73596. 9, // Tab
  73597. 16, // Shift
  73598. 17, // Ctrl
  73599. 18, // Alt
  73600. 19, // Pause
  73601. 20, // CapsLock
  73602. 27, // Escape
  73603. 33, // PageUp
  73604. 34, // PageDown
  73605. 35, // Home
  73606. 36, // End,
  73607. 45, // Insert,
  73608. 91, // Windows,
  73609. 93, // Menu key,
  73610. 144, // NumLock
  73611. 145, // ScrollLock,
  73612. 173, // Mute/Unmute
  73613. 174, // Volume up
  73614. 175, // Volume down,
  73615. 176, // Next song,
  73616. 177, // Previous song,
  73617. 178, // Stop,
  73618. 179, // Play/Pause,
  73619. 255 // Display brightness (increase and decrease)
  73620. ];
  73621. // Function keys.
  73622. for ( let code = 112; code <= 135; code++ ) {
  73623. safeKeycodes.push( code );
  73624. }
  73625. /**
  73626. * Returns `true` if a keystroke will **not** result in "typing".
  73627. *
  73628. * For instance, keystrokes that result in typing are letters "a-zA-Z", numbers "0-9", delete, backspace, etc.
  73629. *
  73630. * Keystrokes that do not cause typing are, for instance, Fn keys (F5, F8, etc.), arrow keys (←, →, ↑, ↓),
  73631. * Tab (↹), "Windows logo key" (⊞ Win), etc.
  73632. *
  73633. * Note: This implementation is very simple and will need to be refined with time.
  73634. *
  73635. * @param {module:engine/view/observer/keyobserver~KeyEventData} keyData
  73636. * @returns {Boolean}
  73637. */
  73638. function isNonTypingKeystroke( keyData ) {
  73639. // Keystrokes which contain Ctrl or Cmd don't represent typing.
  73640. if ( keyData.ctrlKey || keyData.metaKey ) {
  73641. return true;
  73642. }
  73643. return safeKeycodes.includes( keyData.keyCode );
  73644. }
  73645. /***/ }),
  73646. /***/ "./node_modules/@ckeditor/ckeditor5-typing/src/utils/inlinehighlight.js":
  73647. /*!******************************************************************************!*\
  73648. !*** ./node_modules/@ckeditor/ckeditor5-typing/src/utils/inlinehighlight.js ***!
  73649. \******************************************************************************/
  73650. /*! exports provided: default */
  73651. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  73652. "use strict";
  73653. __webpack_require__.r(__webpack_exports__);
  73654. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return inlineHighlight; });
  73655. /* harmony import */ var _findattributerange__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./findattributerange */ "./node_modules/@ckeditor/ckeditor5-typing/src/utils/findattributerange.js");
  73656. /**
  73657. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  73658. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  73659. */
  73660. /**
  73661. * @module typing/utils/inlinehighlight
  73662. */
  73663. /**
  73664. * Adds a visual highlight style to an attribute element in which the selection is anchored.
  73665. * Together with two-step caret movement, they indicate that the user is typing inside the element.
  73666. *
  73667. * Highlight is turned on by adding the given class to the attribute element in the view:
  73668. *
  73669. * * The class is removed before the conversion has started, as callbacks added with the `'highest'` priority
  73670. * to {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher} events.
  73671. * * The class is added in the view post fixer, after other changes in the model tree were converted to the view.
  73672. *
  73673. * This way, adding and removing the highlight does not interfere with conversion.
  73674. *
  73675. * Usage:
  73676. *
  73677. * import inlineHighlight from '@ckeditor/ckeditor5-typing/src/utils/inlinehighlight';
  73678. *
  73679. * // Make `ck-link_selected` class be applied on an `a` element
  73680. * // whenever the corresponding `linkHref` attribute element is selected.
  73681. * inlineHighlight( editor, 'linkHref', 'a', 'ck-link_selected' );
  73682. *
  73683. * @param {module:core/editor/editor~Editor} editor The editor instance.
  73684. * @param {String} attributeName The attribute name to check.
  73685. * @param {String} tagName The tagName of a view item.
  73686. * @param {String} className The class name to apply in the view.
  73687. */
  73688. function inlineHighlight( editor, attributeName, tagName, className ) {
  73689. const view = editor.editing.view;
  73690. const highlightedElements = new Set();
  73691. // Adding the class.
  73692. view.document.registerPostFixer( writer => {
  73693. const selection = editor.model.document.selection;
  73694. let changed = false;
  73695. if ( selection.hasAttribute( attributeName ) ) {
  73696. const modelRange = Object(_findattributerange__WEBPACK_IMPORTED_MODULE_0__["default"])(
  73697. selection.getFirstPosition(),
  73698. attributeName,
  73699. selection.getAttribute( attributeName ),
  73700. editor.model
  73701. );
  73702. const viewRange = editor.editing.mapper.toViewRange( modelRange );
  73703. // There might be multiple view elements in the `viewRange`, for example, when the `a` element is
  73704. // broken by a UIElement.
  73705. for ( const item of viewRange.getItems() ) {
  73706. if ( item.is( 'element', tagName ) && !item.hasClass( className ) ) {
  73707. writer.addClass( className, item );
  73708. highlightedElements.add( item );
  73709. changed = true;
  73710. }
  73711. }
  73712. }
  73713. return changed;
  73714. } );
  73715. // Removing the class.
  73716. editor.conversion.for( 'editingDowncast' ).add( dispatcher => {
  73717. // Make sure the highlight is removed on every possible event, before conversion is started.
  73718. dispatcher.on( 'insert', removeHighlight, { priority: 'highest' } );
  73719. dispatcher.on( 'remove', removeHighlight, { priority: 'highest' } );
  73720. dispatcher.on( 'attribute', removeHighlight, { priority: 'highest' } );
  73721. dispatcher.on( 'selection', removeHighlight, { priority: 'highest' } );
  73722. function removeHighlight() {
  73723. view.change( writer => {
  73724. for ( const item of highlightedElements.values() ) {
  73725. writer.removeClass( className, item );
  73726. highlightedElements.delete( item );
  73727. }
  73728. } );
  73729. }
  73730. } );
  73731. }
  73732. /***/ }),
  73733. /***/ "./node_modules/@ckeditor/ckeditor5-typing/src/utils/utils.js":
  73734. /*!********************************************************************!*\
  73735. !*** ./node_modules/@ckeditor/ckeditor5-typing/src/utils/utils.js ***!
  73736. \********************************************************************/
  73737. /*! exports provided: containerChildrenMutated, getSingleTextNodeChange, compareChildNodes */
  73738. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  73739. "use strict";
  73740. __webpack_require__.r(__webpack_exports__);
  73741. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "containerChildrenMutated", function() { return containerChildrenMutated; });
  73742. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getSingleTextNodeChange", function() { return getSingleTextNodeChange; });
  73743. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "compareChildNodes", function() { return compareChildNodes; });
  73744. /* 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");
  73745. /* 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");
  73746. /**
  73747. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  73748. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  73749. */
  73750. /**
  73751. * @module typing/utils/utils
  73752. */
  73753. /**
  73754. * Returns true if container children have mutated or more than a single text node was changed.
  73755. *
  73756. * @private
  73757. * @param {Array.<module:engine/view/observer/mutationobserver~MutatedText|
  73758. * module:engine/view/observer/mutationobserver~MutatedChildren>} mutations
  73759. * @returns {Boolean}
  73760. */
  73761. function containerChildrenMutated( mutations ) {
  73762. if ( mutations.length == 0 ) {
  73763. return false;
  73764. }
  73765. // Check if there is any mutation of `children` type or any mutation that changes more than one text node.
  73766. for ( const mutation of mutations ) {
  73767. if ( mutation.type === 'children' && !getSingleTextNodeChange( mutation ) ) {
  73768. return true;
  73769. }
  73770. }
  73771. return false;
  73772. }
  73773. /**
  73774. * Returns change made to a single text node.
  73775. *
  73776. * @private
  73777. * @param {module:engine/view/observer/mutationobserver~MutatedText|
  73778. * module:engine/view/observer/mutationobserver~MutatedChildren} mutation
  73779. * @returns {Object|undefined} Change object (see {@link module:utils/difftochanges~diffToChanges} output)
  73780. * or undefined if more than a single text node was changed.
  73781. */
  73782. function getSingleTextNodeChange( mutation ) {
  73783. // One new node.
  73784. if ( mutation.newChildren.length - mutation.oldChildren.length != 1 ) {
  73785. return;
  73786. }
  73787. // Which is text.
  73788. const diffResult = Object(_ckeditor_ckeditor5_utils_src_diff__WEBPACK_IMPORTED_MODULE_0__["default"])( mutation.oldChildren, mutation.newChildren, compareChildNodes );
  73789. const changes = Object(_ckeditor_ckeditor5_utils_src_difftochanges__WEBPACK_IMPORTED_MODULE_1__["default"])( diffResult, mutation.newChildren );
  73790. // In case of [ delete, insert, insert ] the previous check will not exit.
  73791. if ( changes.length > 1 ) {
  73792. return;
  73793. }
  73794. const change = changes[ 0 ];
  73795. // Which is text.
  73796. if ( !( !!change.values[ 0 ] && change.values[ 0 ].is( '$text' ) ) ) {
  73797. return;
  73798. }
  73799. return change;
  73800. }
  73801. /**
  73802. * Checks whether two view nodes are identical, which means they are the same object
  73803. * or contain exactly same data (in case of text nodes).
  73804. *
  73805. * @private
  73806. * @param {module:engine/view/node~Node} oldChild
  73807. * @param {module:engine/view/node~Node} newChild
  73808. * @returns {Boolean}
  73809. */
  73810. function compareChildNodes( oldChild, newChild ) {
  73811. if ( !!oldChild && oldChild.is( '$text' ) && !!newChild && newChild.is( '$text' ) ) {
  73812. return oldChild.data === newChild.data;
  73813. } else {
  73814. return oldChild === newChild;
  73815. }
  73816. }
  73817. /***/ }),
  73818. /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/bindings/clickoutsidehandler.js":
  73819. /*!*********************************************************************************!*\
  73820. !*** ./node_modules/@ckeditor/ckeditor5-ui/src/bindings/clickoutsidehandler.js ***!
  73821. \*********************************************************************************/
  73822. /*! exports provided: default */
  73823. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  73824. "use strict";
  73825. __webpack_require__.r(__webpack_exports__);
  73826. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return clickOutsideHandler; });
  73827. /**
  73828. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  73829. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  73830. */
  73831. /**
  73832. * @module ui/bindings/clickoutsidehandler
  73833. */
  73834. /* global document */
  73835. /**
  73836. * Handles clicking **outside** of a specified set of elements, then fires an action.
  73837. *
  73838. * **Note**: Actually, the action is executed upon `mousedown`, not `click`. It prevents
  73839. * certain issues when the user keeps holding the mouse button and the UI cannot react
  73840. * properly.
  73841. *
  73842. * @param {Object} options Configuration options.
  73843. * @param {module:utils/dom/emittermixin~Emitter} options.emitter The emitter to which this behavior
  73844. * should be added.
  73845. * @param {Function} options.activator Function returning a `Boolean`, to determine whether the handler is active.
  73846. * @param {Array.<HTMLElement>} options.contextElements HTML elements that determine the scope of the
  73847. * handler. Clicking any of them or their descendants will **not** fire the callback.
  73848. * @param {Function} options.callback An action executed by the handler.
  73849. */
  73850. function clickOutsideHandler( { emitter, activator, callback, contextElements } ) {
  73851. emitter.listenTo( document, 'mousedown', ( evt, domEvt ) => {
  73852. if ( !activator() ) {
  73853. return;
  73854. }
  73855. // Check if `composedPath` is `undefined` in case the browser does not support native shadow DOM.
  73856. // Can be removed when all supported browsers support native shadow DOM.
  73857. const path = typeof domEvt.composedPath == 'function' ? domEvt.composedPath() : [];
  73858. for ( const contextElement of contextElements ) {
  73859. if ( contextElement.contains( domEvt.target ) || path.includes( contextElement ) ) {
  73860. return;
  73861. }
  73862. }
  73863. callback();
  73864. } );
  73865. }
  73866. /***/ }),
  73867. /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/bindings/injectcsstransitiondisabler.js":
  73868. /*!*****************************************************************************************!*\
  73869. !*** ./node_modules/@ckeditor/ckeditor5-ui/src/bindings/injectcsstransitiondisabler.js ***!
  73870. \*****************************************************************************************/
  73871. /*! exports provided: default */
  73872. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  73873. "use strict";
  73874. __webpack_require__.r(__webpack_exports__);
  73875. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return injectCssTransitionDisabler; });
  73876. /**
  73877. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  73878. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  73879. */
  73880. /**
  73881. * @module ui/bindings/injectcsstransitiondisabler
  73882. */
  73883. /**
  73884. * A decorator that brings the possibility to temporarily disable CSS transitions using
  73885. * {@link module:ui/view~View} methods. It is helpful when, for instance, the transitions should not happen
  73886. * when the view is first displayed but they should work normal in other cases.
  73887. *
  73888. * The methods to control the CSS transitions are:
  73889. * * `disableCssTransitions()` – Adds the `.ck-transitions-disabled` class to the
  73890. * {@link module:ui/view~View#element view element}.
  73891. * * `enableCssTransitions()` – Removes the `.ck-transitions-disabled` class from the
  73892. * {@link module:ui/view~View#element view element}.
  73893. *
  73894. * **Note**: This helper extends the {@link module:ui/view~View#template template} and must be used **after**
  73895. * {@link module:ui/view~View#setTemplate} is called:
  73896. *
  73897. * import injectCssTransitionDisabler from '@ckeditor/ckeditor5-ui/src/bindings/injectcsstransitiondisabler';
  73898. *
  73899. * class MyView extends View {
  73900. * constructor() {
  73901. * super();
  73902. *
  73903. * // ...
  73904. *
  73905. * this.setTemplate( { ... } );
  73906. *
  73907. * // ...
  73908. *
  73909. * injectCssTransitionDisabler( this );
  73910. *
  73911. * // ...
  73912. * }
  73913. * }
  73914. *
  73915. * The usage comes down to:
  73916. *
  73917. * const view = new MyView();
  73918. *
  73919. * // ...
  73920. *
  73921. * view.disableCssTransitions();
  73922. * view.show();
  73923. * view.enableCssTransitions();
  73924. *
  73925. * @param {module:ui/view~View} view View instance that should get this functionality.
  73926. */
  73927. function injectCssTransitionDisabler( view ) {
  73928. view.set( '_isCssTransitionsDisabled', false );
  73929. view.disableCssTransitions = () => {
  73930. view._isCssTransitionsDisabled = true;
  73931. };
  73932. view.enableCssTransitions = () => {
  73933. view._isCssTransitionsDisabled = false;
  73934. };
  73935. view.extendTemplate( {
  73936. attributes: {
  73937. class: [
  73938. view.bindTemplate.if( '_isCssTransitionsDisabled', 'ck-transitions-disabled' )
  73939. ]
  73940. }
  73941. } );
  73942. }
  73943. /***/ }),
  73944. /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/bindings/preventdefault.js":
  73945. /*!****************************************************************************!*\
  73946. !*** ./node_modules/@ckeditor/ckeditor5-ui/src/bindings/preventdefault.js ***!
  73947. \****************************************************************************/
  73948. /*! exports provided: default */
  73949. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  73950. "use strict";
  73951. __webpack_require__.r(__webpack_exports__);
  73952. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return preventDefault; });
  73953. /**
  73954. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  73955. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  73956. */
  73957. /**
  73958. * @module ui/bindings/preventdefault
  73959. */
  73960. /**
  73961. * A helper which executes a native `Event.preventDefault()` if the target of an event equals the
  73962. * {@link module:ui/view~View#element element of the view}. It shortens the definition of a
  73963. * {@link module:ui/view~View#template template}.
  73964. *
  73965. * // In a class extending View.
  73966. * import preventDefault from '@ckeditor/ckeditor5-ui/src/bindings/preventdefault';
  73967. *
  73968. * // ...
  73969. *
  73970. * this.setTemplate( {
  73971. * tag: 'div',
  73972. *
  73973. * on: {
  73974. * // Prevent the default mousedown action on this view.
  73975. * mousedown: preventDefault( this )
  73976. * }
  73977. * } );
  73978. *
  73979. * @param {module:ui/view~View} view View instance that defines the template.
  73980. * @returns {module:ui/template~TemplateToBinding}
  73981. */
  73982. function preventDefault( view ) {
  73983. return view.bindTemplate.to( evt => {
  73984. if ( evt.target === view.element ) {
  73985. evt.preventDefault();
  73986. }
  73987. } );
  73988. }
  73989. /***/ }),
  73990. /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/bindings/submithandler.js":
  73991. /*!***************************************************************************!*\
  73992. !*** ./node_modules/@ckeditor/ckeditor5-ui/src/bindings/submithandler.js ***!
  73993. \***************************************************************************/
  73994. /*! exports provided: default */
  73995. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  73996. "use strict";
  73997. __webpack_require__.r(__webpack_exports__);
  73998. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return submitHandler; });
  73999. /**
  74000. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  74001. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  74002. */
  74003. /**
  74004. * @module ui/bindings/submithandler
  74005. */
  74006. /**
  74007. * A handler useful for {@link module:ui/view~View views} working as HTML forms. It intercepts a native DOM
  74008. * `submit` event, prevents the default web browser behavior (navigation and page reload) and
  74009. * fires the `submit` event on a view instead. Such a custom event can be then used by any
  74010. * {@link module:utils/dom/emittermixin~Emitter emitter}, e.g. to serialize the form data.
  74011. *
  74012. * import submitHandler from '@ckeditor/ckeditor5-ui/src/bindings/submithandler';
  74013. *
  74014. * // ...
  74015. *
  74016. * class AnyFormView extends View {
  74017. * constructor() {
  74018. * super();
  74019. *
  74020. * // ...
  74021. *
  74022. * submitHandler( {
  74023. * view: this
  74024. * } );
  74025. * }
  74026. * }
  74027. *
  74028. * // ...
  74029. *
  74030. * const view = new AnyFormView();
  74031. *
  74032. * // A sample listener attached by an emitter working with the view.
  74033. * this.listenTo( view, 'submit', () => {
  74034. * saveTheFormData();
  74035. * hideTheForm();
  74036. * } );
  74037. *
  74038. * @param {Object} [options] Configuration options.
  74039. * @param {module:ui/view~View} options.view The view which DOM `submit` events should be handled.
  74040. */
  74041. function submitHandler( { view } ) {
  74042. view.listenTo( view.element, 'submit', ( evt, domEvt ) => {
  74043. domEvt.preventDefault();
  74044. view.fire( 'submit' );
  74045. }, { useCapture: true } );
  74046. }
  74047. /***/ }),
  74048. /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/button/buttonview.js":
  74049. /*!**********************************************************************!*\
  74050. !*** ./node_modules/@ckeditor/ckeditor5-ui/src/button/buttonview.js ***!
  74051. \**********************************************************************/
  74052. /*! exports provided: default */
  74053. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  74054. "use strict";
  74055. __webpack_require__.r(__webpack_exports__);
  74056. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ButtonView; });
  74057. /* harmony import */ var _view__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../view */ "./node_modules/@ckeditor/ckeditor5-ui/src/view.js");
  74058. /* harmony import */ var _icon_iconview__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../icon/iconview */ "./node_modules/@ckeditor/ckeditor5-ui/src/icon/iconview.js");
  74059. /* harmony import */ var _tooltip_tooltipview__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../tooltip/tooltipview */ "./node_modules/@ckeditor/ckeditor5-ui/src/tooltip/tooltipview.js");
  74060. /* 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");
  74061. /* 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");
  74062. /* 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");
  74063. /* 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__);
  74064. /**
  74065. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  74066. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  74067. */
  74068. /**
  74069. * @module ui/button/buttonview
  74070. */
  74071. /**
  74072. * The button view class.
  74073. *
  74074. * const view = new ButtonView();
  74075. *
  74076. * view.set( {
  74077. * label: 'A button',
  74078. * keystroke: 'Ctrl+B',
  74079. * tooltip: true,
  74080. * withText: true
  74081. * } );
  74082. *
  74083. * view.render();
  74084. *
  74085. * document.body.append( view.element );
  74086. *
  74087. * @extends module:ui/view~View
  74088. * @implements module:ui/button/button~Button
  74089. */
  74090. class ButtonView extends _view__WEBPACK_IMPORTED_MODULE_0__["default"] {
  74091. /**
  74092. * @inheritDoc
  74093. */
  74094. constructor( locale ) {
  74095. super( locale );
  74096. const bind = this.bindTemplate;
  74097. const ariaLabelUid = Object(_ckeditor_ckeditor5_utils_src_uid__WEBPACK_IMPORTED_MODULE_3__["default"])();
  74098. // Implement the Button interface.
  74099. this.set( 'class' );
  74100. this.set( 'labelStyle' );
  74101. this.set( 'icon' );
  74102. this.set( 'isEnabled', true );
  74103. this.set( 'isOn', false );
  74104. this.set( 'isVisible', true );
  74105. this.set( 'isToggleable', false );
  74106. this.set( 'keystroke' );
  74107. this.set( 'label' );
  74108. this.set( 'tabindex', -1 );
  74109. this.set( 'tooltip' );
  74110. this.set( 'tooltipPosition', 's' );
  74111. this.set( 'type', 'button' );
  74112. this.set( 'withText', false );
  74113. this.set( 'withKeystroke', false );
  74114. /**
  74115. * Collection of the child views inside of the button {@link #element}.
  74116. *
  74117. * @readonly
  74118. * @member {module:ui/viewcollection~ViewCollection}
  74119. */
  74120. this.children = this.createCollection();
  74121. /**
  74122. * Tooltip of the button view. It is configurable using the {@link #tooltip tooltip attribute}.
  74123. *
  74124. * @readonly
  74125. * @member {module:ui/tooltip/tooltipview~TooltipView} #tooltipView
  74126. */
  74127. this.tooltipView = this._createTooltipView();
  74128. /**
  74129. * Label of the button view. It is configurable using the {@link #label label attribute}.
  74130. *
  74131. * @readonly
  74132. * @member {module:ui/view~View} #labelView
  74133. */
  74134. this.labelView = this._createLabelView( ariaLabelUid );
  74135. /**
  74136. * The icon view of the button. Will be added to {@link #children} when the
  74137. * {@link #icon icon attribute} is defined.
  74138. *
  74139. * @readonly
  74140. * @member {module:ui/icon/iconview~IconView} #iconView
  74141. */
  74142. this.iconView = new _icon_iconview__WEBPACK_IMPORTED_MODULE_1__["default"]();
  74143. this.iconView.extendTemplate( {
  74144. attributes: {
  74145. class: 'ck-button__icon'
  74146. }
  74147. } );
  74148. /**
  74149. * A view displaying the keystroke of the button next to the {@link #labelView label}.
  74150. * Added to {@link #children} when the {@link #withKeystroke `withKeystroke` attribute}
  74151. * is defined.
  74152. *
  74153. * @readonly
  74154. * @member {module:ui/view/view~View} #keystrokeView
  74155. */
  74156. this.keystrokeView = this._createKeystrokeView();
  74157. /**
  74158. * Tooltip of the button bound to the template.
  74159. *
  74160. * @see #tooltip
  74161. * @see #_getTooltipString
  74162. * @private
  74163. * @observable
  74164. * @member {Boolean} #_tooltipString
  74165. */
  74166. this.bind( '_tooltipString' ).to(
  74167. this, 'tooltip',
  74168. this, 'label',
  74169. this, 'keystroke',
  74170. this._getTooltipString.bind( this )
  74171. );
  74172. this.setTemplate( {
  74173. tag: 'button',
  74174. attributes: {
  74175. class: [
  74176. 'ck',
  74177. 'ck-button',
  74178. bind.to( 'class' ),
  74179. bind.if( 'isEnabled', 'ck-disabled', value => !value ),
  74180. bind.if( 'isVisible', 'ck-hidden', value => !value ),
  74181. bind.to( 'isOn', value => value ? 'ck-on' : 'ck-off' ),
  74182. bind.if( 'withText', 'ck-button_with-text' ),
  74183. bind.if( 'withKeystroke', 'ck-button_with-keystroke' )
  74184. ],
  74185. type: bind.to( 'type', value => value ? value : 'button' ),
  74186. tabindex: bind.to( 'tabindex' ),
  74187. 'aria-labelledby': `ck-editor__aria-label_${ ariaLabelUid }`,
  74188. 'aria-disabled': bind.if( 'isEnabled', true, value => !value ),
  74189. 'aria-pressed': bind.to( 'isOn', value => this.isToggleable ? String( value ) : false )
  74190. },
  74191. children: this.children,
  74192. on: {
  74193. mousedown: bind.to( evt => {
  74194. evt.preventDefault();
  74195. } ),
  74196. click: bind.to( evt => {
  74197. // We can't make the button disabled using the disabled attribute, because it won't be focusable.
  74198. // Though, shouldn't this condition be moved to the button controller?
  74199. if ( this.isEnabled ) {
  74200. this.fire( 'execute' );
  74201. } else {
  74202. // Prevent the default when button is disabled, to block e.g.
  74203. // automatic form submitting. See ckeditor/ckeditor5-link#74.
  74204. evt.preventDefault();
  74205. }
  74206. } )
  74207. }
  74208. } );
  74209. }
  74210. /**
  74211. * @inheritDoc
  74212. */
  74213. render() {
  74214. super.render();
  74215. if ( this.icon ) {
  74216. this.iconView.bind( 'content' ).to( this, 'icon' );
  74217. this.children.add( this.iconView );
  74218. }
  74219. this.children.add( this.tooltipView );
  74220. this.children.add( this.labelView );
  74221. if ( this.withKeystroke ) {
  74222. this.children.add( this.keystrokeView );
  74223. }
  74224. }
  74225. /**
  74226. * Focuses the {@link #element} of the button.
  74227. */
  74228. focus() {
  74229. this.element.focus();
  74230. }
  74231. /**
  74232. * Creates a {@link module:ui/tooltip/tooltipview~TooltipView} instance and binds it with button
  74233. * attributes.
  74234. *
  74235. * @private
  74236. * @returns {module:ui/tooltip/tooltipview~TooltipView}
  74237. */
  74238. _createTooltipView() {
  74239. const tooltipView = new _tooltip_tooltipview__WEBPACK_IMPORTED_MODULE_2__["default"]();
  74240. tooltipView.bind( 'text' ).to( this, '_tooltipString' );
  74241. tooltipView.bind( 'position' ).to( this, 'tooltipPosition' );
  74242. return tooltipView;
  74243. }
  74244. /**
  74245. * Creates a label view instance and binds it with button attributes.
  74246. *
  74247. * @private
  74248. * @param {String} ariaLabelUid The aria label UID.
  74249. * @returns {module:ui/view~View}
  74250. */
  74251. _createLabelView( ariaLabelUid ) {
  74252. const labelView = new _view__WEBPACK_IMPORTED_MODULE_0__["default"]();
  74253. const bind = this.bindTemplate;
  74254. labelView.setTemplate( {
  74255. tag: 'span',
  74256. attributes: {
  74257. class: [
  74258. 'ck',
  74259. 'ck-button__label'
  74260. ],
  74261. style: bind.to( 'labelStyle' ),
  74262. id: `ck-editor__aria-label_${ ariaLabelUid }`
  74263. },
  74264. children: [
  74265. {
  74266. text: this.bindTemplate.to( 'label' )
  74267. }
  74268. ]
  74269. } );
  74270. return labelView;
  74271. }
  74272. /**
  74273. * Creates a view that displays a keystroke next to a {@link #labelView label }
  74274. * and binds it with button attributes.
  74275. *
  74276. * @private
  74277. * @returns {module:ui/view~View}
  74278. */
  74279. _createKeystrokeView() {
  74280. const keystrokeView = new _view__WEBPACK_IMPORTED_MODULE_0__["default"]();
  74281. keystrokeView.setTemplate( {
  74282. tag: 'span',
  74283. attributes: {
  74284. class: [
  74285. 'ck',
  74286. 'ck-button__keystroke'
  74287. ]
  74288. },
  74289. children: [
  74290. {
  74291. text: this.bindTemplate.to( 'keystroke', text => Object(_ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_4__["getEnvKeystrokeText"])( text ) )
  74292. }
  74293. ]
  74294. } );
  74295. return keystrokeView;
  74296. }
  74297. /**
  74298. * Gets the text for the {@link #tooltipView} from the combination of
  74299. * {@link #tooltip}, {@link #label} and {@link #keystroke} attributes.
  74300. *
  74301. * @private
  74302. * @see #tooltip
  74303. * @see #_tooltipString
  74304. * @param {Boolean|String|Function} tooltip Button tooltip.
  74305. * @param {String} label Button label.
  74306. * @param {String} keystroke Button keystroke.
  74307. * @returns {String}
  74308. */
  74309. _getTooltipString( tooltip, label, keystroke ) {
  74310. if ( tooltip ) {
  74311. if ( typeof tooltip == 'string' ) {
  74312. return tooltip;
  74313. } else {
  74314. if ( keystroke ) {
  74315. keystroke = Object(_ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_4__["getEnvKeystrokeText"])( keystroke );
  74316. }
  74317. if ( tooltip instanceof Function ) {
  74318. return tooltip( label, keystroke );
  74319. } else {
  74320. return `${ label }${ keystroke ? ` (${ keystroke })` : '' }`;
  74321. }
  74322. }
  74323. }
  74324. return '';
  74325. }
  74326. }
  74327. /***/ }),
  74328. /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/button/switchbuttonview.js":
  74329. /*!****************************************************************************!*\
  74330. !*** ./node_modules/@ckeditor/ckeditor5-ui/src/button/switchbuttonview.js ***!
  74331. \****************************************************************************/
  74332. /*! exports provided: default */
  74333. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  74334. "use strict";
  74335. __webpack_require__.r(__webpack_exports__);
  74336. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return SwitchButtonView; });
  74337. /* harmony import */ var _view__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../view */ "./node_modules/@ckeditor/ckeditor5-ui/src/view.js");
  74338. /* harmony import */ var _buttonview__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./buttonview */ "./node_modules/@ckeditor/ckeditor5-ui/src/button/buttonview.js");
  74339. /* 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");
  74340. /* 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__);
  74341. /**
  74342. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  74343. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  74344. */
  74345. /**
  74346. * @module ui/button/switchbuttonview
  74347. */
  74348. /**
  74349. * The switch button view class.
  74350. *
  74351. * const view = new SwitchButtonView();
  74352. *
  74353. * view.set( {
  74354. * withText: true,
  74355. * label: 'Switch me!'
  74356. * } );
  74357. *
  74358. * view.render();
  74359. *
  74360. * document.body.append( view.element );
  74361. *
  74362. * @extends module:ui/button/buttonview~ButtonView
  74363. */
  74364. class SwitchButtonView extends _buttonview__WEBPACK_IMPORTED_MODULE_1__["default"] {
  74365. /**
  74366. * @inheritDoc
  74367. */
  74368. constructor( locale ) {
  74369. super( locale );
  74370. this.isToggleable = true;
  74371. /**
  74372. * The toggle switch of the button.
  74373. *
  74374. * @readonly
  74375. * @member {module:ui/view~View} #toggleSwitchView
  74376. */
  74377. this.toggleSwitchView = this._createToggleView();
  74378. this.extendTemplate( {
  74379. attributes: {
  74380. class: 'ck-switchbutton'
  74381. }
  74382. } );
  74383. }
  74384. /**
  74385. * @inheritDoc
  74386. */
  74387. render() {
  74388. super.render();
  74389. this.children.add( this.toggleSwitchView );
  74390. }
  74391. /**
  74392. * Creates a toggle child view.
  74393. *
  74394. * @private
  74395. * @returns {module:ui/view~View}
  74396. */
  74397. _createToggleView() {
  74398. const toggleSwitchView = new _view__WEBPACK_IMPORTED_MODULE_0__["default"]();
  74399. toggleSwitchView.setTemplate( {
  74400. tag: 'span',
  74401. attributes: {
  74402. class: [
  74403. 'ck',
  74404. 'ck-button__toggle'
  74405. ]
  74406. },
  74407. children: [
  74408. {
  74409. tag: 'span',
  74410. attributes: {
  74411. class: [
  74412. 'ck',
  74413. 'ck-button__toggle__inner'
  74414. ]
  74415. }
  74416. }
  74417. ]
  74418. } );
  74419. return toggleSwitchView;
  74420. }
  74421. }
  74422. /***/ }),
  74423. /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/colorgrid/colorgridview.js":
  74424. /*!****************************************************************************!*\
  74425. !*** ./node_modules/@ckeditor/ckeditor5-ui/src/colorgrid/colorgridview.js ***!
  74426. \****************************************************************************/
  74427. /*! exports provided: default */
  74428. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  74429. "use strict";
  74430. __webpack_require__.r(__webpack_exports__);
  74431. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ColorGridView; });
  74432. /* harmony import */ var _view__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../view */ "./node_modules/@ckeditor/ckeditor5-ui/src/view.js");
  74433. /* harmony import */ var _colortileview__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./colortileview */ "./node_modules/@ckeditor/ckeditor5-ui/src/colorgrid/colortileview.js");
  74434. /* 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");
  74435. /* harmony import */ var _focuscycler__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../focuscycler */ "./node_modules/@ckeditor/ckeditor5-ui/src/focuscycler.js");
  74436. /* 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");
  74437. /* 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");
  74438. /* 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__);
  74439. /**
  74440. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  74441. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  74442. */
  74443. /**
  74444. * @module ui/colorgrid/colorgrid
  74445. */
  74446. /**
  74447. * A grid of {@link module:ui/colorgrid/colortile~ColorTileView color tiles}.
  74448. *
  74449. * @extends module:ui/view~View
  74450. */
  74451. class ColorGridView extends _view__WEBPACK_IMPORTED_MODULE_0__["default"] {
  74452. /**
  74453. * Creates an instance of a color grid containing {@link module:ui/colorgrid/colortile~ColorTileView tiles}.
  74454. *
  74455. * @param {module:utils/locale~Locale} [locale] The localization services instance.
  74456. * @param {Object} options Component configuration
  74457. * @param {Array.<module:ui/colorgrid/colorgrid~ColorDefinition>} [options.colorDefinitions] Array with definitions
  74458. * required to create the {@link module:ui/colorgrid/colortile~ColorTileView tiles}.
  74459. * @param {Number} options.columns A number of columns to display the tiles.
  74460. */
  74461. constructor( locale, options ) {
  74462. super( locale );
  74463. const colorDefinitions = options && options.colorDefinitions || [];
  74464. const viewStyleAttribute = {};
  74465. if ( options && options.columns ) {
  74466. viewStyleAttribute.gridTemplateColumns = `repeat( ${ options.columns }, 1fr)`;
  74467. }
  74468. /**
  74469. * The color of the currently selected color tile in {@link #items}.
  74470. *
  74471. * @observable
  74472. * @type {String}
  74473. */
  74474. this.set( 'selectedColor' );
  74475. /**
  74476. * Collection of the child tile views.
  74477. *
  74478. * @readonly
  74479. * @member {module:ui/viewcollection~ViewCollection}
  74480. */
  74481. this.items = this.createCollection();
  74482. /**
  74483. * Tracks information about DOM focus in the grid.
  74484. *
  74485. * @readonly
  74486. * @member {module:utils/focustracker~FocusTracker}
  74487. */
  74488. this.focusTracker = new _ckeditor_ckeditor5_utils_src_focustracker__WEBPACK_IMPORTED_MODULE_2__["default"]();
  74489. /**
  74490. * Instance of the {@link module:utils/keystrokehandler~KeystrokeHandler}.
  74491. *
  74492. * @readonly
  74493. * @member {module:utils/keystrokehandler~KeystrokeHandler}
  74494. */
  74495. this.keystrokes = new _ckeditor_ckeditor5_utils_src_keystrokehandler__WEBPACK_IMPORTED_MODULE_4__["default"]();
  74496. /**
  74497. * Helps cycling over focusable {@link #items} in the grid.
  74498. *
  74499. * @readonly
  74500. * @protected
  74501. * @member {module:ui/focuscycler~FocusCycler}
  74502. */
  74503. this._focusCycler = new _focuscycler__WEBPACK_IMPORTED_MODULE_3__["default"]( {
  74504. focusables: this.items,
  74505. focusTracker: this.focusTracker,
  74506. keystrokeHandler: this.keystrokes,
  74507. actions: {
  74508. // Navigate grid items backwards using the arrowup key.
  74509. focusPrevious: 'arrowleft',
  74510. // Navigate grid items forwards using the arrowdown key.
  74511. focusNext: 'arrowright'
  74512. }
  74513. } );
  74514. this.items.on( 'add', ( evt, colorTile ) => {
  74515. colorTile.isOn = colorTile.color === this.selectedColor;
  74516. } );
  74517. colorDefinitions.forEach( color => {
  74518. const colorTile = new _colortileview__WEBPACK_IMPORTED_MODULE_1__["default"]();
  74519. colorTile.set( {
  74520. color: color.color,
  74521. label: color.label,
  74522. tooltip: true,
  74523. hasBorder: color.options.hasBorder
  74524. } );
  74525. colorTile.on( 'execute', () => {
  74526. this.fire( 'execute', {
  74527. value: color.color,
  74528. hasBorder: color.options.hasBorder,
  74529. label: color.label
  74530. } );
  74531. } );
  74532. this.items.add( colorTile );
  74533. } );
  74534. this.setTemplate( {
  74535. tag: 'div',
  74536. children: this.items,
  74537. attributes: {
  74538. class: [
  74539. 'ck',
  74540. 'ck-color-grid'
  74541. ],
  74542. style: viewStyleAttribute
  74543. }
  74544. } );
  74545. this.on( 'change:selectedColor', ( evt, name, selectedColor ) => {
  74546. for ( const item of this.items ) {
  74547. item.isOn = item.color === selectedColor;
  74548. }
  74549. } );
  74550. }
  74551. /**
  74552. * Focuses the first focusable in {@link #items}.
  74553. */
  74554. focus() {
  74555. if ( this.items.length ) {
  74556. this.items.first.focus();
  74557. }
  74558. }
  74559. /**
  74560. * Focuses the last focusable in {@link #items}.
  74561. */
  74562. focusLast() {
  74563. if ( this.items.length ) {
  74564. this.items.last.focus();
  74565. }
  74566. }
  74567. /**
  74568. * @inheritDoc
  74569. */
  74570. render() {
  74571. super.render();
  74572. // Items added before rendering should be known to the #focusTracker.
  74573. for ( const item of this.items ) {
  74574. this.focusTracker.add( item.element );
  74575. }
  74576. this.items.on( 'add', ( evt, item ) => {
  74577. this.focusTracker.add( item.element );
  74578. } );
  74579. this.items.on( 'remove', ( evt, item ) => {
  74580. this.focusTracker.remove( item.element );
  74581. } );
  74582. // Start listening for the keystrokes coming from #element.
  74583. this.keystrokes.listenTo( this.element );
  74584. }
  74585. /**
  74586. * Fired when the `ColorTileView` for the picked item is executed.
  74587. *
  74588. * @event execute
  74589. * @param {Object} data Additional information about the event.
  74590. * @param {String} data.value The value of the selected color
  74591. * ({@link module:ui/colorgrid/colorgrid~ColorDefinition#color `color.color`}).
  74592. * @param {Boolean} data.hasBorder The `hasBorder` property of the selected color
  74593. * ({@link module:ui/colorgrid/colorgrid~ColorDefinition#options `color.options.hasBorder`}).
  74594. * @param {String} data.Label The label of the selected color
  74595. * ({@link module:ui/colorgrid/colorgrid~ColorDefinition#label `color.label`})
  74596. */
  74597. }
  74598. /**
  74599. * A color definition used to create a {@link module:ui/colorgrid/colortile~ColorTileView}.
  74600. *
  74601. * {
  74602. * color: 'hsl(0, 0%, 75%)',
  74603. * label: 'Light Grey',
  74604. * options: {
  74605. * hasBorder: true
  74606. * }
  74607. * }
  74608. *
  74609. * @typedef {Object} module:ui/colorgrid/colorgrid~ColorDefinition
  74610. * @type Object
  74611. *
  74612. * @property {String} color String representing a color.
  74613. * It is used as value of background-color style in {@link module:ui/colorgrid/colortile~ColorTileView}.
  74614. * @property {String} label String used as label for {@link module:ui/colorgrid/colortile~ColorTileView}.
  74615. * @property {Object} options Additional options passed to create a {@link module:ui/colorgrid/colortile~ColorTileView}.
  74616. * @property {Boolean} options.hasBorder A flag that indicates if special a CSS class should be added
  74617. * to {@link module:ui/colorgrid/colortile~ColorTileView}, which renders a border around it.
  74618. */
  74619. /***/ }),
  74620. /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/colorgrid/colortileview.js":
  74621. /*!****************************************************************************!*\
  74622. !*** ./node_modules/@ckeditor/ckeditor5-ui/src/colorgrid/colortileview.js ***!
  74623. \****************************************************************************/
  74624. /*! exports provided: default */
  74625. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  74626. "use strict";
  74627. __webpack_require__.r(__webpack_exports__);
  74628. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ColorTileView; });
  74629. /* harmony import */ var _button_buttonview__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../button/buttonview */ "./node_modules/@ckeditor/ckeditor5-ui/src/button/buttonview.js");
  74630. /* 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");
  74631. /**
  74632. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  74633. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  74634. */
  74635. /**
  74636. * @module ui/colorgrid/colortile
  74637. */
  74638. /**
  74639. * This class represents a single color tile in the {@link module:ui/colorgrid/colorgrid~ColorGridView}.
  74640. *
  74641. * @extends module:ui/button/buttonview~ButtonView
  74642. */
  74643. class ColorTileView extends _button_buttonview__WEBPACK_IMPORTED_MODULE_0__["default"] {
  74644. constructor( locale ) {
  74645. super( locale );
  74646. const bind = this.bindTemplate;
  74647. /**
  74648. * String representing a color shown as tile's background.
  74649. *
  74650. * @type {String}
  74651. */
  74652. this.set( 'color' );
  74653. /**
  74654. * A flag that toggles a special CSS class responsible for displaying
  74655. * a border around the button.
  74656. *
  74657. * @type {Boolean}
  74658. */
  74659. this.set( 'hasBorder' );
  74660. this.icon = _theme_icons_color_tile_check_svg__WEBPACK_IMPORTED_MODULE_1__["default"];
  74661. this.extendTemplate( {
  74662. attributes: {
  74663. style: {
  74664. backgroundColor: bind.to( 'color' )
  74665. },
  74666. class: [
  74667. 'ck',
  74668. 'ck-color-grid__tile',
  74669. bind.if( 'hasBorder', 'ck-color-table__color-tile_bordered' )
  74670. ]
  74671. }
  74672. } );
  74673. }
  74674. /**
  74675. * @inheritDoc
  74676. */
  74677. render() {
  74678. super.render();
  74679. this.iconView.fillColor = 'hsl(0, 0%, 100%)';
  74680. }
  74681. }
  74682. /***/ }),
  74683. /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/colorgrid/utils.js":
  74684. /*!********************************************************************!*\
  74685. !*** ./node_modules/@ckeditor/ckeditor5-ui/src/colorgrid/utils.js ***!
  74686. \********************************************************************/
  74687. /*! exports provided: getLocalizedColorOptions, normalizeColorOptions, normalizeSingleColorDefinition */
  74688. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  74689. "use strict";
  74690. __webpack_require__.r(__webpack_exports__);
  74691. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getLocalizedColorOptions", function() { return getLocalizedColorOptions; });
  74692. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "normalizeColorOptions", function() { return normalizeColorOptions; });
  74693. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "normalizeSingleColorDefinition", function() { return normalizeSingleColorDefinition; });
  74694. /**
  74695. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  74696. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  74697. */
  74698. /**
  74699. * @module ui/colorgrid/utils
  74700. */
  74701. /**
  74702. * Returns color configuration options as defined in `editor.config.(fontColor|fontBackgroundColor).colors` or
  74703. * `editor.config.table.(tableProperties|tableCellProperties).(background|border).colors
  74704. * but processed to account for editor localization in the correct language.
  74705. *
  74706. * Note: The reason behind this method is that there is no way to use {@link module:utils/locale~Locale#t}
  74707. * when the user configuration is defined because the editor does not exist yet.
  74708. *
  74709. * @param {module:utils/locale~Locale} locale The {@link module:core/editor/editor~Editor#locale} instance.
  74710. * @param {Array.<module:ui/colorgrid/colorgrid~ColorDefinition>} options
  74711. * @returns {Array.<module:ui/colorgrid/colorgrid~ColorDefinition>}.
  74712. */
  74713. function getLocalizedColorOptions( locale, options ) {
  74714. const t = locale.t;
  74715. const localizedColorNames = {
  74716. Black: t( 'Black' ),
  74717. 'Dim grey': t( 'Dim grey' ),
  74718. Grey: t( 'Grey' ),
  74719. 'Light grey': t( 'Light grey' ),
  74720. White: t( 'White' ),
  74721. Red: t( 'Red' ),
  74722. Orange: t( 'Orange' ),
  74723. Yellow: t( 'Yellow' ),
  74724. 'Light green': t( 'Light green' ),
  74725. Green: t( 'Green' ),
  74726. Aquamarine: t( 'Aquamarine' ),
  74727. Turquoise: t( 'Turquoise' ),
  74728. 'Light blue': t( 'Light blue' ),
  74729. Blue: t( 'Blue' ),
  74730. Purple: t( 'Purple' )
  74731. };
  74732. return options.map( colorOption => {
  74733. const label = localizedColorNames[ colorOption.label ];
  74734. if ( label && label != colorOption.label ) {
  74735. colorOption.label = label;
  74736. }
  74737. return colorOption;
  74738. } );
  74739. }
  74740. /**
  74741. * Creates a unified color definition object from color configuration options.
  74742. * The object contains the information necessary to both render the UI and initialize the conversion.
  74743. *
  74744. * @param {module:ui/colorgrid/colorgrid~ColorDefinition} options
  74745. * @returns {Array.<module:ui/colorgrid/colorgrid~ColorDefinition>}
  74746. */
  74747. function normalizeColorOptions( options ) {
  74748. return options
  74749. .map( normalizeSingleColorDefinition )
  74750. .filter( option => !!option );
  74751. }
  74752. // Creates a normalized color definition from the user-defined configuration.
  74753. // The "normalization" means it will create full
  74754. // {@link module:ui/colorgrid/colorgrid~ColorDefinition `ColorDefinition-like`}
  74755. // object for string values, and add a `view` property, for each definition.
  74756. //
  74757. // @param {String|module:ui/colorgrid/colorgrid~ColorDefinition}
  74758. // @returns {module:ui/colorgrid/colorgrid~ColorDefinition}
  74759. function normalizeSingleColorDefinition( color ) {
  74760. if ( typeof color === 'string' ) {
  74761. return {
  74762. model: color,
  74763. label: color,
  74764. hasBorder: false,
  74765. view: {
  74766. name: 'span',
  74767. styles: {
  74768. color
  74769. }
  74770. }
  74771. };
  74772. } else {
  74773. return {
  74774. model: color.color,
  74775. label: color.label || color.color,
  74776. hasBorder: color.hasBorder === undefined ? false : color.hasBorder,
  74777. view: {
  74778. name: 'span',
  74779. styles: {
  74780. color: `${ color.color }`
  74781. }
  74782. }
  74783. };
  74784. }
  74785. }
  74786. /***/ }),
  74787. /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/componentfactory.js":
  74788. /*!*********************************************************************!*\
  74789. !*** ./node_modules/@ckeditor/ckeditor5-ui/src/componentfactory.js ***!
  74790. \*********************************************************************/
  74791. /*! exports provided: default */
  74792. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  74793. "use strict";
  74794. __webpack_require__.r(__webpack_exports__);
  74795. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ComponentFactory; });
  74796. /* 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");
  74797. /**
  74798. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  74799. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  74800. */
  74801. /**
  74802. * @module ui/componentfactory
  74803. */
  74804. /**
  74805. * A helper class implementing the UI component ({@link module:ui/view~View view}) factory.
  74806. *
  74807. * It allows functions producing specific UI components to be registered under their unique names
  74808. * in the factory. A registered component can be then instantiated by providing its name.
  74809. * Note that names are case insensitive.
  74810. *
  74811. * // The editor provides localization tools for the factory.
  74812. * const factory = new ComponentFactory( editor );
  74813. *
  74814. * factory.add( 'foo', locale => new FooView( locale ) );
  74815. * factory.add( 'bar', locale => new BarView( locale ) );
  74816. *
  74817. * // An instance of FooView.
  74818. * const fooInstance = factory.create( 'foo' );
  74819. *
  74820. * // Names are case insensitive so this is also allowed:
  74821. * const barInstance = factory.create( 'Bar' );
  74822. *
  74823. * The {@link module:core/editor/editor~Editor#locale editor locale} is passed to the factory
  74824. * function when {@link module:ui/componentfactory~ComponentFactory#create} is called.
  74825. */
  74826. class ComponentFactory {
  74827. /**
  74828. * Creates an instance of the factory.
  74829. *
  74830. * @constructor
  74831. * @param {module:core/editor/editor~Editor} editor The editor instance.
  74832. */
  74833. constructor( editor ) {
  74834. /**
  74835. * The editor instance that the factory belongs to.
  74836. *
  74837. * @readonly
  74838. * @member {module:core/editor/editor~Editor}
  74839. */
  74840. this.editor = editor;
  74841. /**
  74842. * Registered component factories.
  74843. *
  74844. * @private
  74845. * @member {Map}
  74846. */
  74847. this._components = new Map();
  74848. }
  74849. /**
  74850. * Returns an iterator of registered component names. Names are returned in lower case.
  74851. *
  74852. * @returns {Iterable.<String>}
  74853. */
  74854. * names() {
  74855. for ( const value of this._components.values() ) {
  74856. yield value.originalName;
  74857. }
  74858. }
  74859. /**
  74860. * Registers a component factory function that will be used by the
  74861. * {@link #create create} method and called with the
  74862. * {@link module:core/editor/editor~Editor#locale editor locale} as an argument,
  74863. * allowing localization of the {@link module:ui/view~View view}.
  74864. *
  74865. * @param {String} name The name of the component.
  74866. * @param {Function} callback The callback that returns the component.
  74867. */
  74868. add( name, callback ) {
  74869. this._components.set( getNormalized( name ), { callback, originalName: name } );
  74870. }
  74871. /**
  74872. * Creates an instance of a component registered in the factory under a specific name.
  74873. *
  74874. * When called, the {@link module:core/editor/editor~Editor#locale editor locale} is passed to
  74875. * the previously {@link #add added} factory function, allowing localization of the
  74876. * {@link module:ui/view~View view}.
  74877. *
  74878. * @param {String} name The name of the component.
  74879. * @returns {module:ui/view~View} The instantiated component view.
  74880. */
  74881. create( name ) {
  74882. if ( !this.has( name ) ) {
  74883. /**
  74884. * The required component is not registered in the component factory. Please make sure
  74885. * the provided name is correct and the component has been correctly
  74886. * {@link #add added} to the factory.
  74887. *
  74888. * @error componentfactory-item-missing
  74889. * @param {String} name The name of the missing component.
  74890. */
  74891. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"](
  74892. 'componentfactory-item-missing',
  74893. this,
  74894. { name }
  74895. );
  74896. }
  74897. return this._components.get( getNormalized( name ) ).callback( this.editor.locale );
  74898. }
  74899. /**
  74900. * Checks if a component of a given name is registered in the factory.
  74901. *
  74902. * @param {String} name The name of the component.
  74903. * @returns {Boolean}
  74904. */
  74905. has( name ) {
  74906. return this._components.has( getNormalized( name ) );
  74907. }
  74908. }
  74909. //
  74910. // Ensures that the component name used as the key in the internal map is in lower case.
  74911. //
  74912. // @private
  74913. // @param {String} name
  74914. // @returns {String}
  74915. function getNormalized( name ) {
  74916. return String( name ).toLowerCase();
  74917. }
  74918. /***/ }),
  74919. /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/dropdown/button/dropdownbuttonview.js":
  74920. /*!***************************************************************************************!*\
  74921. !*** ./node_modules/@ckeditor/ckeditor5-ui/src/dropdown/button/dropdownbuttonview.js ***!
  74922. \***************************************************************************************/
  74923. /*! exports provided: default */
  74924. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  74925. "use strict";
  74926. __webpack_require__.r(__webpack_exports__);
  74927. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return DropdownButtonView; });
  74928. /* harmony import */ var _button_buttonview__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../button/buttonview */ "./node_modules/@ckeditor/ckeditor5-ui/src/button/buttonview.js");
  74929. /* 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");
  74930. /* harmony import */ var _icon_iconview__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../icon/iconview */ "./node_modules/@ckeditor/ckeditor5-ui/src/icon/iconview.js");
  74931. /**
  74932. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  74933. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  74934. */
  74935. /**
  74936. * @module ui/dropdown/button/dropdownbuttonview
  74937. */
  74938. /**
  74939. * The default dropdown button view class.
  74940. *
  74941. * const view = new DropdownButtonView();
  74942. *
  74943. * view.set( {
  74944. * label: 'A button',
  74945. * keystroke: 'Ctrl+B',
  74946. * tooltip: true
  74947. * } );
  74948. *
  74949. * view.render();
  74950. *
  74951. * document.body.append( view.element );
  74952. *
  74953. * Also see the {@link module:ui/dropdown/utils~createDropdown `createDropdown()` util}.
  74954. *
  74955. * @implements module:ui/dropdown/button/dropdownbutton~DropdownButton
  74956. * @extends module:ui/button/buttonview~ButtonView
  74957. */
  74958. class DropdownButtonView extends _button_buttonview__WEBPACK_IMPORTED_MODULE_0__["default"] {
  74959. /**
  74960. * @inheritDoc
  74961. */
  74962. constructor( locale ) {
  74963. super( locale );
  74964. /**
  74965. * An icon that displays arrow to indicate a dropdown button.
  74966. *
  74967. * @readonly
  74968. * @member {module:ui/icon/iconview~IconView}
  74969. */
  74970. this.arrowView = this._createArrowView();
  74971. this.extendTemplate( {
  74972. attributes: {
  74973. 'aria-haspopup': true
  74974. }
  74975. } );
  74976. // The DropdownButton interface expects the open event upon which will open the dropdown.
  74977. this.delegate( 'execute' ).to( this, 'open' );
  74978. }
  74979. /**
  74980. * @inheritDoc
  74981. */
  74982. render() {
  74983. super.render();
  74984. this.children.add( this.arrowView );
  74985. }
  74986. /**
  74987. * Creates a {@link module:ui/icon/iconview~IconView} instance as {@link #arrowView}.
  74988. *
  74989. * @private
  74990. * @returns {module:ui/icon/iconview~IconView}
  74991. */
  74992. _createArrowView() {
  74993. const arrowView = new _icon_iconview__WEBPACK_IMPORTED_MODULE_2__["default"]();
  74994. arrowView.content = _theme_icons_dropdown_arrow_svg__WEBPACK_IMPORTED_MODULE_1__["default"];
  74995. arrowView.extendTemplate( {
  74996. attributes: {
  74997. class: 'ck-dropdown__arrow'
  74998. }
  74999. } );
  75000. return arrowView;
  75001. }
  75002. }
  75003. /***/ }),
  75004. /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/dropdown/button/splitbuttonview.js":
  75005. /*!************************************************************************************!*\
  75006. !*** ./node_modules/@ckeditor/ckeditor5-ui/src/dropdown/button/splitbuttonview.js ***!
  75007. \************************************************************************************/
  75008. /*! exports provided: default */
  75009. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  75010. "use strict";
  75011. __webpack_require__.r(__webpack_exports__);
  75012. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return SplitButtonView; });
  75013. /* harmony import */ var _view__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../view */ "./node_modules/@ckeditor/ckeditor5-ui/src/view.js");
  75014. /* harmony import */ var _button_buttonview__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../button/buttonview */ "./node_modules/@ckeditor/ckeditor5-ui/src/button/buttonview.js");
  75015. /* 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");
  75016. /* 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");
  75017. /* 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");
  75018. /* 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");
  75019. /* 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__);
  75020. /**
  75021. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  75022. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  75023. */
  75024. /**
  75025. * @module ui/dropdown/button/splitbuttonview
  75026. */
  75027. /**
  75028. * The split button view class.
  75029. *
  75030. * const view = new SplitButtonView();
  75031. *
  75032. * view.set( {
  75033. * label: 'A button',
  75034. * keystroke: 'Ctrl+B',
  75035. * tooltip: true
  75036. * } );
  75037. *
  75038. * view.render();
  75039. *
  75040. * document.body.append( view.element );
  75041. *
  75042. * Also see the {@link module:ui/dropdown/utils~createDropdown `createDropdown()` util}.
  75043. *
  75044. * @implements module:ui/dropdown/button/dropdownbutton~DropdownButton
  75045. * @extends module:ui/view~View
  75046. */
  75047. class SplitButtonView extends _view__WEBPACK_IMPORTED_MODULE_0__["default"] {
  75048. /**
  75049. * @inheritDoc
  75050. */
  75051. constructor( locale ) {
  75052. super( locale );
  75053. const bind = this.bindTemplate;
  75054. // Implement the Button interface.
  75055. this.set( 'icon' );
  75056. this.set( 'isEnabled', true );
  75057. this.set( 'isOn', false );
  75058. this.set( 'isToggleable', false );
  75059. this.set( 'isVisible', true );
  75060. this.set( 'keystroke' );
  75061. this.set( 'label' );
  75062. this.set( 'tabindex', -1 );
  75063. this.set( 'tooltip' );
  75064. this.set( 'tooltipPosition', 's' );
  75065. this.set( 'type', 'button' );
  75066. this.set( 'withText', false );
  75067. /**
  75068. * Collection of the child views inside of the split button {@link #element}.
  75069. *
  75070. * @readonly
  75071. * @member {module:ui/viewcollection~ViewCollection}
  75072. */
  75073. this.children = this.createCollection();
  75074. /**
  75075. * A main button of split button.
  75076. *
  75077. * @readonly
  75078. * @member {module:ui/button/buttonview~ButtonView}
  75079. */
  75080. this.actionView = this._createActionView();
  75081. /**
  75082. * A secondary button of split button that opens dropdown.
  75083. *
  75084. * @readonly
  75085. * @member {module:ui/button/buttonview~ButtonView}
  75086. */
  75087. this.arrowView = this._createArrowView();
  75088. /**
  75089. * Instance of the {@link module:utils/keystrokehandler~KeystrokeHandler}. It manages
  75090. * keystrokes of the split button:
  75091. *
  75092. * * <kbd>▶</kbd> moves focus to arrow view when action view is focused,
  75093. * * <kbd>◀</kbd> moves focus to action view when arrow view is focused.
  75094. *
  75095. * @readonly
  75096. * @member {module:utils/keystrokehandler~KeystrokeHandler}
  75097. */
  75098. this.keystrokes = new _ckeditor_ckeditor5_utils_src_keystrokehandler__WEBPACK_IMPORTED_MODULE_2__["default"]();
  75099. /**
  75100. * Tracks information about DOM focus in the dropdown.
  75101. *
  75102. * @readonly
  75103. * @member {module:utils/focustracker~FocusTracker}
  75104. */
  75105. this.focusTracker = new _ckeditor_ckeditor5_utils_src_focustracker__WEBPACK_IMPORTED_MODULE_3__["default"]();
  75106. this.setTemplate( {
  75107. tag: 'div',
  75108. attributes: {
  75109. class: [
  75110. 'ck',
  75111. 'ck-splitbutton',
  75112. bind.if( 'isVisible', 'ck-hidden', value => !value ),
  75113. this.arrowView.bindTemplate.if( 'isOn', 'ck-splitbutton_open' )
  75114. ]
  75115. },
  75116. children: this.children
  75117. } );
  75118. }
  75119. /**
  75120. * @inheritDoc
  75121. */
  75122. render() {
  75123. super.render();
  75124. this.children.add( this.actionView );
  75125. this.children.add( this.arrowView );
  75126. this.focusTracker.add( this.actionView.element );
  75127. this.focusTracker.add( this.arrowView.element );
  75128. this.keystrokes.listenTo( this.element );
  75129. // Overrides toolbar focus cycling behavior.
  75130. this.keystrokes.set( 'arrowright', ( evt, cancel ) => {
  75131. if ( this.focusTracker.focusedElement === this.actionView.element ) {
  75132. this.arrowView.focus();
  75133. cancel();
  75134. }
  75135. } );
  75136. // Overrides toolbar focus cycling behavior.
  75137. this.keystrokes.set( 'arrowleft', ( evt, cancel ) => {
  75138. if ( this.focusTracker.focusedElement === this.arrowView.element ) {
  75139. this.actionView.focus();
  75140. cancel();
  75141. }
  75142. } );
  75143. }
  75144. /**
  75145. * Focuses the {@link #actionView#element} of the action part of split button.
  75146. */
  75147. focus() {
  75148. this.actionView.focus();
  75149. }
  75150. /**
  75151. * Creates a {@link module:ui/button/buttonview~ButtonView} instance as {@link #actionView} and binds it with main split button
  75152. * attributes.
  75153. *
  75154. * @private
  75155. * @returns {module:ui/button/buttonview~ButtonView}
  75156. */
  75157. _createActionView() {
  75158. const actionView = new _button_buttonview__WEBPACK_IMPORTED_MODULE_1__["default"]();
  75159. actionView.bind(
  75160. 'icon',
  75161. 'isEnabled',
  75162. 'isOn',
  75163. 'isToggleable',
  75164. 'keystroke',
  75165. 'label',
  75166. 'tabindex',
  75167. 'tooltip',
  75168. 'tooltipPosition',
  75169. 'type',
  75170. 'withText'
  75171. ).to( this );
  75172. actionView.extendTemplate( {
  75173. attributes: {
  75174. class: 'ck-splitbutton__action'
  75175. }
  75176. } );
  75177. actionView.delegate( 'execute' ).to( this );
  75178. return actionView;
  75179. }
  75180. /**
  75181. * Creates a {@link module:ui/button/buttonview~ButtonView} instance as {@link #arrowView} and binds it with main split button
  75182. * attributes.
  75183. *
  75184. * @private
  75185. * @returns {module:ui/button/buttonview~ButtonView}
  75186. */
  75187. _createArrowView() {
  75188. const arrowView = new _button_buttonview__WEBPACK_IMPORTED_MODULE_1__["default"]();
  75189. const bind = arrowView.bindTemplate;
  75190. arrowView.icon = _theme_icons_dropdown_arrow_svg__WEBPACK_IMPORTED_MODULE_4__["default"];
  75191. arrowView.extendTemplate( {
  75192. attributes: {
  75193. class: 'ck-splitbutton__arrow',
  75194. 'aria-haspopup': true,
  75195. 'aria-expanded': bind.to( 'isOn', value => String( value ) )
  75196. }
  75197. } );
  75198. arrowView.bind( 'isEnabled' ).to( this );
  75199. arrowView.delegate( 'execute' ).to( this, 'open' );
  75200. return arrowView;
  75201. }
  75202. }
  75203. /***/ }),
  75204. /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/dropdown/dropdownpanelview.js":
  75205. /*!*******************************************************************************!*\
  75206. !*** ./node_modules/@ckeditor/ckeditor5-ui/src/dropdown/dropdownpanelview.js ***!
  75207. \*******************************************************************************/
  75208. /*! exports provided: default */
  75209. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  75210. "use strict";
  75211. __webpack_require__.r(__webpack_exports__);
  75212. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return DropdownPanelView; });
  75213. /* harmony import */ var _view__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../view */ "./node_modules/@ckeditor/ckeditor5-ui/src/view.js");
  75214. /**
  75215. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  75216. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  75217. */
  75218. /**
  75219. * @module ui/dropdown/dropdownpanelview
  75220. */
  75221. /**
  75222. * The dropdown panel view class.
  75223. *
  75224. * See {@link module:ui/dropdown/dropdownview~DropdownView} to learn about the common usage.
  75225. *
  75226. * @extends module:ui/view~View
  75227. */
  75228. class DropdownPanelView extends _view__WEBPACK_IMPORTED_MODULE_0__["default"] {
  75229. /**
  75230. * @inheritDoc
  75231. */
  75232. constructor( locale ) {
  75233. super( locale );
  75234. const bind = this.bindTemplate;
  75235. /**
  75236. * Controls whether the panel is visible.
  75237. *
  75238. * @observable
  75239. * @member {Boolean} #isVisible
  75240. */
  75241. this.set( 'isVisible', false );
  75242. /**
  75243. * The position of the panel, relative to the parent.
  75244. *
  75245. * This property is reflected in the CSS class set to {@link #element} that controls
  75246. * the position of the panel.
  75247. *
  75248. * @observable
  75249. * @default 'se'
  75250. * @member {'s'|'se'|'sw'|'sme'|'smw'|'n'|'ne'|'nw'|'nme'|'nmw'} #position
  75251. */
  75252. this.set( 'position', 'se' );
  75253. /**
  75254. * Collection of the child views in this panel.
  75255. *
  75256. * A common child type is the {@link module:ui/list/listview~ListView} and {@link module:ui/toolbar/toolbarview~ToolbarView}.
  75257. * See {@link module:ui/dropdown/utils~addListToDropdown} and
  75258. * {@link module:ui/dropdown/utils~addToolbarToDropdown} to learn more about child views of dropdowns.
  75259. *
  75260. * @readonly
  75261. * @member {module:ui/viewcollection~ViewCollection}
  75262. */
  75263. this.children = this.createCollection();
  75264. this.setTemplate( {
  75265. tag: 'div',
  75266. attributes: {
  75267. class: [
  75268. 'ck',
  75269. 'ck-reset',
  75270. 'ck-dropdown__panel',
  75271. bind.to( 'position', value => `ck-dropdown__panel_${ value }` ),
  75272. bind.if( 'isVisible', 'ck-dropdown__panel-visible' )
  75273. ]
  75274. },
  75275. children: this.children,
  75276. on: {
  75277. // Drag and drop in the panel should not break the selection in the editor.
  75278. // https://github.com/ckeditor/ckeditor5-ui/issues/228
  75279. selectstart: bind.to( evt => evt.preventDefault() )
  75280. }
  75281. } );
  75282. }
  75283. /**
  75284. * Focuses the view element or first item in view collection on opening dropdown's panel.
  75285. *
  75286. * See also {@link module:ui/dropdown/dropdownpanelfocusable~DropdownPanelFocusable}.
  75287. */
  75288. focus() {
  75289. if ( this.children.length ) {
  75290. this.children.first.focus();
  75291. }
  75292. }
  75293. /**
  75294. * Focuses the view element or last item in view collection on opening dropdown's panel.
  75295. *
  75296. * See also {@link module:ui/dropdown/dropdownpanelfocusable~DropdownPanelFocusable}.
  75297. */
  75298. focusLast() {
  75299. if ( this.children.length ) {
  75300. const lastChild = this.children.last;
  75301. if ( typeof lastChild.focusLast === 'function' ) {
  75302. lastChild.focusLast();
  75303. } else {
  75304. lastChild.focus();
  75305. }
  75306. }
  75307. }
  75308. }
  75309. /***/ }),
  75310. /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/dropdown/dropdownview.js":
  75311. /*!**************************************************************************!*\
  75312. !*** ./node_modules/@ckeditor/ckeditor5-ui/src/dropdown/dropdownview.js ***!
  75313. \**************************************************************************/
  75314. /*! exports provided: default */
  75315. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  75316. "use strict";
  75317. __webpack_require__.r(__webpack_exports__);
  75318. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return DropdownView; });
  75319. /* harmony import */ var _view__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../view */ "./node_modules/@ckeditor/ckeditor5-ui/src/view.js");
  75320. /* 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");
  75321. /* 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");
  75322. /* 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__);
  75323. /* 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");
  75324. /**
  75325. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  75326. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  75327. */
  75328. /**
  75329. * @module ui/dropdown/dropdownview
  75330. */
  75331. /**
  75332. * The dropdown view class. It manages the dropdown button and dropdown panel.
  75333. *
  75334. * In most cases, the easiest way to create a dropdown is by using the {@link module:ui/dropdown/utils~createDropdown}
  75335. * util:
  75336. *
  75337. * const dropdown = createDropdown( locale );
  75338. *
  75339. * // Configure dropdown's button properties:
  75340. * dropdown.buttonView.set( {
  75341. * label: 'A dropdown',
  75342. * withText: true
  75343. * } );
  75344. *
  75345. * dropdown.render();
  75346. *
  75347. * dropdown.panelView.element.textContent = 'Content of the panel';
  75348. *
  75349. * // Will render a dropdown with a panel containing a "Content of the panel" text.
  75350. * document.body.appendChild( dropdown.element );
  75351. *
  75352. * If you want to add a richer content to the dropdown panel, you can use the {@link module:ui/dropdown/utils~addListToDropdown}
  75353. * and {@link module:ui/dropdown/utils~addToolbarToDropdown} helpers. See more examples in
  75354. * {@link module:ui/dropdown/utils~createDropdown} documentation.
  75355. *
  75356. * If you want to create a completely custom dropdown, then you can compose it manually:
  75357. *
  75358. * const button = new DropdownButtonView( locale );
  75359. * const panel = new DropdownPanelView( locale );
  75360. * const dropdown = new DropdownView( locale, button, panel );
  75361. *
  75362. * button.set( {
  75363. * label: 'A dropdown',
  75364. * withText: true
  75365. * } );
  75366. *
  75367. * dropdown.render();
  75368. *
  75369. * panel.element.textContent = 'Content of the panel';
  75370. *
  75371. * // Will render a dropdown with a panel containing a "Content of the panel" text.
  75372. * document.body.appendChild( dropdown.element );
  75373. *
  75374. * However, dropdown created this way will contain little behavior. You will need to implement handlers for actions
  75375. * such as {@link module:ui/bindings/clickoutsidehandler~clickOutsideHandler clicking outside an open dropdown}
  75376. * (which should close it) and support for arrow keys inside the panel. Therefore, unless you really know what
  75377. * you do and you really need to do it, it is recommended to use the {@link module:ui/dropdown/utils~createDropdown} helper.
  75378. *
  75379. * @extends module:ui/view~View
  75380. */
  75381. class DropdownView extends _view__WEBPACK_IMPORTED_MODULE_0__["default"] {
  75382. /**
  75383. * Creates an instance of the dropdown.
  75384. *
  75385. * Also see {@link #render}.
  75386. *
  75387. * @param {module:utils/locale~Locale} [locale] The localization services instance.
  75388. * @param {module:ui/dropdown/button/dropdownbutton~DropdownButton} buttonView
  75389. * @param {module:ui/dropdown/dropdownpanelview~DropdownPanelView} panelView
  75390. */
  75391. constructor( locale, buttonView, panelView ) {
  75392. super( locale );
  75393. const bind = this.bindTemplate;
  75394. /**
  75395. * Button of the dropdown view. Clicking the button opens the {@link #panelView}.
  75396. *
  75397. * @readonly
  75398. * @member {module:ui/button/buttonview~ButtonView} #buttonView
  75399. */
  75400. this.buttonView = buttonView;
  75401. /**
  75402. * Panel of the dropdown. It opens when the {@link #buttonView} is
  75403. * {@link module:ui/button/buttonview~ButtonView#event:execute executed} (i.e. clicked).
  75404. *
  75405. * Child views can be added to the panel's `children` collection:
  75406. *
  75407. * dropdown.panelView.children.add( childView );
  75408. *
  75409. * See {@link module:ui/dropdown/dropdownpanelview~DropdownPanelView#children} and
  75410. * {@link module:ui/viewcollection~ViewCollection#add}.
  75411. *
  75412. * @readonly
  75413. * @member {module:ui/dropdown/dropdownpanelview~DropdownPanelView} #panelView
  75414. */
  75415. this.panelView = panelView;
  75416. /**
  75417. * Controls whether the dropdown view is open, i.e. shows or hides the {@link #panelView panel}.
  75418. *
  75419. * @observable
  75420. * @member {Boolean} #isOpen
  75421. */
  75422. this.set( 'isOpen', false );
  75423. /**
  75424. * Controls whether the dropdown is enabled, i.e. it can be clicked and execute an action.
  75425. *
  75426. * See {@link module:ui/button/buttonview~ButtonView#isEnabled}.
  75427. *
  75428. * @observable
  75429. * @member {Boolean} #isEnabled
  75430. */
  75431. this.set( 'isEnabled', true );
  75432. /**
  75433. * (Optional) The additional CSS class set on the dropdown {@link #element}.
  75434. *
  75435. * @observable
  75436. * @member {String} #class
  75437. */
  75438. this.set( 'class' );
  75439. /**
  75440. * (Optional) The `id` attribute of the dropdown (i.e. to pair with a `<label>` element).
  75441. *
  75442. * @observable
  75443. * @member {String} #id
  75444. */
  75445. this.set( 'id' );
  75446. /**
  75447. * The position of the panel, relative to the dropdown.
  75448. *
  75449. * **Note**: When `'auto'`, the panel will use one of the remaining positions to stay
  75450. * in the viewport, visible to the user. The positions correspond directly to
  75451. * {@link module:ui/dropdown/dropdownview~DropdownView.defaultPanelPositions default panel positions}.
  75452. *
  75453. * **Note**: This value has an impact on the
  75454. * {@link module:ui/dropdown/dropdownpanelview~DropdownPanelView#position} property
  75455. * each time the panel becomes {@link #isOpen open}.
  75456. *
  75457. * @observable
  75458. * @default 'auto'
  75459. * @member {'auto'|'s'|'se'|'sw'|'sme'|'smw'|'n'|'ne'|'nw'|'nme'|'nmw'} #panelPosition
  75460. */
  75461. this.set( 'panelPosition', 'auto' );
  75462. /**
  75463. * Instance of the {@link module:utils/keystrokehandler~KeystrokeHandler}. It manages
  75464. * keystrokes of the dropdown:
  75465. *
  75466. * * <kbd>▼</kbd> opens the dropdown,
  75467. * * <kbd>◀</kbd> and <kbd>Esc</kbd> closes the dropdown.
  75468. *
  75469. * @readonly
  75470. * @member {module:utils/keystrokehandler~KeystrokeHandler}
  75471. */
  75472. this.keystrokes = new _ckeditor_ckeditor5_utils_src_keystrokehandler__WEBPACK_IMPORTED_MODULE_1__["default"]();
  75473. this.setTemplate( {
  75474. tag: 'div',
  75475. attributes: {
  75476. class: [
  75477. 'ck',
  75478. 'ck-dropdown',
  75479. bind.to( 'class' ),
  75480. bind.if( 'isEnabled', 'ck-disabled', value => !value )
  75481. ],
  75482. id: bind.to( 'id' ),
  75483. 'aria-describedby': bind.to( 'ariaDescribedById' )
  75484. },
  75485. children: [
  75486. buttonView,
  75487. panelView
  75488. ]
  75489. } );
  75490. buttonView.extendTemplate( {
  75491. attributes: {
  75492. class: [
  75493. 'ck-dropdown__button'
  75494. ]
  75495. }
  75496. } );
  75497. /**
  75498. * A child {@link module:ui/list/listview~ListView list view} of the dropdown located
  75499. * in its {@link module:ui/dropdown/dropdownview~DropdownView#panelView panel}.
  75500. *
  75501. * **Note**: Only supported when dropdown has list view added using {@link module:ui/dropdown/utils~addListToDropdown}.
  75502. *
  75503. * @readonly
  75504. * @member {module:ui/list/listview~ListView} #listView
  75505. */
  75506. /**
  75507. * A child toolbar of the dropdown located in the
  75508. * {@link module:ui/dropdown/dropdownview~DropdownView#panelView panel}.
  75509. *
  75510. * **Note**: Only supported when dropdown has list view added using {@link module:ui/dropdown/utils~addToolbarToDropdown}.
  75511. *
  75512. * @readonly
  75513. * @member {module:ui/toolbar/toolbarview~ToolbarView} #toolbarView
  75514. */
  75515. /**
  75516. * Fired when the toolbar button or list item is executed.
  75517. *
  75518. * For {@link #listView} It fires when a child of some {@link module:ui/list/listitemview~ListItemView}
  75519. * fired `execute`.
  75520. *
  75521. * For {@link #toolbarView} It fires when one of the buttons has been
  75522. * {@link module:ui/button/buttonview~ButtonView#event:execute executed}.
  75523. *
  75524. * **Note**: Only supported when dropdown has list view added using {@link module:ui/dropdown/utils~addListToDropdown}
  75525. * or {@link module:ui/dropdown/utils~addToolbarToDropdown}.
  75526. *
  75527. * @event execute
  75528. */
  75529. }
  75530. /**
  75531. * @inheritDoc
  75532. */
  75533. render() {
  75534. super.render();
  75535. // Toggle the dropdown when its button has been clicked.
  75536. this.listenTo( this.buttonView, 'open', () => {
  75537. this.isOpen = !this.isOpen;
  75538. } );
  75539. // Toggle the visibility of the panel when the dropdown becomes open.
  75540. this.panelView.bind( 'isVisible' ).to( this, 'isOpen' );
  75541. // Let the dropdown control the position of the panel. The position must
  75542. // be updated every time the dropdown is open.
  75543. this.on( 'change:isOpen', () => {
  75544. if ( !this.isOpen ) {
  75545. return;
  75546. }
  75547. // If "auto", find the best position of the panel to fit into the viewport.
  75548. // Otherwise, simply assign the static position.
  75549. if ( this.panelPosition === 'auto' ) {
  75550. this.panelView.position = DropdownView._getOptimalPosition( {
  75551. element: this.panelView.element,
  75552. target: this.buttonView.element,
  75553. fitInViewport: true,
  75554. positions: this._panelPositions
  75555. } ).name;
  75556. } else {
  75557. this.panelView.position = this.panelPosition;
  75558. }
  75559. } );
  75560. // Listen for keystrokes coming from within #element.
  75561. this.keystrokes.listenTo( this.element );
  75562. const closeDropdown = ( data, cancel ) => {
  75563. if ( this.isOpen ) {
  75564. this.buttonView.focus();
  75565. this.isOpen = false;
  75566. cancel();
  75567. }
  75568. };
  75569. // Open the dropdown panel using the arrow down key, just like with return or space.
  75570. this.keystrokes.set( 'arrowdown', ( data, cancel ) => {
  75571. // Don't open if the dropdown is disabled or already open.
  75572. if ( this.buttonView.isEnabled && !this.isOpen ) {
  75573. this.isOpen = true;
  75574. cancel();
  75575. }
  75576. } );
  75577. // Block the right arrow key (until nested dropdowns are implemented).
  75578. this.keystrokes.set( 'arrowright', ( data, cancel ) => {
  75579. if ( this.isOpen ) {
  75580. cancel();
  75581. }
  75582. } );
  75583. // Close the dropdown using the arrow left/escape key.
  75584. this.keystrokes.set( 'arrowleft', closeDropdown );
  75585. this.keystrokes.set( 'esc', closeDropdown );
  75586. }
  75587. /**
  75588. * Focuses the {@link #buttonView}.
  75589. */
  75590. focus() {
  75591. this.buttonView.focus();
  75592. }
  75593. /**
  75594. * Returns {@link #panelView panel} positions to be used by the
  75595. * {@link module:utils/dom/position~getOptimalPosition `getOptimalPosition()`}
  75596. * utility considering the direction of the language the UI of the editor is displayed in.
  75597. *
  75598. * @type {module:utils/dom/position~Options#positions}
  75599. * @private
  75600. */
  75601. get _panelPositions() {
  75602. const {
  75603. south, north,
  75604. southEast, southWest,
  75605. northEast, northWest,
  75606. southMiddleEast, southMiddleWest,
  75607. northMiddleEast, northMiddleWest
  75608. } = DropdownView.defaultPanelPositions;
  75609. if ( this.locale.uiLanguageDirection !== 'rtl' ) {
  75610. return [
  75611. southEast, southWest, southMiddleEast, southMiddleWest, south,
  75612. northEast, northWest, northMiddleEast, northMiddleWest, north
  75613. ];
  75614. } else {
  75615. return [
  75616. southWest, southEast, southMiddleWest, southMiddleEast, south,
  75617. northWest, northEast, northMiddleWest, northMiddleEast, north
  75618. ];
  75619. }
  75620. }
  75621. }
  75622. /**
  75623. * A set of positioning functions used by the dropdown view to determine
  75624. * the optimal position (i.e. fitting into the browser viewport) of its
  75625. * {@link module:ui/dropdown/dropdownview~DropdownView#panelView panel} when
  75626. * {@link module:ui/dropdown/dropdownview~DropdownView#panelPosition} is set to 'auto'`.
  75627. *
  75628. * The available positioning functions are as follow:
  75629. *
  75630. * **South**
  75631. *
  75632. * * `south`
  75633. *
  75634. * [ Button ]
  75635. * +-----------------+
  75636. * | Panel |
  75637. * +-----------------+
  75638. *
  75639. * * `southEast`
  75640. *
  75641. * [ Button ]
  75642. * +-----------------+
  75643. * | Panel |
  75644. * +-----------------+
  75645. *
  75646. * * `southWest`
  75647. *
  75648. * [ Button ]
  75649. * +-----------------+
  75650. * | Panel |
  75651. * +-----------------+
  75652. *
  75653. * * `southMiddleEast`
  75654. *
  75655. * [ Button ]
  75656. * +-----------------+
  75657. * | Panel |
  75658. * +-----------------+
  75659. *
  75660. * * `southMiddleWest`
  75661. *
  75662. * [ Button ]
  75663. * +-----------------+
  75664. * | Panel |
  75665. * +-----------------+
  75666. *
  75667. * **North**
  75668. *
  75669. * * `north`
  75670. *
  75671. * +-----------------+
  75672. * | Panel |
  75673. * +-----------------+
  75674. * [ Button ]
  75675. *
  75676. * * `northEast`
  75677. *
  75678. * +-----------------+
  75679. * | Panel |
  75680. * +-----------------+
  75681. * [ Button ]
  75682. *
  75683. * * `northWest`
  75684. *
  75685. * +-----------------+
  75686. * | Panel |
  75687. * +-----------------+
  75688. * [ Button ]
  75689. *
  75690. * * `northMiddleEast`
  75691. *
  75692. * +-----------------+
  75693. * | Panel |
  75694. * +-----------------+
  75695. * [ Button ]
  75696. *
  75697. * * `northMiddleWest`
  75698. *
  75699. * +-----------------+
  75700. * | Panel |
  75701. * +-----------------+
  75702. * [ Button ]
  75703. *
  75704. * Positioning functions are compatible with {@link module:utils/dom/position~Position}.
  75705. *
  75706. * The name that position function returns will be reflected in dropdown panel's class that
  75707. * controls its placement. See {@link module:ui/dropdown/dropdownview~DropdownView#panelPosition}
  75708. * to learn more.
  75709. *
  75710. * @member {Object} module:ui/dropdown/dropdownview~DropdownView.defaultPanelPositions
  75711. */
  75712. DropdownView.defaultPanelPositions = {
  75713. south: ( buttonRect, panelRect ) => {
  75714. return {
  75715. top: buttonRect.bottom,
  75716. left: buttonRect.left - ( panelRect.width - buttonRect.width ) / 2,
  75717. name: 's'
  75718. };
  75719. },
  75720. southEast: buttonRect => {
  75721. return {
  75722. top: buttonRect.bottom,
  75723. left: buttonRect.left,
  75724. name: 'se'
  75725. };
  75726. },
  75727. southWest: ( buttonRect, panelRect ) => {
  75728. return {
  75729. top: buttonRect.bottom,
  75730. left: buttonRect.left - panelRect.width + buttonRect.width,
  75731. name: 'sw'
  75732. };
  75733. },
  75734. southMiddleEast: ( buttonRect, panelRect ) => {
  75735. return {
  75736. top: buttonRect.bottom,
  75737. left: buttonRect.left - ( panelRect.width - buttonRect.width ) / 4,
  75738. name: 'sme'
  75739. };
  75740. },
  75741. southMiddleWest: ( buttonRect, panelRect ) => {
  75742. return {
  75743. top: buttonRect.bottom,
  75744. left: buttonRect.left - ( panelRect.width - buttonRect.width ) * 3 / 4,
  75745. name: 'smw'
  75746. };
  75747. },
  75748. north: ( buttonRect, panelRect ) => {
  75749. return {
  75750. top: buttonRect.top - panelRect.height,
  75751. left: buttonRect.left - ( panelRect.width - buttonRect.width ) / 2,
  75752. name: 'n'
  75753. };
  75754. },
  75755. northEast: ( buttonRect, panelRect ) => {
  75756. return {
  75757. top: buttonRect.top - panelRect.height,
  75758. left: buttonRect.left,
  75759. name: 'ne'
  75760. };
  75761. },
  75762. northWest: ( buttonRect, panelRect ) => {
  75763. return {
  75764. top: buttonRect.top - panelRect.height,
  75765. left: buttonRect.left - panelRect.width + buttonRect.width,
  75766. name: 'nw'
  75767. };
  75768. },
  75769. northMiddleEast: ( buttonRect, panelRect ) => {
  75770. return {
  75771. top: buttonRect.top - panelRect.height,
  75772. left: buttonRect.left - ( panelRect.width - buttonRect.width ) / 4,
  75773. name: 'nme'
  75774. };
  75775. },
  75776. northMiddleWest: ( buttonRect, panelRect ) => {
  75777. return {
  75778. top: buttonRect.top - panelRect.height,
  75779. left: buttonRect.left - ( panelRect.width - buttonRect.width ) * 3 / 4,
  75780. name: 'nmw'
  75781. };
  75782. }
  75783. };
  75784. /**
  75785. * A function used to calculate the optimal position for the dropdown panel.
  75786. *
  75787. * @protected
  75788. * @member {Function} module:ui/dropdown/dropdownview~DropdownView._getOptimalPosition
  75789. */
  75790. DropdownView._getOptimalPosition = _ckeditor_ckeditor5_utils_src_dom_position__WEBPACK_IMPORTED_MODULE_3__["getOptimalPosition"];
  75791. /***/ }),
  75792. /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/dropdown/utils.js":
  75793. /*!*******************************************************************!*\
  75794. !*** ./node_modules/@ckeditor/ckeditor5-ui/src/dropdown/utils.js ***!
  75795. \*******************************************************************/
  75796. /*! exports provided: createDropdown, addToolbarToDropdown, addListToDropdown */
  75797. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  75798. "use strict";
  75799. __webpack_require__.r(__webpack_exports__);
  75800. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createDropdown", function() { return createDropdown; });
  75801. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addToolbarToDropdown", function() { return addToolbarToDropdown; });
  75802. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addListToDropdown", function() { return addListToDropdown; });
  75803. /* harmony import */ var _dropdownpanelview__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./dropdownpanelview */ "./node_modules/@ckeditor/ckeditor5-ui/src/dropdown/dropdownpanelview.js");
  75804. /* harmony import */ var _dropdownview__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./dropdownview */ "./node_modules/@ckeditor/ckeditor5-ui/src/dropdown/dropdownview.js");
  75805. /* harmony import */ var _button_dropdownbuttonview__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./button/dropdownbuttonview */ "./node_modules/@ckeditor/ckeditor5-ui/src/dropdown/button/dropdownbuttonview.js");
  75806. /* harmony import */ var _toolbar_toolbarview__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../toolbar/toolbarview */ "./node_modules/@ckeditor/ckeditor5-ui/src/toolbar/toolbarview.js");
  75807. /* harmony import */ var _list_listview__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../list/listview */ "./node_modules/@ckeditor/ckeditor5-ui/src/list/listview.js");
  75808. /* harmony import */ var _list_listitemview__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../list/listitemview */ "./node_modules/@ckeditor/ckeditor5-ui/src/list/listitemview.js");
  75809. /* harmony import */ var _list_listseparatorview__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../list/listseparatorview */ "./node_modules/@ckeditor/ckeditor5-ui/src/list/listseparatorview.js");
  75810. /* harmony import */ var _button_buttonview__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../button/buttonview */ "./node_modules/@ckeditor/ckeditor5-ui/src/button/buttonview.js");
  75811. /* harmony import */ var _button_switchbuttonview__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../button/switchbuttonview */ "./node_modules/@ckeditor/ckeditor5-ui/src/button/switchbuttonview.js");
  75812. /* harmony import */ var _bindings_clickoutsidehandler__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../bindings/clickoutsidehandler */ "./node_modules/@ckeditor/ckeditor5-ui/src/bindings/clickoutsidehandler.js");
  75813. /* 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");
  75814. /* 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__);
  75815. /* 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");
  75816. /* 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__);
  75817. /**
  75818. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  75819. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  75820. */
  75821. /**
  75822. * @module ui/dropdown/utils
  75823. */
  75824. /**
  75825. * A helper for creating dropdowns. It creates an instance of a {@link module:ui/dropdown/dropdownview~DropdownView dropdown},
  75826. * with a {@link module:ui/dropdown/button/dropdownbutton~DropdownButton button},
  75827. * {@link module:ui/dropdown/dropdownpanelview~DropdownPanelView panel} and all standard dropdown's behaviors.
  75828. *
  75829. * # Creating dropdowns
  75830. *
  75831. * By default, the default {@link module:ui/dropdown/button/dropdownbuttonview~DropdownButtonView} class is used as
  75832. * definition of the button:
  75833. *
  75834. * const dropdown = createDropdown( model );
  75835. *
  75836. * // Configure dropdown's button properties:
  75837. * dropdown.buttonView.set( {
  75838. * label: 'A dropdown',
  75839. * withText: true
  75840. * } );
  75841. *
  75842. * dropdown.render();
  75843. *
  75844. * // Will render a dropdown labeled "A dropdown" with an empty panel.
  75845. * document.body.appendChild( dropdown.element );
  75846. *
  75847. * You can also provide other button views (they need to implement the
  75848. * {@link module:ui/dropdown/button/dropdownbutton~DropdownButton} interface). For instance, you can use
  75849. * {@link module:ui/dropdown/button/splitbuttonview~SplitButtonView} to create a dropdown with a split button.
  75850. *
  75851. * const dropdown = createDropdown( model, SplitButtonView );
  75852. *
  75853. * // Configure dropdown's button properties:
  75854. * dropdown.buttonView.set( {
  75855. * label: 'A dropdown',
  75856. * withText: true
  75857. * } );
  75858. *
  75859. * dropdown.buttonView.on( 'execute', () => {
  75860. * // Add the behavior of the "action part" of the split button.
  75861. * // Split button consists of the "action part" and "arrow part".
  75862. * // The arrow opens the dropdown while the action part can have some other behavior.
  75863. * } );
  75864. *
  75865. * dropdown.render();
  75866. *
  75867. * // Will render a dropdown labeled "A dropdown" with an empty panel.
  75868. * document.body.appendChild( dropdown.element );
  75869. *
  75870. * # Adding content to the dropdown's panel
  75871. *
  75872. * The content of the panel can be inserted directly into the `dropdown.panelView.element`:
  75873. *
  75874. * dropdown.panelView.element.textContent = 'Content of the panel';
  75875. *
  75876. * However, most of the time you will want to add there either a {@link module:ui/list/listview~ListView list of options}
  75877. * or a list of buttons (i.e. a {@link module:ui/toolbar/toolbarview~ToolbarView toolbar}).
  75878. * To simplify the task, you can use, respectively, {@link module:ui/dropdown/utils~addListToDropdown} or
  75879. * {@link module:ui/dropdown/utils~addToolbarToDropdown} utils.
  75880. *
  75881. * @param {module:utils/locale~Locale} locale The locale instance.
  75882. * @param {Function} ButtonClass The dropdown button view class. Needs to implement the
  75883. * {@link module:ui/dropdown/button/dropdownbutton~DropdownButton} interface.
  75884. * @returns {module:ui/dropdown/dropdownview~DropdownView} The dropdown view instance.
  75885. */
  75886. function createDropdown( locale, ButtonClass = _button_dropdownbuttonview__WEBPACK_IMPORTED_MODULE_2__["default"] ) {
  75887. const buttonView = new ButtonClass( locale );
  75888. const panelView = new _dropdownpanelview__WEBPACK_IMPORTED_MODULE_0__["default"]( locale );
  75889. const dropdownView = new _dropdownview__WEBPACK_IMPORTED_MODULE_1__["default"]( locale, buttonView, panelView );
  75890. buttonView.bind( 'isEnabled' ).to( dropdownView );
  75891. if ( buttonView instanceof _button_dropdownbuttonview__WEBPACK_IMPORTED_MODULE_2__["default"] ) {
  75892. buttonView.bind( 'isOn' ).to( dropdownView, 'isOpen' );
  75893. } else {
  75894. buttonView.arrowView.bind( 'isOn' ).to( dropdownView, 'isOpen' );
  75895. }
  75896. addDefaultBehavior( dropdownView );
  75897. return dropdownView;
  75898. }
  75899. /**
  75900. * Adds an instance of {@link module:ui/toolbar/toolbarview~ToolbarView} to a dropdown.
  75901. *
  75902. * const buttons = [];
  75903. *
  75904. * // Either create a new ButtonView instance or create existing.
  75905. * buttons.push( new ButtonView() );
  75906. * buttons.push( editor.ui.componentFactory.create( 'someButton' ) );
  75907. *
  75908. * const dropdown = createDropdown( locale );
  75909. *
  75910. * addToolbarToDropdown( dropdown, buttons );
  75911. *
  75912. * dropdown.toolbarView.isVertical = true;
  75913. *
  75914. * // Will render a vertical button dropdown labeled "A button dropdown"
  75915. * // with a button group in the panel containing two buttons.
  75916. * dropdown.render()
  75917. * document.body.appendChild( dropdown.element );
  75918. *
  75919. * See {@link module:ui/dropdown/utils~createDropdown} and {@link module:ui/toolbar/toolbarview~ToolbarView}.
  75920. *
  75921. * @param {module:ui/dropdown/dropdownview~DropdownView} dropdownView A dropdown instance to which `ToolbarView` will be added.
  75922. * @param {Iterable.<module:ui/button/buttonview~ButtonView>} buttons
  75923. */
  75924. function addToolbarToDropdown( dropdownView, buttons ) {
  75925. const locale = dropdownView.locale;
  75926. const t = locale.t;
  75927. const toolbarView = dropdownView.toolbarView = new _toolbar_toolbarview__WEBPACK_IMPORTED_MODULE_3__["default"]( locale );
  75928. toolbarView.set( 'ariaLabel', t( 'Dropdown toolbar' ) );
  75929. dropdownView.extendTemplate( {
  75930. attributes: {
  75931. class: [ 'ck-toolbar-dropdown' ]
  75932. }
  75933. } );
  75934. buttons.map( view => toolbarView.items.add( view ) );
  75935. dropdownView.panelView.children.add( toolbarView );
  75936. toolbarView.items.delegate( 'execute' ).to( dropdownView );
  75937. }
  75938. /**
  75939. * Adds an instance of {@link module:ui/list/listview~ListView} to a dropdown.
  75940. *
  75941. * const items = new Collection();
  75942. *
  75943. * items.add( {
  75944. * type: 'button',
  75945. * model: new Model( {
  75946. * withText: true,
  75947. * label: 'First item',
  75948. * labelStyle: 'color: red'
  75949. * } )
  75950. * } );
  75951. *
  75952. * items.add( {
  75953. * type: 'button',
  75954. * model: new Model( {
  75955. * withText: true,
  75956. * label: 'Second item',
  75957. * labelStyle: 'color: green',
  75958. * class: 'foo'
  75959. * } )
  75960. * } );
  75961. *
  75962. * const dropdown = createDropdown( locale );
  75963. *
  75964. * addListToDropdown( dropdown, items );
  75965. *
  75966. * // Will render a dropdown with a list in the panel containing two items.
  75967. * dropdown.render()
  75968. * document.body.appendChild( dropdown.element );
  75969. *
  75970. * The `items` collection passed to this methods controls the presence and attributes of respective
  75971. * {@link module:ui/list/listitemview~ListItemView list items}.
  75972. *
  75973. *
  75974. * See {@link module:ui/dropdown/utils~createDropdown} and {@link module:list/list~List}.
  75975. *
  75976. * @param {module:ui/dropdown/dropdownview~DropdownView} dropdownView A dropdown instance to which `ListVIew` will be added.
  75977. * @param {Iterable.<module:ui/dropdown/utils~ListDropdownItemDefinition>} items
  75978. * A collection of the list item definitions to populate the list.
  75979. */
  75980. function addListToDropdown( dropdownView, items ) {
  75981. const locale = dropdownView.locale;
  75982. const listView = dropdownView.listView = new _list_listview__WEBPACK_IMPORTED_MODULE_4__["default"]( locale );
  75983. listView.items.bindTo( items ).using( ( { type, model } ) => {
  75984. if ( type === 'separator' ) {
  75985. return new _list_listseparatorview__WEBPACK_IMPORTED_MODULE_6__["default"]( locale );
  75986. } else if ( type === 'button' || type === 'switchbutton' ) {
  75987. const listItemView = new _list_listitemview__WEBPACK_IMPORTED_MODULE_5__["default"]( locale );
  75988. let buttonView;
  75989. if ( type === 'button' ) {
  75990. buttonView = new _button_buttonview__WEBPACK_IMPORTED_MODULE_7__["default"]( locale );
  75991. } else {
  75992. buttonView = new _button_switchbuttonview__WEBPACK_IMPORTED_MODULE_8__["default"]( locale );
  75993. }
  75994. // Bind all model properties to the button view.
  75995. buttonView.bind( ...Object.keys( model ) ).to( model );
  75996. buttonView.delegate( 'execute' ).to( listItemView );
  75997. listItemView.children.add( buttonView );
  75998. return listItemView;
  75999. }
  76000. } );
  76001. dropdownView.panelView.children.add( listView );
  76002. listView.items.delegate( 'execute' ).to( dropdownView );
  76003. }
  76004. // Add a set of default behaviors to dropdown view.
  76005. //
  76006. // @param {module:ui/dropdown/dropdownview~DropdownView} dropdownView
  76007. function addDefaultBehavior( dropdownView ) {
  76008. closeDropdownOnBlur( dropdownView );
  76009. closeDropdownOnExecute( dropdownView );
  76010. focusDropdownContentsOnArrows( dropdownView );
  76011. }
  76012. // Adds a behavior to a dropdownView that closes opened dropdown when user clicks outside the dropdown.
  76013. //
  76014. // @param {module:ui/dropdown/dropdownview~DropdownView} dropdownView
  76015. function closeDropdownOnBlur( dropdownView ) {
  76016. dropdownView.on( 'render', () => {
  76017. Object(_bindings_clickoutsidehandler__WEBPACK_IMPORTED_MODULE_9__["default"])( {
  76018. emitter: dropdownView,
  76019. activator: () => dropdownView.isOpen,
  76020. callback: () => {
  76021. dropdownView.isOpen = false;
  76022. },
  76023. contextElements: [ dropdownView.element ]
  76024. } );
  76025. } );
  76026. }
  76027. // Adds a behavior to a dropdownView that closes the dropdown view on "execute" event.
  76028. //
  76029. // @param {module:ui/dropdown/dropdownview~DropdownView} dropdownView
  76030. function closeDropdownOnExecute( dropdownView ) {
  76031. // Close the dropdown when one of the list items has been executed.
  76032. dropdownView.on( 'execute', evt => {
  76033. // Toggling a switch button view should not close the dropdown.
  76034. if ( evt.source instanceof _button_switchbuttonview__WEBPACK_IMPORTED_MODULE_8__["default"] ) {
  76035. return;
  76036. }
  76037. dropdownView.isOpen = false;
  76038. } );
  76039. }
  76040. // Adds a behavior to a dropdownView that focuses the dropdown's panel view contents on keystrokes.
  76041. //
  76042. // @param {module:ui/dropdown/dropdownview~DropdownView} dropdownView
  76043. function focusDropdownContentsOnArrows( dropdownView ) {
  76044. // If the dropdown panel is already open, the arrow down key should focus the first child of the #panelView.
  76045. dropdownView.keystrokes.set( 'arrowdown', ( data, cancel ) => {
  76046. if ( dropdownView.isOpen ) {
  76047. dropdownView.panelView.focus();
  76048. cancel();
  76049. }
  76050. } );
  76051. // If the dropdown panel is already open, the arrow up key should focus the last child of the #panelView.
  76052. dropdownView.keystrokes.set( 'arrowup', ( data, cancel ) => {
  76053. if ( dropdownView.isOpen ) {
  76054. dropdownView.panelView.focusLast();
  76055. cancel();
  76056. }
  76057. } );
  76058. }
  76059. /**
  76060. * A definition of the list item used by the {@link module:ui/dropdown/utils~addListToDropdown}
  76061. * utility.
  76062. *
  76063. * @typedef {Object} module:ui/dropdown/utils~ListDropdownItemDefinition
  76064. *
  76065. * @property {String} type Either `'separator'`, `'button'` or `'switchbutton'`.
  76066. * @property {module:ui/model~Model} [model] Model of the item (when **not** `'separator'`).
  76067. * Its properties fuel the newly created list item (or its children, depending on the `type`).
  76068. */
  76069. /***/ }),
  76070. /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/editableui/editableuiview.js":
  76071. /*!******************************************************************************!*\
  76072. !*** ./node_modules/@ckeditor/ckeditor5-ui/src/editableui/editableuiview.js ***!
  76073. \******************************************************************************/
  76074. /*! exports provided: default */
  76075. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  76076. "use strict";
  76077. __webpack_require__.r(__webpack_exports__);
  76078. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return EditableUIView; });
  76079. /* harmony import */ var _view__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../view */ "./node_modules/@ckeditor/ckeditor5-ui/src/view.js");
  76080. /**
  76081. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  76082. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  76083. */
  76084. /**
  76085. * @module ui/editableui/editableuiview
  76086. */
  76087. /**
  76088. * The editable UI view class.
  76089. *
  76090. * @extends module:ui/view~View
  76091. */
  76092. class EditableUIView extends _view__WEBPACK_IMPORTED_MODULE_0__["default"] {
  76093. /**
  76094. * Creates an instance of EditableUIView class.
  76095. *
  76096. * @param {module:utils/locale~Locale} [locale] The locale instance.
  76097. * @param {module:engine/view/view~View} editingView The editing view instance the editable is related to.
  76098. * @param {HTMLElement} [editableElement] The editable element. If not specified, this view
  76099. * should create it. Otherwise, the existing element should be used.
  76100. */
  76101. constructor( locale, editingView, editableElement ) {
  76102. super( locale );
  76103. this.setTemplate( {
  76104. tag: 'div',
  76105. attributes: {
  76106. class: [
  76107. 'ck',
  76108. 'ck-content',
  76109. 'ck-editor__editable',
  76110. 'ck-rounded-corners'
  76111. ],
  76112. lang: locale.contentLanguage,
  76113. dir: locale.contentLanguageDirection
  76114. }
  76115. } );
  76116. /**
  76117. * The name of the editable UI view.
  76118. *
  76119. * @member {String} #name
  76120. */
  76121. this.name = null;
  76122. /**
  76123. * Controls whether the editable is focused, i.e. the user is typing in it.
  76124. *
  76125. * @observable
  76126. * @member {Boolean} #isFocused
  76127. */
  76128. this.set( 'isFocused', false );
  76129. /**
  76130. * The element which is the main editable element (usually the one with `contentEditable="true"`).
  76131. *
  76132. * @private
  76133. * @type {HTMLElement}
  76134. */
  76135. this._editableElement = editableElement;
  76136. /**
  76137. * Whether an external {@link #_editableElement} was passed into the constructor, which also means
  76138. * the view will not render its {@link #template}.
  76139. *
  76140. * @private
  76141. * @type {Boolean}
  76142. */
  76143. this._hasExternalElement = !!this._editableElement;
  76144. /**
  76145. * The editing view instance the editable is related to. Editable uses the editing
  76146. * view to dynamically modify its certain DOM attributes after {@link #render rendering}.
  76147. *
  76148. * **Note**: The DOM attributes are performed by the editing view and not UI
  76149. * {@link module:ui/view~View#bindTemplate template bindings} because once rendered,
  76150. * the editable DOM element must remain under the full control of the engine to work properly.
  76151. *
  76152. * @protected
  76153. * @type {module:engine/view/view~View}
  76154. */
  76155. this._editingView = editingView;
  76156. }
  76157. /**
  76158. * Renders the view by either applying the {@link #template} to the existing
  76159. * {@link #_editableElement} or assigning {@link #element} as {@link #_editableElement}.
  76160. */
  76161. render() {
  76162. super.render();
  76163. if ( this._hasExternalElement ) {
  76164. this.template.apply( this.element = this._editableElement );
  76165. } else {
  76166. this._editableElement = this.element;
  76167. }
  76168. this.on( 'change:isFocused', () => this._updateIsFocusedClasses() );
  76169. this._updateIsFocusedClasses();
  76170. }
  76171. /**
  76172. * @inheritDoc
  76173. */
  76174. destroy() {
  76175. if ( this._hasExternalElement ) {
  76176. this.template.revert( this._editableElement );
  76177. }
  76178. super.destroy();
  76179. }
  76180. /**
  76181. * Updates the `ck-focused` and `ck-blurred` CSS classes on the {@link #element} according to
  76182. * the {@link #isFocused} property value using the {@link #_editingView editing view} API.
  76183. *
  76184. * @private
  76185. */
  76186. _updateIsFocusedClasses() {
  76187. const editingView = this._editingView;
  76188. if ( editingView.isRenderingInProgress ) {
  76189. updateAfterRender( this );
  76190. } else {
  76191. update( this );
  76192. }
  76193. function update( view ) {
  76194. editingView.change( writer => {
  76195. const viewRoot = editingView.document.getRoot( view.name );
  76196. writer.addClass( view.isFocused ? 'ck-focused' : 'ck-blurred', viewRoot );
  76197. writer.removeClass( view.isFocused ? 'ck-blurred' : 'ck-focused', viewRoot );
  76198. } );
  76199. }
  76200. // In a case of a multi-root editor, a callback will be attached more than once (one callback for each root).
  76201. // While executing one callback the `isRenderingInProgress` observable is changing what causes executing another
  76202. // callback and render is called inside the already pending render.
  76203. // We need to be sure that callback is executed only when the value has changed from `true` to `false`.
  76204. // See https://github.com/ckeditor/ckeditor5/issues/1676.
  76205. function updateAfterRender( view ) {
  76206. editingView.once( 'change:isRenderingInProgress', ( evt, name, value ) => {
  76207. if ( !value ) {
  76208. update( view );
  76209. } else {
  76210. updateAfterRender( view );
  76211. }
  76212. } );
  76213. }
  76214. }
  76215. }
  76216. /***/ }),
  76217. /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/editableui/inline/inlineeditableuiview.js":
  76218. /*!*******************************************************************************************!*\
  76219. !*** ./node_modules/@ckeditor/ckeditor5-ui/src/editableui/inline/inlineeditableuiview.js ***!
  76220. \*******************************************************************************************/
  76221. /*! exports provided: default */
  76222. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  76223. "use strict";
  76224. __webpack_require__.r(__webpack_exports__);
  76225. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return InlineEditableUIView; });
  76226. /* harmony import */ var _editableui_editableuiview__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../editableui/editableuiview */ "./node_modules/@ckeditor/ckeditor5-ui/src/editableui/editableuiview.js");
  76227. /**
  76228. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  76229. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  76230. */
  76231. /**
  76232. * @module ui/editableui/inline/inlineeditableuiview
  76233. */
  76234. /**
  76235. * The inline editable UI class implementing an inline {@link module:ui/editableui/editableuiview~EditableUIView}.
  76236. *
  76237. * @extends module:ui/editableui/editableuiview~EditableUIView
  76238. */
  76239. class InlineEditableUIView extends _editableui_editableuiview__WEBPACK_IMPORTED_MODULE_0__["default"] {
  76240. /**
  76241. * Creates an instance of the InlineEditableUIView class.
  76242. *
  76243. * @param {module:utils/locale~Locale} [locale] The locale instance.
  76244. * @param {module:engine/view/view~View} editingView The editing view instance the editable is related to.
  76245. * @param {HTMLElement} [editableElement] The editable element. If not specified, the
  76246. * {@link module:ui/editableui/editableuiview~EditableUIView}
  76247. * will create it. Otherwise, the existing element will be used.
  76248. */
  76249. constructor( locale, editingView, editableElement ) {
  76250. super( locale, editingView, editableElement );
  76251. this.extendTemplate( {
  76252. attributes: {
  76253. role: 'textbox',
  76254. class: 'ck-editor__editable_inline'
  76255. }
  76256. } );
  76257. }
  76258. /**
  76259. * @inheritDoc
  76260. */
  76261. render() {
  76262. super.render();
  76263. const editingView = this._editingView;
  76264. const t = this.t;
  76265. editingView.change( writer => {
  76266. const viewRoot = editingView.document.getRoot( this.name );
  76267. writer.setAttribute( 'aria-label', t( 'Rich Text Editor, %0', this.name ), viewRoot );
  76268. } );
  76269. }
  76270. }
  76271. /***/ }),
  76272. /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/editorui/bodycollection.js":
  76273. /*!****************************************************************************!*\
  76274. !*** ./node_modules/@ckeditor/ckeditor5-ui/src/editorui/bodycollection.js ***!
  76275. \****************************************************************************/
  76276. /*! exports provided: default */
  76277. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  76278. "use strict";
  76279. __webpack_require__.r(__webpack_exports__);
  76280. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return BodyCollection; });
  76281. /* harmony import */ var _template__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../template */ "./node_modules/@ckeditor/ckeditor5-ui/src/template.js");
  76282. /* harmony import */ var _viewcollection__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../viewcollection */ "./node_modules/@ckeditor/ckeditor5-ui/src/viewcollection.js");
  76283. /* 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");
  76284. /**
  76285. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  76286. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  76287. */
  76288. /**
  76289. * @module ui/editorui/bodycollection
  76290. */
  76291. /* globals document */
  76292. /**
  76293. * This is a special {@link module:ui/viewcollection~ViewCollection} dedicated to elements that are detached
  76294. * from the DOM structure of the editor, like panels, icons, etc.
  76295. *
  76296. * The body collection is available in the {@link module:ui/editorui/editoruiview~EditorUIView#body `editor.ui.view.body`} property.
  76297. * Any plugin can add a {@link module:ui/view~View view} to this collection.
  76298. * These views will render in a container placed directly in the `<body>` element.
  76299. * The editor will detach and destroy this collection when the editor will be {@link module:core/editor/editor~Editor#destroy destroyed}.
  76300. *
  76301. * If you need to control the life cycle of the body collection on your own, you can create your own instance of this class.
  76302. *
  76303. * A body collection will render itself automatically in the DOM body element as soon as you call {@link ~BodyCollection#attachToDom}.
  76304. * If you create multiple body collections, this class will create a special wrapper element in the DOM to limit the number of
  76305. * elements created directly in the body and remove it when the last body collection will be
  76306. * {@link ~BodyCollection#detachFromDom detached}.
  76307. *
  76308. * @extends module:ui/viewcollection~ViewCollection
  76309. */
  76310. class BodyCollection extends _viewcollection__WEBPACK_IMPORTED_MODULE_1__["default"] {
  76311. /**
  76312. * Creates a new instance of the {@link module:ui/editorui/bodycollection~BodyCollection}.
  76313. *
  76314. * @param {module:utils/locale~Locale} locale The {@link module:core/editor/editor~Editor editor's locale} instance.
  76315. * @param {Iterable.<module:ui/view~View>} [initialItems] The initial items of the collection.
  76316. */
  76317. constructor( locale, initialItems = [] ) {
  76318. super( initialItems );
  76319. /**
  76320. * The {@link module:core/editor/editor~Editor#locale editor's locale} instance.
  76321. * See the view {@link module:ui/view~View#locale locale} property.
  76322. *
  76323. * @member {module:utils/locale~Locale}
  76324. */
  76325. this.locale = locale;
  76326. }
  76327. /**
  76328. * Attaches the body collection to the DOM body element. You need to execute this method to render the content of
  76329. * the body collection.
  76330. */
  76331. attachToDom() {
  76332. /**
  76333. * The element holding elements of the body region.
  76334. *
  76335. * @protected
  76336. * @member {HTMLElement} #_bodyCollectionContainer
  76337. */
  76338. this._bodyCollectionContainer = new _template__WEBPACK_IMPORTED_MODULE_0__["default"]( {
  76339. tag: 'div',
  76340. attributes: {
  76341. class: [
  76342. 'ck',
  76343. 'ck-reset_all',
  76344. 'ck-body',
  76345. 'ck-rounded-corners'
  76346. ],
  76347. dir: this.locale.uiLanguageDirection
  76348. },
  76349. children: this
  76350. } ).render();
  76351. let wrapper = document.querySelector( '.ck-body-wrapper' );
  76352. if ( !wrapper ) {
  76353. wrapper = Object(_ckeditor_ckeditor5_utils_src_dom_createelement__WEBPACK_IMPORTED_MODULE_2__["default"])( document, 'div', { class: 'ck-body-wrapper' } );
  76354. document.body.appendChild( wrapper );
  76355. }
  76356. wrapper.appendChild( this._bodyCollectionContainer );
  76357. }
  76358. /**
  76359. * Detaches the collection from the DOM structure. Use this method when you do not need to use the body collection
  76360. * anymore to clean-up the DOM structure.
  76361. */
  76362. detachFromDom() {
  76363. super.destroy();
  76364. if ( this._bodyCollectionContainer ) {
  76365. this._bodyCollectionContainer.remove();
  76366. }
  76367. const wrapper = document.querySelector( '.ck-body-wrapper' );
  76368. if ( wrapper && wrapper.childElementCount == 0 ) {
  76369. wrapper.remove();
  76370. }
  76371. }
  76372. }
  76373. /***/ }),
  76374. /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/editorui/boxed/boxededitoruiview.js":
  76375. /*!*************************************************************************************!*\
  76376. !*** ./node_modules/@ckeditor/ckeditor5-ui/src/editorui/boxed/boxededitoruiview.js ***!
  76377. \*************************************************************************************/
  76378. /*! exports provided: default */
  76379. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  76380. "use strict";
  76381. __webpack_require__.r(__webpack_exports__);
  76382. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return BoxedEditorUIView; });
  76383. /* harmony import */ var _editorui_editoruiview__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../editorui/editoruiview */ "./node_modules/@ckeditor/ckeditor5-ui/src/editorui/editoruiview.js");
  76384. /* harmony import */ var _label_labelview__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../label/labelview */ "./node_modules/@ckeditor/ckeditor5-ui/src/label/labelview.js");
  76385. /**
  76386. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  76387. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  76388. */
  76389. /**
  76390. * @module ui/editorui/boxed/boxededitoruiview
  76391. */
  76392. /**
  76393. * The boxed editor UI view class. This class represents an editor interface
  76394. * consisting of a toolbar and an editable area, enclosed within a box.
  76395. *
  76396. * @extends module:ui/editorui/editoruiview~EditorUIView
  76397. */
  76398. class BoxedEditorUIView extends _editorui_editoruiview__WEBPACK_IMPORTED_MODULE_0__["default"] {
  76399. /**
  76400. * Creates an instance of the boxed editor UI view class.
  76401. *
  76402. * @param {module:utils/locale~Locale} locale The locale instance..
  76403. */
  76404. constructor( locale ) {
  76405. super( locale );
  76406. /**
  76407. * Collection of the child views located in the top (`.ck-editor__top`)
  76408. * area of the UI.
  76409. *
  76410. * @readonly
  76411. * @member {module:ui/viewcollection~ViewCollection}
  76412. */
  76413. this.top = this.createCollection();
  76414. /**
  76415. * Collection of the child views located in the main (`.ck-editor__main`)
  76416. * area of the UI.
  76417. *
  76418. * @readonly
  76419. * @member {module:ui/viewcollection~ViewCollection}
  76420. */
  76421. this.main = this.createCollection();
  76422. /**
  76423. * Voice label of the UI.
  76424. *
  76425. * @protected
  76426. * @readonly
  76427. * @member {module:ui/view~View} #_voiceLabelView
  76428. */
  76429. this._voiceLabelView = this._createVoiceLabel();
  76430. this.setTemplate( {
  76431. tag: 'div',
  76432. attributes: {
  76433. class: [
  76434. 'ck',
  76435. 'ck-reset',
  76436. 'ck-editor',
  76437. 'ck-rounded-corners'
  76438. ],
  76439. role: 'application',
  76440. dir: locale.uiLanguageDirection,
  76441. lang: locale.uiLanguage,
  76442. 'aria-labelledby': this._voiceLabelView.id
  76443. },
  76444. children: [
  76445. this._voiceLabelView,
  76446. {
  76447. tag: 'div',
  76448. attributes: {
  76449. class: [
  76450. 'ck',
  76451. 'ck-editor__top',
  76452. 'ck-reset_all'
  76453. ],
  76454. role: 'presentation'
  76455. },
  76456. children: this.top
  76457. },
  76458. {
  76459. tag: 'div',
  76460. attributes: {
  76461. class: [
  76462. 'ck',
  76463. 'ck-editor__main'
  76464. ],
  76465. role: 'presentation'
  76466. },
  76467. children: this.main
  76468. }
  76469. ]
  76470. } );
  76471. }
  76472. /**
  76473. * Creates a voice label view instance.
  76474. *
  76475. * @private
  76476. * @returns {module:ui/label/labelview~LabelView}
  76477. */
  76478. _createVoiceLabel() {
  76479. const t = this.t;
  76480. const voiceLabel = new _label_labelview__WEBPACK_IMPORTED_MODULE_1__["default"]();
  76481. voiceLabel.text = t( 'Rich Text Editor' );
  76482. voiceLabel.extendTemplate( {
  76483. attributes: {
  76484. class: 'ck-voice-label'
  76485. }
  76486. } );
  76487. return voiceLabel;
  76488. }
  76489. }
  76490. /***/ }),
  76491. /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/editorui/editoruiview.js":
  76492. /*!**************************************************************************!*\
  76493. !*** ./node_modules/@ckeditor/ckeditor5-ui/src/editorui/editoruiview.js ***!
  76494. \**************************************************************************/
  76495. /*! exports provided: default */
  76496. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  76497. "use strict";
  76498. __webpack_require__.r(__webpack_exports__);
  76499. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return EditorUIView; });
  76500. /* harmony import */ var _view__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../view */ "./node_modules/@ckeditor/ckeditor5-ui/src/view.js");
  76501. /* harmony import */ var _bodycollection__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./bodycollection */ "./node_modules/@ckeditor/ckeditor5-ui/src/editorui/bodycollection.js");
  76502. /* 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");
  76503. /* 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__);
  76504. /**
  76505. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  76506. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  76507. */
  76508. /**
  76509. * @module ui/editorui/editoruiview
  76510. */
  76511. /**
  76512. * The editor UI view class. Base class for the editor main views.
  76513. *
  76514. * @extends module:ui/view~View
  76515. */
  76516. class EditorUIView extends _view__WEBPACK_IMPORTED_MODULE_0__["default"] {
  76517. /**
  76518. * Creates an instance of the editor UI view class.
  76519. *
  76520. * @param {module:utils/locale~Locale} [locale] The locale instance.
  76521. */
  76522. constructor( locale ) {
  76523. super( locale );
  76524. /**
  76525. * Collection of the child views, detached from the DOM
  76526. * structure of the editor, like panels, icons etc.
  76527. *
  76528. * @readonly
  76529. * @member {module:ui/viewcollection~ViewCollection} #body
  76530. */
  76531. this.body = new _bodycollection__WEBPACK_IMPORTED_MODULE_1__["default"]( locale );
  76532. }
  76533. /**
  76534. * @inheritDoc
  76535. */
  76536. render() {
  76537. super.render();
  76538. this.body.attachToDom();
  76539. }
  76540. /**
  76541. * @inheritDoc
  76542. */
  76543. destroy() {
  76544. this.body.detachFromDom();
  76545. return super.destroy();
  76546. }
  76547. }
  76548. /***/ }),
  76549. /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/focuscycler.js":
  76550. /*!****************************************************************!*\
  76551. !*** ./node_modules/@ckeditor/ckeditor5-ui/src/focuscycler.js ***!
  76552. \****************************************************************/
  76553. /*! exports provided: default */
  76554. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  76555. "use strict";
  76556. __webpack_require__.r(__webpack_exports__);
  76557. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return FocusCycler; });
  76558. /* 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");
  76559. /**
  76560. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  76561. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  76562. */
  76563. /**
  76564. * @module ui/focuscycler
  76565. */
  76566. /**
  76567. * A utility class that helps cycling over focusable {@link module:ui/view~View views} in a
  76568. * {@link module:ui/viewcollection~ViewCollection} when the focus is tracked by the
  76569. * {@link module:utils/focustracker~FocusTracker} instance. It helps implementing keyboard
  76570. * navigation in HTML forms, toolbars, lists and the like.
  76571. *
  76572. * To work properly it requires:
  76573. * * a collection of focusable (HTML `tabindex` attribute) views that implement the `focus()` method,
  76574. * * an associated focus tracker to determine which view is focused.
  76575. *
  76576. * A simple cycler setup can look like this:
  76577. *
  76578. * const focusables = new ViewCollection();
  76579. * const focusTracker = new FocusTracker();
  76580. *
  76581. * // Add focusable views to the focus tracker.
  76582. * focusTracker.add( ... );
  76583. *
  76584. * Then, the cycler can be used manually:
  76585. *
  76586. * const cycler = new FocusCycler( { focusables, focusTracker } );
  76587. *
  76588. * // Will focus the first focusable view in #focusables.
  76589. * cycler.focusFirst();
  76590. *
  76591. * // Will log the next focusable item in #focusables.
  76592. * console.log( cycler.next );
  76593. *
  76594. * Alternatively, it can work side by side with the {@link module:utils/keystrokehandler~KeystrokeHandler}:
  76595. *
  76596. * const keystrokeHandler = new KeystrokeHandler();
  76597. *
  76598. * // Activate the keystroke handler.
  76599. * keystrokeHandler.listenTo( sourceOfEvents );
  76600. *
  76601. * const cycler = new FocusCycler( {
  76602. * focusables, focusTracker, keystrokeHandler,
  76603. * actions: {
  76604. * // When arrowup of arrowleft is detected by the #keystrokeHandler,
  76605. * // focusPrevious() will be called on the cycler.
  76606. * focusPrevious: [ 'arrowup', 'arrowleft' ],
  76607. * }
  76608. * } );
  76609. *
  76610. * Check out the {@glink framework/guides/deep-dive/ui/focus-tracking "Deep dive into focus tracking" guide} to learn more.
  76611. */
  76612. class FocusCycler {
  76613. /**
  76614. * Creates an instance of the focus cycler utility.
  76615. *
  76616. * @param {Object} options Configuration options.
  76617. * @param {module:utils/collection~Collection|Object} options.focusables
  76618. * @param {module:utils/focustracker~FocusTracker} options.focusTracker
  76619. * @param {module:utils/keystrokehandler~KeystrokeHandler} [options.keystrokeHandler]
  76620. * @param {Object} [options.actions]
  76621. */
  76622. constructor( options ) {
  76623. Object.assign( this, options );
  76624. /**
  76625. * A {@link module:ui/view~View view} collection that the cycler operates on.
  76626. *
  76627. * @readonly
  76628. * @member {module:utils/collection~Collection} #focusables
  76629. */
  76630. /**
  76631. * A focus tracker instance that the cycler uses to determine the current focus
  76632. * state in {@link #focusables}.
  76633. *
  76634. * @readonly
  76635. * @member {module:utils/focustracker~FocusTracker} #focusTracker
  76636. */
  76637. /**
  76638. * An instance of the {@link module:utils/keystrokehandler~KeystrokeHandler}
  76639. * which can respond to certain keystrokes and cycle the focus.
  76640. *
  76641. * @readonly
  76642. * @member {module:utils/keystrokehandler~KeystrokeHandler} #keystrokeHandler
  76643. */
  76644. /**
  76645. * Actions that the cycler can take when a keystroke is pressed. Requires
  76646. * `options.keystrokeHandler` to be passed and working. When an action is
  76647. * performed, `preventDefault` and `stopPropagation` will be called on the event
  76648. * the keystroke fired in the DOM.
  76649. *
  76650. * actions: {
  76651. * // Will call #focusPrevious() when arrowleft or arrowup is pressed.
  76652. * focusPrevious: [ 'arrowleft', 'arrowup' ],
  76653. *
  76654. * // Will call #focusNext() when arrowdown is pressed.
  76655. * focusNext: 'arrowdown'
  76656. * }
  76657. *
  76658. * @readonly
  76659. * @member {Object} #actions
  76660. */
  76661. if ( options.actions && options.keystrokeHandler ) {
  76662. for ( const methodName in options.actions ) {
  76663. let actions = options.actions[ methodName ];
  76664. if ( typeof actions == 'string' ) {
  76665. actions = [ actions ];
  76666. }
  76667. for ( const keystroke of actions ) {
  76668. options.keystrokeHandler.set( keystroke, ( data, cancel ) => {
  76669. this[ methodName ]();
  76670. cancel();
  76671. } );
  76672. }
  76673. }
  76674. }
  76675. }
  76676. /**
  76677. * Returns the first focusable view in {@link #focusables}.
  76678. * Returns `null` if there is none.
  76679. *
  76680. * @readonly
  76681. * @member {module:ui/view~View|null} #first
  76682. */
  76683. get first() {
  76684. return this.focusables.find( isFocusable ) || null;
  76685. }
  76686. /**
  76687. * Returns the last focusable view in {@link #focusables}.
  76688. * Returns `null` if there is none.
  76689. *
  76690. * @readonly
  76691. * @member {module:ui/view~View|null} #last
  76692. */
  76693. get last() {
  76694. return this.focusables.filter( isFocusable ).slice( -1 )[ 0 ] || null;
  76695. }
  76696. /**
  76697. * Returns the next focusable view in {@link #focusables} based on {@link #current}.
  76698. * Returns `null` if there is none.
  76699. *
  76700. * @readonly
  76701. * @member {module:ui/view~View|null} #next
  76702. */
  76703. get next() {
  76704. return this._getFocusableItem( 1 );
  76705. }
  76706. /**
  76707. * Returns the previous focusable view in {@link #focusables} based on {@link #current}.
  76708. * Returns `null` if there is none.
  76709. *
  76710. * @readonly
  76711. * @member {module:ui/view~View|null} #previous
  76712. */
  76713. get previous() {
  76714. return this._getFocusableItem( -1 );
  76715. }
  76716. /**
  76717. * An index of the view in the {@link #focusables} which is focused according
  76718. * to {@link #focusTracker}. Returns `null` when there is no such view.
  76719. *
  76720. * @readonly
  76721. * @member {Number|null} #current
  76722. */
  76723. get current() {
  76724. let index = null;
  76725. // There's no focused view in the focusables.
  76726. if ( this.focusTracker.focusedElement === null ) {
  76727. return null;
  76728. }
  76729. this.focusables.find( ( view, viewIndex ) => {
  76730. const focused = view.element === this.focusTracker.focusedElement;
  76731. if ( focused ) {
  76732. index = viewIndex;
  76733. }
  76734. return focused;
  76735. } );
  76736. return index;
  76737. }
  76738. /**
  76739. * Focuses the {@link #first} item in {@link #focusables}.
  76740. */
  76741. focusFirst() {
  76742. this._focus( this.first );
  76743. }
  76744. /**
  76745. * Focuses the {@link #last} item in {@link #focusables}.
  76746. */
  76747. focusLast() {
  76748. this._focus( this.last );
  76749. }
  76750. /**
  76751. * Focuses the {@link #next} item in {@link #focusables}.
  76752. */
  76753. focusNext() {
  76754. this._focus( this.next );
  76755. }
  76756. /**
  76757. * Focuses the {@link #previous} item in {@link #focusables}.
  76758. */
  76759. focusPrevious() {
  76760. this._focus( this.previous );
  76761. }
  76762. /**
  76763. * Focuses the given view if it exists.
  76764. *
  76765. * @protected
  76766. * @param {module:ui/view~View} view
  76767. */
  76768. _focus( view ) {
  76769. if ( view ) {
  76770. view.focus();
  76771. }
  76772. }
  76773. /**
  76774. * Returns the next or previous focusable view in {@link #focusables} with respect
  76775. * to {@link #current}.
  76776. *
  76777. * @protected
  76778. * @param {Number} step Either `1` for checking forward from {@link #current} or
  76779. * `-1` for checking backwards.
  76780. * @returns {module:ui/view~View|null}
  76781. */
  76782. _getFocusableItem( step ) {
  76783. // Cache for speed.
  76784. const current = this.current;
  76785. const collectionLength = this.focusables.length;
  76786. if ( !collectionLength ) {
  76787. return null;
  76788. }
  76789. // Start from the beginning if no view is focused.
  76790. // https://github.com/ckeditor/ckeditor5-ui/issues/206
  76791. if ( current === null ) {
  76792. return this[ step === 1 ? 'first' : 'last' ];
  76793. }
  76794. // Cycle in both directions.
  76795. let index = ( current + collectionLength + step ) % collectionLength;
  76796. do {
  76797. const view = this.focusables.get( index );
  76798. // TODO: Check if view is visible.
  76799. if ( isFocusable( view ) ) {
  76800. return view;
  76801. }
  76802. // Cycle in both directions.
  76803. index = ( index + collectionLength + step ) % collectionLength;
  76804. } while ( index !== current );
  76805. return null;
  76806. }
  76807. }
  76808. // Checks whether a view is focusable.
  76809. //
  76810. // @private
  76811. // @param {module:ui/view~View} view A view to be checked.
  76812. // @returns {Boolean}
  76813. function isFocusable( view ) {
  76814. return !!( view.focus && _ckeditor_ckeditor5_utils_src_dom_global__WEBPACK_IMPORTED_MODULE_0__["default"].window.getComputedStyle( view.element ).display != 'none' );
  76815. }
  76816. /***/ }),
  76817. /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/formheader/formheaderview.js":
  76818. /*!******************************************************************************!*\
  76819. !*** ./node_modules/@ckeditor/ckeditor5-ui/src/formheader/formheaderview.js ***!
  76820. \******************************************************************************/
  76821. /*! exports provided: default */
  76822. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  76823. "use strict";
  76824. __webpack_require__.r(__webpack_exports__);
  76825. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return FormHeaderView; });
  76826. /* harmony import */ var _view__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../view */ "./node_modules/@ckeditor/ckeditor5-ui/src/view.js");
  76827. /* harmony import */ var _theme_components_formheader_formheader_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../theme/components/formheader/formheader.css */ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/formheader/formheader.css");
  76828. /* harmony import */ var _theme_components_formheader_formheader_css__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_theme_components_formheader_formheader_css__WEBPACK_IMPORTED_MODULE_1__);
  76829. /**
  76830. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  76831. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  76832. */
  76833. /**
  76834. * @module ui/formheader/formheaderview
  76835. */
  76836. /**
  76837. * The class component representing a form header view. It should be used in more advanced forms to
  76838. * describe the main purpose of the form.
  76839. *
  76840. * By default the component contains a bolded label view that has to be set. The label is usually a short (at most 3-word) string.
  76841. * The component can also be extended by any other elements, like: icons, dropdowns, etc.
  76842. *
  76843. * It is used i.a.
  76844. * by {@link module:table/tablecellproperties/ui/tablecellpropertiesview~TableCellPropertiesView}
  76845. * and {@link module:special-characters/ui/specialcharactersnavigationview~SpecialCharactersNavigationView}.
  76846. *
  76847. * The latter is an example, where the component has been extended by {@link module:ui/dropdown/dropdownview~DropdownView} view.
  76848. *
  76849. * @extends module:ui/view~View
  76850. */
  76851. class FormHeaderView extends _view__WEBPACK_IMPORTED_MODULE_0__["default"] {
  76852. /**
  76853. * Creates an instance of the form header class.
  76854. *
  76855. * @param {module:utils/locale~Locale} locale The locale instance.
  76856. * @param {Object} options
  76857. * @param {String} options.label A label.
  76858. * @param {String} [options.class] An additional class.
  76859. */
  76860. constructor( locale, options = {} ) {
  76861. super( locale );
  76862. const bind = this.bindTemplate;
  76863. /**
  76864. * The label of the header.
  76865. *
  76866. * @observable
  76867. * @member {String} #label
  76868. */
  76869. this.set( 'label', options.label || '' );
  76870. /**
  76871. * An additional CSS class added to the {@link #element}.
  76872. *
  76873. * @observable
  76874. * @member {String} #class
  76875. */
  76876. this.set( 'class', options.class || null );
  76877. /**
  76878. * A collection of header items.
  76879. *
  76880. * @readonly
  76881. * @member {module:ui/viewcollection~ViewCollection}
  76882. */
  76883. this.children = this.createCollection();
  76884. this.setTemplate( {
  76885. tag: 'div',
  76886. attributes: {
  76887. class: [
  76888. 'ck',
  76889. 'ck-form__header',
  76890. bind.to( 'class' )
  76891. ]
  76892. },
  76893. children: this.children
  76894. } );
  76895. const label = new _view__WEBPACK_IMPORTED_MODULE_0__["default"]( locale );
  76896. label.setTemplate( {
  76897. tag: 'span',
  76898. attributes: {
  76899. class: [
  76900. 'ck',
  76901. 'ck-form__header__label'
  76902. ]
  76903. },
  76904. children: [
  76905. { text: bind.to( 'label' ) }
  76906. ]
  76907. } );
  76908. this.children.add( label );
  76909. }
  76910. }
  76911. /***/ }),
  76912. /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/icon/iconview.js":
  76913. /*!******************************************************************!*\
  76914. !*** ./node_modules/@ckeditor/ckeditor5-ui/src/icon/iconview.js ***!
  76915. \******************************************************************/
  76916. /*! exports provided: default */
  76917. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  76918. "use strict";
  76919. __webpack_require__.r(__webpack_exports__);
  76920. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return IconView; });
  76921. /* harmony import */ var _view__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../view */ "./node_modules/@ckeditor/ckeditor5-ui/src/view.js");
  76922. /* 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");
  76923. /* 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__);
  76924. /**
  76925. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  76926. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  76927. */
  76928. /* global DOMParser */
  76929. /**
  76930. * @module ui/icon/iconview
  76931. */
  76932. /**
  76933. * The icon view class.
  76934. *
  76935. * @extends module:ui/view~View
  76936. */
  76937. class IconView extends _view__WEBPACK_IMPORTED_MODULE_0__["default"] {
  76938. /**
  76939. * @inheritDoc
  76940. */
  76941. constructor() {
  76942. super();
  76943. const bind = this.bindTemplate;
  76944. /**
  76945. * The SVG source of the icon.
  76946. *
  76947. * @observable
  76948. * @member {String} #content
  76949. */
  76950. this.set( 'content', '' );
  76951. /**
  76952. * This attribute specifies the boundaries to which the
  76953. * icon content should stretch.
  76954. *
  76955. * @observable
  76956. * @default '0 0 20 20'
  76957. * @member {String} #viewBox
  76958. */
  76959. this.set( 'viewBox', '0 0 20 20' );
  76960. /**
  76961. * The fill color of the child `path.ck-icon__fill`.
  76962. *
  76963. * @observable
  76964. * @default ''
  76965. * @member {String} #fillColor
  76966. */
  76967. this.set( 'fillColor', '' );
  76968. this.setTemplate( {
  76969. tag: 'svg',
  76970. ns: 'http://www.w3.org/2000/svg',
  76971. attributes: {
  76972. class: [
  76973. 'ck',
  76974. 'ck-icon'
  76975. ],
  76976. viewBox: bind.to( 'viewBox' )
  76977. }
  76978. } );
  76979. }
  76980. /**
  76981. * @inheritDoc
  76982. */
  76983. render() {
  76984. super.render();
  76985. this._updateXMLContent();
  76986. this._colorFillPaths();
  76987. // This is a hack for lack of innerHTML binding.
  76988. // See: https://github.com/ckeditor/ckeditor5-ui/issues/99.
  76989. this.on( 'change:content', () => {
  76990. this._updateXMLContent();
  76991. this._colorFillPaths();
  76992. } );
  76993. this.on( 'change:fillColor', () => {
  76994. this._colorFillPaths();
  76995. } );
  76996. }
  76997. /**
  76998. * Updates the {@link #element} with the value of {@link #content}.
  76999. *
  77000. * @private
  77001. */
  77002. _updateXMLContent() {
  77003. if ( this.content ) {
  77004. const parsed = new DOMParser().parseFromString( this.content.trim(), 'image/svg+xml' );
  77005. const svg = parsed.querySelector( 'svg' );
  77006. const viewBox = svg.getAttribute( 'viewBox' );
  77007. if ( viewBox ) {
  77008. this.viewBox = viewBox;
  77009. }
  77010. this.element.innerHTML = '';
  77011. while ( svg.childNodes.length > 0 ) {
  77012. this.element.appendChild( svg.childNodes[ 0 ] );
  77013. }
  77014. }
  77015. }
  77016. /**
  77017. * Fills all child `path.ck-icon__fill` with the `#fillColor`.
  77018. *
  77019. * @private
  77020. */
  77021. _colorFillPaths() {
  77022. if ( this.fillColor ) {
  77023. this.element.querySelectorAll( '.ck-icon__fill' ).forEach( path => {
  77024. path.style.fill = this.fillColor;
  77025. } );
  77026. }
  77027. }
  77028. }
  77029. /***/ }),
  77030. /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/index.js":
  77031. /*!**********************************************************!*\
  77032. !*** ./node_modules/@ckeditor/ckeditor5-ui/src/index.js ***!
  77033. \**********************************************************/
  77034. /*! exports provided: clickOutsideHandler, injectCssTransitionDisabler, submitHandler, BodyCollection, ButtonView, SwitchButtonView, getLocalizedColorOptions, normalizeColorOptions, normalizeSingleColorDefinition, ColorGridView, ColorTileView, DropdownButtonView, SplitButtonView, createDropdown, addToolbarToDropdown, addListToDropdown, EditorUIView, BoxedEditorUIView, InlineEditableUIView, FormHeaderView, FocusCycler, IconView, InputTextView, LabelView, LabeledFieldView, createLabeledInputText, createLabeledDropdown, ListItemView, ListView, Notification, Model, BalloonPanelView, ContextualBalloon, StickyPanelView, TooltipView, Template, ToolbarView, ToolbarSeparatorView, enableToolbarKeyboardFocus, normalizeToolbarConfig, BalloonToolbar, BlockToolbar, View, ViewCollection */
  77035. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  77036. "use strict";
  77037. __webpack_require__.r(__webpack_exports__);
  77038. /* harmony import */ var _bindings_clickoutsidehandler__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./bindings/clickoutsidehandler */ "./node_modules/@ckeditor/ckeditor5-ui/src/bindings/clickoutsidehandler.js");
  77039. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "clickOutsideHandler", function() { return _bindings_clickoutsidehandler__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  77040. /* harmony import */ var _bindings_injectcsstransitiondisabler__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./bindings/injectcsstransitiondisabler */ "./node_modules/@ckeditor/ckeditor5-ui/src/bindings/injectcsstransitiondisabler.js");
  77041. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "injectCssTransitionDisabler", function() { return _bindings_injectcsstransitiondisabler__WEBPACK_IMPORTED_MODULE_1__["default"]; });
  77042. /* harmony import */ var _bindings_submithandler__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./bindings/submithandler */ "./node_modules/@ckeditor/ckeditor5-ui/src/bindings/submithandler.js");
  77043. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "submitHandler", function() { return _bindings_submithandler__WEBPACK_IMPORTED_MODULE_2__["default"]; });
  77044. /* harmony import */ var _editorui_bodycollection__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./editorui/bodycollection */ "./node_modules/@ckeditor/ckeditor5-ui/src/editorui/bodycollection.js");
  77045. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "BodyCollection", function() { return _editorui_bodycollection__WEBPACK_IMPORTED_MODULE_3__["default"]; });
  77046. /* harmony import */ var _button_buttonview__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./button/buttonview */ "./node_modules/@ckeditor/ckeditor5-ui/src/button/buttonview.js");
  77047. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ButtonView", function() { return _button_buttonview__WEBPACK_IMPORTED_MODULE_4__["default"]; });
  77048. /* harmony import */ var _button_switchbuttonview__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./button/switchbuttonview */ "./node_modules/@ckeditor/ckeditor5-ui/src/button/switchbuttonview.js");
  77049. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SwitchButtonView", function() { return _button_switchbuttonview__WEBPACK_IMPORTED_MODULE_5__["default"]; });
  77050. /* harmony import */ var _colorgrid_utils__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./colorgrid/utils */ "./node_modules/@ckeditor/ckeditor5-ui/src/colorgrid/utils.js");
  77051. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getLocalizedColorOptions", function() { return _colorgrid_utils__WEBPACK_IMPORTED_MODULE_6__["getLocalizedColorOptions"]; });
  77052. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "normalizeColorOptions", function() { return _colorgrid_utils__WEBPACK_IMPORTED_MODULE_6__["normalizeColorOptions"]; });
  77053. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "normalizeSingleColorDefinition", function() { return _colorgrid_utils__WEBPACK_IMPORTED_MODULE_6__["normalizeSingleColorDefinition"]; });
  77054. /* harmony import */ var _colorgrid_colorgridview__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./colorgrid/colorgridview */ "./node_modules/@ckeditor/ckeditor5-ui/src/colorgrid/colorgridview.js");
  77055. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ColorGridView", function() { return _colorgrid_colorgridview__WEBPACK_IMPORTED_MODULE_7__["default"]; });
  77056. /* harmony import */ var _colorgrid_colortileview__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./colorgrid/colortileview */ "./node_modules/@ckeditor/ckeditor5-ui/src/colorgrid/colortileview.js");
  77057. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ColorTileView", function() { return _colorgrid_colortileview__WEBPACK_IMPORTED_MODULE_8__["default"]; });
  77058. /* harmony import */ var _dropdown_button_dropdownbuttonview__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./dropdown/button/dropdownbuttonview */ "./node_modules/@ckeditor/ckeditor5-ui/src/dropdown/button/dropdownbuttonview.js");
  77059. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DropdownButtonView", function() { return _dropdown_button_dropdownbuttonview__WEBPACK_IMPORTED_MODULE_9__["default"]; });
  77060. /* harmony import */ var _dropdown_button_splitbuttonview__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./dropdown/button/splitbuttonview */ "./node_modules/@ckeditor/ckeditor5-ui/src/dropdown/button/splitbuttonview.js");
  77061. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SplitButtonView", function() { return _dropdown_button_splitbuttonview__WEBPACK_IMPORTED_MODULE_10__["default"]; });
  77062. /* harmony import */ var _dropdown_utils__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./dropdown/utils */ "./node_modules/@ckeditor/ckeditor5-ui/src/dropdown/utils.js");
  77063. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "createDropdown", function() { return _dropdown_utils__WEBPACK_IMPORTED_MODULE_11__["createDropdown"]; });
  77064. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "addToolbarToDropdown", function() { return _dropdown_utils__WEBPACK_IMPORTED_MODULE_11__["addToolbarToDropdown"]; });
  77065. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "addListToDropdown", function() { return _dropdown_utils__WEBPACK_IMPORTED_MODULE_11__["addListToDropdown"]; });
  77066. /* harmony import */ var _editorui_editoruiview__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./editorui/editoruiview */ "./node_modules/@ckeditor/ckeditor5-ui/src/editorui/editoruiview.js");
  77067. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "EditorUIView", function() { return _editorui_editoruiview__WEBPACK_IMPORTED_MODULE_12__["default"]; });
  77068. /* harmony import */ var _editorui_boxed_boxededitoruiview__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./editorui/boxed/boxededitoruiview */ "./node_modules/@ckeditor/ckeditor5-ui/src/editorui/boxed/boxededitoruiview.js");
  77069. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "BoxedEditorUIView", function() { return _editorui_boxed_boxededitoruiview__WEBPACK_IMPORTED_MODULE_13__["default"]; });
  77070. /* harmony import */ var _editableui_inline_inlineeditableuiview__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./editableui/inline/inlineeditableuiview */ "./node_modules/@ckeditor/ckeditor5-ui/src/editableui/inline/inlineeditableuiview.js");
  77071. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "InlineEditableUIView", function() { return _editableui_inline_inlineeditableuiview__WEBPACK_IMPORTED_MODULE_14__["default"]; });
  77072. /* harmony import */ var _formheader_formheaderview__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./formheader/formheaderview */ "./node_modules/@ckeditor/ckeditor5-ui/src/formheader/formheaderview.js");
  77073. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FormHeaderView", function() { return _formheader_formheaderview__WEBPACK_IMPORTED_MODULE_15__["default"]; });
  77074. /* harmony import */ var _focuscycler__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./focuscycler */ "./node_modules/@ckeditor/ckeditor5-ui/src/focuscycler.js");
  77075. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FocusCycler", function() { return _focuscycler__WEBPACK_IMPORTED_MODULE_16__["default"]; });
  77076. /* harmony import */ var _icon_iconview__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./icon/iconview */ "./node_modules/@ckeditor/ckeditor5-ui/src/icon/iconview.js");
  77077. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "IconView", function() { return _icon_iconview__WEBPACK_IMPORTED_MODULE_17__["default"]; });
  77078. /* harmony import */ var _inputtext_inputtextview__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./inputtext/inputtextview */ "./node_modules/@ckeditor/ckeditor5-ui/src/inputtext/inputtextview.js");
  77079. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "InputTextView", function() { return _inputtext_inputtextview__WEBPACK_IMPORTED_MODULE_18__["default"]; });
  77080. /* harmony import */ var _label_labelview__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./label/labelview */ "./node_modules/@ckeditor/ckeditor5-ui/src/label/labelview.js");
  77081. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "LabelView", function() { return _label_labelview__WEBPACK_IMPORTED_MODULE_19__["default"]; });
  77082. /* harmony import */ var _labeledfield_labeledfieldview__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./labeledfield/labeledfieldview */ "./node_modules/@ckeditor/ckeditor5-ui/src/labeledfield/labeledfieldview.js");
  77083. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "LabeledFieldView", function() { return _labeledfield_labeledfieldview__WEBPACK_IMPORTED_MODULE_20__["default"]; });
  77084. /* harmony import */ var _labeledfield_utils__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./labeledfield/utils */ "./node_modules/@ckeditor/ckeditor5-ui/src/labeledfield/utils.js");
  77085. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "createLabeledInputText", function() { return _labeledfield_utils__WEBPACK_IMPORTED_MODULE_21__["createLabeledInputText"]; });
  77086. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "createLabeledDropdown", function() { return _labeledfield_utils__WEBPACK_IMPORTED_MODULE_21__["createLabeledDropdown"]; });
  77087. /* harmony import */ var _list_listitemview__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./list/listitemview */ "./node_modules/@ckeditor/ckeditor5-ui/src/list/listitemview.js");
  77088. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ListItemView", function() { return _list_listitemview__WEBPACK_IMPORTED_MODULE_22__["default"]; });
  77089. /* harmony import */ var _list_listview__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./list/listview */ "./node_modules/@ckeditor/ckeditor5-ui/src/list/listview.js");
  77090. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ListView", function() { return _list_listview__WEBPACK_IMPORTED_MODULE_23__["default"]; });
  77091. /* harmony import */ var _notification_notification__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./notification/notification */ "./node_modules/@ckeditor/ckeditor5-ui/src/notification/notification.js");
  77092. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Notification", function() { return _notification_notification__WEBPACK_IMPORTED_MODULE_24__["default"]; });
  77093. /* harmony import */ var _model__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./model */ "./node_modules/@ckeditor/ckeditor5-ui/src/model.js");
  77094. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Model", function() { return _model__WEBPACK_IMPORTED_MODULE_25__["default"]; });
  77095. /* harmony import */ var _panel_balloon_balloonpanelview__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./panel/balloon/balloonpanelview */ "./node_modules/@ckeditor/ckeditor5-ui/src/panel/balloon/balloonpanelview.js");
  77096. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "BalloonPanelView", function() { return _panel_balloon_balloonpanelview__WEBPACK_IMPORTED_MODULE_26__["default"]; });
  77097. /* harmony import */ var _panel_balloon_contextualballoon__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./panel/balloon/contextualballoon */ "./node_modules/@ckeditor/ckeditor5-ui/src/panel/balloon/contextualballoon.js");
  77098. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ContextualBalloon", function() { return _panel_balloon_contextualballoon__WEBPACK_IMPORTED_MODULE_27__["default"]; });
  77099. /* harmony import */ var _panel_sticky_stickypanelview__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./panel/sticky/stickypanelview */ "./node_modules/@ckeditor/ckeditor5-ui/src/panel/sticky/stickypanelview.js");
  77100. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "StickyPanelView", function() { return _panel_sticky_stickypanelview__WEBPACK_IMPORTED_MODULE_28__["default"]; });
  77101. /* harmony import */ var _tooltip_tooltipview__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./tooltip/tooltipview */ "./node_modules/@ckeditor/ckeditor5-ui/src/tooltip/tooltipview.js");
  77102. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TooltipView", function() { return _tooltip_tooltipview__WEBPACK_IMPORTED_MODULE_29__["default"]; });
  77103. /* harmony import */ var _template__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./template */ "./node_modules/@ckeditor/ckeditor5-ui/src/template.js");
  77104. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Template", function() { return _template__WEBPACK_IMPORTED_MODULE_30__["default"]; });
  77105. /* harmony import */ var _toolbar_toolbarview__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ./toolbar/toolbarview */ "./node_modules/@ckeditor/ckeditor5-ui/src/toolbar/toolbarview.js");
  77106. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ToolbarView", function() { return _toolbar_toolbarview__WEBPACK_IMPORTED_MODULE_31__["default"]; });
  77107. /* harmony import */ var _toolbar_toolbarseparatorview__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ./toolbar/toolbarseparatorview */ "./node_modules/@ckeditor/ckeditor5-ui/src/toolbar/toolbarseparatorview.js");
  77108. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ToolbarSeparatorView", function() { return _toolbar_toolbarseparatorview__WEBPACK_IMPORTED_MODULE_32__["default"]; });
  77109. /* harmony import */ var _toolbar_enabletoolbarkeyboardfocus__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ./toolbar/enabletoolbarkeyboardfocus */ "./node_modules/@ckeditor/ckeditor5-ui/src/toolbar/enabletoolbarkeyboardfocus.js");
  77110. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "enableToolbarKeyboardFocus", function() { return _toolbar_enabletoolbarkeyboardfocus__WEBPACK_IMPORTED_MODULE_33__["default"]; });
  77111. /* harmony import */ var _toolbar_normalizetoolbarconfig__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ./toolbar/normalizetoolbarconfig */ "./node_modules/@ckeditor/ckeditor5-ui/src/toolbar/normalizetoolbarconfig.js");
  77112. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "normalizeToolbarConfig", function() { return _toolbar_normalizetoolbarconfig__WEBPACK_IMPORTED_MODULE_34__["default"]; });
  77113. /* harmony import */ var _toolbar_balloon_balloontoolbar__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ./toolbar/balloon/balloontoolbar */ "./node_modules/@ckeditor/ckeditor5-ui/src/toolbar/balloon/balloontoolbar.js");
  77114. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "BalloonToolbar", function() { return _toolbar_balloon_balloontoolbar__WEBPACK_IMPORTED_MODULE_35__["default"]; });
  77115. /* harmony import */ var _toolbar_block_blocktoolbar__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! ./toolbar/block/blocktoolbar */ "./node_modules/@ckeditor/ckeditor5-ui/src/toolbar/block/blocktoolbar.js");
  77116. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "BlockToolbar", function() { return _toolbar_block_blocktoolbar__WEBPACK_IMPORTED_MODULE_36__["default"]; });
  77117. /* harmony import */ var _view__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(/*! ./view */ "./node_modules/@ckeditor/ckeditor5-ui/src/view.js");
  77118. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "View", function() { return _view__WEBPACK_IMPORTED_MODULE_37__["default"]; });
  77119. /* harmony import */ var _viewcollection__WEBPACK_IMPORTED_MODULE_38__ = __webpack_require__(/*! ./viewcollection */ "./node_modules/@ckeditor/ckeditor5-ui/src/viewcollection.js");
  77120. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ViewCollection", function() { return _viewcollection__WEBPACK_IMPORTED_MODULE_38__["default"]; });
  77121. /**
  77122. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  77123. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  77124. */
  77125. /**
  77126. * @module ui
  77127. */
  77128. /***/ }),
  77129. /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/inputtext/inputtextview.js":
  77130. /*!****************************************************************************!*\
  77131. !*** ./node_modules/@ckeditor/ckeditor5-ui/src/inputtext/inputtextview.js ***!
  77132. \****************************************************************************/
  77133. /*! exports provided: default */
  77134. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  77135. "use strict";
  77136. __webpack_require__.r(__webpack_exports__);
  77137. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return InputTextView; });
  77138. /* harmony import */ var _view__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../view */ "./node_modules/@ckeditor/ckeditor5-ui/src/view.js");
  77139. /* 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");
  77140. /* harmony import */ var _theme_components_inputtext_inputtext_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../theme/components/inputtext/inputtext.css */ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/inputtext/inputtext.css");
  77141. /* harmony import */ var _theme_components_inputtext_inputtext_css__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_theme_components_inputtext_inputtext_css__WEBPACK_IMPORTED_MODULE_2__);
  77142. /**
  77143. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  77144. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  77145. */
  77146. /**
  77147. * @module ui/inputtext/inputtextview
  77148. */
  77149. /**
  77150. * The text input view class.
  77151. *
  77152. * @extends module:ui/view~View
  77153. */
  77154. class InputTextView extends _view__WEBPACK_IMPORTED_MODULE_0__["default"] {
  77155. /**
  77156. * @inheritDoc
  77157. */
  77158. constructor( locale ) {
  77159. super( locale );
  77160. /**
  77161. * The value of the input.
  77162. *
  77163. * @observable
  77164. * @member {String} #value
  77165. */
  77166. this.set( 'value' );
  77167. /**
  77168. * The `id` attribute of the input (i.e. to pair with a `<label>` element).
  77169. *
  77170. * @observable
  77171. * @member {String} #id
  77172. */
  77173. this.set( 'id' );
  77174. /**
  77175. * The `placeholder` attribute of the input.
  77176. *
  77177. * @observable
  77178. * @member {String} #placeholder
  77179. */
  77180. this.set( 'placeholder' );
  77181. /**
  77182. * Controls whether the input view is in read-only mode.
  77183. *
  77184. * @observable
  77185. * @member {Boolean} #isReadOnly
  77186. */
  77187. this.set( 'isReadOnly', false );
  77188. /**
  77189. * Set to `true` when the field has some error. Usually controlled via
  77190. * {@link module:ui/labeledinput/labeledinputview~LabeledInputView#errorText}.
  77191. *
  77192. * @observable
  77193. * @member {Boolean} #hasError
  77194. */
  77195. this.set( 'hasError', false );
  77196. /**
  77197. * The `id` of the element describing this field, e.g. when it has
  77198. * some error, it helps screen readers read the error text.
  77199. *
  77200. * @observable
  77201. * @member {Boolean} #ariaDescribedById
  77202. */
  77203. this.set( 'ariaDescribedById' );
  77204. /**
  77205. * Stores information about the editor UI focus and propagates it so various plugins and components
  77206. * are unified as a focus group.
  77207. *
  77208. * @readonly
  77209. * @member {module:utils/focustracker~FocusTracker} #focusTracker
  77210. */
  77211. this.focusTracker = new _ckeditor_ckeditor5_utils_src_focustracker__WEBPACK_IMPORTED_MODULE_1__["default"]();
  77212. /**
  77213. * An observable flag set to `true` when the input is currently focused by the user.
  77214. * Set to `false` otherwise.
  77215. *
  77216. * @readonly
  77217. * @observable
  77218. * @member {Boolean} #isFocused
  77219. * @default false
  77220. */
  77221. this.bind( 'isFocused' ).to( this.focusTracker );
  77222. /**
  77223. * An observable flag set to `true` when the input contains no text, i.e.
  77224. * when {@link #value} is `''`, `null`, or `false`.
  77225. *
  77226. * @readonly
  77227. * @observable
  77228. * @member {Boolean} #isEmpty
  77229. * @default true
  77230. */
  77231. this.set( 'isEmpty', true );
  77232. const bind = this.bindTemplate;
  77233. this.setTemplate( {
  77234. tag: 'input',
  77235. attributes: {
  77236. type: 'text',
  77237. class: [
  77238. 'ck',
  77239. 'ck-input',
  77240. 'ck-input-text',
  77241. bind.if( 'isFocused', 'ck-input_focused' ),
  77242. bind.if( 'isEmpty', 'ck-input-text_empty' ),
  77243. bind.if( 'hasError', 'ck-error' )
  77244. ],
  77245. id: bind.to( 'id' ),
  77246. placeholder: bind.to( 'placeholder' ),
  77247. readonly: bind.to( 'isReadOnly' ),
  77248. 'aria-invalid': bind.if( 'hasError', true ),
  77249. 'aria-describedby': bind.to( 'ariaDescribedById' )
  77250. },
  77251. on: {
  77252. input: bind.to( 'input' ),
  77253. change: bind.to( this._updateIsEmpty.bind( this ) )
  77254. }
  77255. } );
  77256. /**
  77257. * Fired when the user types in the input. Corresponds to the native
  77258. * DOM `input` event.
  77259. *
  77260. * @event input
  77261. */
  77262. }
  77263. /**
  77264. * @inheritDoc
  77265. */
  77266. render() {
  77267. super.render();
  77268. this.focusTracker.add( this.element );
  77269. this._setDomElementValue( this.value );
  77270. this._updateIsEmpty();
  77271. // Bind `this.value` to the DOM element's value.
  77272. // We cannot use `value` DOM attribute because removing it on Edge does not clear the DOM element's value property.
  77273. this.on( 'change:value', ( evt, name, value ) => {
  77274. this._setDomElementValue( value );
  77275. this._updateIsEmpty();
  77276. } );
  77277. }
  77278. /**
  77279. * Moves the focus to the input and selects the value.
  77280. */
  77281. select() {
  77282. this.element.select();
  77283. }
  77284. /**
  77285. * Focuses the input.
  77286. */
  77287. focus() {
  77288. this.element.focus();
  77289. }
  77290. /**
  77291. * Updates the {@link #isEmpty} property value on demand.
  77292. *
  77293. * @private
  77294. */
  77295. _updateIsEmpty() {
  77296. this.isEmpty = isInputElementEmpty( this.element );
  77297. }
  77298. /**
  77299. * Sets the `value` property of the {@link #element DOM element} on demand.
  77300. *
  77301. * @private
  77302. */
  77303. _setDomElementValue( value ) {
  77304. this.element.value = ( !value && value !== 0 ) ? '' : value;
  77305. }
  77306. }
  77307. function isInputElementEmpty( domElement ) {
  77308. return !domElement.value;
  77309. }
  77310. /***/ }),
  77311. /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/label/labelview.js":
  77312. /*!********************************************************************!*\
  77313. !*** ./node_modules/@ckeditor/ckeditor5-ui/src/label/labelview.js ***!
  77314. \********************************************************************/
  77315. /*! exports provided: default */
  77316. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  77317. "use strict";
  77318. __webpack_require__.r(__webpack_exports__);
  77319. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return LabelView; });
  77320. /* harmony import */ var _view__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../view */ "./node_modules/@ckeditor/ckeditor5-ui/src/view.js");
  77321. /* 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");
  77322. /* 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");
  77323. /* 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__);
  77324. /**
  77325. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  77326. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  77327. */
  77328. /**
  77329. * @module ui/label/labelview
  77330. */
  77331. /**
  77332. * The label view class.
  77333. *
  77334. * @extends module:ui/view~View
  77335. */
  77336. class LabelView extends _view__WEBPACK_IMPORTED_MODULE_0__["default"] {
  77337. /**
  77338. * @inheritDoc
  77339. */
  77340. constructor( locale ) {
  77341. super( locale );
  77342. /**
  77343. * The text of the label.
  77344. *
  77345. * @observable
  77346. * @member {String} #text
  77347. */
  77348. this.set( 'text' );
  77349. /**
  77350. * The `for` attribute of the label (i.e. to pair with an `<input>` element).
  77351. *
  77352. * @observable
  77353. * @member {String} #for
  77354. */
  77355. this.set( 'for' );
  77356. /**
  77357. * An unique id of the label. It can be used by other UI components to reference
  77358. * the label, for instance, using the `aria-describedby` DOM attribute.
  77359. *
  77360. * @member {String} #id
  77361. */
  77362. this.id = `ck-editor__label_${ Object(_ckeditor_ckeditor5_utils_src_uid__WEBPACK_IMPORTED_MODULE_1__["default"])() }`;
  77363. const bind = this.bindTemplate;
  77364. this.setTemplate( {
  77365. tag: 'label',
  77366. attributes: {
  77367. class: [
  77368. 'ck',
  77369. 'ck-label'
  77370. ],
  77371. id: this.id,
  77372. for: bind.to( 'for' )
  77373. },
  77374. children: [
  77375. {
  77376. text: bind.to( 'text' )
  77377. }
  77378. ]
  77379. } );
  77380. }
  77381. }
  77382. /***/ }),
  77383. /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/labeledfield/labeledfieldview.js":
  77384. /*!**********************************************************************************!*\
  77385. !*** ./node_modules/@ckeditor/ckeditor5-ui/src/labeledfield/labeledfieldview.js ***!
  77386. \**********************************************************************************/
  77387. /*! exports provided: default */
  77388. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  77389. "use strict";
  77390. __webpack_require__.r(__webpack_exports__);
  77391. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return LabeledFieldView; });
  77392. /* harmony import */ var _view__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../view */ "./node_modules/@ckeditor/ckeditor5-ui/src/view.js");
  77393. /* 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");
  77394. /* harmony import */ var _label_labelview__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../label/labelview */ "./node_modules/@ckeditor/ckeditor5-ui/src/label/labelview.js");
  77395. /* 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");
  77396. /* 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__);
  77397. /**
  77398. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  77399. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  77400. */
  77401. /**
  77402. * @module ui/labeledfield/labeledfieldview
  77403. */
  77404. /**
  77405. * The labeled field view class. It can be used to enhance any view with the following features:
  77406. *
  77407. * * a label,
  77408. * * (optional) an error message,
  77409. * * (optional) an info (status) text,
  77410. *
  77411. * all bound logically by proper DOM attributes for UX and accessibility. It also provides an interface
  77412. * (e.g. observable properties) that allows controlling those additional features.
  77413. *
  77414. * The constructor of this class requires a callback that returns a view to be labeled. The callback
  77415. * is called with unique ids that allow binding of DOM properties:
  77416. *
  77417. * const labeledInputView = new LabeledFieldView( locale, ( labeledFieldView, viewUid, statusUid ) => {
  77418. * const inputView = new InputTextView( labeledFieldView.locale );
  77419. *
  77420. * inputView.set( {
  77421. * id: viewUid,
  77422. * ariaDescribedById: statusUid
  77423. * } );
  77424. *
  77425. * inputView.bind( 'isReadOnly' ).to( labeledFieldView, 'isEnabled', value => !value );
  77426. * inputView.bind( 'hasError' ).to( labeledFieldView, 'errorText', value => !!value );
  77427. *
  77428. * return inputView;
  77429. * } );
  77430. *
  77431. * labeledInputView.label = 'User name';
  77432. * labeledInputView.infoText = 'Full name like for instance, John Doe.';
  77433. * labeledInputView.render();
  77434. *
  77435. * document.body.append( labeledInputView.element );
  77436. *
  77437. * See {@link module:ui/labeledfield/utils} to discover ready–to–use labeled input helpers for common
  77438. * UI components.
  77439. *
  77440. * @extends module:ui/view~View
  77441. */
  77442. class LabeledFieldView extends _view__WEBPACK_IMPORTED_MODULE_0__["default"] {
  77443. /**
  77444. * Creates an instance of the labeled field view class using a provided creator function
  77445. * that provides the view to be labeled.
  77446. *
  77447. * @param {module:utils/locale~Locale} locale The locale instance.
  77448. * @param {Function} viewCreator A function that returns a {@link module:ui/view~View}
  77449. * that will be labeled. The following arguments are passed to the creator function:
  77450. *
  77451. * * an instance of the `LabeledFieldView` to allow binding observable properties,
  77452. * * an UID string that connects the {@link #labelView label} and the labeled field view in DOM,
  77453. * * an UID string that connects the {@link #statusView status} and the labeled field view in DOM.
  77454. */
  77455. constructor( locale, viewCreator ) {
  77456. super( locale );
  77457. const viewUid = `ck-labeled-field-view-${ Object(_ckeditor_ckeditor5_utils_src_uid__WEBPACK_IMPORTED_MODULE_1__["default"])() }`;
  77458. const statusUid = `ck-labeled-field-view-status-${ Object(_ckeditor_ckeditor5_utils_src_uid__WEBPACK_IMPORTED_MODULE_1__["default"])() }`;
  77459. /**
  77460. * The field view that gets labeled.
  77461. *
  77462. * @member {module:ui/view~View} #fieldView
  77463. */
  77464. this.fieldView = viewCreator( this, viewUid, statusUid );
  77465. /**
  77466. * The text of the label.
  77467. *
  77468. * @observable
  77469. * @member {String} #label
  77470. */
  77471. this.set( 'label' );
  77472. /**
  77473. * Controls whether the component is in read-only mode.
  77474. *
  77475. * @observable
  77476. * @member {Boolean} #isEnabled
  77477. */
  77478. this.set( 'isEnabled', true );
  77479. /**
  77480. * An observable flag set to `true` when {@link #fieldView} is empty (`false` otherwise).
  77481. *
  77482. * @readonly
  77483. * @observable
  77484. * @member {Boolean} #isEmpty
  77485. * @default true
  77486. */
  77487. this.set( 'isEmpty', true );
  77488. /**
  77489. * An observable flag set to `true` when {@link #fieldView} is currently focused by
  77490. * the user (`false` otherwise).
  77491. *
  77492. * @readonly
  77493. * @observable
  77494. * @member {Boolean} #isFocused
  77495. * @default false
  77496. */
  77497. this.set( 'isFocused', false );
  77498. /**
  77499. * The validation error text. When set, it will be displayed
  77500. * next to the {@link #fieldView} as a typical validation error message.
  77501. * Set it to `null` to hide the message.
  77502. *
  77503. * **Note:** Setting this property to anything but `null` will automatically
  77504. * make the `hasError` of the {@link #fieldView} `true`.
  77505. *
  77506. * @observable
  77507. * @member {String|null} #errorText
  77508. */
  77509. this.set( 'errorText', null );
  77510. /**
  77511. * The additional information text displayed next to the {@link #fieldView} which can
  77512. * be used to inform the user about its purpose, provide help or hints.
  77513. *
  77514. * Set it to `null` to hide the message.
  77515. *
  77516. * **Note:** This text will be displayed in the same place as {@link #errorText} but the
  77517. * latter always takes precedence: if the {@link #errorText} is set, it replaces
  77518. * {@link #infoText}.
  77519. *
  77520. * @observable
  77521. * @member {String|null} #infoText
  77522. * @default null
  77523. */
  77524. this.set( 'infoText', null );
  77525. /**
  77526. * (Optional) The additional CSS class set on the dropdown {@link #element}.
  77527. *
  77528. * @observable
  77529. * @member {String} #class
  77530. */
  77531. this.set( 'class' );
  77532. /**
  77533. * The content of the `placeholder` attribute of the {@link #fieldView}.
  77534. *
  77535. * @observable
  77536. * @member {String} #placeholder
  77537. */
  77538. this.set( 'placeholder' );
  77539. /**
  77540. * The label view instance that describes the entire view.
  77541. *
  77542. * @member {module:ui/label/labelview~LabelView} #labelView
  77543. */
  77544. this.labelView = this._createLabelView( viewUid );
  77545. /**
  77546. * The status view for the {@link #fieldView}. It displays {@link #errorText} and
  77547. * {@link #infoText}.
  77548. *
  77549. * @member {module:ui/view~View} #statusView
  77550. */
  77551. this.statusView = this._createStatusView( statusUid );
  77552. /**
  77553. * The combined status text made of {@link #errorText} and {@link #infoText}.
  77554. * Note that when present, {@link #errorText} always takes precedence in the
  77555. * status.
  77556. *
  77557. * @see #errorText
  77558. * @see #infoText
  77559. * @see #statusView
  77560. * @private
  77561. * @observable
  77562. * @member {String|null} #_statusText
  77563. */
  77564. this.bind( '_statusText' ).to(
  77565. this, 'errorText',
  77566. this, 'infoText',
  77567. ( errorText, infoText ) => errorText || infoText
  77568. );
  77569. const bind = this.bindTemplate;
  77570. this.setTemplate( {
  77571. tag: 'div',
  77572. attributes: {
  77573. class: [
  77574. 'ck',
  77575. 'ck-labeled-field-view',
  77576. bind.to( 'class' ),
  77577. bind.if( 'isEnabled', 'ck-disabled', value => !value ),
  77578. bind.if( 'isEmpty', 'ck-labeled-field-view_empty' ),
  77579. bind.if( 'isFocused', 'ck-labeled-field-view_focused' ),
  77580. bind.if( 'placeholder', 'ck-labeled-field-view_placeholder' ),
  77581. bind.if( 'errorText', 'ck-error' )
  77582. ]
  77583. },
  77584. children: [
  77585. {
  77586. tag: 'div',
  77587. attributes: {
  77588. class: [
  77589. 'ck',
  77590. 'ck-labeled-field-view__input-wrapper'
  77591. ]
  77592. },
  77593. children: [
  77594. this.fieldView,
  77595. this.labelView
  77596. ]
  77597. },
  77598. this.statusView
  77599. ]
  77600. } );
  77601. }
  77602. /**
  77603. * Creates label view class instance and bind with view.
  77604. *
  77605. * @private
  77606. * @param {String} id Unique id to set as labelView#for attribute.
  77607. * @returns {module:ui/label/labelview~LabelView}
  77608. */
  77609. _createLabelView( id ) {
  77610. const labelView = new _label_labelview__WEBPACK_IMPORTED_MODULE_2__["default"]( this.locale );
  77611. labelView.for = id;
  77612. labelView.bind( 'text' ).to( this, 'label' );
  77613. return labelView;
  77614. }
  77615. /**
  77616. * Creates the status view instance. It displays {@link #errorText} and {@link #infoText}
  77617. * next to the {@link #fieldView}. See {@link #_statusText}.
  77618. *
  77619. * @private
  77620. * @param {String} statusUid Unique id of the status, shared with the {@link #fieldView view's}
  77621. * `aria-describedby` attribute.
  77622. * @returns {module:ui/view~View}
  77623. */
  77624. _createStatusView( statusUid ) {
  77625. const statusView = new _view__WEBPACK_IMPORTED_MODULE_0__["default"]( this.locale );
  77626. const bind = this.bindTemplate;
  77627. statusView.setTemplate( {
  77628. tag: 'div',
  77629. attributes: {
  77630. class: [
  77631. 'ck',
  77632. 'ck-labeled-field-view__status',
  77633. bind.if( 'errorText', 'ck-labeled-field-view__status_error' ),
  77634. bind.if( '_statusText', 'ck-hidden', value => !value )
  77635. ],
  77636. id: statusUid,
  77637. role: bind.if( 'errorText', 'alert' )
  77638. },
  77639. children: [
  77640. {
  77641. text: bind.to( '_statusText' )
  77642. }
  77643. ]
  77644. } );
  77645. return statusView;
  77646. }
  77647. /**
  77648. * Focuses the {@link #fieldView}.
  77649. */
  77650. focus() {
  77651. this.fieldView.focus();
  77652. }
  77653. }
  77654. /***/ }),
  77655. /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/labeledfield/utils.js":
  77656. /*!***********************************************************************!*\
  77657. !*** ./node_modules/@ckeditor/ckeditor5-ui/src/labeledfield/utils.js ***!
  77658. \***********************************************************************/
  77659. /*! exports provided: createLabeledInputText, createLabeledDropdown */
  77660. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  77661. "use strict";
  77662. __webpack_require__.r(__webpack_exports__);
  77663. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createLabeledInputText", function() { return createLabeledInputText; });
  77664. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createLabeledDropdown", function() { return createLabeledDropdown; });
  77665. /* harmony import */ var _inputtext_inputtextview__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../inputtext/inputtextview */ "./node_modules/@ckeditor/ckeditor5-ui/src/inputtext/inputtextview.js");
  77666. /* harmony import */ var _dropdown_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../dropdown/utils */ "./node_modules/@ckeditor/ckeditor5-ui/src/dropdown/utils.js");
  77667. /**
  77668. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  77669. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  77670. */
  77671. /**
  77672. * @module ui/labeledfield/utils
  77673. */
  77674. /**
  77675. * A helper for creating labeled inputs.
  77676. *
  77677. * It creates an instance of a {@link module:ui/inputtext/inputtextview~InputTextView input text} that is
  77678. * logically related to a {@link module:ui/labeledfield/labeledfieldview~LabeledFieldView labeled view} in DOM.
  77679. *
  77680. * The helper does the following:
  77681. *
  77682. * * It sets input's `id` and `ariaDescribedById` attributes.
  77683. * * It binds input's `isReadOnly` to the labeled view.
  77684. * * It binds input's `hasError` to the labeled view.
  77685. * * It enables a logic that cleans up the error when user starts typing in the input..
  77686. *
  77687. * Usage:
  77688. *
  77689. * const labeledInputView = new LabeledFieldView( locale, createLabeledDropdown );
  77690. * console.log( labeledInputView.view ); // An input instance.
  77691. *
  77692. * @param {module:ui/labeledfield/labeledfieldview~LabeledFieldView} labeledFieldView The instance of the labeled field view.
  77693. * @param {String} viewUid An UID string that allows DOM logical connection between the
  77694. * {@link module:ui/labeledfield/labeledfieldview~LabeledFieldView#labelView labeled view's label} and the input.
  77695. * @param {String} statusUid An UID string that allows DOM logical connection between the
  77696. * {@link module:ui/labeledfield/labeledfieldview~LabeledFieldView#statusView labeled view's status} and the input.
  77697. * @returns {module:ui/inputtext/inputtextview~InputTextView} The input text view instance.
  77698. */
  77699. function createLabeledInputText( labeledFieldView, viewUid, statusUid ) {
  77700. const inputView = new _inputtext_inputtextview__WEBPACK_IMPORTED_MODULE_0__["default"]( labeledFieldView.locale );
  77701. inputView.set( {
  77702. id: viewUid,
  77703. ariaDescribedById: statusUid
  77704. } );
  77705. inputView.bind( 'isReadOnly' ).to( labeledFieldView, 'isEnabled', value => !value );
  77706. inputView.bind( 'hasError' ).to( labeledFieldView, 'errorText', value => !!value );
  77707. inputView.on( 'input', () => {
  77708. // UX: Make the error text disappear and disable the error indicator as the user
  77709. // starts fixing the errors.
  77710. labeledFieldView.errorText = null;
  77711. } );
  77712. labeledFieldView.bind( 'isEmpty', 'isFocused', 'placeholder' ).to( inputView );
  77713. return inputView;
  77714. }
  77715. /**
  77716. * A helper for creating labeled dropdowns.
  77717. *
  77718. * It creates an instance of a {@link module:ui/dropdown/dropdownview~DropdownView dropdown} that is
  77719. * logically related to a {@link module:ui/labeledfield/labeledfieldview~LabeledFieldView labeled field view}.
  77720. *
  77721. * The helper does the following:
  77722. *
  77723. * * It sets dropdown's `id` and `ariaDescribedById` attributes.
  77724. * * It binds input's `isEnabled` to the labeled view.
  77725. *
  77726. * Usage:
  77727. *
  77728. * const labeledInputView = new LabeledFieldView( locale, createLabeledDropdown );
  77729. * console.log( labeledInputView.view ); // A dropdown instance.
  77730. *
  77731. * @param {module:ui/labeledfield/labeledfieldview~LabeledFieldView} labeledFieldView The instance of the labeled field view.
  77732. * @param {String} viewUid An UID string that allows DOM logical connection between the
  77733. * {@link module:ui/labeledfield/labeledfieldview~LabeledFieldView#labelView labeled view label} and the dropdown.
  77734. * @param {String} statusUid An UID string that allows DOM logical connection between the
  77735. * {@link module:ui/labeledfield/labeledfieldview~LabeledFieldView#statusView labeled view status} and the dropdown.
  77736. * @returns {module:ui/dropdown/dropdownview~DropdownView} The dropdown view instance.
  77737. */
  77738. function createLabeledDropdown( labeledFieldView, viewUid, statusUid ) {
  77739. const dropdownView = Object(_dropdown_utils__WEBPACK_IMPORTED_MODULE_1__["createDropdown"])( labeledFieldView.locale );
  77740. dropdownView.set( {
  77741. id: viewUid,
  77742. ariaDescribedById: statusUid
  77743. } );
  77744. dropdownView.bind( 'isEnabled' ).to( labeledFieldView );
  77745. return dropdownView;
  77746. }
  77747. /***/ }),
  77748. /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/list/listitemview.js":
  77749. /*!**********************************************************************!*\
  77750. !*** ./node_modules/@ckeditor/ckeditor5-ui/src/list/listitemview.js ***!
  77751. \**********************************************************************/
  77752. /*! exports provided: default */
  77753. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  77754. "use strict";
  77755. __webpack_require__.r(__webpack_exports__);
  77756. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ListItemView; });
  77757. /* harmony import */ var _view__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../view */ "./node_modules/@ckeditor/ckeditor5-ui/src/view.js");
  77758. /**
  77759. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  77760. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  77761. */
  77762. /**
  77763. * @module ui/list/listitemview
  77764. */
  77765. /**
  77766. * The list item view class.
  77767. *
  77768. * @extends module:ui/view~View
  77769. */
  77770. class ListItemView extends _view__WEBPACK_IMPORTED_MODULE_0__["default"] {
  77771. /**
  77772. * @inheritDoc
  77773. */
  77774. constructor( locale ) {
  77775. super( locale );
  77776. /**
  77777. * Collection of the child views inside of the list item {@link #element}.
  77778. *
  77779. * @readonly
  77780. * @member {module:ui/viewcollection~ViewCollection}
  77781. */
  77782. this.children = this.createCollection();
  77783. this.setTemplate( {
  77784. tag: 'li',
  77785. attributes: {
  77786. class: [
  77787. 'ck',
  77788. 'ck-list__item'
  77789. ]
  77790. },
  77791. children: this.children
  77792. } );
  77793. }
  77794. /**
  77795. * Focuses the list item.
  77796. */
  77797. focus() {
  77798. this.children.first.focus();
  77799. }
  77800. }
  77801. /***/ }),
  77802. /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/list/listseparatorview.js":
  77803. /*!***************************************************************************!*\
  77804. !*** ./node_modules/@ckeditor/ckeditor5-ui/src/list/listseparatorview.js ***!
  77805. \***************************************************************************/
  77806. /*! exports provided: default */
  77807. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  77808. "use strict";
  77809. __webpack_require__.r(__webpack_exports__);
  77810. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ListSeparatorView; });
  77811. /* harmony import */ var _view__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../view */ "./node_modules/@ckeditor/ckeditor5-ui/src/view.js");
  77812. /**
  77813. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  77814. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  77815. */
  77816. /**
  77817. * @module ui/list/listseparatorview
  77818. */
  77819. /**
  77820. * The list separator view class.
  77821. *
  77822. * @extends module:ui/view~View
  77823. */
  77824. class ListSeparatorView extends _view__WEBPACK_IMPORTED_MODULE_0__["default"] {
  77825. /**
  77826. * @inheritDoc
  77827. */
  77828. constructor( locale ) {
  77829. super( locale );
  77830. this.setTemplate( {
  77831. tag: 'li',
  77832. attributes: {
  77833. class: [
  77834. 'ck',
  77835. 'ck-list__separator'
  77836. ]
  77837. }
  77838. } );
  77839. }
  77840. }
  77841. /***/ }),
  77842. /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/list/listview.js":
  77843. /*!******************************************************************!*\
  77844. !*** ./node_modules/@ckeditor/ckeditor5-ui/src/list/listview.js ***!
  77845. \******************************************************************/
  77846. /*! exports provided: default */
  77847. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  77848. "use strict";
  77849. __webpack_require__.r(__webpack_exports__);
  77850. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ListView; });
  77851. /* harmony import */ var _view__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../view */ "./node_modules/@ckeditor/ckeditor5-ui/src/view.js");
  77852. /* 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");
  77853. /* harmony import */ var _focuscycler__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../focuscycler */ "./node_modules/@ckeditor/ckeditor5-ui/src/focuscycler.js");
  77854. /* 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");
  77855. /* 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");
  77856. /* 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__);
  77857. /**
  77858. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  77859. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  77860. */
  77861. /**
  77862. * @module ui/list/listview
  77863. */
  77864. /**
  77865. * The list view class.
  77866. *
  77867. * @extends module:ui/view~View
  77868. * @implements module:ui/dropdown/dropdownpanelfocusable~DropdownPanelFocusable
  77869. */
  77870. class ListView extends _view__WEBPACK_IMPORTED_MODULE_0__["default"] {
  77871. /**
  77872. * @inheritDoc
  77873. */
  77874. constructor() {
  77875. super();
  77876. /**
  77877. * Collection of the child list views.
  77878. *
  77879. * @readonly
  77880. * @member {module:ui/viewcollection~ViewCollection}
  77881. */
  77882. this.items = this.createCollection();
  77883. /**
  77884. * Tracks information about DOM focus in the list.
  77885. *
  77886. * @readonly
  77887. * @member {module:utils/focustracker~FocusTracker}
  77888. */
  77889. this.focusTracker = new _ckeditor_ckeditor5_utils_src_focustracker__WEBPACK_IMPORTED_MODULE_1__["default"]();
  77890. /**
  77891. * Instance of the {@link module:utils/keystrokehandler~KeystrokeHandler}.
  77892. *
  77893. * @readonly
  77894. * @member {module:utils/keystrokehandler~KeystrokeHandler}
  77895. */
  77896. this.keystrokes = new _ckeditor_ckeditor5_utils_src_keystrokehandler__WEBPACK_IMPORTED_MODULE_3__["default"]();
  77897. /**
  77898. * Helps cycling over focusable {@link #items} in the list.
  77899. *
  77900. * @readonly
  77901. * @protected
  77902. * @member {module:ui/focuscycler~FocusCycler}
  77903. */
  77904. this._focusCycler = new _focuscycler__WEBPACK_IMPORTED_MODULE_2__["default"]( {
  77905. focusables: this.items,
  77906. focusTracker: this.focusTracker,
  77907. keystrokeHandler: this.keystrokes,
  77908. actions: {
  77909. // Navigate list items backwards using the arrowup key.
  77910. focusPrevious: 'arrowup',
  77911. // Navigate toolbar items forwards using the arrowdown key.
  77912. focusNext: 'arrowdown'
  77913. }
  77914. } );
  77915. this.setTemplate( {
  77916. tag: 'ul',
  77917. attributes: {
  77918. class: [
  77919. 'ck',
  77920. 'ck-reset',
  77921. 'ck-list'
  77922. ]
  77923. },
  77924. children: this.items
  77925. } );
  77926. }
  77927. /**
  77928. * @inheritDoc
  77929. */
  77930. render() {
  77931. super.render();
  77932. // Items added before rendering should be known to the #focusTracker.
  77933. for ( const item of this.items ) {
  77934. this.focusTracker.add( item.element );
  77935. }
  77936. this.items.on( 'add', ( evt, item ) => {
  77937. this.focusTracker.add( item.element );
  77938. } );
  77939. this.items.on( 'remove', ( evt, item ) => {
  77940. this.focusTracker.remove( item.element );
  77941. } );
  77942. // Start listening for the keystrokes coming from #element.
  77943. this.keystrokes.listenTo( this.element );
  77944. }
  77945. /**
  77946. * Focuses the first focusable in {@link #items}.
  77947. */
  77948. focus() {
  77949. this._focusCycler.focusFirst();
  77950. }
  77951. /**
  77952. * Focuses the last focusable in {@link #items}.
  77953. */
  77954. focusLast() {
  77955. this._focusCycler.focusLast();
  77956. }
  77957. }
  77958. /***/ }),
  77959. /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/model.js":
  77960. /*!**********************************************************!*\
  77961. !*** ./node_modules/@ckeditor/ckeditor5-ui/src/model.js ***!
  77962. \**********************************************************/
  77963. /*! exports provided: default */
  77964. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  77965. "use strict";
  77966. __webpack_require__.r(__webpack_exports__);
  77967. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Model; });
  77968. /* 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");
  77969. /* 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");
  77970. /* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lodash-es */ "./node_modules/lodash-es/lodash.js");
  77971. /**
  77972. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  77973. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  77974. */
  77975. /**
  77976. * @module ui/model
  77977. */
  77978. /**
  77979. * The base MVC model class.
  77980. *
  77981. * @mixes module:utils/observablemixin~ObservableMixin
  77982. */
  77983. class Model {
  77984. /**
  77985. * Creates a new Model instance.
  77986. *
  77987. * @param {Object} [attributes] The model state attributes to be defined during the instance creation.
  77988. * @param {Object} [properties] The (out of state) properties to be appended to the instance during creation.
  77989. */
  77990. constructor( attributes, properties ) {
  77991. // Extend this instance with the additional (out of state) properties.
  77992. if ( properties ) {
  77993. Object(lodash_es__WEBPACK_IMPORTED_MODULE_2__["extend"])( this, properties );
  77994. }
  77995. // Initialize the attributes.
  77996. if ( attributes ) {
  77997. this.set( attributes );
  77998. }
  77999. }
  78000. }
  78001. Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_0__["default"])( Model, _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_1__["default"] );
  78002. /***/ }),
  78003. /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/notification/notification.js":
  78004. /*!******************************************************************************!*\
  78005. !*** ./node_modules/@ckeditor/ckeditor5-ui/src/notification/notification.js ***!
  78006. \******************************************************************************/
  78007. /*! exports provided: default */
  78008. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  78009. "use strict";
  78010. __webpack_require__.r(__webpack_exports__);
  78011. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Notification; });
  78012. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  78013. /**
  78014. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  78015. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  78016. */
  78017. /**
  78018. * @module ui/notification/notification
  78019. */
  78020. /* globals window */
  78021. /**
  78022. * The Notification plugin.
  78023. *
  78024. * This plugin sends a few types of notifications: `success`, `info` and `warning`. The notifications need to be
  78025. * handled and displayed by a plugin responsible for showing the UI of the notifications. Using this plugin for dispatching
  78026. * notifications makes it possible to switch the notifications UI.
  78027. *
  78028. * Note that every unhandled and not stopped `warning` notification will be displayed as a system alert.
  78029. * See {@link module:ui/notification/notification~Notification#showWarning}.
  78030. *
  78031. * @extends module:core/contextplugin~ContextPlugin
  78032. */
  78033. class Notification extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["ContextPlugin"] {
  78034. /**
  78035. * @inheritDoc
  78036. */
  78037. static get pluginName() {
  78038. return 'Notification';
  78039. }
  78040. /**
  78041. * @inheritDoc
  78042. */
  78043. init() {
  78044. // Each unhandled and not stopped `show:warning` event is displayed as a system alert.
  78045. this.on( 'show:warning', ( evt, data ) => {
  78046. window.alert( data.message ); // eslint-disable-line no-alert
  78047. }, { priority: 'lowest' } );
  78048. }
  78049. /**
  78050. * Shows a success notification.
  78051. *
  78052. * By default, it fires the {@link #event:show:success `show:success` event} with the given `data`. The event namespace can be extended
  78053. * using the `data.namespace` option. For example:
  78054. *
  78055. * showSuccess( 'Image is uploaded.', {
  78056. * namespace: 'upload:image'
  78057. * } );
  78058. *
  78059. * will fire the `show:success:upload:image` event.
  78060. *
  78061. * You can provide the title of the notification:
  78062. *
  78063. * showSuccess( 'Image is uploaded.', {
  78064. * title: 'Image upload success'
  78065. * } );
  78066. *
  78067. * @param {String} message The content of the notification.
  78068. * @param {Object} [data={}] Additional data.
  78069. * @param {String} [data.namespace] Additional event namespace.
  78070. * @param {String} [data.title] The title of the notification.
  78071. */
  78072. showSuccess( message, data = {} ) {
  78073. this._showNotification( {
  78074. message,
  78075. type: 'success',
  78076. namespace: data.namespace,
  78077. title: data.title
  78078. } );
  78079. }
  78080. /**
  78081. * Shows an information notification.
  78082. *
  78083. * By default, it fires the {@link #event:show:info `show:info` event} with the given `data`. The event namespace can be extended
  78084. * using the `data.namespace` option. For example:
  78085. *
  78086. * showInfo( 'Editor is offline.', {
  78087. * namespace: 'editor:status'
  78088. * } );
  78089. *
  78090. * will fire the `show:info:editor:status` event.
  78091. *
  78092. * You can provide the title of the notification:
  78093. *
  78094. * showInfo( 'Editor is offline.', {
  78095. * title: 'Network information'
  78096. * } );
  78097. *
  78098. * @param {String} message The content of the notification.
  78099. * @param {Object} [data={}] Additional data.
  78100. * @param {String} [data.namespace] Additional event namespace.
  78101. * @param {String} [data.title] The title of the notification.
  78102. */
  78103. showInfo( message, data = {} ) {
  78104. this._showNotification( {
  78105. message,
  78106. type: 'info',
  78107. namespace: data.namespace,
  78108. title: data.title
  78109. } );
  78110. }
  78111. /**
  78112. * Shows a warning notification.
  78113. *
  78114. * By default, it fires the {@link #event:show:warning `show:warning` event}
  78115. * with the given `data`. The event namespace can be extended using the `data.namespace` option. For example:
  78116. *
  78117. * showWarning( 'Image upload error.', {
  78118. * namespace: 'upload:image'
  78119. * } );
  78120. *
  78121. * will fire the `show:warning:upload:image` event.
  78122. *
  78123. * You can provide the title of the notification:
  78124. *
  78125. * showWarning( 'Image upload error.', {
  78126. * title: 'Upload failed'
  78127. * } );
  78128. *
  78129. * Note that each unhandled and not stopped `warning` notification will be displayed as a system alert.
  78130. * The plugin responsible for displaying warnings should `stop()` the event to prevent displaying it as an alert:
  78131. *
  78132. * notifications.on( 'show:warning', ( evt, data ) => {
  78133. * // Do something with the data.
  78134. *
  78135. * // Stop this event to prevent displaying it as an alert.
  78136. * evt.stop();
  78137. * } );
  78138. *
  78139. * You can attach many listeners to the same event and `stop()` this event in a listener with a low priority:
  78140. *
  78141. * notifications.on( 'show:warning', ( evt, data ) => {
  78142. * // Show the warning in the UI, but do not stop it.
  78143. * } );
  78144. *
  78145. * notifications.on( 'show:warning', ( evt, data ) => {
  78146. * // Log the warning to some error tracker.
  78147. *
  78148. * // Stop this event to prevent displaying it as an alert.
  78149. * evt.stop();
  78150. * }, { priority: 'low' } );
  78151. *
  78152. * @param {String} message The content of the notification.
  78153. * @param {Object} [data={}] Additional data.
  78154. * @param {String} [data.namespace] Additional event namespace.
  78155. * @param {String} [data.title] The title of the notification.
  78156. */
  78157. showWarning( message, data = {} ) {
  78158. this._showNotification( {
  78159. message,
  78160. type: 'warning',
  78161. namespace: data.namespace,
  78162. title: data.title
  78163. } );
  78164. }
  78165. /**
  78166. * Fires the `show` event with the specified type, namespace and message.
  78167. *
  78168. * @private
  78169. * @param {Object} data The message data.
  78170. * @param {String} data.message The content of the notification.
  78171. * @param {'success'|'info'|'warning'} data.type The type of the message.
  78172. * @param {String} [data.namespace] Additional event namespace.
  78173. * @param {String} [data.title=''] The title of the notification.
  78174. */
  78175. _showNotification( data ) {
  78176. const event = `show:${ data.type }` + ( data.namespace ? `:${ data.namespace }` : '' );
  78177. this.fire( event, {
  78178. message: data.message,
  78179. type: data.type,
  78180. title: data.title || ''
  78181. } );
  78182. }
  78183. /**
  78184. * Fired when one of the `showSuccess()`, `showInfo()`, `showWarning()` methods is called.
  78185. *
  78186. * @event show
  78187. * @param {Object} data The notification data.
  78188. * @param {String} data.message The content of the notification.
  78189. * @param {String} data.title The title of the notification.
  78190. * @param {'success'|'info'|'warning'} data.type The type of the notification.
  78191. */
  78192. /**
  78193. * Fired when the `showSuccess()` method is called.
  78194. *
  78195. * @event show:success
  78196. * @param {Object} data The notification data.
  78197. * @param {String} data.message The content of the notification.
  78198. * @param {String} data.title The title of the notification.
  78199. * @param {'success'} data.type The type of the notification.
  78200. */
  78201. /**
  78202. * Fired when the `showInfo()` method is called.
  78203. *
  78204. * @event show:info
  78205. * @param {Object} data The notification data.
  78206. * @param {String} data.message The content of the notification.
  78207. * @param {String} data.title The title of the notification.
  78208. * @param {'info'} data.type The type of the notification.
  78209. */
  78210. /**
  78211. * Fired when the `showWarning()` method is called.
  78212. *
  78213. * When this event is not handled or stopped by `event.stop()`, the `data.message` of this event will
  78214. * be automatically displayed as a system alert.
  78215. *
  78216. * @event show:warning
  78217. * @param {Object} data The notification data.
  78218. * @param {String} data.message The content of the notification.
  78219. * @param {String} data.title The title of the notification.
  78220. * @param {'warning'} data.type The type of the notification.
  78221. */
  78222. }
  78223. /***/ }),
  78224. /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/panel/balloon/balloonpanelview.js":
  78225. /*!***********************************************************************************!*\
  78226. !*** ./node_modules/@ckeditor/ckeditor5-ui/src/panel/balloon/balloonpanelview.js ***!
  78227. \***********************************************************************************/
  78228. /*! exports provided: default */
  78229. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  78230. "use strict";
  78231. __webpack_require__.r(__webpack_exports__);
  78232. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return BalloonPanelView; });
  78233. /* harmony import */ var _view__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../view */ "./node_modules/@ckeditor/ckeditor5-ui/src/view.js");
  78234. /* 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");
  78235. /* 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");
  78236. /* 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");
  78237. /* 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");
  78238. /* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! lodash-es */ "./node_modules/lodash-es/lodash.js");
  78239. /* 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");
  78240. /* 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__);
  78241. /**
  78242. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  78243. * For licensing, see LICENSE.md.
  78244. */
  78245. /**
  78246. * @module ui/panel/balloon/balloonpanelview
  78247. */
  78248. const toPx = Object(_ckeditor_ckeditor5_utils_src_dom_tounit__WEBPACK_IMPORTED_MODULE_3__["default"])( 'px' );
  78249. const defaultLimiterElement = _ckeditor_ckeditor5_utils_src_dom_global__WEBPACK_IMPORTED_MODULE_4__["default"].document.body;
  78250. /**
  78251. * The balloon panel view class.
  78252. *
  78253. * A floating container which can
  78254. * {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView#pin pin} to any
  78255. * {@link module:utils/dom/position~Options#target target} in the DOM and remain in that position
  78256. * e.g. when the web page is scrolled.
  78257. *
  78258. * The balloon panel can be used to display contextual, non-blocking UI like forms, toolbars and
  78259. * the like in its {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView#content} view
  78260. * collection.
  78261. *
  78262. * There is a number of {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView.defaultPositions}
  78263. * that the balloon can use, automatically switching from one to another when the viewport space becomes
  78264. * scarce to keep the balloon visible to the user as long as it is possible. The balloon will also
  78265. * accept any custom position set provided by the user compatible with the
  78266. * {@link module:utils/dom/position~Options options}.
  78267. *
  78268. * const panel = new BalloonPanelView( locale );
  78269. * const childView = new ChildView();
  78270. * const positions = BalloonPanelView.defaultPositions;
  78271. *
  78272. * panel.render();
  78273. *
  78274. * // Add a child view to the panel's content collection.
  78275. * panel.content.add( childView );
  78276. *
  78277. * // Start pinning the panel to an element with the "target" id DOM.
  78278. * // The balloon will remain pinned until unpin() is called.
  78279. * panel.pin( {
  78280. * target: document.querySelector( '#target' ),
  78281. * positions: [
  78282. * positions.northArrowSouth,
  78283. * positions.southArrowNorth
  78284. * ]
  78285. * } );
  78286. *
  78287. * @extends module:ui/view~View
  78288. */
  78289. class BalloonPanelView extends _view__WEBPACK_IMPORTED_MODULE_0__["default"] {
  78290. /**
  78291. * @inheritDoc
  78292. */
  78293. constructor( locale ) {
  78294. super( locale );
  78295. const bind = this.bindTemplate;
  78296. /**
  78297. * The absolute top position of the balloon panel in pixels.
  78298. *
  78299. * @observable
  78300. * @default 0
  78301. * @member {Number} #top
  78302. */
  78303. this.set( 'top', 0 );
  78304. /**
  78305. * The absolute left position of the balloon panel in pixels.
  78306. *
  78307. * @observable
  78308. * @default 0
  78309. * @member {Number} #left
  78310. */
  78311. this.set( 'left', 0 );
  78312. /**
  78313. * The balloon panel's current position. The position name is reflected in the CSS class set
  78314. * to the balloon, i.e. `.ck-balloon-panel_arrow_nw` for the "arrow_nw" position. The class
  78315. * controls the minor aspects of the balloon's visual appearance like the placement
  78316. * of an {@link #withArrow arrow}. To support a new position, an additional CSS must be created.
  78317. *
  78318. * Default position names correspond with
  78319. * {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView.defaultPositions}.
  78320. *
  78321. * See the {@link #attachTo} and {@link #pin} methods to learn about custom balloon positions.
  78322. *
  78323. * @observable
  78324. * @default 'arrow_nw'
  78325. * @member {'arrow_nw'|'arrow_ne'|'arrow_sw'|'arrow_se'} #position
  78326. */
  78327. this.set( 'position', 'arrow_nw' );
  78328. /**
  78329. * Controls whether the balloon panel is visible or not.
  78330. *
  78331. * @observable
  78332. * @default false
  78333. * @member {Boolean} #isVisible
  78334. */
  78335. this.set( 'isVisible', false );
  78336. /**
  78337. * Controls whether the balloon panel has an arrow. The presence of the arrow
  78338. * is reflected in the `ck-balloon-panel_with-arrow` CSS class.
  78339. *
  78340. * @observable
  78341. * @default true
  78342. * @member {Boolean} #withArrow
  78343. */
  78344. this.set( 'withArrow', true );
  78345. /**
  78346. * An additional CSS class added to the {@link #element}.
  78347. *
  78348. * @observable
  78349. * @member {String} #class
  78350. */
  78351. this.set( 'class' );
  78352. /**
  78353. * A callback that starts pinning the panel when {@link #isVisible} gets
  78354. * `true`. Used by {@link #pin}.
  78355. *
  78356. * @private
  78357. * @member {Function} #_pinWhenIsVisibleCallback
  78358. */
  78359. /**
  78360. * A collection of the child views that creates the balloon panel contents.
  78361. *
  78362. * @readonly
  78363. * @member {module:ui/viewcollection~ViewCollection}
  78364. */
  78365. this.content = this.createCollection();
  78366. this.setTemplate( {
  78367. tag: 'div',
  78368. attributes: {
  78369. class: [
  78370. 'ck',
  78371. 'ck-balloon-panel',
  78372. bind.to( 'position', value => `ck-balloon-panel_${ value }` ),
  78373. bind.if( 'isVisible', 'ck-balloon-panel_visible' ),
  78374. bind.if( 'withArrow', 'ck-balloon-panel_with-arrow' ),
  78375. bind.to( 'class' )
  78376. ],
  78377. style: {
  78378. top: bind.to( 'top', toPx ),
  78379. left: bind.to( 'left', toPx )
  78380. }
  78381. },
  78382. children: this.content
  78383. } );
  78384. }
  78385. /**
  78386. * Shows the panel.
  78387. *
  78388. * See {@link #isVisible}.
  78389. */
  78390. show() {
  78391. this.isVisible = true;
  78392. }
  78393. /**
  78394. * Hides the panel.
  78395. *
  78396. * See {@link #isVisible}.
  78397. */
  78398. hide() {
  78399. this.isVisible = false;
  78400. }
  78401. /**
  78402. * Attaches the panel to a specified {@link module:utils/dom/position~Options#target} with a
  78403. * smart positioning heuristics that chooses from available positions to make sure the panel
  78404. * is visible to the user i.e. within the limits of the viewport.
  78405. *
  78406. * This method accepts configuration {@link module:utils/dom/position~Options options}
  78407. * to set the `target`, optional `limiter` and `positions` the balloon should choose from.
  78408. *
  78409. * const panel = new BalloonPanelView( locale );
  78410. * const positions = BalloonPanelView.defaultPositions;
  78411. *
  78412. * panel.render();
  78413. *
  78414. * // Attach the panel to an element with the "target" id DOM.
  78415. * panel.attachTo( {
  78416. * target: document.querySelector( '#target' ),
  78417. * positions: [
  78418. * positions.northArrowSouth,
  78419. * positions.southArrowNorth
  78420. * ]
  78421. * } );
  78422. *
  78423. * **Note**: Attaching the panel will also automatically {@link #show} it.
  78424. *
  78425. * **Note**: An attached panel will not follow its target when the window is scrolled or resized.
  78426. * See the {@link #pin} method for a more permanent positioning strategy.
  78427. *
  78428. * @param {module:utils/dom/position~Options} options Positioning options compatible with
  78429. * {@link module:utils/dom/position~getOptimalPosition}. Default `positions` array is
  78430. * {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView.defaultPositions}.
  78431. */
  78432. attachTo( options ) {
  78433. this.show();
  78434. const defaultPositions = BalloonPanelView.defaultPositions;
  78435. const positionOptions = Object.assign( {}, {
  78436. element: this.element,
  78437. positions: [
  78438. defaultPositions.southArrowNorth,
  78439. defaultPositions.southArrowNorthMiddleWest,
  78440. defaultPositions.southArrowNorthMiddleEast,
  78441. defaultPositions.southArrowNorthWest,
  78442. defaultPositions.southArrowNorthEast,
  78443. defaultPositions.northArrowSouth,
  78444. defaultPositions.northArrowSouthMiddleWest,
  78445. defaultPositions.northArrowSouthMiddleEast,
  78446. defaultPositions.northArrowSouthWest,
  78447. defaultPositions.northArrowSouthEast
  78448. ],
  78449. limiter: defaultLimiterElement,
  78450. fitInViewport: true
  78451. }, options );
  78452. const optimalPosition = BalloonPanelView._getOptimalPosition( positionOptions );
  78453. // Usually browsers make some problems with super accurate values like 104.345px
  78454. // so it is better to use int values.
  78455. const left = parseInt( optimalPosition.left );
  78456. const top = parseInt( optimalPosition.top );
  78457. const position = optimalPosition.name;
  78458. Object.assign( this, { top, left, position } );
  78459. }
  78460. /**
  78461. * Works the same way as the {@link #attachTo} method except that the position of the panel is
  78462. * continuously updated when:
  78463. *
  78464. * * any ancestor of the {@link module:utils/dom/position~Options#target}
  78465. * or {@link module:utils/dom/position~Options#limiter} is scrolled,
  78466. * * the browser window gets resized or scrolled.
  78467. *
  78468. * Thanks to that, the panel always sticks to the {@link module:utils/dom/position~Options#target}
  78469. * and is immune to the changing environment.
  78470. *
  78471. * const panel = new BalloonPanelView( locale );
  78472. * const positions = BalloonPanelView.defaultPositions;
  78473. *
  78474. * panel.render();
  78475. *
  78476. * // Pin the panel to an element with the "target" id DOM.
  78477. * panel.pin( {
  78478. * target: document.querySelector( '#target' ),
  78479. * positions: [
  78480. * positions.northArrowSouth,
  78481. * positions.southArrowNorth
  78482. * ]
  78483. * } );
  78484. *
  78485. * To leave the pinned state, use the {@link #unpin} method.
  78486. *
  78487. * **Note**: Pinning the panel will also automatically {@link #show} it.
  78488. *
  78489. * @param {module:utils/dom/position~Options} options Positioning options compatible with
  78490. * {@link module:utils/dom/position~getOptimalPosition}. Default `positions` array is
  78491. * {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView.defaultPositions}.
  78492. */
  78493. pin( options ) {
  78494. this.unpin();
  78495. this._pinWhenIsVisibleCallback = () => {
  78496. if ( this.isVisible ) {
  78497. this._startPinning( options );
  78498. } else {
  78499. this._stopPinning();
  78500. }
  78501. };
  78502. this._startPinning( options );
  78503. // Control the state of the listeners depending on whether the panel is visible
  78504. // or not.
  78505. // TODO: Use on() (https://github.com/ckeditor/ckeditor5-utils/issues/144).
  78506. this.listenTo( this, 'change:isVisible', this._pinWhenIsVisibleCallback );
  78507. }
  78508. /**
  78509. * Stops pinning the panel, as set up by {@link #pin}.
  78510. */
  78511. unpin() {
  78512. if ( this._pinWhenIsVisibleCallback ) {
  78513. // Deactivate listeners attached by pin().
  78514. this._stopPinning();
  78515. // Deactivate the panel pin() control logic.
  78516. // TODO: Use off() (https://github.com/ckeditor/ckeditor5-utils/issues/144).
  78517. this.stopListening( this, 'change:isVisible', this._pinWhenIsVisibleCallback );
  78518. this._pinWhenIsVisibleCallback = null;
  78519. this.hide();
  78520. }
  78521. }
  78522. /**
  78523. * Starts managing the pinned state of the panel. See {@link #pin}.
  78524. *
  78525. * @private
  78526. * @param {module:utils/dom/position~Options} options Positioning options compatible with
  78527. * {@link module:utils/dom/position~getOptimalPosition}.
  78528. */
  78529. _startPinning( options ) {
  78530. this.attachTo( options );
  78531. const targetElement = getDomElement( options.target );
  78532. const limiterElement = options.limiter ? getDomElement( options.limiter ) : defaultLimiterElement;
  78533. // Then we need to listen on scroll event of eny element in the document.
  78534. this.listenTo( _ckeditor_ckeditor5_utils_src_dom_global__WEBPACK_IMPORTED_MODULE_4__["default"].document, 'scroll', ( evt, domEvt ) => {
  78535. const scrollTarget = domEvt.target;
  78536. // The position needs to be updated if the positioning target is within the scrolled element.
  78537. const isWithinScrollTarget = targetElement && scrollTarget.contains( targetElement );
  78538. // The position needs to be updated if the positioning limiter is within the scrolled element.
  78539. const isLimiterWithinScrollTarget = limiterElement && scrollTarget.contains( limiterElement );
  78540. // The positioning target and/or limiter can be a Rect, object etc..
  78541. // There's no way to optimize the listener then.
  78542. if ( isWithinScrollTarget || isLimiterWithinScrollTarget || !targetElement || !limiterElement ) {
  78543. this.attachTo( options );
  78544. }
  78545. }, { useCapture: true } );
  78546. // We need to listen on window resize event and update position.
  78547. this.listenTo( _ckeditor_ckeditor5_utils_src_dom_global__WEBPACK_IMPORTED_MODULE_4__["default"].window, 'resize', () => {
  78548. this.attachTo( options );
  78549. } );
  78550. }
  78551. /**
  78552. * Stops managing the pinned state of the panel. See {@link #pin}.
  78553. *
  78554. * @private
  78555. */
  78556. _stopPinning() {
  78557. this.stopListening( _ckeditor_ckeditor5_utils_src_dom_global__WEBPACK_IMPORTED_MODULE_4__["default"].document, 'scroll' );
  78558. this.stopListening( _ckeditor_ckeditor5_utils_src_dom_global__WEBPACK_IMPORTED_MODULE_4__["default"].window, 'resize' );
  78559. }
  78560. }
  78561. // Returns the DOM element for given object or null, if there is none,
  78562. // e.g. when the passed object is a Rect instance or so.
  78563. //
  78564. // @private
  78565. // @param {*} object
  78566. // @returns {HTMLElement|null}
  78567. function getDomElement( object ) {
  78568. if ( Object(lodash_es__WEBPACK_IMPORTED_MODULE_5__["isElement"])( object ) ) {
  78569. return object;
  78570. }
  78571. if ( Object(_ckeditor_ckeditor5_utils_src_dom_isrange__WEBPACK_IMPORTED_MODULE_2__["default"])( object ) ) {
  78572. return object.commonAncestorContainer;
  78573. }
  78574. if ( typeof object == 'function' ) {
  78575. return getDomElement( object() );
  78576. }
  78577. return null;
  78578. }
  78579. /**
  78580. * A horizontal offset of the arrow tip from the edge of the balloon. Controlled by CSS.
  78581. *
  78582. * +-----|---------...
  78583. * | |
  78584. * | |
  78585. * | |
  78586. * | |
  78587. * +--+ | +------...
  78588. * \ | /
  78589. * \|/
  78590. * >|-----|<---------------- horizontal offset
  78591. *
  78592. * @default 30
  78593. * @member {Number} module:ui/panel/balloon/balloonpanelview~BalloonPanelView.arrowHorizontalOffset
  78594. */
  78595. BalloonPanelView.arrowHorizontalOffset = 25;
  78596. /**
  78597. * A vertical offset of the arrow from the edge of the balloon. Controlled by CSS.
  78598. *
  78599. * +-------------...
  78600. * |
  78601. * |
  78602. * | /-- vertical offset
  78603. * | V
  78604. * +--+ +-----... ---------
  78605. * \ / |
  78606. * \/ |
  78607. * -------------------------------
  78608. * ^
  78609. *
  78610. * @default 15
  78611. * @member {Number} module:ui/panel/balloon/balloonpanelview~BalloonPanelView.arrowVerticalOffset
  78612. */
  78613. BalloonPanelView.arrowVerticalOffset = 10;
  78614. /**
  78615. * Function used to calculate the optimal position for the balloon.
  78616. *
  78617. * @protected
  78618. * @member {Function} module:ui/panel/balloon/balloonpanelview~BalloonPanelView._getOptimalPosition
  78619. */
  78620. BalloonPanelView._getOptimalPosition = _ckeditor_ckeditor5_utils_src_dom_position__WEBPACK_IMPORTED_MODULE_1__["getOptimalPosition"];
  78621. /**
  78622. * A default set of positioning functions used by the balloon panel view
  78623. * when attaching using the {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView#attachTo} method.
  78624. *
  78625. * The available positioning functions are as follows:
  78626. *
  78627. *
  78628. *
  78629. * **North west**
  78630. *
  78631. * * `northWestArrowSouthWest`
  78632. *
  78633. * +-----------------+
  78634. * | Balloon |
  78635. * +-----------------+
  78636. * V
  78637. * [ Target ]
  78638. *
  78639. * * `northWestArrowSouthMiddleWest`
  78640. *
  78641. * +-----------------+
  78642. * | Balloon |
  78643. * +-----------------+
  78644. * V
  78645. * [ Target ]
  78646. *
  78647. * * `northWestArrowSouth`
  78648. *
  78649. * +-----------------+
  78650. * | Balloon |
  78651. * +-----------------+
  78652. * V
  78653. * [ Target ]
  78654. *
  78655. * * `northWestArrowSouthMiddleEast`
  78656. *
  78657. * +-----------------+
  78658. * | Balloon |
  78659. * +-----------------+
  78660. * V
  78661. * [ Target ]
  78662. *
  78663. * * `northWestArrowSouthEast`
  78664. *
  78665. * +-----------------+
  78666. * | Balloon |
  78667. * +-----------------+
  78668. * V
  78669. * [ Target ]
  78670. *
  78671. *
  78672. *
  78673. * **North**
  78674. *
  78675. * * `northArrowSouthWest`
  78676. *
  78677. * +-----------------+
  78678. * | Balloon |
  78679. * +-----------------+
  78680. * V
  78681. * [ Target ]
  78682. *
  78683. * * `northArrowSouthMiddleWest`
  78684. *
  78685. * +-----------------+
  78686. * | Balloon |
  78687. * +-----------------+
  78688. * V
  78689. * [ Target ]
  78690. *
  78691. * * `northArrowSouth`
  78692. *
  78693. * +-----------------+
  78694. * | Balloon |
  78695. * +-----------------+
  78696. * V
  78697. * [ Target ]
  78698. *
  78699. * * `northArrowSouthMiddleEast`
  78700. *
  78701. * +-----------------+
  78702. * | Balloon |
  78703. * +-----------------+
  78704. * V
  78705. * [ Target ]
  78706. *
  78707. * * `northArrowSouthEast`
  78708. *
  78709. * +-----------------+
  78710. * | Balloon |
  78711. * +-----------------+
  78712. * V
  78713. * [ Target ]
  78714. *
  78715. * **North east**
  78716. *
  78717. * * `northEastArrowSouthWest`
  78718. *
  78719. * +-----------------+
  78720. * | Balloon |
  78721. * +-----------------+
  78722. * V
  78723. * [ Target ]
  78724. *
  78725. *
  78726. * * `northEastArrowSouthMiddleWest`
  78727. *
  78728. * +-----------------+
  78729. * | Balloon |
  78730. * +-----------------+
  78731. * V
  78732. * [ Target ]
  78733. *
  78734. * * `northEastArrowSouth`
  78735. *
  78736. * +-----------------+
  78737. * | Balloon |
  78738. * +-----------------+
  78739. * V
  78740. * [ Target ]
  78741. *
  78742. * * `northEastArrowSouthMiddleEast`
  78743. *
  78744. * +-----------------+
  78745. * | Balloon |
  78746. * +-----------------+
  78747. * V
  78748. * [ Target ]
  78749. *
  78750. * * `northEastArrowSouthEast`
  78751. *
  78752. * +-----------------+
  78753. * | Balloon |
  78754. * +-----------------+
  78755. * V
  78756. * [ Target ]
  78757. *
  78758. *
  78759. *
  78760. * **South**
  78761. *
  78762. *
  78763. * * `southArrowNorthWest`
  78764. *
  78765. * [ Target ]
  78766. * ^
  78767. * +-----------------+
  78768. * | Balloon |
  78769. * +-----------------+
  78770. *
  78771. * * `southArrowNorthMiddleWest`
  78772. *
  78773. * [ Target ]
  78774. * ^
  78775. * +-----------------+
  78776. * | Balloon |
  78777. * +-----------------+
  78778. *
  78779. * * `southArrowNorth`
  78780. *
  78781. * [ Target ]
  78782. * ^
  78783. * +-----------------+
  78784. * | Balloon |
  78785. * +-----------------+
  78786. *
  78787. * * `southArrowNorthMiddleEast`
  78788. *
  78789. * [ Target ]
  78790. * ^
  78791. * +-----------------+
  78792. * | Balloon |
  78793. * +-----------------+
  78794. *
  78795. * * `southArrowNorthEast`
  78796. *
  78797. * [ Target ]
  78798. * ^
  78799. * +-----------------+
  78800. * | Balloon |
  78801. * +-----------------+
  78802. *
  78803. *
  78804. *
  78805. * **South west**
  78806. *
  78807. * * `southWestArrowNorthWest`
  78808. *
  78809. * [ Target ]
  78810. * ^
  78811. * +-----------------+
  78812. * | Balloon |
  78813. * +-----------------+
  78814. *
  78815. * * `southWestArrowNorthMiddleWest`
  78816. *
  78817. * [ Target ]
  78818. * ^
  78819. * +-----------------+
  78820. * | Balloon |
  78821. * +-----------------+
  78822. *
  78823. * * `southWestArrowNorth`
  78824. *
  78825. * [ Target ]
  78826. * ^
  78827. * +-----------------+
  78828. * | Balloon |
  78829. * +-----------------+
  78830. *
  78831. * * `southWestArrowNorthMiddleEast`
  78832. *
  78833. * [ Target ]
  78834. * ^
  78835. * +-----------------+
  78836. * | Balloon |
  78837. * +-----------------+
  78838. *
  78839. * * `southWestArrowNorthEast`
  78840. *
  78841. * [ Target ]
  78842. * ^
  78843. * +-----------------+
  78844. * | Balloon |
  78845. * +-----------------+
  78846. *
  78847. *
  78848. *
  78849. * **South east**
  78850. *
  78851. * * `southEastArrowNorthWest`
  78852. *
  78853. * [ Target ]
  78854. * ^
  78855. * +-----------------+
  78856. * | Balloon |
  78857. * +-----------------+
  78858. * * `southEastArrowNorthMiddleWest`
  78859. *
  78860. * [ Target ]
  78861. * ^
  78862. * +-----------------+
  78863. * | Balloon |
  78864. * +-----------------+
  78865. *
  78866. * * `southEastArrowNorth`
  78867. *
  78868. * [ Target ]
  78869. * ^
  78870. * +-----------------+
  78871. * | Balloon |
  78872. * +-----------------+
  78873. *
  78874. * * `southEastArrowNorthMiddleEast`
  78875. *
  78876. * [ Target ]
  78877. * ^
  78878. * +-----------------+
  78879. * | Balloon |
  78880. * +-----------------+
  78881. *
  78882. * * `southEastArrowNorthEast`
  78883. *
  78884. * [ Target ]
  78885. * ^
  78886. * +-----------------+
  78887. * | Balloon |
  78888. * +-----------------+
  78889. *
  78890. *
  78891. * See {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView#attachTo}.
  78892. *
  78893. * Positioning functions must be compatible with {@link module:utils/dom/position~Position}.
  78894. *
  78895. * The name that the position function returns will be reflected in the balloon panel's class that
  78896. * controls the placement of the "arrow". See {@link #position} to learn more.
  78897. *
  78898. * @member {Object} module:ui/panel/balloon/balloonpanelview~BalloonPanelView.defaultPositions
  78899. */
  78900. BalloonPanelView.defaultPositions = {
  78901. // ------- North west
  78902. northWestArrowSouthWest: ( targetRect, balloonRect ) => ( {
  78903. top: getNorthTop( targetRect, balloonRect ),
  78904. left: targetRect.left - BalloonPanelView.arrowHorizontalOffset,
  78905. name: 'arrow_sw'
  78906. } ),
  78907. northWestArrowSouthMiddleWest: ( targetRect, balloonRect ) => ( {
  78908. top: getNorthTop( targetRect, balloonRect ),
  78909. left: targetRect.left - ( balloonRect.width * .25 ) - BalloonPanelView.arrowHorizontalOffset,
  78910. name: 'arrow_smw'
  78911. } ),
  78912. northWestArrowSouth: ( targetRect, balloonRect ) => ( {
  78913. top: getNorthTop( targetRect, balloonRect ),
  78914. left: targetRect.left - balloonRect.width / 2,
  78915. name: 'arrow_s'
  78916. } ),
  78917. northWestArrowSouthMiddleEast: ( targetRect, balloonRect ) => ( {
  78918. top: getNorthTop( targetRect, balloonRect ),
  78919. left: targetRect.left - ( balloonRect.width * .75 ) + BalloonPanelView.arrowHorizontalOffset,
  78920. name: 'arrow_sme'
  78921. } ),
  78922. northWestArrowSouthEast: ( targetRect, balloonRect ) => ( {
  78923. top: getNorthTop( targetRect, balloonRect ),
  78924. left: targetRect.left - balloonRect.width + BalloonPanelView.arrowHorizontalOffset,
  78925. name: 'arrow_se'
  78926. } ),
  78927. // ------- North
  78928. northArrowSouthWest: ( targetRect, balloonRect ) => ( {
  78929. top: getNorthTop( targetRect, balloonRect ),
  78930. left: targetRect.left + targetRect.width / 2 - BalloonPanelView.arrowHorizontalOffset,
  78931. name: 'arrow_sw'
  78932. } ),
  78933. northArrowSouthMiddleWest: ( targetRect, balloonRect ) => ( {
  78934. top: getNorthTop( targetRect, balloonRect ),
  78935. left: targetRect.left + targetRect.width / 2 - ( balloonRect.width * .25 ) - BalloonPanelView.arrowHorizontalOffset,
  78936. name: 'arrow_smw'
  78937. } ),
  78938. northArrowSouth: ( targetRect, balloonRect ) => ( {
  78939. top: getNorthTop( targetRect, balloonRect ),
  78940. left: targetRect.left + targetRect.width / 2 - balloonRect.width / 2,
  78941. name: 'arrow_s'
  78942. } ),
  78943. northArrowSouthMiddleEast: ( targetRect, balloonRect ) => ( {
  78944. top: getNorthTop( targetRect, balloonRect ),
  78945. left: targetRect.left + targetRect.width / 2 - ( balloonRect.width * .75 ) + BalloonPanelView.arrowHorizontalOffset,
  78946. name: 'arrow_sme'
  78947. } ),
  78948. northArrowSouthEast: ( targetRect, balloonRect ) => ( {
  78949. top: getNorthTop( targetRect, balloonRect ),
  78950. left: targetRect.left + targetRect.width / 2 - balloonRect.width + BalloonPanelView.arrowHorizontalOffset,
  78951. name: 'arrow_se'
  78952. } ),
  78953. // ------- North east
  78954. northEastArrowSouthWest: ( targetRect, balloonRect ) => ( {
  78955. top: getNorthTop( targetRect, balloonRect ),
  78956. left: targetRect.right - BalloonPanelView.arrowHorizontalOffset,
  78957. name: 'arrow_sw'
  78958. } ),
  78959. northEastArrowSouthMiddleWest: ( targetRect, balloonRect ) => ( {
  78960. top: getNorthTop( targetRect, balloonRect ),
  78961. left: targetRect.right - ( balloonRect.width * .25 ) - BalloonPanelView.arrowHorizontalOffset,
  78962. name: 'arrow_smw'
  78963. } ),
  78964. northEastArrowSouth: ( targetRect, balloonRect ) => ( {
  78965. top: getNorthTop( targetRect, balloonRect ),
  78966. left: targetRect.right - balloonRect.width / 2,
  78967. name: 'arrow_s'
  78968. } ),
  78969. northEastArrowSouthMiddleEast: ( targetRect, balloonRect ) => ( {
  78970. top: getNorthTop( targetRect, balloonRect ),
  78971. left: targetRect.right - ( balloonRect.width * .75 ) + BalloonPanelView.arrowHorizontalOffset,
  78972. name: 'arrow_sme'
  78973. } ),
  78974. northEastArrowSouthEast: ( targetRect, balloonRect ) => ( {
  78975. top: getNorthTop( targetRect, balloonRect ),
  78976. left: targetRect.right - balloonRect.width + BalloonPanelView.arrowHorizontalOffset,
  78977. name: 'arrow_se'
  78978. } ),
  78979. // ------- South west
  78980. southWestArrowNorthWest: ( targetRect, balloonRect ) => ( {
  78981. top: getSouthTop( targetRect, balloonRect ),
  78982. left: targetRect.left - BalloonPanelView.arrowHorizontalOffset,
  78983. name: 'arrow_nw'
  78984. } ),
  78985. southWestArrowNorthMiddleWest: ( targetRect, balloonRect ) => ( {
  78986. top: getSouthTop( targetRect, balloonRect ),
  78987. left: targetRect.left - ( balloonRect.width * .25 ) - BalloonPanelView.arrowHorizontalOffset,
  78988. name: 'arrow_nmw'
  78989. } ),
  78990. southWestArrowNorth: ( targetRect, balloonRect ) => ( {
  78991. top: getSouthTop( targetRect, balloonRect ),
  78992. left: targetRect.left - balloonRect.width / 2,
  78993. name: 'arrow_n'
  78994. } ),
  78995. southWestArrowNorthMiddleEast: ( targetRect, balloonRect ) => ( {
  78996. top: getSouthTop( targetRect, balloonRect ),
  78997. left: targetRect.left - ( balloonRect.width * .75 ) + BalloonPanelView.arrowHorizontalOffset,
  78998. name: 'arrow_nme'
  78999. } ),
  79000. southWestArrowNorthEast: ( targetRect, balloonRect ) => ( {
  79001. top: getSouthTop( targetRect, balloonRect ),
  79002. left: targetRect.left - balloonRect.width + BalloonPanelView.arrowHorizontalOffset,
  79003. name: 'arrow_ne'
  79004. } ),
  79005. // ------- South
  79006. southArrowNorthWest: ( targetRect, balloonRect ) => ( {
  79007. top: getSouthTop( targetRect, balloonRect ),
  79008. left: targetRect.left + targetRect.width / 2 - BalloonPanelView.arrowHorizontalOffset,
  79009. name: 'arrow_nw'
  79010. } ),
  79011. southArrowNorthMiddleWest: ( targetRect, balloonRect ) => ( {
  79012. top: getSouthTop( targetRect, balloonRect ),
  79013. left: targetRect.left + targetRect.width / 2 - ( balloonRect.width * 0.25 ) - BalloonPanelView.arrowHorizontalOffset,
  79014. name: 'arrow_nmw'
  79015. } ),
  79016. southArrowNorth: ( targetRect, balloonRect ) => ( {
  79017. top: getSouthTop( targetRect, balloonRect ),
  79018. left: targetRect.left + targetRect.width / 2 - balloonRect.width / 2,
  79019. name: 'arrow_n'
  79020. } ),
  79021. southArrowNorthMiddleEast: ( targetRect, balloonRect ) => ( {
  79022. top: getSouthTop( targetRect, balloonRect ),
  79023. left: targetRect.left + targetRect.width / 2 - ( balloonRect.width * 0.75 ) + BalloonPanelView.arrowHorizontalOffset,
  79024. name: 'arrow_nme'
  79025. } ),
  79026. southArrowNorthEast: ( targetRect, balloonRect ) => ( {
  79027. top: getSouthTop( targetRect, balloonRect ),
  79028. left: targetRect.left + targetRect.width / 2 - balloonRect.width + BalloonPanelView.arrowHorizontalOffset,
  79029. name: 'arrow_ne'
  79030. } ),
  79031. // ------- South east
  79032. southEastArrowNorthWest: ( targetRect, balloonRect ) => ( {
  79033. top: getSouthTop( targetRect, balloonRect ),
  79034. left: targetRect.right - BalloonPanelView.arrowHorizontalOffset,
  79035. name: 'arrow_nw'
  79036. } ),
  79037. southEastArrowNorthMiddleWest: ( targetRect, balloonRect ) => ( {
  79038. top: getSouthTop( targetRect, balloonRect ),
  79039. left: targetRect.right - ( balloonRect.width * .25 ) - BalloonPanelView.arrowHorizontalOffset,
  79040. name: 'arrow_nmw'
  79041. } ),
  79042. southEastArrowNorth: ( targetRect, balloonRect ) => ( {
  79043. top: getSouthTop( targetRect, balloonRect ),
  79044. left: targetRect.right - balloonRect.width / 2,
  79045. name: 'arrow_n'
  79046. } ),
  79047. southEastArrowNorthMiddleEast: ( targetRect, balloonRect ) => ( {
  79048. top: getSouthTop( targetRect, balloonRect ),
  79049. left: targetRect.right - ( balloonRect.width * .75 ) + BalloonPanelView.arrowHorizontalOffset,
  79050. name: 'arrow_nme'
  79051. } ),
  79052. southEastArrowNorthEast: ( targetRect, balloonRect ) => ( {
  79053. top: getSouthTop( targetRect, balloonRect ),
  79054. left: targetRect.right - balloonRect.width + BalloonPanelView.arrowHorizontalOffset,
  79055. name: 'arrow_ne'
  79056. } )
  79057. };
  79058. // Returns the top coordinate for positions starting with `north*`.
  79059. //
  79060. // @private
  79061. // @param {utils/dom/rect~Rect} targetRect A rect of the target.
  79062. // @param {utils/dom/rect~Rect} elementRect A rect of the balloon.
  79063. // @returns {Number}
  79064. function getNorthTop( targetRect, balloonRect ) {
  79065. return targetRect.top - balloonRect.height - BalloonPanelView.arrowVerticalOffset;
  79066. }
  79067. // Returns the top coordinate for positions starting with `south*`.
  79068. //
  79069. // @private
  79070. // @param {utils/dom/rect~Rect} targetRect A rect of the target.
  79071. // @param {utils/dom/rect~Rect} elementRect A rect of the balloon.
  79072. // @returns {Number}
  79073. function getSouthTop( targetRect ) {
  79074. return targetRect.bottom + BalloonPanelView.arrowVerticalOffset;
  79075. }
  79076. /***/ }),
  79077. /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/panel/balloon/contextualballoon.js":
  79078. /*!************************************************************************************!*\
  79079. !*** ./node_modules/@ckeditor/ckeditor5-ui/src/panel/balloon/contextualballoon.js ***!
  79080. \************************************************************************************/
  79081. /*! exports provided: default */
  79082. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  79083. "use strict";
  79084. __webpack_require__.r(__webpack_exports__);
  79085. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ContextualBalloon; });
  79086. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  79087. /* harmony import */ var _balloonpanelview__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./balloonpanelview */ "./node_modules/@ckeditor/ckeditor5-ui/src/panel/balloon/balloonpanelview.js");
  79088. /* harmony import */ var _view__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../view */ "./node_modules/@ckeditor/ckeditor5-ui/src/view.js");
  79089. /* harmony import */ var _button_buttonview__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../button/buttonview */ "./node_modules/@ckeditor/ckeditor5-ui/src/button/buttonview.js");
  79090. /* 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");
  79091. /* 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");
  79092. /* 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");
  79093. /* 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");
  79094. /* 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");
  79095. /* 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");
  79096. /* 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");
  79097. /* 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__);
  79098. /* 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");
  79099. /* 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__);
  79100. /**
  79101. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  79102. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  79103. */
  79104. /**
  79105. * @module ui/panel/balloon/contextualballoon
  79106. */
  79107. const toPx = Object(_ckeditor_ckeditor5_utils_src_dom_tounit__WEBPACK_IMPORTED_MODULE_6__["default"])( 'px' );
  79108. /**
  79109. * Provides the common contextual balloon for the editor.
  79110. *
  79111. * The role of this plugin is to unify the contextual balloons logic, simplify views management and help
  79112. * avoid the unnecessary complexity of handling multiple {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView}
  79113. * instances in the editor.
  79114. *
  79115. * This plugin allows for creating single or multiple panel stacks.
  79116. *
  79117. * Each stack may have multiple views, with the one on the top being visible. When the visible view is removed from the stack,
  79118. * the previous view becomes visible.
  79119. *
  79120. * It might be useful to implement nested navigation in a balloon. For instance, a toolbar view may contain a link button.
  79121. * 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
  79122. * is displayed. When you finish editing the link and close (remove) the link view, the toolbar view is visible again.
  79123. *
  79124. * However, there are cases when there are multiple independent balloons to be displayed, for instance, if the selection
  79125. * is inside two inline comments at the same time. For such cases, you can create two independent panel stacks.
  79126. * The contextual balloon plugin will create a navigation bar to let the users switch between these panel stacks using the "Next"
  79127. * and "Previous" buttons.
  79128. *
  79129. * If there are no views in the current stack, the balloon panel will try to switch to the next stack. If there are no
  79130. * panels in any stack, the balloon panel will be hidden.
  79131. *
  79132. * **Note**: To force the balloon panel to show only one view, even if there are other stacks, use the `singleViewMode=true` option
  79133. * when {@link module:ui/panel/balloon/contextualballoon~ContextualBalloon#add adding} a view to a panel.
  79134. *
  79135. * From the implementation point of view, the contextual ballon plugin is reusing a single
  79136. * {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView} instance to display multiple contextual balloon
  79137. * panels in the editor. It also creates a special {@link module:ui/panel/balloon/contextualballoon~RotatorView rotator view},
  79138. * used to manage multiple panel stacks. Rotator view is a child of the balloon panel view and the parent of the specific
  79139. * view you want to display. If there is more than one panel stack to be displayed, the rotator view will add a
  79140. * navigation bar. If there is only one stack, the rotator view is transparent (it does not add any UI elements).
  79141. *
  79142. * @extends module:core/plugin~Plugin
  79143. */
  79144. class ContextualBalloon extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  79145. /**
  79146. * @inheritDoc
  79147. */
  79148. static get pluginName() {
  79149. return 'ContextualBalloon';
  79150. }
  79151. /**
  79152. * @inheritDoc
  79153. */
  79154. constructor( editor ) {
  79155. super( editor );
  79156. /**
  79157. * The {@link module:utils/dom/position~Options#limiter position limiter}
  79158. * for the {@link #view balloon}, used when no `limiter` has been passed into {@link #add}
  79159. * or {@link #updatePosition}.
  79160. *
  79161. * By default, a function that obtains the farthest DOM
  79162. * {@link module:engine/view/rooteditableelement~RootEditableElement}
  79163. * of the {@link module:engine/view/document~Document#selection}.
  79164. *
  79165. * @member {module:utils/dom/position~Options#limiter} #positionLimiter
  79166. */
  79167. this.positionLimiter = () => {
  79168. const view = this.editor.editing.view;
  79169. const viewDocument = view.document;
  79170. const editableElement = viewDocument.selection.editableElement;
  79171. if ( editableElement ) {
  79172. return view.domConverter.mapViewToDom( editableElement.root );
  79173. }
  79174. return null;
  79175. };
  79176. /**
  79177. * The currently visible view or `null` when there are no views in any stack.
  79178. *
  79179. * @readonly
  79180. * @observable
  79181. * @member {module:ui/view~View|null} #visibleView
  79182. */
  79183. this.set( 'visibleView', null );
  79184. /**
  79185. * The common balloon panel view.
  79186. *
  79187. * @readonly
  79188. * @member {module:ui/panel/balloon/balloonpanelview~BalloonPanelView} #view
  79189. */
  79190. this.view = new _balloonpanelview__WEBPACK_IMPORTED_MODULE_1__["default"]( editor.locale );
  79191. editor.ui.view.body.add( this.view );
  79192. editor.ui.focusTracker.add( this.view.element );
  79193. /**
  79194. * The map of views and their stacks.
  79195. *
  79196. * @private
  79197. * @type {Map.<module:ui/view~View,Set>}
  79198. */
  79199. this._viewToStack = new Map();
  79200. /**
  79201. * The map of IDs and stacks.
  79202. *
  79203. * @private
  79204. * @type {Map.<String,Set>}
  79205. */
  79206. this._idToStack = new Map();
  79207. /**
  79208. * A total number of all stacks in the balloon.
  79209. *
  79210. * @private
  79211. * @readonly
  79212. * @observable
  79213. * @member {Number} #_numberOfStacks
  79214. */
  79215. this.set( '_numberOfStacks', 0 );
  79216. /**
  79217. * A flag that controls the single view mode.
  79218. *
  79219. * @private
  79220. * @readonly
  79221. * @observable
  79222. * @member {Boolean} #_singleViewMode
  79223. */
  79224. this.set( '_singleViewMode', false );
  79225. /**
  79226. * Rotator view embedded in the contextual balloon.
  79227. * Displays the currently visible view in the balloon and provides navigation for switching stacks.
  79228. *
  79229. * @private
  79230. * @type {module:ui/panel/balloon/contextualballoon~RotatorView}
  79231. */
  79232. this._rotatorView = this._createRotatorView();
  79233. /**
  79234. * Displays fake panels under the balloon panel view when multiple stacks are added to the balloon.
  79235. *
  79236. * @private
  79237. * @type {module:ui/view~View}
  79238. */
  79239. this._fakePanelsView = this._createFakePanelsView();
  79240. }
  79241. /**
  79242. * Returns `true` when the given view is in one of the stacks. Otherwise returns `false`.
  79243. *
  79244. * @param {module:ui/view~View} view
  79245. * @returns {Boolean}
  79246. */
  79247. hasView( view ) {
  79248. return Array.from( this._viewToStack.keys() ).includes( view );
  79249. }
  79250. /**
  79251. * Adds a new view to the stack and makes it visible if the current stack is visible
  79252. * or it is the first view in the balloon.
  79253. *
  79254. * @param {Object} data The configuration of the view.
  79255. * @param {String} [data.stackId='main'] The ID of the stack that the view is added to.
  79256. * @param {module:ui/view~View} [data.view] The content of the balloon.
  79257. * @param {module:utils/dom/position~Options} [data.position] Positioning options.
  79258. * @param {String} [data.balloonClassName] An additional CSS class added to the {@link #view balloon} when visible.
  79259. * @param {Boolean} [data.withArrow=true] Whether the {@link #view balloon} should be rendered with an arrow.
  79260. * @param {Boolean} [data.singleViewMode=false] Whether the view should be the only visible view even if other stacks were added.
  79261. */
  79262. add( data ) {
  79263. if ( this.hasView( data.view ) ) {
  79264. /**
  79265. * Trying to add configuration of the same view more than once.
  79266. *
  79267. * @error contextualballoon-add-view-exist
  79268. */
  79269. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_4__["default"](
  79270. 'contextualballoon-add-view-exist',
  79271. [ this, data ]
  79272. );
  79273. }
  79274. const stackId = data.stackId || 'main';
  79275. // If new stack is added, creates it and show view from this stack.
  79276. if ( !this._idToStack.has( stackId ) ) {
  79277. this._idToStack.set( stackId, new Map( [ [ data.view, data ] ] ) );
  79278. this._viewToStack.set( data.view, this._idToStack.get( stackId ) );
  79279. this._numberOfStacks = this._idToStack.size;
  79280. if ( !this._visibleStack || data.singleViewMode ) {
  79281. this.showStack( stackId );
  79282. }
  79283. return;
  79284. }
  79285. const stack = this._idToStack.get( stackId );
  79286. if ( data.singleViewMode ) {
  79287. this.showStack( stackId );
  79288. }
  79289. // Add new view to the stack.
  79290. stack.set( data.view, data );
  79291. this._viewToStack.set( data.view, stack );
  79292. // And display it if is added to the currently visible stack.
  79293. if ( stack === this._visibleStack ) {
  79294. this._showView( data );
  79295. }
  79296. }
  79297. /**
  79298. * Removes the given view from the stack. If the removed view was visible,
  79299. * the view preceding it in the stack will become visible instead.
  79300. * When there is no view in the stack, the next stack will be displayed.
  79301. * When there are no more stacks, the balloon will hide.
  79302. *
  79303. * @param {module:ui/view~View} view A view to be removed from the balloon.
  79304. */
  79305. remove( view ) {
  79306. if ( !this.hasView( view ) ) {
  79307. /**
  79308. * Trying to remove the configuration of the view not defined in the stack.
  79309. *
  79310. * @error contextualballoon-remove-view-not-exist
  79311. */
  79312. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_4__["default"](
  79313. 'contextualballoon-remove-view-not-exist',
  79314. [ this, view ]
  79315. );
  79316. }
  79317. const stack = this._viewToStack.get( view );
  79318. if ( this._singleViewMode && this.visibleView === view ) {
  79319. this._singleViewMode = false;
  79320. }
  79321. // When visible view will be removed we need to show a preceding view or next stack
  79322. // if a view is the only view in the stack.
  79323. if ( this.visibleView === view ) {
  79324. if ( stack.size === 1 ) {
  79325. if ( this._idToStack.size > 1 ) {
  79326. this._showNextStack();
  79327. } else {
  79328. this.view.hide();
  79329. this.visibleView = null;
  79330. this._rotatorView.hideView();
  79331. }
  79332. } else {
  79333. this._showView( Array.from( stack.values() )[ stack.size - 2 ] );
  79334. }
  79335. }
  79336. if ( stack.size === 1 ) {
  79337. this._idToStack.delete( this._getStackId( stack ) );
  79338. this._numberOfStacks = this._idToStack.size;
  79339. } else {
  79340. stack.delete( view );
  79341. }
  79342. this._viewToStack.delete( view );
  79343. }
  79344. /**
  79345. * Updates the position of the balloon using the position data of the first visible view in the stack.
  79346. * When new position data is given, the position data of the currently visible view will be updated.
  79347. *
  79348. * @param {module:utils/dom/position~Options} [position] position options.
  79349. */
  79350. updatePosition( position ) {
  79351. if ( position ) {
  79352. this._visibleStack.get( this.visibleView ).position = position;
  79353. }
  79354. this.view.pin( this._getBalloonPosition() );
  79355. this._fakePanelsView.updatePosition();
  79356. }
  79357. /**
  79358. * Shows the last view from the stack of a given ID.
  79359. *
  79360. * @param {String} id
  79361. */
  79362. showStack( id ) {
  79363. this.visibleStack = id;
  79364. const stack = this._idToStack.get( id );
  79365. if ( !stack ) {
  79366. /**
  79367. * Trying to show a stack that does not exist.
  79368. *
  79369. * @error contextualballoon-showstack-stack-not-exist
  79370. */
  79371. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_4__["default"](
  79372. 'contextualballoon-showstack-stack-not-exist',
  79373. this
  79374. );
  79375. }
  79376. if ( this._visibleStack === stack ) {
  79377. return;
  79378. }
  79379. this._showView( Array.from( stack.values() ).pop() );
  79380. }
  79381. /**
  79382. * Returns the stack of the currently visible view.
  79383. *
  79384. * @private
  79385. * @type {Set}
  79386. */
  79387. get _visibleStack() {
  79388. return this._viewToStack.get( this.visibleView );
  79389. }
  79390. /**
  79391. * Returns the ID of the given stack.
  79392. *
  79393. * @private
  79394. * @param {Set} stack
  79395. * @returns {String}
  79396. */
  79397. _getStackId( stack ) {
  79398. const entry = Array.from( this._idToStack.entries() ).find( entry => entry[ 1 ] === stack );
  79399. return entry[ 0 ];
  79400. }
  79401. /**
  79402. * Shows the last view from the next stack.
  79403. *
  79404. * @private
  79405. */
  79406. _showNextStack() {
  79407. const stacks = Array.from( this._idToStack.values() );
  79408. let nextIndex = stacks.indexOf( this._visibleStack ) + 1;
  79409. if ( !stacks[ nextIndex ] ) {
  79410. nextIndex = 0;
  79411. }
  79412. this.showStack( this._getStackId( stacks[ nextIndex ] ) );
  79413. }
  79414. /**
  79415. * Shows the last view from the previous stack.
  79416. *
  79417. * @private
  79418. */
  79419. _showPrevStack() {
  79420. const stacks = Array.from( this._idToStack.values() );
  79421. let nextIndex = stacks.indexOf( this._visibleStack ) - 1;
  79422. if ( !stacks[ nextIndex ] ) {
  79423. nextIndex = stacks.length - 1;
  79424. }
  79425. this.showStack( this._getStackId( stacks[ nextIndex ] ) );
  79426. }
  79427. /**
  79428. * Creates a rotator view.
  79429. *
  79430. * @private
  79431. * @returns {module:ui/panel/balloon/contextualballoon~RotatorView}
  79432. */
  79433. _createRotatorView() {
  79434. const view = new RotatorView( this.editor.locale );
  79435. const t = this.editor.locale.t;
  79436. this.view.content.add( view );
  79437. // Hide navigation when there is only a one stack & not in single view mode.
  79438. view.bind( 'isNavigationVisible' ).to( this, '_numberOfStacks', this, '_singleViewMode', ( value, isSingleViewMode ) => {
  79439. return !isSingleViewMode && value > 1;
  79440. } );
  79441. // Update balloon position after toggling navigation.
  79442. view.on( 'change:isNavigationVisible', () => ( this.updatePosition() ), { priority: 'low' } );
  79443. // Update stacks counter value.
  79444. view.bind( 'counter' ).to( this, 'visibleView', this, '_numberOfStacks', ( visibleView, numberOfStacks ) => {
  79445. if ( numberOfStacks < 2 ) {
  79446. return '';
  79447. }
  79448. const current = Array.from( this._idToStack.values() ).indexOf( this._visibleStack ) + 1;
  79449. return t( '%0 of %1', [ current, numberOfStacks ] );
  79450. } );
  79451. view.buttonNextView.on( 'execute', () => {
  79452. // When current view has a focus then move focus to the editable before removing it,
  79453. // otherwise editor will lost focus.
  79454. if ( view.focusTracker.isFocused ) {
  79455. this.editor.editing.view.focus();
  79456. }
  79457. this._showNextStack();
  79458. } );
  79459. view.buttonPrevView.on( 'execute', () => {
  79460. // When current view has a focus then move focus to the editable before removing it,
  79461. // otherwise editor will lost focus.
  79462. if ( view.focusTracker.isFocused ) {
  79463. this.editor.editing.view.focus();
  79464. }
  79465. this._showPrevStack();
  79466. } );
  79467. return view;
  79468. }
  79469. /**
  79470. * @private
  79471. * @returns {module:ui/view~View}
  79472. */
  79473. _createFakePanelsView() {
  79474. const view = new FakePanelsView( this.editor.locale, this.view );
  79475. view.bind( 'numberOfPanels' ).to( this, '_numberOfStacks', this, '_singleViewMode', ( number, isSingleViewMode ) => {
  79476. const showPanels = !isSingleViewMode && number >= 2;
  79477. return showPanels ? Math.min( number - 1, 2 ) : 0;
  79478. } );
  79479. view.listenTo( this.view, 'change:top', () => view.updatePosition() );
  79480. view.listenTo( this.view, 'change:left', () => view.updatePosition() );
  79481. this.editor.ui.view.body.add( view );
  79482. return view;
  79483. }
  79484. /**
  79485. * Sets the view as the content of the balloon and attaches the balloon using position
  79486. * options of the first view.
  79487. *
  79488. * @private
  79489. * @param {Object} data Configuration.
  79490. * @param {module:ui/view~View} [data.view] The view to show in the balloon.
  79491. * @param {String} [data.balloonClassName=''] Additional class name which will be added to the {@link #view balloon}.
  79492. * @param {Boolean} [data.withArrow=true] Whether the {@link #view balloon} should be rendered with an arrow.
  79493. */
  79494. _showView( { view, balloonClassName = '', withArrow = true, singleViewMode = false } ) {
  79495. this.view.class = balloonClassName;
  79496. this.view.withArrow = withArrow;
  79497. this._rotatorView.showView( view );
  79498. this.visibleView = view;
  79499. this.view.pin( this._getBalloonPosition() );
  79500. this._fakePanelsView.updatePosition();
  79501. if ( singleViewMode ) {
  79502. this._singleViewMode = true;
  79503. }
  79504. }
  79505. /**
  79506. * Returns position options of the last view in the stack.
  79507. * This keeps the balloon in the same position when the view is changed.
  79508. *
  79509. * @private
  79510. * @returns {module:utils/dom/position~Options}
  79511. */
  79512. _getBalloonPosition() {
  79513. let position = Array.from( this._visibleStack.values() ).pop().position;
  79514. // Use the default limiter if none has been specified.
  79515. if ( position && !position.limiter ) {
  79516. // Don't modify the original options object.
  79517. position = Object.assign( {}, position, {
  79518. limiter: this.positionLimiter
  79519. } );
  79520. }
  79521. return position;
  79522. }
  79523. }
  79524. /**
  79525. * Rotator view is a helper class for the {@link module:ui/panel/balloon/contextualballoon~ContextualBalloon ContextualBalloon}.
  79526. * It is used for displaying the last view from the current stack and providing navigation buttons for switching stacks.
  79527. * See the {@link module:ui/panel/balloon/contextualballoon~ContextualBalloon ContextualBalloon} documentation to learn more.
  79528. *
  79529. * @extends module:ui/view~View
  79530. */
  79531. class RotatorView extends _view__WEBPACK_IMPORTED_MODULE_2__["default"] {
  79532. /**
  79533. * @inheritDoc
  79534. */
  79535. constructor( locale ) {
  79536. super( locale );
  79537. const t = locale.t;
  79538. const bind = this.bindTemplate;
  79539. /**
  79540. * Defines whether navigation is visible or not.
  79541. *
  79542. * @member {Boolean} #isNavigationVisible
  79543. */
  79544. this.set( 'isNavigationVisible', true );
  79545. /**
  79546. * Used for checking if a view is focused or not.
  79547. *
  79548. * @type {module:utils/focustracker~FocusTracker}
  79549. */
  79550. this.focusTracker = new _ckeditor_ckeditor5_utils_src_focustracker__WEBPACK_IMPORTED_MODULE_5__["default"]();
  79551. /**
  79552. * Navigation button for switching the stack to the previous one.
  79553. *
  79554. * @type {module:ui/button/buttonview~ButtonView}
  79555. */
  79556. this.buttonPrevView = this._createButtonView( t( 'Previous' ), _theme_icons_previous_arrow_svg__WEBPACK_IMPORTED_MODULE_8__["default"] );
  79557. /**
  79558. * Navigation button for switching the stack to the next one.
  79559. *
  79560. * @type {module:ui/button/buttonview~ButtonView}
  79561. */
  79562. this.buttonNextView = this._createButtonView( t( 'Next' ), _theme_icons_next_arrow_svg__WEBPACK_IMPORTED_MODULE_9__["default"] );
  79563. /**
  79564. * A collection of the child views that creates the rotator content.
  79565. *
  79566. * @readonly
  79567. * @type {module:ui/viewcollection~ViewCollection}
  79568. */
  79569. this.content = this.createCollection();
  79570. this.setTemplate( {
  79571. tag: 'div',
  79572. attributes: {
  79573. class: [
  79574. 'ck',
  79575. 'ck-balloon-rotator'
  79576. ],
  79577. 'z-index': '-1'
  79578. },
  79579. children: [
  79580. {
  79581. tag: 'div',
  79582. attributes: {
  79583. class: [
  79584. 'ck-balloon-rotator__navigation',
  79585. bind.to( 'isNavigationVisible', value => value ? '' : 'ck-hidden' )
  79586. ]
  79587. },
  79588. children: [
  79589. this.buttonPrevView,
  79590. {
  79591. tag: 'span',
  79592. attributes: {
  79593. class: [
  79594. 'ck-balloon-rotator__counter'
  79595. ]
  79596. },
  79597. children: [
  79598. {
  79599. text: bind.to( 'counter' )
  79600. }
  79601. ]
  79602. },
  79603. this.buttonNextView
  79604. ]
  79605. },
  79606. {
  79607. tag: 'div',
  79608. attributes: {
  79609. class: 'ck-balloon-rotator__content'
  79610. },
  79611. children: this.content
  79612. }
  79613. ]
  79614. } );
  79615. }
  79616. /**
  79617. * @inheritDoc
  79618. */
  79619. render() {
  79620. super.render();
  79621. this.focusTracker.add( this.element );
  79622. }
  79623. /**
  79624. * Shows a given view.
  79625. *
  79626. * @param {module:ui/view~View} view The view to show.
  79627. */
  79628. showView( view ) {
  79629. this.hideView();
  79630. this.content.add( view );
  79631. }
  79632. /**
  79633. * Hides the currently displayed view.
  79634. */
  79635. hideView() {
  79636. this.content.clear();
  79637. }
  79638. /**
  79639. * Creates a navigation button view.
  79640. *
  79641. * @private
  79642. * @param {String} label The button label.
  79643. * @param {String} icon The button icon.
  79644. * @returns {module:ui/button/buttonview~ButtonView}
  79645. */
  79646. _createButtonView( label, icon ) {
  79647. const view = new _button_buttonview__WEBPACK_IMPORTED_MODULE_3__["default"]( this.locale );
  79648. view.set( {
  79649. label,
  79650. icon,
  79651. tooltip: true
  79652. } );
  79653. return view;
  79654. }
  79655. }
  79656. // Displays additional layers under the balloon when multiple stacks are added to the balloon.
  79657. //
  79658. // @private
  79659. // @extends module:ui/view~View
  79660. class FakePanelsView extends _view__WEBPACK_IMPORTED_MODULE_2__["default"] {
  79661. // @inheritDoc
  79662. constructor( locale, balloonPanelView ) {
  79663. super( locale );
  79664. const bind = this.bindTemplate;
  79665. // Fake panels top offset.
  79666. //
  79667. // @observable
  79668. // @member {Number} #top
  79669. this.set( 'top', 0 );
  79670. // Fake panels left offset.
  79671. //
  79672. // @observable
  79673. // @member {Number} #left
  79674. this.set( 'left', 0 );
  79675. // Fake panels height.
  79676. //
  79677. // @observable
  79678. // @member {Number} #height
  79679. this.set( 'height', 0 );
  79680. // Fake panels width.
  79681. //
  79682. // @observable
  79683. // @member {Number} #width
  79684. this.set( 'width', 0 );
  79685. // Number of rendered fake panels.
  79686. //
  79687. // @observable
  79688. // @member {Number} #numberOfPanels
  79689. this.set( 'numberOfPanels', 0 );
  79690. // Collection of the child views which creates fake panel content.
  79691. //
  79692. // @readonly
  79693. // @type {module:ui/viewcollection~ViewCollection}
  79694. this.content = this.createCollection();
  79695. // Context.
  79696. //
  79697. // @private
  79698. // @type {module:ui/panel/balloon/balloonpanelview~BalloonPanelView}
  79699. this._balloonPanelView = balloonPanelView;
  79700. this.setTemplate( {
  79701. tag: 'div',
  79702. attributes: {
  79703. class: [
  79704. 'ck-fake-panel',
  79705. bind.to( 'numberOfPanels', number => number ? '' : 'ck-hidden' )
  79706. ],
  79707. style: {
  79708. top: bind.to( 'top', toPx ),
  79709. left: bind.to( 'left', toPx ),
  79710. width: bind.to( 'width', toPx ),
  79711. height: bind.to( 'height', toPx )
  79712. }
  79713. },
  79714. children: this.content
  79715. } );
  79716. this.on( 'change:numberOfPanels', ( evt, name, next, prev ) => {
  79717. if ( next > prev ) {
  79718. this._addPanels( next - prev );
  79719. } else {
  79720. this._removePanels( prev - next );
  79721. }
  79722. this.updatePosition();
  79723. } );
  79724. }
  79725. // @private
  79726. // @param {Number} number
  79727. _addPanels( number ) {
  79728. while ( number-- ) {
  79729. const view = new _view__WEBPACK_IMPORTED_MODULE_2__["default"]();
  79730. view.setTemplate( { tag: 'div' } );
  79731. this.content.add( view );
  79732. this.registerChild( view );
  79733. }
  79734. }
  79735. // @private
  79736. // @param {Number} number
  79737. _removePanels( number ) {
  79738. while ( number-- ) {
  79739. const view = this.content.last;
  79740. this.content.remove( view );
  79741. this.deregisterChild( view );
  79742. view.destroy();
  79743. }
  79744. }
  79745. // Updates coordinates of fake panels.
  79746. updatePosition() {
  79747. if ( this.numberOfPanels ) {
  79748. const { top, left } = this._balloonPanelView;
  79749. const { width, height } = new _ckeditor_ckeditor5_utils_src_dom_rect__WEBPACK_IMPORTED_MODULE_7__["default"]( this._balloonPanelView.element );
  79750. Object.assign( this, { top, left, width, height } );
  79751. }
  79752. }
  79753. }
  79754. /***/ }),
  79755. /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/panel/sticky/stickypanelview.js":
  79756. /*!*********************************************************************************!*\
  79757. !*** ./node_modules/@ckeditor/ckeditor5-ui/src/panel/sticky/stickypanelview.js ***!
  79758. \*********************************************************************************/
  79759. /*! exports provided: default */
  79760. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  79761. "use strict";
  79762. __webpack_require__.r(__webpack_exports__);
  79763. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return StickyPanelView; });
  79764. /* 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");
  79765. /* harmony import */ var _view__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../view */ "./node_modules/@ckeditor/ckeditor5-ui/src/view.js");
  79766. /* harmony import */ var _template__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../template */ "./node_modules/@ckeditor/ckeditor5-ui/src/template.js");
  79767. /* 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");
  79768. /* 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");
  79769. /* 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__);
  79770. /**
  79771. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  79772. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  79773. */
  79774. /**
  79775. * @module ui/panel/sticky/stickypanelview
  79776. */
  79777. const toPx = Object(_ckeditor_ckeditor5_utils_src_dom_tounit__WEBPACK_IMPORTED_MODULE_3__["default"])( 'px' );
  79778. /**
  79779. * The sticky panel view class.
  79780. */
  79781. class StickyPanelView extends _view__WEBPACK_IMPORTED_MODULE_1__["default"] {
  79782. /**
  79783. * @inheritDoc
  79784. */
  79785. constructor( locale ) {
  79786. super( locale );
  79787. const bind = this.bindTemplate;
  79788. /**
  79789. * Controls whether the sticky panel should be active.
  79790. *
  79791. * @readonly
  79792. * @observable
  79793. * @member {Boolean} #isActive
  79794. */
  79795. this.set( 'isActive', false );
  79796. /**
  79797. * Controls whether the sticky panel is in the "sticky" state.
  79798. *
  79799. * @readonly
  79800. * @observable
  79801. * @member {Boolean} #isSticky
  79802. */
  79803. this.set( 'isSticky', false );
  79804. /**
  79805. * The limiter element for the sticky panel instance. Its bounding rect limits
  79806. * the "stickyness" of the panel, i.e. when the panel reaches the bottom
  79807. * edge of the limiter, it becomes sticky to that edge and does not float
  79808. * off the limiter. It is mandatory for the panel to work properly and once
  79809. * set, it cannot be changed.
  79810. *
  79811. * @readonly
  79812. * @observable
  79813. * @member {HTMLElement} #limiterElement
  79814. */
  79815. this.set( 'limiterElement', null );
  79816. /**
  79817. * The offset from the bottom edge of {@link #limiterElement}
  79818. * which stops the panel from stickying any further to prevent limiter's content
  79819. * from being completely covered.
  79820. *
  79821. * @readonly
  79822. * @observable
  79823. * @default 50
  79824. * @member {Number} #limiterBottomOffset
  79825. */
  79826. this.set( 'limiterBottomOffset', 50 );
  79827. /**
  79828. * The offset from the top edge of the web browser's viewport which makes the
  79829. * panel become sticky. The default value is `0`, which means the panel becomes
  79830. * sticky when it's upper edge touches the top of the page viewport.
  79831. *
  79832. * This attribute is useful when the web page has UI elements positioned to the top
  79833. * either using `position: fixed` or `position: sticky`, which would cover the
  79834. * sticky panel or vice–versa (depending on the `z-index` hierarchy).
  79835. *
  79836. * @readonly
  79837. * @observable
  79838. * @default 0
  79839. * @member {Number} #viewportTopOffset
  79840. */
  79841. this.set( 'viewportTopOffset', 0 );
  79842. /**
  79843. * Controls the `margin-left` CSS style of the panel.
  79844. *
  79845. * @protected
  79846. * @readonly
  79847. * @observable
  79848. * @member {String} #_marginLeft
  79849. */
  79850. this.set( '_marginLeft', null );
  79851. /**
  79852. * Set `true` if the sticky panel reached the bottom edge of the
  79853. * {@link #limiterElement}.
  79854. *
  79855. * @protected
  79856. * @readonly
  79857. * @observable
  79858. * @member {Boolean} #_isStickyToTheLimiter
  79859. */
  79860. this.set( '_isStickyToTheLimiter', false );
  79861. /**
  79862. * Set `true` if the sticky panel uses the {@link #viewportTopOffset},
  79863. * i.e. not {@link #_isStickyToTheLimiter} and the {@link #viewportTopOffset}
  79864. * is not `0`.
  79865. *
  79866. * @protected
  79867. * @readonly
  79868. * @observable
  79869. * @member {Boolean} #_hasViewportTopOffset
  79870. */
  79871. this.set( '_hasViewportTopOffset', false );
  79872. /**
  79873. * Collection of the child views which creates balloon panel contents.
  79874. *
  79875. * @readonly
  79876. * @member {module:ui/viewcollection~ViewCollection}
  79877. */
  79878. this.content = this.createCollection();
  79879. /**
  79880. * The DOM bounding client rect of the {@link module:ui/view~View#element} of the panel.
  79881. *
  79882. * @protected
  79883. * @member {Object} #_panelRect
  79884. */
  79885. /**
  79886. * The DOM bounding client rect of the {@link #limiterElement}
  79887. * of the panel.
  79888. *
  79889. * @protected
  79890. * @member {Object} #_limiterRect
  79891. */
  79892. /**
  79893. * A dummy element which visually fills the space as long as the
  79894. * actual panel is sticky. It prevents flickering of the UI.
  79895. *
  79896. * @protected
  79897. * @property {HTMLElement}
  79898. */
  79899. this._contentPanelPlaceholder = new _template__WEBPACK_IMPORTED_MODULE_2__["default"]( {
  79900. tag: 'div',
  79901. attributes: {
  79902. class: [
  79903. 'ck',
  79904. 'ck-sticky-panel__placeholder'
  79905. ],
  79906. style: {
  79907. display: bind.to( 'isSticky', isSticky => isSticky ? 'block' : 'none' ),
  79908. height: bind.to( 'isSticky', isSticky => {
  79909. return isSticky ? toPx( this._panelRect.height ) : null;
  79910. } )
  79911. }
  79912. }
  79913. } ).render();
  79914. /**
  79915. * The panel which accepts children into {@link #content} collection.
  79916. * Also an element which is positioned when {@link #isSticky}.
  79917. *
  79918. * @protected
  79919. * @property {HTMLElement}
  79920. */
  79921. this._contentPanel = new _template__WEBPACK_IMPORTED_MODULE_2__["default"]( {
  79922. tag: 'div',
  79923. attributes: {
  79924. class: [
  79925. 'ck',
  79926. 'ck-sticky-panel__content',
  79927. // Toggle class of the panel when "sticky" state changes in the view.
  79928. bind.if( 'isSticky', 'ck-sticky-panel__content_sticky' ),
  79929. bind.if( '_isStickyToTheLimiter', 'ck-sticky-panel__content_sticky_bottom-limit' )
  79930. ],
  79931. style: {
  79932. width: bind.to( 'isSticky', isSticky => {
  79933. return isSticky ? toPx( this._contentPanelPlaceholder.getBoundingClientRect().width ) : null;
  79934. } ),
  79935. top: bind.to( '_hasViewportTopOffset', _hasViewportTopOffset => {
  79936. return _hasViewportTopOffset ? toPx( this.viewportTopOffset ) : null;
  79937. } ),
  79938. bottom: bind.to( '_isStickyToTheLimiter', _isStickyToTheLimiter => {
  79939. return _isStickyToTheLimiter ? toPx( this.limiterBottomOffset ) : null;
  79940. } ),
  79941. marginLeft: bind.to( '_marginLeft' )
  79942. }
  79943. },
  79944. children: this.content
  79945. } ).render();
  79946. this.setTemplate( {
  79947. tag: 'div',
  79948. attributes: {
  79949. class: [
  79950. 'ck',
  79951. 'ck-sticky-panel'
  79952. ]
  79953. },
  79954. children: [
  79955. this._contentPanelPlaceholder,
  79956. this._contentPanel
  79957. ]
  79958. } );
  79959. }
  79960. /**
  79961. * @inheritDoc
  79962. */
  79963. render() {
  79964. super.render();
  79965. // Check if the panel should go into the sticky state immediately.
  79966. this._checkIfShouldBeSticky();
  79967. // Update sticky state of the panel as the window is being scrolled.
  79968. this.listenTo( _ckeditor_ckeditor5_utils_src_dom_global__WEBPACK_IMPORTED_MODULE_0__["default"].window, 'scroll', () => {
  79969. this._checkIfShouldBeSticky();
  79970. } );
  79971. // Synchronize with `model.isActive` because sticking an inactive panel is pointless.
  79972. this.listenTo( this, 'change:isActive', () => {
  79973. this._checkIfShouldBeSticky();
  79974. } );
  79975. }
  79976. /**
  79977. * Analyzes the environment to decide whether the panel should
  79978. * be sticky or not.
  79979. *
  79980. * @protected
  79981. */
  79982. _checkIfShouldBeSticky() {
  79983. const panelRect = this._panelRect = this._contentPanel.getBoundingClientRect();
  79984. let limiterRect;
  79985. if ( !this.limiterElement ) {
  79986. this.isSticky = false;
  79987. } else {
  79988. limiterRect = this._limiterRect = this.limiterElement.getBoundingClientRect();
  79989. // The panel must be active to become sticky.
  79990. this.isSticky = this.isActive &&
  79991. // The limiter's top edge must be beyond the upper edge of the visible viewport (+the viewportTopOffset).
  79992. limiterRect.top < this.viewportTopOffset &&
  79993. // The model#limiterElement's height mustn't be smaller than the panel's height and model#limiterBottomOffset.
  79994. // There's no point in entering the sticky mode if the model#limiterElement is very, very small, because
  79995. // it would immediately set model#_isStickyToTheLimiter true and, given model#limiterBottomOffset, the panel
  79996. // would be positioned before the model#limiterElement.
  79997. this._panelRect.height + this.limiterBottomOffset < limiterRect.height;
  79998. }
  79999. // Stick the panel to the top edge of the viewport simulating CSS position:sticky.
  80000. // TODO: Possibly replaced by CSS in the future http://caniuse.com/#feat=css-sticky
  80001. if ( this.isSticky ) {
  80002. this._isStickyToTheLimiter =
  80003. limiterRect.bottom < panelRect.height + this.limiterBottomOffset + this.viewportTopOffset;
  80004. this._hasViewportTopOffset = !this._isStickyToTheLimiter && !!this.viewportTopOffset;
  80005. this._marginLeft = this._isStickyToTheLimiter ? null : toPx( -_ckeditor_ckeditor5_utils_src_dom_global__WEBPACK_IMPORTED_MODULE_0__["default"].window.scrollX );
  80006. }
  80007. // Detach the panel from the top edge of the viewport.
  80008. else {
  80009. this._isStickyToTheLimiter = false;
  80010. this._hasViewportTopOffset = false;
  80011. this._marginLeft = null;
  80012. }
  80013. }
  80014. }
  80015. /***/ }),
  80016. /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/template.js":
  80017. /*!*************************************************************!*\
  80018. !*** ./node_modules/@ckeditor/ckeditor5-ui/src/template.js ***!
  80019. \*************************************************************/
  80020. /*! exports provided: default, TemplateBinding, TemplateToBinding, TemplateIfBinding */
  80021. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  80022. "use strict";
  80023. __webpack_require__.r(__webpack_exports__);
  80024. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Template; });
  80025. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TemplateBinding", function() { return TemplateBinding; });
  80026. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TemplateToBinding", function() { return TemplateToBinding; });
  80027. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TemplateIfBinding", function() { return TemplateIfBinding; });
  80028. /* 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");
  80029. /* 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");
  80030. /* 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");
  80031. /* harmony import */ var _view__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./view */ "./node_modules/@ckeditor/ckeditor5-ui/src/view.js");
  80032. /* harmony import */ var _viewcollection__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./viewcollection */ "./node_modules/@ckeditor/ckeditor5-ui/src/viewcollection.js");
  80033. /* 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");
  80034. /* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! lodash-es */ "./node_modules/lodash-es/lodash.js");
  80035. /* harmony import */ var _ckeditor_ckeditor5_utils_src_toarray__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/toarray */ "./node_modules/@ckeditor/ckeditor5-utils/src/toarray.js");
  80036. /**
  80037. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  80038. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  80039. */
  80040. /**
  80041. * @module ui/template
  80042. */
  80043. /* global document */
  80044. const xhtmlNs = 'http://www.w3.org/1999/xhtml';
  80045. /**
  80046. * A basic Template class. It renders a DOM HTML element or text from a
  80047. * {@link module:ui/template~TemplateDefinition definition} and supports element attributes, children,
  80048. * bindings to {@link module:utils/observablemixin~Observable observables} and DOM event propagation.
  80049. *
  80050. * A simple template can look like this:
  80051. *
  80052. * const bind = Template.bind( observable, emitter );
  80053. *
  80054. * new Template( {
  80055. * tag: 'p',
  80056. * attributes: {
  80057. * class: 'foo',
  80058. * style: {
  80059. * backgroundColor: 'yellow'
  80060. * }
  80061. * },
  80062. * on: {
  80063. * click: bind.to( 'clicked' )
  80064. * },
  80065. * children: [
  80066. * 'A paragraph.'
  80067. * ]
  80068. * } ).render();
  80069. *
  80070. * and it will render the following HTML element:
  80071. *
  80072. * <p class="foo" style="background-color: yellow;">A paragraph.</p>
  80073. *
  80074. * Additionally, the `observable` will always fire `clicked` upon clicking `<p>` in the DOM.
  80075. *
  80076. * See {@link module:ui/template~TemplateDefinition} to know more about templates and complex
  80077. * template definitions.
  80078. *
  80079. * @mixes module:utils/emittermixin~EmitterMixin
  80080. */
  80081. class Template {
  80082. /**
  80083. * Creates an instance of the {@link ~Template} class.
  80084. *
  80085. * @param {module:ui/template~TemplateDefinition} def The definition of the template.
  80086. */
  80087. constructor( def ) {
  80088. Object.assign( this, normalize( clone( def ) ) );
  80089. /**
  80090. * Indicates whether this particular Template instance has been
  80091. * {@link #render rendered}.
  80092. *
  80093. * @readonly
  80094. * @protected
  80095. * @member {Boolean}
  80096. */
  80097. this._isRendered = false;
  80098. /**
  80099. * The tag (`tagName`) of this template, e.g. `div`. It also indicates that the template
  80100. * renders to an HTML element.
  80101. *
  80102. * @member {String} #tag
  80103. */
  80104. /**
  80105. * The text of the template. It also indicates that the template renders to a DOM text node.
  80106. *
  80107. * @member {Array.<String|module:ui/template~TemplateValueSchema>} #text
  80108. */
  80109. /**
  80110. * The attributes of the template, e.g. `{ id: [ 'ck-id' ] }`, corresponding with
  80111. * the attributes of an HTML element.
  80112. *
  80113. * **Note**: This property only makes sense when {@link #tag} is defined.
  80114. *
  80115. * @member {Object} #attributes
  80116. */
  80117. /**
  80118. * The children of the template. They can be either:
  80119. * * independent instances of {@link ~Template} (sub–templates),
  80120. * * native DOM Nodes.
  80121. *
  80122. * **Note**: This property only makes sense when {@link #tag} is defined.
  80123. *
  80124. * @member {Array.<module:ui/template~Template|Node>} #children
  80125. */
  80126. /**
  80127. * The DOM event listeners of the template.
  80128. *
  80129. * @member {Object} #eventListeners
  80130. */
  80131. /**
  80132. * The data used by the {@link #revert} method to restore a node to its original state.
  80133. *
  80134. * See: {@link #apply}.
  80135. *
  80136. * @readonly
  80137. * @protected
  80138. * @member {module:ui/template~RenderData}
  80139. */
  80140. this._revertData = null;
  80141. }
  80142. /**
  80143. * Renders a DOM Node (an HTML element or text) out of the template.
  80144. *
  80145. * const domNode = new Template( { ... } ).render();
  80146. *
  80147. * See: {@link #apply}.
  80148. *
  80149. * @returns {HTMLElement|Text}
  80150. */
  80151. render() {
  80152. const node = this._renderNode( {
  80153. intoFragment: true
  80154. } );
  80155. this._isRendered = true;
  80156. return node;
  80157. }
  80158. /**
  80159. * Applies the template to an existing DOM Node, either HTML element or text.
  80160. *
  80161. * **Note:** No new DOM nodes will be created. Applying extends:
  80162. *
  80163. * {@link module:ui/template~TemplateDefinition attributes},
  80164. * {@link module:ui/template~TemplateDefinition event listeners}, and
  80165. * `textContent` of {@link module:ui/template~TemplateDefinition children} only.
  80166. *
  80167. * **Note:** Existing `class` and `style` attributes are extended when a template
  80168. * is applied to an HTML element, while other attributes and `textContent` are overridden.
  80169. *
  80170. * **Note:** The process of applying a template can be easily reverted using the
  80171. * {@link module:ui/template~Template#revert} method.
  80172. *
  80173. * const element = document.createElement( 'div' );
  80174. * const observable = new Model( { divClass: 'my-div' } );
  80175. * const emitter = Object.create( EmitterMixin );
  80176. * const bind = Template.bind( observable, emitter );
  80177. *
  80178. * new Template( {
  80179. * attributes: {
  80180. * id: 'first-div',
  80181. * class: bind.to( 'divClass' )
  80182. * },
  80183. * on: {
  80184. * click: bind( 'elementClicked' ) // Will be fired by the observable.
  80185. * },
  80186. * children: [
  80187. * 'Div text.'
  80188. * ]
  80189. * } ).apply( element );
  80190. *
  80191. * console.log( element.outerHTML ); // -> '<div id="first-div" class="my-div"></div>'
  80192. *
  80193. * @see module:ui/template~Template#render
  80194. * @see module:ui/template~Template#revert
  80195. * @param {Node} node Root node for the template to apply.
  80196. */
  80197. apply( node ) {
  80198. this._revertData = getEmptyRevertData();
  80199. this._renderNode( {
  80200. node,
  80201. isApplying: true,
  80202. revertData: this._revertData
  80203. } );
  80204. return node;
  80205. }
  80206. /**
  80207. * Reverts a template {@link module:ui/template~Template#apply applied} to a DOM node.
  80208. *
  80209. * @param {Node} node The root node for the template to revert. In most of the cases, it is the
  80210. * same node used by {@link module:ui/template~Template#apply}.
  80211. */
  80212. revert( node ) {
  80213. if ( !this._revertData ) {
  80214. /**
  80215. * Attempting to revert a template which has not been applied yet.
  80216. *
  80217. * @error ui-template-revert-not-applied
  80218. */
  80219. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"](
  80220. 'ui-template-revert-not-applied',
  80221. [ this, node ]
  80222. );
  80223. }
  80224. this._revertTemplateFromNode( node, this._revertData );
  80225. }
  80226. /**
  80227. * Returns an iterator which traverses the template in search of {@link module:ui/view~View}
  80228. * instances and returns them one by one.
  80229. *
  80230. * const viewFoo = new View();
  80231. * const viewBar = new View();
  80232. * const viewBaz = new View();
  80233. * const template = new Template( {
  80234. * tag: 'div',
  80235. * children: [
  80236. * viewFoo,
  80237. * {
  80238. * tag: 'div',
  80239. * children: [
  80240. * viewBar
  80241. * ]
  80242. * },
  80243. * viewBaz
  80244. * ]
  80245. * } );
  80246. *
  80247. * // Logs: viewFoo, viewBar, viewBaz
  80248. * for ( const view of template.getViews() ) {
  80249. * console.log( view );
  80250. * }
  80251. *
  80252. * @returns {Iterable.<module:ui/view~View>}
  80253. */
  80254. * getViews() {
  80255. function* search( def ) {
  80256. if ( def.children ) {
  80257. for ( const child of def.children ) {
  80258. if ( isView( child ) ) {
  80259. yield child;
  80260. } else if ( isTemplate( child ) ) {
  80261. yield* search( child );
  80262. }
  80263. }
  80264. }
  80265. }
  80266. yield* search( this );
  80267. }
  80268. /**
  80269. * An entry point to the interface which binds DOM nodes to
  80270. * {@link module:utils/observablemixin~Observable observables}.
  80271. * There are two types of bindings:
  80272. *
  80273. * * HTML element attributes or text `textContent` synchronized with attributes of an
  80274. * {@link module:utils/observablemixin~Observable}. Learn more about {@link module:ui/template~BindChain#to}
  80275. * and {@link module:ui/template~BindChain#if}.
  80276. *
  80277. * const bind = Template.bind( observable, emitter );
  80278. *
  80279. * new Template( {
  80280. * attributes: {
  80281. * // Binds the element "class" attribute to observable#classAttribute.
  80282. * class: bind.to( 'classAttribute' )
  80283. * }
  80284. * } ).render();
  80285. *
  80286. * * DOM events fired on HTML element propagated through
  80287. * {@link module:utils/observablemixin~Observable}. Learn more about {@link module:ui/template~BindChain#to}.
  80288. *
  80289. * const bind = Template.bind( observable, emitter );
  80290. *
  80291. * new Template( {
  80292. * on: {
  80293. * // Will be fired by the observable.
  80294. * click: bind( 'elementClicked' )
  80295. * }
  80296. * } ).render();
  80297. *
  80298. * Also see {@link module:ui/view~View#bindTemplate}.
  80299. *
  80300. * @param {module:utils/observablemixin~Observable} observable An observable which provides boundable attributes.
  80301. * @param {module:utils/emittermixin~Emitter} emitter An emitter that listens to observable attribute
  80302. * changes or DOM Events (depending on the kind of the binding). Usually, a {@link module:ui/view~View} instance.
  80303. * @returns {module:ui/template~BindChain}
  80304. */
  80305. static bind( observable, emitter ) {
  80306. return {
  80307. to( eventNameOrFunctionOrAttribute, callback ) {
  80308. return new TemplateToBinding( {
  80309. eventNameOrFunction: eventNameOrFunctionOrAttribute,
  80310. attribute: eventNameOrFunctionOrAttribute,
  80311. observable, emitter, callback
  80312. } );
  80313. },
  80314. if( attribute, valueIfTrue, callback ) {
  80315. return new TemplateIfBinding( {
  80316. observable, emitter, attribute, valueIfTrue, callback
  80317. } );
  80318. }
  80319. };
  80320. }
  80321. /**
  80322. * Extends an existing {@link module:ui/template~Template} instance with some additional content
  80323. * from another {@link module:ui/template~TemplateDefinition}.
  80324. *
  80325. * const bind = Template.bind( observable, emitter );
  80326. *
  80327. * const template = new Template( {
  80328. * tag: 'p',
  80329. * attributes: {
  80330. * class: 'a',
  80331. * data-x: bind.to( 'foo' )
  80332. * },
  80333. * children: [
  80334. * {
  80335. * tag: 'span',
  80336. * attributes: {
  80337. * class: 'b'
  80338. * },
  80339. * children: [
  80340. * 'Span'
  80341. * ]
  80342. * }
  80343. * ]
  80344. * } );
  80345. *
  80346. * // Instance-level extension.
  80347. * Template.extend( template, {
  80348. * attributes: {
  80349. * class: 'b',
  80350. * data-x: bind.to( 'bar' )
  80351. * },
  80352. * children: [
  80353. * {
  80354. * attributes: {
  80355. * class: 'c'
  80356. * }
  80357. * }
  80358. * ]
  80359. * } );
  80360. *
  80361. * // Child extension.
  80362. * Template.extend( template.children[ 0 ], {
  80363. * attributes: {
  80364. * class: 'd'
  80365. * }
  80366. * } );
  80367. *
  80368. * the `outerHTML` of `template.render()` is:
  80369. *
  80370. * <p class="a b" data-x="{ observable.foo } { observable.bar }">
  80371. * <span class="b c d">Span</span>
  80372. * </p>
  80373. *
  80374. * @param {module:ui/template~Template} template An existing template instance to be extended.
  80375. * @param {module:ui/template~TemplateDefinition} def Additional definition to be applied to a template.
  80376. */
  80377. static extend( template, def ) {
  80378. if ( template._isRendered ) {
  80379. /**
  80380. * Extending a template after rendering may not work as expected. To make sure
  80381. * the {@link module:ui/template~Template.extend extending} works for an element,
  80382. * make sure it happens before {@link #render} is called.
  80383. *
  80384. * @error template-extend-render
  80385. */
  80386. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"](
  80387. 'template-extend-render',
  80388. [ this, template ]
  80389. );
  80390. }
  80391. extendTemplate( template, normalize( clone( def ) ) );
  80392. }
  80393. /**
  80394. * Renders a DOM Node (either an HTML element or text) out of the template.
  80395. *
  80396. * @protected
  80397. * @param {module:ui/template~RenderData} data Rendering data.
  80398. */
  80399. _renderNode( data ) {
  80400. let isInvalid;
  80401. if ( data.node ) {
  80402. // When applying, a definition cannot have "tag" and "text" at the same time.
  80403. isInvalid = this.tag && this.text;
  80404. } else {
  80405. // When rendering, a definition must have either "tag" or "text": XOR( this.tag, this.text ).
  80406. isInvalid = this.tag ? this.text : !this.text;
  80407. }
  80408. if ( isInvalid ) {
  80409. /**
  80410. * Node definition cannot have the "tag" and "text" properties at the same time.
  80411. * Node definition must have either "tag" or "text" when rendering a new Node.
  80412. *
  80413. * @error ui-template-wrong-syntax
  80414. */
  80415. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"](
  80416. 'ui-template-wrong-syntax',
  80417. this
  80418. );
  80419. }
  80420. if ( this.text ) {
  80421. return this._renderText( data );
  80422. } else {
  80423. return this._renderElement( data );
  80424. }
  80425. }
  80426. /**
  80427. * Renders an HTML element out of the template.
  80428. *
  80429. * @protected
  80430. * @param {module:ui/template~RenderData} data Rendering data.
  80431. */
  80432. _renderElement( data ) {
  80433. let node = data.node;
  80434. if ( !node ) {
  80435. node = data.node = document.createElementNS( this.ns || xhtmlNs, this.tag );
  80436. }
  80437. this._renderAttributes( data );
  80438. this._renderElementChildren( data );
  80439. this._setUpListeners( data );
  80440. return node;
  80441. }
  80442. /**
  80443. * Renders a text node out of {@link module:ui/template~Template#text}.
  80444. *
  80445. * @protected
  80446. * @param {module:ui/template~RenderData} data Rendering data.
  80447. */
  80448. _renderText( data ) {
  80449. let node = data.node;
  80450. // Save the original textContent to revert it in #revert().
  80451. if ( node ) {
  80452. data.revertData.text = node.textContent;
  80453. } else {
  80454. node = data.node = document.createTextNode( '' );
  80455. }
  80456. // Check if this Text Node is bound to Observable. Cases:
  80457. //
  80458. // text: [ Template.bind( ... ).to( ... ) ]
  80459. //
  80460. // text: [
  80461. // 'foo',
  80462. // Template.bind( ... ).to( ... ),
  80463. // ...
  80464. // ]
  80465. //
  80466. if ( hasTemplateBinding( this.text ) ) {
  80467. this._bindToObservable( {
  80468. schema: this.text,
  80469. updater: getTextUpdater( node ),
  80470. data
  80471. } );
  80472. }
  80473. // Simply set text. Cases:
  80474. //
  80475. // text: [ 'all', 'are', 'static' ]
  80476. //
  80477. // text: [ 'foo' ]
  80478. //
  80479. else {
  80480. node.textContent = this.text.join( '' );
  80481. }
  80482. return node;
  80483. }
  80484. /**
  80485. * Renders HTML element attributes out of {@link module:ui/template~Template#attributes}.
  80486. *
  80487. * @protected
  80488. * @param {module:ui/template~RenderData} data Rendering data.
  80489. */
  80490. _renderAttributes( data ) {
  80491. let attrName, attrValue, domAttrValue, attrNs;
  80492. if ( !this.attributes ) {
  80493. return;
  80494. }
  80495. const node = data.node;
  80496. const revertData = data.revertData;
  80497. for ( attrName in this.attributes ) {
  80498. // Current attribute value in DOM.
  80499. domAttrValue = node.getAttribute( attrName );
  80500. // The value to be set.
  80501. attrValue = this.attributes[ attrName ];
  80502. // Save revert data.
  80503. if ( revertData ) {
  80504. revertData.attributes[ attrName ] = domAttrValue;
  80505. }
  80506. // Detect custom namespace:
  80507. //
  80508. // class: {
  80509. // ns: 'abc',
  80510. // value: Template.bind( ... ).to( ... )
  80511. // }
  80512. //
  80513. attrNs = ( Object(lodash_es__WEBPACK_IMPORTED_MODULE_6__["isObject"])( attrValue[ 0 ] ) && attrValue[ 0 ].ns ) ? attrValue[ 0 ].ns : null;
  80514. // Activate binding if one is found. Cases:
  80515. //
  80516. // class: [
  80517. // Template.bind( ... ).to( ... )
  80518. // ]
  80519. //
  80520. // class: [
  80521. // 'bar',
  80522. // Template.bind( ... ).to( ... ),
  80523. // 'baz'
  80524. // ]
  80525. //
  80526. // class: {
  80527. // ns: 'abc',
  80528. // value: Template.bind( ... ).to( ... )
  80529. // }
  80530. //
  80531. if ( hasTemplateBinding( attrValue ) ) {
  80532. // Normalize attributes with additional data like namespace:
  80533. //
  80534. // class: {
  80535. // ns: 'abc',
  80536. // value: [ ... ]
  80537. // }
  80538. //
  80539. const valueToBind = attrNs ? attrValue[ 0 ].value : attrValue;
  80540. // Extend the original value of attributes like "style" and "class",
  80541. // don't override them.
  80542. if ( revertData && shouldExtend( attrName ) ) {
  80543. valueToBind.unshift( domAttrValue );
  80544. }
  80545. this._bindToObservable( {
  80546. schema: valueToBind,
  80547. updater: getAttributeUpdater( node, attrName, attrNs ),
  80548. data
  80549. } );
  80550. }
  80551. // Style attribute could be an Object so it needs to be parsed in a specific way.
  80552. //
  80553. // style: {
  80554. // width: '100px',
  80555. // height: Template.bind( ... ).to( ... )
  80556. // }
  80557. //
  80558. else if ( attrName == 'style' && typeof attrValue[ 0 ] !== 'string' ) {
  80559. this._renderStyleAttribute( attrValue[ 0 ], data );
  80560. }
  80561. // Otherwise simply set the static attribute:
  80562. //
  80563. // class: [ 'foo' ]
  80564. //
  80565. // class: [ 'all', 'are', 'static' ]
  80566. //
  80567. // class: [
  80568. // {
  80569. // ns: 'abc',
  80570. // value: [ 'foo' ]
  80571. // }
  80572. // ]
  80573. //
  80574. else {
  80575. // Extend the original value of attributes like "style" and "class",
  80576. // don't override them.
  80577. if ( revertData && domAttrValue && shouldExtend( attrName ) ) {
  80578. attrValue.unshift( domAttrValue );
  80579. }
  80580. attrValue = attrValue
  80581. // Retrieve "values" from:
  80582. //
  80583. // class: [
  80584. // {
  80585. // ns: 'abc',
  80586. // value: [ ... ]
  80587. // }
  80588. // ]
  80589. //
  80590. .map( val => val ? ( val.value || val ) : val )
  80591. // Flatten the array.
  80592. .reduce( ( prev, next ) => prev.concat( next ), [] )
  80593. // Convert into string.
  80594. .reduce( arrayValueReducer, '' );
  80595. if ( !isFalsy( attrValue ) ) {
  80596. node.setAttributeNS( attrNs, attrName, attrValue );
  80597. }
  80598. }
  80599. }
  80600. }
  80601. /**
  80602. * Renders the `style` attribute of an HTML element based on
  80603. * {@link module:ui/template~Template#attributes}.
  80604. *
  80605. * A style attribute is an {Object} with static values:
  80606. *
  80607. * attributes: {
  80608. * style: {
  80609. * color: 'red'
  80610. * }
  80611. * }
  80612. *
  80613. * or values bound to {@link module:ui/model~Model} properties:
  80614. *
  80615. * attributes: {
  80616. * style: {
  80617. * color: bind.to( ... )
  80618. * }
  80619. * }
  80620. *
  80621. * Note: The `style` attribute is rendered without setting the namespace. It does not seem to be
  80622. * needed.
  80623. *
  80624. * @private
  80625. * @param {Object} styles Styles located in `attributes.style` of {@link module:ui/template~TemplateDefinition}.
  80626. * @param {module:ui/template~RenderData} data Rendering data.
  80627. */
  80628. _renderStyleAttribute( styles, data ) {
  80629. const node = data.node;
  80630. for ( const styleName in styles ) {
  80631. const styleValue = styles[ styleName ];
  80632. // Cases:
  80633. //
  80634. // style: {
  80635. // color: bind.to( 'attribute' )
  80636. // }
  80637. //
  80638. if ( hasTemplateBinding( styleValue ) ) {
  80639. this._bindToObservable( {
  80640. schema: [ styleValue ],
  80641. updater: getStyleUpdater( node, styleName ),
  80642. data
  80643. } );
  80644. }
  80645. // Cases:
  80646. //
  80647. // style: {
  80648. // color: 'red'
  80649. // }
  80650. //
  80651. else {
  80652. node.style[ styleName ] = styleValue;
  80653. }
  80654. }
  80655. }
  80656. /**
  80657. * Recursively renders HTML element's children from {@link module:ui/template~Template#children}.
  80658. *
  80659. * @protected
  80660. * @param {module:ui/template~RenderData} data Rendering data.
  80661. */
  80662. _renderElementChildren( data ) {
  80663. const node = data.node;
  80664. const container = data.intoFragment ? document.createDocumentFragment() : node;
  80665. const isApplying = data.isApplying;
  80666. let childIndex = 0;
  80667. for ( const child of this.children ) {
  80668. if ( isViewCollection( child ) ) {
  80669. if ( !isApplying ) {
  80670. child.setParent( node );
  80671. // Note: ViewCollection renders its children.
  80672. for ( const view of child ) {
  80673. container.appendChild( view.element );
  80674. }
  80675. }
  80676. } else if ( isView( child ) ) {
  80677. if ( !isApplying ) {
  80678. if ( !child.isRendered ) {
  80679. child.render();
  80680. }
  80681. container.appendChild( child.element );
  80682. }
  80683. } else if ( Object(_ckeditor_ckeditor5_utils_src_dom_isnode__WEBPACK_IMPORTED_MODULE_5__["default"])( child ) ) {
  80684. container.appendChild( child );
  80685. } else {
  80686. if ( isApplying ) {
  80687. const revertData = data.revertData;
  80688. const childRevertData = getEmptyRevertData();
  80689. revertData.children.push( childRevertData );
  80690. child._renderNode( {
  80691. node: container.childNodes[ childIndex++ ],
  80692. isApplying: true,
  80693. revertData: childRevertData
  80694. } );
  80695. } else {
  80696. container.appendChild( child.render() );
  80697. }
  80698. }
  80699. }
  80700. if ( data.intoFragment ) {
  80701. node.appendChild( container );
  80702. }
  80703. }
  80704. /**
  80705. * Activates `on` event listeners from the {@link module:ui/template~TemplateDefinition}
  80706. * on an HTML element.
  80707. *
  80708. * @protected
  80709. * @param {module:ui/template~RenderData} data Rendering data.
  80710. */
  80711. _setUpListeners( data ) {
  80712. if ( !this.eventListeners ) {
  80713. return;
  80714. }
  80715. for ( const key in this.eventListeners ) {
  80716. const revertBindings = this.eventListeners[ key ].map( schemaItem => {
  80717. const [ domEvtName, domSelector ] = key.split( '@' );
  80718. return schemaItem.activateDomEventListener( domEvtName, domSelector, data );
  80719. } );
  80720. if ( data.revertData ) {
  80721. data.revertData.bindings.push( revertBindings );
  80722. }
  80723. }
  80724. }
  80725. /**
  80726. * For a given {@link module:ui/template~TemplateValueSchema} containing {@link module:ui/template~TemplateBinding}
  80727. * activates the binding and sets its initial value.
  80728. *
  80729. * Note: {@link module:ui/template~TemplateValueSchema} can be for HTML element attributes or
  80730. * text node `textContent`.
  80731. *
  80732. * @protected
  80733. * @param {Object} options Binding options.
  80734. * @param {module:ui/template~TemplateValueSchema} options.schema
  80735. * @param {Function} options.updater A function which updates the DOM (like attribute or text).
  80736. * @param {module:ui/template~RenderData} options.data Rendering data.
  80737. */
  80738. _bindToObservable( { schema, updater, data } ) {
  80739. const revertData = data.revertData;
  80740. // Set initial values.
  80741. syncValueSchemaValue( schema, updater, data );
  80742. const revertBindings = schema
  80743. // Filter "falsy" (false, undefined, null, '') value schema components out.
  80744. .filter( item => !isFalsy( item ) )
  80745. // Filter inactive bindings from schema, like static strings ('foo'), numbers (42), etc.
  80746. .filter( item => item.observable )
  80747. // Once only the actual binding are left, let the emitter listen to observable change:attribute event.
  80748. // TODO: Reduce the number of listeners attached as many bindings may listen
  80749. // to the same observable attribute.
  80750. .map( templateBinding => templateBinding.activateAttributeListener( schema, updater, data ) );
  80751. if ( revertData ) {
  80752. revertData.bindings.push( revertBindings );
  80753. }
  80754. }
  80755. /**
  80756. * Reverts {@link module:ui/template~RenderData#revertData template data} from a node to
  80757. * return it to the original state.
  80758. *
  80759. * @protected
  80760. * @param {HTMLElement|Text} node A node to be reverted.
  80761. * @param {Object} revertData An object that stores information about what changes have been made by
  80762. * {@link #apply} to the node. See {@link module:ui/template~RenderData#revertData} for more information.
  80763. */
  80764. _revertTemplateFromNode( node, revertData ) {
  80765. for ( const binding of revertData.bindings ) {
  80766. // Each binding may consist of several observable+observable#attribute.
  80767. // like the following has 2:
  80768. //
  80769. // class: [
  80770. // 'x',
  80771. // bind.to( 'foo' ),
  80772. // 'y',
  80773. // bind.to( 'bar' )
  80774. // ]
  80775. //
  80776. for ( const revertBinding of binding ) {
  80777. revertBinding();
  80778. }
  80779. }
  80780. if ( revertData.text ) {
  80781. node.textContent = revertData.text;
  80782. return;
  80783. }
  80784. for ( const attrName in revertData.attributes ) {
  80785. const attrValue = revertData.attributes[ attrName ];
  80786. // When the attribute has **not** been set before #apply().
  80787. if ( attrValue === null ) {
  80788. node.removeAttribute( attrName );
  80789. } else {
  80790. node.setAttribute( attrName, attrValue );
  80791. }
  80792. }
  80793. for ( let i = 0; i < revertData.children.length; ++i ) {
  80794. this._revertTemplateFromNode( node.childNodes[ i ], revertData.children[ i ] );
  80795. }
  80796. }
  80797. }
  80798. Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_1__["default"])( Template, _ckeditor_ckeditor5_utils_src_emittermixin__WEBPACK_IMPORTED_MODULE_2__["default"] );
  80799. /**
  80800. * Describes a binding created by the {@link module:ui/template~Template.bind} interface.
  80801. *
  80802. * @protected
  80803. */
  80804. class TemplateBinding {
  80805. /**
  80806. * Creates an instance of the {@link module:ui/template~TemplateBinding} class.
  80807. *
  80808. * @param {module:ui/template~TemplateDefinition} def The definition of the binding.
  80809. */
  80810. constructor( def ) {
  80811. Object.assign( this, def );
  80812. /**
  80813. * An observable instance of the binding. It either:
  80814. *
  80815. * * provides the attribute with the value,
  80816. * * or passes the event when a corresponding DOM event is fired.
  80817. *
  80818. * @member {module:utils/observablemixin~ObservableMixin} module:ui/template~TemplateBinding#observable
  80819. */
  80820. /**
  80821. * An {@link module:utils/emittermixin~Emitter} used by the binding to:
  80822. *
  80823. * * listen to the attribute change in the {@link module:ui/template~TemplateBinding#observable},
  80824. * * or listen to the event in the DOM.
  80825. *
  80826. * @member {module:utils/emittermixin~EmitterMixin} module:ui/template~TemplateBinding#emitter
  80827. */
  80828. /**
  80829. * The name of the {@link module:ui/template~TemplateBinding#observable observed attribute}.
  80830. *
  80831. * @member {String} module:ui/template~TemplateBinding#attribute
  80832. */
  80833. /**
  80834. * A custom function to process the value of the {@link module:ui/template~TemplateBinding#attribute}.
  80835. *
  80836. * @member {Function} [module:ui/template~TemplateBinding#callback]
  80837. */
  80838. }
  80839. /**
  80840. * Returns the value of the binding. It is the value of the {@link module:ui/template~TemplateBinding#attribute} in
  80841. * {@link module:ui/template~TemplateBinding#observable}. The value may be processed by the
  80842. * {@link module:ui/template~TemplateBinding#callback}, if such has been passed to the binding.
  80843. *
  80844. * @param {Node} [node] A native DOM node, passed to the custom {@link module:ui/template~TemplateBinding#callback}.
  80845. * @returns {*} The value of {@link module:ui/template~TemplateBinding#attribute} in
  80846. * {@link module:ui/template~TemplateBinding#observable}.
  80847. */
  80848. getValue( node ) {
  80849. const value = this.observable[ this.attribute ];
  80850. return this.callback ? this.callback( value, node ) : value;
  80851. }
  80852. /**
  80853. * Activates the listener which waits for changes of the {@link module:ui/template~TemplateBinding#attribute} in
  80854. * {@link module:ui/template~TemplateBinding#observable}, then updates the DOM with the aggregated
  80855. * value of {@link module:ui/template~TemplateValueSchema}.
  80856. *
  80857. * @param {module:ui/template~TemplateValueSchema} schema A full schema to generate an attribute or text in the DOM.
  80858. * @param {Function} updater A DOM updater function used to update the native DOM attribute or text.
  80859. * @param {module:ui/template~RenderData} data Rendering data.
  80860. * @returns {Function} A function to sever the listener binding.
  80861. */
  80862. activateAttributeListener( schema, updater, data ) {
  80863. const callback = () => syncValueSchemaValue( schema, updater, data );
  80864. this.emitter.listenTo( this.observable, 'change:' + this.attribute, callback );
  80865. // Allows revert of the listener.
  80866. return () => {
  80867. this.emitter.stopListening( this.observable, 'change:' + this.attribute, callback );
  80868. };
  80869. }
  80870. }
  80871. /**
  80872. * Describes either:
  80873. *
  80874. * * a binding to an {@link module:utils/observablemixin~Observable},
  80875. * * or a native DOM event binding.
  80876. *
  80877. * It is created by the {@link module:ui/template~BindChain#to} method.
  80878. *
  80879. * @protected
  80880. */
  80881. class TemplateToBinding extends TemplateBinding {
  80882. /**
  80883. * Activates the listener for the native DOM event, which when fired, is propagated by
  80884. * the {@link module:ui/template~TemplateBinding#emitter}.
  80885. *
  80886. * @param {String} domEvtName The name of the native DOM event.
  80887. * @param {String} domSelector The selector in the DOM to filter delegated events.
  80888. * @param {module:ui/template~RenderData} data Rendering data.
  80889. * @returns {Function} A function to sever the listener binding.
  80890. */
  80891. activateDomEventListener( domEvtName, domSelector, data ) {
  80892. const callback = ( evt, domEvt ) => {
  80893. if ( !domSelector || domEvt.target.matches( domSelector ) ) {
  80894. if ( typeof this.eventNameOrFunction == 'function' ) {
  80895. this.eventNameOrFunction( domEvt );
  80896. } else {
  80897. this.observable.fire( this.eventNameOrFunction, domEvt );
  80898. }
  80899. }
  80900. };
  80901. this.emitter.listenTo( data.node, domEvtName, callback );
  80902. // Allows revert of the listener.
  80903. return () => {
  80904. this.emitter.stopListening( data.node, domEvtName, callback );
  80905. };
  80906. }
  80907. }
  80908. /**
  80909. * Describes a binding to {@link module:utils/observablemixin~ObservableMixin} created by the {@link module:ui/template~BindChain#if}
  80910. * method.
  80911. *
  80912. * @protected
  80913. */
  80914. class TemplateIfBinding extends TemplateBinding {
  80915. /**
  80916. * @inheritDoc
  80917. */
  80918. getValue( node ) {
  80919. const value = super.getValue( node );
  80920. return isFalsy( value ) ? false : ( this.valueIfTrue || true );
  80921. }
  80922. /**
  80923. * The value of the DOM attribute or text to be set if the {@link module:ui/template~TemplateBinding#attribute} in
  80924. * {@link module:ui/template~TemplateBinding#observable} is `true`.
  80925. *
  80926. * @member {String} [module:ui/template~TemplateIfBinding#valueIfTrue]
  80927. */
  80928. }
  80929. // Checks whether given {@link module:ui/template~TemplateValueSchema} contains a
  80930. // {@link module:ui/template~TemplateBinding}.
  80931. //
  80932. // @param {module:ui/template~TemplateValueSchema} schema
  80933. // @returns {Boolean}
  80934. function hasTemplateBinding( schema ) {
  80935. if ( !schema ) {
  80936. return false;
  80937. }
  80938. // Normalize attributes with additional data like namespace:
  80939. //
  80940. // class: {
  80941. // ns: 'abc',
  80942. // value: [ ... ]
  80943. // }
  80944. //
  80945. if ( schema.value ) {
  80946. schema = schema.value;
  80947. }
  80948. if ( Array.isArray( schema ) ) {
  80949. return schema.some( hasTemplateBinding );
  80950. } else if ( schema instanceof TemplateBinding ) {
  80951. return true;
  80952. }
  80953. return false;
  80954. }
  80955. // Assembles the value using {@link module:ui/template~TemplateValueSchema} and stores it in a form of
  80956. // an Array. Each entry of the Array corresponds to one of {@link module:ui/template~TemplateValueSchema}
  80957. // items.
  80958. //
  80959. // @param {module:ui/template~TemplateValueSchema} schema
  80960. // @param {Node} node DOM Node updated when {@link module:utils/observablemixin~ObservableMixin} changes.
  80961. // @returns {Array}
  80962. function getValueSchemaValue( schema, node ) {
  80963. return schema.map( schemaItem => {
  80964. // Process {@link module:ui/template~TemplateBinding} bindings.
  80965. if ( schemaItem instanceof TemplateBinding ) {
  80966. return schemaItem.getValue( node );
  80967. }
  80968. // All static values like strings, numbers, and "falsy" values (false, null, undefined, '', etc.) just pass.
  80969. return schemaItem;
  80970. } );
  80971. }
  80972. // A function executed each time the bound Observable attribute changes, which updates the DOM with a value
  80973. // constructed from {@link module:ui/template~TemplateValueSchema}.
  80974. //
  80975. // @param {module:ui/template~TemplateValueSchema} schema
  80976. // @param {Function} updater A function which updates the DOM (like attribute or text).
  80977. // @param {Node} node DOM Node updated when {@link module:utils/observablemixin~ObservableMixin} changes.
  80978. function syncValueSchemaValue( schema, updater, { node } ) {
  80979. let value = getValueSchemaValue( schema, node );
  80980. // Check if schema is a single Template.bind.if, like:
  80981. //
  80982. // class: Template.bind.if( 'foo' )
  80983. //
  80984. if ( schema.length == 1 && schema[ 0 ] instanceof TemplateIfBinding ) {
  80985. value = value[ 0 ];
  80986. } else {
  80987. value = value.reduce( arrayValueReducer, '' );
  80988. }
  80989. if ( isFalsy( value ) ) {
  80990. updater.remove();
  80991. } else {
  80992. updater.set( value );
  80993. }
  80994. }
  80995. // Returns an object consisting of `set` and `remove` functions, which
  80996. // can be used in the context of DOM Node to set or reset `textContent`.
  80997. // @see module:ui/view~View#_bindToObservable
  80998. //
  80999. // @param {Node} node DOM Node to be modified.
  81000. // @returns {Object}
  81001. function getTextUpdater( node ) {
  81002. return {
  81003. set( value ) {
  81004. node.textContent = value;
  81005. },
  81006. remove() {
  81007. node.textContent = '';
  81008. }
  81009. };
  81010. }
  81011. // Returns an object consisting of `set` and `remove` functions, which
  81012. // can be used in the context of DOM Node to set or reset an attribute.
  81013. // @see module:ui/view~View#_bindToObservable
  81014. //
  81015. // @param {Node} node DOM Node to be modified.
  81016. // @param {String} attrName Name of the attribute to be modified.
  81017. // @param {String} [ns=null] Namespace to use.
  81018. // @returns {Object}
  81019. function getAttributeUpdater( el, attrName, ns ) {
  81020. return {
  81021. set( value ) {
  81022. el.setAttributeNS( ns, attrName, value );
  81023. },
  81024. remove() {
  81025. el.removeAttributeNS( ns, attrName );
  81026. }
  81027. };
  81028. }
  81029. // Returns an object consisting of `set` and `remove` functions, which
  81030. // can be used in the context of CSSStyleDeclaration to set or remove a style.
  81031. // @see module:ui/view~View#_bindToObservable
  81032. //
  81033. // @param {Node} node DOM Node to be modified.
  81034. // @param {String} styleName Name of the style to be modified.
  81035. // @returns {Object}
  81036. function getStyleUpdater( el, styleName ) {
  81037. return {
  81038. set( value ) {
  81039. el.style[ styleName ] = value;
  81040. },
  81041. remove() {
  81042. el.style[ styleName ] = null;
  81043. }
  81044. };
  81045. }
  81046. // Clones definition of the template.
  81047. //
  81048. // @param {module:ui/template~TemplateDefinition} def
  81049. // @returns {module:ui/template~TemplateDefinition}
  81050. function clone( def ) {
  81051. const clone = Object(lodash_es__WEBPACK_IMPORTED_MODULE_6__["cloneDeepWith"])( def, value => {
  81052. // Don't clone the `Template.bind`* bindings because of the references to Observable
  81053. // and DomEmitterMixin instances inside, which would also be traversed and cloned by greedy
  81054. // cloneDeepWith algorithm. There's no point in cloning Observable/DomEmitterMixins
  81055. // along with the definition.
  81056. //
  81057. // Don't clone Template instances if provided as a child. They're simply #render()ed
  81058. // and nothing should interfere.
  81059. //
  81060. // Also don't clone View instances if provided as a child of the Template. The template
  81061. // instance will be extracted from the View during the normalization and there's no need
  81062. // to clone it.
  81063. if ( value && ( value instanceof TemplateBinding || isTemplate( value ) || isView( value ) || isViewCollection( value ) ) ) {
  81064. return value;
  81065. }
  81066. } );
  81067. return clone;
  81068. }
  81069. // Normalizes given {@link module:ui/template~TemplateDefinition}.
  81070. //
  81071. // See:
  81072. // * {@link normalizeAttributes}
  81073. // * {@link normalizeListeners}
  81074. // * {@link normalizePlainTextDefinition}
  81075. // * {@link normalizeTextDefinition}
  81076. //
  81077. // @param {module:ui/template~TemplateDefinition} def
  81078. // @returns {module:ui/template~TemplateDefinition} Normalized definition.
  81079. function normalize( def ) {
  81080. if ( typeof def == 'string' ) {
  81081. def = normalizePlainTextDefinition( def );
  81082. } else if ( def.text ) {
  81083. normalizeTextDefinition( def );
  81084. }
  81085. if ( def.on ) {
  81086. def.eventListeners = normalizeListeners( def.on );
  81087. // Template mixes EmitterMixin, so delete #on to avoid collision.
  81088. delete def.on;
  81089. }
  81090. if ( !def.text ) {
  81091. if ( def.attributes ) {
  81092. normalizeAttributes( def.attributes );
  81093. }
  81094. const children = [];
  81095. if ( def.children ) {
  81096. if ( isViewCollection( def.children ) ) {
  81097. children.push( def.children );
  81098. } else {
  81099. for ( const child of def.children ) {
  81100. if ( isTemplate( child ) || isView( child ) || Object(_ckeditor_ckeditor5_utils_src_dom_isnode__WEBPACK_IMPORTED_MODULE_5__["default"])( child ) ) {
  81101. children.push( child );
  81102. } else {
  81103. children.push( new Template( child ) );
  81104. }
  81105. }
  81106. }
  81107. }
  81108. def.children = children;
  81109. }
  81110. return def;
  81111. }
  81112. // Normalizes "attributes" section of {@link module:ui/template~TemplateDefinition}.
  81113. //
  81114. // attributes: {
  81115. // a: 'bar',
  81116. // b: {@link module:ui/template~TemplateBinding},
  81117. // c: {
  81118. // value: 'bar'
  81119. // }
  81120. // }
  81121. //
  81122. // becomes
  81123. //
  81124. // attributes: {
  81125. // a: [ 'bar' ],
  81126. // b: [ {@link module:ui/template~TemplateBinding} ],
  81127. // c: {
  81128. // value: [ 'bar' ]
  81129. // }
  81130. // }
  81131. //
  81132. // @param {Object} attributes
  81133. function normalizeAttributes( attributes ) {
  81134. for ( const a in attributes ) {
  81135. if ( attributes[ a ].value ) {
  81136. attributes[ a ].value = Object(_ckeditor_ckeditor5_utils_src_toarray__WEBPACK_IMPORTED_MODULE_7__["default"])( attributes[ a ].value );
  81137. }
  81138. arrayify( attributes, a );
  81139. }
  81140. }
  81141. // Normalizes "on" section of {@link module:ui/template~TemplateDefinition}.
  81142. //
  81143. // on: {
  81144. // a: 'bar',
  81145. // b: {@link module:ui/template~TemplateBinding},
  81146. // c: [ {@link module:ui/template~TemplateBinding}, () => { ... } ]
  81147. // }
  81148. //
  81149. // becomes
  81150. //
  81151. // on: {
  81152. // a: [ 'bar' ],
  81153. // b: [ {@link module:ui/template~TemplateBinding} ],
  81154. // c: [ {@link module:ui/template~TemplateBinding}, () => { ... } ]
  81155. // }
  81156. //
  81157. // @param {Object} listeners
  81158. // @returns {Object} Object containing normalized listeners.
  81159. function normalizeListeners( listeners ) {
  81160. for ( const l in listeners ) {
  81161. arrayify( listeners, l );
  81162. }
  81163. return listeners;
  81164. }
  81165. // Normalizes "string" {@link module:ui/template~TemplateDefinition}.
  81166. //
  81167. // "foo"
  81168. //
  81169. // becomes
  81170. //
  81171. // { text: [ 'foo' ] },
  81172. //
  81173. // @param {String} def
  81174. // @returns {module:ui/template~TemplateDefinition} Normalized template definition.
  81175. function normalizePlainTextDefinition( def ) {
  81176. return {
  81177. text: [ def ]
  81178. };
  81179. }
  81180. // Normalizes text {@link module:ui/template~TemplateDefinition}.
  81181. //
  81182. // children: [
  81183. // { text: 'def' },
  81184. // { text: {@link module:ui/template~TemplateBinding} }
  81185. // ]
  81186. //
  81187. // becomes
  81188. //
  81189. // children: [
  81190. // { text: [ 'def' ] },
  81191. // { text: [ {@link module:ui/template~TemplateBinding} ] }
  81192. // ]
  81193. //
  81194. // @param {module:ui/template~TemplateDefinition} def
  81195. function normalizeTextDefinition( def ) {
  81196. def.text = Object(_ckeditor_ckeditor5_utils_src_toarray__WEBPACK_IMPORTED_MODULE_7__["default"])( def.text );
  81197. }
  81198. // Wraps an entry in Object in an Array, if not already one.
  81199. //
  81200. // {
  81201. // x: 'y',
  81202. // a: [ 'b' ]
  81203. // }
  81204. //
  81205. // becomes
  81206. //
  81207. // {
  81208. // x: [ 'y' ],
  81209. // a: [ 'b' ]
  81210. // }
  81211. //
  81212. // @param {Object} obj
  81213. // @param {String} key
  81214. function arrayify( obj, key ) {
  81215. obj[ key ] = Object(_ckeditor_ckeditor5_utils_src_toarray__WEBPACK_IMPORTED_MODULE_7__["default"])( obj[ key ] );
  81216. }
  81217. // A helper which concatenates the value avoiding unwanted
  81218. // leading white spaces.
  81219. //
  81220. // @param {String} prev
  81221. // @param {String} cur
  81222. // @returns {String}
  81223. function arrayValueReducer( prev, cur ) {
  81224. if ( isFalsy( cur ) ) {
  81225. return prev;
  81226. } else if ( isFalsy( prev ) ) {
  81227. return cur;
  81228. } else {
  81229. return `${ prev } ${ cur }`;
  81230. }
  81231. }
  81232. // Extends one object defined in the following format:
  81233. //
  81234. // {
  81235. // key1: [Array1],
  81236. // key2: [Array2],
  81237. // ...
  81238. // keyN: [ArrayN]
  81239. // }
  81240. //
  81241. // with another object of the same data format.
  81242. //
  81243. // @param {Object} obj Base object.
  81244. // @param {Object} ext Object extending base.
  81245. // @returns {String}
  81246. function extendObjectValueArray( obj, ext ) {
  81247. for ( const a in ext ) {
  81248. if ( obj[ a ] ) {
  81249. obj[ a ].push( ...ext[ a ] );
  81250. } else {
  81251. obj[ a ] = ext[ a ];
  81252. }
  81253. }
  81254. }
  81255. // A helper for {@link module:ui/template~Template#extend}. Recursively extends {@link module:ui/template~Template} instance
  81256. // with content from {@link module:ui/template~TemplateDefinition}. See {@link module:ui/template~Template#extend} to learn more.
  81257. //
  81258. // @param {module:ui/template~Template} def A template instance to be extended.
  81259. // @param {module:ui/template~TemplateDefinition} def A definition which is to extend the template instance.
  81260. // @param {Object} Error context.
  81261. function extendTemplate( template, def ) {
  81262. if ( def.attributes ) {
  81263. if ( !template.attributes ) {
  81264. template.attributes = {};
  81265. }
  81266. extendObjectValueArray( template.attributes, def.attributes );
  81267. }
  81268. if ( def.eventListeners ) {
  81269. if ( !template.eventListeners ) {
  81270. template.eventListeners = {};
  81271. }
  81272. extendObjectValueArray( template.eventListeners, def.eventListeners );
  81273. }
  81274. if ( def.text ) {
  81275. template.text.push( ...def.text );
  81276. }
  81277. if ( def.children && def.children.length ) {
  81278. if ( template.children.length != def.children.length ) {
  81279. /**
  81280. * The number of children in extended definition does not match.
  81281. *
  81282. * @error ui-template-extend-children-mismatch
  81283. */
  81284. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"](
  81285. 'ui-template-extend-children-mismatch',
  81286. template
  81287. );
  81288. }
  81289. let childIndex = 0;
  81290. for ( const childDef of def.children ) {
  81291. extendTemplate( template.children[ childIndex++ ], childDef );
  81292. }
  81293. }
  81294. }
  81295. // Checks if value is "falsy".
  81296. // Note: 0 (Number) is not "falsy" in this context.
  81297. //
  81298. // @private
  81299. // @param {*} value Value to be checked.
  81300. function isFalsy( value ) {
  81301. return !value && value !== 0;
  81302. }
  81303. // Checks if the item is an instance of {@link module:ui/view~View}
  81304. //
  81305. // @private
  81306. // @param {*} value Value to be checked.
  81307. function isView( item ) {
  81308. return item instanceof _view__WEBPACK_IMPORTED_MODULE_3__["default"];
  81309. }
  81310. // Checks if the item is an instance of {@link module:ui/template~Template}
  81311. //
  81312. // @private
  81313. // @param {*} value Value to be checked.
  81314. function isTemplate( item ) {
  81315. return item instanceof Template;
  81316. }
  81317. // Checks if the item is an instance of {@link module:ui/viewcollection~ViewCollection}
  81318. //
  81319. // @private
  81320. // @param {*} value Value to be checked.
  81321. function isViewCollection( item ) {
  81322. return item instanceof _viewcollection__WEBPACK_IMPORTED_MODULE_4__["default"];
  81323. }
  81324. // Creates an empty skeleton for {@link module:ui/template~Template#revert}
  81325. // data.
  81326. //
  81327. // @private
  81328. function getEmptyRevertData() {
  81329. return {
  81330. children: [],
  81331. bindings: [],
  81332. attributes: {}
  81333. };
  81334. }
  81335. // Checks whether an attribute should be extended when
  81336. // {@link module:ui/template~Template#apply} is called.
  81337. //
  81338. // @private
  81339. // @param {String} attrName Attribute name to check.
  81340. function shouldExtend( attrName ) {
  81341. return attrName == 'class' || attrName == 'style';
  81342. }
  81343. /**
  81344. * A definition of the {@link module:ui/template~Template}. It describes what kind of
  81345. * node a template will render (HTML element or text), attributes of an element, DOM event
  81346. * listeners and children.
  81347. *
  81348. * Also see:
  81349. * * {@link module:ui/template~TemplateValueSchema} to learn about HTML element attributes,
  81350. * * {@link module:ui/template~TemplateListenerSchema} to learn about DOM event listeners.
  81351. *
  81352. * A sample definition on an HTML element can look like this:
  81353. *
  81354. * new Template( {
  81355. * tag: 'p',
  81356. * children: [
  81357. * {
  81358. * tag: 'span',
  81359. * attributes: { ... },
  81360. * children: [ ... ],
  81361. * },
  81362. * {
  81363. * text: 'static–text'
  81364. * },
  81365. * 'also-static–text',
  81366. * ],
  81367. * attributes: {
  81368. * class: {@link module:ui/template~TemplateValueSchema},
  81369. * id: {@link module:ui/template~TemplateValueSchema},
  81370. * style: {@link module:ui/template~TemplateValueSchema}
  81371. *
  81372. * // ...
  81373. * },
  81374. * on: {
  81375. * 'click': {@link module:ui/template~TemplateListenerSchema}
  81376. *
  81377. * // Document.querySelector format is also accepted.
  81378. * 'keyup@a.some-class': {@link module:ui/template~TemplateListenerSchema}
  81379. *
  81380. * // ...
  81381. * }
  81382. * } );
  81383. *
  81384. * A {@link module:ui/view~View}, another {@link module:ui/template~Template} or a native DOM node
  81385. * can also become a child of a template. When a view is passed, its {@link module:ui/view~View#element} is used:
  81386. *
  81387. * const view = new SomeView();
  81388. * const childTemplate = new Template( { ... } );
  81389. * const childNode = document.createElement( 'b' );
  81390. *
  81391. * new Template( {
  81392. * tag: 'p',
  81393. *
  81394. * children: [
  81395. * // view#element will be added as a child of this <p>.
  81396. * view,
  81397. *
  81398. * // The output of childTemplate.render() will be added here.
  81399. * childTemplate,
  81400. *
  81401. * // Native DOM nodes are included directly in the rendered output.
  81402. * childNode
  81403. * ]
  81404. * } );
  81405. *
  81406. * An entire {@link module:ui/viewcollection~ViewCollection} can be used as a child in the definition:
  81407. *
  81408. * const collection = new ViewCollection();
  81409. * collection.add( someView );
  81410. *
  81411. * new Template( {
  81412. * tag: 'p',
  81413. *
  81414. * children: collection
  81415. * } );
  81416. *
  81417. * @typedef module:ui/template~TemplateDefinition
  81418. * @type Object
  81419. *
  81420. * @property {String} tag See the template {@link module:ui/template~Template#tag} property.
  81421. *
  81422. * @property {Array.<module:ui/template~TemplateDefinition>} [children]
  81423. * See the template {@link module:ui/template~Template#children} property.
  81424. *
  81425. * @property {Object.<String, module:ui/template~TemplateValueSchema>} [attributes]
  81426. * See the template {@link module:ui/template~Template#attributes} property.
  81427. *
  81428. * @property {String|module:ui/template~TemplateValueSchema|Array.<String|module:ui/template~TemplateValueSchema>} [text]
  81429. * See the template {@link module:ui/template~Template#text} property.
  81430. *
  81431. * @property {Object.<String, module:ui/template~TemplateListenerSchema>} [on]
  81432. * See the template {@link module:ui/template~Template#eventListeners} property.
  81433. */
  81434. /**
  81435. * Describes a value of an HTML element attribute or `textContent`. It allows combining multiple
  81436. * data sources like static values and {@link module:utils/observablemixin~Observable} attributes.
  81437. *
  81438. * Also see:
  81439. * * {@link module:ui/template~TemplateDefinition} to learn where to use it,
  81440. * * {@link module:ui/template~Template.bind} to learn how to configure
  81441. * {@link module:utils/observablemixin~Observable} attribute bindings,
  81442. * * {@link module:ui/template~Template#render} to learn how to render a template,
  81443. * * {@link module:ui/template~BindChain#to `to()`} and {@link module:ui/template~BindChain#if `if()`}
  81444. * methods to learn more about bindings.
  81445. *
  81446. * Attribute values can be described in many different ways:
  81447. *
  81448. * // Bind helper will create bindings to attributes of the observable.
  81449. * const bind = Template.bind( observable, emitter );
  81450. *
  81451. * new Template( {
  81452. * tag: 'p',
  81453. * attributes: {
  81454. * // A plain string schema.
  81455. * 'class': 'static-text',
  81456. *
  81457. * // An object schema, binds to the "foo" attribute of the
  81458. * // observable and follows its value.
  81459. * 'class': bind.to( 'foo' ),
  81460. *
  81461. * // An array schema, combines the above.
  81462. * 'class': [
  81463. * 'static-text',
  81464. * bind.to( 'bar', () => { ... } ),
  81465. *
  81466. * // Bindings can also be conditional.
  81467. * bind.if( 'baz', 'class-when-baz-is-true' )
  81468. * ],
  81469. *
  81470. * // An array schema, with a custom namespace, e.g. useful for creating SVGs.
  81471. * 'class': {
  81472. * ns: 'http://ns.url',
  81473. * value: [
  81474. * bind.if( 'baz', 'value-when-true' ),
  81475. * 'static-text'
  81476. * ]
  81477. * },
  81478. *
  81479. * // An object schema, specific for styles.
  81480. * style: {
  81481. * color: 'red',
  81482. * backgroundColor: bind.to( 'qux', () => { ... } )
  81483. * }
  81484. * }
  81485. * } );
  81486. *
  81487. * Text nodes can also have complex values:
  81488. *
  81489. * const bind = Template.bind( observable, emitter );
  81490. *
  81491. * // Will render a "foo" text node.
  81492. * new Template( {
  81493. * text: 'foo'
  81494. * } );
  81495. *
  81496. * // Will render a "static text: {observable.foo}" text node.
  81497. * // The text of the node will be updated as the "foo" attribute changes.
  81498. * new Template( {
  81499. * text: [
  81500. * 'static text: ',
  81501. * bind.to( 'foo', () => { ... } )
  81502. * ]
  81503. * } );
  81504. *
  81505. * @typedef module:ui/template~TemplateValueSchema
  81506. * @type {Object|String|Array}
  81507. */
  81508. /**
  81509. * Describes an event listener attached to an HTML element. Such listener can propagate DOM events
  81510. * through an {@link module:utils/observablemixin~Observable} instance, execute custom callbacks
  81511. * or both, if necessary.
  81512. *
  81513. * Also see:
  81514. * * {@link module:ui/template~TemplateDefinition} to learn more about template definitions,
  81515. * * {@link module:ui/template~BindChain#to `to()`} method to learn more about bindings.
  81516. *
  81517. * Check out different ways of attaching event listeners below:
  81518. *
  81519. * // Bind helper will propagate events through the observable.
  81520. * const bind = Template.bind( observable, emitter );
  81521. *
  81522. * new Template( {
  81523. * tag: 'p',
  81524. * on: {
  81525. * // An object schema. The observable will fire the "clicked" event upon DOM "click".
  81526. * click: bind.to( 'clicked' )
  81527. *
  81528. * // An object schema. It will work for "click" event on "a.foo" children only.
  81529. * 'click@a.foo': bind.to( 'clicked' )
  81530. *
  81531. * // An array schema, makes the observable propagate multiple events.
  81532. * click: [
  81533. * bind.to( 'clicked' ),
  81534. * bind.to( 'executed' )
  81535. * ],
  81536. *
  81537. * // An array schema with a custom callback.
  81538. * 'click@a.foo': {
  81539. * bind.to( 'clicked' ),
  81540. * bind.to( evt => {
  81541. * console.log( `${ evt.target } has been clicked!` );
  81542. * } }
  81543. * }
  81544. * }
  81545. * } );
  81546. *
  81547. * @typedef module:ui/template~TemplateListenerSchema
  81548. * @type {Object|String|Array}
  81549. */
  81550. /**
  81551. * The return value of {@link ~Template.bind `Template.bind()`}. It provides `to()` and `if()`
  81552. * methods to create the {@link module:utils/observablemixin~Observable observable} attribute and event bindings.
  81553. *
  81554. * @interface module:ui/template~BindChain
  81555. */
  81556. /**
  81557. * Binds an {@link module:utils/observablemixin~Observable observable} to either:
  81558. *
  81559. * * an HTML element attribute or a text node `textContent`, so it remains in sync with the observable
  81560. * attribute as it changes,
  81561. * * or an HTML element DOM event, so the DOM events are propagated through an observable.
  81562. *
  81563. * Some common use cases of `to()` bindings are presented below:
  81564. *
  81565. * const bind = Template.bind( observable, emitter );
  81566. *
  81567. * new Template( {
  81568. * tag: 'p',
  81569. * attributes: {
  81570. * // class="..." attribute gets bound to `observable#a`
  81571. * class: bind.to( 'a' )
  81572. * },
  81573. * children: [
  81574. * // <p>...</p> gets bound to observable#b; always `toUpperCase()`.
  81575. * {
  81576. * text: bind.to( 'b', ( value, node ) => value.toUpperCase() )
  81577. * }
  81578. * ],
  81579. * on: {
  81580. * click: [
  81581. * // An observable will fire "clicked" upon "click" in the DOM.
  81582. * bind.to( 'clicked' ),
  81583. *
  81584. * // A custom callback will be executed upon "click" in the DOM.
  81585. * bind.to( () => {
  81586. * ...
  81587. * } )
  81588. * ]
  81589. * }
  81590. * } ).render();
  81591. *
  81592. * Learn more about using `to()` in the {@link module:ui/template~TemplateValueSchema} and
  81593. * {@link module:ui/template~TemplateListenerSchema}.
  81594. *
  81595. * @method #to
  81596. * @param {String|Function} eventNameOrFunctionOrAttribute An attribute name of
  81597. * {@link module:utils/observablemixin~Observable} or a DOM event name or an event callback.
  81598. * @param {Function} [callback] Allows for processing of the value. Accepts `Node` and `value` as arguments.
  81599. * @returns {module:ui/template~TemplateBinding}
  81600. */
  81601. /**
  81602. * Binds an {@link module:utils/observablemixin~Observable observable} to an HTML element attribute or a text
  81603. * node `textContent` so it remains in sync with the observable attribute as it changes.
  81604. *
  81605. * Unlike {@link module:ui/template~BindChain#to}, it controls the presence of the attribute or `textContent`
  81606. * depending on the "falseness" of an {@link module:utils/observablemixin~Observable} attribute.
  81607. *
  81608. * const bind = Template.bind( observable, emitter );
  81609. *
  81610. * new Template( {
  81611. * tag: 'input',
  81612. * attributes: {
  81613. * // <input checked> when `observable#a` is not undefined/null/false/''
  81614. * // <input> when `observable#a` is undefined/null/false
  81615. * checked: bind.if( 'a' )
  81616. * },
  81617. * children: [
  81618. * {
  81619. * // <input>"b-is-not-set"</input> when `observable#b` is undefined/null/false/''
  81620. * // <input></input> when `observable#b` is not "falsy"
  81621. * text: bind.if( 'b', 'b-is-not-set', ( value, node ) => !value )
  81622. * }
  81623. * ]
  81624. * } ).render();
  81625. *
  81626. * Learn more about using `if()` in the {@link module:ui/template~TemplateValueSchema}.
  81627. *
  81628. * @method #if
  81629. * @param {String} attribute An attribute name of {@link module:utils/observablemixin~Observable} used in the binding.
  81630. * @param {String} [valueIfTrue] Value set when the {@link module:utils/observablemixin~Observable} attribute is not
  81631. * undefined/null/false/'' (empty string).
  81632. * @param {Function} [callback] Allows for processing of the value. Accepts `Node` and `value` as arguments.
  81633. * @returns {module:ui/template~TemplateBinding}
  81634. */
  81635. /**
  81636. * The {@link module:ui/template~Template#_renderNode} configuration.
  81637. *
  81638. * @private
  81639. * @interface module:ui/template~RenderData
  81640. */
  81641. /**
  81642. * Tells {@link module:ui/template~Template#_renderNode} to render
  81643. * children into `DocumentFragment` first and then append the fragment
  81644. * to the parent element. It is a speed optimization.
  81645. *
  81646. * @member {Boolean} #intoFragment
  81647. */
  81648. /**
  81649. * A node which is being rendered.
  81650. *
  81651. * @member {HTMLElement|Text} #node
  81652. */
  81653. /**
  81654. * Indicates whether the {@module:ui/template~RenderNodeOptions#node} has
  81655. * been provided by {@module:ui/template~Template#apply}.
  81656. *
  81657. * @member {Boolean} #isApplying
  81658. */
  81659. /**
  81660. * An object storing the data that helps {@module:ui/template~Template#revert}
  81661. * bringing back an element to its initial state, i.e. before
  81662. * {@module:ui/template~Template#apply} was called.
  81663. *
  81664. * @member {Object} #revertData
  81665. */
  81666. /***/ }),
  81667. /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/toolbar/balloon/balloontoolbar.js":
  81668. /*!***********************************************************************************!*\
  81669. !*** ./node_modules/@ckeditor/ckeditor5-ui/src/toolbar/balloon/balloontoolbar.js ***!
  81670. \***********************************************************************************/
  81671. /*! exports provided: default */
  81672. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  81673. "use strict";
  81674. __webpack_require__.r(__webpack_exports__);
  81675. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return BalloonToolbar; });
  81676. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  81677. /* harmony import */ var _panel_balloon_contextualballoon__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../panel/balloon/contextualballoon */ "./node_modules/@ckeditor/ckeditor5-ui/src/panel/balloon/contextualballoon.js");
  81678. /* harmony import */ var _toolbarview__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../toolbarview */ "./node_modules/@ckeditor/ckeditor5-ui/src/toolbar/toolbarview.js");
  81679. /* harmony import */ var _panel_balloon_balloonpanelview_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../panel/balloon/balloonpanelview.js */ "./node_modules/@ckeditor/ckeditor5-ui/src/panel/balloon/balloonpanelview.js");
  81680. /* harmony import */ var _ckeditor_ckeditor5_utils_src_focustracker__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/focustracker */ "./node_modules/@ckeditor/ckeditor5-utils/src/focustracker.js");
  81681. /* harmony import */ var _ckeditor_ckeditor5_utils_src_dom_rect__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/dom/rect */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/rect.js");
  81682. /* harmony import */ var _normalizetoolbarconfig__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../normalizetoolbarconfig */ "./node_modules/@ckeditor/ckeditor5-ui/src/toolbar/normalizetoolbarconfig.js");
  81683. /* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! lodash-es */ "./node_modules/lodash-es/lodash.js");
  81684. /* harmony import */ var _ckeditor_ckeditor5_utils_src_dom_resizeobserver__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/dom/resizeobserver */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/resizeobserver.js");
  81685. /* harmony import */ var _ckeditor_ckeditor5_utils_src_dom_tounit__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/dom/tounit */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/tounit.js");
  81686. /**
  81687. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  81688. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  81689. */
  81690. /**
  81691. * @module ui/toolbar/balloon/balloontoolbar
  81692. */
  81693. const toPx = Object(_ckeditor_ckeditor5_utils_src_dom_tounit__WEBPACK_IMPORTED_MODULE_9__["default"])( 'px' );
  81694. /**
  81695. * The contextual toolbar.
  81696. *
  81697. * It uses the {@link module:ui/panel/balloon/contextualballoon~ContextualBalloon contextual balloon plugin}.
  81698. *
  81699. * @extends module:core/plugin~Plugin
  81700. */
  81701. class BalloonToolbar extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  81702. /**
  81703. * @inheritDoc
  81704. */
  81705. static get pluginName() {
  81706. return 'BalloonToolbar';
  81707. }
  81708. /**
  81709. * @inheritDoc
  81710. */
  81711. static get requires() {
  81712. return [ _panel_balloon_contextualballoon__WEBPACK_IMPORTED_MODULE_1__["default"] ];
  81713. }
  81714. /**
  81715. * @inheritDoc
  81716. */
  81717. constructor( editor ) {
  81718. super( editor );
  81719. /**
  81720. * A cached and normalized `config.balloonToolbar` object.
  81721. *
  81722. * @type {module:core/editor/editorconfig~EditorConfig#balloonToolbar}
  81723. * @private
  81724. */
  81725. this._balloonConfig = Object(_normalizetoolbarconfig__WEBPACK_IMPORTED_MODULE_6__["default"])( editor.config.get( 'balloonToolbar' ) );
  81726. /**
  81727. * The toolbar view displayed in the balloon.
  81728. *
  81729. * @type {module:ui/toolbar/toolbarview~ToolbarView}
  81730. */
  81731. this.toolbarView = this._createToolbarView();
  81732. /**
  81733. * Tracks the focus of the {@link module:core/editor/editorui~EditorUI#getEditableElement editable element}
  81734. * and the {@link #toolbarView}. When both are blurred then the toolbar should hide.
  81735. *
  81736. * @readonly
  81737. * @type {module:utils:focustracker~FocusTracker}
  81738. */
  81739. this.focusTracker = new _ckeditor_ckeditor5_utils_src_focustracker__WEBPACK_IMPORTED_MODULE_4__["default"]();
  81740. // Wait for the EditorUI#init. EditableElement is not available before.
  81741. editor.ui.once( 'ready', () => {
  81742. this.focusTracker.add( editor.ui.getEditableElement() );
  81743. this.focusTracker.add( this.toolbarView.element );
  81744. } );
  81745. /**
  81746. * An instance of the resize observer that allows to respond to changes in editable's geometry
  81747. * so the toolbar can stay within its boundaries (and group toolbar items that do not fit).
  81748. *
  81749. * **Note**: Used only when `shouldNotGroupWhenFull` was **not** set in the
  81750. * {@link module:core/editor/editorconfig~EditorConfig#balloonToolbar configuration}.
  81751. *
  81752. * **Note:** Created in {@link #init}.
  81753. *
  81754. * @protected
  81755. * @member {module:utils/dom/resizeobserver~ResizeObserver}
  81756. */
  81757. this._resizeObserver = null;
  81758. /**
  81759. * The contextual balloon plugin instance.
  81760. *
  81761. * @private
  81762. * @type {module:ui/panel/balloon/contextualballoon~ContextualBalloon}
  81763. */
  81764. this._balloon = editor.plugins.get( _panel_balloon_contextualballoon__WEBPACK_IMPORTED_MODULE_1__["default"] );
  81765. /**
  81766. * Fires {@link #event:_selectionChangeDebounced} event using `lodash#debounce`.
  81767. *
  81768. * This function is stored as a plugin property to make possible to cancel
  81769. * trailing debounced invocation on destroy.
  81770. *
  81771. * @private
  81772. * @type {Function}
  81773. */
  81774. this._fireSelectionChangeDebounced = Object(lodash_es__WEBPACK_IMPORTED_MODULE_7__["debounce"])( () => this.fire( '_selectionChangeDebounced' ), 200 );
  81775. // The appearance of the BalloonToolbar method is event–driven.
  81776. // It is possible to stop the #show event and this prevent the toolbar from showing up.
  81777. this.decorate( 'show' );
  81778. }
  81779. /**
  81780. * @inheritDoc
  81781. */
  81782. init() {
  81783. const editor = this.editor;
  81784. const selection = editor.model.document.selection;
  81785. // Show/hide the toolbar on editable focus/blur.
  81786. this.listenTo( this.focusTracker, 'change:isFocused', ( evt, name, isFocused ) => {
  81787. const isToolbarVisible = this._balloon.visibleView === this.toolbarView;
  81788. if ( !isFocused && isToolbarVisible ) {
  81789. this.hide();
  81790. } else if ( isFocused ) {
  81791. this.show();
  81792. }
  81793. } );
  81794. // Hide the toolbar when the selection is changed by a direct change or has changed to collapsed.
  81795. this.listenTo( selection, 'change:range', ( evt, data ) => {
  81796. if ( data.directChange || selection.isCollapsed ) {
  81797. this.hide();
  81798. }
  81799. // Fire internal `_selectionChangeDebounced` event to use it for showing
  81800. // the toolbar after the selection stops changing.
  81801. this._fireSelectionChangeDebounced();
  81802. } );
  81803. // Show the toolbar when the selection stops changing.
  81804. this.listenTo( this, '_selectionChangeDebounced', () => {
  81805. if ( this.editor.editing.view.document.isFocused ) {
  81806. this.show();
  81807. }
  81808. } );
  81809. if ( !this._balloonConfig.shouldNotGroupWhenFull ) {
  81810. this.listenTo( editor, 'ready', () => {
  81811. const editableElement = editor.ui.view.editable.element;
  81812. // Set #toolbarView's max-width on the initialization and update it on the editable resize.
  81813. this._resizeObserver = new _ckeditor_ckeditor5_utils_src_dom_resizeobserver__WEBPACK_IMPORTED_MODULE_8__["default"]( editableElement, () => {
  81814. // The max-width equals 90% of the editable's width for the best user experience.
  81815. // The value keeps the balloon very close to the boundaries of the editable and limits the cases
  81816. // when the balloon juts out from the editable element it belongs to.
  81817. this.toolbarView.maxWidth = toPx( new _ckeditor_ckeditor5_utils_src_dom_rect__WEBPACK_IMPORTED_MODULE_5__["default"]( editableElement ).width * .9 );
  81818. } );
  81819. } );
  81820. }
  81821. // Listen to the toolbar view and whenever it changes its geometry due to some items being
  81822. // grouped or ungrouped, update the position of the balloon because a shorter/longer toolbar
  81823. // means the balloon could be pointing at the wrong place. Once updated, the balloon will point
  81824. // at the right selection in the content again.
  81825. // https://github.com/ckeditor/ckeditor5/issues/6444
  81826. this.listenTo( this.toolbarView, 'groupedItemsUpdate', () => {
  81827. this._updatePosition();
  81828. } );
  81829. }
  81830. /**
  81831. * Creates toolbar components based on given configuration.
  81832. * This needs to be done when all plugins are ready.
  81833. *
  81834. * @inheritDoc
  81835. */
  81836. afterInit() {
  81837. const factory = this.editor.ui.componentFactory;
  81838. this.toolbarView.fillFromConfig( this._balloonConfig, factory );
  81839. }
  81840. /**
  81841. * Creates the toolbar view instance.
  81842. *
  81843. * @private
  81844. * @returns {module:ui/toolbar/toolbarview~ToolbarView}
  81845. */
  81846. _createToolbarView() {
  81847. const shouldGroupWhenFull = !this._balloonConfig.shouldNotGroupWhenFull;
  81848. const toolbarView = new _toolbarview__WEBPACK_IMPORTED_MODULE_2__["default"]( this.editor.locale, {
  81849. shouldGroupWhenFull,
  81850. isFloating: true
  81851. } );
  81852. toolbarView.render();
  81853. return toolbarView;
  81854. }
  81855. /**
  81856. * Shows the toolbar and attaches it to the selection.
  81857. *
  81858. * Fires {@link #event:show} event which can be stopped to prevent the toolbar from showing up.
  81859. */
  81860. show() {
  81861. const editor = this.editor;
  81862. const selection = editor.model.document.selection;
  81863. const schema = editor.model.schema;
  81864. // Do not add the toolbar to the balloon stack twice.
  81865. if ( this._balloon.hasView( this.toolbarView ) ) {
  81866. return;
  81867. }
  81868. // Do not show the toolbar when the selection is collapsed.
  81869. if ( selection.isCollapsed ) {
  81870. return;
  81871. }
  81872. // Do not show the toolbar when there is more than one range in the selection and they fully contain selectable elements.
  81873. // See https://github.com/ckeditor/ckeditor5/issues/6443.
  81874. if ( selectionContainsOnlyMultipleSelectables( selection, schema ) ) {
  81875. return;
  81876. }
  81877. // Don not show the toolbar when all components inside are disabled
  81878. // see https://github.com/ckeditor/ckeditor5-ui/issues/269.
  81879. if ( Array.from( this.toolbarView.items ).every( item => item.isEnabled !== undefined && !item.isEnabled ) ) {
  81880. return;
  81881. }
  81882. // Update the toolbar position when the editor ui should be refreshed.
  81883. this.listenTo( this.editor.ui, 'update', () => {
  81884. this._updatePosition();
  81885. } );
  81886. // Add the toolbar to the common editor contextual balloon.
  81887. this._balloon.add( {
  81888. view: this.toolbarView,
  81889. position: this._getBalloonPositionData(),
  81890. balloonClassName: 'ck-toolbar-container'
  81891. } );
  81892. }
  81893. /**
  81894. * Hides the toolbar.
  81895. */
  81896. hide() {
  81897. if ( this._balloon.hasView( this.toolbarView ) ) {
  81898. this.stopListening( this.editor.ui, 'update' );
  81899. this._balloon.remove( this.toolbarView );
  81900. }
  81901. }
  81902. /**
  81903. * Returns positioning options for the {@link #_balloon}. They control the way balloon is attached
  81904. * to the selection.
  81905. *
  81906. * @private
  81907. * @returns {module:utils/dom/position~Options}
  81908. */
  81909. _getBalloonPositionData() {
  81910. const editor = this.editor;
  81911. const view = editor.editing.view;
  81912. const viewDocument = view.document;
  81913. const viewSelection = viewDocument.selection;
  81914. // Get direction of the selection.
  81915. const isBackward = viewDocument.selection.isBackward;
  81916. return {
  81917. // Because the target for BalloonPanelView is a Rect (not DOMRange), it's geometry will stay fixed
  81918. // as the window scrolls. To let the BalloonPanelView follow such Rect, is must be continuously
  81919. // computed and hence, the target is defined as a function instead of a static value.
  81920. // https://github.com/ckeditor/ckeditor5-ui/issues/195
  81921. target: () => {
  81922. const range = isBackward ? viewSelection.getFirstRange() : viewSelection.getLastRange();
  81923. const rangeRects = _ckeditor_ckeditor5_utils_src_dom_rect__WEBPACK_IMPORTED_MODULE_5__["default"].getDomRangeRects( view.domConverter.viewRangeToDom( range ) );
  81924. // Select the proper range rect depending on the direction of the selection.
  81925. if ( isBackward ) {
  81926. return rangeRects[ 0 ];
  81927. } else {
  81928. // Ditch the zero-width "orphan" rect in the next line for the forward selection if there's
  81929. // another one preceding it. It is not rendered as a selection by the web browser anyway.
  81930. // https://github.com/ckeditor/ckeditor5-ui/issues/308
  81931. if ( rangeRects.length > 1 && rangeRects[ rangeRects.length - 1 ].width === 0 ) {
  81932. rangeRects.pop();
  81933. }
  81934. return rangeRects[ rangeRects.length - 1 ];
  81935. }
  81936. },
  81937. positions: getBalloonPositions( isBackward )
  81938. };
  81939. }
  81940. /**
  81941. * Updates the position of the {@link #_balloon} to make up for changes:
  81942. *
  81943. * * in the geometry of the selection it is attached to (e.g. the selection moved in the viewport or expanded or shrunk),
  81944. * * or the geometry of the balloon toolbar itself (e.g. the toolbar has grouped or ungrouped some items and it is shorter or longer).
  81945. *
  81946. * @private
  81947. */
  81948. _updatePosition() {
  81949. this._balloon.updatePosition( this._getBalloonPositionData() );
  81950. }
  81951. /**
  81952. * @inheritDoc
  81953. */
  81954. destroy() {
  81955. super.destroy();
  81956. this.stopListening();
  81957. this._fireSelectionChangeDebounced.cancel();
  81958. this.toolbarView.destroy();
  81959. this.focusTracker.destroy();
  81960. if ( this._resizeObserver ) {
  81961. this._resizeObserver.destroy();
  81962. }
  81963. }
  81964. /**
  81965. * This event is fired just before the toolbar shows up. Stopping this event will prevent this.
  81966. *
  81967. * @event show
  81968. */
  81969. /**
  81970. * This is internal plugin event which is fired 200 ms after model selection last change.
  81971. * This is to makes easy test debounced action without need to use `setTimeout`.
  81972. *
  81973. * @protected
  81974. * @event _selectionChangeDebounced
  81975. */
  81976. }
  81977. // Returns toolbar positions for the given direction of the selection.
  81978. //
  81979. // @private
  81980. // @param {Boolean} isBackward
  81981. // @returns {Array.<module:utils/dom/position~Position>}
  81982. function getBalloonPositions( isBackward ) {
  81983. const defaultPositions = _panel_balloon_balloonpanelview_js__WEBPACK_IMPORTED_MODULE_3__["default"].defaultPositions;
  81984. return isBackward ? [
  81985. defaultPositions.northWestArrowSouth,
  81986. defaultPositions.northWestArrowSouthWest,
  81987. defaultPositions.northWestArrowSouthEast,
  81988. defaultPositions.northWestArrowSouthMiddleEast,
  81989. defaultPositions.northWestArrowSouthMiddleWest,
  81990. defaultPositions.southWestArrowNorth,
  81991. defaultPositions.southWestArrowNorthWest,
  81992. defaultPositions.southWestArrowNorthEast,
  81993. defaultPositions.southWestArrowNorthMiddleWest,
  81994. defaultPositions.southWestArrowNorthMiddleEast
  81995. ] : [
  81996. defaultPositions.southEastArrowNorth,
  81997. defaultPositions.southEastArrowNorthEast,
  81998. defaultPositions.southEastArrowNorthWest,
  81999. defaultPositions.southEastArrowNorthMiddleEast,
  82000. defaultPositions.southEastArrowNorthMiddleWest,
  82001. defaultPositions.northEastArrowSouth,
  82002. defaultPositions.northEastArrowSouthEast,
  82003. defaultPositions.northEastArrowSouthWest,
  82004. defaultPositions.northEastArrowSouthMiddleEast,
  82005. defaultPositions.northEastArrowSouthMiddleWest
  82006. ];
  82007. }
  82008. // Returns "true" when the selection has multiple ranges and each range contains a selectable element
  82009. // and nothing else.
  82010. //
  82011. // @private
  82012. // @param {module:engine/model/selection~Selection} selection
  82013. // @param {module:engine/model/schema~Schema} schema
  82014. // @returns {Boolean}
  82015. function selectionContainsOnlyMultipleSelectables( selection, schema ) {
  82016. // It doesn't contain multiple objects if there is only one range.
  82017. if ( selection.rangeCount === 1 ) {
  82018. return false;
  82019. }
  82020. return [ ...selection.getRanges() ].every( range => {
  82021. const element = range.getContainedElement();
  82022. return element && schema.isSelectable( element );
  82023. } );
  82024. }
  82025. /**
  82026. * Contextual toolbar configuration. Used by the {@link module:ui/toolbar/balloon/balloontoolbar~BalloonToolbar}
  82027. * feature.
  82028. *
  82029. * ## Configuring toolbar items
  82030. *
  82031. * const config = {
  82032. * balloonToolbar: [ 'bold', 'italic', 'undo', 'redo' ]
  82033. * };
  82034. *
  82035. * You can also use `'|'` to create a separator between groups of items:
  82036. *
  82037. * const config = {
  82038. * balloonToolbar: [ 'bold', 'italic', | 'undo', 'redo' ]
  82039. * };
  82040. *
  82041. * Read also about configuring the main editor toolbar in {@link module:core/editor/editorconfig~EditorConfig#toolbar}.
  82042. *
  82043. * ## Configuring items grouping
  82044. *
  82045. * You can prevent automatic items grouping by setting the `shouldNotGroupWhenFull` option:
  82046. *
  82047. * const config = {
  82048. * balloonToolbar: {
  82049. * items: [ 'bold', 'italic', 'undo', 'redo' ],
  82050. * shouldNotGroupWhenFull: true
  82051. * },
  82052. * };
  82053. *
  82054. * @member {Array.<String>|Object} module:core/editor/editorconfig~EditorConfig#balloonToolbar
  82055. */
  82056. /***/ }),
  82057. /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/toolbar/block/blockbuttonview.js":
  82058. /*!**********************************************************************************!*\
  82059. !*** ./node_modules/@ckeditor/ckeditor5-ui/src/toolbar/block/blockbuttonview.js ***!
  82060. \**********************************************************************************/
  82061. /*! exports provided: default */
  82062. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  82063. "use strict";
  82064. __webpack_require__.r(__webpack_exports__);
  82065. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return BlockButtonView; });
  82066. /* harmony import */ var _button_buttonview__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../button/buttonview */ "./node_modules/@ckeditor/ckeditor5-ui/src/button/buttonview.js");
  82067. /* harmony import */ var _ckeditor_ckeditor5_utils_src_dom_tounit__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/dom/tounit */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/tounit.js");
  82068. /* harmony import */ var _theme_components_toolbar_blocktoolbar_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../theme/components/toolbar/blocktoolbar.css */ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/toolbar/blocktoolbar.css");
  82069. /* harmony import */ var _theme_components_toolbar_blocktoolbar_css__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_theme_components_toolbar_blocktoolbar_css__WEBPACK_IMPORTED_MODULE_2__);
  82070. /**
  82071. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  82072. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  82073. */
  82074. /**
  82075. * @module ui/toolbar/block/blockbuttonview
  82076. */
  82077. const toPx = Object(_ckeditor_ckeditor5_utils_src_dom_tounit__WEBPACK_IMPORTED_MODULE_1__["default"])( 'px' );
  82078. /**
  82079. * The block button view class.
  82080. *
  82081. * This view represents a button attached next to block element where the selection is anchored.
  82082. *
  82083. * See {@link module:ui/toolbar/block/blocktoolbar~BlockToolbar}.
  82084. *
  82085. * @extends {module:ui/button/buttonview~ButtonView}
  82086. */
  82087. class BlockButtonView extends _button_buttonview__WEBPACK_IMPORTED_MODULE_0__["default"] {
  82088. /**
  82089. * @inheritDoc
  82090. */
  82091. constructor( locale ) {
  82092. super( locale );
  82093. const bind = this.bindTemplate;
  82094. // Hide button on init.
  82095. this.isVisible = false;
  82096. this.isToggleable = true;
  82097. /**
  82098. * Top offset.
  82099. *
  82100. * @member {Number} #top
  82101. */
  82102. this.set( 'top', 0 );
  82103. /**
  82104. * Left offset.
  82105. *
  82106. * @member {Number} #left
  82107. */
  82108. this.set( 'left', 0 );
  82109. this.extendTemplate( {
  82110. attributes: {
  82111. class: 'ck-block-toolbar-button',
  82112. style: {
  82113. top: bind.to( 'top', val => toPx( val ) ),
  82114. left: bind.to( 'left', val => toPx( val ) )
  82115. }
  82116. }
  82117. } );
  82118. }
  82119. }
  82120. /***/ }),
  82121. /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/toolbar/block/blocktoolbar.js":
  82122. /*!*******************************************************************************!*\
  82123. !*** ./node_modules/@ckeditor/ckeditor5-ui/src/toolbar/block/blocktoolbar.js ***!
  82124. \*******************************************************************************/
  82125. /*! exports provided: default */
  82126. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  82127. "use strict";
  82128. __webpack_require__.r(__webpack_exports__);
  82129. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return BlockToolbar; });
  82130. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  82131. /* harmony import */ var _blockbuttonview__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./blockbuttonview */ "./node_modules/@ckeditor/ckeditor5-ui/src/toolbar/block/blockbuttonview.js");
  82132. /* harmony import */ var _panel_balloon_balloonpanelview__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../panel/balloon/balloonpanelview */ "./node_modules/@ckeditor/ckeditor5-ui/src/panel/balloon/balloonpanelview.js");
  82133. /* harmony import */ var _toolbarview__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../toolbarview */ "./node_modules/@ckeditor/ckeditor5-ui/src/toolbar/toolbarview.js");
  82134. /* harmony import */ var _bindings_clickoutsidehandler__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../bindings/clickoutsidehandler */ "./node_modules/@ckeditor/ckeditor5-ui/src/bindings/clickoutsidehandler.js");
  82135. /* harmony import */ var _ckeditor_ckeditor5_utils_src_dom_position__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/dom/position */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/position.js");
  82136. /* harmony import */ var _ckeditor_ckeditor5_utils_src_dom_rect__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/dom/rect */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/rect.js");
  82137. /* harmony import */ var _normalizetoolbarconfig__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../normalizetoolbarconfig */ "./node_modules/@ckeditor/ckeditor5-ui/src/toolbar/normalizetoolbarconfig.js");
  82138. /* harmony import */ var _ckeditor_ckeditor5_utils_src_dom_resizeobserver__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/dom/resizeobserver */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/resizeobserver.js");
  82139. /* harmony import */ var _ckeditor_ckeditor5_utils_src_dom_tounit__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/dom/tounit */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/tounit.js");
  82140. /**
  82141. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  82142. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  82143. */
  82144. /**
  82145. * @module ui/toolbar/block/blocktoolbar
  82146. */
  82147. /* global window */
  82148. const toPx = Object(_ckeditor_ckeditor5_utils_src_dom_tounit__WEBPACK_IMPORTED_MODULE_9__["default"])( 'px' );
  82149. /**
  82150. * The block toolbar plugin.
  82151. *
  82152. * This plugin provides a button positioned next to the block of content where the selection is anchored.
  82153. * Upon clicking the button, a dropdown providing access to editor features shows up, as configured in
  82154. * {@link module:core/editor/editorconfig~EditorConfig#blockToolbar}.
  82155. *
  82156. * By default, the button is displayed next to all elements marked in {@link module:engine/model/schema~Schema}
  82157. * as `$block` for which the toolbar provides at least one option.
  82158. *
  82159. * By default, the button is attached so its right boundary is touching the
  82160. * {@link module:engine/view/editableelement~EditableElement}:
  82161. *
  82162. * __ |
  82163. * | || This is a block of content that the
  82164. * ¯¯ | button is attached to. This is a
  82165. * | block of content that the button is
  82166. * | attached to.
  82167. *
  82168. * The position of the button can be adjusted using the CSS `transform` property:
  82169. *
  82170. * .ck-block-toolbar-button {
  82171. * transform: translateX( -10px );
  82172. * }
  82173. *
  82174. * __ |
  82175. * | | | This is a block of content that the
  82176. * ¯¯ | button is attached to. This is a
  82177. * | block of content that the button is
  82178. * | attached to.
  82179. *
  82180. * **Note**: If you plan to run the editor in a right–to–left (RTL) language, keep in mind the button
  82181. * will be attached to the **right** boundary of the editable area. In that case, make sure the
  82182. * CSS position adjustment works properly by adding the following styles:
  82183. *
  82184. * .ck[dir="rtl"] .ck-block-toolbar-button {
  82185. * transform: translateX( 10px );
  82186. * }
  82187. *
  82188. * @extends module:core/plugin~Plugin
  82189. */
  82190. class BlockToolbar extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  82191. /**
  82192. * @inheritDoc
  82193. */
  82194. static get pluginName() {
  82195. return 'BlockToolbar';
  82196. }
  82197. /**
  82198. * @inheritDoc
  82199. */
  82200. constructor( editor ) {
  82201. super( editor );
  82202. /**
  82203. * A cached and normalized `config.blockToolbar` object.
  82204. *
  82205. * @type {module:core/editor/editorconfig~EditorConfig#blockToolbar}
  82206. * @private
  82207. */
  82208. this._blockToolbarConfig = Object(_normalizetoolbarconfig__WEBPACK_IMPORTED_MODULE_7__["default"])( this.editor.config.get( 'blockToolbar' ) );
  82209. /**
  82210. * The toolbar view.
  82211. *
  82212. * @type {module:ui/toolbar/toolbarview~ToolbarView}
  82213. */
  82214. this.toolbarView = this._createToolbarView();
  82215. /**
  82216. * The balloon panel view, containing the {@link #toolbarView}.
  82217. *
  82218. * @type {module:ui/panel/balloon/balloonpanelview~BalloonPanelView}
  82219. */
  82220. this.panelView = this._createPanelView();
  82221. /**
  82222. * The button view that opens the {@link #toolbarView}.
  82223. *
  82224. * @type {module:ui/toolbar/block/blockbuttonview~BlockButtonView}
  82225. */
  82226. this.buttonView = this._createButtonView();
  82227. /**
  82228. * An instance of the resize observer that allows to respond to changes in editable's geometry
  82229. * so the toolbar can stay within its boundaries (and group toolbar items that do not fit).
  82230. *
  82231. * **Note**: Used only when `shouldNotGroupWhenFull` was **not** set in the
  82232. * {@link module:core/editor/editorconfig~EditorConfig#blockToolbar configuration}.
  82233. *
  82234. * **Note:** Created in {@link #afterInit}.
  82235. *
  82236. * @protected
  82237. * @member {module:utils/dom/resizeobserver~ResizeObserver}
  82238. */
  82239. this._resizeObserver = null;
  82240. // Close the #panelView upon clicking outside of the plugin UI.
  82241. Object(_bindings_clickoutsidehandler__WEBPACK_IMPORTED_MODULE_4__["default"])( {
  82242. emitter: this.panelView,
  82243. contextElements: [ this.panelView.element, this.buttonView.element ],
  82244. activator: () => this.panelView.isVisible,
  82245. callback: () => this._hidePanel()
  82246. } );
  82247. }
  82248. /**
  82249. * @inheritDoc
  82250. */
  82251. init() {
  82252. const editor = this.editor;
  82253. // Hides panel on a direct selection change.
  82254. this.listenTo( editor.model.document.selection, 'change:range', ( evt, data ) => {
  82255. if ( data.directChange ) {
  82256. this._hidePanel();
  82257. }
  82258. } );
  82259. this.listenTo( editor.ui, 'update', () => this._updateButton() );
  82260. // `low` priority is used because of https://github.com/ckeditor/ckeditor5-core/issues/133.
  82261. this.listenTo( editor, 'change:isReadOnly', () => this._updateButton(), { priority: 'low' } );
  82262. this.listenTo( editor.ui.focusTracker, 'change:isFocused', () => this._updateButton() );
  82263. // Reposition button on resize.
  82264. this.listenTo( this.buttonView, 'change:isVisible', ( evt, name, isVisible ) => {
  82265. if ( isVisible ) {
  82266. // Keep correct position of button and panel on window#resize.
  82267. this.buttonView.listenTo( window, 'resize', () => this._updateButton() );
  82268. } else {
  82269. // Stop repositioning button when is hidden.
  82270. this.buttonView.stopListening( window, 'resize' );
  82271. // Hide the panel when the button disappears.
  82272. this._hidePanel();
  82273. }
  82274. } );
  82275. }
  82276. /**
  82277. * Fills the toolbar with its items based on the configuration.
  82278. *
  82279. * **Note:** This needs to be done after all plugins are ready.
  82280. *
  82281. * @inheritDoc
  82282. */
  82283. afterInit() {
  82284. const factory = this.editor.ui.componentFactory;
  82285. const config = this._blockToolbarConfig;
  82286. this.toolbarView.fillFromConfig( config, factory );
  82287. // Hide panel before executing each button in the panel.
  82288. for ( const item of this.toolbarView.items ) {
  82289. item.on( 'execute', () => this._hidePanel( true ), { priority: 'high' } );
  82290. }
  82291. if ( !config.shouldNotGroupWhenFull ) {
  82292. this.listenTo( this.editor, 'ready', () => {
  82293. const editableElement = this.editor.ui.view.editable.element;
  82294. // Set #toolbarView's max-width just after the initialization and update it on the editable resize.
  82295. this._resizeObserver = new _ckeditor_ckeditor5_utils_src_dom_resizeobserver__WEBPACK_IMPORTED_MODULE_8__["default"]( editableElement, () => {
  82296. this.toolbarView.maxWidth = this._getToolbarMaxWidth();
  82297. } );
  82298. } );
  82299. }
  82300. }
  82301. /**
  82302. * @inheritDoc
  82303. */
  82304. destroy() {
  82305. super.destroy();
  82306. // Destroy created UI components as they are not automatically destroyed (see ckeditor5#1341).
  82307. this.panelView.destroy();
  82308. this.buttonView.destroy();
  82309. this.toolbarView.destroy();
  82310. if ( this._resizeObserver ) {
  82311. this._resizeObserver.destroy();
  82312. }
  82313. }
  82314. /**
  82315. * Creates the {@link #toolbarView}.
  82316. *
  82317. * @private
  82318. * @returns {module:ui/toolbar/toolbarview~ToolbarView}
  82319. */
  82320. _createToolbarView() {
  82321. const shouldGroupWhenFull = !this._blockToolbarConfig.shouldNotGroupWhenFull;
  82322. const toolbarView = new _toolbarview__WEBPACK_IMPORTED_MODULE_3__["default"]( this.editor.locale, {
  82323. shouldGroupWhenFull,
  82324. isFloating: true
  82325. } );
  82326. // When toolbar lost focus then panel should hide.
  82327. toolbarView.focusTracker.on( 'change:isFocused', ( evt, name, is ) => {
  82328. if ( !is ) {
  82329. this._hidePanel();
  82330. }
  82331. } );
  82332. return toolbarView;
  82333. }
  82334. /**
  82335. * Creates the {@link #panelView}.
  82336. *
  82337. * @private
  82338. * @returns {module:ui/panel/balloon/balloonpanelview~BalloonPanelView}
  82339. */
  82340. _createPanelView() {
  82341. const editor = this.editor;
  82342. const panelView = new _panel_balloon_balloonpanelview__WEBPACK_IMPORTED_MODULE_2__["default"]( editor.locale );
  82343. panelView.content.add( this.toolbarView );
  82344. panelView.class = 'ck-toolbar-container';
  82345. editor.ui.view.body.add( panelView );
  82346. editor.ui.focusTracker.add( panelView.element );
  82347. // Close #panelView on `Esc` press.
  82348. this.toolbarView.keystrokes.set( 'Esc', ( evt, cancel ) => {
  82349. this._hidePanel( true );
  82350. cancel();
  82351. } );
  82352. return panelView;
  82353. }
  82354. /**
  82355. * Creates the {@link #buttonView}.
  82356. *
  82357. * @private
  82358. * @returns {module:ui/toolbar/block/blockbuttonview~BlockButtonView}
  82359. */
  82360. _createButtonView() {
  82361. const editor = this.editor;
  82362. const t = editor.t;
  82363. const buttonView = new _blockbuttonview__WEBPACK_IMPORTED_MODULE_1__["default"]( editor.locale );
  82364. buttonView.set( {
  82365. label: t( 'Edit block' ),
  82366. icon: ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["icons"].pilcrow,
  82367. withText: false
  82368. } );
  82369. // Bind the panelView observable properties to the buttonView.
  82370. buttonView.bind( 'isOn' ).to( this.panelView, 'isVisible' );
  82371. buttonView.bind( 'tooltip' ).to( this.panelView, 'isVisible', isVisible => !isVisible );
  82372. // Toggle the panelView upon buttonView#execute.
  82373. this.listenTo( buttonView, 'execute', () => {
  82374. if ( !this.panelView.isVisible ) {
  82375. this._showPanel();
  82376. } else {
  82377. this._hidePanel( true );
  82378. }
  82379. } );
  82380. editor.ui.view.body.add( buttonView );
  82381. editor.ui.focusTracker.add( buttonView.element );
  82382. return buttonView;
  82383. }
  82384. /**
  82385. * Shows or hides the button.
  82386. * When all the conditions for displaying the button are matched, it shows the button. Hides otherwise.
  82387. *
  82388. * @private
  82389. */
  82390. _updateButton() {
  82391. const editor = this.editor;
  82392. const model = editor.model;
  82393. const view = editor.editing.view;
  82394. // Hides the button when the editor is not focused.
  82395. if ( !editor.ui.focusTracker.isFocused ) {
  82396. this._hideButton();
  82397. return;
  82398. }
  82399. // Hides the button when the editor switches to the read-only mode.
  82400. if ( editor.isReadOnly ) {
  82401. this._hideButton();
  82402. return;
  82403. }
  82404. // Get the first selected block, button will be attached to this element.
  82405. const modelTarget = Array.from( model.document.selection.getSelectedBlocks() )[ 0 ];
  82406. // Hides the button when there is no enabled item in toolbar for the current block element.
  82407. if ( !modelTarget || Array.from( this.toolbarView.items ).every( item => !item.isEnabled ) ) {
  82408. this._hideButton();
  82409. return;
  82410. }
  82411. // Get DOM target element.
  82412. const domTarget = view.domConverter.mapViewToDom( editor.editing.mapper.toViewElement( modelTarget ) );
  82413. // Show block button.
  82414. this.buttonView.isVisible = true;
  82415. // Attach block button to target DOM element.
  82416. this._attachButtonToElement( domTarget );
  82417. // When panel is opened then refresh it position to be properly aligned with block button.
  82418. if ( this.panelView.isVisible ) {
  82419. this._showPanel();
  82420. }
  82421. }
  82422. /**
  82423. * Hides the button.
  82424. *
  82425. * @private
  82426. */
  82427. _hideButton() {
  82428. this.buttonView.isVisible = false;
  82429. }
  82430. /**
  82431. * Shows the {@link #toolbarView} attached to the {@link #buttonView}.
  82432. * If the toolbar is already visible, then it simply repositions it.
  82433. *
  82434. * @private
  82435. */
  82436. _showPanel() {
  82437. const wasVisible = this.panelView.isVisible;
  82438. // So here's the thing: If there was no initial panelView#show() or these two were in different order, the toolbar
  82439. // positioning will break in RTL editors. Weird, right? What you show know is that the toolbar
  82440. // grouping works thanks to:
  82441. //
  82442. // * the ResizeObserver, which kicks in as soon as the toolbar shows up in DOM (becomes visible again).
  82443. // * the observable ToolbarView#maxWidth, which triggers re-grouping when changed.
  82444. //
  82445. // Here are the possible scenarios:
  82446. //
  82447. // 1. (WRONG ❌) If the #maxWidth is set when the toolbar is invisible, it won't affect item grouping (no DOMRects, no grouping).
  82448. // Then, when panelView.pin() is called, the position of the toolbar will be calculated for the old
  82449. // items grouping state, and when finally ResizeObserver kicks in (hey, the toolbar is visible now, right?)
  82450. // it will group/ungroup some items and the length of the toolbar will change. But since in RTL the toolbar
  82451. // is attached on the right side and the positioning uses CSS "left", it will result in the toolbar shifting
  82452. // to the left and being displayed in the wrong place.
  82453. // 2. (WRONG ❌) If the panelView.pin() is called first and #maxWidth set next, then basically the story repeats. The balloon
  82454. // calculates the position for the old toolbar grouping state, then the toolbar re-groups items and because
  82455. // it is positioned using CSS "left" it will move.
  82456. // 3. (RIGHT ✅) We show the panel first (the toolbar does re-grouping but it does not matter), then the #maxWidth
  82457. // is set allowing the toolbar to re-group again and finally panelView.pin() does the positioning when the
  82458. // items grouping state is stable and final.
  82459. //
  82460. // https://github.com/ckeditor/ckeditor5/issues/6449, https://github.com/ckeditor/ckeditor5/issues/6575
  82461. this.panelView.show();
  82462. this.toolbarView.maxWidth = this._getToolbarMaxWidth();
  82463. this.panelView.pin( {
  82464. target: this.buttonView.element,
  82465. limiter: this.editor.ui.getEditableElement()
  82466. } );
  82467. if ( !wasVisible ) {
  82468. this.toolbarView.items.get( 0 ).focus();
  82469. }
  82470. }
  82471. /**
  82472. * Hides the {@link #toolbarView}.
  82473. *
  82474. * @private
  82475. * @param {Boolean} [focusEditable=false] When `true`, the editable will be focused after hiding the panel.
  82476. */
  82477. _hidePanel( focusEditable ) {
  82478. this.panelView.isVisible = false;
  82479. if ( focusEditable ) {
  82480. this.editor.editing.view.focus();
  82481. }
  82482. }
  82483. /**
  82484. * Attaches the {@link #buttonView} to the target block of content.
  82485. *
  82486. * @protected
  82487. * @param {HTMLElement} targetElement Target element.
  82488. */
  82489. _attachButtonToElement( targetElement ) {
  82490. const contentStyles = window.getComputedStyle( targetElement );
  82491. const editableRect = new _ckeditor_ckeditor5_utils_src_dom_rect__WEBPACK_IMPORTED_MODULE_6__["default"]( this.editor.ui.getEditableElement() );
  82492. const contentPaddingTop = parseInt( contentStyles.paddingTop, 10 );
  82493. // When line height is not an integer then thread it as "normal".
  82494. // MDN says that 'normal' == ~1.2 on desktop browsers.
  82495. const contentLineHeight = parseInt( contentStyles.lineHeight, 10 ) || parseInt( contentStyles.fontSize, 10 ) * 1.2;
  82496. const position = Object(_ckeditor_ckeditor5_utils_src_dom_position__WEBPACK_IMPORTED_MODULE_5__["getOptimalPosition"])( {
  82497. element: this.buttonView.element,
  82498. target: targetElement,
  82499. positions: [
  82500. ( contentRect, buttonRect ) => {
  82501. let left;
  82502. if ( this.editor.locale.uiLanguageDirection === 'ltr' ) {
  82503. left = editableRect.left - buttonRect.width;
  82504. } else {
  82505. left = editableRect.right;
  82506. }
  82507. return {
  82508. top: contentRect.top + contentPaddingTop + ( contentLineHeight - buttonRect.height ) / 2,
  82509. left
  82510. };
  82511. }
  82512. ]
  82513. } );
  82514. this.buttonView.top = position.top;
  82515. this.buttonView.left = position.left;
  82516. }
  82517. /**
  82518. * Gets the {@link #toolbarView} max-width, based on
  82519. * editable width plus distance between farthest edge of the {@link #buttonView} and the editable.
  82520. *
  82521. * @private
  82522. * @returns {String} maxWidth A maximum width that toolbar can have, in pixels.
  82523. */
  82524. _getToolbarMaxWidth() {
  82525. const editableElement = this.editor.ui.view.editable.element;
  82526. const editableRect = new _ckeditor_ckeditor5_utils_src_dom_rect__WEBPACK_IMPORTED_MODULE_6__["default"]( editableElement );
  82527. const buttonRect = new _ckeditor_ckeditor5_utils_src_dom_rect__WEBPACK_IMPORTED_MODULE_6__["default"]( this.buttonView.element );
  82528. const isRTL = this.editor.locale.uiLanguageDirection === 'rtl';
  82529. const offset = isRTL ? ( buttonRect.left - editableRect.right ) + buttonRect.width : editableRect.left - buttonRect.left;
  82530. return toPx( editableRect.width + offset );
  82531. }
  82532. }
  82533. /**
  82534. * The block toolbar configuration. Used by the {@link module:ui/toolbar/block/blocktoolbar~BlockToolbar}
  82535. * feature.
  82536. *
  82537. * const config = {
  82538. * blockToolbar: [ 'paragraph', 'heading1', 'heading2', 'bulletedList', 'numberedList' ]
  82539. * };
  82540. *
  82541. * You can also use `'|'` to create a separator between groups of items:
  82542. *
  82543. * const config = {
  82544. * blockToolbar: [ 'paragraph', 'heading1', 'heading2', '|', 'bulletedList', 'numberedList' ]
  82545. * };
  82546. *
  82547. * ## Configuring items grouping
  82548. *
  82549. * You can prevent automatic items grouping by setting the `shouldNotGroupWhenFull` option:
  82550. *
  82551. * const config = {
  82552. * blockToolbar: {
  82553. * items: [ 'paragraph', 'heading1', 'heading2', '|', 'bulletedList', 'numberedList' ],
  82554. * shouldNotGroupWhenFull: true
  82555. * },
  82556. * };
  82557. *
  82558. * Read more about configuring the main editor toolbar in {@link module:core/editor/editorconfig~EditorConfig#toolbar}.
  82559. *
  82560. * @member {Array.<String>|Object} module:core/editor/editorconfig~EditorConfig#blockToolbar
  82561. */
  82562. /***/ }),
  82563. /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/toolbar/enabletoolbarkeyboardfocus.js":
  82564. /*!***************************************************************************************!*\
  82565. !*** ./node_modules/@ckeditor/ckeditor5-ui/src/toolbar/enabletoolbarkeyboardfocus.js ***!
  82566. \***************************************************************************************/
  82567. /*! exports provided: default */
  82568. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  82569. "use strict";
  82570. __webpack_require__.r(__webpack_exports__);
  82571. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return enableToolbarKeyboardFocus; });
  82572. /**
  82573. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  82574. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  82575. */
  82576. /**
  82577. * @module ui/toolbar/enabletoolbarkeyboardfocus
  82578. */
  82579. /**
  82580. * Enables focus/blur toolbar navigation using `Alt+F10` and `Esc` keystrokes.
  82581. *
  82582. * @param {Object} options Options of the utility.
  82583. * @param {*} options.origin A view to which the focus will return when `Esc` is pressed and
  82584. * `options.toolbar` is focused.
  82585. * @param {module:utils/keystrokehandler~KeystrokeHandler} options.originKeystrokeHandler A keystroke
  82586. * handler to register `Alt+F10` keystroke.
  82587. * @param {module:utils/focustracker~FocusTracker} options.originFocusTracker A focus tracker
  82588. * for `options.origin`.
  82589. * @param {module:ui/toolbar/toolbarview~ToolbarView} options.toolbar A toolbar which is to gain
  82590. * focus when `Alt+F10` is pressed.
  82591. * @param {Function} [options.beforeFocus] A callback executed before the `options.toolbar` gains focus
  82592. * upon the `Alt+F10` keystroke.
  82593. * @param {Function} [options.afterBlur] A callback executed after `options.toolbar` loses focus upon
  82594. * `Esc` keystroke but before the focus goes back to `options.origin`.
  82595. */
  82596. function enableToolbarKeyboardFocus( {
  82597. origin,
  82598. originKeystrokeHandler,
  82599. originFocusTracker,
  82600. toolbar,
  82601. beforeFocus,
  82602. afterBlur
  82603. } ) {
  82604. // Because toolbar items can get focus, the overall state of the toolbar must
  82605. // also be tracked.
  82606. originFocusTracker.add( toolbar.element );
  82607. // Focus the toolbar on the keystroke, if not already focused.
  82608. originKeystrokeHandler.set( 'Alt+F10', ( data, cancel ) => {
  82609. if ( originFocusTracker.isFocused && !toolbar.focusTracker.isFocused ) {
  82610. if ( beforeFocus ) {
  82611. beforeFocus();
  82612. }
  82613. toolbar.focus();
  82614. cancel();
  82615. }
  82616. } );
  82617. // Blur the toolbar and bring the focus back to origin.
  82618. toolbar.keystrokes.set( 'Esc', ( data, cancel ) => {
  82619. if ( toolbar.focusTracker.isFocused ) {
  82620. origin.focus();
  82621. if ( afterBlur ) {
  82622. afterBlur();
  82623. }
  82624. cancel();
  82625. }
  82626. } );
  82627. }
  82628. /***/ }),
  82629. /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/toolbar/normalizetoolbarconfig.js":
  82630. /*!***********************************************************************************!*\
  82631. !*** ./node_modules/@ckeditor/ckeditor5-ui/src/toolbar/normalizetoolbarconfig.js ***!
  82632. \***********************************************************************************/
  82633. /*! exports provided: default */
  82634. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  82635. "use strict";
  82636. __webpack_require__.r(__webpack_exports__);
  82637. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return normalizeToolbarConfig; });
  82638. /**
  82639. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  82640. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  82641. */
  82642. /**
  82643. * @module ui/toolbar/normalizetoolbarconfig
  82644. */
  82645. /**
  82646. * Normalizes the toolbar configuration (`config.toolbar`), which:
  82647. *
  82648. * * may be defined as an `Array`:
  82649. *
  82650. * toolbar: [ 'heading', 'bold', 'italic', 'link', ... ]
  82651. *
  82652. * * or an `Object`:
  82653. *
  82654. * toolbar: {
  82655. * items: [ 'heading', 'bold', 'italic', 'link', ... ],
  82656. * removeItems: [ 'bold' ],
  82657. * ...
  82658. * }
  82659. *
  82660. * * or may not be defined at all (`undefined`)
  82661. *
  82662. * and returns it in the object form.
  82663. *
  82664. * @param {Array|Object|undefined} config The value of `config.toolbar`.
  82665. * @returns {Object} A normalized toolbar config object.
  82666. */
  82667. function normalizeToolbarConfig( config ) {
  82668. if ( Array.isArray( config ) ) {
  82669. return {
  82670. items: config,
  82671. removeItems: []
  82672. };
  82673. }
  82674. if ( !config ) {
  82675. return {
  82676. items: [],
  82677. removeItems: []
  82678. };
  82679. }
  82680. return Object.assign( {
  82681. items: [],
  82682. removeItems: []
  82683. }, config );
  82684. }
  82685. /***/ }),
  82686. /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/toolbar/toolbarlinebreakview.js":
  82687. /*!*********************************************************************************!*\
  82688. !*** ./node_modules/@ckeditor/ckeditor5-ui/src/toolbar/toolbarlinebreakview.js ***!
  82689. \*********************************************************************************/
  82690. /*! exports provided: default */
  82691. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  82692. "use strict";
  82693. __webpack_require__.r(__webpack_exports__);
  82694. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ToolbarLineBreakView; });
  82695. /* harmony import */ var _view__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../view */ "./node_modules/@ckeditor/ckeditor5-ui/src/view.js");
  82696. /**
  82697. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  82698. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  82699. */
  82700. /**
  82701. * @module ui/toolbar/toolbarlinebreakview
  82702. */
  82703. /**
  82704. * The toolbar line break view class.
  82705. *
  82706. * @extends module:ui/view~View
  82707. */
  82708. class ToolbarLineBreakView extends _view__WEBPACK_IMPORTED_MODULE_0__["default"] {
  82709. /**
  82710. * @inheritDoc
  82711. */
  82712. constructor( locale ) {
  82713. super( locale );
  82714. this.setTemplate( {
  82715. tag: 'span',
  82716. attributes: {
  82717. class: [
  82718. 'ck',
  82719. 'ck-toolbar__line-break'
  82720. ]
  82721. }
  82722. } );
  82723. }
  82724. }
  82725. /***/ }),
  82726. /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/toolbar/toolbarseparatorview.js":
  82727. /*!*********************************************************************************!*\
  82728. !*** ./node_modules/@ckeditor/ckeditor5-ui/src/toolbar/toolbarseparatorview.js ***!
  82729. \*********************************************************************************/
  82730. /*! exports provided: default */
  82731. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  82732. "use strict";
  82733. __webpack_require__.r(__webpack_exports__);
  82734. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ToolbarSeparatorView; });
  82735. /* harmony import */ var _view__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../view */ "./node_modules/@ckeditor/ckeditor5-ui/src/view.js");
  82736. /**
  82737. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  82738. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  82739. */
  82740. /**
  82741. * @module ui/toolbar/toolbarseparatorview
  82742. */
  82743. /**
  82744. * The toolbar separator view class.
  82745. *
  82746. * @extends module:ui/view~View
  82747. */
  82748. class ToolbarSeparatorView extends _view__WEBPACK_IMPORTED_MODULE_0__["default"] {
  82749. /**
  82750. * @inheritDoc
  82751. */
  82752. constructor( locale ) {
  82753. super( locale );
  82754. this.setTemplate( {
  82755. tag: 'span',
  82756. attributes: {
  82757. class: [
  82758. 'ck',
  82759. 'ck-toolbar__separator'
  82760. ]
  82761. }
  82762. } );
  82763. }
  82764. }
  82765. /***/ }),
  82766. /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/toolbar/toolbarview.js":
  82767. /*!************************************************************************!*\
  82768. !*** ./node_modules/@ckeditor/ckeditor5-ui/src/toolbar/toolbarview.js ***!
  82769. \************************************************************************/
  82770. /*! exports provided: default */
  82771. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  82772. "use strict";
  82773. __webpack_require__.r(__webpack_exports__);
  82774. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ToolbarView; });
  82775. /* harmony import */ var _view__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../view */ "./node_modules/@ckeditor/ckeditor5-ui/src/view.js");
  82776. /* 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");
  82777. /* harmony import */ var _focuscycler__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../focuscycler */ "./node_modules/@ckeditor/ckeditor5-ui/src/focuscycler.js");
  82778. /* 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");
  82779. /* harmony import */ var _toolbarseparatorview__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./toolbarseparatorview */ "./node_modules/@ckeditor/ckeditor5-ui/src/toolbar/toolbarseparatorview.js");
  82780. /* harmony import */ var _toolbarlinebreakview__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./toolbarlinebreakview */ "./node_modules/@ckeditor/ckeditor5-ui/src/toolbar/toolbarlinebreakview.js");
  82781. /* harmony import */ var _ckeditor_ckeditor5_utils_src_dom_resizeobserver__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/dom/resizeobserver */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/resizeobserver.js");
  82782. /* harmony import */ var _bindings_preventdefault_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../bindings/preventdefault.js */ "./node_modules/@ckeditor/ckeditor5-ui/src/bindings/preventdefault.js");
  82783. /* harmony import */ var _ckeditor_ckeditor5_utils_src_dom_rect__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/dom/rect */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/rect.js");
  82784. /* harmony import */ var _ckeditor_ckeditor5_utils_src_dom_global__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/dom/global */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/global.js");
  82785. /* harmony import */ var _dropdown_utils__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../dropdown/utils */ "./node_modules/@ckeditor/ckeditor5-ui/src/dropdown/utils.js");
  82786. /* 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");
  82787. /* harmony import */ var _normalizetoolbarconfig__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./normalizetoolbarconfig */ "./node_modules/@ckeditor/ckeditor5-ui/src/toolbar/normalizetoolbarconfig.js");
  82788. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  82789. /* harmony import */ var _theme_components_toolbar_toolbar_css__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../../theme/components/toolbar/toolbar.css */ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/toolbar/toolbar.css");
  82790. /* harmony import */ var _theme_components_toolbar_toolbar_css__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(_theme_components_toolbar_toolbar_css__WEBPACK_IMPORTED_MODULE_14__);
  82791. /**
  82792. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  82793. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  82794. */
  82795. /**
  82796. * @module ui/toolbar/toolbarview
  82797. */
  82798. /**
  82799. * The toolbar view class.
  82800. *
  82801. * @extends module:ui/view~View
  82802. * @implements module:ui/dropdown/dropdownpanelfocusable~DropdownPanelFocusable
  82803. */
  82804. class ToolbarView extends _view__WEBPACK_IMPORTED_MODULE_0__["default"] {
  82805. /**
  82806. * Creates an instance of the {@link module:ui/toolbar/toolbarview~ToolbarView} class.
  82807. *
  82808. * Also see {@link #render}.
  82809. *
  82810. * @param {module:utils/locale~Locale} locale The localization services instance.
  82811. * @param {module:ui/toolbar/toolbarview~ToolbarOptions} [options] Configuration options of the toolbar.
  82812. */
  82813. constructor( locale, options ) {
  82814. super( locale );
  82815. const bind = this.bindTemplate;
  82816. const t = this.t;
  82817. /**
  82818. * A reference to the options object passed to the constructor.
  82819. *
  82820. * @readonly
  82821. * @member {module:ui/toolbar/toolbarview~ToolbarOptions}
  82822. */
  82823. this.options = options || {};
  82824. /**
  82825. * Label used by assistive technologies to describe this toolbar element.
  82826. *
  82827. * @default 'Editor toolbar'
  82828. * @member {String} #ariaLabel
  82829. */
  82830. this.set( 'ariaLabel', t( 'Editor toolbar' ) );
  82831. /**
  82832. * The maximum width of the toolbar element.
  82833. *
  82834. * **Note**: When set to a specific value (e.g. `'200px'`), the value will affect the behavior of the
  82835. * {@link module:ui/toolbar/toolbarview~ToolbarOptions#shouldGroupWhenFull}
  82836. * option by changing the number of {@link #items} that will be displayed in the toolbar at a time.
  82837. *
  82838. * @observable
  82839. * @default 'auto'
  82840. * @member {String} #maxWidth
  82841. */
  82842. this.set( 'maxWidth', 'auto' );
  82843. /**
  82844. * A collection of toolbar items (buttons, dropdowns, etc.).
  82845. *
  82846. * @readonly
  82847. * @member {module:ui/viewcollection~ViewCollection}
  82848. */
  82849. this.items = this.createCollection();
  82850. /**
  82851. * Tracks information about the DOM focus in the toolbar.
  82852. *
  82853. * @readonly
  82854. * @member {module:utils/focustracker~FocusTracker}
  82855. */
  82856. this.focusTracker = new _ckeditor_ckeditor5_utils_src_focustracker__WEBPACK_IMPORTED_MODULE_1__["default"]();
  82857. /**
  82858. * An instance of the {@link module:utils/keystrokehandler~KeystrokeHandler}
  82859. * to handle keyboard navigation in the toolbar.
  82860. *
  82861. * @readonly
  82862. * @member {module:utils/keystrokehandler~KeystrokeHandler}
  82863. */
  82864. this.keystrokes = new _ckeditor_ckeditor5_utils_src_keystrokehandler__WEBPACK_IMPORTED_MODULE_3__["default"]();
  82865. /**
  82866. * An additional CSS class added to the {@link #element}.
  82867. *
  82868. * @observable
  82869. * @member {String} #class
  82870. */
  82871. this.set( 'class' );
  82872. /**
  82873. * When set true, makes the toolbar look compact with {@link #element}.
  82874. *
  82875. * @observable
  82876. * @default false
  82877. * @member {String} #isCompact
  82878. */
  82879. this.set( 'isCompact', false );
  82880. /**
  82881. * A (child) view containing {@link #items toolbar items}.
  82882. *
  82883. * @readonly
  82884. * @member {module:ui/toolbar/toolbarview~ItemsView}
  82885. */
  82886. this.itemsView = new ItemsView( locale );
  82887. /**
  82888. * A top–level collection aggregating building blocks of the toolbar.
  82889. *
  82890. * ┌───────────────── ToolbarView ─────────────────┐
  82891. * | ┌──────────────── #children ────────────────┐ |
  82892. * | | ┌──────────── #itemsView ───────────┐ | |
  82893. * | | | [ item1 ] [ item2 ] ... [ itemN ] | | |
  82894. * | | └──────────────────────────────────-┘ | |
  82895. * | └───────────────────────────────────────────┘ |
  82896. * └───────────────────────────────────────────────┘
  82897. *
  82898. * By default, it contains the {@link #itemsView} but it can be extended with additional
  82899. * UI elements when necessary.
  82900. *
  82901. * @readonly
  82902. * @member {module:ui/viewcollection~ViewCollection}
  82903. */
  82904. this.children = this.createCollection();
  82905. this.children.add( this.itemsView );
  82906. /**
  82907. * A collection of {@link #items} that take part in the focus cycling
  82908. * (i.e. navigation using the keyboard). Usually, it contains a subset of {@link #items} with
  82909. * some optional UI elements that also belong to the toolbar and should be focusable
  82910. * by the user.
  82911. *
  82912. * @readonly
  82913. * @member {module:ui/viewcollection~ViewCollection}
  82914. */
  82915. this.focusables = this.createCollection();
  82916. /**
  82917. * Controls the orientation of toolbar items. Only available when
  82918. * {@link module:ui/toolbar/toolbarview~ToolbarOptions#shouldGroupWhenFull dynamic items grouping}
  82919. * is **disabled**.
  82920. *
  82921. * @observable
  82922. * @member {Boolean} #isVertical
  82923. */
  82924. /**
  82925. * Helps cycling over {@link #focusables focusable items} in the toolbar.
  82926. *
  82927. * @readonly
  82928. * @protected
  82929. * @member {module:ui/focuscycler~FocusCycler}
  82930. */
  82931. const isRtl = locale.uiLanguageDirection === 'rtl';
  82932. this._focusCycler = new _focuscycler__WEBPACK_IMPORTED_MODULE_2__["default"]( {
  82933. focusables: this.focusables,
  82934. focusTracker: this.focusTracker,
  82935. keystrokeHandler: this.keystrokes,
  82936. actions: {
  82937. // Navigate toolbar items backwards using the arrow[left,up] keys.
  82938. focusPrevious: [ isRtl ? 'arrowright' : 'arrowleft', 'arrowup' ],
  82939. // Navigate toolbar items forwards using the arrow[right,down] keys.
  82940. focusNext: [ isRtl ? 'arrowleft' : 'arrowright', 'arrowdown' ]
  82941. }
  82942. } );
  82943. const classes = [
  82944. 'ck',
  82945. 'ck-toolbar',
  82946. bind.to( 'class' ),
  82947. bind.if( 'isCompact', 'ck-toolbar_compact' )
  82948. ];
  82949. if ( this.options.shouldGroupWhenFull && this.options.isFloating ) {
  82950. classes.push( 'ck-toolbar_floating' );
  82951. }
  82952. this.setTemplate( {
  82953. tag: 'div',
  82954. attributes: {
  82955. class: classes,
  82956. role: 'toolbar',
  82957. 'aria-label': bind.to( 'ariaLabel' ),
  82958. style: {
  82959. maxWidth: bind.to( 'maxWidth' )
  82960. }
  82961. },
  82962. children: this.children,
  82963. on: {
  82964. // https://github.com/ckeditor/ckeditor5-ui/issues/206
  82965. mousedown: Object(_bindings_preventdefault_js__WEBPACK_IMPORTED_MODULE_7__["default"])( this )
  82966. }
  82967. } );
  82968. /**
  82969. * An instance of the active toolbar behavior that shapes its look and functionality.
  82970. *
  82971. * See {@link module:ui/toolbar/toolbarview~ToolbarBehavior} to learn more.
  82972. *
  82973. * @protected
  82974. * @readonly
  82975. * @member {module:ui/toolbar/toolbarview~ToolbarBehavior}
  82976. */
  82977. this._behavior = this.options.shouldGroupWhenFull ? new DynamicGrouping( this ) : new StaticLayout( this );
  82978. }
  82979. /**
  82980. * @inheritDoc
  82981. */
  82982. render() {
  82983. super.render();
  82984. // Children added before rendering should be known to the #focusTracker.
  82985. for ( const item of this.items ) {
  82986. this.focusTracker.add( item.element );
  82987. }
  82988. this.items.on( 'add', ( evt, item ) => {
  82989. this.focusTracker.add( item.element );
  82990. } );
  82991. this.items.on( 'remove', ( evt, item ) => {
  82992. this.focusTracker.remove( item.element );
  82993. } );
  82994. // Start listening for the keystrokes coming from #element.
  82995. this.keystrokes.listenTo( this.element );
  82996. this._behavior.render( this );
  82997. }
  82998. /**
  82999. * @inheritDoc
  83000. */
  83001. destroy() {
  83002. this._behavior.destroy();
  83003. return super.destroy();
  83004. }
  83005. /**
  83006. * Focuses the first focusable in {@link #focusables}.
  83007. */
  83008. focus() {
  83009. this._focusCycler.focusFirst();
  83010. }
  83011. /**
  83012. * Focuses the last focusable in {@link #focusables}.
  83013. */
  83014. focusLast() {
  83015. this._focusCycler.focusLast();
  83016. }
  83017. /**
  83018. * A utility that expands the plain toolbar configuration into
  83019. * {@link module:ui/toolbar/toolbarview~ToolbarView#items} using a given component factory.
  83020. *
  83021. * @param {Array.<String>|Object} itemsOrConfig The toolbar items or the entire toolbar configuration object.
  83022. * @param {module:ui/componentfactory~ComponentFactory} factory A factory producing toolbar items.
  83023. */
  83024. fillFromConfig( itemsOrConfig, factory ) {
  83025. const config = Object(_normalizetoolbarconfig__WEBPACK_IMPORTED_MODULE_12__["default"])( itemsOrConfig );
  83026. const itemsToClean = config.items
  83027. .filter( ( name, idx, items ) => {
  83028. if ( name === '|' ) {
  83029. return true;
  83030. }
  83031. // Items listed in `config.removeItems` should not be added to the toolbar.
  83032. if ( config.removeItems.indexOf( name ) !== -1 ) {
  83033. return false;
  83034. }
  83035. if ( name === '-' ) {
  83036. // The toolbar line breaks must not be rendered when toolbar grouping is enabled.
  83037. // (https://github.com/ckeditor/ckeditor5/issues/8582)
  83038. if ( this.options.shouldGroupWhenFull ) {
  83039. /**
  83040. * The toolbar multiline breaks (`-` items) only work when the automatic button grouping
  83041. * is disabled in the toolbar configuration.
  83042. * To do this, set the `shouldNotGroupWhenFull` option to `true` in the editor configuration:
  83043. *
  83044. * const config = {
  83045. * toolbar: {
  83046. * items: [ ... ],
  83047. * shouldNotGroupWhenFull: true
  83048. * }
  83049. * }
  83050. *
  83051. * Learn more about {@link module:core/editor/editorconfig~EditorConfig#toolbar toolbar configuration}.
  83052. *
  83053. * @error toolbarview-line-break-ignored-when-grouping-items
  83054. */
  83055. Object(_ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_11__["logWarning"])( 'toolbarview-line-break-ignored-when-grouping-items', items );
  83056. return false;
  83057. }
  83058. return true;
  83059. }
  83060. // For the items that cannot be instantiated we are sending warning message. We also filter them out.
  83061. if ( !factory.has( name ) ) {
  83062. /**
  83063. * There was a problem processing the configuration of the toolbar. The item with the given
  83064. * name does not exist so it was omitted when rendering the toolbar.
  83065. *
  83066. * This warning usually shows up when the {@link module:core/plugin~Plugin} which is supposed
  83067. * to provide a toolbar item has not been loaded or there is a typo in the configuration.
  83068. *
  83069. * Make sure the plugin responsible for this toolbar item is loaded and the toolbar configuration
  83070. * is correct, e.g. {@link module:basic-styles/bold~Bold} is loaded for the `'bold'` toolbar item.
  83071. *
  83072. * You can use the following snippet to retrieve all available toolbar items:
  83073. *
  83074. * Array.from( editor.ui.componentFactory.names() );
  83075. *
  83076. * @error toolbarview-item-unavailable
  83077. * @param {String} name The name of the component.
  83078. */
  83079. Object(_ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_11__["logWarning"])( 'toolbarview-item-unavailable', { name } );
  83080. return false;
  83081. }
  83082. return true;
  83083. } );
  83084. const itemsToAdd = this._cleanSeparators( itemsToClean )
  83085. // Instantiate toolbar items.
  83086. .map( name => {
  83087. if ( name === '|' ) {
  83088. return new _toolbarseparatorview__WEBPACK_IMPORTED_MODULE_4__["default"]();
  83089. } else if ( name === '-' ) {
  83090. return new _toolbarlinebreakview__WEBPACK_IMPORTED_MODULE_5__["default"]();
  83091. }
  83092. return factory.create( name );
  83093. } );
  83094. this.items.addMany( itemsToAdd );
  83095. }
  83096. /**
  83097. * Remove leading, trailing, and duplicated separators (`-` and `|`).
  83098. *
  83099. * @private
  83100. * @param {Array.<String>} items
  83101. */
  83102. _cleanSeparators( items ) {
  83103. const nonSeparatorPredicate = item => ( item !== '-' && item !== '|' );
  83104. const count = items.length;
  83105. // Find an index of the first item that is not a separator.
  83106. const firstCommandItem = items.findIndex( nonSeparatorPredicate );
  83107. // Search from the end of the list, then convert found index back to the original direction.
  83108. const lastCommandItem = count - items
  83109. .slice()
  83110. .reverse()
  83111. .findIndex( nonSeparatorPredicate );
  83112. return items
  83113. // Return items without the leading and trailing separators.
  83114. .slice( firstCommandItem, lastCommandItem )
  83115. // Remove duplicated separators.
  83116. .filter( ( name, idx, items ) => {
  83117. // Filter only separators.
  83118. if ( nonSeparatorPredicate( name ) ) {
  83119. return true;
  83120. }
  83121. const isDuplicated = idx > 0 && items[ idx - 1 ] === name;
  83122. return !isDuplicated;
  83123. } );
  83124. }
  83125. /**
  83126. * Fired when some toolbar {@link #items} were grouped or ungrouped as a result of some change
  83127. * in the toolbar geometry.
  83128. *
  83129. * **Note**: This event is always fired **once** regardless of the number of items that were be
  83130. * grouped or ungrouped at a time.
  83131. *
  83132. * **Note**: This event is fired only if the items grouping functionality was enabled in
  83133. * the first place (see {@link module:ui/toolbar/toolbarview~ToolbarOptions#shouldGroupWhenFull}).
  83134. *
  83135. * @event groupedItemsUpdate
  83136. */
  83137. }
  83138. /**
  83139. * An inner block of the {@link module:ui/toolbar/toolbarview~ToolbarView} hosting its
  83140. * {@link module:ui/toolbar/toolbarview~ToolbarView#items}.
  83141. *
  83142. * @private
  83143. * @extends module:ui/view~View
  83144. */
  83145. class ItemsView extends _view__WEBPACK_IMPORTED_MODULE_0__["default"] {
  83146. /**
  83147. * @inheritDoc
  83148. */
  83149. constructor( locale ) {
  83150. super( locale );
  83151. /**
  83152. * A collection of items (buttons, dropdowns, etc.).
  83153. *
  83154. * @readonly
  83155. * @member {module:ui/viewcollection~ViewCollection}
  83156. */
  83157. this.children = this.createCollection();
  83158. this.setTemplate( {
  83159. tag: 'div',
  83160. attributes: {
  83161. class: [
  83162. 'ck',
  83163. 'ck-toolbar__items'
  83164. ]
  83165. },
  83166. children: this.children
  83167. } );
  83168. }
  83169. }
  83170. /**
  83171. * A toolbar behavior that makes it static and unresponsive to the changes of the environment.
  83172. * At the same time, it also makes it possible to display a toolbar with a vertical layout
  83173. * using the {@link module:ui/toolbar/toolbarview~ToolbarView#isVertical} property.
  83174. *
  83175. * @private
  83176. * @implements module:ui/toolbar/toolbarview~ToolbarBehavior
  83177. */
  83178. class StaticLayout {
  83179. /**
  83180. * Creates an instance of the {@link module:ui/toolbar/toolbarview~StaticLayout} toolbar
  83181. * behavior.
  83182. *
  83183. * @param {module:ui/toolbar/toolbarview~ToolbarView} view An instance of the toolbar that this behavior
  83184. * is added to.
  83185. */
  83186. constructor( view ) {
  83187. const bind = view.bindTemplate;
  83188. // Static toolbar can be vertical when needed.
  83189. view.set( 'isVertical', false );
  83190. // 1:1 pass–through binding, all ToolbarView#items are visible.
  83191. view.itemsView.children.bindTo( view.items ).using( item => item );
  83192. // 1:1 pass–through binding, all ToolbarView#items are focusable.
  83193. view.focusables.bindTo( view.items ).using( item => item );
  83194. view.extendTemplate( {
  83195. attributes: {
  83196. class: [
  83197. // When vertical, the toolbar has an additional CSS class.
  83198. bind.if( 'isVertical', 'ck-toolbar_vertical' )
  83199. ]
  83200. }
  83201. } );
  83202. }
  83203. /**
  83204. * @inheritDoc
  83205. */
  83206. render() {}
  83207. /**
  83208. * @inheritDoc
  83209. */
  83210. destroy() {}
  83211. }
  83212. /**
  83213. * A toolbar behavior that makes the items respond to changes in the geometry.
  83214. *
  83215. * In a nutshell, it groups {@link module:ui/toolbar/toolbarview~ToolbarView#items}
  83216. * that do not fit visually into a single row of the toolbar (due to limited space).
  83217. * Items that do not fit are aggregated in a dropdown displayed at the end of the toolbar.
  83218. *
  83219. * ┌──────────────────────────────────────── ToolbarView ──────────────────────────────────────────┐
  83220. * | ┌─────────────────────────────────────── #children ─────────────────────────────────────────┐ |
  83221. * | | ┌─────── #itemsView ────────┐ ┌──────────────────────┐ ┌── #groupedItemsDropdown ───┐ | |
  83222. * | | | #ungroupedItems | | ToolbarSeparatorView | | #groupedItems | | |
  83223. * | | └──────────────────────────-┘ └──────────────────────┘ └────────────────────────────┘ | |
  83224. * | | \---------- only when toolbar items overflow --------/ | |
  83225. * | └───────────────────────────────────────────────────────────────────────────────────────────┘ |
  83226. * └───────────────────────────────────────────────────────────────────────────────────────────────┘
  83227. *
  83228. * @private
  83229. * @implements module:ui/toolbar/toolbarview~ToolbarBehavior
  83230. */
  83231. class DynamicGrouping {
  83232. /**
  83233. * Creates an instance of the {@link module:ui/toolbar/toolbarview~DynamicGrouping} toolbar
  83234. * behavior.
  83235. *
  83236. * @param {module:ui/toolbar/toolbarview~ToolbarView} view An instance of the toolbar that this behavior
  83237. * is added to.
  83238. */
  83239. constructor( view ) {
  83240. /**
  83241. * A toolbar view this behavior belongs to.
  83242. *
  83243. * @readonly
  83244. * @member {module:ui/toolbar~ToolbarView}
  83245. */
  83246. this.view = view;
  83247. /**
  83248. * A collection of toolbar children.
  83249. *
  83250. * @readonly
  83251. * @member {module:ui/viewcollection~ViewCollection}
  83252. */
  83253. this.viewChildren = view.children;
  83254. /**
  83255. * A collection of focusable toolbar elements.
  83256. *
  83257. * @readonly
  83258. * @member {module:ui/viewcollection~ViewCollection}
  83259. */
  83260. this.viewFocusables = view.focusables;
  83261. /**
  83262. * A view containing toolbar items.
  83263. *
  83264. * @readonly
  83265. * @member {module:ui/toolbar/toolbarview~ItemsView}
  83266. */
  83267. this.viewItemsView = view.itemsView;
  83268. /**
  83269. * Toolbar focus tracker.
  83270. *
  83271. * @readonly
  83272. * @member {module:utils/focustracker~FocusTracker}
  83273. */
  83274. this.viewFocusTracker = view.focusTracker;
  83275. /**
  83276. * Toolbar locale.
  83277. *
  83278. * @readonly
  83279. * @member {module:utils/locale~Locale}
  83280. */
  83281. this.viewLocale = view.locale;
  83282. /**
  83283. * Toolbar element.
  83284. *
  83285. * @readonly
  83286. * @member {HTMLElement} #viewElement
  83287. */
  83288. /**
  83289. * A subset of toolbar {@link module:ui/toolbar/toolbarview~ToolbarView#items}.
  83290. * Aggregates items that fit into a single row of the toolbar and were not {@link #groupedItems grouped}
  83291. * into a {@link #groupedItemsDropdown dropdown}. Items of this collection are displayed in the
  83292. * {@link module:ui/toolbar/toolbarview~ToolbarView#itemsView}.
  83293. *
  83294. * When none of the {@link module:ui/toolbar/toolbarview~ToolbarView#items} were grouped, it
  83295. * matches the {@link module:ui/toolbar/toolbarview~ToolbarView#items} collection in size and order.
  83296. *
  83297. * @readonly
  83298. * @member {module:ui/viewcollection~ViewCollection}
  83299. */
  83300. this.ungroupedItems = view.createCollection();
  83301. /**
  83302. * A subset of toolbar {@link module:ui/toolbar/toolbarview~ToolbarView#items}.
  83303. * A collection of the toolbar items that do not fit into a single row of the toolbar.
  83304. * Grouped items are displayed in a dedicated {@link #groupedItemsDropdown dropdown}.
  83305. *
  83306. * When none of the {@link module:ui/toolbar/toolbarview~ToolbarView#items} were grouped,
  83307. * this collection is empty.
  83308. *
  83309. * @readonly
  83310. * @member {module:ui/viewcollection~ViewCollection}
  83311. */
  83312. this.groupedItems = view.createCollection();
  83313. /**
  83314. * The dropdown that aggregates {@link #groupedItems grouped items} that do not fit into a single
  83315. * row of the toolbar. It is displayed on demand as the last of
  83316. * {@link module:ui/toolbar/toolbarview~ToolbarView#children toolbar children} and offers another
  83317. * (nested) toolbar which displays items that would normally overflow.
  83318. *
  83319. * @readonly
  83320. * @member {module:ui/dropdown/dropdownview~DropdownView}
  83321. */
  83322. this.groupedItemsDropdown = this._createGroupedItemsDropdown();
  83323. /**
  83324. * An instance of the resize observer that helps dynamically determine the geometry of the toolbar
  83325. * and manage items that do not fit into a single row.
  83326. *
  83327. * **Note:** Created in {@link #_enableGroupingOnResize}.
  83328. *
  83329. * @readonly
  83330. * @member {module:utils/dom/resizeobserver~ResizeObserver}
  83331. */
  83332. this.resizeObserver = null;
  83333. /**
  83334. * A cached value of the horizontal padding style used by {@link #_updateGrouping}
  83335. * to manage the {@link module:ui/toolbar/toolbarview~ToolbarView#items} that do not fit into
  83336. * a single toolbar line. This value can be reused between updates because it is unlikely that
  83337. * the padding will change and re–using `Window.getComputedStyle()` is expensive.
  83338. *
  83339. * @readonly
  83340. * @member {Number}
  83341. */
  83342. this.cachedPadding = null;
  83343. /**
  83344. * A flag indicating that an items grouping update has been queued (e.g. due to the toolbar being visible)
  83345. * and should be executed immediately the next time the toolbar shows up.
  83346. *
  83347. * @readonly
  83348. * @member {Boolean}
  83349. */
  83350. this.shouldUpdateGroupingOnNextResize = false;
  83351. // Only those items that were not grouped are visible to the user.
  83352. view.itemsView.children.bindTo( this.ungroupedItems ).using( item => item );
  83353. // Make sure all #items visible in the main space of the toolbar are "focuscycleable".
  83354. this.ungroupedItems.on( 'add', this._updateFocusCycleableItems.bind( this ) );
  83355. this.ungroupedItems.on( 'remove', this._updateFocusCycleableItems.bind( this ) );
  83356. // Make sure the #groupedItemsDropdown is also included in cycling when it appears.
  83357. view.children.on( 'add', this._updateFocusCycleableItems.bind( this ) );
  83358. view.children.on( 'remove', this._updateFocusCycleableItems.bind( this ) );
  83359. // ToolbarView#items is dynamic. When an item is added or removed, it should be automatically
  83360. // represented in either grouped or ungrouped items at the right index.
  83361. // In other words #items == concat( #ungroupedItems, #groupedItems )
  83362. // (in length and order).
  83363. view.items.on( 'change', ( evt, changeData ) => {
  83364. const index = changeData.index;
  83365. // Removing.
  83366. for ( const removedItem of changeData.removed ) {
  83367. if ( index >= this.ungroupedItems.length ) {
  83368. this.groupedItems.remove( removedItem );
  83369. } else {
  83370. this.ungroupedItems.remove( removedItem );
  83371. }
  83372. }
  83373. // Adding.
  83374. for ( let currentIndex = index; currentIndex < index + changeData.added.length; currentIndex++ ) {
  83375. const addedItem = changeData.added[ currentIndex - index ];
  83376. if ( currentIndex > this.ungroupedItems.length ) {
  83377. this.groupedItems.add( addedItem, currentIndex - this.ungroupedItems.length );
  83378. } else {
  83379. this.ungroupedItems.add( addedItem, currentIndex );
  83380. }
  83381. }
  83382. // When new ungrouped items join in and land in #ungroupedItems, there's a chance it causes
  83383. // the toolbar to overflow.
  83384. // Consequently if removed from grouped or ungrouped items, there is a chance
  83385. // some new space is available and we could do some ungrouping.
  83386. this._updateGrouping();
  83387. } );
  83388. view.extendTemplate( {
  83389. attributes: {
  83390. class: [
  83391. // To group items dynamically, the toolbar needs a dedicated CSS class.
  83392. 'ck-toolbar_grouping'
  83393. ]
  83394. }
  83395. } );
  83396. }
  83397. /**
  83398. * Enables dynamic items grouping based on the dimensions of the toolbar.
  83399. *
  83400. * @param {module:ui/toolbar/toolbarview~ToolbarView} view An instance of the toolbar that this behavior
  83401. * is added to.
  83402. */
  83403. render( view ) {
  83404. this.viewElement = view.element;
  83405. this._enableGroupingOnResize();
  83406. this._enableGroupingOnMaxWidthChange( view );
  83407. }
  83408. /**
  83409. * Cleans up the internals used by this behavior.
  83410. */
  83411. destroy() {
  83412. // The dropdown may not be in ToolbarView#children at the moment of toolbar destruction
  83413. // so let's make sure it's actually destroyed along with the toolbar.
  83414. this.groupedItemsDropdown.destroy();
  83415. this.resizeObserver.destroy();
  83416. }
  83417. /**
  83418. * When called, it will check if any of the {@link #ungroupedItems} do not fit into a single row of the toolbar,
  83419. * and it will move them to the {@link #groupedItems} when it happens.
  83420. *
  83421. * At the same time, it will also check if there is enough space in the toolbar for the first of the
  83422. * {@link #groupedItems} to be returned back to {@link #ungroupedItems} and still fit into a single row
  83423. * without the toolbar wrapping.
  83424. *
  83425. * @protected
  83426. */
  83427. _updateGrouping() {
  83428. // Do no grouping–related geometry analysis when the toolbar is detached from visible DOM,
  83429. // for instance before #render(), or after render but without a parent or a parent detached
  83430. // from DOM. DOMRects won't work anyway and there will be tons of warning in the console and
  83431. // nothing else. This happens, for instance, when the toolbar is detached from DOM and
  83432. // some logic adds or removes its #items.
  83433. if ( !this.viewElement.ownerDocument.body.contains( this.viewElement ) ) {
  83434. return;
  83435. }
  83436. // Do not update grouping when the element is invisible. Such toolbar has DOMRect filled with zeros
  83437. // and that would cause all items to be grouped. Instead, queue the grouping so it runs next time
  83438. // the toolbar is visible (the next ResizeObserver callback execution). This is handy because
  83439. // the grouping could be caused by increasing the #maxWidth when the toolbar was invisible and the next
  83440. // time it shows up, some items could actually be ungrouped (https://github.com/ckeditor/ckeditor5/issues/6575).
  83441. if ( !this.viewElement.offsetParent ) {
  83442. this.shouldUpdateGroupingOnNextResize = true;
  83443. return;
  83444. }
  83445. // Remember how many items were initially grouped so at the it is possible to figure out if the number
  83446. // of grouped items has changed. If the number has changed, geometry of the toolbar has also changed.
  83447. const initialGroupedItemsCount = this.groupedItems.length;
  83448. let wereItemsGrouped;
  83449. // Group #items as long as some wrap to the next row. This will happen, for instance,
  83450. // when the toolbar is getting narrow and there is not enough space to display all items in
  83451. // a single row.
  83452. while ( this._areItemsOverflowing ) {
  83453. this._groupLastItem();
  83454. wereItemsGrouped = true;
  83455. }
  83456. // If none were grouped now but there were some items already grouped before,
  83457. // then, what the hell, maybe let's see if some of them can be ungrouped. This happens when,
  83458. // for instance, the toolbar is stretching and there's more space in it than before.
  83459. if ( !wereItemsGrouped && this.groupedItems.length ) {
  83460. // Ungroup items as long as none are overflowing or there are none to ungroup left.
  83461. while ( this.groupedItems.length && !this._areItemsOverflowing ) {
  83462. this._ungroupFirstItem();
  83463. }
  83464. // If the ungrouping ended up with some item wrapping to the next row,
  83465. // put it back to the group toolbar ("undo the last ungroup"). We don't know whether
  83466. // an item will wrap or not until we ungroup it (that's a DOM/CSS thing) so this
  83467. // clean–up is vital for the algorithm.
  83468. if ( this._areItemsOverflowing ) {
  83469. this._groupLastItem();
  83470. }
  83471. }
  83472. if ( this.groupedItems.length !== initialGroupedItemsCount ) {
  83473. this.view.fire( 'groupedItemsUpdate' );
  83474. }
  83475. }
  83476. /**
  83477. * Returns `true` when {@link module:ui/toolbar/toolbarview~ToolbarView#element} children visually overflow,
  83478. * for instance if the toolbar is narrower than its members. Returns `false` otherwise.
  83479. *
  83480. * @private
  83481. * @type {Boolean}
  83482. */
  83483. get _areItemsOverflowing() {
  83484. // An empty toolbar cannot overflow.
  83485. if ( !this.ungroupedItems.length ) {
  83486. return false;
  83487. }
  83488. const element = this.viewElement;
  83489. const uiLanguageDirection = this.viewLocale.uiLanguageDirection;
  83490. const lastChildRect = new _ckeditor_ckeditor5_utils_src_dom_rect__WEBPACK_IMPORTED_MODULE_8__["default"]( element.lastChild );
  83491. const toolbarRect = new _ckeditor_ckeditor5_utils_src_dom_rect__WEBPACK_IMPORTED_MODULE_8__["default"]( element );
  83492. if ( !this.cachedPadding ) {
  83493. const computedStyle = _ckeditor_ckeditor5_utils_src_dom_global__WEBPACK_IMPORTED_MODULE_9__["default"].window.getComputedStyle( element );
  83494. const paddingProperty = uiLanguageDirection === 'ltr' ? 'paddingRight' : 'paddingLeft';
  83495. // parseInt() is essential because of quirky floating point numbers logic and DOM.
  83496. // If the padding turned out too big because of that, the grouped items dropdown would
  83497. // always look (from the Rect perspective) like it overflows (while it's not).
  83498. this.cachedPadding = Number.parseInt( computedStyle[ paddingProperty ] );
  83499. }
  83500. if ( uiLanguageDirection === 'ltr' ) {
  83501. return lastChildRect.right > toolbarRect.right - this.cachedPadding;
  83502. } else {
  83503. return lastChildRect.left < toolbarRect.left + this.cachedPadding;
  83504. }
  83505. }
  83506. /**
  83507. * Enables the functionality that prevents {@link #ungroupedItems} from overflowing (wrapping to the next row)
  83508. * upon resize when there is little space available. Instead, the toolbar items are moved to the
  83509. * {@link #groupedItems} collection and displayed in a dropdown at the end of the row (which has its own nested toolbar).
  83510. *
  83511. * When called, the toolbar will automatically analyze the location of its {@link #ungroupedItems} and "group"
  83512. * them in the dropdown if necessary. It will also observe the browser window for size changes in
  83513. * the future and respond to them by grouping more items or reverting already grouped back, depending
  83514. * on the visual space available.
  83515. *
  83516. * @private
  83517. */
  83518. _enableGroupingOnResize() {
  83519. let previousWidth;
  83520. // TODO: Consider debounce.
  83521. this.resizeObserver = new _ckeditor_ckeditor5_utils_src_dom_resizeobserver__WEBPACK_IMPORTED_MODULE_6__["default"]( this.viewElement, entry => {
  83522. if ( !previousWidth || previousWidth !== entry.contentRect.width || this.shouldUpdateGroupingOnNextResize ) {
  83523. this.shouldUpdateGroupingOnNextResize = false;
  83524. this._updateGrouping();
  83525. previousWidth = entry.contentRect.width;
  83526. }
  83527. } );
  83528. this._updateGrouping();
  83529. }
  83530. /**
  83531. * Enables the grouping functionality, just like {@link #_enableGroupingOnResize} but the difference is that
  83532. * it listens to the changes of {@link module:ui/toolbar/toolbarview~ToolbarView#maxWidth} instead.
  83533. *
  83534. * @private
  83535. */
  83536. _enableGroupingOnMaxWidthChange( view ) {
  83537. view.on( 'change:maxWidth', () => {
  83538. this._updateGrouping();
  83539. } );
  83540. }
  83541. /**
  83542. * When called, it will remove the last item from {@link #ungroupedItems} and move it back
  83543. * to the {@link #groupedItems} collection.
  83544. *
  83545. * The opposite of {@link #_ungroupFirstItem}.
  83546. *
  83547. * @private
  83548. */
  83549. _groupLastItem() {
  83550. if ( !this.groupedItems.length ) {
  83551. this.viewChildren.add( new _toolbarseparatorview__WEBPACK_IMPORTED_MODULE_4__["default"]() );
  83552. this.viewChildren.add( this.groupedItemsDropdown );
  83553. this.viewFocusTracker.add( this.groupedItemsDropdown.element );
  83554. }
  83555. this.groupedItems.add( this.ungroupedItems.remove( this.ungroupedItems.last ), 0 );
  83556. }
  83557. /**
  83558. * Moves the very first item belonging to {@link #groupedItems} back
  83559. * to the {@link #ungroupedItems} collection.
  83560. *
  83561. * The opposite of {@link #_groupLastItem}.
  83562. *
  83563. * @private
  83564. */
  83565. _ungroupFirstItem() {
  83566. this.ungroupedItems.add( this.groupedItems.remove( this.groupedItems.first ) );
  83567. if ( !this.groupedItems.length ) {
  83568. this.viewChildren.remove( this.groupedItemsDropdown );
  83569. this.viewChildren.remove( this.viewChildren.last );
  83570. this.viewFocusTracker.remove( this.groupedItemsDropdown.element );
  83571. }
  83572. }
  83573. /**
  83574. * Creates the {@link #groupedItemsDropdown} that hosts the members of the {@link #groupedItems}
  83575. * collection when there is not enough space in the toolbar to display all items in a single row.
  83576. *
  83577. * @private
  83578. * @returns {module:ui/dropdown/dropdownview~DropdownView}
  83579. */
  83580. _createGroupedItemsDropdown() {
  83581. const locale = this.viewLocale;
  83582. const t = locale.t;
  83583. const dropdown = Object(_dropdown_utils__WEBPACK_IMPORTED_MODULE_10__["createDropdown"])( locale );
  83584. dropdown.class = 'ck-toolbar__grouped-dropdown';
  83585. // Make sure the dropdown never sticks out to the left/right. It should be under the main toolbar.
  83586. // (https://github.com/ckeditor/ckeditor5/issues/5608)
  83587. dropdown.panelPosition = locale.uiLanguageDirection === 'ltr' ? 'sw' : 'se';
  83588. Object(_dropdown_utils__WEBPACK_IMPORTED_MODULE_10__["addToolbarToDropdown"])( dropdown, [] );
  83589. dropdown.buttonView.set( {
  83590. label: t( 'Show more items' ),
  83591. tooltip: true,
  83592. tooltipPosition: locale.uiLanguageDirection === 'rtl' ? 'se' : 'sw',
  83593. icon: ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_13__["icons"].threeVerticalDots
  83594. } );
  83595. // 1:1 pass–through binding.
  83596. dropdown.toolbarView.items.bindTo( this.groupedItems ).using( item => item );
  83597. return dropdown;
  83598. }
  83599. /**
  83600. * Updates the {@link module:ui/toolbar/toolbarview~ToolbarView#focusables focus–cycleable items}
  83601. * collection so it represents the up–to–date state of the UI from the perspective of the user.
  83602. *
  83603. * For instance, the {@link #groupedItemsDropdown} can show up and hide but when it is visible,
  83604. * it must be subject to focus cycling in the toolbar.
  83605. *
  83606. * See the {@link module:ui/toolbar/toolbarview~ToolbarView#focusables collection} documentation
  83607. * to learn more about the purpose of this method.
  83608. *
  83609. * @private
  83610. */
  83611. _updateFocusCycleableItems() {
  83612. this.viewFocusables.clear();
  83613. this.ungroupedItems.map( item => {
  83614. this.viewFocusables.add( item );
  83615. } );
  83616. if ( this.groupedItems.length ) {
  83617. this.viewFocusables.add( this.groupedItemsDropdown );
  83618. }
  83619. }
  83620. }
  83621. /**
  83622. * Options passed to the {@link module:ui/toolbar/toolbarview~ToolbarView#constructor} of the toolbar.
  83623. *
  83624. * @interface module:ui/toolbar/toolbarview~ToolbarOptions
  83625. */
  83626. /**
  83627. * When set to `true`, the toolbar will automatically group {@link module:ui/toolbar/toolbarview~ToolbarView#items} that
  83628. * would normally wrap to the next line when there is not enough space to display them in a single row, for
  83629. * instance, if the parent container of the toolbar is narrow. For toolbars in absolutely positioned containers
  83630. * without width restrictions also the {@link module:ui/toolbar/toolbarview~ToolbarOptions#isFloating} option is required to be `true`.
  83631. *
  83632. * See also: {@link module:ui/toolbar/toolbarview~ToolbarView#maxWidth}.
  83633. *
  83634. * @member {Boolean} module:ui/toolbar/toolbarview~ToolbarOptions#shouldGroupWhenFull
  83635. */
  83636. /**
  83637. * This option should be enabled for toolbars in absolutely positioned containers without width restrictions
  83638. * to enable automatic {@link module:ui/toolbar/toolbarview~ToolbarView#items} grouping.
  83639. * When this option is set to `true`, the items will stop wrapping to the next line
  83640. * and together with {@link module:ui/toolbar/toolbarview~ToolbarOptions#shouldGroupWhenFull},
  83641. * this will allow grouping them when there is not enough space in a single row.
  83642. *
  83643. * @member {Boolean} module:ui/toolbar/toolbarview~ToolbarOptions#isFloating
  83644. */
  83645. /**
  83646. * A class interface defining the behavior of the {@link module:ui/toolbar/toolbarview~ToolbarView}.
  83647. *
  83648. * Toolbar behaviors extend its look and functionality and have an impact on the
  83649. * {@link module:ui/toolbar/toolbarview~ToolbarView#element} template or
  83650. * {@link module:ui/toolbar/toolbarview~ToolbarView#render rendering}. They can be enabled
  83651. * conditionally, e.g. depending on the configuration of the toolbar.
  83652. *
  83653. * @private
  83654. * @interface module:ui/toolbar/toolbarview~ToolbarBehavior
  83655. */
  83656. /**
  83657. * Creates a new toolbar behavior instance.
  83658. *
  83659. * The instance is created in the {@link module:ui/toolbar/toolbarview~ToolbarView#constructor} of the toolbar.
  83660. * This is the right place to extend the {@link module:ui/toolbar/toolbarview~ToolbarView#template} of
  83661. * the toolbar, define extra toolbar properties, etc.
  83662. *
  83663. * @method #constructor
  83664. * @param {module:ui/toolbar/toolbarview~ToolbarView} view An instance of the toolbar that this behavior is added to.
  83665. */
  83666. /**
  83667. * A method called after the toolbar has been {@link module:ui/toolbar/toolbarview~ToolbarView#render rendered}.
  83668. * It can be used to, for example, customize the behavior of the toolbar when its {@link module:ui/toolbar/toolbarview~ToolbarView#element}
  83669. * is available.
  83670. *
  83671. * @readonly
  83672. * @member {Function} #render
  83673. * @param {module:ui/toolbar/toolbarview~ToolbarView} view An instance of the toolbar being rendered.
  83674. */
  83675. /**
  83676. * A method called after the toolbar has been {@link module:ui/toolbar/toolbarview~ToolbarView#destroy destroyed}.
  83677. * It allows cleaning up after the toolbar behavior, for instance, this is the right place to detach
  83678. * event listeners, free up references, etc.
  83679. *
  83680. * @readonly
  83681. * @member {Function} #destroy
  83682. */
  83683. /***/ }),
  83684. /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/tooltip/tooltipview.js":
  83685. /*!************************************************************************!*\
  83686. !*** ./node_modules/@ckeditor/ckeditor5-ui/src/tooltip/tooltipview.js ***!
  83687. \************************************************************************/
  83688. /*! exports provided: default */
  83689. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  83690. "use strict";
  83691. __webpack_require__.r(__webpack_exports__);
  83692. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return TooltipView; });
  83693. /* harmony import */ var _view__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../view */ "./node_modules/@ckeditor/ckeditor5-ui/src/view.js");
  83694. /* 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");
  83695. /* 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__);
  83696. /**
  83697. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  83698. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  83699. */
  83700. /**
  83701. * @module ui/tooltip/tooltipview
  83702. */
  83703. /**
  83704. * The tooltip view class.
  83705. *
  83706. * @extends module:ui/view~View
  83707. */
  83708. class TooltipView extends _view__WEBPACK_IMPORTED_MODULE_0__["default"] {
  83709. /**
  83710. * @inheritDoc
  83711. */
  83712. constructor( locale ) {
  83713. super( locale );
  83714. /**
  83715. * The text of the tooltip visible to the user.
  83716. *
  83717. * @observable
  83718. * @member {String} #text
  83719. */
  83720. this.set( 'text', '' );
  83721. /**
  83722. * The position of the tooltip (south, south-west, south-east, or north).
  83723. *
  83724. * +-----------+
  83725. * | north |
  83726. * +-----------+
  83727. * V
  83728. * [element]
  83729. *
  83730. * [element]
  83731. * ^
  83732. * +-----------+
  83733. * | south |
  83734. * +-----------+
  83735. *
  83736. * +----------+
  83737. * [element] < | east |
  83738. * +----------+
  83739. *
  83740. * +----------+
  83741. * | west | > [element]
  83742. * +----------+
  83743. *
  83744. * [element]
  83745. * ^
  83746. * +--------------+
  83747. * | south west |
  83748. * +--------------+
  83749. *
  83750. * [element]
  83751. * ^
  83752. * +--------------+
  83753. * | south east |
  83754. * +--------------+
  83755. * @observable
  83756. * @default 's'
  83757. * @member {'s'|'n'|'e'|'w'|'sw'|'se'} #position
  83758. */
  83759. this.set( 'position', 's' );
  83760. const bind = this.bindTemplate;
  83761. this.setTemplate( {
  83762. tag: 'span',
  83763. attributes: {
  83764. class: [
  83765. 'ck',
  83766. 'ck-tooltip',
  83767. bind.to( 'position', position => 'ck-tooltip_' + position ),
  83768. bind.if( 'text', 'ck-hidden', value => !value.trim() )
  83769. ]
  83770. },
  83771. children: [
  83772. {
  83773. tag: 'span',
  83774. attributes: {
  83775. class: [
  83776. 'ck',
  83777. 'ck-tooltip__text'
  83778. ]
  83779. },
  83780. children: [
  83781. {
  83782. text: bind.to( 'text' )
  83783. }
  83784. ]
  83785. }
  83786. ]
  83787. } );
  83788. }
  83789. }
  83790. /***/ }),
  83791. /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/view.js":
  83792. /*!*********************************************************!*\
  83793. !*** ./node_modules/@ckeditor/ckeditor5-ui/src/view.js ***!
  83794. \*********************************************************/
  83795. /*! exports provided: default */
  83796. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  83797. "use strict";
  83798. __webpack_require__.r(__webpack_exports__);
  83799. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return View; });
  83800. /* 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");
  83801. /* harmony import */ var _viewcollection__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./viewcollection */ "./node_modules/@ckeditor/ckeditor5-ui/src/viewcollection.js");
  83802. /* harmony import */ var _template__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./template */ "./node_modules/@ckeditor/ckeditor5-ui/src/template.js");
  83803. /* 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");
  83804. /* 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");
  83805. /* 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");
  83806. /* 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");
  83807. /* 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");
  83808. /* 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");
  83809. /* harmony import */ var _theme_globals_globals_css__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_theme_globals_globals_css__WEBPACK_IMPORTED_MODULE_8__);
  83810. /**
  83811. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  83812. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  83813. */
  83814. /**
  83815. * @module ui/view
  83816. */
  83817. /**
  83818. * The basic view class, which represents an HTML element created out of a
  83819. * {@link module:ui/view~View#template}. Views are building blocks of the user interface and handle
  83820. * interaction
  83821. *
  83822. * Views {@link module:ui/view~View#registerChild aggregate} children in
  83823. * {@link module:ui/view~View#createCollection collections} and manage the life cycle of DOM
  83824. * listeners e.g. by handling rendering and destruction.
  83825. *
  83826. * See the {@link module:ui/template~TemplateDefinition} syntax to learn more about shaping view
  83827. * elements, attributes and listeners.
  83828. *
  83829. * class SampleView extends View {
  83830. * constructor( locale ) {
  83831. * super( locale );
  83832. *
  83833. * const bind = this.bindTemplate;
  83834. *
  83835. * // Views define their interface (state) using observable attributes.
  83836. * this.set( 'elementClass', 'bar' );
  83837. *
  83838. * this.setTemplate( {
  83839. * tag: 'p',
  83840. *
  83841. * // The element of the view can be defined with its children.
  83842. * children: [
  83843. * 'Hello',
  83844. * {
  83845. * tag: 'b',
  83846. * children: [ 'world!' ]
  83847. * }
  83848. * ],
  83849. * attributes: {
  83850. * class: [
  83851. * 'foo',
  83852. *
  83853. * // Observable attributes control the state of the view in DOM.
  83854. * bind.to( 'elementClass' )
  83855. * ]
  83856. * },
  83857. * on: {
  83858. * // Views listen to DOM events and propagate them.
  83859. * click: bind.to( 'clicked' )
  83860. * }
  83861. * } );
  83862. * }
  83863. * }
  83864. *
  83865. * const view = new SampleView( locale );
  83866. *
  83867. * view.render();
  83868. *
  83869. * // Append <p class="foo bar">Hello<b>world</b></p> to the <body>
  83870. * document.body.appendChild( view.element );
  83871. *
  83872. * // Change the class attribute to <p class="foo baz">Hello<b>world</b></p>
  83873. * view.elementClass = 'baz';
  83874. *
  83875. * // Respond to the "click" event in DOM by executing a custom action.
  83876. * view.on( 'clicked', () => {
  83877. * console.log( 'The view has been clicked!' );
  83878. * } );
  83879. *
  83880. * @mixes module:utils/observablemixin~ObservableMixin
  83881. */
  83882. class View {
  83883. /**
  83884. * Creates an instance of the {@link module:ui/view~View} class.
  83885. *
  83886. * Also see {@link #render}.
  83887. *
  83888. * @param {module:utils/locale~Locale} [locale] The localization services instance.
  83889. */
  83890. constructor( locale ) {
  83891. /**
  83892. * An HTML element of the view. `null` until {@link #render rendered}
  83893. * from the {@link #template}.
  83894. *
  83895. * class SampleView extends View {
  83896. * constructor() {
  83897. * super();
  83898. *
  83899. * // A template instance the #element will be created from.
  83900. * this.setTemplate( {
  83901. * tag: 'p'
  83902. *
  83903. * // ...
  83904. * } );
  83905. * }
  83906. * }
  83907. *
  83908. * const view = new SampleView();
  83909. *
  83910. * // Renders the #template.
  83911. * view.render();
  83912. *
  83913. * // Append the HTML element of the view to <body>.
  83914. * document.body.appendChild( view.element );
  83915. *
  83916. * **Note**: The element of the view can also be assigned directly:
  83917. *
  83918. * view.element = document.querySelector( '#my-container' );
  83919. *
  83920. * @member {HTMLElement}
  83921. */
  83922. this.element = null;
  83923. /**
  83924. * Set `true` when the view has already been {@link module:ui/view~View#render rendered}.
  83925. *
  83926. * @readonly
  83927. * @member {Boolean} #isRendered
  83928. */
  83929. this.isRendered = false;
  83930. /**
  83931. * A set of tools to localize the user interface.
  83932. *
  83933. * Also see {@link module:core/editor/editor~Editor#locale}.
  83934. *
  83935. * @readonly
  83936. * @member {module:utils/locale~Locale}
  83937. */
  83938. this.locale = locale;
  83939. /**
  83940. * Shorthand for {@link module:utils/locale~Locale#t}.
  83941. *
  83942. * Note: If {@link #locale} instance hasn't been passed to the view this method may not
  83943. * be available.
  83944. *
  83945. * @see module:utils/locale~Locale#t
  83946. * @method
  83947. */
  83948. this.t = locale && locale.t;
  83949. /**
  83950. * Collections registered with {@link #createCollection}.
  83951. *
  83952. * @protected
  83953. * @member {Set.<module:ui/viewcollection~ViewCollection>}
  83954. */
  83955. this._viewCollections = new _ckeditor_ckeditor5_utils_src_collection__WEBPACK_IMPORTED_MODULE_5__["default"]();
  83956. /**
  83957. * A collection of view instances, which have been added directly
  83958. * into the {@link module:ui/template~Template#children}.
  83959. *
  83960. * @protected
  83961. * @member {module:ui/viewcollection~ViewCollection}
  83962. */
  83963. this._unboundChildren = this.createCollection();
  83964. // Pass parent locale to its children.
  83965. this._viewCollections.on( 'add', ( evt, collection ) => {
  83966. collection.locale = locale;
  83967. } );
  83968. /**
  83969. * Template of this view. It provides the {@link #element} representing
  83970. * the view in DOM, which is {@link #render rendered}.
  83971. *
  83972. * @member {module:ui/template~Template} #template
  83973. */
  83974. /**
  83975. * Cached {@link module:ui/template~BindChain bind chain} object created by the
  83976. * {@link #template}. See {@link #bindTemplate}.
  83977. *
  83978. * @private
  83979. * @member {Object} #_bindTemplate
  83980. */
  83981. this.decorate( 'render' );
  83982. }
  83983. /**
  83984. * Shorthand for {@link module:ui/template~Template.bind}, a binding
  83985. * {@link module:ui/template~BindChain interface} pre–configured for the view instance.
  83986. *
  83987. * It provides {@link module:ui/template~BindChain#to `to()`} and
  83988. * {@link module:ui/template~BindChain#if `if()`} methods that initialize bindings with
  83989. * observable attributes and attach DOM listeners.
  83990. *
  83991. * class SampleView extends View {
  83992. * constructor( locale ) {
  83993. * super( locale );
  83994. *
  83995. * const bind = this.bindTemplate;
  83996. *
  83997. * // These {@link module:utils/observablemixin~Observable observable} attributes will control
  83998. * // the state of the view in DOM.
  83999. * this.set( {
  84000. * elementClass: 'foo',
  84001. * isEnabled: true
  84002. * } );
  84003. *
  84004. * this.setTemplate( {
  84005. * tag: 'p',
  84006. *
  84007. * attributes: {
  84008. * // The class HTML attribute will follow elementClass
  84009. * // and isEnabled view attributes.
  84010. * class: [
  84011. * bind.to( 'elementClass' )
  84012. * bind.if( 'isEnabled', 'present-when-enabled' )
  84013. * ]
  84014. * },
  84015. *
  84016. * on: {
  84017. * // The view will fire the "clicked" event upon clicking <p> in DOM.
  84018. * click: bind.to( 'clicked' )
  84019. * }
  84020. * } );
  84021. * }
  84022. * }
  84023. *
  84024. * @method #bindTemplate
  84025. */
  84026. get bindTemplate() {
  84027. if ( this._bindTemplate ) {
  84028. return this._bindTemplate;
  84029. }
  84030. return ( this._bindTemplate = _template__WEBPACK_IMPORTED_MODULE_2__["default"].bind( this, this ) );
  84031. }
  84032. /**
  84033. * Creates a new collection of views, which can be used as
  84034. * {@link module:ui/template~Template#children} of this view.
  84035. *
  84036. * class SampleView extends View {
  84037. * constructor( locale ) {
  84038. * super( locale );
  84039. *
  84040. * const child = new ChildView( locale );
  84041. * this.items = this.createCollection( [ child ] );
  84042. *
  84043. * this.setTemplate( {
  84044. * tag: 'p',
  84045. *
  84046. * // `items` collection will render here.
  84047. * children: this.items
  84048. * } );
  84049. * }
  84050. * }
  84051. *
  84052. * const view = new SampleView( locale );
  84053. * view.render();
  84054. *
  84055. * // It will append <p><child#element></p> to the <body>.
  84056. * document.body.appendChild( view.element );
  84057. *
  84058. * @param {Iterable.<module:ui/view~View>} [views] Initial views of the collection.
  84059. * @returns {module:ui/viewcollection~ViewCollection} A new collection of view instances.
  84060. */
  84061. createCollection( views ) {
  84062. const collection = new _viewcollection__WEBPACK_IMPORTED_MODULE_1__["default"]( views );
  84063. this._viewCollections.add( collection );
  84064. return collection;
  84065. }
  84066. /**
  84067. * Registers a new child view under the view instance. Once registered, a child
  84068. * view is managed by its parent, including {@link #render rendering}
  84069. * and {@link #destroy destruction}.
  84070. *
  84071. * To revert this, use {@link #deregisterChild}.
  84072. *
  84073. * class SampleView extends View {
  84074. * constructor( locale ) {
  84075. * super( locale );
  84076. *
  84077. * this.childA = new SomeChildView( locale );
  84078. * this.childB = new SomeChildView( locale );
  84079. *
  84080. * this.setTemplate( { tag: 'p' } );
  84081. *
  84082. * // Register the children.
  84083. * this.registerChild( [ this.childA, this.childB ] );
  84084. * }
  84085. *
  84086. * render() {
  84087. * super.render();
  84088. *
  84089. * this.element.appendChild( this.childA.element );
  84090. * this.element.appendChild( this.childB.element );
  84091. * }
  84092. * }
  84093. *
  84094. * const view = new SampleView( locale );
  84095. *
  84096. * view.render();
  84097. *
  84098. * // Will append <p><childA#element><b></b><childB#element></p>.
  84099. * document.body.appendChild( view.element );
  84100. *
  84101. * **Note**: There's no need to add child views if they're already referenced in the
  84102. * {@link #template}:
  84103. *
  84104. * class SampleView extends View {
  84105. * constructor( locale ) {
  84106. * super( locale );
  84107. *
  84108. * this.childA = new SomeChildView( locale );
  84109. * this.childB = new SomeChildView( locale );
  84110. *
  84111. * this.setTemplate( {
  84112. * tag: 'p',
  84113. *
  84114. * // These children will be added automatically. There's no
  84115. * // need to call {@link #registerChild} for any of them.
  84116. * children: [ this.childA, this.childB ]
  84117. * } );
  84118. * }
  84119. *
  84120. * // ...
  84121. * }
  84122. *
  84123. * @param {module:ui/view~View|Iterable.<module:ui/view~View>} children Children views to be registered.
  84124. */
  84125. registerChild( children ) {
  84126. if ( !Object(_ckeditor_ckeditor5_utils_src_isiterable__WEBPACK_IMPORTED_MODULE_7__["default"])( children ) ) {
  84127. children = [ children ];
  84128. }
  84129. for ( const child of children ) {
  84130. this._unboundChildren.add( child );
  84131. }
  84132. }
  84133. /**
  84134. * The opposite of {@link #registerChild}. Removes a child view from this view instance.
  84135. * Once removed, the child is no longer managed by its parent, e.g. it can safely
  84136. * become a child of another parent view.
  84137. *
  84138. * @see #registerChild
  84139. * @param {module:ui/view~View|Iterable.<module:ui/view~View>} children Child views to be removed.
  84140. */
  84141. deregisterChild( children ) {
  84142. if ( !Object(_ckeditor_ckeditor5_utils_src_isiterable__WEBPACK_IMPORTED_MODULE_7__["default"])( children ) ) {
  84143. children = [ children ];
  84144. }
  84145. for ( const child of children ) {
  84146. this._unboundChildren.remove( child );
  84147. }
  84148. }
  84149. /**
  84150. * Sets the {@link #template} of the view with with given definition.
  84151. *
  84152. * A shorthand for:
  84153. *
  84154. * view.setTemplate( definition );
  84155. *
  84156. * @param {module:ui/template~TemplateDefinition} definition Definition of view's template.
  84157. */
  84158. setTemplate( definition ) {
  84159. this.template = new _template__WEBPACK_IMPORTED_MODULE_2__["default"]( definition );
  84160. }
  84161. /**
  84162. * {@link module:ui/template~Template.extend Extends} the {@link #template} of the view with
  84163. * with given definition.
  84164. *
  84165. * A shorthand for:
  84166. *
  84167. * Template.extend( view.template, definition );
  84168. *
  84169. * **Note**: Is requires the {@link #template} to be already set. See {@link #setTemplate}.
  84170. *
  84171. * @param {module:ui/template~TemplateDefinition} definition Definition which
  84172. * extends the {@link #template}.
  84173. */
  84174. extendTemplate( definition ) {
  84175. _template__WEBPACK_IMPORTED_MODULE_2__["default"].extend( this.template, definition );
  84176. }
  84177. /**
  84178. * Recursively renders the view.
  84179. *
  84180. * Once the view is rendered:
  84181. * * the {@link #element} becomes an HTML element out of {@link #template},
  84182. * * the {@link #isRendered} flag is set `true`.
  84183. *
  84184. * **Note**: The children of the view:
  84185. * * defined directly in the {@link #template}
  84186. * * residing in collections created by the {@link #createCollection} method,
  84187. * * and added by {@link #registerChild}
  84188. * are also rendered in the process.
  84189. *
  84190. * In general, `render()` method is the right place to keep the code which refers to the
  84191. * {@link #element} and should be executed at the very beginning of the view's life cycle.
  84192. *
  84193. * It is possible to {@link module:ui/template~Template.extend} the {@link #template} before
  84194. * the view is rendered. To allow an early customization of the view (e.g. by its parent),
  84195. * such references should be done in `render()`.
  84196. *
  84197. * class SampleView extends View {
  84198. * constructor() {
  84199. * this.setTemplate( {
  84200. * // ...
  84201. * } );
  84202. * },
  84203. *
  84204. * render() {
  84205. * // View#element becomes available.
  84206. * super.render();
  84207. *
  84208. * // The "scroll" listener depends on #element.
  84209. * this.listenTo( window, 'scroll', () => {
  84210. * // A reference to #element would render the #template and make it non-extendable.
  84211. * if ( window.scrollY > 0 ) {
  84212. * this.element.scrollLeft = 100;
  84213. * } else {
  84214. * this.element.scrollLeft = 0;
  84215. * }
  84216. * } );
  84217. * }
  84218. * }
  84219. *
  84220. * const view = new SampleView();
  84221. *
  84222. * // Let's customize the view before it gets rendered.
  84223. * view.extendTemplate( {
  84224. * attributes: {
  84225. * class: [
  84226. * 'additional-class'
  84227. * ]
  84228. * }
  84229. * } );
  84230. *
  84231. * // Late rendering allows customization of the view.
  84232. * view.render();
  84233. */
  84234. render() {
  84235. if ( this.isRendered ) {
  84236. /**
  84237. * This View has already been rendered.
  84238. *
  84239. * @error ui-view-render-already-rendered
  84240. */
  84241. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"]( 'ui-view-render-already-rendered', this );
  84242. }
  84243. // Render #element of the view.
  84244. if ( this.template ) {
  84245. this.element = this.template.render();
  84246. // Auto–register view children from #template.
  84247. this.registerChild( this.template.getViews() );
  84248. }
  84249. this.isRendered = true;
  84250. }
  84251. /**
  84252. * Recursively destroys the view instance and child views added by {@link #registerChild} and
  84253. * residing in collections created by the {@link #createCollection}.
  84254. *
  84255. * Destruction disables all event listeners:
  84256. * * created on the view, e.g. `view.on( 'event', () => {} )`,
  84257. * * defined in the {@link #template} for DOM events.
  84258. */
  84259. destroy() {
  84260. this.stopListening();
  84261. this._viewCollections.map( c => c.destroy() );
  84262. // Template isn't obligatory for views.
  84263. if ( this.template && this.template._revertData ) {
  84264. this.template.revert( this.element );
  84265. }
  84266. }
  84267. /**
  84268. * Event fired by the {@link #render} method. Actual rendering is executed as a listener to
  84269. * this event with the default priority.
  84270. *
  84271. * See {@link module:utils/observablemixin~ObservableMixin#decorate} for more information and samples.
  84272. *
  84273. * @event render
  84274. */
  84275. }
  84276. Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_6__["default"])( View, _ckeditor_ckeditor5_utils_src_dom_emittermixin__WEBPACK_IMPORTED_MODULE_3__["default"] );
  84277. Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_6__["default"])( View, _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_4__["default"] );
  84278. /***/ }),
  84279. /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/viewcollection.js":
  84280. /*!*******************************************************************!*\
  84281. !*** ./node_modules/@ckeditor/ckeditor5-ui/src/viewcollection.js ***!
  84282. \*******************************************************************/
  84283. /*! exports provided: default */
  84284. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  84285. "use strict";
  84286. __webpack_require__.r(__webpack_exports__);
  84287. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ViewCollection; });
  84288. /* 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");
  84289. /* 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");
  84290. /**
  84291. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  84292. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  84293. */
  84294. /**
  84295. * @module ui/viewcollection
  84296. */
  84297. /**
  84298. * Collects {@link module:ui/view~View} instances.
  84299. *
  84300. * const parentView = new ParentView( locale );
  84301. * const collection = new ViewCollection( locale );
  84302. *
  84303. * collection.setParent( parentView.element );
  84304. *
  84305. * const viewA = new ChildView( locale );
  84306. * const viewB = new ChildView( locale );
  84307. *
  84308. * View collection renders and manages view {@link module:ui/view~View#element elements}:
  84309. *
  84310. * collection.add( viewA );
  84311. * collection.add( viewB );
  84312. *
  84313. * console.log( parentView.element.firsChild ); // -> viewA.element
  84314. * console.log( parentView.element.lastChild ); // -> viewB.element
  84315. *
  84316. * It {@link module:ui/viewcollection~ViewCollection#delegate propagates} DOM events too:
  84317. *
  84318. * // Delegate #click and #keydown events from viewA and viewB to the parentView.
  84319. * collection.delegate( 'click' ).to( parentView );
  84320. *
  84321. * parentView.on( 'click', ( evt ) => {
  84322. * console.log( `${ evt.source } has been clicked.` );
  84323. * } );
  84324. *
  84325. * // This event will be delegated to the parentView.
  84326. * viewB.fire( 'click' );
  84327. *
  84328. * **Note**: A view collection can be used directly in the {@link module:ui/template~TemplateDefinition definition}
  84329. * of a {@link module:ui/template~Template template}.
  84330. *
  84331. * @extends module:utils/collection~Collection
  84332. * @mixes module:utils/observablemixin~ObservableMixin
  84333. */
  84334. class ViewCollection extends _ckeditor_ckeditor5_utils_src_collection__WEBPACK_IMPORTED_MODULE_1__["default"] {
  84335. /**
  84336. * Creates a new instance of the {@link module:ui/viewcollection~ViewCollection}.
  84337. *
  84338. * @param {Iterable.<module:ui/view~View>} [initialItems] The initial items of the collection.
  84339. */
  84340. constructor( initialItems = [] ) {
  84341. super( initialItems, {
  84342. // An #id Number attribute should be legal and not break the `ViewCollection` instance.
  84343. // https://github.com/ckeditor/ckeditor5-ui/issues/93
  84344. idProperty: 'viewUid'
  84345. } );
  84346. // Handle {@link module:ui/view~View#element} in DOM when a new view is added to the collection.
  84347. this.on( 'add', ( evt, view, index ) => {
  84348. this._renderViewIntoCollectionParent( view, index );
  84349. } );
  84350. // Handle {@link module:ui/view~View#element} in DOM when a view is removed from the collection.
  84351. this.on( 'remove', ( evt, view ) => {
  84352. if ( view.element && this._parentElement ) {
  84353. view.element.remove();
  84354. }
  84355. } );
  84356. /**
  84357. * A parent element within which child views are rendered and managed in DOM.
  84358. *
  84359. * @protected
  84360. * @member {HTMLElement}
  84361. */
  84362. this._parentElement = null;
  84363. }
  84364. /**
  84365. * Destroys the view collection along with child views.
  84366. * See the view {@link module:ui/view~View#destroy} method.
  84367. */
  84368. destroy() {
  84369. this.map( view => view.destroy() );
  84370. }
  84371. /**
  84372. * Sets the parent HTML element of this collection. When parent is set, {@link #add adding} and
  84373. * {@link #remove removing} views in the collection synchronizes their
  84374. * {@link module:ui/view~View#element elements} in the parent element.
  84375. *
  84376. * @param {HTMLElement} element A new parent element.
  84377. */
  84378. setParent( elementOrDocFragment ) {
  84379. this._parentElement = elementOrDocFragment;
  84380. // Take care of the initial collection items passed to the constructor.
  84381. for ( const view of this ) {
  84382. this._renderViewIntoCollectionParent( view );
  84383. }
  84384. }
  84385. /**
  84386. * Delegates selected events coming from within views in the collection to any
  84387. * {@link module:utils/emittermixin~Emitter}.
  84388. *
  84389. * For the following views and collection:
  84390. *
  84391. * const viewA = new View();
  84392. * const viewB = new View();
  84393. * const viewC = new View();
  84394. *
  84395. * const views = parentView.createCollection();
  84396. *
  84397. * views.delegate( 'eventX' ).to( viewB );
  84398. * views.delegate( 'eventX', 'eventY' ).to( viewC );
  84399. *
  84400. * views.add( viewA );
  84401. *
  84402. * the `eventX` is delegated (fired by) `viewB` and `viewC` along with `customData`:
  84403. *
  84404. * viewA.fire( 'eventX', customData );
  84405. *
  84406. * and `eventY` is delegated (fired by) `viewC` along with `customData`:
  84407. *
  84408. * viewA.fire( 'eventY', customData );
  84409. *
  84410. * See {@link module:utils/emittermixin~Emitter#delegate}.
  84411. *
  84412. * @param {...String} events {@link module:ui/view~View} event names to be delegated to another
  84413. * {@link module:utils/emittermixin~Emitter}.
  84414. * @returns {Object}
  84415. * @returns {Function} return.to A function which accepts the destination of
  84416. * {@link module:utils/emittermixin~Emitter#delegate delegated} events.
  84417. */
  84418. delegate( ...events ) {
  84419. if ( !events.length || !isStringArray( events ) ) {
  84420. /**
  84421. * All event names must be strings.
  84422. *
  84423. * @error ui-viewcollection-delegate-wrong-events
  84424. */
  84425. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"](
  84426. 'ui-viewcollection-delegate-wrong-events',
  84427. this
  84428. );
  84429. }
  84430. return {
  84431. /**
  84432. * Selects destination for {@link module:utils/emittermixin~Emitter#delegate} events.
  84433. *
  84434. * @memberOf module:ui/viewcollection~ViewCollection#delegate
  84435. * @function module:ui/viewcollection~ViewCollection#delegate.to
  84436. * @param {module:utils/emittermixin~Emitter} dest An `Emitter` instance which is
  84437. * the destination for delegated events.
  84438. */
  84439. to: dest => {
  84440. // Activate delegating on existing views in this collection.
  84441. for ( const view of this ) {
  84442. for ( const evtName of events ) {
  84443. view.delegate( evtName ).to( dest );
  84444. }
  84445. }
  84446. // Activate delegating on future views in this collection.
  84447. this.on( 'add', ( evt, view ) => {
  84448. for ( const evtName of events ) {
  84449. view.delegate( evtName ).to( dest );
  84450. }
  84451. } );
  84452. // Deactivate delegating when view is removed from this collection.
  84453. this.on( 'remove', ( evt, view ) => {
  84454. for ( const evtName of events ) {
  84455. view.stopDelegating( evtName, dest );
  84456. }
  84457. } );
  84458. }
  84459. };
  84460. }
  84461. /**
  84462. * This method {@link module:ui/view~View#render renders} a new view added to the collection.
  84463. *
  84464. * If the {@link #_parentElement parent element} of the collection is set, this method also adds
  84465. * the view's {@link module:ui/view~View#element} as a child of the parent in DOM at a specified index.
  84466. *
  84467. * **Note**: If index is not specified, the view's element is pushed as the last child
  84468. * of the parent element.
  84469. *
  84470. * @private
  84471. * @param {module:ui/view~View} view A new view added to the collection.
  84472. * @param {Number} [index] An index the view holds in the collection. When not specified,
  84473. * the view is added at the end.
  84474. */
  84475. _renderViewIntoCollectionParent( view, index ) {
  84476. if ( !view.isRendered ) {
  84477. view.render();
  84478. }
  84479. if ( view.element && this._parentElement ) {
  84480. this._parentElement.insertBefore( view.element, this._parentElement.children[ index ] );
  84481. }
  84482. }
  84483. /**
  84484. * Removes a child view from the collection. If the {@link #setParent parent element} of the
  84485. * collection has been set, the {@link module:ui/view~View#element element} of the view is also removed
  84486. * in DOM, reflecting the order of the collection.
  84487. *
  84488. * See the {@link #add} method.
  84489. *
  84490. * @method #remove
  84491. * @param {module:ui/view~View|Number|String} subject The view to remove, its id or index in the collection.
  84492. * @returns {Object} The removed view.
  84493. */
  84494. }
  84495. // Check if all entries of the array are of `String` type.
  84496. //
  84497. // @private
  84498. // @param {Array} arr An array to be checked.
  84499. // @returns {Boolean}
  84500. function isStringArray( arr ) {
  84501. return arr.every( a => typeof a == 'string' );
  84502. }
  84503. /***/ }),
  84504. /***/ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/button/button.css":
  84505. /*!********************************************************************************!*\
  84506. !*** ./node_modules/@ckeditor/ckeditor5-ui/theme/components/button/button.css ***!
  84507. \********************************************************************************/
  84508. /*! no static exports found */
  84509. /***/ (function(module, exports, __webpack_require__) {
  84510. var api = __webpack_require__(/*! ../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  84511. 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");
  84512. content = content.__esModule ? content.default : content;
  84513. if (typeof content === 'string') {
  84514. content = [[module.i, content, '']];
  84515. }
  84516. var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
  84517. options.insert = "head";
  84518. options.singleton = true;
  84519. var update = api(content, options);
  84520. module.exports = content.locals || {};
  84521. /***/ }),
  84522. /***/ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/button/switchbutton.css":
  84523. /*!**************************************************************************************!*\
  84524. !*** ./node_modules/@ckeditor/ckeditor5-ui/theme/components/button/switchbutton.css ***!
  84525. \**************************************************************************************/
  84526. /*! no static exports found */
  84527. /***/ (function(module, exports, __webpack_require__) {
  84528. var api = __webpack_require__(/*! ../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  84529. 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");
  84530. content = content.__esModule ? content.default : content;
  84531. if (typeof content === 'string') {
  84532. content = [[module.i, content, '']];
  84533. }
  84534. var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
  84535. options.insert = "head";
  84536. options.singleton = true;
  84537. var update = api(content, options);
  84538. module.exports = content.locals || {};
  84539. /***/ }),
  84540. /***/ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/colorgrid/colorgrid.css":
  84541. /*!**************************************************************************************!*\
  84542. !*** ./node_modules/@ckeditor/ckeditor5-ui/theme/components/colorgrid/colorgrid.css ***!
  84543. \**************************************************************************************/
  84544. /*! no static exports found */
  84545. /***/ (function(module, exports, __webpack_require__) {
  84546. var api = __webpack_require__(/*! ../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  84547. 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");
  84548. content = content.__esModule ? content.default : content;
  84549. if (typeof content === 'string') {
  84550. content = [[module.i, content, '']];
  84551. }
  84552. var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
  84553. options.insert = "head";
  84554. options.singleton = true;
  84555. var update = api(content, options);
  84556. module.exports = content.locals || {};
  84557. /***/ }),
  84558. /***/ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/dropdown/dropdown.css":
  84559. /*!************************************************************************************!*\
  84560. !*** ./node_modules/@ckeditor/ckeditor5-ui/theme/components/dropdown/dropdown.css ***!
  84561. \************************************************************************************/
  84562. /*! no static exports found */
  84563. /***/ (function(module, exports, __webpack_require__) {
  84564. var api = __webpack_require__(/*! ../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  84565. 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");
  84566. content = content.__esModule ? content.default : content;
  84567. if (typeof content === 'string') {
  84568. content = [[module.i, content, '']];
  84569. }
  84570. var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
  84571. options.insert = "head";
  84572. options.singleton = true;
  84573. var update = api(content, options);
  84574. module.exports = content.locals || {};
  84575. /***/ }),
  84576. /***/ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/dropdown/listdropdown.css":
  84577. /*!****************************************************************************************!*\
  84578. !*** ./node_modules/@ckeditor/ckeditor5-ui/theme/components/dropdown/listdropdown.css ***!
  84579. \****************************************************************************************/
  84580. /*! no static exports found */
  84581. /***/ (function(module, exports, __webpack_require__) {
  84582. var api = __webpack_require__(/*! ../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  84583. 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");
  84584. content = content.__esModule ? content.default : content;
  84585. if (typeof content === 'string') {
  84586. content = [[module.i, content, '']];
  84587. }
  84588. var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
  84589. options.insert = "head";
  84590. options.singleton = true;
  84591. var update = api(content, options);
  84592. module.exports = content.locals || {};
  84593. /***/ }),
  84594. /***/ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/dropdown/splitbutton.css":
  84595. /*!***************************************************************************************!*\
  84596. !*** ./node_modules/@ckeditor/ckeditor5-ui/theme/components/dropdown/splitbutton.css ***!
  84597. \***************************************************************************************/
  84598. /*! no static exports found */
  84599. /***/ (function(module, exports, __webpack_require__) {
  84600. var api = __webpack_require__(/*! ../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  84601. 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");
  84602. content = content.__esModule ? content.default : content;
  84603. if (typeof content === 'string') {
  84604. content = [[module.i, content, '']];
  84605. }
  84606. var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
  84607. options.insert = "head";
  84608. options.singleton = true;
  84609. var update = api(content, options);
  84610. module.exports = content.locals || {};
  84611. /***/ }),
  84612. /***/ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/dropdown/toolbardropdown.css":
  84613. /*!*******************************************************************************************!*\
  84614. !*** ./node_modules/@ckeditor/ckeditor5-ui/theme/components/dropdown/toolbardropdown.css ***!
  84615. \*******************************************************************************************/
  84616. /*! no static exports found */
  84617. /***/ (function(module, exports, __webpack_require__) {
  84618. var api = __webpack_require__(/*! ../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  84619. 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");
  84620. content = content.__esModule ? content.default : content;
  84621. if (typeof content === 'string') {
  84622. content = [[module.i, content, '']];
  84623. }
  84624. var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
  84625. options.insert = "head";
  84626. options.singleton = true;
  84627. var update = api(content, options);
  84628. module.exports = content.locals || {};
  84629. /***/ }),
  84630. /***/ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/editorui/editorui.css":
  84631. /*!************************************************************************************!*\
  84632. !*** ./node_modules/@ckeditor/ckeditor5-ui/theme/components/editorui/editorui.css ***!
  84633. \************************************************************************************/
  84634. /*! no static exports found */
  84635. /***/ (function(module, exports, __webpack_require__) {
  84636. var api = __webpack_require__(/*! ../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  84637. 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");
  84638. content = content.__esModule ? content.default : content;
  84639. if (typeof content === 'string') {
  84640. content = [[module.i, content, '']];
  84641. }
  84642. var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
  84643. options.insert = "head";
  84644. options.singleton = true;
  84645. var update = api(content, options);
  84646. module.exports = content.locals || {};
  84647. /***/ }),
  84648. /***/ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/formheader/formheader.css":
  84649. /*!****************************************************************************************!*\
  84650. !*** ./node_modules/@ckeditor/ckeditor5-ui/theme/components/formheader/formheader.css ***!
  84651. \****************************************************************************************/
  84652. /*! no static exports found */
  84653. /***/ (function(module, exports, __webpack_require__) {
  84654. var api = __webpack_require__(/*! ../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  84655. var content = __webpack_require__(/*! !../../../../../postcss-loader/src??ref--5-1!./formheader.css */ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/formheader/formheader.css");
  84656. content = content.__esModule ? content.default : content;
  84657. if (typeof content === 'string') {
  84658. content = [[module.i, content, '']];
  84659. }
  84660. var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
  84661. options.insert = "head";
  84662. options.singleton = true;
  84663. var update = api(content, options);
  84664. module.exports = content.locals || {};
  84665. /***/ }),
  84666. /***/ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/icon/icon.css":
  84667. /*!****************************************************************************!*\
  84668. !*** ./node_modules/@ckeditor/ckeditor5-ui/theme/components/icon/icon.css ***!
  84669. \****************************************************************************/
  84670. /*! no static exports found */
  84671. /***/ (function(module, exports, __webpack_require__) {
  84672. var api = __webpack_require__(/*! ../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  84673. 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");
  84674. content = content.__esModule ? content.default : content;
  84675. if (typeof content === 'string') {
  84676. content = [[module.i, content, '']];
  84677. }
  84678. var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
  84679. options.insert = "head";
  84680. options.singleton = true;
  84681. var update = api(content, options);
  84682. module.exports = content.locals || {};
  84683. /***/ }),
  84684. /***/ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/inputtext/inputtext.css":
  84685. /*!**************************************************************************************!*\
  84686. !*** ./node_modules/@ckeditor/ckeditor5-ui/theme/components/inputtext/inputtext.css ***!
  84687. \**************************************************************************************/
  84688. /*! no static exports found */
  84689. /***/ (function(module, exports, __webpack_require__) {
  84690. var api = __webpack_require__(/*! ../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  84691. 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");
  84692. content = content.__esModule ? content.default : content;
  84693. if (typeof content === 'string') {
  84694. content = [[module.i, content, '']];
  84695. }
  84696. var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
  84697. options.insert = "head";
  84698. options.singleton = true;
  84699. var update = api(content, options);
  84700. module.exports = content.locals || {};
  84701. /***/ }),
  84702. /***/ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/label/label.css":
  84703. /*!******************************************************************************!*\
  84704. !*** ./node_modules/@ckeditor/ckeditor5-ui/theme/components/label/label.css ***!
  84705. \******************************************************************************/
  84706. /*! no static exports found */
  84707. /***/ (function(module, exports, __webpack_require__) {
  84708. var api = __webpack_require__(/*! ../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  84709. 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");
  84710. content = content.__esModule ? content.default : content;
  84711. if (typeof content === 'string') {
  84712. content = [[module.i, content, '']];
  84713. }
  84714. var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
  84715. options.insert = "head";
  84716. options.singleton = true;
  84717. var update = api(content, options);
  84718. module.exports = content.locals || {};
  84719. /***/ }),
  84720. /***/ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/labeledfield/labeledfieldview.css":
  84721. /*!************************************************************************************************!*\
  84722. !*** ./node_modules/@ckeditor/ckeditor5-ui/theme/components/labeledfield/labeledfieldview.css ***!
  84723. \************************************************************************************************/
  84724. /*! no static exports found */
  84725. /***/ (function(module, exports, __webpack_require__) {
  84726. var api = __webpack_require__(/*! ../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  84727. 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");
  84728. content = content.__esModule ? content.default : content;
  84729. if (typeof content === 'string') {
  84730. content = [[module.i, content, '']];
  84731. }
  84732. var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
  84733. options.insert = "head";
  84734. options.singleton = true;
  84735. var update = api(content, options);
  84736. module.exports = content.locals || {};
  84737. /***/ }),
  84738. /***/ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/list/list.css":
  84739. /*!****************************************************************************!*\
  84740. !*** ./node_modules/@ckeditor/ckeditor5-ui/theme/components/list/list.css ***!
  84741. \****************************************************************************/
  84742. /*! no static exports found */
  84743. /***/ (function(module, exports, __webpack_require__) {
  84744. var api = __webpack_require__(/*! ../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  84745. 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");
  84746. content = content.__esModule ? content.default : content;
  84747. if (typeof content === 'string') {
  84748. content = [[module.i, content, '']];
  84749. }
  84750. var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
  84751. options.insert = "head";
  84752. options.singleton = true;
  84753. var update = api(content, options);
  84754. module.exports = content.locals || {};
  84755. /***/ }),
  84756. /***/ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/panel/balloonpanel.css":
  84757. /*!*************************************************************************************!*\
  84758. !*** ./node_modules/@ckeditor/ckeditor5-ui/theme/components/panel/balloonpanel.css ***!
  84759. \*************************************************************************************/
  84760. /*! no static exports found */
  84761. /***/ (function(module, exports, __webpack_require__) {
  84762. var api = __webpack_require__(/*! ../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  84763. 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");
  84764. content = content.__esModule ? content.default : content;
  84765. if (typeof content === 'string') {
  84766. content = [[module.i, content, '']];
  84767. }
  84768. var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
  84769. options.insert = "head";
  84770. options.singleton = true;
  84771. var update = api(content, options);
  84772. module.exports = content.locals || {};
  84773. /***/ }),
  84774. /***/ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/panel/balloonrotator.css":
  84775. /*!***************************************************************************************!*\
  84776. !*** ./node_modules/@ckeditor/ckeditor5-ui/theme/components/panel/balloonrotator.css ***!
  84777. \***************************************************************************************/
  84778. /*! no static exports found */
  84779. /***/ (function(module, exports, __webpack_require__) {
  84780. var api = __webpack_require__(/*! ../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  84781. 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");
  84782. content = content.__esModule ? content.default : content;
  84783. if (typeof content === 'string') {
  84784. content = [[module.i, content, '']];
  84785. }
  84786. var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
  84787. options.insert = "head";
  84788. options.singleton = true;
  84789. var update = api(content, options);
  84790. module.exports = content.locals || {};
  84791. /***/ }),
  84792. /***/ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/panel/fakepanel.css":
  84793. /*!**********************************************************************************!*\
  84794. !*** ./node_modules/@ckeditor/ckeditor5-ui/theme/components/panel/fakepanel.css ***!
  84795. \**********************************************************************************/
  84796. /*! no static exports found */
  84797. /***/ (function(module, exports, __webpack_require__) {
  84798. var api = __webpack_require__(/*! ../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  84799. 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");
  84800. content = content.__esModule ? content.default : content;
  84801. if (typeof content === 'string') {
  84802. content = [[module.i, content, '']];
  84803. }
  84804. var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
  84805. options.insert = "head";
  84806. options.singleton = true;
  84807. var update = api(content, options);
  84808. module.exports = content.locals || {};
  84809. /***/ }),
  84810. /***/ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/panel/stickypanel.css":
  84811. /*!************************************************************************************!*\
  84812. !*** ./node_modules/@ckeditor/ckeditor5-ui/theme/components/panel/stickypanel.css ***!
  84813. \************************************************************************************/
  84814. /*! no static exports found */
  84815. /***/ (function(module, exports, __webpack_require__) {
  84816. var api = __webpack_require__(/*! ../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  84817. 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");
  84818. content = content.__esModule ? content.default : content;
  84819. if (typeof content === 'string') {
  84820. content = [[module.i, content, '']];
  84821. }
  84822. var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
  84823. options.insert = "head";
  84824. options.singleton = true;
  84825. var update = api(content, options);
  84826. module.exports = content.locals || {};
  84827. /***/ }),
  84828. /***/ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/responsive-form/responsiveform.css":
  84829. /*!*************************************************************************************************!*\
  84830. !*** ./node_modules/@ckeditor/ckeditor5-ui/theme/components/responsive-form/responsiveform.css ***!
  84831. \*************************************************************************************************/
  84832. /*! no static exports found */
  84833. /***/ (function(module, exports, __webpack_require__) {
  84834. var api = __webpack_require__(/*! ../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  84835. 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");
  84836. content = content.__esModule ? content.default : content;
  84837. if (typeof content === 'string') {
  84838. content = [[module.i, content, '']];
  84839. }
  84840. var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
  84841. options.insert = "head";
  84842. options.singleton = true;
  84843. var update = api(content, options);
  84844. module.exports = content.locals || {};
  84845. /***/ }),
  84846. /***/ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/toolbar/blocktoolbar.css":
  84847. /*!***************************************************************************************!*\
  84848. !*** ./node_modules/@ckeditor/ckeditor5-ui/theme/components/toolbar/blocktoolbar.css ***!
  84849. \***************************************************************************************/
  84850. /*! no static exports found */
  84851. /***/ (function(module, exports, __webpack_require__) {
  84852. var api = __webpack_require__(/*! ../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  84853. var content = __webpack_require__(/*! !../../../../../postcss-loader/src??ref--5-1!./blocktoolbar.css */ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/toolbar/blocktoolbar.css");
  84854. content = content.__esModule ? content.default : content;
  84855. if (typeof content === 'string') {
  84856. content = [[module.i, content, '']];
  84857. }
  84858. var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
  84859. options.insert = "head";
  84860. options.singleton = true;
  84861. var update = api(content, options);
  84862. module.exports = content.locals || {};
  84863. /***/ }),
  84864. /***/ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/toolbar/toolbar.css":
  84865. /*!**********************************************************************************!*\
  84866. !*** ./node_modules/@ckeditor/ckeditor5-ui/theme/components/toolbar/toolbar.css ***!
  84867. \**********************************************************************************/
  84868. /*! no static exports found */
  84869. /***/ (function(module, exports, __webpack_require__) {
  84870. var api = __webpack_require__(/*! ../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  84871. 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");
  84872. content = content.__esModule ? content.default : content;
  84873. if (typeof content === 'string') {
  84874. content = [[module.i, content, '']];
  84875. }
  84876. var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
  84877. options.insert = "head";
  84878. options.singleton = true;
  84879. var update = api(content, options);
  84880. module.exports = content.locals || {};
  84881. /***/ }),
  84882. /***/ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/tooltip/tooltip.css":
  84883. /*!**********************************************************************************!*\
  84884. !*** ./node_modules/@ckeditor/ckeditor5-ui/theme/components/tooltip/tooltip.css ***!
  84885. \**********************************************************************************/
  84886. /*! no static exports found */
  84887. /***/ (function(module, exports, __webpack_require__) {
  84888. var api = __webpack_require__(/*! ../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  84889. 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");
  84890. content = content.__esModule ? content.default : content;
  84891. if (typeof content === 'string') {
  84892. content = [[module.i, content, '']];
  84893. }
  84894. var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
  84895. options.insert = "head";
  84896. options.singleton = true;
  84897. var update = api(content, options);
  84898. module.exports = content.locals || {};
  84899. /***/ }),
  84900. /***/ "./node_modules/@ckeditor/ckeditor5-ui/theme/globals/globals.css":
  84901. /*!***********************************************************************!*\
  84902. !*** ./node_modules/@ckeditor/ckeditor5-ui/theme/globals/globals.css ***!
  84903. \***********************************************************************/
  84904. /*! no static exports found */
  84905. /***/ (function(module, exports, __webpack_require__) {
  84906. var api = __webpack_require__(/*! ../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  84907. 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");
  84908. content = content.__esModule ? content.default : content;
  84909. if (typeof content === 'string') {
  84910. content = [[module.i, content, '']];
  84911. }
  84912. var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
  84913. options.insert = "head";
  84914. options.singleton = true;
  84915. var update = api(content, options);
  84916. module.exports = content.locals || {};
  84917. /***/ }),
  84918. /***/ "./node_modules/@ckeditor/ckeditor5-ui/theme/icons/color-tile-check.svg":
  84919. /*!******************************************************************************!*\
  84920. !*** ./node_modules/@ckeditor/ckeditor5-ui/theme/icons/color-tile-check.svg ***!
  84921. \******************************************************************************/
  84922. /*! exports provided: default */
  84923. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  84924. "use strict";
  84925. __webpack_require__.r(__webpack_exports__);
  84926. /* 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.035 8.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>");
  84927. /***/ }),
  84928. /***/ "./node_modules/@ckeditor/ckeditor5-ui/theme/icons/dropdown-arrow.svg":
  84929. /*!****************************************************************************!*\
  84930. !*** ./node_modules/@ckeditor/ckeditor5-ui/theme/icons/dropdown-arrow.svg ***!
  84931. \****************************************************************************/
  84932. /*! exports provided: default */
  84933. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  84934. "use strict";
  84935. __webpack_require__.r(__webpack_exports__);
  84936. /* 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>");
  84937. /***/ }),
  84938. /***/ "./node_modules/@ckeditor/ckeditor5-ui/theme/icons/next-arrow.svg":
  84939. /*!************************************************************************!*\
  84940. !*** ./node_modules/@ckeditor/ckeditor5-ui/theme/icons/next-arrow.svg ***!
  84941. \************************************************************************/
  84942. /*! exports provided: default */
  84943. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  84944. "use strict";
  84945. __webpack_require__.r(__webpack_exports__);
  84946. /* 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>");
  84947. /***/ }),
  84948. /***/ "./node_modules/@ckeditor/ckeditor5-ui/theme/icons/previous-arrow.svg":
  84949. /*!****************************************************************************!*\
  84950. !*** ./node_modules/@ckeditor/ckeditor5-ui/theme/icons/previous-arrow.svg ***!
  84951. \****************************************************************************/
  84952. /*! exports provided: default */
  84953. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  84954. "use strict";
  84955. __webpack_require__.r(__webpack_exports__);
  84956. /* 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>");
  84957. /***/ }),
  84958. /***/ "./node_modules/@ckeditor/ckeditor5-undo/src/basecommand.js":
  84959. /*!******************************************************************!*\
  84960. !*** ./node_modules/@ckeditor/ckeditor5-undo/src/basecommand.js ***!
  84961. \******************************************************************/
  84962. /*! exports provided: default */
  84963. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  84964. "use strict";
  84965. __webpack_require__.r(__webpack_exports__);
  84966. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return BaseCommand; });
  84967. /* 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");
  84968. /* 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");
  84969. /**
  84970. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  84971. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  84972. */
  84973. /**
  84974. * @module undo/basecommand
  84975. */
  84976. /**
  84977. * Base class for undo feature commands: {@link module:undo/undocommand~UndoCommand} and {@link module:undo/redocommand~RedoCommand}.
  84978. *
  84979. * @protected
  84980. * @extends module:core/command~Command
  84981. */
  84982. class BaseCommand extends _ckeditor_ckeditor5_core_src_command__WEBPACK_IMPORTED_MODULE_0__["default"] {
  84983. constructor( editor ) {
  84984. super( editor );
  84985. /**
  84986. * Stack of items stored by the command. These are pairs of:
  84987. *
  84988. * * {@link module:engine/model/batch~Batch batch} saved by the command,
  84989. * * {@link module:engine/model/selection~Selection selection} state at the moment of saving the batch.
  84990. *
  84991. * @protected
  84992. * @member {Array} #_stack
  84993. */
  84994. this._stack = [];
  84995. /**
  84996. * Stores all batches that were created by this command.
  84997. *
  84998. * @protected
  84999. * @member {WeakSet.<module:engine/model/batch~Batch>} #_createdBatches
  85000. */
  85001. this._createdBatches = new WeakSet();
  85002. // Refresh state, so the command is inactive right after initialization.
  85003. this.refresh();
  85004. this.listenTo( editor.data, 'set', () => this.clearStack() );
  85005. }
  85006. /**
  85007. * @inheritDoc
  85008. */
  85009. refresh() {
  85010. this.isEnabled = this._stack.length > 0;
  85011. }
  85012. /**
  85013. * Stores a batch in the command, together with the selection state of the {@link module:engine/model/document~Document document}
  85014. * created by the editor which this command is registered to.
  85015. *
  85016. * @param {module:engine/model/batch~Batch} batch The batch to add.
  85017. */
  85018. addBatch( batch ) {
  85019. const docSelection = this.editor.model.document.selection;
  85020. const selection = {
  85021. ranges: docSelection.hasOwnRange ? Array.from( docSelection.getRanges() ) : [],
  85022. isBackward: docSelection.isBackward
  85023. };
  85024. this._stack.push( { batch, selection } );
  85025. this.refresh();
  85026. }
  85027. /**
  85028. * Removes all items from the stack.
  85029. */
  85030. clearStack() {
  85031. this._stack = [];
  85032. this.refresh();
  85033. }
  85034. /**
  85035. * Restores the {@link module:engine/model/document~Document#selection document selection} state after a batch was undone.
  85036. *
  85037. * @protected
  85038. * @param {Array.<module:engine/model/range~Range>} ranges Ranges to be restored.
  85039. * @param {Boolean} isBackward A flag describing whether the restored range was selected forward or backward.
  85040. * @param {Array.<module:engine/model/operation/operation~Operation>} operations Operations which has been applied
  85041. * since selection has been stored.
  85042. */
  85043. _restoreSelection( ranges, isBackward, operations ) {
  85044. const model = this.editor.model;
  85045. const document = model.document;
  85046. // This will keep the transformed selection ranges.
  85047. const selectionRanges = [];
  85048. // Transform all ranges from the restored selection.
  85049. const transformedRangeGroups = ranges.map( range => range.getTransformedByOperations( operations ) );
  85050. const allRanges = transformedRangeGroups.flat();
  85051. for ( const rangeGroup of transformedRangeGroups ) {
  85052. // While transforming there could appear ranges that are contained by other ranges, we shall ignore them.
  85053. const transformed = rangeGroup
  85054. .filter( range => range.root != document.graveyard )
  85055. .filter( range => !isRangeContainedByAnyOtherRange( range, allRanges ) );
  85056. // All the transformed ranges ended up in graveyard.
  85057. if ( !transformed.length ) {
  85058. continue;
  85059. }
  85060. // After the range got transformed, we have an array of ranges. Some of those
  85061. // ranges may be "touching" -- they can be next to each other and could be merged.
  85062. normalizeRanges( transformed );
  85063. // For each `range` from `ranges`, we take only one transformed range.
  85064. // This is because we want to prevent situation where single-range selection
  85065. // got transformed to multi-range selection.
  85066. selectionRanges.push( transformed[ 0 ] );
  85067. }
  85068. // @if CK_DEBUG_ENGINE // console.log( `Restored selection by undo: ${ selectionRanges.join( ', ' ) }` );
  85069. // `selectionRanges` may be empty if all ranges ended up in graveyard. If that is the case, do not restore selection.
  85070. if ( selectionRanges.length ) {
  85071. model.change( writer => {
  85072. writer.setSelection( selectionRanges, { backward: isBackward } );
  85073. } );
  85074. }
  85075. }
  85076. /**
  85077. * Undoes a batch by reversing that batch, transforming reversed batch and finally applying it.
  85078. * This is a helper method for {@link #execute}.
  85079. *
  85080. * @protected
  85081. * @param {module:engine/model/batch~Batch} batchToUndo The batch to be undone.
  85082. * @param {module:engine/model/batch~Batch} undoingBatch The batch that will contain undoing changes.
  85083. */
  85084. _undo( batchToUndo, undoingBatch ) {
  85085. const model = this.editor.model;
  85086. const document = model.document;
  85087. // All changes done by the command execution will be saved as one batch.
  85088. this._createdBatches.add( undoingBatch );
  85089. const operationsToUndo = batchToUndo.operations.slice().filter( operation => operation.isDocumentOperation );
  85090. operationsToUndo.reverse();
  85091. // We will process each operation from `batchToUndo`, in reverse order. If there were operations A, B and C in undone batch,
  85092. // we need to revert them in reverse order, so first C' (reversed C), then B', then A'.
  85093. for ( const operationToUndo of operationsToUndo ) {
  85094. const nextBaseVersion = operationToUndo.baseVersion + 1;
  85095. const historyOperations = Array.from( document.history.getOperations( nextBaseVersion ) );
  85096. const transformedSets = Object(_ckeditor_ckeditor5_engine_src_model_operation_transform__WEBPACK_IMPORTED_MODULE_1__["transformSets"])(
  85097. [ operationToUndo.getReversed() ],
  85098. historyOperations,
  85099. {
  85100. useRelations: true,
  85101. document: this.editor.model.document,
  85102. padWithNoOps: false,
  85103. forceWeakRemove: true
  85104. }
  85105. );
  85106. const reversedOperations = transformedSets.operationsA;
  85107. // After reversed operation has been transformed by all history operations, apply it.
  85108. for ( const operation of reversedOperations ) {
  85109. // Before applying, add the operation to the `undoingBatch`.
  85110. undoingBatch.addOperation( operation );
  85111. model.applyOperation( operation );
  85112. document.history.setOperationAsUndone( operationToUndo, operation );
  85113. }
  85114. }
  85115. }
  85116. }
  85117. // Normalizes list of ranges by joining intersecting or "touching" ranges.
  85118. //
  85119. // @param {Array.<module:engine/model/range~Range>} ranges
  85120. //
  85121. function normalizeRanges( ranges ) {
  85122. ranges.sort( ( a, b ) => a.start.isBefore( b.start ) ? -1 : 1 );
  85123. for ( let i = 1; i < ranges.length; i++ ) {
  85124. const previousRange = ranges[ i - 1 ];
  85125. const joinedRange = previousRange.getJoined( ranges[ i ], true );
  85126. if ( joinedRange ) {
  85127. // Replace the ranges on the list with the new joined range.
  85128. i--;
  85129. ranges.splice( i, 2, joinedRange );
  85130. }
  85131. }
  85132. }
  85133. function isRangeContainedByAnyOtherRange( range, ranges ) {
  85134. return ranges.some( otherRange => otherRange !== range && otherRange.containsRange( range, true ) );
  85135. }
  85136. /***/ }),
  85137. /***/ "./node_modules/@ckeditor/ckeditor5-undo/src/index.js":
  85138. /*!************************************************************!*\
  85139. !*** ./node_modules/@ckeditor/ckeditor5-undo/src/index.js ***!
  85140. \************************************************************/
  85141. /*! exports provided: Undo, UndoEditing, UndoUi */
  85142. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  85143. "use strict";
  85144. __webpack_require__.r(__webpack_exports__);
  85145. /* harmony import */ var _undo__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./undo */ "./node_modules/@ckeditor/ckeditor5-undo/src/undo.js");
  85146. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Undo", function() { return _undo__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  85147. /* harmony import */ var _undoediting__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./undoediting */ "./node_modules/@ckeditor/ckeditor5-undo/src/undoediting.js");
  85148. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "UndoEditing", function() { return _undoediting__WEBPACK_IMPORTED_MODULE_1__["default"]; });
  85149. /* harmony import */ var _undoui__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./undoui */ "./node_modules/@ckeditor/ckeditor5-undo/src/undoui.js");
  85150. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "UndoUi", function() { return _undoui__WEBPACK_IMPORTED_MODULE_2__["default"]; });
  85151. /**
  85152. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  85153. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  85154. */
  85155. /**
  85156. * @module undo
  85157. */
  85158. /***/ }),
  85159. /***/ "./node_modules/@ckeditor/ckeditor5-undo/src/redocommand.js":
  85160. /*!******************************************************************!*\
  85161. !*** ./node_modules/@ckeditor/ckeditor5-undo/src/redocommand.js ***!
  85162. \******************************************************************/
  85163. /*! exports provided: default */
  85164. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  85165. "use strict";
  85166. __webpack_require__.r(__webpack_exports__);
  85167. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return RedoCommand; });
  85168. /* harmony import */ var _basecommand__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./basecommand */ "./node_modules/@ckeditor/ckeditor5-undo/src/basecommand.js");
  85169. /**
  85170. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  85171. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  85172. */
  85173. /**
  85174. * @module undo/redocommand
  85175. */
  85176. /**
  85177. * The redo command stores {@link module:engine/model/batch~Batch batches} that were used to undo a batch by
  85178. * {@link module:undo/undocommand~UndoCommand}. It is able to redo a previously undone batch by reversing the undoing
  85179. * batches created by `UndoCommand`. The reversed batch is transformed by all the batches from
  85180. * {@link module:engine/model/document~Document#history history} that happened after the reversed undo batch.
  85181. *
  85182. * The redo command also takes care of restoring the {@link module:engine/model/document~Document#selection document selection}.
  85183. *
  85184. * @extends module:undo/basecommand~BaseCommand
  85185. */
  85186. class RedoCommand extends _basecommand__WEBPACK_IMPORTED_MODULE_0__["default"] {
  85187. /**
  85188. * Executes the command. This method reverts the last {@link module:engine/model/batch~Batch batch} added to
  85189. * the command's stack, applies the reverted and transformed version on the
  85190. * {@link module:engine/model/document~Document document} and removes the batch from the stack.
  85191. * Then, it restores the {@link module:engine/model/document~Document#selection document selection}.
  85192. *
  85193. * @fires execute
  85194. */
  85195. execute() {
  85196. const item = this._stack.pop();
  85197. const redoingBatch = this.editor.model.createBatch( 'transparent' );
  85198. // All changes have to be done in one `enqueueChange` callback so other listeners will not step between consecutive
  85199. // operations, or won't do changes to the document before selection is properly restored.
  85200. this.editor.model.enqueueChange( redoingBatch, () => {
  85201. const lastOperation = item.batch.operations[ item.batch.operations.length - 1 ];
  85202. const nextBaseVersion = lastOperation.baseVersion + 1;
  85203. const operations = this.editor.model.document.history.getOperations( nextBaseVersion );
  85204. this._restoreSelection( item.selection.ranges, item.selection.isBackward, operations );
  85205. this._undo( item.batch, redoingBatch );
  85206. } );
  85207. this.refresh();
  85208. }
  85209. }
  85210. /***/ }),
  85211. /***/ "./node_modules/@ckeditor/ckeditor5-undo/src/undo.js":
  85212. /*!***********************************************************!*\
  85213. !*** ./node_modules/@ckeditor/ckeditor5-undo/src/undo.js ***!
  85214. \***********************************************************/
  85215. /*! exports provided: default */
  85216. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  85217. "use strict";
  85218. __webpack_require__.r(__webpack_exports__);
  85219. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Undo; });
  85220. /* 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");
  85221. /* harmony import */ var _undoediting__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./undoediting */ "./node_modules/@ckeditor/ckeditor5-undo/src/undoediting.js");
  85222. /* harmony import */ var _undoui__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./undoui */ "./node_modules/@ckeditor/ckeditor5-undo/src/undoui.js");
  85223. /**
  85224. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  85225. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  85226. */
  85227. /**
  85228. * @module undo/undo
  85229. */
  85230. /**
  85231. * The undo feature.
  85232. *
  85233. * This is a "glue" plugin which loads the {@link module:undo/undoediting~UndoEditing undo editing feature}
  85234. * and {@link module:undo/undoui~UndoUI undo UI feature}.
  85235. *
  85236. * Below is the explanation of the undo mechanism working together with {@link module:engine/model/history~History History}:
  85237. *
  85238. * Whenever a {@link module:engine/model/operation/operation~Operation operation} is applied to the
  85239. * {@link module:engine/model/document~Document document}, it is saved to `History` as is.
  85240. * The {@link module:engine/model/batch~Batch batch} that owns that operation is also saved, in
  85241. * {@link module:undo/undocommand~UndoCommand}, together with the selection that was present in the document before the
  85242. * operation was applied. A batch is saved instead of the operation because changes are undone batch-by-batch, not operation-by-operation
  85243. * and a batch is seen as one undo step.
  85244. *
  85245. * After some changes happen to the document, the `History` and `UndoCommand` stack can be represented as follows:
  85246. *
  85247. * History Undo stack
  85248. * ============== ==================================
  85249. * [operation A1] [batch A]
  85250. * [operation B1] [batch B]
  85251. * [operation B2] [batch C]
  85252. * [operation C1]
  85253. * [operation C2]
  85254. * [operation B3]
  85255. * [operation C3]
  85256. *
  85257. * Where operations starting with the same letter are from same batch.
  85258. *
  85259. * Undoing a batch means that a set of operations which will reverse the effects of that batch needs to be generated.
  85260. * For example, if a batch added several letters, undoing the batch should remove them. It is important to apply undoing
  85261. * operations in the reversed order, so if a batch has operation `X`, `Y`, `Z`, reversed operations `Zr`, `Yr` and `Xr`
  85262. * need to be applied. Otherwise reversed operation `Xr` would operate on a wrong document state, because operation `X`
  85263. * does not know that operations `Y` and `Z` happened.
  85264. *
  85265. * After operations from an undone batch got {@link module:engine/model/operation/operation~Operation#getReversed reversed},
  85266. * one needs to make sure if they are ready to be applied. In the scenario above, operation `C3` is the last operation and `C3r`
  85267. * bases on up-to-date document state, so it can be applied to the document.
  85268. *
  85269. * History Undo stack
  85270. * ================= ==================================
  85271. * [ operation A1 ] [ batch A ]
  85272. * [ operation B1 ] [ batch B ]
  85273. * [ operation B2 ] [ processing undoing batch C ]
  85274. * [ operation C1 ]
  85275. * [ operation C2 ]
  85276. * [ operation B3 ]
  85277. * [ operation C3 ]
  85278. * [ operation C3r ]
  85279. *
  85280. * Next is operation `C2`, reversed to `C2r`. `C2r` bases on `C2`, so it bases on the wrong document state. It needs to be
  85281. * transformed by operations from history that happened after it, so it "knows" about them. Let us assume that `C2' = C2r * B3 * C3 * C3r`,
  85282. * where `*` means "transformed by". Rest of operations from that batch are processed in the same fashion.
  85283. *
  85284. * History Undo stack Redo stack
  85285. * ================= ================================== ==================================
  85286. * [ operation A1 ] [ batch A ] [ batch Cr ]
  85287. * [ operation B1 ] [ batch B ]
  85288. * [ operation B2 ]
  85289. * [ operation C1 ]
  85290. * [ operation C2 ]
  85291. * [ operation B3 ]
  85292. * [ operation C3 ]
  85293. * [ operation C3r ]
  85294. * [ operation C2' ]
  85295. * [ operation C1' ]
  85296. *
  85297. * Selective undo works on the same basis, however, instead of undoing the last batch in the undo stack, any batch can be undone.
  85298. * The same algorithm applies: operations from a batch (i.e. `A1`) are reversed and then transformed by operations stored in history.
  85299. *
  85300. * Redo also is very similar to undo. It has its own stack that is filled with undoing (reversed batches). Operations from
  85301. * batch that is re-done are reversed-back, transformed in proper order and applied to the document.
  85302. *
  85303. * History Undo stack Redo stack
  85304. * ================= ================================== ==================================
  85305. * [ operation A1 ] [ batch A ]
  85306. * [ operation B1 ] [ batch B ]
  85307. * [ operation B2 ] [ batch Crr ]
  85308. * [ operation C1 ]
  85309. * [ operation C2 ]
  85310. * [ operation B3 ]
  85311. * [ operation C3 ]
  85312. * [ operation C3r ]
  85313. * [ operation C2' ]
  85314. * [ operation C1' ]
  85315. * [ operation C1'r]
  85316. * [ operation C2'r]
  85317. * [ operation C3rr]
  85318. *
  85319. * @extends module:core/plugin~Plugin
  85320. */
  85321. class Undo extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
  85322. /**
  85323. * @inheritDoc
  85324. */
  85325. static get requires() {
  85326. return [ _undoediting__WEBPACK_IMPORTED_MODULE_1__["default"], _undoui__WEBPACK_IMPORTED_MODULE_2__["default"] ];
  85327. }
  85328. /**
  85329. * @inheritDoc
  85330. */
  85331. static get pluginName() {
  85332. return 'Undo';
  85333. }
  85334. }
  85335. /***/ }),
  85336. /***/ "./node_modules/@ckeditor/ckeditor5-undo/src/undocommand.js":
  85337. /*!******************************************************************!*\
  85338. !*** ./node_modules/@ckeditor/ckeditor5-undo/src/undocommand.js ***!
  85339. \******************************************************************/
  85340. /*! exports provided: default */
  85341. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  85342. "use strict";
  85343. __webpack_require__.r(__webpack_exports__);
  85344. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return UndoCommand; });
  85345. /* harmony import */ var _basecommand__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./basecommand */ "./node_modules/@ckeditor/ckeditor5-undo/src/basecommand.js");
  85346. /**
  85347. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  85348. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  85349. */
  85350. /**
  85351. * @module undo/undocommand
  85352. */
  85353. /**
  85354. * The undo command stores {@link module:engine/model/batch~Batch batches} applied to the
  85355. * {@link module:engine/model/document~Document document} and is able to undo a batch by reversing it and transforming by
  85356. * batches from {@link module:engine/model/document~Document#history history} that happened after the reversed batch.
  85357. *
  85358. * The undo command also takes care of restoring the {@link module:engine/model/document~Document#selection document selection}.
  85359. *
  85360. * @extends module:undo/basecommand~BaseCommand
  85361. */
  85362. class UndoCommand extends _basecommand__WEBPACK_IMPORTED_MODULE_0__["default"] {
  85363. /**
  85364. * Executes the command. This method reverts a {@link module:engine/model/batch~Batch batch} added to the command's stack, transforms
  85365. * and applies the reverted version on the {@link module:engine/model/document~Document document} and removes the batch from the stack.
  85366. * Then, it restores the {@link module:engine/model/document~Document#selection document selection}.
  85367. *
  85368. * @fires execute
  85369. * @fires revert
  85370. * @param {module:engine/model/batch~Batch} [batch] A batch that should be undone. If not set, the last added batch will be undone.
  85371. */
  85372. execute( batch = null ) {
  85373. // If batch is not given, set `batchIndex` to the last index in command stack.
  85374. const batchIndex = batch ? this._stack.findIndex( a => a.batch == batch ) : this._stack.length - 1;
  85375. const item = this._stack.splice( batchIndex, 1 )[ 0 ];
  85376. const undoingBatch = this.editor.model.createBatch( 'transparent' );
  85377. // All changes has to be done in one `enqueueChange` callback so other listeners will not
  85378. // step between consecutive operations, or won't do changes to the document before selection is properly restored.
  85379. this.editor.model.enqueueChange( undoingBatch, () => {
  85380. this._undo( item.batch, undoingBatch );
  85381. const operations = this.editor.model.document.history.getOperations( item.batch.baseVersion );
  85382. this._restoreSelection( item.selection.ranges, item.selection.isBackward, operations );
  85383. this.fire( 'revert', item.batch, undoingBatch );
  85384. } );
  85385. this.refresh();
  85386. }
  85387. }
  85388. /**
  85389. * Fired when execution of the command reverts some batch.
  85390. *
  85391. * @event revert
  85392. */
  85393. /***/ }),
  85394. /***/ "./node_modules/@ckeditor/ckeditor5-undo/src/undoediting.js":
  85395. /*!******************************************************************!*\
  85396. !*** ./node_modules/@ckeditor/ckeditor5-undo/src/undoediting.js ***!
  85397. \******************************************************************/
  85398. /*! exports provided: default */
  85399. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  85400. "use strict";
  85401. __webpack_require__.r(__webpack_exports__);
  85402. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return UndoEditing; });
  85403. /* 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");
  85404. /* harmony import */ var _undocommand__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./undocommand */ "./node_modules/@ckeditor/ckeditor5-undo/src/undocommand.js");
  85405. /* harmony import */ var _redocommand__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./redocommand */ "./node_modules/@ckeditor/ckeditor5-undo/src/redocommand.js");
  85406. /**
  85407. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  85408. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  85409. */
  85410. /**
  85411. * @module undo/undoediting
  85412. */
  85413. /**
  85414. * The undo engine feature.
  85415. *
  85416. * It introduces the `'undo'` and `'redo'` commands to the editor.
  85417. *
  85418. * @extends module:core/plugin~Plugin
  85419. */
  85420. class UndoEditing extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
  85421. /**
  85422. * @inheritDoc
  85423. */
  85424. static get pluginName() {
  85425. return 'UndoEditing';
  85426. }
  85427. /**
  85428. * @inheritDoc
  85429. */
  85430. constructor( editor ) {
  85431. super( editor );
  85432. /**
  85433. * The command that manages undo {@link module:engine/model/batch~Batch batches} stack (history).
  85434. * Created and registered during the {@link #init feature initialization}.
  85435. *
  85436. * @private
  85437. * @member {module:undo/undocommand~UndoCommand} #_undoCommand
  85438. */
  85439. /**
  85440. * The command that manages redo {@link module:engine/model/batch~Batch batches} stack (history).
  85441. * Created and registered during the {@link #init feature initialization}.
  85442. *
  85443. * @private
  85444. * @member {module:undo/undocommand~UndoCommand} #_redoCommand
  85445. */
  85446. /**
  85447. * Keeps track of which batches were registered in undo.
  85448. *
  85449. * @private
  85450. * @member {WeakSet.<module:engine/model/batch~Batch>}
  85451. */
  85452. this._batchRegistry = new WeakSet();
  85453. }
  85454. /**
  85455. * @inheritDoc
  85456. */
  85457. init() {
  85458. const editor = this.editor;
  85459. // Create commands.
  85460. this._undoCommand = new _undocommand__WEBPACK_IMPORTED_MODULE_1__["default"]( editor );
  85461. this._redoCommand = new _redocommand__WEBPACK_IMPORTED_MODULE_2__["default"]( editor );
  85462. // Register command to the editor.
  85463. editor.commands.add( 'undo', this._undoCommand );
  85464. editor.commands.add( 'redo', this._redoCommand );
  85465. this.listenTo( editor.model, 'applyOperation', ( evt, args ) => {
  85466. const operation = args[ 0 ];
  85467. // Do not register batch if the operation is not a document operation.
  85468. // This prevents from creating empty undo steps, where all operations where non-document operations.
  85469. // Non-document operations creates and alters content in detached tree fragments (for example, document fragments).
  85470. // Most of time this is preparing data before it is inserted into actual tree (for example during copy & paste).
  85471. // Such operations should not be reversed.
  85472. if ( !operation.isDocumentOperation ) {
  85473. return;
  85474. }
  85475. const batch = operation.batch;
  85476. const isRedoBatch = this._redoCommand._createdBatches.has( batch );
  85477. const isUndoBatch = this._undoCommand._createdBatches.has( batch );
  85478. const isRegisteredBatch = this._batchRegistry.has( batch );
  85479. // If changes are not a part of a batch or this is not a new batch, omit those changes.
  85480. if ( isRegisteredBatch || ( batch.type == 'transparent' && !isRedoBatch && !isUndoBatch ) ) {
  85481. return;
  85482. } else {
  85483. if ( isRedoBatch ) {
  85484. // If this batch comes from `redoCommand`, add it to `undoCommand` stack.
  85485. this._undoCommand.addBatch( batch );
  85486. } else if ( !isUndoBatch ) {
  85487. // A default batch - these are new changes in the document, not introduced by undo feature.
  85488. // Add them to `undoCommand` stack and clear `redoCommand` stack.
  85489. this._undoCommand.addBatch( batch );
  85490. this._redoCommand.clearStack();
  85491. }
  85492. }
  85493. // Add the batch to the registry so it will not be processed again.
  85494. this._batchRegistry.add( batch );
  85495. }, { priority: 'highest' } );
  85496. this.listenTo( this._undoCommand, 'revert', ( evt, undoneBatch, undoingBatch ) => {
  85497. this._redoCommand.addBatch( undoingBatch );
  85498. } );
  85499. editor.keystrokes.set( 'CTRL+Z', 'undo' );
  85500. editor.keystrokes.set( 'CTRL+Y', 'redo' );
  85501. editor.keystrokes.set( 'CTRL+SHIFT+Z', 'redo' );
  85502. }
  85503. }
  85504. /***/ }),
  85505. /***/ "./node_modules/@ckeditor/ckeditor5-undo/src/undoui.js":
  85506. /*!*************************************************************!*\
  85507. !*** ./node_modules/@ckeditor/ckeditor5-undo/src/undoui.js ***!
  85508. \*************************************************************/
  85509. /*! exports provided: default */
  85510. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  85511. "use strict";
  85512. __webpack_require__.r(__webpack_exports__);
  85513. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return UndoUI; });
  85514. /* 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");
  85515. /* 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");
  85516. /* 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");
  85517. /* 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");
  85518. /**
  85519. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  85520. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  85521. */
  85522. /**
  85523. * @module undo/undoui
  85524. */
  85525. /**
  85526. * The undo UI feature. It introduces the `'undo'` and `'redo'` buttons to the editor.
  85527. *
  85528. * @extends module:core/plugin~Plugin
  85529. */
  85530. class UndoUI extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
  85531. /**
  85532. * @inheritDoc
  85533. */
  85534. static get pluginName() {
  85535. return 'UndoUI';
  85536. }
  85537. /**
  85538. * @inheritDoc
  85539. */
  85540. init() {
  85541. const editor = this.editor;
  85542. const locale = editor.locale;
  85543. const t = editor.t;
  85544. const localizedUndoIcon = locale.uiLanguageDirection == 'ltr' ? _theme_icons_undo_svg__WEBPACK_IMPORTED_MODULE_2__["default"] : _theme_icons_redo_svg__WEBPACK_IMPORTED_MODULE_3__["default"];
  85545. const localizedRedoIcon = locale.uiLanguageDirection == 'ltr' ? _theme_icons_redo_svg__WEBPACK_IMPORTED_MODULE_3__["default"] : _theme_icons_undo_svg__WEBPACK_IMPORTED_MODULE_2__["default"];
  85546. this._addButton( 'undo', t( 'Undo' ), 'CTRL+Z', localizedUndoIcon );
  85547. this._addButton( 'redo', t( 'Redo' ), 'CTRL+Y', localizedRedoIcon );
  85548. }
  85549. /**
  85550. * Creates a button for the specified command.
  85551. *
  85552. * @private
  85553. * @param {String} name Command name.
  85554. * @param {String} label Button label.
  85555. * @param {String} keystroke Command keystroke.
  85556. * @param {String} Icon Source of the icon.
  85557. */
  85558. _addButton( name, label, keystroke, Icon ) {
  85559. const editor = this.editor;
  85560. editor.ui.componentFactory.add( name, locale => {
  85561. const command = editor.commands.get( name );
  85562. const view = new _ckeditor_ckeditor5_ui_src_button_buttonview__WEBPACK_IMPORTED_MODULE_1__["default"]( locale );
  85563. view.set( {
  85564. label,
  85565. icon: Icon,
  85566. keystroke,
  85567. tooltip: true
  85568. } );
  85569. view.bind( 'isEnabled' ).to( command, 'isEnabled' );
  85570. this.listenTo( view, 'execute', () => {
  85571. editor.execute( name );
  85572. editor.editing.view.focus();
  85573. } );
  85574. return view;
  85575. } );
  85576. }
  85577. }
  85578. /***/ }),
  85579. /***/ "./node_modules/@ckeditor/ckeditor5-undo/theme/icons/redo.svg":
  85580. /*!********************************************************************!*\
  85581. !*** ./node_modules/@ckeditor/ckeditor5-undo/theme/icons/redo.svg ***!
  85582. \********************************************************************/
  85583. /*! exports provided: default */
  85584. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  85585. "use strict";
  85586. __webpack_require__.r(__webpack_exports__);
  85587. /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"m14.958 9.367-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>");
  85588. /***/ }),
  85589. /***/ "./node_modules/@ckeditor/ckeditor5-undo/theme/icons/undo.svg":
  85590. /*!********************************************************************!*\
  85591. !*** ./node_modules/@ckeditor/ckeditor5-undo/theme/icons/undo.svg ***!
  85592. \********************************************************************/
  85593. /*! exports provided: default */
  85594. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  85595. "use strict";
  85596. __webpack_require__.r(__webpack_exports__);
  85597. /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"m5.042 9.367 2.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>");
  85598. /***/ }),
  85599. /***/ "./node_modules/@ckeditor/ckeditor5-upload/src/adapters/base64uploadadapter.js":
  85600. /*!*************************************************************************************!*\
  85601. !*** ./node_modules/@ckeditor/ckeditor5-upload/src/adapters/base64uploadadapter.js ***!
  85602. \*************************************************************************************/
  85603. /*! exports provided: default */
  85604. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  85605. "use strict";
  85606. __webpack_require__.r(__webpack_exports__);
  85607. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Base64UploadAdapter; });
  85608. /* 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");
  85609. /* harmony import */ var _filerepository__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../filerepository */ "./node_modules/@ckeditor/ckeditor5-upload/src/filerepository.js");
  85610. /**
  85611. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  85612. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  85613. */
  85614. /**
  85615. * @module upload/adapters/base64uploadadapter
  85616. */
  85617. /* globals window */
  85618. /**
  85619. * A plugin that converts images inserted into the editor into [Base64 strings](https://en.wikipedia.org/wiki/Base64)
  85620. * in the {@glink builds/guides/integration/saving-data editor output}.
  85621. *
  85622. * This kind of image upload does not require server processing – images are stored with the rest of the text and
  85623. * displayed by the web browser without additional requests.
  85624. *
  85625. * Check out the {@glink features/image-upload/image-upload comprehensive "Image upload overview"} to learn about
  85626. * other ways to upload images into CKEditor 5.
  85627. *
  85628. * @extends module:core/plugin~Plugin
  85629. */
  85630. class Base64UploadAdapter extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
  85631. /**
  85632. * @inheritDoc
  85633. */
  85634. static get requires() {
  85635. return [ _filerepository__WEBPACK_IMPORTED_MODULE_1__["default"] ];
  85636. }
  85637. /**
  85638. * @inheritDoc
  85639. */
  85640. static get pluginName() {
  85641. return 'Base64UploadAdapter';
  85642. }
  85643. /**
  85644. * @inheritDoc
  85645. */
  85646. init() {
  85647. this.editor.plugins.get( _filerepository__WEBPACK_IMPORTED_MODULE_1__["default"] ).createUploadAdapter = loader => new Adapter( loader );
  85648. }
  85649. }
  85650. /**
  85651. * The upload adapter that converts images inserted into the editor into Base64 strings.
  85652. *
  85653. * @private
  85654. * @implements module:upload/filerepository~UploadAdapter
  85655. */
  85656. class Adapter {
  85657. /**
  85658. * Creates a new adapter instance.
  85659. *
  85660. * @param {module:upload/filerepository~FileLoader} loader
  85661. */
  85662. constructor( loader ) {
  85663. /**
  85664. * `FileLoader` instance to use during the upload.
  85665. *
  85666. * @member {module:upload/filerepository~FileLoader} #loader
  85667. */
  85668. this.loader = loader;
  85669. }
  85670. /**
  85671. * Starts the upload process.
  85672. *
  85673. * @see module:upload/filerepository~UploadAdapter#upload
  85674. * @returns {Promise}
  85675. */
  85676. upload() {
  85677. return new Promise( ( resolve, reject ) => {
  85678. const reader = this.reader = new window.FileReader();
  85679. reader.addEventListener( 'load', () => {
  85680. resolve( { default: reader.result } );
  85681. } );
  85682. reader.addEventListener( 'error', err => {
  85683. reject( err );
  85684. } );
  85685. reader.addEventListener( 'abort', () => {
  85686. reject();
  85687. } );
  85688. this.loader.file.then( file => {
  85689. reader.readAsDataURL( file );
  85690. } );
  85691. } );
  85692. }
  85693. /**
  85694. * Aborts the upload process.
  85695. *
  85696. * @see module:upload/filerepository~UploadAdapter#abort
  85697. * @returns {Promise}
  85698. */
  85699. abort() {
  85700. this.reader.abort();
  85701. }
  85702. }
  85703. /***/ }),
  85704. /***/ "./node_modules/@ckeditor/ckeditor5-upload/src/adapters/simpleuploadadapter.js":
  85705. /*!*************************************************************************************!*\
  85706. !*** ./node_modules/@ckeditor/ckeditor5-upload/src/adapters/simpleuploadadapter.js ***!
  85707. \*************************************************************************************/
  85708. /*! exports provided: default */
  85709. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  85710. "use strict";
  85711. __webpack_require__.r(__webpack_exports__);
  85712. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return SimpleUploadAdapter; });
  85713. /* 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");
  85714. /* harmony import */ var _filerepository__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../filerepository */ "./node_modules/@ckeditor/ckeditor5-upload/src/filerepository.js");
  85715. /* 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");
  85716. /**
  85717. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  85718. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  85719. */
  85720. /**
  85721. * @module upload/adapters/simpleuploadadapter
  85722. */
  85723. /* globals XMLHttpRequest, FormData */
  85724. /**
  85725. * The Simple upload adapter allows uploading images to an application running on your server using
  85726. * the [`XMLHttpRequest`](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest) API with a
  85727. * minimal {@link module:upload/adapters/simpleuploadadapter~SimpleUploadConfig editor configuration}.
  85728. *
  85729. * ClassicEditor
  85730. * .create( document.querySelector( '#editor' ), {
  85731. * simpleUpload: {
  85732. * uploadUrl: 'http://example.com',
  85733. * headers: {
  85734. * ...
  85735. * }
  85736. * }
  85737. * } )
  85738. * .then( ... )
  85739. * .catch( ... );
  85740. *
  85741. * See the {@glink features/image-upload/simple-upload-adapter "Simple upload adapter"} guide to learn how to
  85742. * learn more about the feature (configuration, server–side requirements, etc.).
  85743. *
  85744. * Check out the {@glink features/image-upload/image-upload comprehensive "Image upload overview"} to learn about
  85745. * other ways to upload images into CKEditor 5.
  85746. *
  85747. * @extends module:core/plugin~Plugin
  85748. */
  85749. class SimpleUploadAdapter extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
  85750. /**
  85751. * @inheritDoc
  85752. */
  85753. static get requires() {
  85754. return [ _filerepository__WEBPACK_IMPORTED_MODULE_1__["default"] ];
  85755. }
  85756. /**
  85757. * @inheritDoc
  85758. */
  85759. static get pluginName() {
  85760. return 'SimpleUploadAdapter';
  85761. }
  85762. /**
  85763. * @inheritDoc
  85764. */
  85765. init() {
  85766. const options = this.editor.config.get( 'simpleUpload' );
  85767. if ( !options ) {
  85768. return;
  85769. }
  85770. if ( !options.uploadUrl ) {
  85771. /**
  85772. * The {@link module:upload/adapters/simpleuploadadapter~SimpleUploadConfig#uploadUrl `config.simpleUpload.uploadUrl`}
  85773. * configuration required by the {@link module:upload/adapters/simpleuploadadapter~SimpleUploadAdapter `SimpleUploadAdapter`}
  85774. * is missing. Make sure the correct URL is specified for the image upload to work properly.
  85775. *
  85776. * @error simple-upload-adapter-missing-uploadurl
  85777. */
  85778. Object(_ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__["logWarning"])( 'simple-upload-adapter-missing-uploadurl' );
  85779. return;
  85780. }
  85781. this.editor.plugins.get( _filerepository__WEBPACK_IMPORTED_MODULE_1__["default"] ).createUploadAdapter = loader => {
  85782. return new Adapter( loader, options );
  85783. };
  85784. }
  85785. }
  85786. /**
  85787. * Upload adapter.
  85788. *
  85789. * @private
  85790. * @implements module:upload/filerepository~UploadAdapter
  85791. */
  85792. class Adapter {
  85793. /**
  85794. * Creates a new adapter instance.
  85795. *
  85796. * @param {module:upload/filerepository~FileLoader} loader
  85797. * @param {module:upload/adapters/simpleuploadadapter~SimpleUploadConfig} options
  85798. */
  85799. constructor( loader, options ) {
  85800. /**
  85801. * FileLoader instance to use during the upload.
  85802. *
  85803. * @member {module:upload/filerepository~FileLoader} #loader
  85804. */
  85805. this.loader = loader;
  85806. /**
  85807. * The configuration of the adapter.
  85808. *
  85809. * @member {module:upload/adapters/simpleuploadadapter~SimpleUploadConfig} #options
  85810. */
  85811. this.options = options;
  85812. }
  85813. /**
  85814. * Starts the upload process.
  85815. *
  85816. * @see module:upload/filerepository~UploadAdapter#upload
  85817. * @returns {Promise}
  85818. */
  85819. upload() {
  85820. return this.loader.file
  85821. .then( file => new Promise( ( resolve, reject ) => {
  85822. this._initRequest();
  85823. this._initListeners( resolve, reject, file );
  85824. this._sendRequest( file );
  85825. } ) );
  85826. }
  85827. /**
  85828. * Aborts the upload process.
  85829. *
  85830. * @see module:upload/filerepository~UploadAdapter#abort
  85831. * @returns {Promise}
  85832. */
  85833. abort() {
  85834. if ( this.xhr ) {
  85835. this.xhr.abort();
  85836. }
  85837. }
  85838. /**
  85839. * Initializes the `XMLHttpRequest` object using the URL specified as
  85840. * {@link module:upload/adapters/simpleuploadadapter~SimpleUploadConfig#uploadUrl `simpleUpload.uploadUrl`} in the editor's
  85841. * configuration.
  85842. *
  85843. * @private
  85844. */
  85845. _initRequest() {
  85846. const xhr = this.xhr = new XMLHttpRequest();
  85847. xhr.open( 'POST', this.options.uploadUrl, true );
  85848. xhr.responseType = 'json';
  85849. }
  85850. /**
  85851. * Initializes XMLHttpRequest listeners
  85852. *
  85853. * @private
  85854. * @param {Function} resolve Callback function to be called when the request is successful.
  85855. * @param {Function} reject Callback function to be called when the request cannot be completed.
  85856. * @param {File} file Native File object.
  85857. */
  85858. _initListeners( resolve, reject, file ) {
  85859. const xhr = this.xhr;
  85860. const loader = this.loader;
  85861. const genericErrorText = `Couldn't upload file: ${ file.name }.`;
  85862. xhr.addEventListener( 'error', () => reject( genericErrorText ) );
  85863. xhr.addEventListener( 'abort', () => reject() );
  85864. xhr.addEventListener( 'load', () => {
  85865. const response = xhr.response;
  85866. if ( !response || response.error ) {
  85867. return reject( response && response.error && response.error.message ? response.error.message : genericErrorText );
  85868. }
  85869. const urls = response.url ? { default: response.url } : response.urls;
  85870. // Resolve with the normalized `urls` property and pass the rest of the response
  85871. // to allow customizing the behavior of features relying on the upload adapters.
  85872. resolve( {
  85873. ...response,
  85874. urls
  85875. } );
  85876. } );
  85877. // Upload progress when it is supported.
  85878. /* istanbul ignore else */
  85879. if ( xhr.upload ) {
  85880. xhr.upload.addEventListener( 'progress', evt => {
  85881. if ( evt.lengthComputable ) {
  85882. loader.uploadTotal = evt.total;
  85883. loader.uploaded = evt.loaded;
  85884. }
  85885. } );
  85886. }
  85887. }
  85888. /**
  85889. * Prepares the data and sends the request.
  85890. *
  85891. * @private
  85892. * @param {File} file File instance to be uploaded.
  85893. */
  85894. _sendRequest( file ) {
  85895. // Set headers if specified.
  85896. const headers = this.options.headers || {};
  85897. // Use the withCredentials flag if specified.
  85898. const withCredentials = this.options.withCredentials || false;
  85899. for ( const headerName of Object.keys( headers ) ) {
  85900. this.xhr.setRequestHeader( headerName, headers[ headerName ] );
  85901. }
  85902. this.xhr.withCredentials = withCredentials;
  85903. // Prepare the form data.
  85904. const data = new FormData();
  85905. data.append( 'upload', file );
  85906. // Send the request.
  85907. this.xhr.send( data );
  85908. }
  85909. }
  85910. /**
  85911. * The configuration of the {@link module:upload/adapters/simpleuploadadapter~SimpleUploadAdapter simple upload adapter}.
  85912. *
  85913. * ClassicEditor
  85914. * .create( editorElement, {
  85915. * simpleUpload: {
  85916. * // The URL the images are uploaded to.
  85917. * uploadUrl: 'http://example.com',
  85918. *
  85919. * // Headers sent along with the XMLHttpRequest to the upload server.
  85920. * headers: {
  85921. * ...
  85922. * }
  85923. * }
  85924. * } );
  85925. * .then( ... )
  85926. * .catch( ... );
  85927. *
  85928. * See the {@glink features/image-upload/simple-upload-adapter "Simple upload adapter"} guide to learn more.
  85929. *
  85930. * See {@link module:core/editor/editorconfig~EditorConfig all editor configuration options}.
  85931. *
  85932. * @interface SimpleUploadConfig
  85933. */
  85934. /**
  85935. * The configuration of the {@link module:upload/adapters/simpleuploadadapter~SimpleUploadAdapter simple upload adapter}.
  85936. *
  85937. * Read more in {@link module:upload/adapters/simpleuploadadapter~SimpleUploadConfig}.
  85938. *
  85939. * @member {module:upload/adapters/simpleuploadadapter~SimpleUploadConfig} module:core/editor/editorconfig~EditorConfig#simpleUpload
  85940. */
  85941. /**
  85942. * The path (URL) to the server (application) which handles the file upload. When specified, enables the automatic
  85943. * upload of resources (images) inserted into the editor content.
  85944. *
  85945. * Learn more about the server application requirements in the
  85946. * {@glink features/image-upload/simple-upload-adapter#server-side-configuration "Server-side configuration"} section
  85947. * of the feature guide.
  85948. *
  85949. * @member {String} module:upload/adapters/simpleuploadadapter~SimpleUploadConfig#uploadUrl
  85950. */
  85951. /**
  85952. * An object that defines additional [headers](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers) sent with
  85953. * the request to the server during the upload. This is the right place to implement security mechanisms like
  85954. * authentication and [CSRF](https://developer.mozilla.org/en-US/docs/Glossary/CSRF) protection.
  85955. *
  85956. * ClassicEditor
  85957. * .create( editorElement, {
  85958. * simpleUpload: {
  85959. * headers: {
  85960. * 'X-CSRF-TOKEN': 'CSRF-Token',
  85961. * Authorization: 'Bearer <JSON Web Token>'
  85962. * }
  85963. * }
  85964. * } );
  85965. * .then( ... )
  85966. * .catch( ... );
  85967. *
  85968. * Learn more about the server application requirements in the
  85969. * {@glink features/image-upload/simple-upload-adapter#server-side-configuration "Server-side configuration"} section
  85970. * of the feature guide.
  85971. *
  85972. * @member {Object.<String, String>} module:upload/adapters/simpleuploadadapter~SimpleUploadConfig#headers
  85973. */
  85974. /**
  85975. * This flag enables the
  85976. * [`withCredentials`](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/withCredentials)
  85977. * property of the request sent to the server during the upload. It affects cross-site requests only and, for instance,
  85978. * allows credentials such as cookies to be sent along with the request.
  85979. *
  85980. * ClassicEditor
  85981. * .create( editorElement, {
  85982. * simpleUpload: {
  85983. * withCredentials: true
  85984. * }
  85985. * } );
  85986. * .then( ... )
  85987. * .catch( ... );
  85988. *
  85989. * Learn more about the server application requirements in the
  85990. * {@glink features/image-upload/simple-upload-adapter#server-side-configuration "Server-side configuration"} section
  85991. * of the feature guide.
  85992. *
  85993. * @member {Boolean} [module:upload/adapters/simpleuploadadapter~SimpleUploadConfig#withCredentials=false]
  85994. */
  85995. /***/ }),
  85996. /***/ "./node_modules/@ckeditor/ckeditor5-upload/src/filereader.js":
  85997. /*!*******************************************************************!*\
  85998. !*** ./node_modules/@ckeditor/ckeditor5-upload/src/filereader.js ***!
  85999. \*******************************************************************/
  86000. /*! exports provided: default */
  86001. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  86002. "use strict";
  86003. __webpack_require__.r(__webpack_exports__);
  86004. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return FileReader; });
  86005. /* 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");
  86006. /* 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");
  86007. /**
  86008. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  86009. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  86010. */
  86011. /**
  86012. * @module upload/filereader
  86013. */
  86014. /* globals window */
  86015. /**
  86016. * Wrapper over the native `FileReader`.
  86017. */
  86018. class FileReader {
  86019. /**
  86020. * Creates an instance of the FileReader.
  86021. */
  86022. constructor() {
  86023. const reader = new window.FileReader();
  86024. /**
  86025. * Instance of native FileReader.
  86026. *
  86027. * @private
  86028. * @member {FileReader} #_reader
  86029. */
  86030. this._reader = reader;
  86031. this._data = undefined;
  86032. /**
  86033. * Number of bytes loaded.
  86034. *
  86035. * @readonly
  86036. * @observable
  86037. * @member {Number} #loaded
  86038. */
  86039. this.set( 'loaded', 0 );
  86040. reader.onprogress = evt => {
  86041. this.loaded = evt.loaded;
  86042. };
  86043. }
  86044. /**
  86045. * Returns error that occurred during file reading.
  86046. *
  86047. * @returns {Error}
  86048. */
  86049. get error() {
  86050. return this._reader.error;
  86051. }
  86052. /**
  86053. * Holds the data of an already loaded file. The file must be first loaded
  86054. * by using {@link module:upload/filereader~FileReader#read `read()`}.
  86055. *
  86056. * @type {File|undefined}
  86057. */
  86058. get data() {
  86059. return this._data;
  86060. }
  86061. /**
  86062. * Reads the provided file.
  86063. *
  86064. * @param {File} file Native File object.
  86065. * @returns {Promise.<String>} Returns a promise that will be resolved with file's content.
  86066. * The promise will be rejected in case of an error or when the reading process is aborted.
  86067. */
  86068. read( file ) {
  86069. const reader = this._reader;
  86070. this.total = file.size;
  86071. return new Promise( ( resolve, reject ) => {
  86072. reader.onload = () => {
  86073. const result = reader.result;
  86074. this._data = result;
  86075. resolve( result );
  86076. };
  86077. reader.onerror = () => {
  86078. reject( 'error' );
  86079. };
  86080. reader.onabort = () => {
  86081. reject( 'aborted' );
  86082. };
  86083. this._reader.readAsDataURL( file );
  86084. } );
  86085. }
  86086. /**
  86087. * Aborts file reader.
  86088. */
  86089. abort() {
  86090. this._reader.abort();
  86091. }
  86092. }
  86093. Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_1__["default"])( FileReader, _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_0__["default"] );
  86094. /***/ }),
  86095. /***/ "./node_modules/@ckeditor/ckeditor5-upload/src/filerepository.js":
  86096. /*!***********************************************************************!*\
  86097. !*** ./node_modules/@ckeditor/ckeditor5-upload/src/filerepository.js ***!
  86098. \***********************************************************************/
  86099. /*! exports provided: default */
  86100. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  86101. "use strict";
  86102. __webpack_require__.r(__webpack_exports__);
  86103. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return FileRepository; });
  86104. /* 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");
  86105. /* 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");
  86106. /* 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");
  86107. /* 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");
  86108. /* 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");
  86109. /* 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");
  86110. /* harmony import */ var _filereader_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./filereader.js */ "./node_modules/@ckeditor/ckeditor5-upload/src/filereader.js");
  86111. /* 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");
  86112. /**
  86113. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  86114. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  86115. */
  86116. /**
  86117. * @module upload/filerepository
  86118. */
  86119. /**
  86120. * File repository plugin. A central point for managing file upload.
  86121. *
  86122. * To use it, first you need an upload adapter. Upload adapter's job is to handle communication with the server
  86123. * (sending the file and handling server's response). You can use one of the existing plugins introducing upload adapters
  86124. * (e.g. {@link module:easy-image/cloudservicesuploadadapter~CloudServicesUploadAdapter} or
  86125. * {@link module:adapter-ckfinder/uploadadapter~CKFinderUploadAdapter}) or write your own one – see
  86126. * the {@glink framework/guides/deep-dive/upload-adapter "Custom image upload adapter" deep dive guide}.
  86127. *
  86128. * Then, you can use {@link module:upload/filerepository~FileRepository#createLoader `createLoader()`} and the returned
  86129. * {@link module:upload/filerepository~FileLoader} instance to load and upload files.
  86130. *
  86131. * @extends module:core/plugin~Plugin
  86132. */
  86133. class FileRepository extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
  86134. /**
  86135. * @inheritDoc
  86136. */
  86137. static get pluginName() {
  86138. return 'FileRepository';
  86139. }
  86140. /**
  86141. * @inheritDoc
  86142. */
  86143. static get requires() {
  86144. return [ _ckeditor_ckeditor5_core_src_pendingactions__WEBPACK_IMPORTED_MODULE_1__["default"] ];
  86145. }
  86146. /**
  86147. * @inheritDoc
  86148. */
  86149. init() {
  86150. /**
  86151. * Collection of loaders associated with this repository.
  86152. *
  86153. * @member {module:utils/collection~Collection} #loaders
  86154. */
  86155. this.loaders = new _ckeditor_ckeditor5_utils_src_collection__WEBPACK_IMPORTED_MODULE_4__["default"]();
  86156. // Keeps upload in a sync with pending actions.
  86157. this.loaders.on( 'add', () => this._updatePendingAction() );
  86158. this.loaders.on( 'remove', () => this._updatePendingAction() );
  86159. /**
  86160. * Loaders mappings used to retrieve loaders references.
  86161. *
  86162. * @private
  86163. * @member {Map<File|Promise, FileLoader>} #_loadersMap
  86164. */
  86165. this._loadersMap = new Map();
  86166. /**
  86167. * Reference to a pending action registered in a {@link module:core/pendingactions~PendingActions} plugin
  86168. * while upload is in progress. When there is no upload then value is `null`.
  86169. *
  86170. * @private
  86171. * @member {Object} #_pendingAction
  86172. */
  86173. this._pendingAction = null;
  86174. /**
  86175. * A factory function which should be defined before using `FileRepository`.
  86176. *
  86177. * It should return a new instance of {@link module:upload/filerepository~UploadAdapter} that will be used to upload files.
  86178. * {@link module:upload/filerepository~FileLoader} instance associated with the adapter
  86179. * will be passed to that function.
  86180. *
  86181. * For more information and example see {@link module:upload/filerepository~UploadAdapter}.
  86182. *
  86183. * @member {Function} #createUploadAdapter
  86184. */
  86185. /**
  86186. * Number of bytes uploaded.
  86187. *
  86188. * @readonly
  86189. * @observable
  86190. * @member {Number} #uploaded
  86191. */
  86192. this.set( 'uploaded', 0 );
  86193. /**
  86194. * Number of total bytes to upload.
  86195. *
  86196. * It might be different than the file size because of headers and additional data.
  86197. * It contains `null` if value is not available yet, so it's better to use {@link #uploadedPercent} to monitor
  86198. * the progress.
  86199. *
  86200. * @readonly
  86201. * @observable
  86202. * @member {Number|null} #uploadTotal
  86203. */
  86204. this.set( 'uploadTotal', null );
  86205. /**
  86206. * Upload progress in percents.
  86207. *
  86208. * @readonly
  86209. * @observable
  86210. * @member {Number} #uploadedPercent
  86211. */
  86212. this.bind( 'uploadedPercent' ).to( this, 'uploaded', this, 'uploadTotal', ( uploaded, total ) => {
  86213. return total ? ( uploaded / total * 100 ) : 0;
  86214. } );
  86215. }
  86216. /**
  86217. * Returns the loader associated with specified file or promise.
  86218. *
  86219. * To get loader by id use `fileRepository.loaders.get( id )`.
  86220. *
  86221. * @param {File|Promise.<File>} fileOrPromise Native file or promise handle.
  86222. * @returns {module:upload/filerepository~FileLoader|null}
  86223. */
  86224. getLoader( fileOrPromise ) {
  86225. return this._loadersMap.get( fileOrPromise ) || null;
  86226. }
  86227. /**
  86228. * Creates a loader instance for the given file.
  86229. *
  86230. * Requires {@link #createUploadAdapter} factory to be defined.
  86231. *
  86232. * @param {File|Promise.<File>} fileOrPromise Native File object or native Promise object which resolves to a File.
  86233. * @returns {module:upload/filerepository~FileLoader|null}
  86234. */
  86235. createLoader( fileOrPromise ) {
  86236. if ( !this.createUploadAdapter ) {
  86237. /**
  86238. * You need to enable an upload adapter in order to be able to upload files.
  86239. *
  86240. * This warning shows up when {@link module:upload/filerepository~FileRepository} is being used
  86241. * without {@link #createUploadAdapter defining an upload adapter}.
  86242. *
  86243. * **If you see this warning when using one of the {@glink builds/index CKEditor 5 Builds}**
  86244. * it means that you did not configure any of the upload adapters available by default in those builds.
  86245. *
  86246. * See the {@glink features/image-upload/image-upload comprehensive "Image upload overview"} to learn which upload
  86247. * adapters are available in the builds and how to configure them.
  86248. *
  86249. * **If you see this warning when using a custom build** there is a chance that you enabled
  86250. * a feature like {@link module:image/imageupload~ImageUpload},
  86251. * or {@link module:image/imageupload/imageuploadui~ImageUploadUI} but you did not enable any upload adapter.
  86252. * You can choose one of the existing upload adapters listed in the
  86253. * {@glink features/image-upload/image-upload "Image upload overview"}.
  86254. *
  86255. * You can also implement your {@glink framework/guides/deep-dive/upload-adapter own image upload adapter}.
  86256. *
  86257. * @error filerepository-no-upload-adapter
  86258. */
  86259. Object(_ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__["logWarning"])( 'filerepository-no-upload-adapter' );
  86260. return null;
  86261. }
  86262. const loader = new FileLoader( Promise.resolve( fileOrPromise ), this.createUploadAdapter );
  86263. this.loaders.add( loader );
  86264. this._loadersMap.set( fileOrPromise, loader );
  86265. // Store also file => loader mapping so loader can be retrieved by file instance returned upon Promise resolution.
  86266. if ( fileOrPromise instanceof Promise ) {
  86267. loader.file
  86268. .then( file => {
  86269. this._loadersMap.set( file, loader );
  86270. } )
  86271. // Every then() must have a catch().
  86272. // File loader state (and rejections) are handled in read() and upload().
  86273. // Also, see the "does not swallow the file promise rejection" test.
  86274. .catch( () => {} );
  86275. }
  86276. loader.on( 'change:uploaded', () => {
  86277. let aggregatedUploaded = 0;
  86278. for ( const loader of this.loaders ) {
  86279. aggregatedUploaded += loader.uploaded;
  86280. }
  86281. this.uploaded = aggregatedUploaded;
  86282. } );
  86283. loader.on( 'change:uploadTotal', () => {
  86284. let aggregatedTotal = 0;
  86285. for ( const loader of this.loaders ) {
  86286. if ( loader.uploadTotal ) {
  86287. aggregatedTotal += loader.uploadTotal;
  86288. }
  86289. }
  86290. this.uploadTotal = aggregatedTotal;
  86291. } );
  86292. return loader;
  86293. }
  86294. /**
  86295. * Destroys the given loader.
  86296. *
  86297. * @param {File|Promise|module:upload/filerepository~FileLoader} fileOrPromiseOrLoader File or Promise associated
  86298. * with that loader or loader itself.
  86299. */
  86300. destroyLoader( fileOrPromiseOrLoader ) {
  86301. const loader = fileOrPromiseOrLoader instanceof FileLoader ? fileOrPromiseOrLoader : this.getLoader( fileOrPromiseOrLoader );
  86302. loader._destroy();
  86303. this.loaders.remove( loader );
  86304. this._loadersMap.forEach( ( value, key ) => {
  86305. if ( value === loader ) {
  86306. this._loadersMap.delete( key );
  86307. }
  86308. } );
  86309. }
  86310. /**
  86311. * Registers or deregisters pending action bound with upload progress.
  86312. *
  86313. * @private
  86314. */
  86315. _updatePendingAction() {
  86316. const pendingActions = this.editor.plugins.get( _ckeditor_ckeditor5_core_src_pendingactions__WEBPACK_IMPORTED_MODULE_1__["default"] );
  86317. if ( this.loaders.length ) {
  86318. if ( !this._pendingAction ) {
  86319. const t = this.editor.t;
  86320. const getMessage = value => `${ t( 'Upload in progress' ) } ${ parseInt( value ) }%.`;
  86321. this._pendingAction = pendingActions.add( getMessage( this.uploadedPercent ) );
  86322. this._pendingAction.bind( 'message' ).to( this, 'uploadedPercent', getMessage );
  86323. }
  86324. } else {
  86325. pendingActions.remove( this._pendingAction );
  86326. this._pendingAction = null;
  86327. }
  86328. }
  86329. }
  86330. Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_5__["default"])( FileRepository, _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_3__["default"] );
  86331. /**
  86332. * File loader class.
  86333. *
  86334. * It is used to control the process of reading the file and uploading it using the specified upload adapter.
  86335. */
  86336. class FileLoader {
  86337. /**
  86338. * Creates a new instance of `FileLoader`.
  86339. *
  86340. * @param {Promise.<File>} filePromise A promise which resolves to a file instance.
  86341. * @param {Function} uploadAdapterCreator The function which returns {@link module:upload/filerepository~UploadAdapter} instance.
  86342. */
  86343. constructor( filePromise, uploadAdapterCreator ) {
  86344. /**
  86345. * Unique id of FileLoader instance.
  86346. *
  86347. * @readonly
  86348. * @member {Number}
  86349. */
  86350. this.id = Object(_ckeditor_ckeditor5_utils_src_uid_js__WEBPACK_IMPORTED_MODULE_7__["default"])();
  86351. /**
  86352. * Additional wrapper over the initial file promise passed to this loader.
  86353. *
  86354. * @protected
  86355. * @member {module:upload/filerepository~FilePromiseWrapper}
  86356. */
  86357. this._filePromiseWrapper = this._createFilePromiseWrapper( filePromise );
  86358. /**
  86359. * Adapter instance associated with this file loader.
  86360. *
  86361. * @private
  86362. * @member {module:upload/filerepository~UploadAdapter}
  86363. */
  86364. this._adapter = uploadAdapterCreator( this );
  86365. /**
  86366. * FileReader used by FileLoader.
  86367. *
  86368. * @protected
  86369. * @member {module:upload/filereader~FileReader}
  86370. */
  86371. this._reader = new _filereader_js__WEBPACK_IMPORTED_MODULE_6__["default"]();
  86372. /**
  86373. * Current status of FileLoader. It can be one of the following:
  86374. *
  86375. * * 'idle',
  86376. * * 'reading',
  86377. * * 'uploading',
  86378. * * 'aborted',
  86379. * * 'error'.
  86380. *
  86381. * When reading status can change in a following way:
  86382. *
  86383. * `idle` -> `reading` -> `idle`
  86384. * `idle` -> `reading -> `aborted`
  86385. * `idle` -> `reading -> `error`
  86386. *
  86387. * When uploading status can change in a following way:
  86388. *
  86389. * `idle` -> `uploading` -> `idle`
  86390. * `idle` -> `uploading` -> `aborted`
  86391. * `idle` -> `uploading` -> `error`
  86392. *
  86393. * @readonly
  86394. * @observable
  86395. * @member {String} #status
  86396. */
  86397. this.set( 'status', 'idle' );
  86398. /**
  86399. * Number of bytes uploaded.
  86400. *
  86401. * @readonly
  86402. * @observable
  86403. * @member {Number} #uploaded
  86404. */
  86405. this.set( 'uploaded', 0 );
  86406. /**
  86407. * Number of total bytes to upload.
  86408. *
  86409. * @readonly
  86410. * @observable
  86411. * @member {Number|null} #uploadTotal
  86412. */
  86413. this.set( 'uploadTotal', null );
  86414. /**
  86415. * Upload progress in percents.
  86416. *
  86417. * @readonly
  86418. * @observable
  86419. * @member {Number} #uploadedPercent
  86420. */
  86421. this.bind( 'uploadedPercent' ).to( this, 'uploaded', this, 'uploadTotal', ( uploaded, total ) => {
  86422. return total ? ( uploaded / total * 100 ) : 0;
  86423. } );
  86424. /**
  86425. * Response of the upload.
  86426. *
  86427. * @readonly
  86428. * @observable
  86429. * @member {Object|null} #uploadResponse
  86430. */
  86431. this.set( 'uploadResponse', null );
  86432. }
  86433. /**
  86434. * A `Promise` which resolves to a `File` instance associated with this file loader.
  86435. *
  86436. * @type {Promise.<File|null>}
  86437. */
  86438. get file() {
  86439. if ( !this._filePromiseWrapper ) {
  86440. // Loader was destroyed, return promise which resolves to null.
  86441. return Promise.resolve( null );
  86442. } else {
  86443. // The `this._filePromiseWrapper.promise` is chained and not simply returned to handle a case when:
  86444. //
  86445. // * The `loader.file.then( ... )` is called by external code (returned promise is pending).
  86446. // * Then `loader._destroy()` is called (call is synchronous) which destroys the `loader`.
  86447. // * Promise returned by the first `loader.file.then( ... )` call is resolved.
  86448. //
  86449. // Returning `this._filePromiseWrapper.promise` will still resolve to a `File` instance so there
  86450. // is an additional check needed in the chain to see if `loader` was destroyed in the meantime.
  86451. return this._filePromiseWrapper.promise.then( file => this._filePromiseWrapper ? file : null );
  86452. }
  86453. }
  86454. /**
  86455. * Returns the file data. To read its data, you need for first load the file
  86456. * by using the {@link module:upload/filerepository~FileLoader#read `read()`} method.
  86457. *
  86458. * @type {File|undefined}
  86459. */
  86460. get data() {
  86461. return this._reader.data;
  86462. }
  86463. /**
  86464. * Reads file using {@link module:upload/filereader~FileReader}.
  86465. *
  86466. * Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `filerepository-read-wrong-status` when status
  86467. * is different than `idle`.
  86468. *
  86469. * Example usage:
  86470. *
  86471. * fileLoader.read()
  86472. * .then( data => { ... } )
  86473. * .catch( err => {
  86474. * if ( err === 'aborted' ) {
  86475. * console.log( 'Reading aborted.' );
  86476. * } else {
  86477. * console.log( 'Reading error.', err );
  86478. * }
  86479. * } );
  86480. *
  86481. * @returns {Promise.<String>} Returns promise that will be resolved with read data. Promise will be rejected if error
  86482. * occurs or if read process is aborted.
  86483. */
  86484. read() {
  86485. if ( this.status != 'idle' ) {
  86486. /**
  86487. * You cannot call read if the status is different than idle.
  86488. *
  86489. * @error filerepository-read-wrong-status
  86490. */
  86491. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__["default"]( 'filerepository-read-wrong-status', this );
  86492. }
  86493. this.status = 'reading';
  86494. return this.file
  86495. .then( file => this._reader.read( file ) )
  86496. .then( data => {
  86497. // Edge case: reader was aborted after file was read - double check for proper status.
  86498. // It can happen when image was deleted during its upload.
  86499. if ( this.status !== 'reading' ) {
  86500. throw this.status;
  86501. }
  86502. this.status = 'idle';
  86503. return data;
  86504. } )
  86505. .catch( err => {
  86506. if ( err === 'aborted' ) {
  86507. this.status = 'aborted';
  86508. throw 'aborted';
  86509. }
  86510. this.status = 'error';
  86511. throw this._reader.error ? this._reader.error : err;
  86512. } );
  86513. }
  86514. /**
  86515. * Reads file using the provided {@link module:upload/filerepository~UploadAdapter}.
  86516. *
  86517. * Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `filerepository-upload-wrong-status` when status
  86518. * is different than `idle`.
  86519. * Example usage:
  86520. *
  86521. * fileLoader.upload()
  86522. * .then( data => { ... } )
  86523. * .catch( e => {
  86524. * if ( e === 'aborted' ) {
  86525. * console.log( 'Uploading aborted.' );
  86526. * } else {
  86527. * console.log( 'Uploading error.', e );
  86528. * }
  86529. * } );
  86530. *
  86531. * @returns {Promise.<Object>} Returns promise that will be resolved with response data. Promise will be rejected if error
  86532. * occurs or if read process is aborted.
  86533. */
  86534. upload() {
  86535. if ( this.status != 'idle' ) {
  86536. /**
  86537. * You cannot call upload if the status is different than idle.
  86538. *
  86539. * @error filerepository-upload-wrong-status
  86540. */
  86541. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__["default"]( 'filerepository-upload-wrong-status', this );
  86542. }
  86543. this.status = 'uploading';
  86544. return this.file
  86545. .then( () => this._adapter.upload() )
  86546. .then( data => {
  86547. this.uploadResponse = data;
  86548. this.status = 'idle';
  86549. return data;
  86550. } )
  86551. .catch( err => {
  86552. if ( this.status === 'aborted' ) {
  86553. throw 'aborted';
  86554. }
  86555. this.status = 'error';
  86556. throw err;
  86557. } );
  86558. }
  86559. /**
  86560. * Aborts loading process.
  86561. */
  86562. abort() {
  86563. const status = this.status;
  86564. this.status = 'aborted';
  86565. if ( !this._filePromiseWrapper.isFulfilled ) {
  86566. // Edge case: file loader is aborted before read() is called
  86567. // so it might happen that no one handled the rejection of this promise.
  86568. // See https://github.com/ckeditor/ckeditor5-upload/pull/100
  86569. this._filePromiseWrapper.promise.catch( () => {} );
  86570. this._filePromiseWrapper.rejecter( 'aborted' );
  86571. } else if ( status == 'reading' ) {
  86572. this._reader.abort();
  86573. } else if ( status == 'uploading' && this._adapter.abort ) {
  86574. this._adapter.abort();
  86575. }
  86576. this._destroy();
  86577. }
  86578. /**
  86579. * Performs cleanup.
  86580. *
  86581. * @private
  86582. */
  86583. _destroy() {
  86584. this._filePromiseWrapper = undefined;
  86585. this._reader = undefined;
  86586. this._adapter = undefined;
  86587. this.uploadResponse = undefined;
  86588. }
  86589. /**
  86590. * Wraps a given file promise into another promise giving additional
  86591. * control (resolving, rejecting, checking if fulfilled) over it.
  86592. *
  86593. * @private
  86594. * @param filePromise The initial file promise to be wrapped.
  86595. * @returns {module:upload/filerepository~FilePromiseWrapper}
  86596. */
  86597. _createFilePromiseWrapper( filePromise ) {
  86598. const wrapper = {};
  86599. wrapper.promise = new Promise( ( resolve, reject ) => {
  86600. wrapper.rejecter = reject;
  86601. wrapper.isFulfilled = false;
  86602. filePromise
  86603. .then( file => {
  86604. wrapper.isFulfilled = true;
  86605. resolve( file );
  86606. } )
  86607. .catch( err => {
  86608. wrapper.isFulfilled = true;
  86609. reject( err );
  86610. } );
  86611. } );
  86612. return wrapper;
  86613. }
  86614. }
  86615. Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_5__["default"])( FileLoader, _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_3__["default"] );
  86616. /**
  86617. * Upload adapter interface used by the {@link module:upload/filerepository~FileRepository file repository}
  86618. * to handle file upload. An upload adapter is a bridge between the editor and server that handles file uploads.
  86619. * It should contain a logic necessary to initiate an upload process and monitor its progress.
  86620. *
  86621. * Learn how to develop your own upload adapter for CKEditor 5 in the
  86622. * {@glink framework/guides/deep-dive/upload-adapter "Custom upload adapter" guide}.
  86623. *
  86624. * @interface UploadAdapter
  86625. */
  86626. /**
  86627. * Executes the upload process.
  86628. * This method should return a promise that will resolve when data will be uploaded to server. Promise should be
  86629. * resolved with an object containing information about uploaded file:
  86630. *
  86631. * {
  86632. * default: 'http://server/default-size.image.png'
  86633. * }
  86634. *
  86635. * Additionally, other image sizes can be provided:
  86636. *
  86637. * {
  86638. * default: 'http://server/default-size.image.png',
  86639. * '160': 'http://server/size-160.image.png',
  86640. * '500': 'http://server/size-500.image.png',
  86641. * '1000': 'http://server/size-1000.image.png',
  86642. * '1052': 'http://server/default-size.image.png'
  86643. * }
  86644. *
  86645. * You can also pass additional properties from the server. In this case you need to wrap URLs
  86646. * in the `urls` object and pass additional properties along the `urls` property.
  86647. *
  86648. * {
  86649. * myCustomProperty: 'foo',
  86650. * urls: {
  86651. * default: 'http://server/default-size.image.png',
  86652. * '160': 'http://server/size-160.image.png',
  86653. * '500': 'http://server/size-500.image.png',
  86654. * '1000': 'http://server/size-1000.image.png',
  86655. * '1052': 'http://server/default-size.image.png'
  86656. * }
  86657. * }
  86658. *
  86659. * NOTE: When returning multiple images, the widest returned one should equal the default one. It is essential to
  86660. * correctly set `width` attribute of the image. See this discussion:
  86661. * https://github.com/ckeditor/ckeditor5-easy-image/issues/4 for more information.
  86662. *
  86663. * Take a look at {@link module:upload/filerepository~UploadAdapter example Adapter implementation} and
  86664. * {@link module:upload/filerepository~FileRepository#createUploadAdapter createUploadAdapter method}.
  86665. *
  86666. * @method module:upload/filerepository~UploadAdapter#upload
  86667. * @returns {Promise.<Object>} Promise that should be resolved when data is uploaded.
  86668. */
  86669. /**
  86670. * Aborts the upload process.
  86671. * After aborting it should reject promise returned from {@link #upload upload()}.
  86672. *
  86673. * Take a look at {@link module:upload/filerepository~UploadAdapter example Adapter implementation} and
  86674. * {@link module:upload/filerepository~FileRepository#createUploadAdapter createUploadAdapter method}.
  86675. *
  86676. * @method module:upload/filerepository~UploadAdapter#abort
  86677. */
  86678. /**
  86679. * Object returned by {@link module:upload/filerepository~FileLoader#_createFilePromiseWrapper} method
  86680. * to add more control over the initial file promise passed to {@link module:upload/filerepository~FileLoader}.
  86681. *
  86682. * @protected
  86683. * @typedef {Object} module:upload/filerepository~FilePromiseWrapper
  86684. * @property {Promise.<File>} promise Wrapper promise which can be chained for further processing.
  86685. * @property {Function} rejecter Rejects the promise when called.
  86686. * @property {Boolean} isFulfilled Whether original promise is already fulfilled.
  86687. */
  86688. /***/ }),
  86689. /***/ "./node_modules/@ckeditor/ckeditor5-upload/src/index.js":
  86690. /*!**************************************************************!*\
  86691. !*** ./node_modules/@ckeditor/ckeditor5-upload/src/index.js ***!
  86692. \**************************************************************/
  86693. /*! exports provided: FileRepository, FileDialogButtonView, Base64UploadAdapter, SimpleUploadAdapter */
  86694. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  86695. "use strict";
  86696. __webpack_require__.r(__webpack_exports__);
  86697. /* harmony import */ var _filerepository__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./filerepository */ "./node_modules/@ckeditor/ckeditor5-upload/src/filerepository.js");
  86698. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FileRepository", function() { return _filerepository__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  86699. /* harmony import */ var _ui_filedialogbuttonview__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ui/filedialogbuttonview */ "./node_modules/@ckeditor/ckeditor5-upload/src/ui/filedialogbuttonview.js");
  86700. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FileDialogButtonView", function() { return _ui_filedialogbuttonview__WEBPACK_IMPORTED_MODULE_1__["default"]; });
  86701. /* harmony import */ var _adapters_base64uploadadapter__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./adapters/base64uploadadapter */ "./node_modules/@ckeditor/ckeditor5-upload/src/adapters/base64uploadadapter.js");
  86702. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Base64UploadAdapter", function() { return _adapters_base64uploadadapter__WEBPACK_IMPORTED_MODULE_2__["default"]; });
  86703. /* harmony import */ var _adapters_simpleuploadadapter__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./adapters/simpleuploadadapter */ "./node_modules/@ckeditor/ckeditor5-upload/src/adapters/simpleuploadadapter.js");
  86704. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SimpleUploadAdapter", function() { return _adapters_simpleuploadadapter__WEBPACK_IMPORTED_MODULE_3__["default"]; });
  86705. /**
  86706. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  86707. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  86708. */
  86709. /**
  86710. * @module upload
  86711. */
  86712. /***/ }),
  86713. /***/ "./node_modules/@ckeditor/ckeditor5-upload/src/ui/filedialogbuttonview.js":
  86714. /*!********************************************************************************!*\
  86715. !*** ./node_modules/@ckeditor/ckeditor5-upload/src/ui/filedialogbuttonview.js ***!
  86716. \********************************************************************************/
  86717. /*! exports provided: default */
  86718. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  86719. "use strict";
  86720. __webpack_require__.r(__webpack_exports__);
  86721. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return FileDialogButtonView; });
  86722. /* 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");
  86723. /* 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");
  86724. /**
  86725. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  86726. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  86727. */
  86728. /**
  86729. * @module upload/ui/filedialogbuttonview
  86730. */
  86731. /**
  86732. * The file dialog button view.
  86733. *
  86734. * This component provides a button that opens the native file selection dialog.
  86735. * It can be used to implement the UI of a file upload feature.
  86736. *
  86737. * const view = new FileDialogButtonView( locale );
  86738. *
  86739. * view.set( {
  86740. * acceptedType: 'image/*',
  86741. * allowMultipleFiles: true
  86742. * } );
  86743. *
  86744. * view.buttonView.set( {
  86745. * label: t( 'Insert image' ),
  86746. * icon: imageIcon,
  86747. * tooltip: true
  86748. * } );
  86749. *
  86750. * view.on( 'done', ( evt, files ) => {
  86751. * for ( const file of Array.from( files ) ) {
  86752. * console.log( 'Selected file', file );
  86753. * }
  86754. * } );
  86755. *
  86756. * @extends module:ui/view~View
  86757. */
  86758. class FileDialogButtonView extends _ckeditor_ckeditor5_ui_src_view__WEBPACK_IMPORTED_MODULE_1__["default"] {
  86759. /**
  86760. * @inheritDoc
  86761. */
  86762. constructor( locale ) {
  86763. super( locale );
  86764. /**
  86765. * The button view of the component.
  86766. *
  86767. * @member {module:ui/button/buttonview~ButtonView}
  86768. */
  86769. this.buttonView = new _ckeditor_ckeditor5_ui_src_button_buttonview__WEBPACK_IMPORTED_MODULE_0__["default"]( locale );
  86770. /**
  86771. * A hidden `<input>` view used to execute file dialog.
  86772. *
  86773. * @protected
  86774. * @member {module:upload/ui/filedialogbuttonview~FileInputView}
  86775. */
  86776. this._fileInputView = new FileInputView( locale );
  86777. /**
  86778. * Accepted file types. Can be provided in form of file extensions, media type or one of:
  86779. * * `audio/*`,
  86780. * * `video/*`,
  86781. * * `image/*`.
  86782. *
  86783. * @observable
  86784. * @member {String} #acceptedType
  86785. */
  86786. this._fileInputView.bind( 'acceptedType' ).to( this );
  86787. /**
  86788. * Indicates if multiple files can be selected. Defaults to `true`.
  86789. *
  86790. * @observable
  86791. * @member {Boolean} #allowMultipleFiles
  86792. */
  86793. this._fileInputView.bind( 'allowMultipleFiles' ).to( this );
  86794. /**
  86795. * Fired when file dialog is closed with file selected.
  86796. *
  86797. * view.on( 'done', ( evt, files ) => {
  86798. * for ( const file of files ) {
  86799. * console.log( 'Selected file', file );
  86800. * }
  86801. * }
  86802. *
  86803. * @event done
  86804. * @param {Array.<File>} files Array of selected files.
  86805. */
  86806. this._fileInputView.delegate( 'done' ).to( this );
  86807. this.setTemplate( {
  86808. tag: 'span',
  86809. attributes: {
  86810. class: 'ck-file-dialog-button'
  86811. },
  86812. children: [
  86813. this.buttonView,
  86814. this._fileInputView
  86815. ]
  86816. } );
  86817. this.buttonView.on( 'execute', () => {
  86818. this._fileInputView.open();
  86819. } );
  86820. }
  86821. /**
  86822. * Focuses the {@link #buttonView}.
  86823. */
  86824. focus() {
  86825. this.buttonView.focus();
  86826. }
  86827. }
  86828. /**
  86829. * The hidden file input view class.
  86830. *
  86831. * @private
  86832. * @extends module:ui/view~View
  86833. */
  86834. class FileInputView extends _ckeditor_ckeditor5_ui_src_view__WEBPACK_IMPORTED_MODULE_1__["default"] {
  86835. /**
  86836. * @inheritDoc
  86837. */
  86838. constructor( locale ) {
  86839. super( locale );
  86840. /**
  86841. * Accepted file types. Can be provided in form of file extensions, media type or one of:
  86842. * * `audio/*`,
  86843. * * `video/*`,
  86844. * * `image/*`.
  86845. *
  86846. * @observable
  86847. * @member {String} #acceptedType
  86848. */
  86849. this.set( 'acceptedType' );
  86850. /**
  86851. * Indicates if multiple files can be selected. Defaults to `false`.
  86852. *
  86853. * @observable
  86854. * @member {Boolean} #allowMultipleFiles
  86855. */
  86856. this.set( 'allowMultipleFiles', false );
  86857. const bind = this.bindTemplate;
  86858. this.setTemplate( {
  86859. tag: 'input',
  86860. attributes: {
  86861. class: [
  86862. 'ck-hidden'
  86863. ],
  86864. type: 'file',
  86865. tabindex: '-1',
  86866. accept: bind.to( 'acceptedType' ),
  86867. multiple: bind.to( 'allowMultipleFiles' )
  86868. },
  86869. on: {
  86870. // Removing from code coverage since we cannot programmatically set input element files.
  86871. change: bind.to( /* istanbul ignore next */ () => {
  86872. if ( this.element && this.element.files && this.element.files.length ) {
  86873. this.fire( 'done', this.element.files );
  86874. }
  86875. this.element.value = '';
  86876. } )
  86877. }
  86878. } );
  86879. }
  86880. /**
  86881. * Opens file dialog.
  86882. */
  86883. open() {
  86884. this.element.click();
  86885. }
  86886. }
  86887. /***/ }),
  86888. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js":
  86889. /*!*********************************************************************!*\
  86890. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js ***!
  86891. \*********************************************************************/
  86892. /*! exports provided: DOCUMENTATION_URL, default, logWarning, logError */
  86893. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  86894. "use strict";
  86895. __webpack_require__.r(__webpack_exports__);
  86896. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DOCUMENTATION_URL", function() { return DOCUMENTATION_URL; });
  86897. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return CKEditorError; });
  86898. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "logWarning", function() { return logWarning; });
  86899. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "logError", function() { return logError; });
  86900. /**
  86901. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  86902. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  86903. */
  86904. /**
  86905. * @module utils/ckeditorerror
  86906. */
  86907. /* globals console */
  86908. /**
  86909. * URL to the documentation with error codes.
  86910. */
  86911. const DOCUMENTATION_URL =
  86912. 'https://ckeditor.com/docs/ckeditor5/latest/framework/guides/support/error-codes.html';
  86913. /**
  86914. * The CKEditor error class.
  86915. *
  86916. * You should throw `CKEditorError` when:
  86917. *
  86918. * * An unexpected situation occurred and the editor (most probably) will not work properly. Such exception will be handled
  86919. * by the {@link module:watchdog/watchdog~Watchdog watchdog} (if it is integrated),
  86920. * * If the editor is incorrectly integrated or the editor API is used in the wrong way. This way you will give
  86921. * feedback to the developer as soon as possible. Keep in mind that for common integration issues which should not
  86922. * stop editor initialization (like missing upload adapter, wrong name of a toolbar component) we use
  86923. * {@link module:utils/ckeditorerror~logWarning `logWarning()`} and
  86924. * {@link module:utils/ckeditorerror~logError `logError()`}
  86925. * to improve developers experience and let them see the a working editor as soon as possible.
  86926. *
  86927. * /**
  86928. * * Error thrown when a plugin cannot be loaded due to JavaScript errors, lack of plugins with a given name, etc.
  86929. * *
  86930. * * @error plugin-load
  86931. * * @param pluginName The name of the plugin that could not be loaded.
  86932. * * @param moduleName The name of the module which tried to load this plugin.
  86933. * * /
  86934. * throw new CKEditorError( 'plugin-load', {
  86935. * pluginName: 'foo',
  86936. * moduleName: 'bar'
  86937. * } );
  86938. *
  86939. * @extends Error
  86940. */
  86941. class CKEditorError extends Error {
  86942. /**
  86943. * Creates an instance of the CKEditorError class.
  86944. *
  86945. * @param {String} errorName The error id in an `error-name` format. A link to this error documentation page will be added
  86946. * to the thrown error's `message`.
  86947. * @param {Object|null} context A context of the error by which the {@link module:watchdog/watchdog~Watchdog watchdog}
  86948. * is able to determine which editor crashed. It should be an editor instance or a property connected to it. It can be also
  86949. * a `null` value if the editor should not be restarted in case of the error (e.g. during the editor initialization).
  86950. * The error context should be checked using the `areConnectedThroughProperties( editor, context )` utility
  86951. * to check if the object works as the context.
  86952. * @param {Object} [data] Additional data describing the error. A stringified version of this object
  86953. * will be appended to the error message, so the data are quickly visible in the console. The original
  86954. * data object will also be later available under the {@link #data} property.
  86955. */
  86956. constructor( errorName, context, data ) {
  86957. const message = `${ errorName }${ ( data ? ` ${ JSON.stringify( data ) }` : '' ) }${ getLinkToDocumentationMessage( errorName ) }`;
  86958. super( message );
  86959. /**
  86960. * @type {String}
  86961. */
  86962. this.name = 'CKEditorError';
  86963. /**
  86964. * A context of the error by which the Watchdog is able to determine which editor crashed.
  86965. *
  86966. * @type {Object|null}
  86967. */
  86968. this.context = context;
  86969. /**
  86970. * The additional error data passed to the constructor. Undefined if none was passed.
  86971. *
  86972. * @type {Object|undefined}
  86973. */
  86974. this.data = data;
  86975. }
  86976. /**
  86977. * Checks if the error is of the `CKEditorError` type.
  86978. */
  86979. is( type ) {
  86980. return type === 'CKEditorError';
  86981. }
  86982. /**
  86983. * A utility that ensures that the thrown error is a {@link module:utils/ckeditorerror~CKEditorError} one.
  86984. * It is useful when combined with the {@link module:watchdog/watchdog~Watchdog} feature, which can restart the editor in case
  86985. * of a {@link module:utils/ckeditorerror~CKEditorError} error.
  86986. *
  86987. * @static
  86988. * @param {Error} err The error to rethrow.
  86989. * @param {Object} context An object connected through properties with the editor instance. This context will be used
  86990. * by the watchdog to verify which editor should be restarted.
  86991. */
  86992. static rethrowUnexpectedError( err, context ) {
  86993. if ( err.is && err.is( 'CKEditorError' ) ) {
  86994. throw err;
  86995. }
  86996. /**
  86997. * An unexpected error occurred inside the CKEditor 5 codebase. This error will look like the original one
  86998. * to make the debugging easier.
  86999. *
  87000. * This error is only useful when the editor is initialized using the {@link module:watchdog/watchdog~Watchdog} feature.
  87001. * In case of such error (or any {@link module:utils/ckeditorerror~CKEditorError} error) the watchdog should restart the editor.
  87002. *
  87003. * @error unexpected-error
  87004. */
  87005. const error = new CKEditorError( err.message, context );
  87006. // Restore the original stack trace to make the error look like the original one.
  87007. // See https://github.com/ckeditor/ckeditor5/issues/5595 for more details.
  87008. error.stack = err.stack;
  87009. throw error;
  87010. }
  87011. }
  87012. /**
  87013. * Logs a warning to the console with a properly formatted message and adds a link to the documentation.
  87014. * Use whenever you want to log a warning to the console.
  87015. *
  87016. * /**
  87017. * * There was a problem processing the configuration of the toolbar. The item with the given
  87018. * * name does not exist, so it was omitted when rendering the toolbar.
  87019. * *
  87020. * * @error toolbarview-item-unavailable
  87021. * * @param {String} name The name of the component.
  87022. * * /
  87023. * logWarning( 'toolbarview-item-unavailable', { name } );
  87024. *
  87025. * See also {@link module:utils/ckeditorerror~CKEditorError} for an explanation when to throw an error and when to log
  87026. * a warning or an error to the console.
  87027. *
  87028. * @param {String} errorName The error name to be logged.
  87029. * @param {Object} [data] Additional data to be logged.
  87030. * @returns {String}
  87031. */
  87032. function logWarning( errorName, data ) {
  87033. console.warn( ...formatConsoleArguments( errorName, data ) );
  87034. }
  87035. /**
  87036. * Logs an error to the console with a properly formatted message and adds a link to the documentation.
  87037. * Use whenever you want to log an error to the console.
  87038. *
  87039. * /**
  87040. * * There was a problem processing the configuration of the toolbar. The item with the given
  87041. * * name does not exist, so it was omitted when rendering the toolbar.
  87042. * *
  87043. * * @error toolbarview-item-unavailable
  87044. * * @param {String} name The name of the component.
  87045. * * /
  87046. * logError( 'toolbarview-item-unavailable', { name } );
  87047. *
  87048. * **Note**: In most cases logging a warning using {@link module:utils/ckeditorerror~logWarning} is enough.
  87049. *
  87050. * See also {@link module:utils/ckeditorerror~CKEditorError} for an explanation when to use each method.
  87051. *
  87052. * @param {String} errorName The error name to be logged.
  87053. * @param {Object} [data] Additional data to be logged.
  87054. * @returns {String}
  87055. */
  87056. function logError( errorName, data ) {
  87057. console.error( ...formatConsoleArguments( errorName, data ) );
  87058. }
  87059. function getLinkToDocumentationMessage( errorName ) {
  87060. return `\nRead more: ${ DOCUMENTATION_URL }#error-${ errorName }`;
  87061. }
  87062. function formatConsoleArguments( errorName, data ) {
  87063. const documentationMessage = getLinkToDocumentationMessage( errorName );
  87064. return data ? [ errorName, data, documentationMessage ] : [ errorName, documentationMessage ];
  87065. }
  87066. /***/ }),
  87067. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/collection.js":
  87068. /*!******************************************************************!*\
  87069. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/collection.js ***!
  87070. \******************************************************************/
  87071. /*! exports provided: default */
  87072. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  87073. "use strict";
  87074. __webpack_require__.r(__webpack_exports__);
  87075. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Collection; });
  87076. /* harmony import */ var _emittermixin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./emittermixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/emittermixin.js");
  87077. /* harmony import */ var _ckeditorerror__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  87078. /* harmony import */ var _uid__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./uid */ "./node_modules/@ckeditor/ckeditor5-utils/src/uid.js");
  87079. /* harmony import */ var _isiterable__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./isiterable */ "./node_modules/@ckeditor/ckeditor5-utils/src/isiterable.js");
  87080. /* harmony import */ var _mix__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./mix */ "./node_modules/@ckeditor/ckeditor5-utils/src/mix.js");
  87081. /**
  87082. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  87083. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  87084. */
  87085. /**
  87086. * @module utils/collection
  87087. */
  87088. /**
  87089. * Collections are ordered sets of objects. Items in the collection can be retrieved by their indexes
  87090. * in the collection (like in an array) or by their ids.
  87091. *
  87092. * If an object without an `id` property is being added to the collection, the `id` property will be generated
  87093. * automatically. Note that the automatically generated id is unique only within this single collection instance.
  87094. *
  87095. * By default an item in the collection is identified by its `id` property. The name of the identifier can be
  87096. * configured through the constructor of the collection.
  87097. *
  87098. * @mixes module:utils/emittermixin~EmitterMixin
  87099. */
  87100. class Collection {
  87101. /**
  87102. * Creates a new Collection instance.
  87103. *
  87104. * You can provide an iterable of initial items the collection will be created with:
  87105. *
  87106. * const collection = new Collection( [ { id: 'John' }, { id: 'Mike' } ] );
  87107. *
  87108. * console.log( collection.get( 0 ) ); // -> { id: 'John' }
  87109. * console.log( collection.get( 1 ) ); // -> { id: 'Mike' }
  87110. * console.log( collection.get( 'Mike' ) ); // -> { id: 'Mike' }
  87111. *
  87112. * Or you can first create a collection and then add new items using the {@link #add} method:
  87113. *
  87114. * const collection = new Collection();
  87115. *
  87116. * collection.add( { id: 'John' } );
  87117. * console.log( collection.get( 0 ) ); // -> { id: 'John' }
  87118. *
  87119. * Whatever option you choose, you can always pass a configuration object as the last argument
  87120. * of the constructor:
  87121. *
  87122. * const emptyCollection = new Collection( { idProperty: 'name' } );
  87123. * emptyCollection.add( { name: 'John' } );
  87124. * console.log( collection.get( 'John' ) ); // -> { name: 'John' }
  87125. *
  87126. * const nonEmptyCollection = new Collection( [ { name: 'John' } ], { idProperty: 'name' } );
  87127. * nonEmptyCollection.add( { name: 'George' } );
  87128. * console.log( collection.get( 'George' ) ); // -> { name: 'George' }
  87129. * console.log( collection.get( 'John' ) ); // -> { name: 'John' }
  87130. *
  87131. * @param {Iterable.<Object>|Object} initialItemsOrOptions The initial items of the collection or
  87132. * the options object.
  87133. * @param {Object} [options={}] The options object, when the first argument is an array of initial items.
  87134. * @param {String} [options.idProperty='id'] The name of the property which is used to identify an item.
  87135. * Items that do not have such a property will be assigned one when added to the collection.
  87136. */
  87137. constructor( initialItemsOrOptions = {}, options = {} ) {
  87138. const hasInitialItems = Object(_isiterable__WEBPACK_IMPORTED_MODULE_3__["default"])( initialItemsOrOptions );
  87139. if ( !hasInitialItems ) {
  87140. options = initialItemsOrOptions;
  87141. }
  87142. /**
  87143. * The internal list of items in the collection.
  87144. *
  87145. * @private
  87146. * @member {Object[]}
  87147. */
  87148. this._items = [];
  87149. /**
  87150. * The internal map of items in the collection.
  87151. *
  87152. * @private
  87153. * @member {Map}
  87154. */
  87155. this._itemMap = new Map();
  87156. /**
  87157. * The name of the property which is considered to identify an item.
  87158. *
  87159. * @private
  87160. * @member {String}
  87161. */
  87162. this._idProperty = options.idProperty || 'id';
  87163. /**
  87164. * A helper mapping external items of a bound collection ({@link #bindTo})
  87165. * and actual items of this collection. It provides information
  87166. * necessary to properly remove items bound to another collection.
  87167. *
  87168. * See {@link #_bindToInternalToExternalMap}.
  87169. *
  87170. * @protected
  87171. * @member {WeakMap}
  87172. */
  87173. this._bindToExternalToInternalMap = new WeakMap();
  87174. /**
  87175. * A helper mapping items of this collection to external items of a bound collection
  87176. * ({@link #bindTo}). It provides information necessary to manage the bindings, e.g.
  87177. * to avoid loops in two–way bindings.
  87178. *
  87179. * See {@link #_bindToExternalToInternalMap}.
  87180. *
  87181. * @protected
  87182. * @member {WeakMap}
  87183. */
  87184. this._bindToInternalToExternalMap = new WeakMap();
  87185. /**
  87186. * Stores indexes of skipped items from bound external collection.
  87187. *
  87188. * @private
  87189. * @member {Array}
  87190. */
  87191. this._skippedIndexesFromExternal = [];
  87192. // Set the initial content of the collection (if provided in the constructor).
  87193. if ( hasInitialItems ) {
  87194. for ( const item of initialItemsOrOptions ) {
  87195. this._items.push( item );
  87196. this._itemMap.set( this._getItemIdBeforeAdding( item ), item );
  87197. }
  87198. }
  87199. /**
  87200. * A collection instance this collection is bound to as a result
  87201. * of calling {@link #bindTo} method.
  87202. *
  87203. * @protected
  87204. * @member {module:utils/collection~Collection} #_bindToCollection
  87205. */
  87206. }
  87207. /**
  87208. * The number of items available in the collection.
  87209. *
  87210. * @member {Number} #length
  87211. */
  87212. get length() {
  87213. return this._items.length;
  87214. }
  87215. /**
  87216. * Returns the first item from the collection or null when collection is empty.
  87217. *
  87218. * @returns {Object|null} The first item or `null` if collection is empty.
  87219. */
  87220. get first() {
  87221. return this._items[ 0 ] || null;
  87222. }
  87223. /**
  87224. * Returns the last item from the collection or null when collection is empty.
  87225. *
  87226. * @returns {Object|null} The last item or `null` if collection is empty.
  87227. */
  87228. get last() {
  87229. return this._items[ this.length - 1 ] || null;
  87230. }
  87231. /**
  87232. * Adds an item into the collection.
  87233. *
  87234. * If the item does not have an id, then it will be automatically generated and set on the item.
  87235. *
  87236. * @chainable
  87237. * @param {Object} item
  87238. * @param {Number} [index] The position of the item in the collection. The item
  87239. * is pushed to the collection when `index` not specified.
  87240. * @fires add
  87241. * @fires change
  87242. */
  87243. add( item, index ) {
  87244. return this.addMany( [ item ], index );
  87245. }
  87246. /**
  87247. * Adds multiple items into the collection.
  87248. *
  87249. * Any item not containing an id will get an automatically generated one.
  87250. *
  87251. * @chainable
  87252. * @param {Iterable.<Object>} item
  87253. * @param {Number} [index] The position of the insertion. Items will be appended if no `index` is specified.
  87254. * @fires add
  87255. * @fires change
  87256. */
  87257. addMany( items, index ) {
  87258. if ( index === undefined ) {
  87259. index = this._items.length;
  87260. } else if ( index > this._items.length || index < 0 ) {
  87261. /**
  87262. * The `index` passed to {@link module:utils/collection~Collection#addMany `Collection#addMany()`}
  87263. * is invalid. It must be a number between 0 and the collection's length.
  87264. *
  87265. * @error collection-add-item-invalid-index
  87266. */
  87267. throw new _ckeditorerror__WEBPACK_IMPORTED_MODULE_1__["default"]( 'collection-add-item-invalid-index', this );
  87268. }
  87269. for ( let offset = 0; offset < items.length; offset++ ) {
  87270. const item = items[ offset ];
  87271. const itemId = this._getItemIdBeforeAdding( item );
  87272. const currentItemIndex = index + offset;
  87273. this._items.splice( currentItemIndex, 0, item );
  87274. this._itemMap.set( itemId, item );
  87275. this.fire( 'add', item, currentItemIndex );
  87276. }
  87277. this.fire( 'change', {
  87278. added: items,
  87279. removed: [],
  87280. index
  87281. } );
  87282. return this;
  87283. }
  87284. /**
  87285. * Gets an item by its ID or index.
  87286. *
  87287. * @param {String|Number} idOrIndex The item ID or index in the collection.
  87288. * @returns {Object|null} The requested item or `null` if such item does not exist.
  87289. */
  87290. get( idOrIndex ) {
  87291. let item;
  87292. if ( typeof idOrIndex == 'string' ) {
  87293. item = this._itemMap.get( idOrIndex );
  87294. } else if ( typeof idOrIndex == 'number' ) {
  87295. item = this._items[ idOrIndex ];
  87296. } else {
  87297. /**
  87298. * An index or ID must be given.
  87299. *
  87300. * @error collection-get-invalid-arg
  87301. */
  87302. throw new _ckeditorerror__WEBPACK_IMPORTED_MODULE_1__["default"]( 'collection-get-invalid-arg', this );
  87303. }
  87304. return item || null;
  87305. }
  87306. /**
  87307. * Returns a Boolean indicating whether the collection contains an item.
  87308. *
  87309. * @param {Object|String} itemOrId The item or its ID in the collection.
  87310. * @returns {Boolean} `true` if the collection contains the item, `false` otherwise.
  87311. */
  87312. has( itemOrId ) {
  87313. if ( typeof itemOrId == 'string' ) {
  87314. return this._itemMap.has( itemOrId );
  87315. } else { // Object
  87316. const idProperty = this._idProperty;
  87317. const id = itemOrId[ idProperty ];
  87318. return this._itemMap.has( id );
  87319. }
  87320. }
  87321. /**
  87322. * Gets an index of an item in the collection.
  87323. * When an item is not defined in the collection, the index will equal -1.
  87324. *
  87325. * @param {Object|String} itemOrId The item or its ID in the collection.
  87326. * @returns {Number} The index of a given item.
  87327. */
  87328. getIndex( itemOrId ) {
  87329. let item;
  87330. if ( typeof itemOrId == 'string' ) {
  87331. item = this._itemMap.get( itemOrId );
  87332. } else {
  87333. item = itemOrId;
  87334. }
  87335. return this._items.indexOf( item );
  87336. }
  87337. /**
  87338. * Removes an item from the collection.
  87339. *
  87340. * @param {Object|Number|String} subject The item to remove, its ID or index in the collection.
  87341. * @returns {Object} The removed item.
  87342. * @fires remove
  87343. * @fires change
  87344. */
  87345. remove( subject ) {
  87346. const [ item, index ] = this._remove( subject );
  87347. this.fire( 'change', {
  87348. added: [],
  87349. removed: [ item ],
  87350. index
  87351. } );
  87352. return item;
  87353. }
  87354. /**
  87355. * Executes the callback for each item in the collection and composes an array or values returned by this callback.
  87356. *
  87357. * @param {Function} callback
  87358. * @param {Object} callback.item
  87359. * @param {Number} callback.index
  87360. * @param {Object} ctx Context in which the `callback` will be called.
  87361. * @returns {Array} The result of mapping.
  87362. */
  87363. map( callback, ctx ) {
  87364. return this._items.map( callback, ctx );
  87365. }
  87366. /**
  87367. * Finds the first item in the collection for which the `callback` returns a true value.
  87368. *
  87369. * @param {Function} callback
  87370. * @param {Object} callback.item
  87371. * @param {Number} callback.index
  87372. * @param {Object} ctx Context in which the `callback` will be called.
  87373. * @returns {Object} The item for which `callback` returned a true value.
  87374. */
  87375. find( callback, ctx ) {
  87376. return this._items.find( callback, ctx );
  87377. }
  87378. /**
  87379. * Returns an array with items for which the `callback` returned a true value.
  87380. *
  87381. * @param {Function} callback
  87382. * @param {Object} callback.item
  87383. * @param {Number} callback.index
  87384. * @param {Object} ctx Context in which the `callback` will be called.
  87385. * @returns {Object[]} The array with matching items.
  87386. */
  87387. filter( callback, ctx ) {
  87388. return this._items.filter( callback, ctx );
  87389. }
  87390. /**
  87391. * Removes all items from the collection and destroys the binding created using
  87392. * {@link #bindTo}.
  87393. *
  87394. * @fires remove
  87395. * @fires change
  87396. */
  87397. clear() {
  87398. if ( this._bindToCollection ) {
  87399. this.stopListening( this._bindToCollection );
  87400. this._bindToCollection = null;
  87401. }
  87402. const removedItems = Array.from( this._items );
  87403. while ( this.length ) {
  87404. this._remove( 0 );
  87405. }
  87406. this.fire( 'change', {
  87407. added: [],
  87408. removed: removedItems,
  87409. index: 0
  87410. } );
  87411. }
  87412. /**
  87413. * Binds and synchronizes the collection with another one.
  87414. *
  87415. * The binding can be a simple factory:
  87416. *
  87417. * class FactoryClass {
  87418. * constructor( data ) {
  87419. * this.label = data.label;
  87420. * }
  87421. * }
  87422. *
  87423. * const source = new Collection( { idProperty: 'label' } );
  87424. * const target = new Collection();
  87425. *
  87426. * target.bindTo( source ).as( FactoryClass );
  87427. *
  87428. * source.add( { label: 'foo' } );
  87429. * source.add( { label: 'bar' } );
  87430. *
  87431. * console.log( target.length ); // 2
  87432. * console.log( target.get( 1 ).label ); // 'bar'
  87433. *
  87434. * source.remove( 0 );
  87435. * console.log( target.length ); // 1
  87436. * console.log( target.get( 0 ).label ); // 'bar'
  87437. *
  87438. * or the factory driven by a custom callback:
  87439. *
  87440. * class FooClass {
  87441. * constructor( data ) {
  87442. * this.label = data.label;
  87443. * }
  87444. * }
  87445. *
  87446. * class BarClass {
  87447. * constructor( data ) {
  87448. * this.label = data.label;
  87449. * }
  87450. * }
  87451. *
  87452. * const source = new Collection( { idProperty: 'label' } );
  87453. * const target = new Collection();
  87454. *
  87455. * target.bindTo( source ).using( ( item ) => {
  87456. * if ( item.label == 'foo' ) {
  87457. * return new FooClass( item );
  87458. * } else {
  87459. * return new BarClass( item );
  87460. * }
  87461. * } );
  87462. *
  87463. * source.add( { label: 'foo' } );
  87464. * source.add( { label: 'bar' } );
  87465. *
  87466. * console.log( target.length ); // 2
  87467. * console.log( target.get( 0 ) instanceof FooClass ); // true
  87468. * console.log( target.get( 1 ) instanceof BarClass ); // true
  87469. *
  87470. * or the factory out of property name:
  87471. *
  87472. * const source = new Collection( { idProperty: 'label' } );
  87473. * const target = new Collection();
  87474. *
  87475. * target.bindTo( source ).using( 'label' );
  87476. *
  87477. * source.add( { label: { value: 'foo' } } );
  87478. * source.add( { label: { value: 'bar' } } );
  87479. *
  87480. * console.log( target.length ); // 2
  87481. * console.log( target.get( 0 ).value ); // 'foo'
  87482. * console.log( target.get( 1 ).value ); // 'bar'
  87483. *
  87484. * It's possible to skip specified items by returning falsy value:
  87485. *
  87486. * const source = new Collection();
  87487. * const target = new Collection();
  87488. *
  87489. * target.bindTo( source ).using( item => {
  87490. * if ( item.hidden ) {
  87491. * return null;
  87492. * }
  87493. *
  87494. * return item;
  87495. * } );
  87496. *
  87497. * source.add( { hidden: true } );
  87498. * source.add( { hidden: false } );
  87499. *
  87500. * console.log( source.length ); // 2
  87501. * console.log( target.length ); // 1
  87502. *
  87503. * **Note**: {@link #clear} can be used to break the binding.
  87504. *
  87505. * @param {module:utils/collection~Collection} externalCollection A collection to be bound.
  87506. * @returns {Object}
  87507. * @returns {module:utils/collection~CollectionBindToChain} The binding chain object.
  87508. */
  87509. bindTo( externalCollection ) {
  87510. if ( this._bindToCollection ) {
  87511. /**
  87512. * The collection cannot be bound more than once.
  87513. *
  87514. * @error collection-bind-to-rebind
  87515. */
  87516. throw new _ckeditorerror__WEBPACK_IMPORTED_MODULE_1__["default"]( 'collection-bind-to-rebind', this );
  87517. }
  87518. this._bindToCollection = externalCollection;
  87519. return {
  87520. as: Class => {
  87521. this._setUpBindToBinding( item => new Class( item ) );
  87522. },
  87523. using: callbackOrProperty => {
  87524. if ( typeof callbackOrProperty == 'function' ) {
  87525. this._setUpBindToBinding( item => callbackOrProperty( item ) );
  87526. } else {
  87527. this._setUpBindToBinding( item => item[ callbackOrProperty ] );
  87528. }
  87529. }
  87530. };
  87531. }
  87532. /**
  87533. * Finalizes and activates a binding initiated by {#bindTo}.
  87534. *
  87535. * @protected
  87536. * @param {Function} factory A function which produces collection items.
  87537. */
  87538. _setUpBindToBinding( factory ) {
  87539. const externalCollection = this._bindToCollection;
  87540. // Adds the item to the collection once a change has been done to the external collection.
  87541. //
  87542. // @private
  87543. const addItem = ( evt, externalItem, index ) => {
  87544. const isExternalBoundToThis = externalCollection._bindToCollection == this;
  87545. const externalItemBound = externalCollection._bindToInternalToExternalMap.get( externalItem );
  87546. // If an external collection is bound to this collection, which makes it a 2–way binding,
  87547. // and the particular external collection item is already bound, don't add it here.
  87548. // The external item has been created **out of this collection's item** and (re)adding it will
  87549. // cause a loop.
  87550. if ( isExternalBoundToThis && externalItemBound ) {
  87551. this._bindToExternalToInternalMap.set( externalItem, externalItemBound );
  87552. this._bindToInternalToExternalMap.set( externalItemBound, externalItem );
  87553. } else {
  87554. const item = factory( externalItem );
  87555. // When there is no item we need to remember skipped index first and then we can skip this item.
  87556. if ( !item ) {
  87557. this._skippedIndexesFromExternal.push( index );
  87558. return;
  87559. }
  87560. // Lets try to put item at the same index as index in external collection
  87561. // but when there are a skipped items in one or both collections we need to recalculate this index.
  87562. let finalIndex = index;
  87563. // When we try to insert item after some skipped items from external collection we need
  87564. // to include this skipped items and decrease index.
  87565. //
  87566. // For the following example:
  87567. // external -> [ 'A', 'B - skipped for internal', 'C - skipped for internal' ]
  87568. // internal -> [ A ]
  87569. //
  87570. // Another item is been added at the end of external collection:
  87571. // external.add( 'D' )
  87572. // external -> [ 'A', 'B - skipped for internal', 'C - skipped for internal', 'D' ]
  87573. //
  87574. // We can't just add 'D' to internal at the same index as index in external because
  87575. // this will produce empty indexes what is invalid:
  87576. // internal -> [ 'A', empty, empty, 'D' ]
  87577. //
  87578. // So we need to include skipped items and decrease index
  87579. // internal -> [ 'A', 'D' ]
  87580. for ( const skipped of this._skippedIndexesFromExternal ) {
  87581. if ( index > skipped ) {
  87582. finalIndex--;
  87583. }
  87584. }
  87585. // We need to take into consideration that external collection could skip some items from
  87586. // internal collection.
  87587. //
  87588. // For the following example:
  87589. // internal -> [ 'A', 'B - skipped for external', 'C - skipped for external' ]
  87590. // external -> [ A ]
  87591. //
  87592. // Another item is been added at the end of external collection:
  87593. // external.add( 'D' )
  87594. // external -> [ 'A', 'D' ]
  87595. //
  87596. // We need to include skipped items and place new item after them:
  87597. // internal -> [ 'A', 'B - skipped for external', 'C - skipped for external', 'D' ]
  87598. for ( const skipped of externalCollection._skippedIndexesFromExternal ) {
  87599. if ( finalIndex >= skipped ) {
  87600. finalIndex++;
  87601. }
  87602. }
  87603. this._bindToExternalToInternalMap.set( externalItem, item );
  87604. this._bindToInternalToExternalMap.set( item, externalItem );
  87605. this.add( item, finalIndex );
  87606. // After adding new element to internal collection we need update indexes
  87607. // of skipped items in external collection.
  87608. for ( let i = 0; i < externalCollection._skippedIndexesFromExternal.length; i++ ) {
  87609. if ( finalIndex <= externalCollection._skippedIndexesFromExternal[ i ] ) {
  87610. externalCollection._skippedIndexesFromExternal[ i ]++;
  87611. }
  87612. }
  87613. }
  87614. };
  87615. // Load the initial content of the collection.
  87616. for ( const externalItem of externalCollection ) {
  87617. addItem( null, externalItem, externalCollection.getIndex( externalItem ) );
  87618. }
  87619. // Synchronize the with collection as new items are added.
  87620. this.listenTo( externalCollection, 'add', addItem );
  87621. // Synchronize the with collection as new items are removed.
  87622. this.listenTo( externalCollection, 'remove', ( evt, externalItem, index ) => {
  87623. const item = this._bindToExternalToInternalMap.get( externalItem );
  87624. if ( item ) {
  87625. this.remove( item );
  87626. }
  87627. // After removing element from external collection we need update/remove indexes
  87628. // of skipped items in internal collection.
  87629. this._skippedIndexesFromExternal = this._skippedIndexesFromExternal.reduce( ( result, skipped ) => {
  87630. if ( index < skipped ) {
  87631. result.push( skipped - 1 );
  87632. }
  87633. if ( index > skipped ) {
  87634. result.push( skipped );
  87635. }
  87636. return result;
  87637. }, [] );
  87638. } );
  87639. }
  87640. /**
  87641. * Returns an unique id property for a given `item`.
  87642. *
  87643. * The method will generate new id and assign it to the `item` if it doesn't have any.
  87644. *
  87645. * @private
  87646. * @param {Object} item Item to be added.
  87647. * @returns {String}
  87648. */
  87649. _getItemIdBeforeAdding( item ) {
  87650. const idProperty = this._idProperty;
  87651. let itemId;
  87652. if ( ( idProperty in item ) ) {
  87653. itemId = item[ idProperty ];
  87654. if ( typeof itemId != 'string' ) {
  87655. /**
  87656. * This item's ID should be a string.
  87657. *
  87658. * @error collection-add-invalid-id
  87659. */
  87660. throw new _ckeditorerror__WEBPACK_IMPORTED_MODULE_1__["default"]( 'collection-add-invalid-id', this );
  87661. }
  87662. if ( this.get( itemId ) ) {
  87663. /**
  87664. * This item already exists in the collection.
  87665. *
  87666. * @error collection-add-item-already-exists
  87667. */
  87668. throw new _ckeditorerror__WEBPACK_IMPORTED_MODULE_1__["default"]( 'collection-add-item-already-exists', this );
  87669. }
  87670. } else {
  87671. item[ idProperty ] = itemId = Object(_uid__WEBPACK_IMPORTED_MODULE_2__["default"])();
  87672. }
  87673. return itemId;
  87674. }
  87675. /**
  87676. * Core {@link #remove} method implementation shared in other functions.
  87677. *
  87678. * In contrast this method **does not** fire the {@link #event:change} event.
  87679. *
  87680. * @private
  87681. * @param {Object} subject The item to remove, its id or index in the collection.
  87682. * @returns {Array} Returns an array with the removed item and its index.
  87683. * @fires remove
  87684. */
  87685. _remove( subject ) {
  87686. let index, id, item;
  87687. let itemDoesNotExist = false;
  87688. const idProperty = this._idProperty;
  87689. if ( typeof subject == 'string' ) {
  87690. id = subject;
  87691. item = this._itemMap.get( id );
  87692. itemDoesNotExist = !item;
  87693. if ( item ) {
  87694. index = this._items.indexOf( item );
  87695. }
  87696. } else if ( typeof subject == 'number' ) {
  87697. index = subject;
  87698. item = this._items[ index ];
  87699. itemDoesNotExist = !item;
  87700. if ( item ) {
  87701. id = item[ idProperty ];
  87702. }
  87703. } else {
  87704. item = subject;
  87705. id = item[ idProperty ];
  87706. index = this._items.indexOf( item );
  87707. itemDoesNotExist = ( index == -1 || !this._itemMap.get( id ) );
  87708. }
  87709. if ( itemDoesNotExist ) {
  87710. /**
  87711. * Item not found.
  87712. *
  87713. * @error collection-remove-404
  87714. */
  87715. throw new _ckeditorerror__WEBPACK_IMPORTED_MODULE_1__["default"]( 'collection-remove-404', this );
  87716. }
  87717. this._items.splice( index, 1 );
  87718. this._itemMap.delete( id );
  87719. const externalItem = this._bindToInternalToExternalMap.get( item );
  87720. this._bindToInternalToExternalMap.delete( item );
  87721. this._bindToExternalToInternalMap.delete( externalItem );
  87722. this.fire( 'remove', item, index );
  87723. return [ item, index ];
  87724. }
  87725. /**
  87726. * Iterable interface.
  87727. *
  87728. * @returns {Iterable.<*>}
  87729. */
  87730. [ Symbol.iterator ]() {
  87731. return this._items[ Symbol.iterator ]();
  87732. }
  87733. /**
  87734. * Fired when an item is added to the collection.
  87735. *
  87736. * @event add
  87737. * @param {Object} item The added item.
  87738. */
  87739. /**
  87740. * Fired when the collection was changed due to adding or removing items.
  87741. *
  87742. * @event change
  87743. * @param {Iterable.<Object>} added A list of added items.
  87744. * @param {Iterable.<Object>} removed A list of removed items.
  87745. * @param {Number} index An index where the addition or removal occurred.
  87746. */
  87747. /**
  87748. * Fired when an item is removed from the collection.
  87749. *
  87750. * @event remove
  87751. * @param {Object} item The removed item.
  87752. * @param {Number} index Index from which item was removed.
  87753. */
  87754. }
  87755. Object(_mix__WEBPACK_IMPORTED_MODULE_4__["default"])( Collection, _emittermixin__WEBPACK_IMPORTED_MODULE_0__["default"] );
  87756. /**
  87757. * An object returned by the {@link module:utils/collection~Collection#bindTo `bindTo()`} method
  87758. * providing functions that specify the type of the binding.
  87759. *
  87760. * See the {@link module:utils/collection~Collection#bindTo `bindTo()`} documentation for examples.
  87761. *
  87762. * @interface module:utils/collection~CollectionBindToChain
  87763. */
  87764. /**
  87765. * Creates a callback or a property binding.
  87766. *
  87767. * @method #using
  87768. * @param {Function|String} callbackOrProperty When the function is passed, it should return
  87769. * the collection items. When the string is provided, the property value is used to create the bound collection items.
  87770. */
  87771. /**
  87772. * Creates the class factory binding in which items of the source collection are passed to
  87773. * the constructor of the specified class.
  87774. *
  87775. * @method #as
  87776. * @param {Function} Class The class constructor used to create instances in the factory.
  87777. */
  87778. /***/ }),
  87779. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/comparearrays.js":
  87780. /*!*********************************************************************!*\
  87781. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/comparearrays.js ***!
  87782. \*********************************************************************/
  87783. /*! exports provided: default */
  87784. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  87785. "use strict";
  87786. __webpack_require__.r(__webpack_exports__);
  87787. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return compareArrays; });
  87788. /**
  87789. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  87790. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  87791. */
  87792. /**
  87793. * @module utils/comparearrays
  87794. */
  87795. /**
  87796. * Compares how given arrays relate to each other. One array can be: same as another array, prefix of another array
  87797. * or completely different. If arrays are different, first index at which they differ is returned. Otherwise,
  87798. * a flag specifying the relation is returned. Flags are negative numbers, so whenever a number >= 0 is returned
  87799. * it means that arrays differ.
  87800. *
  87801. * compareArrays( [ 0, 2 ], [ 0, 2 ] ); // 'same'
  87802. * compareArrays( [ 0, 2 ], [ 0, 2, 1 ] ); // 'prefix'
  87803. * compareArrays( [ 0, 2 ], [ 0 ] ); // 'extension'
  87804. * compareArrays( [ 0, 2 ], [ 1, 2 ] ); // 0
  87805. * compareArrays( [ 0, 2 ], [ 0, 1 ] ); // 1
  87806. *
  87807. * @param {Array} a Array that is compared.
  87808. * @param {Array} b Array to compare with.
  87809. * @returns {module:utils/comparearrays~ArrayRelation} How array `a` is related to `b`.
  87810. */
  87811. function compareArrays( a, b ) {
  87812. const minLen = Math.min( a.length, b.length );
  87813. for ( let i = 0; i < minLen; i++ ) {
  87814. if ( a[ i ] != b[ i ] ) {
  87815. // The arrays are different.
  87816. return i;
  87817. }
  87818. }
  87819. // Both arrays were same at all points.
  87820. if ( a.length == b.length ) {
  87821. // If their length is also same, they are the same.
  87822. return 'same';
  87823. } else if ( a.length < b.length ) {
  87824. // Compared array is shorter so it is a prefix of the other array.
  87825. return 'prefix';
  87826. } else {
  87827. // Compared array is longer so it is an extension of the other array.
  87828. return 'extension';
  87829. }
  87830. }
  87831. /**
  87832. * @typedef {'extension'|'same'|'prefix'} module:utils/comparearrays~ArrayRelation
  87833. */
  87834. /***/ }),
  87835. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/config.js":
  87836. /*!**************************************************************!*\
  87837. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/config.js ***!
  87838. \**************************************************************/
  87839. /*! exports provided: default */
  87840. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  87841. "use strict";
  87842. __webpack_require__.r(__webpack_exports__);
  87843. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Config; });
  87844. /* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash-es */ "./node_modules/lodash-es/lodash.js");
  87845. /**
  87846. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  87847. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  87848. */
  87849. /**
  87850. * @module utils/config
  87851. */
  87852. /**
  87853. * Handles a configuration dictionary.
  87854. */
  87855. class Config {
  87856. /**
  87857. * Creates an instance of the {@link ~Config} class.
  87858. *
  87859. * @param {Object} [configurations] The initial configurations to be set. Usually, provided by the user.
  87860. * @param {Object} [defaultConfigurations] The default configurations. Usually, provided by the system.
  87861. */
  87862. constructor( configurations, defaultConfigurations ) {
  87863. /**
  87864. * Store for the whole configuration.
  87865. *
  87866. * @private
  87867. * @member {Object}
  87868. */
  87869. this._config = {};
  87870. // Set default configuration.
  87871. if ( defaultConfigurations ) {
  87872. // Clone the configuration to make sure that the properties will not be shared
  87873. // between editors and make the watchdog feature work correctly.
  87874. this.define( cloneConfig( defaultConfigurations ) );
  87875. }
  87876. // Set initial configuration.
  87877. if ( configurations ) {
  87878. this._setObjectToTarget( this._config, configurations );
  87879. }
  87880. }
  87881. /**
  87882. * Set configuration values.
  87883. *
  87884. * It accepts both a name/value pair or an object, which properties and values will be used to set
  87885. * configurations.
  87886. *
  87887. * It also accepts setting a "deep configuration" by using dots in the name. For example, `'resize.width'` sets
  87888. * the value for the `width` configuration in the `resize` subset.
  87889. *
  87890. * config.set( 'width', 500 );
  87891. * config.set( 'toolbar.collapsed', true );
  87892. *
  87893. * // Equivalent to:
  87894. * config.set( {
  87895. * width: 500
  87896. * toolbar: {
  87897. * collapsed: true
  87898. * }
  87899. * } );
  87900. *
  87901. * Passing an object as the value will amend the configuration, not replace it.
  87902. *
  87903. * config.set( 'toolbar', {
  87904. * collapsed: true,
  87905. * } );
  87906. *
  87907. * config.set( 'toolbar', {
  87908. * color: 'red',
  87909. * } );
  87910. *
  87911. * config.get( 'toolbar.collapsed' ); // true
  87912. * config.get( 'toolbar.color' ); // 'red'
  87913. *
  87914. * @param {String|Object} name The configuration name or an object from which take properties as
  87915. * configuration entries. Configuration names are case-sensitive.
  87916. * @param {*} value The configuration value. Used if a name is passed.
  87917. */
  87918. set( name, value ) {
  87919. this._setToTarget( this._config, name, value );
  87920. }
  87921. /**
  87922. * Does exactly the same as {@link #set} with one exception – passed configuration extends
  87923. * existing one, but does not overwrite already defined values.
  87924. *
  87925. * This method is supposed to be called by plugin developers to setup plugin's configurations. It would be
  87926. * rarely used for other needs.
  87927. *
  87928. * @param {String|Object} name The configuration name or an object from which take properties as
  87929. * configuration entries. Configuration names are case-sensitive.
  87930. * @param {*} value The configuration value. Used if a name is passed.
  87931. */
  87932. define( name, value ) {
  87933. const isDefine = true;
  87934. this._setToTarget( this._config, name, value, isDefine );
  87935. }
  87936. /**
  87937. * Gets the value for a configuration entry.
  87938. *
  87939. * config.get( 'name' );
  87940. *
  87941. * Deep configurations can be retrieved by separating each part with a dot.
  87942. *
  87943. * config.get( 'toolbar.collapsed' );
  87944. *
  87945. * @param {String} name The configuration name. Configuration names are case-sensitive.
  87946. * @returns {*} The configuration value or `undefined` if the configuration entry was not found.
  87947. */
  87948. get( name ) {
  87949. return this._getFromSource( this._config, name );
  87950. }
  87951. /**
  87952. * Iterates over all top level configuration names.
  87953. *
  87954. * @returns {Iterable.<String>}
  87955. */
  87956. * names() {
  87957. for ( const name of Object.keys( this._config ) ) {
  87958. yield name;
  87959. }
  87960. }
  87961. /**
  87962. * Saves passed configuration to the specified target (nested object).
  87963. *
  87964. * @private
  87965. * @param {Object} target Nested config object.
  87966. * @param {String|Object} name The configuration name or an object from which take properties as
  87967. * configuration entries. Configuration names are case-sensitive.
  87968. * @param {*} value The configuration value. Used if a name is passed.
  87969. * @param {Boolean} [isDefine=false] Define if passed configuration should overwrite existing one.
  87970. */
  87971. _setToTarget( target, name, value, isDefine = false ) {
  87972. // In case of an object, iterate through it and call `_setToTarget` again for each property.
  87973. if ( Object(lodash_es__WEBPACK_IMPORTED_MODULE_0__["isPlainObject"])( name ) ) {
  87974. this._setObjectToTarget( target, name, isDefine );
  87975. return;
  87976. }
  87977. // The configuration name should be split into parts if it has dots. E.g. `resize.width` -> [`resize`, `width`].
  87978. const parts = name.split( '.' );
  87979. // Take the name of the configuration out of the parts. E.g. `resize.width` -> `width`.
  87980. name = parts.pop();
  87981. // Iterate over parts to check if currently stored configuration has proper structure.
  87982. for ( const part of parts ) {
  87983. // If there is no object for specified part then create one.
  87984. if ( !Object(lodash_es__WEBPACK_IMPORTED_MODULE_0__["isPlainObject"])( target[ part ] ) ) {
  87985. target[ part ] = {};
  87986. }
  87987. // Nested object becomes a target.
  87988. target = target[ part ];
  87989. }
  87990. // In case of value is an object.
  87991. if ( Object(lodash_es__WEBPACK_IMPORTED_MODULE_0__["isPlainObject"])( value ) ) {
  87992. // We take care of proper config structure.
  87993. if ( !Object(lodash_es__WEBPACK_IMPORTED_MODULE_0__["isPlainObject"])( target[ name ] ) ) {
  87994. target[ name ] = {};
  87995. }
  87996. target = target[ name ];
  87997. // And iterate through this object calling `_setToTarget` again for each property.
  87998. this._setObjectToTarget( target, value, isDefine );
  87999. return;
  88000. }
  88001. // Do nothing if we are defining configuration for non empty name.
  88002. if ( isDefine && typeof target[ name ] != 'undefined' ) {
  88003. return;
  88004. }
  88005. target[ name ] = value;
  88006. }
  88007. /**
  88008. * Get specified configuration from specified source (nested object).
  88009. *
  88010. * @private
  88011. * @param {Object} source level of nested object.
  88012. * @param {String} name The configuration name. Configuration names are case-sensitive.
  88013. * @returns {*} The configuration value or `undefined` if the configuration entry was not found.
  88014. */
  88015. _getFromSource( source, name ) {
  88016. // The configuration name should be split into parts if it has dots. E.g. `resize.width` -> [`resize`, `width`].
  88017. const parts = name.split( '.' );
  88018. // Take the name of the configuration out of the parts. E.g. `resize.width` -> `width`.
  88019. name = parts.pop();
  88020. // Iterate over parts to check if currently stored configuration has proper structure.
  88021. for ( const part of parts ) {
  88022. if ( !Object(lodash_es__WEBPACK_IMPORTED_MODULE_0__["isPlainObject"])( source[ part ] ) ) {
  88023. source = null;
  88024. break;
  88025. }
  88026. // Nested object becomes a source.
  88027. source = source[ part ];
  88028. }
  88029. // Always returns undefined for non existing configuration.
  88030. return source ? cloneConfig( source[ name ] ) : undefined;
  88031. }
  88032. /**
  88033. * Iterates through passed object and calls {@link #_setToTarget} method with object key and value for each property.
  88034. *
  88035. * @private
  88036. * @param {Object} target Nested config object.
  88037. * @param {Object} configuration Configuration data set
  88038. * @param {Boolean} [isDefine] Defines if passed configuration is default configuration or not.
  88039. */
  88040. _setObjectToTarget( target, configuration, isDefine ) {
  88041. Object.keys( configuration ).forEach( key => {
  88042. this._setToTarget( target, key, configuration[ key ], isDefine );
  88043. } );
  88044. }
  88045. }
  88046. // Clones configuration object or value.
  88047. // @param {*} source Source configuration
  88048. // @returns {*} Cloned configuration value.
  88049. function cloneConfig( source ) {
  88050. return Object(lodash_es__WEBPACK_IMPORTED_MODULE_0__["cloneDeepWith"])( source, leaveDOMReferences );
  88051. }
  88052. // A customized function for cloneDeepWith.
  88053. // It will leave references to DOM Elements instead of cloning them.
  88054. //
  88055. // @param {*} value
  88056. // @returns {Element|undefined}
  88057. function leaveDOMReferences( value ) {
  88058. return Object(lodash_es__WEBPACK_IMPORTED_MODULE_0__["isElement"])( value ) ? value : undefined;
  88059. }
  88060. /***/ }),
  88061. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/count.js":
  88062. /*!*************************************************************!*\
  88063. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/count.js ***!
  88064. \*************************************************************/
  88065. /*! exports provided: default */
  88066. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  88067. "use strict";
  88068. __webpack_require__.r(__webpack_exports__);
  88069. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return count; });
  88070. /**
  88071. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  88072. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  88073. */
  88074. /**
  88075. * @module utils/count
  88076. */
  88077. /**
  88078. * Returns the number of items return by the iterator.
  88079. *
  88080. * count( [ 1, 2, 3, 4, 5 ] ); // 5;
  88081. *
  88082. * @param {Iterable.<*>} iterator Any iterator.
  88083. * @returns {Number} Number of items returned by that iterator.
  88084. */
  88085. function count( iterator ) {
  88086. let count = 0;
  88087. for ( const _ of iterator ) { // eslint-disable-line no-unused-vars
  88088. count++;
  88089. }
  88090. return count;
  88091. }
  88092. /***/ }),
  88093. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/diff.js":
  88094. /*!************************************************************!*\
  88095. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/diff.js ***!
  88096. \************************************************************/
  88097. /*! exports provided: default */
  88098. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  88099. "use strict";
  88100. __webpack_require__.r(__webpack_exports__);
  88101. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return diff; });
  88102. /* harmony import */ var _src_fastdiff__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../src/fastdiff */ "./node_modules/@ckeditor/ckeditor5-utils/src/fastdiff.js");
  88103. /**
  88104. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  88105. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  88106. */
  88107. /**
  88108. * @module utils/diff
  88109. */
  88110. // The following code is based on the "O(NP) Sequence Comparison Algorithm"
  88111. // by Sun Wu, Udi Manber, Gene Myers, Webb Miller.
  88112. /**
  88113. * Calculates the difference between two arrays or strings producing an array containing a list of changes
  88114. * necessary to transform input into output.
  88115. *
  88116. * diff( 'aba', 'acca' ); // [ 'equal', 'insert', 'insert', 'delete', 'equal' ]
  88117. *
  88118. * This function is based on the "O(NP) Sequence Comparison Algorithm" by Sun Wu, Udi Manber, Gene Myers, Webb Miller.
  88119. * Unfortunately, while it gives the most precise results, its to complex for longer strings/arrow (above 200 items).
  88120. * Therefore, `diff()` automatically switches to {@link module:utils/fastdiff~fastDiff `fastDiff()`} when detecting
  88121. * such a scenario. The return formats of both functions are identical.
  88122. *
  88123. * @param {Array|String} a Input array or string.
  88124. * @param {Array|String} b Output array or string.
  88125. * @param {Function} [cmp] Optional function used to compare array values, by default === is used.
  88126. * @returns {Array} Array of changes.
  88127. */
  88128. function diff( a, b, cmp ) {
  88129. // Set the comparator function.
  88130. cmp = cmp || function( a, b ) {
  88131. return a === b;
  88132. };
  88133. const aLength = a.length;
  88134. const bLength = b.length;
  88135. // Perform `fastDiff` for longer strings/arrays (see #269).
  88136. if ( aLength > 200 || bLength > 200 || aLength + bLength > 300 ) {
  88137. return diff.fastDiff( a, b, cmp, true );
  88138. }
  88139. // Temporary action type statics.
  88140. let _insert, _delete;
  88141. // Swapped the arrays to use the shorter one as the first one.
  88142. if ( bLength < aLength ) {
  88143. const tmp = a;
  88144. a = b;
  88145. b = tmp;
  88146. // We swap the action types as well.
  88147. _insert = 'delete';
  88148. _delete = 'insert';
  88149. } else {
  88150. _insert = 'insert';
  88151. _delete = 'delete';
  88152. }
  88153. const m = a.length;
  88154. const n = b.length;
  88155. const delta = n - m;
  88156. // Edit scripts, for each diagonal.
  88157. const es = {};
  88158. // Furthest points, the furthest y we can get on each diagonal.
  88159. const fp = {};
  88160. function snake( k ) {
  88161. // We use -1 as an alternative below to handle initial values ( instead of filling the fp with -1 first ).
  88162. // Furthest points (y) on the diagonal below k.
  88163. const y1 = ( fp[ k - 1 ] !== undefined ? fp[ k - 1 ] : -1 ) + 1;
  88164. // Furthest points (y) on the diagonal above k.
  88165. const y2 = fp[ k + 1 ] !== undefined ? fp[ k + 1 ] : -1;
  88166. // The way we should go to get further.
  88167. const dir = y1 > y2 ? -1 : 1;
  88168. // Clone previous changes array (if any).
  88169. if ( es[ k + dir ] ) {
  88170. es[ k ] = es[ k + dir ].slice( 0 );
  88171. }
  88172. // Create changes array.
  88173. if ( !es[ k ] ) {
  88174. es[ k ] = [];
  88175. }
  88176. // Push the action.
  88177. es[ k ].push( y1 > y2 ? _insert : _delete );
  88178. // Set the beginning coordinates.
  88179. let y = Math.max( y1, y2 );
  88180. let x = y - k;
  88181. // Traverse the diagonal as long as the values match.
  88182. while ( x < m && y < n && cmp( a[ x ], b[ y ] ) ) {
  88183. x++;
  88184. y++;
  88185. // Push no change action.
  88186. es[ k ].push( 'equal' );
  88187. }
  88188. return y;
  88189. }
  88190. let p = 0;
  88191. let k;
  88192. // Traverse the graph until we reach the end of the longer string.
  88193. do {
  88194. // Updates furthest points and edit scripts for diagonals below delta.
  88195. for ( k = -p; k < delta; k++ ) {
  88196. fp[ k ] = snake( k );
  88197. }
  88198. // Updates furthest points and edit scripts for diagonals above delta.
  88199. for ( k = delta + p; k > delta; k-- ) {
  88200. fp[ k ] = snake( k );
  88201. }
  88202. // Updates furthest point and edit script for the delta diagonal.
  88203. // note that the delta diagonal is the one which goes through the sink (m, n).
  88204. fp[ delta ] = snake( delta );
  88205. p++;
  88206. } while ( fp[ delta ] !== n );
  88207. // Return the final list of edit changes.
  88208. // We remove the first item that represents the action for the injected nulls.
  88209. return es[ delta ].slice( 1 );
  88210. }
  88211. // Store the API in static property to easily overwrite it in tests.
  88212. // Too bad dependency injection does not work in Webpack + ES 6 (const) + Babel.
  88213. diff.fastDiff = _src_fastdiff__WEBPACK_IMPORTED_MODULE_0__["default"];
  88214. /***/ }),
  88215. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/difftochanges.js":
  88216. /*!*********************************************************************!*\
  88217. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/difftochanges.js ***!
  88218. \*********************************************************************/
  88219. /*! exports provided: default */
  88220. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  88221. "use strict";
  88222. __webpack_require__.r(__webpack_exports__);
  88223. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return diffToChanges; });
  88224. /**
  88225. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  88226. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  88227. */
  88228. /**
  88229. * @module utils/difftochanges
  88230. */
  88231. /**
  88232. * Creates a set of changes which need to be applied to the input in order to transform
  88233. * it into the output. This function can be used with strings or arrays.
  88234. *
  88235. * const input = Array.from( 'abc' );
  88236. * const output = Array.from( 'xaby' );
  88237. * const changes = diffToChanges( diff( input, output ), output );
  88238. *
  88239. * changes.forEach( change => {
  88240. * if ( change.type == 'insert' ) {
  88241. * input.splice( change.index, 0, ...change.values );
  88242. * } else if ( change.type == 'delete' ) {
  88243. * input.splice( change.index, change.howMany );
  88244. * }
  88245. * } );
  88246. *
  88247. * input.join( '' ) == output.join( '' ); // -> true
  88248. *
  88249. * @param {Array.<'equal'|'insert'|'delete'>} diff Result of {@link module:utils/diff~diff}.
  88250. * @param {String|Array} output The string or array which was passed as diff's output.
  88251. * @returns {Array.<Object>} Set of changes (insert or delete) which need to be applied to the input
  88252. * in order to transform it into the output.
  88253. */
  88254. function diffToChanges( diff, output ) {
  88255. const changes = [];
  88256. let index = 0;
  88257. let lastOperation;
  88258. diff.forEach( change => {
  88259. if ( change == 'equal' ) {
  88260. pushLast();
  88261. index++;
  88262. } else if ( change == 'insert' ) {
  88263. if ( isContinuationOf( 'insert' ) ) {
  88264. lastOperation.values.push( output[ index ] );
  88265. } else {
  88266. pushLast();
  88267. lastOperation = {
  88268. type: 'insert',
  88269. index,
  88270. values: [ output[ index ] ]
  88271. };
  88272. }
  88273. index++;
  88274. } else /* if ( change == 'delete' ) */ {
  88275. if ( isContinuationOf( 'delete' ) ) {
  88276. lastOperation.howMany++;
  88277. } else {
  88278. pushLast();
  88279. lastOperation = {
  88280. type: 'delete',
  88281. index,
  88282. howMany: 1
  88283. };
  88284. }
  88285. }
  88286. } );
  88287. pushLast();
  88288. return changes;
  88289. function pushLast() {
  88290. if ( lastOperation ) {
  88291. changes.push( lastOperation );
  88292. lastOperation = null;
  88293. }
  88294. }
  88295. function isContinuationOf( expected ) {
  88296. return lastOperation && lastOperation.type == expected;
  88297. }
  88298. }
  88299. /***/ }),
  88300. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/createelement.js":
  88301. /*!*************************************************************************!*\
  88302. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/dom/createelement.js ***!
  88303. \*************************************************************************/
  88304. /*! exports provided: default */
  88305. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  88306. "use strict";
  88307. __webpack_require__.r(__webpack_exports__);
  88308. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return createElement; });
  88309. /* harmony import */ var _isiterable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../isiterable */ "./node_modules/@ckeditor/ckeditor5-utils/src/isiterable.js");
  88310. /* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash-es */ "./node_modules/lodash-es/lodash.js");
  88311. /**
  88312. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  88313. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  88314. */
  88315. /**
  88316. * @module utils/dom/createelement
  88317. */
  88318. /**
  88319. * Creates element with attributes and children.
  88320. *
  88321. * createElement( document, 'p' ); // <p>
  88322. * createElement( document, 'p', { class: 'foo' } ); // <p class="foo">
  88323. * createElement( document, 'p', null, 'foo' ); // <p>foo</p>
  88324. * createElement( document, 'p', null, [ 'foo', createElement( document, 'img' ) ] ); // <p>foo<img></p>
  88325. *
  88326. * @param {Document} doc Document used to create element.
  88327. * @param {String} name Name of the element.
  88328. * @param {Object} [attributes] Object keys will become attributes keys and object values will became attributes values.
  88329. * @param {Node|String|Array.<Node|String>} [children] Child or array of children. Strings will be automatically turned
  88330. * into Text nodes.
  88331. * @returns {Element} Created element.
  88332. */
  88333. function createElement( doc, name, attributes = {}, children = [] ) {
  88334. const namespace = attributes && attributes.xmlns;
  88335. const element = namespace ? doc.createElementNS( namespace, name ) : doc.createElement( name );
  88336. for ( const key in attributes ) {
  88337. element.setAttribute( key, attributes[ key ] );
  88338. }
  88339. if ( Object(lodash_es__WEBPACK_IMPORTED_MODULE_1__["isString"])( children ) || !Object(_isiterable__WEBPACK_IMPORTED_MODULE_0__["default"])( children ) ) {
  88340. children = [ children ];
  88341. }
  88342. for ( let child of children ) {
  88343. if ( Object(lodash_es__WEBPACK_IMPORTED_MODULE_1__["isString"])( child ) ) {
  88344. child = doc.createTextNode( child );
  88345. }
  88346. element.appendChild( child );
  88347. }
  88348. return element;
  88349. }
  88350. /***/ }),
  88351. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/emittermixin.js":
  88352. /*!************************************************************************!*\
  88353. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/dom/emittermixin.js ***!
  88354. \************************************************************************/
  88355. /*! exports provided: default */
  88356. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  88357. "use strict";
  88358. __webpack_require__.r(__webpack_exports__);
  88359. /* harmony import */ var _emittermixin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../emittermixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/emittermixin.js");
  88360. /* harmony import */ var _uid__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../uid */ "./node_modules/@ckeditor/ckeditor5-utils/src/uid.js");
  88361. /* harmony import */ var _isnode__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./isnode */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/isnode.js");
  88362. /* harmony import */ var _iswindow__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./iswindow */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/iswindow.js");
  88363. /* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! lodash-es */ "./node_modules/lodash-es/lodash.js");
  88364. /**
  88365. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  88366. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  88367. */
  88368. /**
  88369. * @module utils/dom/emittermixin
  88370. */
  88371. /**
  88372. * Mixin that injects the DOM events API into its host. It provides the API
  88373. * compatible with {@link module:utils/emittermixin~EmitterMixin}.
  88374. *
  88375. * DOM emitter mixin is by default available in the {@link module:ui/view~View} class,
  88376. * but it can also be mixed into any other class:
  88377. *
  88378. * import mix from '../utils/mix.js';
  88379. * import DomEmitterMixin from '../utils/dom/emittermixin.js';
  88380. *
  88381. * class SomeView {}
  88382. * mix( SomeView, DomEmitterMixin );
  88383. *
  88384. * const view = new SomeView();
  88385. * view.listenTo( domElement, ( evt, domEvt ) => {
  88386. * console.log( evt, domEvt );
  88387. * } );
  88388. *
  88389. * @mixin EmitterMixin
  88390. * @mixes module:utils/emittermixin~EmitterMixin
  88391. * @implements module:utils/dom/emittermixin~Emitter
  88392. */
  88393. const DomEmitterMixin = Object(lodash_es__WEBPACK_IMPORTED_MODULE_4__["extend"])( {}, _emittermixin__WEBPACK_IMPORTED_MODULE_0__["default"], {
  88394. /**
  88395. * Registers a callback function to be executed when an event is fired in a specific Emitter or DOM Node.
  88396. * It is backwards compatible with {@link module:utils/emittermixin~EmitterMixin#listenTo}.
  88397. *
  88398. * @param {module:utils/emittermixin~Emitter|Node} emitter The object that fires the event.
  88399. * @param {String} event The name of the event.
  88400. * @param {Function} callback The function to be called on event.
  88401. * @param {Object} [options={}] Additional options.
  88402. * @param {module:utils/priorities~PriorityString|Number} [options.priority='normal'] The priority of this event callback. The higher
  88403. * the priority value the sooner the callback will be fired. Events having the same priority are called in the
  88404. * order they were added.
  88405. * @param {Boolean} [options.useCapture=false] Indicates that events of this type will be dispatched to the registered
  88406. * listener before being dispatched to any EventTarget beneath it in the DOM tree.
  88407. * @param {Boolean} [options.usePassive=false] Indicates that the function specified by listener will never call preventDefault()
  88408. * and prevents blocking browser's main thread by this event handler.
  88409. */
  88410. listenTo( emitter, ...rest ) {
  88411. // Check if emitter is an instance of DOM Node. If so, replace the argument with
  88412. // corresponding ProxyEmitter (or create one if not existing).
  88413. if ( Object(_isnode__WEBPACK_IMPORTED_MODULE_2__["default"])( emitter ) || Object(_iswindow__WEBPACK_IMPORTED_MODULE_3__["default"])( emitter ) ) {
  88414. const proxy = this._getProxyEmitter( emitter ) || new ProxyEmitter( emitter );
  88415. proxy.attach( ...rest );
  88416. emitter = proxy;
  88417. }
  88418. // Execute parent class method with Emitter (or ProxyEmitter) instance.
  88419. _emittermixin__WEBPACK_IMPORTED_MODULE_0__["default"].listenTo.call( this, emitter, ...rest );
  88420. },
  88421. /**
  88422. * Stops listening for events. It can be used at different levels:
  88423. * It is backwards compatible with {@link module:utils/emittermixin~EmitterMixin#listenTo}.
  88424. *
  88425. * * To stop listening to a specific callback.
  88426. * * To stop listening to a specific event.
  88427. * * To stop listening to all events fired by a specific object.
  88428. * * To stop listening to all events fired by all object.
  88429. *
  88430. * @param {module:utils/emittermixin~Emitter|Node} [emitter] The object to stop listening to. If omitted, stops it for all objects.
  88431. * @param {String} [event] (Requires the `emitter`) The name of the event to stop listening to. If omitted, stops it
  88432. * for all events from `emitter`.
  88433. * @param {Function} [callback] (Requires the `event`) The function to be removed from the call list for the given
  88434. * `event`.
  88435. */
  88436. stopListening( emitter, event, callback ) {
  88437. // Check if emitter is an instance of DOM Node. If so, replace the argument with corresponding ProxyEmitter.
  88438. if ( Object(_isnode__WEBPACK_IMPORTED_MODULE_2__["default"])( emitter ) || Object(_iswindow__WEBPACK_IMPORTED_MODULE_3__["default"])( emitter ) ) {
  88439. const proxy = this._getProxyEmitter( emitter );
  88440. // Element has no listeners.
  88441. if ( !proxy ) {
  88442. return;
  88443. }
  88444. emitter = proxy;
  88445. }
  88446. // Execute parent class method with Emitter (or ProxyEmitter) instance.
  88447. _emittermixin__WEBPACK_IMPORTED_MODULE_0__["default"].stopListening.call( this, emitter, event, callback );
  88448. if ( emitter instanceof ProxyEmitter ) {
  88449. emitter.detach( event );
  88450. }
  88451. },
  88452. /**
  88453. * Retrieves ProxyEmitter instance for given DOM Node residing in this Host.
  88454. *
  88455. * @private
  88456. * @param {Node} node DOM Node of the ProxyEmitter.
  88457. * @returns {module:utils/dom/emittermixin~ProxyEmitter} ProxyEmitter instance or null.
  88458. */
  88459. _getProxyEmitter( node ) {
  88460. return Object(_emittermixin__WEBPACK_IMPORTED_MODULE_0__["_getEmitterListenedTo"])( this, getNodeUID( node ) );
  88461. }
  88462. } );
  88463. /* harmony default export */ __webpack_exports__["default"] = (DomEmitterMixin);
  88464. /**
  88465. * Creates a ProxyEmitter instance. Such an instance is a bridge between a DOM Node firing events
  88466. * and any Host listening to them. It is backwards compatible with {@link module:utils/emittermixin~EmitterMixin#on}.
  88467. *
  88468. * listenTo( click, ... )
  88469. * +-----------------------------------------+
  88470. * | stopListening( ... ) |
  88471. * +----------------------------+ | addEventListener( click, ... )
  88472. * | Host | | +---------------------------------------------+
  88473. * +----------------------------+ | | removeEventListener( click, ... ) |
  88474. * | _listeningTo: { | +----------v-------------+ |
  88475. * | UID: { | | ProxyEmitter | |
  88476. * | emitter: ProxyEmitter, | +------------------------+ +------------v----------+
  88477. * | callbacks: { | | events: { | | Node (HTMLElement) |
  88478. * | click: [ callbacks ] | | click: [ callbacks ] | +-----------------------+
  88479. * | } | | }, | | data-ck-expando: UID |
  88480. * | } | | _domNode: Node, | +-----------------------+
  88481. * | } | | _domListeners: {}, | |
  88482. * | +------------------------+ | | _emitterId: UID | |
  88483. * | | DomEmitterMixin | | +--------------^---------+ |
  88484. * | +------------------------+ | | | |
  88485. * +--------------^-------------+ | +---------------------------------------------+
  88486. * | | click (DOM Event)
  88487. * +-----------------------------------------+
  88488. * fire( click, DOM Event )
  88489. *
  88490. * @mixes module:utils/emittermixin~EmitterMixin
  88491. * @implements module:utils/dom/emittermixin~Emitter
  88492. * @private
  88493. */
  88494. class ProxyEmitter {
  88495. /**
  88496. * @param {Node} node DOM Node that fires events.
  88497. * @returns {Object} ProxyEmitter instance bound to the DOM Node.
  88498. */
  88499. constructor( node ) {
  88500. // Set emitter ID to match DOM Node "expando" property.
  88501. Object(_emittermixin__WEBPACK_IMPORTED_MODULE_0__["_setEmitterId"])( this, getNodeUID( node ) );
  88502. // Remember the DOM Node this ProxyEmitter is bound to.
  88503. this._domNode = node;
  88504. }
  88505. }
  88506. Object(lodash_es__WEBPACK_IMPORTED_MODULE_4__["extend"])( ProxyEmitter.prototype, _emittermixin__WEBPACK_IMPORTED_MODULE_0__["default"], {
  88507. /**
  88508. * Collection of native DOM listeners.
  88509. *
  88510. * @private
  88511. * @member {Object} module:utils/dom/emittermixin~ProxyEmitter#_domListeners
  88512. */
  88513. /**
  88514. * Registers a callback function to be executed when an event is fired.
  88515. *
  88516. * It attaches a native DOM listener to the DOM Node. When fired,
  88517. * a corresponding Emitter event will also fire with DOM Event object as an argument.
  88518. *
  88519. * @method module:utils/dom/emittermixin~ProxyEmitter#attach
  88520. * @param {String} event The name of the event.
  88521. * @param {Function} callback The function to be called on event.
  88522. * @param {Object} [options={}] Additional options.
  88523. * @param {Boolean} [options.useCapture=false] Indicates that events of this type will be dispatched to the registered
  88524. * listener before being dispatched to any EventTarget beneath it in the DOM tree.
  88525. * @param {Boolean} [options.usePassive=false] Indicates that the function specified by listener will never call preventDefault()
  88526. * and prevents blocking browser's main thread by this event handler.
  88527. */
  88528. attach( event, callback, options = {} ) {
  88529. // If the DOM Listener for given event already exist it is pointless
  88530. // to attach another one.
  88531. if ( this._domListeners && this._domListeners[ event ] ) {
  88532. return;
  88533. }
  88534. const listenerOptions = {
  88535. capture: !!options.useCapture,
  88536. passive: !!options.usePassive
  88537. };
  88538. const domListener = this._createDomListener( event, listenerOptions );
  88539. // Attach the native DOM listener to DOM Node.
  88540. this._domNode.addEventListener( event, domListener, listenerOptions );
  88541. if ( !this._domListeners ) {
  88542. this._domListeners = {};
  88543. }
  88544. // Store the native DOM listener in this ProxyEmitter. It will be helpful
  88545. // when stopping listening to the event.
  88546. this._domListeners[ event ] = domListener;
  88547. },
  88548. /**
  88549. * Stops executing the callback on the given event.
  88550. *
  88551. * @method module:utils/dom/emittermixin~ProxyEmitter#detach
  88552. * @param {String} event The name of the event.
  88553. */
  88554. detach( event ) {
  88555. let events;
  88556. // Remove native DOM listeners which are orphans. If no callbacks
  88557. // are awaiting given event, detach native DOM listener from DOM Node.
  88558. // See: {@link attach}.
  88559. if ( this._domListeners[ event ] && ( !( events = this._events[ event ] ) || !events.callbacks.length ) ) {
  88560. this._domListeners[ event ].removeListener();
  88561. }
  88562. },
  88563. /**
  88564. * Creates a native DOM listener callback. When the native DOM event
  88565. * is fired it will fire corresponding event on this ProxyEmitter.
  88566. * Note: A native DOM Event is passed as an argument.
  88567. *
  88568. * @private
  88569. * @method module:utils/dom/emittermixin~ProxyEmitter#_createDomListener
  88570. * @param {String} event The name of the event.
  88571. * @param {Object} [options] Additional options.
  88572. * @param {Boolean} [options.capture=false] Indicates whether the listener was created for capturing event.
  88573. * @param {Boolean} [options.passive=false] Indicates that the function specified by listener will never call preventDefault()
  88574. * and prevents blocking browser's main thread by this event handler.
  88575. * @returns {Function} The DOM listener callback.
  88576. */
  88577. _createDomListener( event, options ) {
  88578. const domListener = domEvt => {
  88579. this.fire( event, domEvt );
  88580. };
  88581. // Supply the DOM listener callback with a function that will help
  88582. // detach it from the DOM Node, when it is no longer necessary.
  88583. // See: {@link detach}.
  88584. domListener.removeListener = () => {
  88585. this._domNode.removeEventListener( event, domListener, options );
  88586. delete this._domListeners[ event ];
  88587. };
  88588. return domListener;
  88589. }
  88590. } );
  88591. // Gets an unique DOM Node identifier. The identifier will be set if not defined.
  88592. //
  88593. // @private
  88594. // @param {Node} node
  88595. // @returns {String} UID for given DOM Node.
  88596. function getNodeUID( node ) {
  88597. return node[ 'data-ck-expando' ] || ( node[ 'data-ck-expando' ] = Object(_uid__WEBPACK_IMPORTED_MODULE_1__["default"])() );
  88598. }
  88599. /**
  88600. * Interface representing classes which mix in {@link module:utils/dom/emittermixin~EmitterMixin}.
  88601. *
  88602. * @interface Emitter
  88603. */
  88604. /***/ }),
  88605. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/getancestors.js":
  88606. /*!************************************************************************!*\
  88607. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/dom/getancestors.js ***!
  88608. \************************************************************************/
  88609. /*! exports provided: default */
  88610. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  88611. "use strict";
  88612. __webpack_require__.r(__webpack_exports__);
  88613. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return getAncestors; });
  88614. /**
  88615. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  88616. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  88617. */
  88618. /* globals Node */
  88619. /**
  88620. * @module utils/dom/getancestors
  88621. */
  88622. /**
  88623. * Returns all ancestors of given DOM node, starting from the top-most (root). Includes the given node itself. If the
  88624. * node is a part of `DocumentFragment` that `DocumentFragment` will be returned. In contrary, if the node is
  88625. * appended to a `Document`, that `Document` will not be returned (algorithms operating on DOM tree care for `Document#documentElement`
  88626. * at most, which will be returned).
  88627. *
  88628. * @param {Node} node DOM node.
  88629. * @returns {Array.<Node|DocumentFragment>} Array of given `node` parents.
  88630. */
  88631. function getAncestors( node ) {
  88632. const nodes = [];
  88633. // We are interested in `Node`s `DocumentFragment`s only.
  88634. while ( node && node.nodeType != Node.DOCUMENT_NODE ) {
  88635. nodes.unshift( node );
  88636. node = node.parentNode;
  88637. }
  88638. return nodes;
  88639. }
  88640. /***/ }),
  88641. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/getborderwidths.js":
  88642. /*!***************************************************************************!*\
  88643. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/dom/getborderwidths.js ***!
  88644. \***************************************************************************/
  88645. /*! exports provided: default */
  88646. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  88647. "use strict";
  88648. __webpack_require__.r(__webpack_exports__);
  88649. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return getBorderWidths; });
  88650. /**
  88651. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  88652. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  88653. */
  88654. /**
  88655. * @module utils/dom/getborderwidths
  88656. */
  88657. /**
  88658. * Returns an object containing CSS border widths of a specified HTML element.
  88659. *
  88660. * @param {HTMLElement} element An element which has CSS borders.
  88661. * @returns {Object} An object containing `top`, `left`, `right` and `bottom` properties
  88662. * with numerical values of the `border-[top,left,right,bottom]-width` CSS styles.
  88663. */
  88664. function getBorderWidths( element ) {
  88665. // Call getComputedStyle on the window the element document belongs to.
  88666. const style = element.ownerDocument.defaultView.getComputedStyle( element );
  88667. return {
  88668. top: parseInt( style.borderTopWidth, 10 ),
  88669. right: parseInt( style.borderRightWidth, 10 ),
  88670. bottom: parseInt( style.borderBottomWidth, 10 ),
  88671. left: parseInt( style.borderLeftWidth, 10 )
  88672. };
  88673. }
  88674. /***/ }),
  88675. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/getcommonancestor.js":
  88676. /*!*****************************************************************************!*\
  88677. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/dom/getcommonancestor.js ***!
  88678. \*****************************************************************************/
  88679. /*! exports provided: default */
  88680. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  88681. "use strict";
  88682. __webpack_require__.r(__webpack_exports__);
  88683. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return getCommonAncestor; });
  88684. /* harmony import */ var _getancestors__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./getancestors */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/getancestors.js");
  88685. /**
  88686. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  88687. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  88688. */
  88689. /**
  88690. * @module utils/dom/getcommonancestor
  88691. */
  88692. /**
  88693. * Searches and returns the lowest common ancestor of two given nodes.
  88694. *
  88695. * @param {Node} nodeA First node.
  88696. * @param {Node} nodeB Second node.
  88697. * @returns {Node|DocumentFragment|Document|null} Lowest common ancestor of both nodes or `null` if nodes do not have a common ancestor.
  88698. */
  88699. function getCommonAncestor( nodeA, nodeB ) {
  88700. const ancestorsA = Object(_getancestors__WEBPACK_IMPORTED_MODULE_0__["default"])( nodeA );
  88701. const ancestorsB = Object(_getancestors__WEBPACK_IMPORTED_MODULE_0__["default"])( nodeB );
  88702. let i = 0;
  88703. // It does not matter which array is shorter.
  88704. while ( ancestorsA[ i ] == ancestorsB[ i ] && ancestorsA[ i ] ) {
  88705. i++;
  88706. }
  88707. return i === 0 ? null : ancestorsA[ i - 1 ];
  88708. }
  88709. /***/ }),
  88710. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/getdatafromelement.js":
  88711. /*!******************************************************************************!*\
  88712. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/dom/getdatafromelement.js ***!
  88713. \******************************************************************************/
  88714. /*! exports provided: default */
  88715. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  88716. "use strict";
  88717. __webpack_require__.r(__webpack_exports__);
  88718. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return getDataFromElement; });
  88719. /**
  88720. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  88721. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  88722. */
  88723. /* globals HTMLTextAreaElement */
  88724. /**
  88725. * @module utils/dom/getdatafromelement
  88726. */
  88727. /**
  88728. * Gets data from a given source element.
  88729. *
  88730. * @param {HTMLElement} el The element from which the data will be retrieved.
  88731. * @returns {String} The data string.
  88732. */
  88733. function getDataFromElement( el ) {
  88734. if ( el instanceof HTMLTextAreaElement ) {
  88735. return el.value;
  88736. }
  88737. return el.innerHTML;
  88738. }
  88739. /***/ }),
  88740. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/getpositionedancestor.js":
  88741. /*!*********************************************************************************!*\
  88742. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/dom/getpositionedancestor.js ***!
  88743. \*********************************************************************************/
  88744. /*! exports provided: default */
  88745. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  88746. "use strict";
  88747. __webpack_require__.r(__webpack_exports__);
  88748. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return getPositionedAncestor; });
  88749. /* harmony import */ var _global__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./global */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/global.js");
  88750. /**
  88751. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  88752. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  88753. */
  88754. /**
  88755. * @module utils/dom/getpositionedancestor
  88756. */
  88757. /**
  88758. * For a given element, returns the nearest ancestor element which CSS position is not "static".
  88759. *
  88760. * @param {HTMLElement} element The native DOM element to be checked.
  88761. * @returns {HTMLElement|null}
  88762. */
  88763. function getPositionedAncestor( element ) {
  88764. if ( !element || !element.parentNode ) {
  88765. return null;
  88766. }
  88767. if ( element.offsetParent === _global__WEBPACK_IMPORTED_MODULE_0__["default"].document.body ) {
  88768. return null;
  88769. }
  88770. return element.offsetParent;
  88771. }
  88772. /***/ }),
  88773. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/global.js":
  88774. /*!******************************************************************!*\
  88775. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/dom/global.js ***!
  88776. \******************************************************************/
  88777. /*! exports provided: default */
  88778. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  88779. "use strict";
  88780. __webpack_require__.r(__webpack_exports__);
  88781. /**
  88782. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  88783. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  88784. */
  88785. /* globals window, document */
  88786. /**
  88787. * @module utils/dom/global
  88788. */
  88789. /**
  88790. * A helper (module) giving an access to the global DOM objects such as `window` and
  88791. * `document`. Accessing these objects using this helper allows easy and bulletproof
  88792. * testing, i.e. stubbing native properties:
  88793. *
  88794. * import global from 'ckeditor5/utils/dom/global.js';
  88795. *
  88796. * // This stub will work for any code using global module.
  88797. * testUtils.sinon.stub( global, 'window', {
  88798. * innerWidth: 10000
  88799. * } );
  88800. *
  88801. * console.log( global.window.innerWidth );
  88802. */
  88803. /* harmony default export */ __webpack_exports__["default"] = ({ window, document });
  88804. /***/ }),
  88805. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/indexof.js":
  88806. /*!*******************************************************************!*\
  88807. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/dom/indexof.js ***!
  88808. \*******************************************************************/
  88809. /*! exports provided: default */
  88810. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  88811. "use strict";
  88812. __webpack_require__.r(__webpack_exports__);
  88813. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return indexOf; });
  88814. /**
  88815. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  88816. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  88817. */
  88818. /**
  88819. * @module utils/dom/indexof
  88820. */
  88821. /**
  88822. * Returns index of the node in the parent element.
  88823. *
  88824. * @param {Node} node Node which index is tested.
  88825. * @returns {Number} Index of the node in the parent element. Returns 0 if node has no parent.
  88826. */
  88827. function indexOf( node ) {
  88828. let index = 0;
  88829. while ( node.previousSibling ) {
  88830. node = node.previousSibling;
  88831. index++;
  88832. }
  88833. return index;
  88834. }
  88835. /***/ }),
  88836. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/insertat.js":
  88837. /*!********************************************************************!*\
  88838. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/dom/insertat.js ***!
  88839. \********************************************************************/
  88840. /*! exports provided: default */
  88841. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  88842. "use strict";
  88843. __webpack_require__.r(__webpack_exports__);
  88844. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return insertAt; });
  88845. /**
  88846. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  88847. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  88848. */
  88849. /**
  88850. * @module utils/dom/insertat
  88851. */
  88852. /**
  88853. * Inserts node to the parent at given index.
  88854. *
  88855. * @param {Element} parentElement Parent element.
  88856. * @param {Number} index Insertions index.
  88857. * @param {Node} nodeToInsert Node to insert.
  88858. */
  88859. function insertAt( parentElement, index, nodeToInsert ) {
  88860. parentElement.insertBefore( nodeToInsert, parentElement.childNodes[ index ] || null );
  88861. }
  88862. /***/ }),
  88863. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/isnode.js":
  88864. /*!******************************************************************!*\
  88865. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/dom/isnode.js ***!
  88866. \******************************************************************/
  88867. /*! exports provided: default */
  88868. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  88869. "use strict";
  88870. __webpack_require__.r(__webpack_exports__);
  88871. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return isNode; });
  88872. /**
  88873. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  88874. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  88875. */
  88876. /**
  88877. * @module utils/dom/isnode
  88878. */
  88879. /**
  88880. * Checks if the object is a native DOM Node.
  88881. *
  88882. * @param {*} obj
  88883. * @returns {Boolean}
  88884. */
  88885. function isNode( obj ) {
  88886. if ( obj ) {
  88887. if ( obj.defaultView ) {
  88888. return obj instanceof obj.defaultView.Document;
  88889. } else if ( obj.ownerDocument && obj.ownerDocument.defaultView ) {
  88890. return obj instanceof obj.ownerDocument.defaultView.Node;
  88891. }
  88892. }
  88893. return false;
  88894. }
  88895. /***/ }),
  88896. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/isrange.js":
  88897. /*!*******************************************************************!*\
  88898. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/dom/isrange.js ***!
  88899. \*******************************************************************/
  88900. /*! exports provided: default */
  88901. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  88902. "use strict";
  88903. __webpack_require__.r(__webpack_exports__);
  88904. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return isRange; });
  88905. /**
  88906. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  88907. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  88908. */
  88909. /**
  88910. * @module utils/dom/isrange
  88911. */
  88912. /**
  88913. * Checks if the object is a native DOM Range.
  88914. *
  88915. * @param {*} obj
  88916. * @returns {Boolean}
  88917. */
  88918. function isRange( obj ) {
  88919. return Object.prototype.toString.apply( obj ) == '[object Range]';
  88920. }
  88921. /***/ }),
  88922. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/istext.js":
  88923. /*!******************************************************************!*\
  88924. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/dom/istext.js ***!
  88925. \******************************************************************/
  88926. /*! exports provided: default */
  88927. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  88928. "use strict";
  88929. __webpack_require__.r(__webpack_exports__);
  88930. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return isText; });
  88931. /**
  88932. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  88933. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  88934. */
  88935. /**
  88936. * @module utils/dom/istext
  88937. */
  88938. /**
  88939. * Checks if the object is a native DOM Text node.
  88940. *
  88941. * @param {*} obj
  88942. * @returns {Boolean}
  88943. */
  88944. function isText( obj ) {
  88945. return Object.prototype.toString.call( obj ) == '[object Text]';
  88946. }
  88947. /***/ }),
  88948. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/iswindow.js":
  88949. /*!********************************************************************!*\
  88950. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/dom/iswindow.js ***!
  88951. \********************************************************************/
  88952. /*! exports provided: default */
  88953. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  88954. "use strict";
  88955. __webpack_require__.r(__webpack_exports__);
  88956. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return isWindow; });
  88957. /**
  88958. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  88959. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  88960. */
  88961. /**
  88962. * @module utils/dom/iswindow
  88963. */
  88964. /**
  88965. * Checks if the object is a native DOM Window.
  88966. *
  88967. * @param {*} obj
  88968. * @returns {Boolean}
  88969. */
  88970. function isWindow( obj ) {
  88971. const stringifiedObject = Object.prototype.toString.apply( obj );
  88972. // Returns `true` for the `window` object in browser environments.
  88973. if ( stringifiedObject == '[object Window]' ) {
  88974. return true;
  88975. }
  88976. // Returns `true` for the `window` object in the Electron environment.
  88977. if ( stringifiedObject == '[object global]' ) {
  88978. return true;
  88979. }
  88980. return false;
  88981. }
  88982. /***/ }),
  88983. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/position.js":
  88984. /*!********************************************************************!*\
  88985. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/dom/position.js ***!
  88986. \********************************************************************/
  88987. /*! exports provided: getOptimalPosition */
  88988. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  88989. "use strict";
  88990. __webpack_require__.r(__webpack_exports__);
  88991. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getOptimalPosition", function() { return getOptimalPosition; });
  88992. /* harmony import */ var _global__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./global */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/global.js");
  88993. /* harmony import */ var _rect__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./rect */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/rect.js");
  88994. /* harmony import */ var _getpositionedancestor__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./getpositionedancestor */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/getpositionedancestor.js");
  88995. /* harmony import */ var _getborderwidths__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./getborderwidths */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/getborderwidths.js");
  88996. /* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! lodash-es */ "./node_modules/lodash-es/lodash.js");
  88997. /**
  88998. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  88999. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  89000. */
  89001. /**
  89002. * @module utils/dom/position
  89003. */
  89004. /**
  89005. * Calculates the `position: absolute` coordinates of a given element so it can be positioned with respect to the
  89006. * target in the visually most efficient way, taking various restrictions like viewport or limiter geometry
  89007. * into consideration.
  89008. *
  89009. * // The element which is to be positioned.
  89010. * const element = document.body.querySelector( '#toolbar' );
  89011. *
  89012. * // A target to which the element is positioned relatively.
  89013. * const target = document.body.querySelector( '#container' );
  89014. *
  89015. * // Finding the optimal coordinates for the positioning.
  89016. * const { left, top, name } = getOptimalPosition( {
  89017. * element: element,
  89018. * target: target,
  89019. *
  89020. * // The algorithm will chose among these positions to meet the requirements such
  89021. * // as "limiter" element or "fitInViewport", set below. The positions are considered
  89022. * // in the order of the array.
  89023. * positions: [
  89024. * //
  89025. * // [ Target ]
  89026. * // +-----------------+
  89027. * // | Element |
  89028. * // +-----------------+
  89029. * //
  89030. * targetRect => ( {
  89031. * top: targetRect.bottom,
  89032. * left: targetRect.left,
  89033. * name: 'mySouthEastPosition'
  89034. * } ),
  89035. *
  89036. * //
  89037. * // +-----------------+
  89038. * // | Element |
  89039. * // +-----------------+
  89040. * // [ Target ]
  89041. * //
  89042. * ( targetRect, elementRect ) => ( {
  89043. * top: targetRect.top - elementRect.height,
  89044. * left: targetRect.left,
  89045. * name: 'myNorthEastPosition'
  89046. * } )
  89047. * ],
  89048. *
  89049. * // Find a position such guarantees the element remains within visible boundaries of <body>.
  89050. * limiter: document.body,
  89051. *
  89052. * // Find a position such guarantees the element remains within visible boundaries of the browser viewport.
  89053. * fitInViewport: true
  89054. * } );
  89055. *
  89056. * // The best position which fits into document.body and the viewport. May be useful
  89057. * // to set proper class on the `element`.
  89058. * console.log( name ); // -> "myNorthEastPosition"
  89059. *
  89060. * // Using the absolute coordinates which has been found to position the element
  89061. * // as in the diagram depicting the "myNorthEastPosition" position.
  89062. * element.style.top = top;
  89063. * element.style.left = left;
  89064. *
  89065. * @param {module:utils/dom/position~Options} options Positioning options object.
  89066. * @returns {module:utils/dom/position~Position}
  89067. */
  89068. function getOptimalPosition( { element, target, positions, limiter, fitInViewport } ) {
  89069. // If the {@link module:utils/dom/position~Options#target} is a function, use what it returns.
  89070. // https://github.com/ckeditor/ckeditor5-utils/issues/157
  89071. if ( Object(lodash_es__WEBPACK_IMPORTED_MODULE_4__["isFunction"])( target ) ) {
  89072. target = target();
  89073. }
  89074. // If the {@link module:utils/dom/position~Options#limiter} is a function, use what it returns.
  89075. // https://github.com/ckeditor/ckeditor5-ui/issues/260
  89076. if ( Object(lodash_es__WEBPACK_IMPORTED_MODULE_4__["isFunction"])( limiter ) ) {
  89077. limiter = limiter();
  89078. }
  89079. const positionedElementAncestor = Object(_getpositionedancestor__WEBPACK_IMPORTED_MODULE_2__["default"])( element );
  89080. const elementRect = new _rect__WEBPACK_IMPORTED_MODULE_1__["default"]( element );
  89081. const targetRect = new _rect__WEBPACK_IMPORTED_MODULE_1__["default"]( target );
  89082. let bestPositionRect;
  89083. let bestPositionName;
  89084. // If there are no limits, just grab the very first position and be done with that drama.
  89085. if ( !limiter && !fitInViewport ) {
  89086. [ bestPositionName, bestPositionRect ] = getPositionNameAndRect( positions[ 0 ], targetRect, elementRect );
  89087. } else {
  89088. const limiterRect = limiter && new _rect__WEBPACK_IMPORTED_MODULE_1__["default"]( limiter ).getVisible();
  89089. const viewportRect = fitInViewport && new _rect__WEBPACK_IMPORTED_MODULE_1__["default"]( _global__WEBPACK_IMPORTED_MODULE_0__["default"].window );
  89090. const bestPosition = getBestPositionNameAndRect( positions, { targetRect, elementRect, limiterRect, viewportRect } );
  89091. // If there's no best position found, i.e. when all intersections have no area because
  89092. // rects have no width or height, then just use the first available position.
  89093. [ bestPositionName, bestPositionRect ] = bestPosition || getPositionNameAndRect( positions[ 0 ], targetRect, elementRect );
  89094. }
  89095. let absoluteRectCoordinates = getAbsoluteRectCoordinates( bestPositionRect );
  89096. if ( positionedElementAncestor ) {
  89097. absoluteRectCoordinates = shiftRectCoordinatesDueToPositionedAncestor( absoluteRectCoordinates, positionedElementAncestor );
  89098. }
  89099. return {
  89100. left: absoluteRectCoordinates.left,
  89101. top: absoluteRectCoordinates.top,
  89102. name: bestPositionName
  89103. };
  89104. }
  89105. // For given position function, returns a corresponding `Rect` instance.
  89106. //
  89107. // @private
  89108. // @param {Function} position A function returning {@link module:utils/dom/position~Position}.
  89109. // @param {utils/dom/rect~Rect} targetRect A rect of the target.
  89110. // @param {utils/dom/rect~Rect} elementRect A rect of positioned element.
  89111. // @returns {Array|null} An array containing position name and its Rect (or null if position should be ignored).
  89112. function getPositionNameAndRect( position, targetRect, elementRect ) {
  89113. const positionData = position( targetRect, elementRect );
  89114. if ( !positionData ) {
  89115. return null;
  89116. }
  89117. const { left, top, name } = positionData;
  89118. return [ name, elementRect.clone().moveTo( left, top ) ];
  89119. }
  89120. // For a given array of positioning functions, returns such that provides the best
  89121. // fit of the `elementRect` into the `limiterRect` and `viewportRect`.
  89122. //
  89123. // @private
  89124. //
  89125. // @param {Object} options
  89126. // @param {module:utils/dom/position~Options#positions} positions Functions returning {@link module:utils/dom/position~Position}
  89127. // to be checked, in the order of preference.
  89128. // @param {Object} options
  89129. // @param {utils/dom/rect~Rect} options.targetRect A rect of the {@link module:utils/dom/position~Options#target}.
  89130. // @param {utils/dom/rect~Rect} options.elementRect A rect of positioned {@link module:utils/dom/position~Options#element}.
  89131. // @param {utils/dom/rect~Rect} options.limiterRect A rect of the {@link module:utils/dom/position~Options#limiter}.
  89132. // @param {utils/dom/rect~Rect} options.viewportRect A rect of the viewport.
  89133. //
  89134. // @returns {Array} An array containing the name of the position and it's rect.
  89135. function getBestPositionNameAndRect( positions, options ) {
  89136. const { elementRect, viewportRect } = options;
  89137. // This is when element is fully visible.
  89138. const elementRectArea = elementRect.getArea();
  89139. // Let's calculate intersection areas for positions. It will end early if best match is found.
  89140. const processedPositions = processPositionsToAreas( positions, options );
  89141. // First let's check all positions that fully fit in the viewport.
  89142. if ( viewportRect ) {
  89143. const processedPositionsInViewport = processedPositions.filter( ( { viewportIntersectArea } ) => {
  89144. return viewportIntersectArea === elementRectArea;
  89145. } );
  89146. // Try to find best position from those which fit completely in viewport.
  89147. const bestPositionData = getBestOfProcessedPositions( processedPositionsInViewport, elementRectArea );
  89148. if ( bestPositionData ) {
  89149. return bestPositionData;
  89150. }
  89151. }
  89152. // Either there is no viewportRect or there is no position that fits completely in the viewport.
  89153. return getBestOfProcessedPositions( processedPositions, elementRectArea );
  89154. }
  89155. // For a given array of positioning functions, calculates intersection areas for them.
  89156. //
  89157. // Note: If some position fully fits into the `limiterRect`, it will be returned early, without further consideration
  89158. // of other positions.
  89159. //
  89160. // @private
  89161. //
  89162. // @param {module:utils/dom/position~Options#positions} positions Functions returning {@link module:utils/dom/position~Position}
  89163. // to be checked, in the order of preference.
  89164. // @param {Object} options
  89165. // @param {utils/dom/rect~Rect} options.targetRect A rect of the {@link module:utils/dom/position~Options#target}.
  89166. // @param {utils/dom/rect~Rect} options.elementRect A rect of positioned {@link module:utils/dom/position~Options#element}.
  89167. // @param {utils/dom/rect~Rect} options.limiterRect A rect of the {@link module:utils/dom/position~Options#limiter}.
  89168. // @param {utils/dom/rect~Rect} options.viewportRect A rect of the viewport.
  89169. //
  89170. // @returns {Array.<Object>} Array of positions with calculated intersection areas. Each item is an object containing:
  89171. // * {String} positionName Name of position.
  89172. // * {utils/dom/rect~Rect} positionRect Rect of position.
  89173. // * {Number} limiterIntersectArea Area of intersection of the position with limiter part that is in the viewport.
  89174. // * {Number} viewportIntersectArea Area of intersection of the position with viewport.
  89175. function processPositionsToAreas( positions, { targetRect, elementRect, limiterRect, viewportRect } ) {
  89176. const processedPositions = [];
  89177. // This is when element is fully visible.
  89178. const elementRectArea = elementRect.getArea();
  89179. for ( const position of positions ) {
  89180. const positionData = getPositionNameAndRect( position, targetRect, elementRect );
  89181. if ( !positionData ) {
  89182. continue;
  89183. }
  89184. const [ positionName, positionRect ] = positionData;
  89185. let limiterIntersectArea = 0;
  89186. let viewportIntersectArea = 0;
  89187. if ( limiterRect ) {
  89188. if ( viewportRect ) {
  89189. // Consider only the part of the limiter which is visible in the viewport. So the limiter is getting limited.
  89190. const limiterViewportIntersectRect = limiterRect.getIntersection( viewportRect );
  89191. if ( limiterViewportIntersectRect ) {
  89192. // If the limiter is within the viewport, then check the intersection between that part of the
  89193. // limiter and actual position.
  89194. limiterIntersectArea = limiterViewportIntersectRect.getIntersectionArea( positionRect );
  89195. }
  89196. } else {
  89197. limiterIntersectArea = limiterRect.getIntersectionArea( positionRect );
  89198. }
  89199. }
  89200. if ( viewportRect ) {
  89201. viewportIntersectArea = viewportRect.getIntersectionArea( positionRect );
  89202. }
  89203. const processedPosition = {
  89204. positionName,
  89205. positionRect,
  89206. limiterIntersectArea,
  89207. viewportIntersectArea
  89208. };
  89209. // If a such position is found that element is fully contained by the limiter then, obviously,
  89210. // there will be no better one, so finishing.
  89211. if ( limiterIntersectArea === elementRectArea ) {
  89212. return [ processedPosition ];
  89213. }
  89214. processedPositions.push( processedPosition );
  89215. }
  89216. return processedPositions;
  89217. }
  89218. // For a given array of processed position data (with calculated Rects for positions and intersection areas)
  89219. // returns such that provides the best fit of the `elementRect` into the `limiterRect` and `viewportRect` at the same time.
  89220. //
  89221. // **Note**: It will return early if some position fully fits into the `limiterRect`.
  89222. //
  89223. // @private
  89224. // @param {Array.<Object>} Array of positions with calculated intersection areas (in order of preference).
  89225. // Each item is an object containing:
  89226. //
  89227. // * {String} positionName Name of position.
  89228. // * {utils/dom/rect~Rect} positionRect Rect of position.
  89229. // * {Number} limiterIntersectArea Area of intersection of the position with limiter part that is in the viewport.
  89230. // * {Number} viewportIntersectArea Area of intersection of the position with viewport.
  89231. //
  89232. // @param {Number} elementRectArea Area of positioned {@link module:utils/dom/position~Options#element}.
  89233. // @returns {Array|null} An array containing the name of the position and it's rect, or null if not found.
  89234. function getBestOfProcessedPositions( processedPositions, elementRectArea ) {
  89235. let maxFitFactor = 0;
  89236. let bestPositionRect;
  89237. let bestPositionName;
  89238. for ( const { positionName, positionRect, limiterIntersectArea, viewportIntersectArea } of processedPositions ) {
  89239. // If a such position is found that element is fully container by the limiter then, obviously,
  89240. // there will be no better one, so finishing.
  89241. if ( limiterIntersectArea === elementRectArea ) {
  89242. return [ positionName, positionRect ];
  89243. }
  89244. // To maximize both viewport and limiter intersection areas we use distance on viewportIntersectArea
  89245. // and limiterIntersectArea plane (without sqrt because we are looking for max value).
  89246. const fitFactor = viewportIntersectArea ** 2 + limiterIntersectArea ** 2;
  89247. if ( fitFactor > maxFitFactor ) {
  89248. maxFitFactor = fitFactor;
  89249. bestPositionRect = positionRect;
  89250. bestPositionName = positionName;
  89251. }
  89252. }
  89253. return bestPositionRect ? [ bestPositionName, bestPositionRect ] : null;
  89254. }
  89255. // For a given absolute Rect coordinates object and a positioned element ancestor, it returns an object with
  89256. // new Rect coordinates that make up for the position and the scroll of the ancestor.
  89257. //
  89258. // This is necessary because while Rects (and DOMRects) are relative to the browser's viewport, their coordinates
  89259. // are used in real–life to position elements with `position: absolute`, which are scoped by any positioned
  89260. // (and scrollable) ancestors.
  89261. //
  89262. // @private
  89263. //
  89264. // @param {Object} absoluteRectCoordinates An object with absolute rect coordinates.
  89265. // @param {Object} absoluteRectCoordinates.top
  89266. // @param {Object} absoluteRectCoordinates.left
  89267. // @param {HTMLElement} positionedElementAncestor An ancestor element that should be considered.
  89268. //
  89269. // @returns {Object} An object corresponding to `absoluteRectCoordinates` input but with values shifted
  89270. // to make up for the positioned element ancestor.
  89271. function shiftRectCoordinatesDueToPositionedAncestor( { left, top }, positionedElementAncestor ) {
  89272. const ancestorPosition = getAbsoluteRectCoordinates( new _rect__WEBPACK_IMPORTED_MODULE_1__["default"]( positionedElementAncestor ) );
  89273. const ancestorBorderWidths = Object(_getborderwidths__WEBPACK_IMPORTED_MODULE_3__["default"])( positionedElementAncestor );
  89274. // (https://github.com/ckeditor/ckeditor5-ui-default/issues/126)
  89275. // If there's some positioned ancestor of the panel, then its `Rect` must be taken into
  89276. // consideration. `Rect` is always relative to the viewport while `position: absolute` works
  89277. // with respect to that positioned ancestor.
  89278. left -= ancestorPosition.left;
  89279. top -= ancestorPosition.top;
  89280. // (https://github.com/ckeditor/ckeditor5-utils/issues/139)
  89281. // If there's some positioned ancestor of the panel, not only its position must be taken into
  89282. // consideration (see above) but also its internal scrolls. Scroll have an impact here because `Rect`
  89283. // is relative to the viewport (it doesn't care about scrolling), while `position: absolute`
  89284. // must compensate that scrolling.
  89285. left += positionedElementAncestor.scrollLeft;
  89286. top += positionedElementAncestor.scrollTop;
  89287. // (https://github.com/ckeditor/ckeditor5-utils/issues/139)
  89288. // If there's some positioned ancestor of the panel, then its `Rect` includes its CSS `borderWidth`
  89289. // while `position: absolute` positioning does not consider it.
  89290. // E.g. `{ position: absolute, top: 0, left: 0 }` means upper left corner of the element,
  89291. // not upper-left corner of its border.
  89292. left -= ancestorBorderWidths.left;
  89293. top -= ancestorBorderWidths.top;
  89294. return { left, top };
  89295. }
  89296. // DOMRect (also Rect) works in a scroll–independent geometry but `position: absolute` doesn't.
  89297. // This function converts Rect to `position: absolute` coordinates.
  89298. //
  89299. // @private
  89300. // @param {utils/dom/rect~Rect} rect A rect to be converted.
  89301. // @returns {Object} Object containing `left` and `top` properties, in absolute coordinates.
  89302. function getAbsoluteRectCoordinates( { left, top } ) {
  89303. const { scrollX, scrollY } = _global__WEBPACK_IMPORTED_MODULE_0__["default"].window;
  89304. return {
  89305. left: left + scrollX,
  89306. top: top + scrollY
  89307. };
  89308. }
  89309. /**
  89310. * The `getOptimalPosition()` helper options.
  89311. *
  89312. * @interface module:utils/dom/position~Options
  89313. */
  89314. /**
  89315. * Element that is to be positioned.
  89316. *
  89317. * @member {HTMLElement} #element
  89318. */
  89319. /**
  89320. * Target with respect to which the `element` is to be positioned.
  89321. *
  89322. * @member {HTMLElement|Range|ClientRect|Rect|Function} #target
  89323. */
  89324. /**
  89325. * An array of functions which return {@link module:utils/dom/position~Position} relative
  89326. * to the `target`, in the order of preference.
  89327. *
  89328. * **Note**: If a function returns `null`, it is ignored by the `getOptimalPosition()`.
  89329. *
  89330. * @member {Array.<Function>} #positions
  89331. */
  89332. /**
  89333. * When set, the algorithm will chose position which fits the most in the
  89334. * limiter's bounding rect.
  89335. *
  89336. * @member {HTMLElement|Range|ClientRect|Rect|Function} #limiter
  89337. */
  89338. /**
  89339. * When set, the algorithm will chose such a position which fits `element`
  89340. * the most inside visible viewport.
  89341. *
  89342. * @member {Boolean} #fitInViewport
  89343. */
  89344. /**
  89345. * An object describing a position in `position: absolute` coordinate
  89346. * system, along with position name.
  89347. *
  89348. * @typedef {Object} module:utils/dom/position~Position
  89349. *
  89350. * @property {Number} top Top position offset.
  89351. * @property {Number} left Left position offset.
  89352. * @property {String} name Name of the position.
  89353. */
  89354. /***/ }),
  89355. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/rect.js":
  89356. /*!****************************************************************!*\
  89357. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/dom/rect.js ***!
  89358. \****************************************************************/
  89359. /*! exports provided: default */
  89360. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  89361. "use strict";
  89362. __webpack_require__.r(__webpack_exports__);
  89363. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Rect; });
  89364. /* harmony import */ var _isrange__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isrange */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/isrange.js");
  89365. /* harmony import */ var _iswindow__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./iswindow */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/iswindow.js");
  89366. /* harmony import */ var _getborderwidths__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./getborderwidths */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/getborderwidths.js");
  89367. /* harmony import */ var _istext__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./istext */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/istext.js");
  89368. /* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! lodash-es */ "./node_modules/lodash-es/lodash.js");
  89369. /**
  89370. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  89371. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  89372. */
  89373. /**
  89374. * @module utils/dom/rect
  89375. */
  89376. const rectProperties = [ 'top', 'right', 'bottom', 'left', 'width', 'height' ];
  89377. /**
  89378. * A helper class representing a `ClientRect` object, e.g. value returned by
  89379. * the native `object.getBoundingClientRect()` method. Provides a set of methods
  89380. * to manipulate the rect and compare it against other rect instances.
  89381. */
  89382. class Rect {
  89383. /**
  89384. * Creates an instance of rect.
  89385. *
  89386. * // Rect of an HTMLElement.
  89387. * const rectA = new Rect( document.body );
  89388. *
  89389. * // Rect of a DOM Range.
  89390. * const rectB = new Rect( document.getSelection().getRangeAt( 0 ) );
  89391. *
  89392. * // Rect of a window (web browser viewport).
  89393. * const rectC = new Rect( window );
  89394. *
  89395. * // Rect out of an object.
  89396. * const rectD = new Rect( { top: 0, right: 10, bottom: 10, left: 0, width: 10, height: 10 } );
  89397. *
  89398. * // Rect out of another Rect instance.
  89399. * const rectE = new Rect( rectD );
  89400. *
  89401. * // Rect out of a ClientRect.
  89402. * const rectF = new Rect( document.body.getClientRects().item( 0 ) );
  89403. *
  89404. * **Note**: By default a rect of an HTML element includes its CSS borders and scrollbars (if any)
  89405. * ant the rect of a `window` includes scrollbars too. Use {@link #excludeScrollbarsAndBorders}
  89406. * to get the inner part of the rect.
  89407. *
  89408. * @param {HTMLElement|Range|Window|ClientRect|module:utils/dom/rect~Rect|Object} source A source object to create the rect.
  89409. */
  89410. constructor( source ) {
  89411. const isSourceRange = Object(_isrange__WEBPACK_IMPORTED_MODULE_0__["default"])( source );
  89412. /**
  89413. * The object this rect is for.
  89414. *
  89415. * @protected
  89416. * @readonly
  89417. * @member {HTMLElement|Range|ClientRect|module:utils/dom/rect~Rect|Object} #_source
  89418. */
  89419. Object.defineProperty( this, '_source', {
  89420. // If the source is a Rect instance, copy it's #_source.
  89421. value: source._source || source,
  89422. writable: true,
  89423. enumerable: false
  89424. } );
  89425. if ( Object(lodash_es__WEBPACK_IMPORTED_MODULE_4__["isElement"])( source ) || isSourceRange ) {
  89426. // The `Rect` class depends on `getBoundingClientRect` and `getClientRects` DOM methods. If the source
  89427. // of a rect in an HTML element or a DOM range but it does not belong to any rendered DOM tree, these methods
  89428. // will fail to obtain the geometry and the rect instance makes little sense to the features using it.
  89429. // To get rid of this warning make sure the source passed to the constructor is a descendant of `window.document.body`.
  89430. // @if CK_DEBUG // const sourceNode = isSourceRange ? source.startContainer : source;
  89431. // @if CK_DEBUG // if ( !sourceNode.ownerDocument || !sourceNode.ownerDocument.body.contains( sourceNode ) ) {
  89432. // @if CK_DEBUG // console.warn(
  89433. // @if CK_DEBUG // 'rect-source-not-in-dom: The source of this rect does not belong to any rendered DOM tree.',
  89434. // @if CK_DEBUG // { source } );
  89435. // @if CK_DEBUG // }
  89436. if ( isSourceRange ) {
  89437. const rangeRects = Rect.getDomRangeRects( source );
  89438. copyRectProperties( this, Rect.getBoundingRect( rangeRects ) );
  89439. } else {
  89440. copyRectProperties( this, source.getBoundingClientRect() );
  89441. }
  89442. } else if ( Object(_iswindow__WEBPACK_IMPORTED_MODULE_1__["default"])( source ) ) {
  89443. const { innerWidth, innerHeight } = source;
  89444. copyRectProperties( this, {
  89445. top: 0,
  89446. right: innerWidth,
  89447. bottom: innerHeight,
  89448. left: 0,
  89449. width: innerWidth,
  89450. height: innerHeight
  89451. } );
  89452. } else {
  89453. copyRectProperties( this, source );
  89454. }
  89455. /**
  89456. * The "top" value of the rect.
  89457. *
  89458. * @readonly
  89459. * @member {Number} #top
  89460. */
  89461. /**
  89462. * The "right" value of the rect.
  89463. *
  89464. * @readonly
  89465. * @member {Number} #right
  89466. */
  89467. /**
  89468. * The "bottom" value of the rect.
  89469. *
  89470. * @readonly
  89471. * @member {Number} #bottom
  89472. */
  89473. /**
  89474. * The "left" value of the rect.
  89475. *
  89476. * @readonly
  89477. * @member {Number} #left
  89478. */
  89479. /**
  89480. * The "width" value of the rect.
  89481. *
  89482. * @readonly
  89483. * @member {Number} #width
  89484. */
  89485. /**
  89486. * The "height" value of the rect.
  89487. *
  89488. * @readonly
  89489. * @member {Number} #height
  89490. */
  89491. }
  89492. /**
  89493. * Returns a clone of the rect.
  89494. *
  89495. * @returns {module:utils/dom/rect~Rect} A cloned rect.
  89496. */
  89497. clone() {
  89498. return new Rect( this );
  89499. }
  89500. /**
  89501. * Moves the rect so that its upper–left corner lands in desired `[ x, y ]` location.
  89502. *
  89503. * @param {Number} x Desired horizontal location.
  89504. * @param {Number} y Desired vertical location.
  89505. * @returns {module:utils/dom/rect~Rect} A rect which has been moved.
  89506. */
  89507. moveTo( x, y ) {
  89508. this.top = y;
  89509. this.right = x + this.width;
  89510. this.bottom = y + this.height;
  89511. this.left = x;
  89512. return this;
  89513. }
  89514. /**
  89515. * Moves the rect in–place by a dedicated offset.
  89516. *
  89517. * @param {Number} x A horizontal offset.
  89518. * @param {Number} y A vertical offset
  89519. * @returns {module:utils/dom/rect~Rect} A rect which has been moved.
  89520. */
  89521. moveBy( x, y ) {
  89522. this.top += y;
  89523. this.right += x;
  89524. this.left += x;
  89525. this.bottom += y;
  89526. return this;
  89527. }
  89528. /**
  89529. * Returns a new rect a a result of intersection with another rect.
  89530. *
  89531. * @param {module:utils/dom/rect~Rect} anotherRect
  89532. * @returns {module:utils/dom/rect~Rect}
  89533. */
  89534. getIntersection( anotherRect ) {
  89535. const rect = {
  89536. top: Math.max( this.top, anotherRect.top ),
  89537. right: Math.min( this.right, anotherRect.right ),
  89538. bottom: Math.min( this.bottom, anotherRect.bottom ),
  89539. left: Math.max( this.left, anotherRect.left )
  89540. };
  89541. rect.width = rect.right - rect.left;
  89542. rect.height = rect.bottom - rect.top;
  89543. if ( rect.width < 0 || rect.height < 0 ) {
  89544. return null;
  89545. } else {
  89546. return new Rect( rect );
  89547. }
  89548. }
  89549. /**
  89550. * Returns the area of intersection with another rect.
  89551. *
  89552. * @param {module:utils/dom/rect~Rect} anotherRect [description]
  89553. * @returns {Number} Area of intersection.
  89554. */
  89555. getIntersectionArea( anotherRect ) {
  89556. const rect = this.getIntersection( anotherRect );
  89557. if ( rect ) {
  89558. return rect.getArea();
  89559. } else {
  89560. return 0;
  89561. }
  89562. }
  89563. /**
  89564. * Returns the area of the rect.
  89565. *
  89566. * @returns {Number}
  89567. */
  89568. getArea() {
  89569. return this.width * this.height;
  89570. }
  89571. /**
  89572. * Returns a new rect, a part of the original rect, which is actually visible to the user,
  89573. * e.g. an original rect cropped by parent element rects which have `overflow` set in CSS
  89574. * other than `"visible"`.
  89575. *
  89576. * If there's no such visible rect, which is when the rect is limited by one or many of
  89577. * the ancestors, `null` is returned.
  89578. *
  89579. * @returns {module:utils/dom/rect~Rect|null} A visible rect instance or `null`, if there's none.
  89580. */
  89581. getVisible() {
  89582. const source = this._source;
  89583. let visibleRect = this.clone();
  89584. // There's no ancestor to crop <body> with the overflow.
  89585. if ( !isBody( source ) ) {
  89586. let parent = source.parentNode || source.commonAncestorContainer;
  89587. // Check the ancestors all the way up to the <body>.
  89588. while ( parent && !isBody( parent ) ) {
  89589. const parentRect = new Rect( parent );
  89590. const intersectionRect = visibleRect.getIntersection( parentRect );
  89591. if ( intersectionRect ) {
  89592. if ( intersectionRect.getArea() < visibleRect.getArea() ) {
  89593. // Reduce the visible rect to the intersection.
  89594. visibleRect = intersectionRect;
  89595. }
  89596. } else {
  89597. // There's no intersection, the rect is completely invisible.
  89598. return null;
  89599. }
  89600. parent = parent.parentNode;
  89601. }
  89602. }
  89603. return visibleRect;
  89604. }
  89605. /**
  89606. * Checks if all property values ({@link #top}, {@link #left}, {@link #right},
  89607. * {@link #bottom}, {@link #width} and {@link #height}) are the equal in both rect
  89608. * instances.
  89609. *
  89610. * @param {module:utils/dom/rect~Rect} rect A rect instance to compare with.
  89611. * @returns {Boolean} `true` when Rects are equal. `false` otherwise.
  89612. */
  89613. isEqual( anotherRect ) {
  89614. for ( const prop of rectProperties ) {
  89615. if ( this[ prop ] !== anotherRect[ prop ] ) {
  89616. return false;
  89617. }
  89618. }
  89619. return true;
  89620. }
  89621. /**
  89622. * Checks whether a rect fully contains another rect instance.
  89623. *
  89624. * @param {module:utils/dom/rect~Rect} anotherRect
  89625. * @returns {Boolean} `true` if contains, `false` otherwise.
  89626. */
  89627. contains( anotherRect ) {
  89628. const intersectRect = this.getIntersection( anotherRect );
  89629. return !!( intersectRect && intersectRect.isEqual( anotherRect ) );
  89630. }
  89631. /**
  89632. * Excludes scrollbars and CSS borders from the rect.
  89633. *
  89634. * * Borders are removed when {@link #_source} is an HTML element.
  89635. * * Scrollbars are excluded from HTML elements and the `window`.
  89636. *
  89637. * @returns {module:utils/dom/rect~Rect} A rect which has been updated.
  89638. */
  89639. excludeScrollbarsAndBorders() {
  89640. const source = this._source;
  89641. let scrollBarWidth, scrollBarHeight, direction;
  89642. if ( Object(_iswindow__WEBPACK_IMPORTED_MODULE_1__["default"])( source ) ) {
  89643. scrollBarWidth = source.innerWidth - source.document.documentElement.clientWidth;
  89644. scrollBarHeight = source.innerHeight - source.document.documentElement.clientHeight;
  89645. direction = source.getComputedStyle( source.document.documentElement ).direction;
  89646. } else {
  89647. const borderWidths = Object(_getborderwidths__WEBPACK_IMPORTED_MODULE_2__["default"])( this._source );
  89648. scrollBarWidth = source.offsetWidth - source.clientWidth - borderWidths.left - borderWidths.right;
  89649. scrollBarHeight = source.offsetHeight - source.clientHeight - borderWidths.top - borderWidths.bottom;
  89650. direction = source.ownerDocument.defaultView.getComputedStyle( source ).direction;
  89651. this.left += borderWidths.left;
  89652. this.top += borderWidths.top;
  89653. this.right -= borderWidths.right;
  89654. this.bottom -= borderWidths.bottom;
  89655. this.width = this.right - this.left;
  89656. this.height = this.bottom - this.top;
  89657. }
  89658. this.width -= scrollBarWidth;
  89659. if ( direction === 'ltr' ) {
  89660. this.right -= scrollBarWidth;
  89661. } else {
  89662. this.left += scrollBarWidth;
  89663. }
  89664. this.height -= scrollBarHeight;
  89665. this.bottom -= scrollBarHeight;
  89666. return this;
  89667. }
  89668. /**
  89669. * Returns an array of rects of the given native DOM Range.
  89670. *
  89671. * @param {Range} range A native DOM range.
  89672. * @returns {Array.<module:utils/dom/rect~Rect>} DOM Range rects.
  89673. */
  89674. static getDomRangeRects( range ) {
  89675. const rects = [];
  89676. // Safari does not iterate over ClientRectList using for...of loop.
  89677. const clientRects = Array.from( range.getClientRects() );
  89678. if ( clientRects.length ) {
  89679. for ( const rect of clientRects ) {
  89680. rects.push( new Rect( rect ) );
  89681. }
  89682. }
  89683. // If there's no client rects for the Range, use parent container's bounding rect
  89684. // instead and adjust rect's width to simulate the actual geometry of such range.
  89685. // https://github.com/ckeditor/ckeditor5-utils/issues/153
  89686. // https://github.com/ckeditor/ckeditor5-ui/issues/317
  89687. else {
  89688. let startContainer = range.startContainer;
  89689. if ( Object(_istext__WEBPACK_IMPORTED_MODULE_3__["default"])( startContainer ) ) {
  89690. startContainer = startContainer.parentNode;
  89691. }
  89692. const rect = new Rect( startContainer.getBoundingClientRect() );
  89693. rect.right = rect.left;
  89694. rect.width = 0;
  89695. rects.push( rect );
  89696. }
  89697. return rects;
  89698. }
  89699. /**
  89700. * Returns a bounding rectangle that contains all the given `rects`.
  89701. *
  89702. * @param {Iterable.<module:utils/dom/rect~Rect>} rects A list of rectangles that should be contained in the result rectangle.
  89703. * @returns {module:utils/dom/rect~Rect|null} Bounding rectangle or `null` if no `rects` were given.
  89704. */
  89705. static getBoundingRect( rects ) {
  89706. const boundingRectData = {
  89707. left: Number.POSITIVE_INFINITY,
  89708. top: Number.POSITIVE_INFINITY,
  89709. right: Number.NEGATIVE_INFINITY,
  89710. bottom: Number.NEGATIVE_INFINITY
  89711. };
  89712. let rectangleCount = 0;
  89713. for ( const rect of rects ) {
  89714. rectangleCount++;
  89715. boundingRectData.left = Math.min( boundingRectData.left, rect.left );
  89716. boundingRectData.top = Math.min( boundingRectData.top, rect.top );
  89717. boundingRectData.right = Math.max( boundingRectData.right, rect.right );
  89718. boundingRectData.bottom = Math.max( boundingRectData.bottom, rect.bottom );
  89719. }
  89720. if ( rectangleCount == 0 ) {
  89721. return null;
  89722. }
  89723. boundingRectData.width = boundingRectData.right - boundingRectData.left;
  89724. boundingRectData.height = boundingRectData.bottom - boundingRectData.top;
  89725. return new Rect( boundingRectData );
  89726. }
  89727. }
  89728. // Acquires all the rect properties from the passed source.
  89729. //
  89730. // @private
  89731. // @param {module:utils/dom/rect~Rect} rect
  89732. // @param {ClientRect|module:utils/dom/rect~Rect|Object} source
  89733. function copyRectProperties( rect, source ) {
  89734. for ( const p of rectProperties ) {
  89735. rect[ p ] = source[ p ];
  89736. }
  89737. }
  89738. // Checks if provided object is a <body> HTML element.
  89739. //
  89740. // @private
  89741. // @param {HTMLElement|Range} elementOrRange
  89742. // @returns {Boolean}
  89743. function isBody( elementOrRange ) {
  89744. if ( !Object(lodash_es__WEBPACK_IMPORTED_MODULE_4__["isElement"])( elementOrRange ) ) {
  89745. return false;
  89746. }
  89747. return elementOrRange === elementOrRange.ownerDocument.body;
  89748. }
  89749. /***/ }),
  89750. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/remove.js":
  89751. /*!******************************************************************!*\
  89752. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/dom/remove.js ***!
  89753. \******************************************************************/
  89754. /*! exports provided: default */
  89755. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  89756. "use strict";
  89757. __webpack_require__.r(__webpack_exports__);
  89758. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return remove; });
  89759. /**
  89760. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  89761. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  89762. */
  89763. /**
  89764. * @module utils/dom/remove
  89765. */
  89766. /**
  89767. * Removes given node from parent.
  89768. *
  89769. * @param {Node} node Node to remove.
  89770. */
  89771. function remove( node ) {
  89772. const parent = node.parentNode;
  89773. if ( parent ) {
  89774. parent.removeChild( node );
  89775. }
  89776. }
  89777. /***/ }),
  89778. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/resizeobserver.js":
  89779. /*!**************************************************************************!*\
  89780. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/dom/resizeobserver.js ***!
  89781. \**************************************************************************/
  89782. /*! exports provided: default */
  89783. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  89784. "use strict";
  89785. __webpack_require__.r(__webpack_exports__);
  89786. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ResizeObserver; });
  89787. /* harmony import */ var _mix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../mix */ "./node_modules/@ckeditor/ckeditor5-utils/src/mix.js");
  89788. /* harmony import */ var _global__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./global */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/global.js");
  89789. /* harmony import */ var _rect__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./rect */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/rect.js");
  89790. /* harmony import */ var _emittermixin__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./emittermixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/emittermixin.js");
  89791. /**
  89792. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  89793. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  89794. */
  89795. /**
  89796. * @module utils/dom/resizeobserver
  89797. */
  89798. /* globals setTimeout, clearTimeout */
  89799. const RESIZE_CHECK_INTERVAL = 100;
  89800. /**
  89801. * A helper class which instances allow performing custom actions when native DOM elements are resized.
  89802. *
  89803. * const editableElement = editor.editing.view.getDomRoot();
  89804. *
  89805. * const observer = new ResizeObserver( editableElement, entry => {
  89806. * console.log( 'The editable element has been resized in DOM.' );
  89807. * console.log( entry.target ); // -> editableElement
  89808. * console.log( entry.contentRect.width ); // -> e.g. '423px'
  89809. * } );
  89810. *
  89811. * By default, it uses the [native DOM resize observer](https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver)
  89812. * under the hood and in browsers that do not support the native API yet, a polyfilled observer is
  89813. * used instead.
  89814. */
  89815. class ResizeObserver {
  89816. /**
  89817. * Creates an instance of the `ResizeObserver` class.
  89818. *
  89819. * @param {HTMLElement} element A DOM element that is to be observed for resizing. Note that
  89820. * the element must be visible (i.e. not detached from DOM) for the observer to work.
  89821. * @param {Function} callback A function called when the observed element was resized. It passes
  89822. * the [`ResizeObserverEntry`](https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserverEntry)
  89823. * object with information about the resize event.
  89824. */
  89825. constructor( element, callback ) {
  89826. // **Note**: For the maximum performance, this class ensures only a single instance of the native
  89827. // (or polyfilled) observer is used no matter how many instances of this class were created.
  89828. if ( !ResizeObserver._observerInstance ) {
  89829. ResizeObserver._createObserver();
  89830. }
  89831. /**
  89832. * The element observer by this observer.
  89833. *
  89834. * @readonly
  89835. * @private
  89836. * @member {HTMLElement}
  89837. */
  89838. this._element = element;
  89839. /**
  89840. * The callback executed each time {@link #_element} is resized.
  89841. *
  89842. * @readonly
  89843. * @private
  89844. * @member {Function}
  89845. */
  89846. this._callback = callback;
  89847. ResizeObserver._addElementCallback( element, callback );
  89848. ResizeObserver._observerInstance.observe( element );
  89849. }
  89850. /**
  89851. * Destroys the observer which disables the `callback` passed to the {@link #constructor}.
  89852. */
  89853. destroy() {
  89854. ResizeObserver._deleteElementCallback( this._element, this._callback );
  89855. }
  89856. /**
  89857. * Registers a new resize callback for the DOM element.
  89858. *
  89859. * @private
  89860. * @static
  89861. * @param {HTMLElement} element
  89862. * @param {Function} callback
  89863. */
  89864. static _addElementCallback( element, callback ) {
  89865. if ( !ResizeObserver._elementCallbacks ) {
  89866. ResizeObserver._elementCallbacks = new Map();
  89867. }
  89868. let callbacks = ResizeObserver._elementCallbacks.get( element );
  89869. if ( !callbacks ) {
  89870. callbacks = new Set();
  89871. ResizeObserver._elementCallbacks.set( element, callbacks );
  89872. }
  89873. callbacks.add( callback );
  89874. }
  89875. /**
  89876. * Removes a resize callback from the DOM element. If no callbacks are left
  89877. * for the element, it removes the element from the native observer.
  89878. *
  89879. * @private
  89880. * @static
  89881. * @param {HTMLElement} element
  89882. * @param {Function} callback
  89883. */
  89884. static _deleteElementCallback( element, callback ) {
  89885. const callbacks = ResizeObserver._getElementCallbacks( element );
  89886. // Remove the element callback. Check if exist first in case someone
  89887. // called destroy() twice.
  89888. if ( callbacks ) {
  89889. callbacks.delete( callback );
  89890. // If no callbacks left for the element, also remove the element.
  89891. if ( !callbacks.size ) {
  89892. ResizeObserver._elementCallbacks.delete( element );
  89893. ResizeObserver._observerInstance.unobserve( element );
  89894. }
  89895. }
  89896. if ( ResizeObserver._elementCallbacks && !ResizeObserver._elementCallbacks.size ) {
  89897. ResizeObserver._observerInstance = null;
  89898. ResizeObserver._elementCallbacks = null;
  89899. }
  89900. }
  89901. /**
  89902. * Returns are registered resize callbacks for the DOM element.
  89903. *
  89904. * @private
  89905. * @static
  89906. * @param {HTMLElement} element
  89907. * @returns {Set.<HTMLElement>|null}
  89908. */
  89909. static _getElementCallbacks( element ) {
  89910. if ( !ResizeObserver._elementCallbacks ) {
  89911. return null;
  89912. }
  89913. return ResizeObserver._elementCallbacks.get( element );
  89914. }
  89915. /**
  89916. * Creates the single native observer shared across all `ResizeObserver` instances.
  89917. * If the browser does not support the native API, it creates a polyfill.
  89918. *
  89919. * @private
  89920. * @static
  89921. */
  89922. static _createObserver() {
  89923. let ObserverConstructor;
  89924. // TODO: One day, the `ResizeObserver` API will be supported in all modern web browsers.
  89925. // When it happens, this module will no longer make sense and should be removed and
  89926. // the native implementation should be used across the project to save bytes.
  89927. // Check out https://caniuse.com/#feat=resizeobserver.
  89928. if ( typeof _global__WEBPACK_IMPORTED_MODULE_1__["default"].window.ResizeObserver === 'function' ) {
  89929. ObserverConstructor = _global__WEBPACK_IMPORTED_MODULE_1__["default"].window.ResizeObserver;
  89930. } else {
  89931. ObserverConstructor = ResizeObserverPolyfill;
  89932. }
  89933. ResizeObserver._observerInstance = new ObserverConstructor( entries => {
  89934. for ( const entry of entries ) {
  89935. const callbacks = ResizeObserver._getElementCallbacks( entry.target );
  89936. if ( callbacks ) {
  89937. for ( const callback of callbacks ) {
  89938. callback( entry );
  89939. }
  89940. }
  89941. }
  89942. } );
  89943. }
  89944. }
  89945. /**
  89946. * The single native observer instance (or polyfill in browsers that do not support the API)
  89947. * shared across all {@link module:utils/dom/resizeobserver~ResizeObserver} instances.
  89948. *
  89949. * @static
  89950. * @protected
  89951. * @readonly
  89952. * @property {Object|null} module:utils/dom/resizeobserver~ResizeObserver#_observerInstance
  89953. */
  89954. ResizeObserver._observerInstance = null;
  89955. /**
  89956. * A mapping of native DOM elements and their callbacks shared across all
  89957. * {@link module:utils/dom/resizeobserver~ResizeObserver} instances.
  89958. *
  89959. * @static
  89960. * @private
  89961. * @readonly
  89962. * @property {Map.<HTMLElement,Set>|null} module:utils/dom/resizeobserver~ResizeObserver#_elementCallbacks
  89963. */
  89964. ResizeObserver._elementCallbacks = null;
  89965. /**
  89966. * A polyfill class for the native [`ResizeObserver`](https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver).
  89967. *
  89968. * @private
  89969. * @mixes module:utils/domemittermixin~DomEmitterMixin
  89970. */
  89971. class ResizeObserverPolyfill {
  89972. /**
  89973. * Creates an instance of the {@link module:utils/dom/resizeobserver~ResizeObserverPolyfill} class.
  89974. *
  89975. * It synchronously reacts to resize of the window to check if observed elements' geometry changed.
  89976. *
  89977. * Additionally, the polyfilled observer uses a timeout to check if observed elements' geometry has changed
  89978. * in some other way (dynamic layouts, scrollbars showing up, etc.), so its response can also be asynchronous.
  89979. *
  89980. * @param {Function} callback A function called when any observed element was resized. Refer to the
  89981. * native [`ResizeObserver`](https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver) API to
  89982. * learn more.
  89983. */
  89984. constructor( callback ) {
  89985. /**
  89986. * A function called when any observed {@link #_elements element} was resized.
  89987. *
  89988. * @readonly
  89989. * @protected
  89990. * @member {Function}
  89991. */
  89992. this._callback = callback;
  89993. /**
  89994. * DOM elements currently observed by the observer instance.
  89995. *
  89996. * @readonly
  89997. * @protected
  89998. * @member {Set}
  89999. */
  90000. this._elements = new Set();
  90001. /**
  90002. * Cached DOM {@link #_elements elements} bounding rects to compare to upon the next check.
  90003. *
  90004. * @readonly
  90005. * @protected
  90006. * @member {Map.<HTMLElement,module:utils/dom/rect~Rect>}
  90007. */
  90008. this._previousRects = new Map();
  90009. /**
  90010. * An UID of the current timeout upon which the observed elements rects
  90011. * will be compared to the {@link #_previousRects previous rects} from the past.
  90012. *
  90013. * @readonly
  90014. * @protected
  90015. * @member {Map.<HTMLElement,module:utils/dom/rect~Rect>}
  90016. */
  90017. this._periodicCheckTimeout = null;
  90018. }
  90019. /**
  90020. * Starts observing a DOM element.
  90021. *
  90022. * Learn more in the
  90023. * [native method documentation](https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver/observe).
  90024. *
  90025. * @param {HTMLElement} element
  90026. */
  90027. observe( element ) {
  90028. this._elements.add( element );
  90029. this._checkElementRectsAndExecuteCallback();
  90030. if ( this._elements.size === 1 ) {
  90031. this._startPeriodicCheck();
  90032. }
  90033. }
  90034. /**
  90035. * Stops observing a DOM element.
  90036. *
  90037. * Learn more in the
  90038. * [native method documentation](https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver/unobserve).
  90039. *
  90040. * @param {HTMLElement} element
  90041. */
  90042. unobserve( element ) {
  90043. this._elements.delete( element );
  90044. this._previousRects.delete( element );
  90045. if ( !this._elements.size ) {
  90046. this._stopPeriodicCheck();
  90047. }
  90048. }
  90049. /**
  90050. * When called, the observer calls the {@link #_callback resize callback} for all observed
  90051. * {@link #_elements elements} but also starts checking periodically for changes in the elements' geometry.
  90052. * If some are detected, {@link #_callback resize callback} is called for relevant elements that were resized.
  90053. *
  90054. * @protected
  90055. */
  90056. _startPeriodicCheck() {
  90057. const periodicCheck = () => {
  90058. this._checkElementRectsAndExecuteCallback();
  90059. this._periodicCheckTimeout = setTimeout( periodicCheck, RESIZE_CHECK_INTERVAL );
  90060. };
  90061. this.listenTo( _global__WEBPACK_IMPORTED_MODULE_1__["default"].window, 'resize', () => {
  90062. this._checkElementRectsAndExecuteCallback();
  90063. } );
  90064. this._periodicCheckTimeout = setTimeout( periodicCheck, RESIZE_CHECK_INTERVAL );
  90065. }
  90066. /**
  90067. * Stops checking for changes in all observed {@link #_elements elements} geometry.
  90068. *
  90069. * @protected
  90070. */
  90071. _stopPeriodicCheck() {
  90072. clearTimeout( this._periodicCheckTimeout );
  90073. this.stopListening();
  90074. this._previousRects.clear();
  90075. }
  90076. /**
  90077. * Checks if the geometry of any of the {@link #_elements element} has changed. If so, executes
  90078. * the {@link #_callback resize callback} with element geometry data.
  90079. *
  90080. * @protected
  90081. */
  90082. _checkElementRectsAndExecuteCallback() {
  90083. const entries = [];
  90084. for ( const element of this._elements ) {
  90085. if ( this._hasRectChanged( element ) ) {
  90086. entries.push( {
  90087. target: element,
  90088. contentRect: this._previousRects.get( element )
  90089. } );
  90090. }
  90091. }
  90092. if ( entries.length ) {
  90093. this._callback( entries );
  90094. }
  90095. }
  90096. /**
  90097. * Compares the DOM element geometry to the {@link #_previousRects cached geometry} from the past.
  90098. * Returns `true` if geometry has changed or the element is checked for the first time.
  90099. *
  90100. * @protected
  90101. * @param {HTMLElement} element
  90102. * @returns {Boolean}
  90103. */
  90104. _hasRectChanged( element ) {
  90105. if ( !element.ownerDocument.body.contains( element ) ) {
  90106. return false;
  90107. }
  90108. const currentRect = new _rect__WEBPACK_IMPORTED_MODULE_2__["default"]( element );
  90109. const previousRect = this._previousRects.get( element );
  90110. // The first check should always yield true despite no Previous rect to compare to.
  90111. // The native ResizeObserver does that and... that makes sense. Sort of.
  90112. const hasChanged = !previousRect || !previousRect.isEqual( currentRect );
  90113. this._previousRects.set( element, currentRect );
  90114. return hasChanged;
  90115. }
  90116. }
  90117. Object(_mix__WEBPACK_IMPORTED_MODULE_0__["default"])( ResizeObserverPolyfill, _emittermixin__WEBPACK_IMPORTED_MODULE_3__["default"] );
  90118. /***/ }),
  90119. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/scroll.js":
  90120. /*!******************************************************************!*\
  90121. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/dom/scroll.js ***!
  90122. \******************************************************************/
  90123. /*! exports provided: scrollViewportToShowTarget, scrollAncestorsToShowTarget */
  90124. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  90125. "use strict";
  90126. __webpack_require__.r(__webpack_exports__);
  90127. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "scrollViewportToShowTarget", function() { return scrollViewportToShowTarget; });
  90128. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "scrollAncestorsToShowTarget", function() { return scrollAncestorsToShowTarget; });
  90129. /* harmony import */ var _isrange__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isrange */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/isrange.js");
  90130. /* harmony import */ var _rect__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./rect */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/rect.js");
  90131. /* harmony import */ var _istext__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./istext */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/istext.js");
  90132. /**
  90133. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  90134. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  90135. */
  90136. /**
  90137. * @module utils/dom/scroll
  90138. */
  90139. const utils = {};
  90140. /**
  90141. * Makes any page `HTMLElement` or `Range` (`target`) visible inside the browser viewport.
  90142. * This helper will scroll all `target` ancestors and the web browser viewport to reveal the target to
  90143. * the user. If the `target` is already visible, nothing will happen.
  90144. *
  90145. * @param {HTMLElement|Range} options.target A target, which supposed to become visible to the user.
  90146. * @param {Number} [options.viewportOffset] An offset from the edge of the viewport (in pixels)
  90147. * the `target` will be moved by when the viewport is scrolled. It enhances the user experience
  90148. * by keeping the `target` some distance from the edge of the viewport and thus making it easier to
  90149. * read or edit by the user.
  90150. */
  90151. function scrollViewportToShowTarget( { target, viewportOffset = 0 } ) {
  90152. const targetWindow = getWindow( target );
  90153. let currentWindow = targetWindow;
  90154. let currentFrame = null;
  90155. // Iterate over all windows, starting from target's parent window up to window#top.
  90156. while ( currentWindow ) {
  90157. let firstAncestorToScroll;
  90158. // Let's scroll target's ancestors first to reveal it. Then, once the ancestor scrolls
  90159. // settled down, the algorithm can eventually scroll the viewport of the current window.
  90160. //
  90161. // Note: If the current window is target's **original** window (e.g. the first one),
  90162. // start scrolling the closest parent of the target. If not, scroll the closest parent
  90163. // of an iframe that resides in the current window.
  90164. if ( currentWindow == targetWindow ) {
  90165. firstAncestorToScroll = getParentElement( target );
  90166. } else {
  90167. firstAncestorToScroll = getParentElement( currentFrame );
  90168. }
  90169. // Scroll the target's ancestors first. Once done, scrolling the viewport is easy.
  90170. scrollAncestorsToShowRect( firstAncestorToScroll, () => {
  90171. // Note: If the target does not belong to the current window **directly**,
  90172. // i.e. it resides in an iframe belonging to the window, obtain the target's rect
  90173. // in the coordinates of the current window. By default, a Rect returns geometry
  90174. // relative to the current window's viewport. To make it work in a parent window,
  90175. // it must be shifted.
  90176. return getRectRelativeToWindow( target, currentWindow );
  90177. } );
  90178. // Obtain the rect of the target after it has been scrolled within its ancestors.
  90179. // It's time to scroll the viewport.
  90180. const targetRect = getRectRelativeToWindow( target, currentWindow );
  90181. scrollWindowToShowRect( currentWindow, targetRect, viewportOffset );
  90182. if ( currentWindow.parent != currentWindow ) {
  90183. // Keep the reference to the <iframe> element the "previous current window" was
  90184. // rendered within. It will be useful to re–calculate the rect of the target
  90185. // in the parent window's relative geometry. The target's rect must be shifted
  90186. // by it's iframe's position.
  90187. currentFrame = currentWindow.frameElement;
  90188. currentWindow = currentWindow.parent;
  90189. // If the current window has some parent but frameElement is inaccessible, then they have
  90190. // different domains/ports and, due to security reasons, accessing and scrolling
  90191. // the parent window won't be possible.
  90192. // See https://github.com/ckeditor/ckeditor5/issues/930.
  90193. if ( !currentFrame ) {
  90194. return;
  90195. }
  90196. } else {
  90197. currentWindow = null;
  90198. }
  90199. }
  90200. }
  90201. /**
  90202. * Makes any page `HTMLElement` or `Range` (target) visible within its scrollable ancestors,
  90203. * e.g. if they have `overflow: scroll` CSS style.
  90204. *
  90205. * @param {HTMLElement|Range} target A target, which supposed to become visible to the user.
  90206. */
  90207. function scrollAncestorsToShowTarget( target ) {
  90208. const targetParent = getParentElement( target );
  90209. scrollAncestorsToShowRect( targetParent, () => {
  90210. return new _rect__WEBPACK_IMPORTED_MODULE_1__["default"]( target );
  90211. } );
  90212. }
  90213. // TODO: Using a property value shorthand in the top of the file
  90214. // causes JSDoc to throw errors. See https://github.com/cksource/docs-builder/issues/75.
  90215. Object.assign( utils, {
  90216. scrollViewportToShowTarget,
  90217. scrollAncestorsToShowTarget
  90218. } );
  90219. // Makes a given rect visible within its parent window.
  90220. //
  90221. // Note: Avoid the situation where the caret is still in the viewport, but totally
  90222. // at the edge of it. In such situation, if it moved beyond the viewport in the next
  90223. // action e.g. after paste, the scrolling would move it to the viewportOffset level
  90224. // and it all would look like the caret visually moved up/down:
  90225. //
  90226. // 1.
  90227. // | foo[]
  90228. // | <--- N px of space below the caret
  90229. // +---------------------------------...
  90230. //
  90231. // 2. *paste*
  90232. // 3.
  90233. // |
  90234. // |
  90235. // +-foo-----------------------------...
  90236. // bar[] <--- caret below viewport, scrolling...
  90237. //
  90238. // 4. *scrolling*
  90239. // 5.
  90240. // |
  90241. // | foo
  90242. // | bar[] <--- caret precisely at the edge
  90243. // +---------------------------------...
  90244. //
  90245. // To prevent this, this method checks the rects moved by the viewportOffset to cover
  90246. // the upper/lower edge of the viewport. It makes sure if the action repeats, there's
  90247. // no twitching – it's a purely visual improvement:
  90248. //
  90249. // 5. (after fix)
  90250. // |
  90251. // | foo
  90252. // | bar[]
  90253. // | <--- N px of space below the caret
  90254. // +---------------------------------...
  90255. //
  90256. // @private
  90257. // @param {Window} window A window which is scrolled to reveal the rect.
  90258. // @param {module:utils/dom/rect~Rect} rect A rect which is to be revealed.
  90259. // @param {Number} viewportOffset See scrollViewportToShowTarget.
  90260. function scrollWindowToShowRect( window, rect, viewportOffset ) {
  90261. const targetShiftedDownRect = rect.clone().moveBy( 0, viewportOffset );
  90262. const targetShiftedUpRect = rect.clone().moveBy( 0, -viewportOffset );
  90263. const viewportRect = new _rect__WEBPACK_IMPORTED_MODULE_1__["default"]( window ).excludeScrollbarsAndBorders();
  90264. const rects = [ targetShiftedUpRect, targetShiftedDownRect ];
  90265. if ( !rects.every( rect => viewportRect.contains( rect ) ) ) {
  90266. let { scrollX, scrollY } = window;
  90267. if ( isAbove( targetShiftedUpRect, viewportRect ) ) {
  90268. scrollY -= viewportRect.top - rect.top + viewportOffset;
  90269. } else if ( isBelow( targetShiftedDownRect, viewportRect ) ) {
  90270. scrollY += rect.bottom - viewportRect.bottom + viewportOffset;
  90271. }
  90272. // TODO: Web browsers scroll natively to place the target in the middle
  90273. // of the viewport. It's not a very popular case, though.
  90274. if ( isLeftOf( rect, viewportRect ) ) {
  90275. scrollX -= viewportRect.left - rect.left + viewportOffset;
  90276. } else if ( isRightOf( rect, viewportRect ) ) {
  90277. scrollX += rect.right - viewportRect.right + viewportOffset;
  90278. }
  90279. window.scrollTo( scrollX, scrollY );
  90280. }
  90281. }
  90282. // Recursively scrolls element ancestors to visually reveal a rect.
  90283. //
  90284. // @private
  90285. // @param {HTMLElement} A parent The first ancestors to start scrolling.
  90286. // @param {Function} getRect A function which returns the Rect, which is to be revealed.
  90287. function scrollAncestorsToShowRect( parent, getRect ) {
  90288. const parentWindow = getWindow( parent );
  90289. let parentRect, targetRect;
  90290. while ( parent != parentWindow.document.body ) {
  90291. targetRect = getRect();
  90292. parentRect = new _rect__WEBPACK_IMPORTED_MODULE_1__["default"]( parent ).excludeScrollbarsAndBorders();
  90293. if ( !parentRect.contains( targetRect ) ) {
  90294. if ( isAbove( targetRect, parentRect ) ) {
  90295. parent.scrollTop -= parentRect.top - targetRect.top;
  90296. } else if ( isBelow( targetRect, parentRect ) ) {
  90297. parent.scrollTop += targetRect.bottom - parentRect.bottom;
  90298. }
  90299. if ( isLeftOf( targetRect, parentRect ) ) {
  90300. parent.scrollLeft -= parentRect.left - targetRect.left;
  90301. } else if ( isRightOf( targetRect, parentRect ) ) {
  90302. parent.scrollLeft += targetRect.right - parentRect.right;
  90303. }
  90304. }
  90305. parent = parent.parentNode;
  90306. }
  90307. }
  90308. // Determines if a given `Rect` extends beyond the bottom edge of the second `Rect`.
  90309. //
  90310. // @private
  90311. // @param {module:utils/dom/rect~Rect} firstRect
  90312. // @param {module:utils/dom/rect~Rect} secondRect
  90313. function isBelow( firstRect, secondRect ) {
  90314. return firstRect.bottom > secondRect.bottom;
  90315. }
  90316. // Determines if a given `Rect` extends beyond the top edge of the second `Rect`.
  90317. //
  90318. // @private
  90319. // @param {module:utils/dom/rect~Rect} firstRect
  90320. // @param {module:utils/dom/rect~Rect} secondRect
  90321. function isAbove( firstRect, secondRect ) {
  90322. return firstRect.top < secondRect.top;
  90323. }
  90324. // Determines if a given `Rect` extends beyond the left edge of the second `Rect`.
  90325. //
  90326. // @private
  90327. // @param {module:utils/dom/rect~Rect} firstRect
  90328. // @param {module:utils/dom/rect~Rect} secondRect
  90329. function isLeftOf( firstRect, secondRect ) {
  90330. return firstRect.left < secondRect.left;
  90331. }
  90332. // Determines if a given `Rect` extends beyond the right edge of the second `Rect`.
  90333. //
  90334. // @private
  90335. // @param {module:utils/dom/rect~Rect} firstRect
  90336. // @param {module:utils/dom/rect~Rect} secondRect
  90337. function isRightOf( firstRect, secondRect ) {
  90338. return firstRect.right > secondRect.right;
  90339. }
  90340. // Returns the closest window of an element or range.
  90341. //
  90342. // @private
  90343. // @param {HTMLElement|Range} firstRect
  90344. // @returns {Window}
  90345. function getWindow( elementOrRange ) {
  90346. if ( Object(_isrange__WEBPACK_IMPORTED_MODULE_0__["default"])( elementOrRange ) ) {
  90347. return elementOrRange.startContainer.ownerDocument.defaultView;
  90348. } else {
  90349. return elementOrRange.ownerDocument.defaultView;
  90350. }
  90351. }
  90352. // Returns the closest parent of an element or DOM range.
  90353. //
  90354. // @private
  90355. // @param {HTMLElement|Range} firstRect
  90356. // @returns {HTMLelement}
  90357. function getParentElement( elementOrRange ) {
  90358. if ( Object(_isrange__WEBPACK_IMPORTED_MODULE_0__["default"])( elementOrRange ) ) {
  90359. let parent = elementOrRange.commonAncestorContainer;
  90360. // If a Range is attached to the Text, use the closest element ancestor.
  90361. if ( Object(_istext__WEBPACK_IMPORTED_MODULE_2__["default"])( parent ) ) {
  90362. parent = parent.parentNode;
  90363. }
  90364. return parent;
  90365. } else {
  90366. return elementOrRange.parentNode;
  90367. }
  90368. }
  90369. // Returns the rect of an element or range residing in an iframe.
  90370. // The result rect is relative to the geometry of the passed window instance.
  90371. //
  90372. // @private
  90373. // @param {HTMLElement|Range} target Element or range which rect should be returned.
  90374. // @param {Window} relativeWindow A window the rect should be relative to.
  90375. // @returns {module:utils/dom/rect~Rect}
  90376. function getRectRelativeToWindow( target, relativeWindow ) {
  90377. const targetWindow = getWindow( target );
  90378. const rect = new _rect__WEBPACK_IMPORTED_MODULE_1__["default"]( target );
  90379. if ( targetWindow === relativeWindow ) {
  90380. return rect;
  90381. } else {
  90382. let currentWindow = targetWindow;
  90383. while ( currentWindow != relativeWindow ) {
  90384. const frame = currentWindow.frameElement;
  90385. const frameRect = new _rect__WEBPACK_IMPORTED_MODULE_1__["default"]( frame ).excludeScrollbarsAndBorders();
  90386. rect.moveBy( frameRect.left, frameRect.top );
  90387. currentWindow = currentWindow.parent;
  90388. }
  90389. }
  90390. return rect;
  90391. }
  90392. /***/ }),
  90393. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/setdatainelement.js":
  90394. /*!****************************************************************************!*\
  90395. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/dom/setdatainelement.js ***!
  90396. \****************************************************************************/
  90397. /*! exports provided: default */
  90398. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  90399. "use strict";
  90400. __webpack_require__.r(__webpack_exports__);
  90401. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return setDataInElement; });
  90402. /**
  90403. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  90404. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  90405. */
  90406. /**
  90407. * @module utils/dom/setdatainelement
  90408. */
  90409. /* globals HTMLTextAreaElement */
  90410. /**
  90411. * Sets data in a given element.
  90412. *
  90413. * @param {HTMLElement} el The element in which the data will be set.
  90414. * @param {String} data The data string.
  90415. */
  90416. function setDataInElement( el, data ) {
  90417. if ( el instanceof HTMLTextAreaElement ) {
  90418. el.value = data;
  90419. }
  90420. el.innerHTML = data;
  90421. }
  90422. /***/ }),
  90423. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/tounit.js":
  90424. /*!******************************************************************!*\
  90425. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/dom/tounit.js ***!
  90426. \******************************************************************/
  90427. /*! exports provided: default */
  90428. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  90429. "use strict";
  90430. __webpack_require__.r(__webpack_exports__);
  90431. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return toUnit; });
  90432. /**
  90433. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  90434. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  90435. */
  90436. /**
  90437. * @module utils/dom/tounit
  90438. */
  90439. /**
  90440. * Returns a helper function, which adds a desired trailing
  90441. * `unit` to the passed value.
  90442. *
  90443. * @param {String} unit An unit like "px" or "em".
  90444. * @returns {module:utils/dom/tounit~helper}
  90445. */
  90446. function toUnit( unit ) {
  90447. /**
  90448. * A function, which adds a pre–defined trailing `unit`
  90449. * to the passed `value`.
  90450. *
  90451. * @function helper
  90452. * @param {*} value A value to be given the unit.
  90453. * @returns {String} A value with the trailing unit.
  90454. */
  90455. return value => value + unit;
  90456. }
  90457. /***/ }),
  90458. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/elementreplacer.js":
  90459. /*!***********************************************************************!*\
  90460. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/elementreplacer.js ***!
  90461. \***********************************************************************/
  90462. /*! exports provided: default */
  90463. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  90464. "use strict";
  90465. __webpack_require__.r(__webpack_exports__);
  90466. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ElementReplacer; });
  90467. /**
  90468. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  90469. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  90470. */
  90471. /**
  90472. * @module utils/elementreplacer
  90473. */
  90474. /**
  90475. * Utility class allowing to hide existing HTML elements or replace them with given ones in a way that doesn't remove
  90476. * the original elements from the DOM.
  90477. */
  90478. class ElementReplacer {
  90479. constructor() {
  90480. /**
  90481. * The elements replaced by {@link #replace} and their replacements.
  90482. *
  90483. * @private
  90484. * @member {Array.<Object>}
  90485. */
  90486. this._replacedElements = [];
  90487. }
  90488. /**
  90489. * Hides the `element` and, if specified, inserts the the given element next to it.
  90490. *
  90491. * The effect of this method can be reverted by {@link #restore}.
  90492. *
  90493. * @param {HTMLElement} element The element to replace.
  90494. * @param {HTMLElement} [newElement] The replacement element. If not passed, then the `element` will just be hidden.
  90495. */
  90496. replace( element, newElement ) {
  90497. this._replacedElements.push( { element, newElement } );
  90498. element.style.display = 'none';
  90499. if ( newElement ) {
  90500. element.parentNode.insertBefore( newElement, element.nextSibling );
  90501. }
  90502. }
  90503. /**
  90504. * Restores what {@link #replace} did.
  90505. */
  90506. restore() {
  90507. this._replacedElements.forEach( ( { element, newElement } ) => {
  90508. element.style.display = '';
  90509. if ( newElement ) {
  90510. newElement.remove();
  90511. }
  90512. } );
  90513. this._replacedElements = [];
  90514. }
  90515. }
  90516. /***/ }),
  90517. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/emittermixin.js":
  90518. /*!********************************************************************!*\
  90519. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/emittermixin.js ***!
  90520. \********************************************************************/
  90521. /*! exports provided: default, _getEmitterListenedTo, _setEmitterId, _getEmitterId */
  90522. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  90523. "use strict";
  90524. __webpack_require__.r(__webpack_exports__);
  90525. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_getEmitterListenedTo", function() { return _getEmitterListenedTo; });
  90526. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_setEmitterId", function() { return _setEmitterId; });
  90527. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_getEmitterId", function() { return _getEmitterId; });
  90528. /* harmony import */ var _eventinfo__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./eventinfo */ "./node_modules/@ckeditor/ckeditor5-utils/src/eventinfo.js");
  90529. /* harmony import */ var _uid__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./uid */ "./node_modules/@ckeditor/ckeditor5-utils/src/uid.js");
  90530. /* harmony import */ var _priorities__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./priorities */ "./node_modules/@ckeditor/ckeditor5-utils/src/priorities.js");
  90531. /* harmony import */ var _version__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./version */ "./node_modules/@ckeditor/ckeditor5-utils/src/version.js");
  90532. /* harmony import */ var _ckeditorerror__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  90533. /**
  90534. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  90535. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  90536. */
  90537. /**
  90538. * @module utils/emittermixin
  90539. */
  90540. // To check if component is loaded more than once.
  90541. const _listeningTo = Symbol( 'listeningTo' );
  90542. const _emitterId = Symbol( 'emitterId' );
  90543. /**
  90544. * Mixin that injects the {@link ~Emitter events API} into its host.
  90545. *
  90546. * Read more about the concept of emitters in the:
  90547. * * {@glink framework/guides/architecture/core-editor-architecture#event-system-and-observables Event system and observables}
  90548. * section of the {@glink framework/guides/architecture/core-editor-architecture Core editor architecture} guide.
  90549. * * {@glink framework/guides/deep-dive/event-system Event system} deep dive guide.
  90550. *
  90551. * @mixin EmitterMixin
  90552. * @implements module:utils/emittermixin~Emitter
  90553. */
  90554. const EmitterMixin = {
  90555. /**
  90556. * @inheritDoc
  90557. */
  90558. on( event, callback, options = {} ) {
  90559. this.listenTo( this, event, callback, options );
  90560. },
  90561. /**
  90562. * @inheritDoc
  90563. */
  90564. once( event, callback, options ) {
  90565. let wasFired = false;
  90566. const onceCallback = function( event, ...args ) {
  90567. // Ensure the callback is called only once even if the callback itself leads to re-firing the event
  90568. // (which would call the callback again).
  90569. if ( !wasFired ) {
  90570. wasFired = true;
  90571. // Go off() at the first call.
  90572. event.off();
  90573. // Go with the original callback.
  90574. callback.call( this, event, ...args );
  90575. }
  90576. };
  90577. // Make a similar on() call, simply replacing the callback.
  90578. this.listenTo( this, event, onceCallback, options );
  90579. },
  90580. /**
  90581. * @inheritDoc
  90582. */
  90583. off( event, callback ) {
  90584. this.stopListening( this, event, callback );
  90585. },
  90586. /**
  90587. * @inheritDoc
  90588. */
  90589. listenTo( emitter, event, callback, options = {} ) {
  90590. let emitterInfo, eventCallbacks;
  90591. // _listeningTo contains a list of emitters that this object is listening to.
  90592. // This list has the following format:
  90593. //
  90594. // _listeningTo: {
  90595. // emitterId: {
  90596. // emitter: emitter,
  90597. // callbacks: {
  90598. // event1: [ callback1, callback2, ... ]
  90599. // ....
  90600. // }
  90601. // },
  90602. // ...
  90603. // }
  90604. if ( !this[ _listeningTo ] ) {
  90605. this[ _listeningTo ] = {};
  90606. }
  90607. const emitters = this[ _listeningTo ];
  90608. if ( !_getEmitterId( emitter ) ) {
  90609. _setEmitterId( emitter );
  90610. }
  90611. const emitterId = _getEmitterId( emitter );
  90612. if ( !( emitterInfo = emitters[ emitterId ] ) ) {
  90613. emitterInfo = emitters[ emitterId ] = {
  90614. emitter,
  90615. callbacks: {}
  90616. };
  90617. }
  90618. if ( !( eventCallbacks = emitterInfo.callbacks[ event ] ) ) {
  90619. eventCallbacks = emitterInfo.callbacks[ event ] = [];
  90620. }
  90621. eventCallbacks.push( callback );
  90622. // Finally register the callback to the event.
  90623. addEventListener( this, emitter, event, callback, options );
  90624. },
  90625. /**
  90626. * @inheritDoc
  90627. */
  90628. stopListening( emitter, event, callback ) {
  90629. const emitters = this[ _listeningTo ];
  90630. let emitterId = emitter && _getEmitterId( emitter );
  90631. const emitterInfo = emitters && emitterId && emitters[ emitterId ];
  90632. const eventCallbacks = emitterInfo && event && emitterInfo.callbacks[ event ];
  90633. // Stop if nothing has been listened.
  90634. if ( !emitters || ( emitter && !emitterInfo ) || ( event && !eventCallbacks ) ) {
  90635. return;
  90636. }
  90637. // All params provided. off() that single callback.
  90638. if ( callback ) {
  90639. removeEventListener( this, emitter, event, callback );
  90640. // We must remove callbacks as well in order to prevent memory leaks.
  90641. // See https://github.com/ckeditor/ckeditor5/pull/8480
  90642. const index = eventCallbacks.indexOf( callback );
  90643. if ( index !== -1 ) {
  90644. if ( eventCallbacks.length === 1 ) {
  90645. delete emitterInfo.callbacks[ event ];
  90646. } else {
  90647. removeEventListener( this, emitter, event, callback );
  90648. }
  90649. }
  90650. }
  90651. // Only `emitter` and `event` provided. off() all callbacks for that event.
  90652. else if ( eventCallbacks ) {
  90653. while ( ( callback = eventCallbacks.pop() ) ) {
  90654. removeEventListener( this, emitter, event, callback );
  90655. }
  90656. delete emitterInfo.callbacks[ event ];
  90657. }
  90658. // Only `emitter` provided. off() all events for that emitter.
  90659. else if ( emitterInfo ) {
  90660. for ( event in emitterInfo.callbacks ) {
  90661. this.stopListening( emitter, event );
  90662. }
  90663. delete emitters[ emitterId ];
  90664. }
  90665. // No params provided. off() all emitters.
  90666. else {
  90667. for ( emitterId in emitters ) {
  90668. this.stopListening( emitters[ emitterId ].emitter );
  90669. }
  90670. delete this[ _listeningTo ];
  90671. }
  90672. },
  90673. /**
  90674. * @inheritDoc
  90675. */
  90676. fire( eventOrInfo, ...args ) {
  90677. try {
  90678. const eventInfo = eventOrInfo instanceof _eventinfo__WEBPACK_IMPORTED_MODULE_0__["default"] ? eventOrInfo : new _eventinfo__WEBPACK_IMPORTED_MODULE_0__["default"]( this, eventOrInfo );
  90679. const event = eventInfo.name;
  90680. let callbacks = getCallbacksForEvent( this, event );
  90681. // Record that the event passed this emitter on its path.
  90682. eventInfo.path.push( this );
  90683. // Handle event listener callbacks first.
  90684. if ( callbacks ) {
  90685. // Arguments passed to each callback.
  90686. const callbackArgs = [ eventInfo, ...args ];
  90687. // Copying callbacks array is the easiest and most secure way of preventing infinite loops, when event callbacks
  90688. // are added while processing other callbacks. Previous solution involved adding counters (unique ids) but
  90689. // failed if callbacks were added to the queue before currently processed callback.
  90690. // If this proves to be too inefficient, another method is to change `.on()` so callbacks are stored if same
  90691. // event is currently processed. Then, `.fire()` at the end, would have to add all stored events.
  90692. callbacks = Array.from( callbacks );
  90693. for ( let i = 0; i < callbacks.length; i++ ) {
  90694. callbacks[ i ].callback.apply( this, callbackArgs );
  90695. // Remove the callback from future requests if off() has been called.
  90696. if ( eventInfo.off.called ) {
  90697. // Remove the called mark for the next calls.
  90698. delete eventInfo.off.called;
  90699. this._removeEventListener( event, callbacks[ i ].callback );
  90700. }
  90701. // Do not execute next callbacks if stop() was called.
  90702. if ( eventInfo.stop.called ) {
  90703. break;
  90704. }
  90705. }
  90706. }
  90707. // Delegate event to other emitters if needed.
  90708. if ( this._delegations ) {
  90709. const destinations = this._delegations.get( event );
  90710. const passAllDestinations = this._delegations.get( '*' );
  90711. if ( destinations ) {
  90712. fireDelegatedEvents( destinations, eventInfo, args );
  90713. }
  90714. if ( passAllDestinations ) {
  90715. fireDelegatedEvents( passAllDestinations, eventInfo, args );
  90716. }
  90717. }
  90718. return eventInfo.return;
  90719. } catch ( err ) {
  90720. // @if CK_DEBUG // throw err;
  90721. /* istanbul ignore next */
  90722. _ckeditorerror__WEBPACK_IMPORTED_MODULE_4__["default"].rethrowUnexpectedError( err, this );
  90723. }
  90724. },
  90725. /**
  90726. * @inheritDoc
  90727. */
  90728. delegate( ...events ) {
  90729. return {
  90730. to: ( emitter, nameOrFunction ) => {
  90731. if ( !this._delegations ) {
  90732. this._delegations = new Map();
  90733. }
  90734. // Originally there was a for..of loop which unfortunately caused an error in Babel that didn't allow
  90735. // build an application. See: https://github.com/ckeditor/ckeditor5-react/issues/40.
  90736. events.forEach( eventName => {
  90737. const destinations = this._delegations.get( eventName );
  90738. if ( !destinations ) {
  90739. this._delegations.set( eventName, new Map( [ [ emitter, nameOrFunction ] ] ) );
  90740. } else {
  90741. destinations.set( emitter, nameOrFunction );
  90742. }
  90743. } );
  90744. }
  90745. };
  90746. },
  90747. /**
  90748. * @inheritDoc
  90749. */
  90750. stopDelegating( event, emitter ) {
  90751. if ( !this._delegations ) {
  90752. return;
  90753. }
  90754. if ( !event ) {
  90755. this._delegations.clear();
  90756. } else if ( !emitter ) {
  90757. this._delegations.delete( event );
  90758. } else {
  90759. const destinations = this._delegations.get( event );
  90760. if ( destinations ) {
  90761. destinations.delete( emitter );
  90762. }
  90763. }
  90764. },
  90765. /**
  90766. * @inheritDoc
  90767. */
  90768. _addEventListener( event, callback, options ) {
  90769. createEventNamespace( this, event );
  90770. const lists = getCallbacksListsForNamespace( this, event );
  90771. const priority = _priorities__WEBPACK_IMPORTED_MODULE_2__["default"].get( options.priority );
  90772. const callbackDefinition = {
  90773. callback,
  90774. priority
  90775. };
  90776. // Add the callback to all callbacks list.
  90777. for ( const callbacks of lists ) {
  90778. // Add the callback to the list in the right priority position.
  90779. let added = false;
  90780. for ( let i = 0; i < callbacks.length; i++ ) {
  90781. if ( callbacks[ i ].priority < priority ) {
  90782. callbacks.splice( i, 0, callbackDefinition );
  90783. added = true;
  90784. break;
  90785. }
  90786. }
  90787. // Add at the end, if right place was not found.
  90788. if ( !added ) {
  90789. callbacks.push( callbackDefinition );
  90790. }
  90791. }
  90792. },
  90793. /**
  90794. * @inheritDoc
  90795. */
  90796. _removeEventListener( event, callback ) {
  90797. const lists = getCallbacksListsForNamespace( this, event );
  90798. for ( const callbacks of lists ) {
  90799. for ( let i = 0; i < callbacks.length; i++ ) {
  90800. if ( callbacks[ i ].callback == callback ) {
  90801. // Remove the callback from the list (fixing the next index).
  90802. callbacks.splice( i, 1 );
  90803. i--;
  90804. }
  90805. }
  90806. }
  90807. }
  90808. };
  90809. /* harmony default export */ __webpack_exports__["default"] = (EmitterMixin);
  90810. /**
  90811. * Emitter/listener interface.
  90812. *
  90813. * Can be easily implemented by a class by mixing the {@link module:utils/emittermixin~EmitterMixin} mixin.
  90814. *
  90815. * Read more about the usage of this interface in the:
  90816. * * {@glink framework/guides/architecture/core-editor-architecture#event-system-and-observables Event system and observables}
  90817. * section of the {@glink framework/guides/architecture/core-editor-architecture Core editor architecture} guide.
  90818. * * {@glink framework/guides/deep-dive/event-system Event system} deep dive guide.
  90819. *
  90820. * @interface Emitter
  90821. */
  90822. /**
  90823. * Registers a callback function to be executed when an event is fired.
  90824. *
  90825. * Shorthand for {@link #listenTo `this.listenTo( this, event, callback, options )`} (it makes the emitter
  90826. * listen on itself).
  90827. *
  90828. * @method #on
  90829. * @param {String} event The name of the event.
  90830. * @param {Function} callback The function to be called on event.
  90831. * @param {Object} [options={}] Additional options.
  90832. * @param {module:utils/priorities~PriorityString|Number} [options.priority='normal'] The priority of this event callback. The higher
  90833. * the priority value the sooner the callback will be fired. Events having the same priority are called in the
  90834. * order they were added.
  90835. */
  90836. /**
  90837. * Registers a callback function to be executed on the next time the event is fired only. This is similar to
  90838. * calling {@link #on} followed by {@link #off} in the callback.
  90839. *
  90840. * @method #once
  90841. * @param {String} event The name of the event.
  90842. * @param {Function} callback The function to be called on event.
  90843. * @param {Object} [options={}] Additional options.
  90844. * @param {module:utils/priorities~PriorityString|Number} [options.priority='normal'] The priority of this event callback. The higher
  90845. * the priority value the sooner the callback will be fired. Events having the same priority are called in the
  90846. * order they were added.
  90847. */
  90848. /**
  90849. * Stops executing the callback on the given event.
  90850. * Shorthand for {@link #stopListening `this.stopListening( this, event, callback )`}.
  90851. *
  90852. * @method #off
  90853. * @param {String} event The name of the event.
  90854. * @param {Function} callback The function to stop being called.
  90855. */
  90856. /**
  90857. * Registers a callback function to be executed when an event is fired in a specific (emitter) object.
  90858. *
  90859. * Events can be grouped in namespaces using `:`.
  90860. * When namespaced event is fired, it additionally fires all callbacks for that namespace.
  90861. *
  90862. * // myEmitter.on( ... ) is a shorthand for myEmitter.listenTo( myEmitter, ... ).
  90863. * myEmitter.on( 'myGroup', genericCallback );
  90864. * myEmitter.on( 'myGroup:myEvent', specificCallback );
  90865. *
  90866. * // genericCallback is fired.
  90867. * myEmitter.fire( 'myGroup' );
  90868. * // both genericCallback and specificCallback are fired.
  90869. * myEmitter.fire( 'myGroup:myEvent' );
  90870. * // genericCallback is fired even though there are no callbacks for "foo".
  90871. * myEmitter.fire( 'myGroup:foo' );
  90872. *
  90873. * An event callback can {@link module:utils/eventinfo~EventInfo#stop stop the event} and
  90874. * set the {@link module:utils/eventinfo~EventInfo#return return value} of the {@link #fire} method.
  90875. *
  90876. * @method #listenTo
  90877. * @param {module:utils/emittermixin~Emitter} emitter The object that fires the event.
  90878. * @param {String} event The name of the event.
  90879. * @param {Function} callback The function to be called on event.
  90880. * @param {Object} [options={}] Additional options.
  90881. * @param {module:utils/priorities~PriorityString|Number} [options.priority='normal'] The priority of this event callback. The higher
  90882. * the priority value the sooner the callback will be fired. Events having the same priority are called in the
  90883. * order they were added.
  90884. */
  90885. /**
  90886. * Stops listening for events. It can be used at different levels:
  90887. *
  90888. * * To stop listening to a specific callback.
  90889. * * To stop listening to a specific event.
  90890. * * To stop listening to all events fired by a specific object.
  90891. * * To stop listening to all events fired by all objects.
  90892. *
  90893. * @method #stopListening
  90894. * @param {module:utils/emittermixin~Emitter} [emitter] The object to stop listening to. If omitted, stops it for all objects.
  90895. * @param {String} [event] (Requires the `emitter`) The name of the event to stop listening to. If omitted, stops it
  90896. * for all events from `emitter`.
  90897. * @param {Function} [callback] (Requires the `event`) The function to be removed from the call list for the given
  90898. * `event`.
  90899. */
  90900. /**
  90901. * Fires an event, executing all callbacks registered for it.
  90902. *
  90903. * The first parameter passed to callbacks is an {@link module:utils/eventinfo~EventInfo} object,
  90904. * followed by the optional `args` provided in the `fire()` method call.
  90905. *
  90906. * @method #fire
  90907. * @param {String|module:utils/eventinfo~EventInfo} eventOrInfo The name of the event or `EventInfo` object if event is delegated.
  90908. * @param {...*} [args] Additional arguments to be passed to the callbacks.
  90909. * @returns {*} By default the method returns `undefined`. However, the return value can be changed by listeners
  90910. * through modification of the {@link module:utils/eventinfo~EventInfo#return `evt.return`}'s property (the event info
  90911. * is the first param of every callback).
  90912. */
  90913. /**
  90914. * Delegates selected events to another {@link module:utils/emittermixin~Emitter}. For instance:
  90915. *
  90916. * emitterA.delegate( 'eventX' ).to( emitterB );
  90917. * emitterA.delegate( 'eventX', 'eventY' ).to( emitterC );
  90918. *
  90919. * then `eventX` is delegated (fired by) `emitterB` and `emitterC` along with `data`:
  90920. *
  90921. * emitterA.fire( 'eventX', data );
  90922. *
  90923. * and `eventY` is delegated (fired by) `emitterC` along with `data`:
  90924. *
  90925. * emitterA.fire( 'eventY', data );
  90926. *
  90927. * @method #delegate
  90928. * @param {...String} events Event names that will be delegated to another emitter.
  90929. * @returns {module:utils/emittermixin~EmitterMixinDelegateChain}
  90930. */
  90931. /**
  90932. * Stops delegating events. It can be used at different levels:
  90933. *
  90934. * * To stop delegating all events.
  90935. * * To stop delegating a specific event to all emitters.
  90936. * * To stop delegating a specific event to a specific emitter.
  90937. *
  90938. * @method #stopDelegating
  90939. * @param {String} [event] The name of the event to stop delegating. If omitted, stops it all delegations.
  90940. * @param {module:utils/emittermixin~Emitter} [emitter] (requires `event`) The object to stop delegating a particular event to.
  90941. * If omitted, stops delegation of `event` to all emitters.
  90942. */
  90943. /**
  90944. * Adds callback to emitter for given event.
  90945. *
  90946. * @protected
  90947. * @method #_addEventListener
  90948. * @param {String} event The name of the event.
  90949. * @param {Function} callback The function to be called on event.
  90950. * @param {Object} [options={}] Additional options.
  90951. * @param {module:utils/priorities~PriorityString|Number} [options.priority='normal'] The priority of this event callback. The higher
  90952. * the priority value the sooner the callback will be fired. Events having the same priority are called in the
  90953. * order they were added.
  90954. */
  90955. /**
  90956. * Removes callback from emitter for given event.
  90957. *
  90958. * @protected
  90959. * @method #_removeEventListener
  90960. * @param {String} event The name of the event.
  90961. * @param {Function} callback The function to stop being called.
  90962. */
  90963. /**
  90964. * Checks if `listeningEmitter` listens to an emitter with given `listenedToEmitterId` and if so, returns that emitter.
  90965. * If not, returns `null`.
  90966. *
  90967. * @protected
  90968. * @param {module:utils/emittermixin~Emitter} listeningEmitter An emitter that listens.
  90969. * @param {String} listenedToEmitterId Unique emitter id of emitter listened to.
  90970. * @returns {module:utils/emittermixin~Emitter|null}
  90971. */
  90972. function _getEmitterListenedTo( listeningEmitter, listenedToEmitterId ) {
  90973. if ( listeningEmitter[ _listeningTo ] && listeningEmitter[ _listeningTo ][ listenedToEmitterId ] ) {
  90974. return listeningEmitter[ _listeningTo ][ listenedToEmitterId ].emitter;
  90975. }
  90976. return null;
  90977. }
  90978. /**
  90979. * Sets emitter's unique id.
  90980. *
  90981. * **Note:** `_emitterId` can be set only once.
  90982. *
  90983. * @protected
  90984. * @param {module:utils/emittermixin~Emitter} emitter An emitter for which id will be set.
  90985. * @param {String} [id] Unique id to set. If not passed, random unique id will be set.
  90986. */
  90987. function _setEmitterId( emitter, id ) {
  90988. if ( !emitter[ _emitterId ] ) {
  90989. emitter[ _emitterId ] = id || Object(_uid__WEBPACK_IMPORTED_MODULE_1__["default"])();
  90990. }
  90991. }
  90992. /**
  90993. * Returns emitter's unique id.
  90994. *
  90995. * @protected
  90996. * @param {module:utils/emittermixin~Emitter} emitter An emitter which id will be returned.
  90997. */
  90998. function _getEmitterId( emitter ) {
  90999. return emitter[ _emitterId ];
  91000. }
  91001. // Gets the internal `_events` property of the given object.
  91002. // `_events` property store all lists with callbacks for registered event names.
  91003. // If there were no events registered on the object, empty `_events` object is created.
  91004. function getEvents( source ) {
  91005. if ( !source._events ) {
  91006. Object.defineProperty( source, '_events', {
  91007. value: {}
  91008. } );
  91009. }
  91010. return source._events;
  91011. }
  91012. // Creates event node for generic-specific events relation architecture.
  91013. function makeEventNode() {
  91014. return {
  91015. callbacks: [],
  91016. childEvents: []
  91017. };
  91018. }
  91019. // Creates an architecture for generic-specific events relation.
  91020. // If needed, creates all events for given eventName, i.e. if the first registered event
  91021. // is foo:bar:abc, it will create foo:bar:abc, foo:bar and foo event and tie them together.
  91022. // It also copies callbacks from more generic events to more specific events when
  91023. // specific events are created.
  91024. function createEventNamespace( source, eventName ) {
  91025. const events = getEvents( source );
  91026. // First, check if the event we want to add to the structure already exists.
  91027. if ( events[ eventName ] ) {
  91028. // If it exists, we don't have to do anything.
  91029. return;
  91030. }
  91031. // In other case, we have to create the structure for the event.
  91032. // Note, that we might need to create intermediate events too.
  91033. // I.e. if foo:bar:abc is being registered and we only have foo in the structure,
  91034. // we need to also register foo:bar.
  91035. // Currently processed event name.
  91036. let name = eventName;
  91037. // Name of the event that is a child event for currently processed event.
  91038. let childEventName = null;
  91039. // Array containing all newly created specific events.
  91040. const newEventNodes = [];
  91041. // While loop can't check for ':' index because we have to handle generic events too.
  91042. // In each loop, we truncate event name, going from the most specific name to the generic one.
  91043. // I.e. foo:bar:abc -> foo:bar -> foo.
  91044. while ( name !== '' ) {
  91045. if ( events[ name ] ) {
  91046. // If the currently processed event name is already registered, we can be sure
  91047. // that it already has all the structure created, so we can break the loop here
  91048. // as no more events need to be registered.
  91049. break;
  91050. }
  91051. // If this event is not yet registered, create a new object for it.
  91052. events[ name ] = makeEventNode();
  91053. // Add it to the array with newly created events.
  91054. newEventNodes.push( events[ name ] );
  91055. // Add previously processed event name as a child of this event.
  91056. if ( childEventName ) {
  91057. events[ name ].childEvents.push( childEventName );
  91058. }
  91059. childEventName = name;
  91060. // If `.lastIndexOf()` returns -1, `.substr()` will return '' which will break the loop.
  91061. name = name.substr( 0, name.lastIndexOf( ':' ) );
  91062. }
  91063. if ( name !== '' ) {
  91064. // If name is not empty, we found an already registered event that was a parent of the
  91065. // event we wanted to register.
  91066. // Copy that event's callbacks to newly registered events.
  91067. for ( const node of newEventNodes ) {
  91068. node.callbacks = events[ name ].callbacks.slice();
  91069. }
  91070. // Add last newly created event to the already registered event.
  91071. events[ name ].childEvents.push( childEventName );
  91072. }
  91073. }
  91074. // Gets an array containing callbacks list for a given event and it's more specific events.
  91075. // I.e. if given event is foo:bar and there is also foo:bar:abc event registered, this will
  91076. // return callback list of foo:bar and foo:bar:abc (but not foo).
  91077. function getCallbacksListsForNamespace( source, eventName ) {
  91078. const eventNode = getEvents( source )[ eventName ];
  91079. if ( !eventNode ) {
  91080. return [];
  91081. }
  91082. let callbacksLists = [ eventNode.callbacks ];
  91083. for ( let i = 0; i < eventNode.childEvents.length; i++ ) {
  91084. const childCallbacksLists = getCallbacksListsForNamespace( source, eventNode.childEvents[ i ] );
  91085. callbacksLists = callbacksLists.concat( childCallbacksLists );
  91086. }
  91087. return callbacksLists;
  91088. }
  91089. // Get the list of callbacks for a given event, but only if there any callbacks have been registered.
  91090. // If there are no callbacks registered for given event, it checks if this is a specific event and looks
  91091. // for callbacks for it's more generic version.
  91092. function getCallbacksForEvent( source, eventName ) {
  91093. let event;
  91094. if ( !source._events || !( event = source._events[ eventName ] ) || !event.callbacks.length ) {
  91095. // There are no callbacks registered for specified eventName.
  91096. // But this could be a specific-type event that is in a namespace.
  91097. if ( eventName.indexOf( ':' ) > -1 ) {
  91098. // If the eventName is specific, try to find callback lists for more generic event.
  91099. return getCallbacksForEvent( source, eventName.substr( 0, eventName.lastIndexOf( ':' ) ) );
  91100. } else {
  91101. // If this is a top-level generic event, return null;
  91102. return null;
  91103. }
  91104. }
  91105. return event.callbacks;
  91106. }
  91107. // Fires delegated events for given map of destinations.
  91108. //
  91109. // @private
  91110. // * @param {Map.<utils.Emitter>} destinations A map containing
  91111. // `[ {@link module:utils/emittermixin~Emitter}, "event name" ]` pair destinations.
  91112. // * @param {utils.EventInfo} eventInfo The original event info object.
  91113. // * @param {Array.<*>} fireArgs Arguments the original event was fired with.
  91114. function fireDelegatedEvents( destinations, eventInfo, fireArgs ) {
  91115. for ( let [ emitter, name ] of destinations ) {
  91116. if ( !name ) {
  91117. name = eventInfo.name;
  91118. } else if ( typeof name == 'function' ) {
  91119. name = name( eventInfo.name );
  91120. }
  91121. const delegatedInfo = new _eventinfo__WEBPACK_IMPORTED_MODULE_0__["default"]( eventInfo.source, name );
  91122. delegatedInfo.path = [ ...eventInfo.path ];
  91123. emitter.fire( delegatedInfo, ...fireArgs );
  91124. }
  91125. }
  91126. // Helper for registering event callback on the emitter.
  91127. function addEventListener( listener, emitter, event, callback, options ) {
  91128. if ( emitter._addEventListener ) {
  91129. emitter._addEventListener( event, callback, options );
  91130. } else {
  91131. // Allow listening on objects that do not implement Emitter interface.
  91132. // This is needed in some tests that are using mocks instead of the real objects with EmitterMixin mixed.
  91133. listener._addEventListener.call( emitter, event, callback, options );
  91134. }
  91135. }
  91136. // Helper for removing event callback from the emitter.
  91137. function removeEventListener( listener, emitter, event, callback ) {
  91138. if ( emitter._removeEventListener ) {
  91139. emitter._removeEventListener( event, callback );
  91140. } else {
  91141. // Allow listening on objects that do not implement Emitter interface.
  91142. // This is needed in some tests that are using mocks instead of the real objects with EmitterMixin mixed.
  91143. listener._removeEventListener.call( emitter, event, callback );
  91144. }
  91145. }
  91146. /**
  91147. * The return value of {@link ~EmitterMixin#delegate}.
  91148. *
  91149. * @interface module:utils/emittermixin~EmitterMixinDelegateChain
  91150. */
  91151. /**
  91152. * Selects destination for {@link module:utils/emittermixin~EmitterMixin#delegate} events.
  91153. *
  91154. * @method #to
  91155. * @param {module:utils/emittermixin~Emitter} emitter An `EmitterMixin` instance which is the destination for delegated events.
  91156. * @param {String|Function} [nameOrFunction] A custom event name or function which converts the original name string.
  91157. */
  91158. /***/ }),
  91159. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/env.js":
  91160. /*!***********************************************************!*\
  91161. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/env.js ***!
  91162. \***********************************************************/
  91163. /*! exports provided: default, isMac, isGecko, isSafari, isAndroid, isBlink, isRegExpUnicodePropertySupported */
  91164. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  91165. "use strict";
  91166. __webpack_require__.r(__webpack_exports__);
  91167. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isMac", function() { return isMac; });
  91168. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isGecko", function() { return isGecko; });
  91169. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isSafari", function() { return isSafari; });
  91170. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isAndroid", function() { return isAndroid; });
  91171. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isBlink", function() { return isBlink; });
  91172. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isRegExpUnicodePropertySupported", function() { return isRegExpUnicodePropertySupported; });
  91173. /**
  91174. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  91175. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  91176. */
  91177. /* globals navigator:false */
  91178. /**
  91179. * @module utils/env
  91180. */
  91181. const userAgent = navigator.userAgent.toLowerCase();
  91182. /**
  91183. * A namespace containing environment and browser information.
  91184. *
  91185. * @namespace
  91186. */
  91187. const env = {
  91188. /**
  91189. * Indicates that the application is running on Macintosh.
  91190. *
  91191. * @static
  91192. * @type {Boolean}
  91193. */
  91194. isMac: isMac( userAgent ),
  91195. /**
  91196. * Indicates that the application is running in Firefox (Gecko).
  91197. *
  91198. * @static
  91199. * @type {Boolean}
  91200. */
  91201. isGecko: isGecko( userAgent ),
  91202. /**
  91203. * Indicates that the application is running in Safari.
  91204. *
  91205. * @static
  91206. * @type {Boolean}
  91207. */
  91208. isSafari: isSafari( userAgent ),
  91209. /**
  91210. * Indicates that the application is running on Android mobile device.
  91211. *
  91212. * @static
  91213. * @type {Boolean}
  91214. */
  91215. isAndroid: isAndroid( userAgent ),
  91216. /**
  91217. * Indicates that the application is running in a browser using the Blink engine.
  91218. *
  91219. * @static
  91220. * @type {Boolean}
  91221. */
  91222. isBlink: isBlink( userAgent ),
  91223. /**
  91224. * Environment features information.
  91225. *
  91226. * @memberOf module:utils/env~env
  91227. * @namespace
  91228. */
  91229. features: {
  91230. /**
  91231. * Indicates that the environment supports ES2018 Unicode property escapes — like `\p{P}` or `\p{L}`.
  91232. * More information about unicode properties might be found
  91233. * [in Unicode Standard Annex #44](https://www.unicode.org/reports/tr44/#GC_Values_Table).
  91234. *
  91235. * @type {Boolean}
  91236. */
  91237. isRegExpUnicodePropertySupported: isRegExpUnicodePropertySupported()
  91238. }
  91239. };
  91240. /* harmony default export */ __webpack_exports__["default"] = (env);
  91241. /**
  91242. * Checks if User Agent represented by the string is running on Macintosh.
  91243. *
  91244. * @param {String} userAgent **Lowercase** `navigator.userAgent` string.
  91245. * @returns {Boolean} Whether User Agent is running on Macintosh or not.
  91246. */
  91247. function isMac( userAgent ) {
  91248. return userAgent.indexOf( 'macintosh' ) > -1;
  91249. }
  91250. /**
  91251. * Checks if User Agent represented by the string is Firefox (Gecko).
  91252. *
  91253. * @param {String} userAgent **Lowercase** `navigator.userAgent` string.
  91254. * @returns {Boolean} Whether User Agent is Firefox or not.
  91255. */
  91256. function isGecko( userAgent ) {
  91257. return !!userAgent.match( /gecko\/\d+/ );
  91258. }
  91259. /**
  91260. * Checks if User Agent represented by the string is Safari.
  91261. *
  91262. * @param {String} userAgent **Lowercase** `navigator.userAgent` string.
  91263. * @returns {Boolean} Whether User Agent is Safari or not.
  91264. */
  91265. function isSafari( userAgent ) {
  91266. return userAgent.indexOf( ' applewebkit/' ) > -1 && userAgent.indexOf( 'chrome' ) === -1;
  91267. }
  91268. /**
  91269. * Checks if User Agent represented by the string is Android mobile device.
  91270. *
  91271. * @param {String} userAgent **Lowercase** `navigator.userAgent` string.
  91272. * @returns {Boolean} Whether User Agent is Safari or not.
  91273. */
  91274. function isAndroid( userAgent ) {
  91275. return userAgent.indexOf( 'android' ) > -1;
  91276. }
  91277. /**
  91278. * Checks if User Agent represented by the string is Blink engine.
  91279. *
  91280. * @param {String} userAgent **Lowercase** `navigator.userAgent` string.
  91281. * @returns {Boolean} Whether User Agent is Blink engine or not.
  91282. */
  91283. function isBlink( userAgent ) {
  91284. // The Edge browser before switching to the Blink engine used to report itself as Chrome (and "Edge/")
  91285. // but after switching to the Blink it replaced "Edge/" with "Edg/".
  91286. return userAgent.indexOf( 'chrome/' ) > -1 && userAgent.indexOf( 'edge/' ) < 0;
  91287. }
  91288. /**
  91289. * Checks if the current environment supports ES2018 Unicode properties like `\p{P}` or `\p{L}`.
  91290. * More information about unicode properties might be found
  91291. * [in Unicode Standard Annex #44](https://www.unicode.org/reports/tr44/#GC_Values_Table).
  91292. *
  91293. * @returns {Boolean}
  91294. */
  91295. function isRegExpUnicodePropertySupported() {
  91296. let isSupported = false;
  91297. // Feature detection for Unicode properties. Added in ES2018. Currently Firefox does not support it.
  91298. // See https://github.com/ckeditor/ckeditor5-mention/issues/44#issuecomment-487002174.
  91299. try {
  91300. // Usage of regular expression literal cause error during build (ckeditor/ckeditor5-dev#534).
  91301. isSupported = 'ć'.search( new RegExp( '[\\p{L}]', 'u' ) ) === 0;
  91302. } catch ( error ) {
  91303. // Firefox throws a SyntaxError when the group is unsupported.
  91304. }
  91305. return isSupported;
  91306. }
  91307. /***/ }),
  91308. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/eventinfo.js":
  91309. /*!*****************************************************************!*\
  91310. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/eventinfo.js ***!
  91311. \*****************************************************************/
  91312. /*! exports provided: default */
  91313. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  91314. "use strict";
  91315. __webpack_require__.r(__webpack_exports__);
  91316. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return EventInfo; });
  91317. /* harmony import */ var _spy__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./spy */ "./node_modules/@ckeditor/ckeditor5-utils/src/spy.js");
  91318. /**
  91319. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  91320. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  91321. */
  91322. /**
  91323. * @module utils/eventinfo
  91324. */
  91325. /**
  91326. * The event object passed to event callbacks. It is used to provide information about the event as well as a tool to
  91327. * manipulate it.
  91328. */
  91329. class EventInfo {
  91330. /**
  91331. * @param {Object} source The emitter.
  91332. * @param {String} name The event name.
  91333. */
  91334. constructor( source, name ) {
  91335. /**
  91336. * The object that fired the event.
  91337. *
  91338. * @readonly
  91339. * @member {Object}
  91340. */
  91341. this.source = source;
  91342. /**
  91343. * The event name.
  91344. *
  91345. * @readonly
  91346. * @member {String}
  91347. */
  91348. this.name = name;
  91349. /**
  91350. * Path this event has followed. See {@link module:utils/emittermixin~EmitterMixin#delegate}.
  91351. *
  91352. * @readonly
  91353. * @member {Array.<Object>}
  91354. */
  91355. this.path = [];
  91356. // The following methods are defined in the constructor because they must be re-created per instance.
  91357. /**
  91358. * Stops the event emitter to call further callbacks for this event interaction.
  91359. *
  91360. * @method #stop
  91361. */
  91362. this.stop = Object(_spy__WEBPACK_IMPORTED_MODULE_0__["default"])();
  91363. /**
  91364. * Removes the current callback from future interactions of this event.
  91365. *
  91366. * @method #off
  91367. */
  91368. this.off = Object(_spy__WEBPACK_IMPORTED_MODULE_0__["default"])();
  91369. /**
  91370. * The value which will be returned by {@link module:utils/emittermixin~EmitterMixin#fire}.
  91371. *
  91372. * It's `undefined` by default and can be changed by an event listener:
  91373. *
  91374. * dataController.fire( 'getSelectedContent', ( evt ) => {
  91375. * // This listener will make `dataController.fire( 'getSelectedContent' )`
  91376. * // always return an empty DocumentFragment.
  91377. * evt.return = new DocumentFragment();
  91378. *
  91379. * // Make sure no other listeners are executed.
  91380. * evt.stop();
  91381. * } );
  91382. *
  91383. * @member #return
  91384. */
  91385. }
  91386. }
  91387. /***/ }),
  91388. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/fastdiff.js":
  91389. /*!****************************************************************!*\
  91390. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/fastdiff.js ***!
  91391. \****************************************************************/
  91392. /*! exports provided: default */
  91393. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  91394. "use strict";
  91395. __webpack_require__.r(__webpack_exports__);
  91396. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return fastDiff; });
  91397. /**
  91398. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  91399. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  91400. */
  91401. /**
  91402. * @module utils/fastdiff
  91403. */
  91404. /**
  91405. * Finds positions of the first and last change in the given string/array and generates a set of changes:
  91406. *
  91407. * fastDiff( '12a', '12xyza' );
  91408. * // [ { index: 2, type: 'insert', values: [ 'x', 'y', 'z' ] } ]
  91409. *
  91410. * fastDiff( '12a', '12aa' );
  91411. * // [ { index: 3, type: 'insert', values: [ 'a' ] } ]
  91412. *
  91413. * fastDiff( '12xyza', '12a' );
  91414. * // [ { index: 2, type: 'delete', howMany: 3 } ]
  91415. *
  91416. * fastDiff( [ '1', '2', 'a', 'a' ], [ '1', '2', 'a' ] );
  91417. * // [ { index: 3, type: 'delete', howMany: 1 } ]
  91418. *
  91419. * fastDiff( [ '1', '2', 'a', 'b', 'c', '3' ], [ '2', 'a', 'b' ] );
  91420. * // [ { index: 0, type: 'insert', values: [ '2', 'a', 'b' ] }, { index: 3, type: 'delete', howMany: 6 } ]
  91421. *
  91422. * Passed arrays can contain any type of data, however to compare them correctly custom comparator function
  91423. * should be passed as a third parameter:
  91424. *
  91425. * fastDiff( [ { value: 1 }, { value: 2 } ], [ { value: 1 }, { value: 3 } ], ( a, b ) => {
  91426. * return a.value === b.value;
  91427. * } );
  91428. * // [ { index: 1, type: 'insert', values: [ { value: 3 } ] }, { index: 2, type: 'delete', howMany: 1 } ]
  91429. *
  91430. * The resulted set of changes can be applied to the input in order to transform it into the output, for example:
  91431. *
  91432. * let input = '12abc3';
  91433. * const output = '2ab';
  91434. * const changes = fastDiff( input, output );
  91435. *
  91436. * changes.forEach( change => {
  91437. * if ( change.type == 'insert' ) {
  91438. * input = input.substring( 0, change.index ) + change.values.join( '' ) + input.substring( change.index );
  91439. * } else if ( change.type == 'delete' ) {
  91440. * input = input.substring( 0, change.index ) + input.substring( change.index + change.howMany );
  91441. * }
  91442. * } );
  91443. *
  91444. * // input equals output now
  91445. *
  91446. * or in case of arrays:
  91447. *
  91448. * let input = [ '1', '2', 'a', 'b', 'c', '3' ];
  91449. * const output = [ '2', 'a', 'b' ];
  91450. * const changes = fastDiff( input, output );
  91451. *
  91452. * changes.forEach( change => {
  91453. * if ( change.type == 'insert' ) {
  91454. * input = input.slice( 0, change.index ).concat( change.values, input.slice( change.index ) );
  91455. * } else if ( change.type == 'delete' ) {
  91456. * input = input.slice( 0, change.index ).concat( input.slice( change.index + change.howMany ) );
  91457. * }
  91458. * } );
  91459. *
  91460. * // input equals output now
  91461. *
  91462. * By passing `true` as the fourth parameter (`atomicChanges`) the output of this function will become compatible with
  91463. * the {@link module:utils/diff~diff `diff()`} function:
  91464. *
  91465. * fastDiff( '12a', '12xyza' );
  91466. * // [ 'equal', 'equal', 'insert', 'insert', 'insert', 'equal' ]
  91467. *
  91468. * The default output format of this function is compatible with the output format of
  91469. * {@link module:utils/difftochanges~diffToChanges `diffToChanges()`}. The `diffToChanges()` input format is, in turn,
  91470. * compatible with the output of {@link module:utils/diff~diff `diff()`}:
  91471. *
  91472. * const a = '1234';
  91473. * const b = '12xyz34';
  91474. *
  91475. * // Both calls will return the same results (grouped changes format).
  91476. * fastDiff( a, b );
  91477. * diffToChanges( diff( a, b ) );
  91478. *
  91479. * // Again, both calls will return the same results (atomic changes format).
  91480. * fastDiff( a, b, null, true );
  91481. * diff( a, b );
  91482. *
  91483. *
  91484. * @param {Array|String} a Input array or string.
  91485. * @param {Array|String} b Input array or string.
  91486. * @param {Function} [cmp] Optional function used to compare array values, by default `===` (strict equal operator) is used.
  91487. * @param {Boolean} [atomicChanges=false] Whether an array of `inset|delete|equal` operations should
  91488. * be returned instead of changes set. This makes this function compatible with {@link module:utils/diff~diff `diff()`}.
  91489. * @returns {Array} Array of changes.
  91490. */
  91491. function fastDiff( a, b, cmp, atomicChanges = false ) {
  91492. // Set the comparator function.
  91493. cmp = cmp || function( a, b ) {
  91494. return a === b;
  91495. };
  91496. // Convert the string (or any array-like object - eg. NodeList) to an array by using the slice() method because,
  91497. // unlike Array.from(), it returns array of UTF-16 code units instead of the code points of a string.
  91498. // One code point might be a surrogate pair of two code units. All text offsets are expected to be in code units.
  91499. // See ckeditor/ckeditor5#3147.
  91500. //
  91501. // We need to make sure here that fastDiff() works identical to diff().
  91502. if ( !Array.isArray( a ) ) {
  91503. a = Array.prototype.slice.call( a );
  91504. }
  91505. if ( !Array.isArray( b ) ) {
  91506. b = Array.prototype.slice.call( b );
  91507. }
  91508. // Find first and last change.
  91509. const changeIndexes = findChangeBoundaryIndexes( a, b, cmp );
  91510. // Transform into changes array.
  91511. return atomicChanges ? changeIndexesToAtomicChanges( changeIndexes, b.length ) : changeIndexesToChanges( b, changeIndexes );
  91512. }
  91513. // Finds position of the first and last change in the given arrays. For example:
  91514. //
  91515. // const indexes = findChangeBoundaryIndexes( [ '1', '2', '3', '4' ], [ '1', '3', '4', '2', '4' ] );
  91516. // console.log( indexes ); // { firstIndex: 1, lastIndexOld: 3, lastIndexNew: 4 }
  91517. //
  91518. // 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`.
  91519. // Based on such indexes, array with `insert`/`delete` operations which allows transforming first value into the second one
  91520. // can be generated.
  91521. //
  91522. // @param {Array} arr1
  91523. // @param {Array} arr2
  91524. // @param {Function} cmp Comparator function.
  91525. // @returns {Object}
  91526. // @returns {Number} return.firstIndex Index of the first change in both values (always the same for both).
  91527. // @returns {Number} result.lastIndexOld Index of the last common value in `arr1`.
  91528. // @returns {Number} result.lastIndexNew Index of the last common value in `arr2`.
  91529. function findChangeBoundaryIndexes( arr1, arr2, cmp ) {
  91530. // Find the first difference between passed values.
  91531. const firstIndex = findFirstDifferenceIndex( arr1, arr2, cmp );
  91532. // If arrays are equal return -1 indexes object.
  91533. if ( firstIndex === -1 ) {
  91534. return { firstIndex: -1, lastIndexOld: -1, lastIndexNew: -1 };
  91535. }
  91536. // Remove the common part of each value and reverse them to make it simpler to find the last difference between them.
  91537. const oldArrayReversed = cutAndReverse( arr1, firstIndex );
  91538. const newArrayReversed = cutAndReverse( arr2, firstIndex );
  91539. // Find the first difference between reversed values.
  91540. // It should be treated as "how many elements from the end the last difference occurred".
  91541. //
  91542. // For example:
  91543. //
  91544. // initial -> after cut -> reversed:
  91545. // oldValue: '321ba' -> '21ba' -> 'ab12'
  91546. // newValue: '31xba' -> '1xba' -> 'abx1'
  91547. // lastIndex: -> 2
  91548. //
  91549. // So the last change occurred two characters from the end of the arrays.
  91550. const lastIndex = findFirstDifferenceIndex( oldArrayReversed, newArrayReversed, cmp );
  91551. // Use `lastIndex` to calculate proper offset, starting from the beginning (`lastIndex` kind of starts from the end).
  91552. const lastIndexOld = arr1.length - lastIndex;
  91553. const lastIndexNew = arr2.length - lastIndex;
  91554. return { firstIndex, lastIndexOld, lastIndexNew };
  91555. }
  91556. // Returns a first index on which given arrays differ. If both arrays are the same, -1 is returned.
  91557. //
  91558. // @param {Array} arr1
  91559. // @param {Array} arr2
  91560. // @param {Function} cmp Comparator function.
  91561. // @returns {Number}
  91562. function findFirstDifferenceIndex( arr1, arr2, cmp ) {
  91563. for ( let i = 0; i < Math.max( arr1.length, arr2.length ); i++ ) {
  91564. if ( arr1[ i ] === undefined || arr2[ i ] === undefined || !cmp( arr1[ i ], arr2[ i ] ) ) {
  91565. return i;
  91566. }
  91567. }
  91568. return -1; // Return -1 if arrays are equal.
  91569. }
  91570. // Returns a copy of the given array with `howMany` elements removed starting from the beginning and in reversed order.
  91571. //
  91572. // @param {Array} arr Array to be processed.
  91573. // @param {Number} howMany How many elements from array beginning to remove.
  91574. // @returns {Array} Shortened and reversed array.
  91575. function cutAndReverse( arr, howMany ) {
  91576. return arr.slice( howMany ).reverse();
  91577. }
  91578. // Generates changes array based on change indexes from `findChangeBoundaryIndexes` function. This function will
  91579. // generate array with 0 (no changes), 1 (deletion or insertion) or 2 records (insertion and deletion).
  91580. //
  91581. // @param {Array} newArray New array for which change indexes were calculated.
  91582. // @param {Object} changeIndexes Change indexes object from `findChangeBoundaryIndexes` function.
  91583. // @returns {Array.<Object>} Array of changes compatible with {@link module:utils/difftochanges~diffToChanges} format.
  91584. function changeIndexesToChanges( newArray, changeIndexes ) {
  91585. const result = [];
  91586. const { firstIndex, lastIndexOld, lastIndexNew } = changeIndexes;
  91587. // Order operations as 'insert', 'delete' array to keep compatibility with {@link module:utils/difftochanges~diffToChanges}
  91588. // in most cases. However, 'diffToChanges' does not stick to any order so in some cases
  91589. // (for example replacing '12345' with 'abcd') it will generate 'delete', 'insert' order.
  91590. if ( lastIndexNew - firstIndex > 0 ) {
  91591. result.push( {
  91592. index: firstIndex,
  91593. type: 'insert',
  91594. values: newArray.slice( firstIndex, lastIndexNew )
  91595. } );
  91596. }
  91597. if ( lastIndexOld - firstIndex > 0 ) {
  91598. result.push( {
  91599. index: firstIndex + ( lastIndexNew - firstIndex ), // Increase index of what was inserted.
  91600. type: 'delete',
  91601. howMany: lastIndexOld - firstIndex
  91602. } );
  91603. }
  91604. return result;
  91605. }
  91606. // Generates array with set `equal|insert|delete` operations based on change indexes from `findChangeBoundaryIndexes` function.
  91607. //
  91608. // @param {Object} changeIndexes Change indexes object from `findChangeBoundaryIndexes` function.
  91609. // @param {Number} newLength Length of the new array on which `findChangeBoundaryIndexes` calculated change indexes.
  91610. // @returns {Array.<String>} Array of changes compatible with {@link module:utils/diff~diff} format.
  91611. function changeIndexesToAtomicChanges( changeIndexes, newLength ) {
  91612. const { firstIndex, lastIndexOld, lastIndexNew } = changeIndexes;
  91613. // No changes.
  91614. if ( firstIndex === -1 ) {
  91615. return Array( newLength ).fill( 'equal' );
  91616. }
  91617. let result = [];
  91618. if ( firstIndex > 0 ) {
  91619. result = result.concat( Array( firstIndex ).fill( 'equal' ) );
  91620. }
  91621. if ( lastIndexNew - firstIndex > 0 ) {
  91622. result = result.concat( Array( lastIndexNew - firstIndex ).fill( 'insert' ) );
  91623. }
  91624. if ( lastIndexOld - firstIndex > 0 ) {
  91625. result = result.concat( Array( lastIndexOld - firstIndex ).fill( 'delete' ) );
  91626. }
  91627. if ( lastIndexNew < newLength ) {
  91628. result = result.concat( Array( newLength - lastIndexNew ).fill( 'equal' ) );
  91629. }
  91630. return result;
  91631. }
  91632. /***/ }),
  91633. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/first.js":
  91634. /*!*************************************************************!*\
  91635. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/first.js ***!
  91636. \*************************************************************/
  91637. /*! exports provided: default */
  91638. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  91639. "use strict";
  91640. __webpack_require__.r(__webpack_exports__);
  91641. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return first; });
  91642. /**
  91643. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  91644. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  91645. */
  91646. /**
  91647. * @module utils/first
  91648. */
  91649. /**
  91650. * Returns first item of the given `iterable`.
  91651. *
  91652. * @param {Iterable.<*>} iterable
  91653. * @returns {*}
  91654. */
  91655. function first( iterable ) {
  91656. const iteratorItem = iterable.next();
  91657. if ( iteratorItem.done ) {
  91658. return null;
  91659. }
  91660. return iteratorItem.value;
  91661. }
  91662. /***/ }),
  91663. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/focustracker.js":
  91664. /*!********************************************************************!*\
  91665. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/focustracker.js ***!
  91666. \********************************************************************/
  91667. /*! exports provided: default */
  91668. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  91669. "use strict";
  91670. __webpack_require__.r(__webpack_exports__);
  91671. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return FocusTracker; });
  91672. /* harmony import */ var _dom_emittermixin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./dom/emittermixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/emittermixin.js");
  91673. /* harmony import */ var _observablemixin__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./observablemixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/observablemixin.js");
  91674. /* harmony import */ var _ckeditorerror__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  91675. /* harmony import */ var _mix__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./mix */ "./node_modules/@ckeditor/ckeditor5-utils/src/mix.js");
  91676. /**
  91677. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  91678. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  91679. */
  91680. /* global setTimeout, clearTimeout */
  91681. /**
  91682. * @module utils/focustracker
  91683. */
  91684. /**
  91685. * Allows observing a group of `HTMLElement`s whether at least one of them is focused.
  91686. *
  91687. * Used by the {@link module:core/editor/editor~Editor} in order to track whether the focus is still within the application,
  91688. * or were used outside of its UI.
  91689. *
  91690. * **Note** `focus` and `blur` listeners use event capturing, so it is only needed to register wrapper `HTMLElement`
  91691. * which contain other `focusable` elements. But note that this wrapper element has to be focusable too
  91692. * (have e.g. `tabindex="-1"`).
  91693. *
  91694. * Check out the {@glink framework/guides/deep-dive/ui/focus-tracking "Deep dive into focus tracking" guide} to learn more.
  91695. *
  91696. * @mixes module:utils/dom/emittermixin~EmitterMixin
  91697. * @mixes module:utils/observablemixin~ObservableMixin
  91698. */
  91699. class FocusTracker {
  91700. constructor() {
  91701. /**
  91702. * True when one of the registered elements is focused.
  91703. *
  91704. * @readonly
  91705. * @observable
  91706. * @member {Boolean} #isFocused
  91707. */
  91708. this.set( 'isFocused', false );
  91709. /**
  91710. * The currently focused element.
  91711. *
  91712. * While {@link #isFocused `isFocused`} remains `true`, the focus can
  91713. * move between different UI elements. This property tracks those
  91714. * elements and tells which one is currently focused.
  91715. *
  91716. * @readonly
  91717. * @observable
  91718. * @member {HTMLElement|null} #focusedElement
  91719. */
  91720. this.set( 'focusedElement', null );
  91721. /**
  91722. * List of registered elements.
  91723. *
  91724. * @private
  91725. * @member {Set.<HTMLElement>}
  91726. */
  91727. this._elements = new Set();
  91728. /**
  91729. * Event loop timeout.
  91730. *
  91731. * @private
  91732. * @member {Number}
  91733. */
  91734. this._nextEventLoopTimeout = null;
  91735. }
  91736. /**
  91737. * Starts tracking the specified element.
  91738. *
  91739. * @param {HTMLElement} element
  91740. */
  91741. add( element ) {
  91742. if ( this._elements.has( element ) ) {
  91743. /**
  91744. * This element is already tracked by {@link module:utils/focustracker~FocusTracker}.
  91745. *
  91746. * @error focustracker-add-element-already-exist
  91747. */
  91748. throw new _ckeditorerror__WEBPACK_IMPORTED_MODULE_2__["default"]( 'focustracker-add-element-already-exist', this );
  91749. }
  91750. this.listenTo( element, 'focus', () => this._focus( element ), { useCapture: true } );
  91751. this.listenTo( element, 'blur', () => this._blur(), { useCapture: true } );
  91752. this._elements.add( element );
  91753. }
  91754. /**
  91755. * Stops tracking the specified element and stops listening on this element.
  91756. *
  91757. * @param {HTMLElement} element
  91758. */
  91759. remove( element ) {
  91760. if ( element === this.focusedElement ) {
  91761. this._blur( element );
  91762. }
  91763. if ( this._elements.has( element ) ) {
  91764. this.stopListening( element );
  91765. this._elements.delete( element );
  91766. }
  91767. }
  91768. /**
  91769. * Destroys the focus tracker by:
  91770. * - Disabling all event listeners attached to tracked elements.
  91771. * - Removing all tracked elements that were previously added.
  91772. */
  91773. destroy() {
  91774. this.stopListening();
  91775. }
  91776. /**
  91777. * Stores currently focused element and set {#isFocused} as `true`.
  91778. *
  91779. * @private
  91780. * @param {HTMLElement} element Element which has been focused.
  91781. */
  91782. _focus( element ) {
  91783. clearTimeout( this._nextEventLoopTimeout );
  91784. this.focusedElement = element;
  91785. this.isFocused = true;
  91786. }
  91787. /**
  91788. * Clears currently focused element and set {@link #isFocused} as `false`.
  91789. * This method uses `setTimeout` to change order of fires `blur` and `focus` events.
  91790. *
  91791. * @private
  91792. * @fires blur
  91793. */
  91794. _blur() {
  91795. clearTimeout( this._nextEventLoopTimeout );
  91796. this._nextEventLoopTimeout = setTimeout( () => {
  91797. this.focusedElement = null;
  91798. this.isFocused = false;
  91799. }, 0 );
  91800. }
  91801. /**
  91802. * @event focus
  91803. */
  91804. /**
  91805. * @event blur
  91806. */
  91807. }
  91808. Object(_mix__WEBPACK_IMPORTED_MODULE_3__["default"])( FocusTracker, _dom_emittermixin__WEBPACK_IMPORTED_MODULE_0__["default"] );
  91809. Object(_mix__WEBPACK_IMPORTED_MODULE_3__["default"])( FocusTracker, _observablemixin__WEBPACK_IMPORTED_MODULE_1__["default"] );
  91810. /***/ }),
  91811. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/index.js":
  91812. /*!*************************************************************!*\
  91813. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/index.js ***!
  91814. \*************************************************************/
  91815. /*! exports provided: env, diff, mix, EmitterMixin, ObservableMixin, CKEditorError, logError, logWarning, ElementReplacer, createElement, DomEmitterMixin, global, getDataFromElement, Rect, ResizeObserver, setDataInElement, toUnit, keyCodes, getCode, parseKeystroke, getEnvKeystrokeText, isArrowKeyCode, getLocalizedArrowKeyCodeDirection, isForwardArrowKeyCode, getLanguageDirection, Locale, Collection, first, FocusTracker, KeystrokeHandler, toArray, toMap, priorities, uid, version */
  91816. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  91817. "use strict";
  91818. __webpack_require__.r(__webpack_exports__);
  91819. /* harmony import */ var _env__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./env */ "./node_modules/@ckeditor/ckeditor5-utils/src/env.js");
  91820. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "env", function() { return _env__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  91821. /* harmony import */ var _diff__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./diff */ "./node_modules/@ckeditor/ckeditor5-utils/src/diff.js");
  91822. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "diff", function() { return _diff__WEBPACK_IMPORTED_MODULE_1__["default"]; });
  91823. /* harmony import */ var _mix__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./mix */ "./node_modules/@ckeditor/ckeditor5-utils/src/mix.js");
  91824. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "mix", function() { return _mix__WEBPACK_IMPORTED_MODULE_2__["default"]; });
  91825. /* harmony import */ var _emittermixin__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./emittermixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/emittermixin.js");
  91826. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "EmitterMixin", function() { return _emittermixin__WEBPACK_IMPORTED_MODULE_3__["default"]; });
  91827. /* harmony import */ var _observablemixin__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./observablemixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/observablemixin.js");
  91828. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ObservableMixin", function() { return _observablemixin__WEBPACK_IMPORTED_MODULE_4__["default"]; });
  91829. /* harmony import */ var _ckeditorerror__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  91830. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CKEditorError", function() { return _ckeditorerror__WEBPACK_IMPORTED_MODULE_5__["default"]; });
  91831. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "logError", function() { return _ckeditorerror__WEBPACK_IMPORTED_MODULE_5__["logError"]; });
  91832. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "logWarning", function() { return _ckeditorerror__WEBPACK_IMPORTED_MODULE_5__["logWarning"]; });
  91833. /* harmony import */ var _elementreplacer__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./elementreplacer */ "./node_modules/@ckeditor/ckeditor5-utils/src/elementreplacer.js");
  91834. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ElementReplacer", function() { return _elementreplacer__WEBPACK_IMPORTED_MODULE_6__["default"]; });
  91835. /* harmony import */ var _dom_createelement__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./dom/createelement */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/createelement.js");
  91836. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "createElement", function() { return _dom_createelement__WEBPACK_IMPORTED_MODULE_7__["default"]; });
  91837. /* harmony import */ var _dom_emittermixin__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./dom/emittermixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/emittermixin.js");
  91838. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DomEmitterMixin", function() { return _dom_emittermixin__WEBPACK_IMPORTED_MODULE_8__["default"]; });
  91839. /* harmony import */ var _dom_global__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./dom/global */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/global.js");
  91840. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "global", function() { return _dom_global__WEBPACK_IMPORTED_MODULE_9__["default"]; });
  91841. /* harmony import */ var _dom_getdatafromelement__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./dom/getdatafromelement */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/getdatafromelement.js");
  91842. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getDataFromElement", function() { return _dom_getdatafromelement__WEBPACK_IMPORTED_MODULE_10__["default"]; });
  91843. /* harmony import */ var _dom_rect__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./dom/rect */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/rect.js");
  91844. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Rect", function() { return _dom_rect__WEBPACK_IMPORTED_MODULE_11__["default"]; });
  91845. /* harmony import */ var _dom_resizeobserver__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./dom/resizeobserver */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/resizeobserver.js");
  91846. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ResizeObserver", function() { return _dom_resizeobserver__WEBPACK_IMPORTED_MODULE_12__["default"]; });
  91847. /* harmony import */ var _dom_setdatainelement__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./dom/setdatainelement */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/setdatainelement.js");
  91848. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "setDataInElement", function() { return _dom_setdatainelement__WEBPACK_IMPORTED_MODULE_13__["default"]; });
  91849. /* harmony import */ var _dom_tounit__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./dom/tounit */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/tounit.js");
  91850. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toUnit", function() { return _dom_tounit__WEBPACK_IMPORTED_MODULE_14__["default"]; });
  91851. /* harmony import */ var _keyboard__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./keyboard */ "./node_modules/@ckeditor/ckeditor5-utils/src/keyboard.js");
  91852. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "keyCodes", function() { return _keyboard__WEBPACK_IMPORTED_MODULE_15__["keyCodes"]; });
  91853. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getCode", function() { return _keyboard__WEBPACK_IMPORTED_MODULE_15__["getCode"]; });
  91854. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "parseKeystroke", function() { return _keyboard__WEBPACK_IMPORTED_MODULE_15__["parseKeystroke"]; });
  91855. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getEnvKeystrokeText", function() { return _keyboard__WEBPACK_IMPORTED_MODULE_15__["getEnvKeystrokeText"]; });
  91856. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isArrowKeyCode", function() { return _keyboard__WEBPACK_IMPORTED_MODULE_15__["isArrowKeyCode"]; });
  91857. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getLocalizedArrowKeyCodeDirection", function() { return _keyboard__WEBPACK_IMPORTED_MODULE_15__["getLocalizedArrowKeyCodeDirection"]; });
  91858. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isForwardArrowKeyCode", function() { return _keyboard__WEBPACK_IMPORTED_MODULE_15__["isForwardArrowKeyCode"]; });
  91859. /* harmony import */ var _language__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./language */ "./node_modules/@ckeditor/ckeditor5-utils/src/language.js");
  91860. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getLanguageDirection", function() { return _language__WEBPACK_IMPORTED_MODULE_16__["getLanguageDirection"]; });
  91861. /* harmony import */ var _locale__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./locale */ "./node_modules/@ckeditor/ckeditor5-utils/src/locale.js");
  91862. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Locale", function() { return _locale__WEBPACK_IMPORTED_MODULE_17__["default"]; });
  91863. /* harmony import */ var _collection__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./collection */ "./node_modules/@ckeditor/ckeditor5-utils/src/collection.js");
  91864. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Collection", function() { return _collection__WEBPACK_IMPORTED_MODULE_18__["default"]; });
  91865. /* harmony import */ var _first__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./first */ "./node_modules/@ckeditor/ckeditor5-utils/src/first.js");
  91866. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "first", function() { return _first__WEBPACK_IMPORTED_MODULE_19__["default"]; });
  91867. /* harmony import */ var _focustracker__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./focustracker */ "./node_modules/@ckeditor/ckeditor5-utils/src/focustracker.js");
  91868. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FocusTracker", function() { return _focustracker__WEBPACK_IMPORTED_MODULE_20__["default"]; });
  91869. /* harmony import */ var _keystrokehandler__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./keystrokehandler */ "./node_modules/@ckeditor/ckeditor5-utils/src/keystrokehandler.js");
  91870. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "KeystrokeHandler", function() { return _keystrokehandler__WEBPACK_IMPORTED_MODULE_21__["default"]; });
  91871. /* harmony import */ var _toarray__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./toarray */ "./node_modules/@ckeditor/ckeditor5-utils/src/toarray.js");
  91872. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toArray", function() { return _toarray__WEBPACK_IMPORTED_MODULE_22__["default"]; });
  91873. /* harmony import */ var _tomap__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./tomap */ "./node_modules/@ckeditor/ckeditor5-utils/src/tomap.js");
  91874. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toMap", function() { return _tomap__WEBPACK_IMPORTED_MODULE_23__["default"]; });
  91875. /* harmony import */ var _priorities__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./priorities */ "./node_modules/@ckeditor/ckeditor5-utils/src/priorities.js");
  91876. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "priorities", function() { return _priorities__WEBPACK_IMPORTED_MODULE_24__["default"]; });
  91877. /* harmony import */ var _uid__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./uid */ "./node_modules/@ckeditor/ckeditor5-utils/src/uid.js");
  91878. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "uid", function() { return _uid__WEBPACK_IMPORTED_MODULE_25__["default"]; });
  91879. /* harmony import */ var _version__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./version */ "./node_modules/@ckeditor/ckeditor5-utils/src/version.js");
  91880. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "version", function() { return _version__WEBPACK_IMPORTED_MODULE_26__["default"]; });
  91881. /**
  91882. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  91883. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  91884. */
  91885. /**
  91886. * @module utils
  91887. */
  91888. /***/ }),
  91889. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/isiterable.js":
  91890. /*!******************************************************************!*\
  91891. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/isiterable.js ***!
  91892. \******************************************************************/
  91893. /*! exports provided: default */
  91894. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  91895. "use strict";
  91896. __webpack_require__.r(__webpack_exports__);
  91897. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return isIterable; });
  91898. /**
  91899. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  91900. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  91901. */
  91902. /**
  91903. * @module utils/isiterable
  91904. */
  91905. /**
  91906. * Checks if value implements iterator interface.
  91907. *
  91908. * @param {*} value The value to check.
  91909. * @returns {Boolean} True if value implements iterator interface.
  91910. */
  91911. function isIterable( value ) {
  91912. return !!( value && value[ Symbol.iterator ] );
  91913. }
  91914. /***/ }),
  91915. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/keyboard.js":
  91916. /*!****************************************************************!*\
  91917. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/keyboard.js ***!
  91918. \****************************************************************/
  91919. /*! exports provided: keyCodes, getCode, parseKeystroke, getEnvKeystrokeText, isArrowKeyCode, getLocalizedArrowKeyCodeDirection, isForwardArrowKeyCode */
  91920. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  91921. "use strict";
  91922. __webpack_require__.r(__webpack_exports__);
  91923. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "keyCodes", function() { return keyCodes; });
  91924. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getCode", function() { return getCode; });
  91925. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "parseKeystroke", function() { return parseKeystroke; });
  91926. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getEnvKeystrokeText", function() { return getEnvKeystrokeText; });
  91927. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isArrowKeyCode", function() { return isArrowKeyCode; });
  91928. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getLocalizedArrowKeyCodeDirection", function() { return getLocalizedArrowKeyCodeDirection; });
  91929. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isForwardArrowKeyCode", function() { return isForwardArrowKeyCode; });
  91930. /* harmony import */ var _ckeditorerror__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  91931. /* harmony import */ var _env__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./env */ "./node_modules/@ckeditor/ckeditor5-utils/src/env.js");
  91932. /**
  91933. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  91934. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  91935. */
  91936. /**
  91937. * A set of utilities related to keyboard support.
  91938. *
  91939. * @module utils/keyboard
  91940. */
  91941. const modifiersToGlyphsMac = {
  91942. ctrl: '⌃',
  91943. cmd: '⌘',
  91944. alt: '⌥',
  91945. shift: '⇧'
  91946. };
  91947. const modifiersToGlyphsNonMac = {
  91948. ctrl: 'Ctrl+',
  91949. alt: 'Alt+',
  91950. shift: 'Shift+'
  91951. };
  91952. /**
  91953. * An object with `keyName => keyCode` pairs for a set of known keys.
  91954. *
  91955. * Contains:
  91956. *
  91957. * * `a-z`,
  91958. * * `0-9`,
  91959. * * `f1-f12`,
  91960. * * `arrow(left|up|right|bottom)`,
  91961. * * `backspace`, `delete`, `enter`, `esc`, `tab`,
  91962. * * `ctrl`, `cmd`, `shift`, `alt`.
  91963. */
  91964. const keyCodes = generateKnownKeyCodes();
  91965. const keyCodeNames = Object.fromEntries(
  91966. Object.entries( keyCodes ).map( ( [ name, code ] ) => [ code, name.charAt( 0 ).toUpperCase() + name.slice( 1 ) ] )
  91967. );
  91968. /**
  91969. * Converts a key name or {@link module:utils/keyboard~KeystrokeInfo keystroke info} into a key code.
  91970. *
  91971. * Note: Key names are matched with {@link module:utils/keyboard~keyCodes} in a case-insensitive way.
  91972. *
  91973. * @param {String|module:utils/keyboard~KeystrokeInfo} A key name (see {@link module:utils/keyboard~keyCodes})
  91974. * or a keystroke data object.
  91975. * @returns {Number} Key or keystroke code.
  91976. */
  91977. function getCode( key ) {
  91978. let keyCode;
  91979. if ( typeof key == 'string' ) {
  91980. keyCode = keyCodes[ key.toLowerCase() ];
  91981. if ( !keyCode ) {
  91982. /**
  91983. * Unknown key name. Only key names included in the {@link module:utils/keyboard~keyCodes} can be used.
  91984. *
  91985. * @error keyboard-unknown-key
  91986. * @param {String} key
  91987. */
  91988. throw new _ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"]( 'keyboard-unknown-key', null, { key } );
  91989. }
  91990. } else {
  91991. keyCode = key.keyCode +
  91992. ( key.altKey ? keyCodes.alt : 0 ) +
  91993. ( key.ctrlKey ? keyCodes.ctrl : 0 ) +
  91994. ( key.shiftKey ? keyCodes.shift : 0 ) +
  91995. ( key.metaKey ? keyCodes.cmd : 0 );
  91996. }
  91997. return keyCode;
  91998. }
  91999. /**
  92000. * Parses the keystroke and returns a keystroke code that will match the code returned by
  92001. * {@link module:utils/keyboard~getCode} for the corresponding {@link module:utils/keyboard~KeystrokeInfo keystroke info}.
  92002. *
  92003. * The keystroke can be passed in two formats:
  92004. *
  92005. * * as a single string – e.g. `ctrl + A`,
  92006. * * as an array of {@link module:utils/keyboard~keyCodes known key names} and key codes – e.g.:
  92007. * * `[ 'ctrl', 32 ]` (ctrl + space),
  92008. * * `[ 'ctrl', 'a' ]` (ctrl + A).
  92009. *
  92010. * Note: Key names are matched with {@link module:utils/keyboard~keyCodes} in a case-insensitive way.
  92011. *
  92012. * Note: Only keystrokes with a single non-modifier key are supported (e.g. `ctrl+A` is OK, but `ctrl+A+B` is not).
  92013. *
  92014. * Note: On macOS, keystroke handling is translating the `Ctrl` key to the `Cmd` key and handling only that keystroke.
  92015. * For example, a registered keystroke `Ctrl+A` will be translated to `Cmd+A` on macOS. To disable the translation of some keystroke,
  92016. * use the forced modifier: `Ctrl!+A` (note the exclamation mark).
  92017. *
  92018. * @param {String|Array.<Number|String>} keystroke The keystroke definition.
  92019. * @returns {Number} Keystroke code.
  92020. */
  92021. function parseKeystroke( keystroke ) {
  92022. if ( typeof keystroke == 'string' ) {
  92023. keystroke = splitKeystrokeText( keystroke );
  92024. }
  92025. return keystroke
  92026. .map( key => ( typeof key == 'string' ) ? getEnvKeyCode( key ) : key )
  92027. .reduce( ( key, sum ) => sum + key, 0 );
  92028. }
  92029. /**
  92030. * Translates any keystroke string text like `"Ctrl+A"` to an
  92031. * environment–specific keystroke, i.e. `"⌘A"` on macOS.
  92032. *
  92033. * @param {String} keystroke The keystroke text.
  92034. * @returns {String} The keystroke text specific for the environment.
  92035. */
  92036. function getEnvKeystrokeText( keystroke ) {
  92037. let keystrokeCode = parseKeystroke( keystroke );
  92038. const modifiersToGlyphs = Object.entries( _env__WEBPACK_IMPORTED_MODULE_1__["default"].isMac ? modifiersToGlyphsMac : modifiersToGlyphsNonMac );
  92039. const modifiers = modifiersToGlyphs.reduce( ( modifiers, [ name, glyph ] ) => {
  92040. // Modifier keys are stored as a bit mask so extract those from the keystroke code.
  92041. if ( ( keystrokeCode & keyCodes[ name ] ) != 0 ) {
  92042. keystrokeCode &= ~keyCodes[ name ];
  92043. modifiers += glyph;
  92044. }
  92045. return modifiers;
  92046. }, '' );
  92047. return modifiers + ( keystrokeCode ? keyCodeNames[ keystrokeCode ] : '' );
  92048. }
  92049. /**
  92050. * Returns `true` if the provided key code represents one of the arrow keys.
  92051. *
  92052. * @param {Number} keyCode A key code as in {@link module:utils/keyboard~KeystrokeInfo#keyCode}.
  92053. * @returns {Boolean}
  92054. */
  92055. function isArrowKeyCode( keyCode ) {
  92056. return keyCode == keyCodes.arrowright ||
  92057. keyCode == keyCodes.arrowleft ||
  92058. keyCode == keyCodes.arrowup ||
  92059. keyCode == keyCodes.arrowdown;
  92060. }
  92061. /**
  92062. * Returns the direction in which the {@link module:engine/model/documentselection~DocumentSelection selection}
  92063. * will move when the provided arrow key code is pressed considering the language direction of the editor content.
  92064. *
  92065. * For instance, in right–to–left (RTL) content languages, pressing the left arrow means moving the selection right (forward)
  92066. * in the model structure. Similarly, pressing the right arrow moves the selection left (backward).
  92067. *
  92068. * @param {Number} keyCode A key code as in {@link module:utils/keyboard~KeystrokeInfo#keyCode}.
  92069. * @param {'ltr'|'rtl'} contentLanguageDirection The content language direction, corresponding to
  92070. * {@link module:utils/locale~Locale#contentLanguageDirection}.
  92071. * @returns {'left'|'up'|'right'|'down'} Localized arrow direction.
  92072. */
  92073. function getLocalizedArrowKeyCodeDirection( keyCode, contentLanguageDirection ) {
  92074. const isLtrContent = contentLanguageDirection === 'ltr';
  92075. switch ( keyCode ) {
  92076. case keyCodes.arrowleft:
  92077. return isLtrContent ? 'left' : 'right';
  92078. case keyCodes.arrowright:
  92079. return isLtrContent ? 'right' : 'left';
  92080. case keyCodes.arrowup:
  92081. return 'up';
  92082. case keyCodes.arrowdown:
  92083. return 'down';
  92084. }
  92085. }
  92086. // Converts a key name to the key code with mapping based on the env.
  92087. //
  92088. // See: {@link module:utils/keyboard~getCode}.
  92089. //
  92090. // @param {String} key The key name (see {@link module:utils/keyboard~keyCodes}).
  92091. // @returns {Number} Key code.
  92092. function getEnvKeyCode( key ) {
  92093. // Don't remap modifier key for forced modifiers.
  92094. if ( key.endsWith( '!' ) ) {
  92095. return getCode( key.slice( 0, -1 ) );
  92096. }
  92097. const code = getCode( key );
  92098. return _env__WEBPACK_IMPORTED_MODULE_1__["default"].isMac && code == keyCodes.ctrl ? keyCodes.cmd : code;
  92099. }
  92100. /**
  92101. * Determines if the provided key code moves the {@link module:engine/model/documentselection~DocumentSelection selection}
  92102. * forward or backward considering the language direction of the editor content.
  92103. *
  92104. * For instance, in right–to–left (RTL) languages, pressing the left arrow means moving forward
  92105. * in the model structure. Similarly, pressing the right arrow moves the selection backward.
  92106. *
  92107. * @param {Number} keyCode A key code as in {@link module:utils/keyboard~KeystrokeInfo#keyCode}.
  92108. * @param {'ltr'|'rtl'} contentLanguageDirection The content language direction, corresponding to
  92109. * {@link module:utils/locale~Locale#contentLanguageDirection}.
  92110. * @returns {Boolean}
  92111. */
  92112. function isForwardArrowKeyCode( keyCode, contentLanguageDirection ) {
  92113. const localizedKeyCodeDirection = getLocalizedArrowKeyCodeDirection( keyCode, contentLanguageDirection );
  92114. return localizedKeyCodeDirection === 'down' || localizedKeyCodeDirection === 'right';
  92115. }
  92116. function generateKnownKeyCodes() {
  92117. const keyCodes = {
  92118. arrowleft: 37,
  92119. arrowup: 38,
  92120. arrowright: 39,
  92121. arrowdown: 40,
  92122. backspace: 8,
  92123. delete: 46,
  92124. enter: 13,
  92125. space: 32,
  92126. esc: 27,
  92127. tab: 9,
  92128. // The idea about these numbers is that they do not collide with any real key codes, so we can use them
  92129. // like bit masks.
  92130. ctrl: 0x110000,
  92131. shift: 0x220000,
  92132. alt: 0x440000,
  92133. cmd: 0x880000
  92134. };
  92135. // a-z
  92136. for ( let code = 65; code <= 90; code++ ) {
  92137. const letter = String.fromCharCode( code );
  92138. keyCodes[ letter.toLowerCase() ] = code;
  92139. }
  92140. // 0-9
  92141. for ( let code = 48; code <= 57; code++ ) {
  92142. keyCodes[ code - 48 ] = code;
  92143. }
  92144. // F1-F12
  92145. for ( let code = 112; code <= 123; code++ ) {
  92146. keyCodes[ 'f' + ( code - 111 ) ] = code;
  92147. }
  92148. return keyCodes;
  92149. }
  92150. function splitKeystrokeText( keystroke ) {
  92151. return keystroke.split( '+' ).map( key => key.trim() );
  92152. }
  92153. /**
  92154. * Information about the keystroke.
  92155. *
  92156. * @interface module:utils/keyboard~KeystrokeInfo
  92157. */
  92158. /**
  92159. * The [key code](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/keyCode).
  92160. *
  92161. * @member {Number} module:utils/keyboard~KeystrokeInfo#keyCode
  92162. */
  92163. /**
  92164. * Whether the <kbd>Alt</kbd> modifier was pressed.
  92165. *
  92166. * @member {Boolean} module:utils/keyboard~KeystrokeInfo#altKey
  92167. */
  92168. /**
  92169. * Whether the <kbd>Ctrl</kbd> modifier was pressed.
  92170. *
  92171. * @member {Boolean} module:utils/keyboard~KeystrokeInfo#ctrlKey
  92172. */
  92173. /**
  92174. * Whether the <kbd>Shift</kbd> modifier was pressed.
  92175. *
  92176. * @member {Boolean} module:utils/keyboard~KeystrokeInfo#shiftKey
  92177. */
  92178. /**
  92179. * Whether the <kbd>Cmd</kbd> modifier was pressed.
  92180. *
  92181. * @member {Boolean} module:utils/keyboard~KeystrokeInfo#metaKey
  92182. */
  92183. /***/ }),
  92184. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/keystrokehandler.js":
  92185. /*!************************************************************************!*\
  92186. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/keystrokehandler.js ***!
  92187. \************************************************************************/
  92188. /*! exports provided: default */
  92189. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  92190. "use strict";
  92191. __webpack_require__.r(__webpack_exports__);
  92192. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return KeystrokeHandler; });
  92193. /* harmony import */ var _dom_emittermixin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./dom/emittermixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/emittermixin.js");
  92194. /* harmony import */ var _keyboard__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./keyboard */ "./node_modules/@ckeditor/ckeditor5-utils/src/keyboard.js");
  92195. /**
  92196. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  92197. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  92198. */
  92199. /**
  92200. * @module utils/keystrokehandler
  92201. */
  92202. /**
  92203. * Keystroke handler allows registering callbacks for given keystrokes.
  92204. *
  92205. * The most frequent use of this class is through the {@link module:core/editor/editor~Editor#keystrokes `editor.keystrokes`}
  92206. * property. It allows listening to keystrokes executed in the editing view:
  92207. *
  92208. * editor.keystrokes.set( 'Ctrl+A', ( keyEvtData, cancel ) => {
  92209. * console.log( 'Ctrl+A has been pressed' );
  92210. * cancel();
  92211. * } );
  92212. *
  92213. * However, this utility class can be used in various part of the UI. For instance, a certain {@link module:ui/view~View}
  92214. * can use it like this:
  92215. *
  92216. * class MyView extends View {
  92217. * constructor() {
  92218. * this.keystrokes = new KeystrokeHandler();
  92219. *
  92220. * this.keystrokes.set( 'tab', handleTabKey );
  92221. * }
  92222. *
  92223. * render() {
  92224. * super.render();
  92225. *
  92226. * this.keystrokes.listenTo( this.element );
  92227. * }
  92228. * }
  92229. *
  92230. * That keystroke handler will listen to `keydown` events fired in this view's main element.
  92231. *
  92232. */
  92233. class KeystrokeHandler {
  92234. /**
  92235. * Creates an instance of the keystroke handler.
  92236. */
  92237. constructor() {
  92238. /**
  92239. * Listener used to listen to events for easier keystroke handler destruction.
  92240. *
  92241. * @protected
  92242. * @member {module:utils/dom/emittermixin~Emitter}
  92243. */
  92244. this._listener = Object.create( _dom_emittermixin__WEBPACK_IMPORTED_MODULE_0__["default"] );
  92245. }
  92246. /**
  92247. * Starts listening for `keydown` events from a given emitter.
  92248. *
  92249. * @param {module:utils/emittermixin~Emitter} emitter
  92250. */
  92251. listenTo( emitter ) {
  92252. // The #_listener works here as a kind of dispatcher. It groups the events coming from the same
  92253. // keystroke so the listeners can be attached to them with different priorities.
  92254. //
  92255. // E.g. all the keystrokes with the `keyCode` of 42 coming from the `emitter` are propagated
  92256. // as a `_keydown:42` event by the `_listener`. If there's a callback created by the `set`
  92257. // method for this 42 keystroke, it listens to the `_listener#_keydown:42` event only and interacts
  92258. // only with other listeners of this particular event, thus making it possible to prioritize
  92259. // the listeners and safely cancel execution, when needed. Instead of duplicating the Emitter logic,
  92260. // the KeystrokeHandler re–uses it to do its job.
  92261. this._listener.listenTo( emitter, 'keydown', ( evt, keyEvtData ) => {
  92262. this._listener.fire( '_keydown:' + Object(_keyboard__WEBPACK_IMPORTED_MODULE_1__["getCode"])( keyEvtData ), keyEvtData );
  92263. } );
  92264. }
  92265. /**
  92266. * Registers a handler for the specified keystroke.
  92267. *
  92268. * @param {String|Array.<String|Number>} keystroke Keystroke defined in a format accepted by
  92269. * the {@link module:utils/keyboard~parseKeystroke} function.
  92270. * @param {Function} callback A function called with the
  92271. * {@link module:engine/view/observer/keyobserver~KeyEventData key event data} object and
  92272. * a helper funcion to call both `preventDefault()` and `stopPropagation()` on the underlying event.
  92273. * @param {Object} [options={}] Additional options.
  92274. * @param {module:utils/priorities~PriorityString|Number} [options.priority='normal'] The priority of the keystroke
  92275. * callback. The higher the priority value the sooner the callback will be executed. Keystrokes having the same priority
  92276. * are called in the order they were added.
  92277. */
  92278. set( keystroke, callback, options = {} ) {
  92279. const keyCode = Object(_keyboard__WEBPACK_IMPORTED_MODULE_1__["parseKeystroke"])( keystroke );
  92280. const priority = options.priority;
  92281. // Execute the passed callback on KeystrokeHandler#_keydown.
  92282. // TODO: https://github.com/ckeditor/ckeditor5-utils/issues/144
  92283. this._listener.listenTo( this._listener, '_keydown:' + keyCode, ( evt, keyEvtData ) => {
  92284. callback( keyEvtData, () => {
  92285. // Stop the event in the DOM: no listener in the web page
  92286. // will be triggered by this event.
  92287. keyEvtData.preventDefault();
  92288. keyEvtData.stopPropagation();
  92289. // Stop the event in the KeystrokeHandler: no more callbacks
  92290. // will be executed for this keystroke.
  92291. evt.stop();
  92292. } );
  92293. // Mark this keystroke as handled by the callback. See: #press.
  92294. evt.return = true;
  92295. }, { priority } );
  92296. }
  92297. /**
  92298. * Triggers a keystroke handler for a specified key combination, if such a keystroke was {@link #set defined}.
  92299. *
  92300. * @param {module:engine/view/observer/keyobserver~KeyEventData} keyEvtData Key event data.
  92301. * @returns {Boolean} Whether the keystroke was handled.
  92302. */
  92303. press( keyEvtData ) {
  92304. return !!this._listener.fire( '_keydown:' + Object(_keyboard__WEBPACK_IMPORTED_MODULE_1__["getCode"])( keyEvtData ), keyEvtData );
  92305. }
  92306. /**
  92307. * Destroys the keystroke handler.
  92308. */
  92309. destroy() {
  92310. this._listener.stopListening();
  92311. }
  92312. }
  92313. /***/ }),
  92314. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/language.js":
  92315. /*!****************************************************************!*\
  92316. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/language.js ***!
  92317. \****************************************************************/
  92318. /*! exports provided: getLanguageDirection */
  92319. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  92320. "use strict";
  92321. __webpack_require__.r(__webpack_exports__);
  92322. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getLanguageDirection", function() { return getLanguageDirection; });
  92323. /**
  92324. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  92325. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  92326. */
  92327. /**
  92328. * @module utils/language
  92329. */
  92330. const RTL_LANGUAGE_CODES = [
  92331. 'ar', 'ara', // Arabic
  92332. 'fa', 'per', 'fas', // Persian
  92333. 'he', 'heb', // Hebrew
  92334. 'ku', 'kur', // Kurdish
  92335. 'ug', 'uig' // Uighur, Uyghur
  92336. ];
  92337. /**
  92338. * Helps determine whether a language text direction is LTR or RTL.
  92339. *
  92340. * @param {String} language The ISO 639-1 or ISO 639-2 language code.
  92341. * @returns {'ltr'|'rtl'}
  92342. */
  92343. function getLanguageDirection( languageCode ) {
  92344. return RTL_LANGUAGE_CODES.includes( languageCode ) ? 'rtl' : 'ltr';
  92345. }
  92346. /***/ }),
  92347. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/locale.js":
  92348. /*!**************************************************************!*\
  92349. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/locale.js ***!
  92350. \**************************************************************/
  92351. /*! exports provided: default */
  92352. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  92353. "use strict";
  92354. __webpack_require__.r(__webpack_exports__);
  92355. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Locale; });
  92356. /* harmony import */ var _toarray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./toarray */ "./node_modules/@ckeditor/ckeditor5-utils/src/toarray.js");
  92357. /* harmony import */ var _translation_service__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./translation-service */ "./node_modules/@ckeditor/ckeditor5-utils/src/translation-service.js");
  92358. /* harmony import */ var _language__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./language */ "./node_modules/@ckeditor/ckeditor5-utils/src/language.js");
  92359. /**
  92360. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  92361. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  92362. */
  92363. /**
  92364. * @module utils/locale
  92365. */
  92366. /* globals console */
  92367. /**
  92368. * Represents the localization services.
  92369. */
  92370. class Locale {
  92371. /**
  92372. * Creates a new instance of the locale class. Learn more about
  92373. * {@glink features/ui-language configuring the language of the editor}.
  92374. *
  92375. * @param {Object} [options] Locale configuration.
  92376. * @param {String} [options.uiLanguage='en'] The editor UI language code in the
  92377. * [ISO 639-1](https://en.wikipedia.org/wiki/ISO_639-1) format. See {@link #uiLanguage}.
  92378. * @param {String} [options.contentLanguage] The editor content language code in the
  92379. * [ISO 639-1](https://en.wikipedia.org/wiki/ISO_639-1) format. If not specified, the same as `options.language`.
  92380. * See {@link #contentLanguage}.
  92381. */
  92382. constructor( options = {} ) {
  92383. /**
  92384. * The editor UI language code in the [ISO 639-1](https://en.wikipedia.org/wiki/ISO_639-1) format.
  92385. *
  92386. * If the {@link #contentLanguage content language} was not specified in the `Locale` constructor,
  92387. * it also defines the language of the content.
  92388. *
  92389. * @readonly
  92390. * @member {String}
  92391. */
  92392. this.uiLanguage = options.uiLanguage || 'en';
  92393. /**
  92394. * The editor content language code in the [ISO 639-1](https://en.wikipedia.org/wiki/ISO_639-1) format.
  92395. *
  92396. * Usually the same as the {@link #uiLanguage editor language}, it can be customized by passing an optional
  92397. * argument to the `Locale` constructor.
  92398. *
  92399. * @readonly
  92400. * @member {String}
  92401. */
  92402. this.contentLanguage = options.contentLanguage || this.uiLanguage;
  92403. /**
  92404. * Text direction of the {@link #uiLanguage editor UI language}. Either `'ltr'` or `'rtl'`.
  92405. *
  92406. * @readonly
  92407. * @member {String}
  92408. */
  92409. this.uiLanguageDirection = Object(_language__WEBPACK_IMPORTED_MODULE_2__["getLanguageDirection"])( this.uiLanguage );
  92410. /**
  92411. * Text direction of the {@link #contentLanguage editor content language}.
  92412. *
  92413. * If the content language was passed directly to the `Locale` constructor, this property represents the
  92414. * direction of that language.
  92415. *
  92416. * If the {@link #contentLanguage editor content language} was derived from the {@link #uiLanguage editor language},
  92417. * the content language direction is the same as the {@link #uiLanguageDirection UI language direction}.
  92418. *
  92419. * The value is either `'ltr'` or `'rtl'`.
  92420. *
  92421. * @readonly
  92422. * @member {String}
  92423. */
  92424. this.contentLanguageDirection = Object(_language__WEBPACK_IMPORTED_MODULE_2__["getLanguageDirection"])( this.contentLanguage );
  92425. /**
  92426. * Translates the given message to the {@link #uiLanguage}. This method is also available in
  92427. * {@link module:core/editor/editor~Editor#t `Editor`} and {@link module:ui/view~View#t `View`}.
  92428. *
  92429. * This method's context is statically bound to the `Locale` instance and **should always be called as a function**:
  92430. *
  92431. * const t = locale.t;
  92432. * t( 'Label' );
  92433. *
  92434. * The message can be either a string or an object implementing the {@link module:utils/translation-service~Message} interface.
  92435. *
  92436. * The message may contain placeholders (`%<index>`) for value(s) that are passed as a `values` parameter.
  92437. * For an array of values, the `%<index>` will be changed to an element of that array at the given index.
  92438. * For a single value passed as the second argument, only the `%0` placeholders will be changed to the provided value.
  92439. *
  92440. * t( 'Created file "%0" in %1ms.', [ fileName, timeTaken ] );
  92441. * t( 'Created file "%0", fileName );
  92442. *
  92443. * The message supports plural forms. To specify the plural form, use the `plural` property. Singular or plural form
  92444. * will be chosen depending on the first value from the passed `values`. The value of the `plural` property is used
  92445. * as a default plural translation when the translation for the target language is missing.
  92446. *
  92447. * t( { string: 'Add a space', plural: 'Add %0 spaces' }, 1 ); // 'Add a space' for the English language.
  92448. * t( { string: 'Add a space', plural: 'Add %0 spaces' }, 5 ); // 'Add 5 spaces' for the English language.
  92449. * t( { string: '%1 a space', plural: '%1 %0 spaces' }, [ 2, 'Add' ] ); // 'Add 2 spaces' for the English language.
  92450. *
  92451. * t( { string: 'Add a space', plural: 'Add %0 spaces' }, 1 ); // 'Dodaj spację' for the Polish language.
  92452. * t( { string: 'Add a space', plural: 'Add %0 spaces' }, 5 ); // 'Dodaj 5 spacji' for the Polish language.
  92453. * t( { string: '%1 a space', plural: '%1 %0 spaces' }, [ 2, 'Add' ] ); // 'Dodaj 2 spacje' for the Polish language.
  92454. *
  92455. * * The message should provide an ID using the `id` property when the message strings are not unique and their
  92456. * translations should be different.
  92457. *
  92458. * translate( 'en', { string: 'image', id: 'ADD_IMAGE' } );
  92459. * translate( 'en', { string: 'image', id: 'AN_IMAGE' } );
  92460. *
  92461. * @method #t
  92462. * @param {String|module:utils/translation-service~Message} message A message that will be localized (translated).
  92463. * @param {String|Number|Array.<String|Number>} [values] A value or an array of values that will fill message placeholders.
  92464. * For messages supporting plural forms the first value will determine the plural form.
  92465. * @returns {String}
  92466. */
  92467. this.t = ( message, values ) => this._t( message, values );
  92468. }
  92469. /**
  92470. * The editor UI language code in the [ISO 639-1](https://en.wikipedia.org/wiki/ISO_639-1) format.
  92471. *
  92472. * **Note**: This property was deprecated. Please use {@link #uiLanguage} and {@link #contentLanguage}
  92473. * properties instead.
  92474. *
  92475. * @deprecated
  92476. * @member {String}
  92477. */
  92478. get language() {
  92479. /**
  92480. * The {@link module:utils/locale~Locale#language `Locale#language`} property was deprecated and will
  92481. * be removed in the near future. Please use the {@link #uiLanguage} and {@link #contentLanguage} properties instead.
  92482. *
  92483. * @error locale-deprecated-language-property
  92484. */
  92485. console.warn(
  92486. 'locale-deprecated-language-property: ' +
  92487. 'The Locale#language property has been deprecated and will be removed in the near future. ' +
  92488. 'Please use #uiLanguage and #contentLanguage properties instead.' );
  92489. return this.uiLanguage;
  92490. }
  92491. /**
  92492. * An unbound version of the {@link #t} method.
  92493. *
  92494. * @private
  92495. * @param {String|module:utils/translation-service~Message} message
  92496. * @param {Number|String|Array.<Number|String>} [values]
  92497. * @returns {String}
  92498. */
  92499. _t( message, values = [] ) {
  92500. values = Object(_toarray__WEBPACK_IMPORTED_MODULE_0__["default"])( values );
  92501. if ( typeof message === 'string' ) {
  92502. message = { string: message };
  92503. }
  92504. const hasPluralForm = !!message.plural;
  92505. const quantity = hasPluralForm ? values[ 0 ] : 1;
  92506. const translatedString = Object(_translation_service__WEBPACK_IMPORTED_MODULE_1__["_translate"])( this.uiLanguage, message, quantity );
  92507. return interpolateString( translatedString, values );
  92508. }
  92509. }
  92510. // Fills the `%0, %1, ...` string placeholders with values.
  92511. function interpolateString( string, values ) {
  92512. return string.replace( /%(\d+)/g, ( match, index ) => {
  92513. return ( index < values.length ) ? values[ index ] : match;
  92514. } );
  92515. }
  92516. /***/ }),
  92517. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/mix.js":
  92518. /*!***********************************************************!*\
  92519. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/mix.js ***!
  92520. \***********************************************************/
  92521. /*! exports provided: default */
  92522. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  92523. "use strict";
  92524. __webpack_require__.r(__webpack_exports__);
  92525. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return mix; });
  92526. /**
  92527. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  92528. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  92529. */
  92530. /**
  92531. * @module utils/mix
  92532. */
  92533. /**
  92534. * Copies enumerable properties and symbols from the objects given as 2nd+ parameters to the
  92535. * prototype of first object (a constructor).
  92536. *
  92537. * class Editor {
  92538. * ...
  92539. * }
  92540. *
  92541. * const SomeMixin = {
  92542. * a() {
  92543. * return 'a';
  92544. * }
  92545. * };
  92546. *
  92547. * mix( Editor, SomeMixin, ... );
  92548. *
  92549. * new Editor().a(); // -> 'a'
  92550. *
  92551. * Note: Properties which already exist in the base class will not be overriden.
  92552. *
  92553. * @param {Function} [baseClass] Class which prototype will be extended.
  92554. * @param {Object} [...mixins] Objects from which to get properties.
  92555. */
  92556. function mix( baseClass, ...mixins ) {
  92557. mixins.forEach( mixin => {
  92558. Object.getOwnPropertyNames( mixin ).concat( Object.getOwnPropertySymbols( mixin ) )
  92559. .forEach( key => {
  92560. if ( key in baseClass.prototype ) {
  92561. return;
  92562. }
  92563. const sourceDescriptor = Object.getOwnPropertyDescriptor( mixin, key );
  92564. sourceDescriptor.enumerable = false;
  92565. Object.defineProperty( baseClass.prototype, key, sourceDescriptor );
  92566. } );
  92567. } );
  92568. }
  92569. /***/ }),
  92570. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/objecttomap.js":
  92571. /*!*******************************************************************!*\
  92572. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/objecttomap.js ***!
  92573. \*******************************************************************/
  92574. /*! exports provided: default */
  92575. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  92576. "use strict";
  92577. __webpack_require__.r(__webpack_exports__);
  92578. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return objectToMap; });
  92579. /**
  92580. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  92581. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  92582. */
  92583. /**
  92584. * @module utils/objecttomap
  92585. */
  92586. /**
  92587. * Transforms object to map.
  92588. *
  92589. * const map = objectToMap( { 'foo': 1, 'bar': 2 } );
  92590. * map.get( 'foo' ); // 1
  92591. *
  92592. * **Note**: For mixed data (`Object` or `Iterable`) there's a dedicated {@link module:utils/tomap~toMap} function.
  92593. *
  92594. * @param {Object} obj Object to transform.
  92595. * @returns {Map} Map created from object.
  92596. */
  92597. function objectToMap( obj ) {
  92598. const map = new Map();
  92599. for ( const key in obj ) {
  92600. map.set( key, obj[ key ] );
  92601. }
  92602. return map;
  92603. }
  92604. /***/ }),
  92605. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/observablemixin.js":
  92606. /*!***********************************************************************!*\
  92607. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/observablemixin.js ***!
  92608. \***********************************************************************/
  92609. /*! exports provided: default */
  92610. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  92611. "use strict";
  92612. __webpack_require__.r(__webpack_exports__);
  92613. /* harmony import */ var _emittermixin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./emittermixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/emittermixin.js");
  92614. /* harmony import */ var _ckeditorerror__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  92615. /* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lodash-es */ "./node_modules/lodash-es/lodash.js");
  92616. /**
  92617. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  92618. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  92619. */
  92620. /**
  92621. * @module utils/observablemixin
  92622. */
  92623. const observablePropertiesSymbol = Symbol( 'observableProperties' );
  92624. const boundObservablesSymbol = Symbol( 'boundObservables' );
  92625. const boundPropertiesSymbol = Symbol( 'boundProperties' );
  92626. const _decoratedMethods = Symbol( 'decoratedMethods' );
  92627. const _decoratedOriginal = Symbol( 'decoratedOriginal' );
  92628. /**
  92629. * A mixin that injects the "observable properties" and data binding functionality described in the
  92630. * {@link ~Observable} interface.
  92631. *
  92632. * Read more about the concept of observables in the:
  92633. * * {@glink framework/guides/architecture/core-editor-architecture#event-system-and-observables "Event system and observables"}
  92634. * section of the {@glink framework/guides/architecture/core-editor-architecture "Core editor architecture"} guide,
  92635. * * {@glink framework/guides/deep-dive/observables "Observables" deep dive} guide.
  92636. *
  92637. * @mixin ObservableMixin
  92638. * @mixes module:utils/emittermixin~EmitterMixin
  92639. * @implements module:utils/observablemixin~Observable
  92640. */
  92641. const ObservableMixin = {
  92642. /**
  92643. * @inheritDoc
  92644. */
  92645. set( name, value ) {
  92646. // If the first parameter is an Object, iterate over its properties.
  92647. if ( Object(lodash_es__WEBPACK_IMPORTED_MODULE_2__["isObject"])( name ) ) {
  92648. Object.keys( name ).forEach( property => {
  92649. this.set( property, name[ property ] );
  92650. }, this );
  92651. return;
  92652. }
  92653. initObservable( this );
  92654. const properties = this[ observablePropertiesSymbol ];
  92655. if ( ( name in this ) && !properties.has( name ) ) {
  92656. /**
  92657. * Cannot override an existing property.
  92658. *
  92659. * This error is thrown when trying to {@link ~Observable#set set} a property with
  92660. * a name of an already existing property. For example:
  92661. *
  92662. * let observable = new Model();
  92663. * observable.property = 1;
  92664. * observable.set( 'property', 2 ); // throws
  92665. *
  92666. * observable.set( 'property', 1 );
  92667. * observable.set( 'property', 2 ); // ok, because this is an existing property.
  92668. *
  92669. * @error observable-set-cannot-override
  92670. */
  92671. throw new _ckeditorerror__WEBPACK_IMPORTED_MODULE_1__["default"]( 'observable-set-cannot-override', this );
  92672. }
  92673. Object.defineProperty( this, name, {
  92674. enumerable: true,
  92675. configurable: true,
  92676. get() {
  92677. return properties.get( name );
  92678. },
  92679. set( value ) {
  92680. const oldValue = properties.get( name );
  92681. // Fire `set` event before the new value will be set to make it possible
  92682. // to override observable property without affecting `change` event.
  92683. // See https://github.com/ckeditor/ckeditor5-utils/issues/171.
  92684. let newValue = this.fire( 'set:' + name, name, value, oldValue );
  92685. if ( newValue === undefined ) {
  92686. newValue = value;
  92687. }
  92688. // Allow undefined as an initial value like A.define( 'x', undefined ) (#132).
  92689. // Note: When properties map has no such own property, then its value is undefined.
  92690. if ( oldValue !== newValue || !properties.has( name ) ) {
  92691. properties.set( name, newValue );
  92692. this.fire( 'change:' + name, name, newValue, oldValue );
  92693. }
  92694. }
  92695. } );
  92696. this[ name ] = value;
  92697. },
  92698. /**
  92699. * @inheritDoc
  92700. */
  92701. bind( ...bindProperties ) {
  92702. if ( !bindProperties.length || !isStringArray( bindProperties ) ) {
  92703. /**
  92704. * All properties must be strings.
  92705. *
  92706. * @error observable-bind-wrong-properties
  92707. */
  92708. throw new _ckeditorerror__WEBPACK_IMPORTED_MODULE_1__["default"]( 'observable-bind-wrong-properties', this );
  92709. }
  92710. if ( ( new Set( bindProperties ) ).size !== bindProperties.length ) {
  92711. /**
  92712. * Properties must be unique.
  92713. *
  92714. * @error observable-bind-duplicate-properties
  92715. */
  92716. throw new _ckeditorerror__WEBPACK_IMPORTED_MODULE_1__["default"]( 'observable-bind-duplicate-properties', this );
  92717. }
  92718. initObservable( this );
  92719. const boundProperties = this[ boundPropertiesSymbol ];
  92720. bindProperties.forEach( propertyName => {
  92721. if ( boundProperties.has( propertyName ) ) {
  92722. /**
  92723. * Cannot bind the same property more than once.
  92724. *
  92725. * @error observable-bind-rebind
  92726. */
  92727. throw new _ckeditorerror__WEBPACK_IMPORTED_MODULE_1__["default"]( 'observable-bind-rebind', this );
  92728. }
  92729. } );
  92730. const bindings = new Map();
  92731. // @typedef {Object} Binding
  92732. // @property {Array} property Property which is bound.
  92733. // @property {Array} to Array of observable–property components of the binding (`{ observable: ..., property: .. }`).
  92734. // @property {Array} callback A function which processes `to` components.
  92735. bindProperties.forEach( a => {
  92736. const binding = { property: a, to: [] };
  92737. boundProperties.set( a, binding );
  92738. bindings.set( a, binding );
  92739. } );
  92740. // @typedef {Object} BindChain
  92741. // @property {Function} to See {@link ~ObservableMixin#_bindTo}.
  92742. // @property {Function} toMany See {@link ~ObservableMixin#_bindToMany}.
  92743. // @property {module:utils/observablemixin~Observable} _observable The observable which initializes the binding.
  92744. // @property {Array} _bindProperties Array of `_observable` properties to be bound.
  92745. // @property {Array} _to Array of `to()` observable–properties (`{ observable: toObservable, properties: ...toProperties }`).
  92746. // @property {Map} _bindings Stores bindings to be kept in
  92747. // {@link ~ObservableMixin#_boundProperties}/{@link ~ObservableMixin#_boundObservables}
  92748. // initiated in this binding chain.
  92749. return {
  92750. to: bindTo,
  92751. toMany: bindToMany,
  92752. _observable: this,
  92753. _bindProperties: bindProperties,
  92754. _to: [],
  92755. _bindings: bindings
  92756. };
  92757. },
  92758. /**
  92759. * @inheritDoc
  92760. */
  92761. unbind( ...unbindProperties ) {
  92762. // Nothing to do here if not inited yet.
  92763. if ( !( this[ observablePropertiesSymbol ] ) ) {
  92764. return;
  92765. }
  92766. const boundProperties = this[ boundPropertiesSymbol ];
  92767. const boundObservables = this[ boundObservablesSymbol ];
  92768. if ( unbindProperties.length ) {
  92769. if ( !isStringArray( unbindProperties ) ) {
  92770. /**
  92771. * Properties must be strings.
  92772. *
  92773. * @error observable-unbind-wrong-properties
  92774. */
  92775. throw new _ckeditorerror__WEBPACK_IMPORTED_MODULE_1__["default"]( 'observable-unbind-wrong-properties', this );
  92776. }
  92777. unbindProperties.forEach( propertyName => {
  92778. const binding = boundProperties.get( propertyName );
  92779. // Nothing to do if the binding is not defined
  92780. if ( !binding ) {
  92781. return;
  92782. }
  92783. let toObservable, toProperty, toProperties, toPropertyBindings;
  92784. binding.to.forEach( to => {
  92785. // TODO: ES6 destructuring.
  92786. toObservable = to[ 0 ];
  92787. toProperty = to[ 1 ];
  92788. toProperties = boundObservables.get( toObservable );
  92789. toPropertyBindings = toProperties[ toProperty ];
  92790. toPropertyBindings.delete( binding );
  92791. if ( !toPropertyBindings.size ) {
  92792. delete toProperties[ toProperty ];
  92793. }
  92794. if ( !Object.keys( toProperties ).length ) {
  92795. boundObservables.delete( toObservable );
  92796. this.stopListening( toObservable, 'change' );
  92797. }
  92798. } );
  92799. boundProperties.delete( propertyName );
  92800. } );
  92801. } else {
  92802. boundObservables.forEach( ( bindings, boundObservable ) => {
  92803. this.stopListening( boundObservable, 'change' );
  92804. } );
  92805. boundObservables.clear();
  92806. boundProperties.clear();
  92807. }
  92808. },
  92809. /**
  92810. * @inheritDoc
  92811. */
  92812. decorate( methodName ) {
  92813. const originalMethod = this[ methodName ];
  92814. if ( !originalMethod ) {
  92815. /**
  92816. * Cannot decorate an undefined method.
  92817. *
  92818. * @error observablemixin-cannot-decorate-undefined
  92819. * @param {Object} object The object which method should be decorated.
  92820. * @param {String} methodName Name of the method which does not exist.
  92821. */
  92822. throw new _ckeditorerror__WEBPACK_IMPORTED_MODULE_1__["default"](
  92823. 'observablemixin-cannot-decorate-undefined',
  92824. this,
  92825. { object: this, methodName }
  92826. );
  92827. }
  92828. this.on( methodName, ( evt, args ) => {
  92829. evt.return = originalMethod.apply( this, args );
  92830. } );
  92831. this[ methodName ] = function( ...args ) {
  92832. return this.fire( methodName, args );
  92833. };
  92834. this[ methodName ][ _decoratedOriginal ] = originalMethod;
  92835. if ( !this[ _decoratedMethods ] ) {
  92836. this[ _decoratedMethods ] = [];
  92837. }
  92838. this[ _decoratedMethods ].push( methodName );
  92839. }
  92840. };
  92841. Object(lodash_es__WEBPACK_IMPORTED_MODULE_2__["extend"])( ObservableMixin, _emittermixin__WEBPACK_IMPORTED_MODULE_0__["default"] );
  92842. // Override the EmitterMixin stopListening method to be able to clean (and restore) decorated methods.
  92843. // This is needed in case of:
  92844. // 1. Have x.foo() decorated.
  92845. // 2. Call x.stopListening()
  92846. // 3. Call x.foo(). Problem: nothing happens (the original foo() method is not executed)
  92847. ObservableMixin.stopListening = function( emitter, event, callback ) {
  92848. // Removing all listeners so let's clean the decorated methods to the original state.
  92849. if ( !emitter && this[ _decoratedMethods ] ) {
  92850. for ( const methodName of this[ _decoratedMethods ] ) {
  92851. this[ methodName ] = this[ methodName ][ _decoratedOriginal ];
  92852. }
  92853. delete this[ _decoratedMethods ];
  92854. }
  92855. _emittermixin__WEBPACK_IMPORTED_MODULE_0__["default"].stopListening.call( this, emitter, event, callback );
  92856. };
  92857. /* harmony default export */ __webpack_exports__["default"] = (ObservableMixin);
  92858. // Init symbol properties needed for the observable mechanism to work.
  92859. //
  92860. // @private
  92861. // @param {module:utils/observablemixin~ObservableMixin} observable
  92862. function initObservable( observable ) {
  92863. // Do nothing if already inited.
  92864. if ( observable[ observablePropertiesSymbol ] ) {
  92865. return;
  92866. }
  92867. // The internal hash containing the observable's state.
  92868. //
  92869. // @private
  92870. // @type {Map}
  92871. Object.defineProperty( observable, observablePropertiesSymbol, {
  92872. value: new Map()
  92873. } );
  92874. // Map containing bindings to external observables. It shares the binding objects
  92875. // (`{ observable: A, property: 'a', to: ... }`) with {@link module:utils/observablemixin~ObservableMixin#_boundProperties} and
  92876. // it is used to observe external observables to update own properties accordingly.
  92877. // See {@link module:utils/observablemixin~ObservableMixin#bind}.
  92878. //
  92879. // A.bind( 'a', 'b', 'c' ).to( B, 'x', 'y', 'x' );
  92880. // console.log( A._boundObservables );
  92881. //
  92882. // Map( {
  92883. // B: {
  92884. // x: Set( [
  92885. // { observable: A, property: 'a', to: [ [ B, 'x' ] ] },
  92886. // { observable: A, property: 'c', to: [ [ B, 'x' ] ] }
  92887. // ] ),
  92888. // y: Set( [
  92889. // { observable: A, property: 'b', to: [ [ B, 'y' ] ] },
  92890. // ] )
  92891. // }
  92892. // } )
  92893. //
  92894. // A.bind( 'd' ).to( B, 'z' ).to( C, 'w' ).as( callback );
  92895. // console.log( A._boundObservables );
  92896. //
  92897. // Map( {
  92898. // B: {
  92899. // x: Set( [
  92900. // { observable: A, property: 'a', to: [ [ B, 'x' ] ] },
  92901. // { observable: A, property: 'c', to: [ [ B, 'x' ] ] }
  92902. // ] ),
  92903. // y: Set( [
  92904. // { observable: A, property: 'b', to: [ [ B, 'y' ] ] },
  92905. // ] ),
  92906. // z: Set( [
  92907. // { observable: A, property: 'd', to: [ [ B, 'z' ], [ C, 'w' ] ], callback: callback }
  92908. // ] )
  92909. // },
  92910. // C: {
  92911. // w: Set( [
  92912. // { observable: A, property: 'd', to: [ [ B, 'z' ], [ C, 'w' ] ], callback: callback }
  92913. // ] )
  92914. // }
  92915. // } )
  92916. //
  92917. // @private
  92918. // @type {Map}
  92919. Object.defineProperty( observable, boundObservablesSymbol, {
  92920. value: new Map()
  92921. } );
  92922. // Object that stores which properties of this observable are bound and how. It shares
  92923. // the binding objects (`{ observable: A, property: 'a', to: ... }`) with
  92924. // {@link module:utils/observablemixin~ObservableMixin#_boundObservables}. This data structure is
  92925. // a reverse of {@link module:utils/observablemixin~ObservableMixin#_boundObservables} and it is helpful for
  92926. // {@link module:utils/observablemixin~ObservableMixin#unbind}.
  92927. //
  92928. // See {@link module:utils/observablemixin~ObservableMixin#bind}.
  92929. //
  92930. // A.bind( 'a', 'b', 'c' ).to( B, 'x', 'y', 'x' );
  92931. // console.log( A._boundProperties );
  92932. //
  92933. // Map( {
  92934. // a: { observable: A, property: 'a', to: [ [ B, 'x' ] ] },
  92935. // b: { observable: A, property: 'b', to: [ [ B, 'y' ] ] },
  92936. // c: { observable: A, property: 'c', to: [ [ B, 'x' ] ] }
  92937. // } )
  92938. //
  92939. // A.bind( 'd' ).to( B, 'z' ).to( C, 'w' ).as( callback );
  92940. // console.log( A._boundProperties );
  92941. //
  92942. // Map( {
  92943. // a: { observable: A, property: 'a', to: [ [ B, 'x' ] ] },
  92944. // b: { observable: A, property: 'b', to: [ [ B, 'y' ] ] },
  92945. // c: { observable: A, property: 'c', to: [ [ B, 'x' ] ] },
  92946. // d: { observable: A, property: 'd', to: [ [ B, 'z' ], [ C, 'w' ] ], callback: callback }
  92947. // } )
  92948. //
  92949. // @private
  92950. // @type {Map}
  92951. Object.defineProperty( observable, boundPropertiesSymbol, {
  92952. value: new Map()
  92953. } );
  92954. }
  92955. // A chaining for {@link module:utils/observablemixin~ObservableMixin#bind} providing `.to()` interface.
  92956. //
  92957. // @private
  92958. // @param {...[Observable|String|Function]} args Arguments of the `.to( args )` binding.
  92959. function bindTo( ...args ) {
  92960. const parsedArgs = parseBindToArgs( ...args );
  92961. const bindingsKeys = Array.from( this._bindings.keys() );
  92962. const numberOfBindings = bindingsKeys.length;
  92963. // Eliminate A.bind( 'x' ).to( B, C )
  92964. if ( !parsedArgs.callback && parsedArgs.to.length > 1 ) {
  92965. /**
  92966. * Binding multiple observables only possible with callback.
  92967. *
  92968. * @error observable-bind-to-no-callback
  92969. */
  92970. throw new _ckeditorerror__WEBPACK_IMPORTED_MODULE_1__["default"]( 'observable-bind-to-no-callback', this );
  92971. }
  92972. // Eliminate A.bind( 'x', 'y' ).to( B, callback )
  92973. if ( numberOfBindings > 1 && parsedArgs.callback ) {
  92974. /**
  92975. * Cannot bind multiple properties and use a callback in one binding.
  92976. *
  92977. * @error observable-bind-to-extra-callback
  92978. */
  92979. throw new _ckeditorerror__WEBPACK_IMPORTED_MODULE_1__["default"](
  92980. 'observable-bind-to-extra-callback',
  92981. this
  92982. );
  92983. }
  92984. parsedArgs.to.forEach( to => {
  92985. // Eliminate A.bind( 'x', 'y' ).to( B, 'a' )
  92986. if ( to.properties.length && to.properties.length !== numberOfBindings ) {
  92987. /**
  92988. * The number of properties must match.
  92989. *
  92990. * @error observable-bind-to-properties-length
  92991. */
  92992. throw new _ckeditorerror__WEBPACK_IMPORTED_MODULE_1__["default"]( 'observable-bind-to-properties-length', this );
  92993. }
  92994. // When no to.properties specified, observing source properties instead i.e.
  92995. // A.bind( 'x', 'y' ).to( B ) -> Observe B.x and B.y
  92996. if ( !to.properties.length ) {
  92997. to.properties = this._bindProperties;
  92998. }
  92999. } );
  93000. this._to = parsedArgs.to;
  93001. // Fill {@link BindChain#_bindings} with callback. When the callback is set there's only one binding.
  93002. if ( parsedArgs.callback ) {
  93003. this._bindings.get( bindingsKeys[ 0 ] ).callback = parsedArgs.callback;
  93004. }
  93005. attachBindToListeners( this._observable, this._to );
  93006. // Update observable._boundProperties and observable._boundObservables.
  93007. updateBindToBound( this );
  93008. // Set initial values of bound properties.
  93009. this._bindProperties.forEach( propertyName => {
  93010. updateBoundObservableProperty( this._observable, propertyName );
  93011. } );
  93012. }
  93013. // Binds to an attribute in a set of iterable observables.
  93014. //
  93015. // @private
  93016. // @param {Array.<Observable>} observables
  93017. // @param {String} attribute
  93018. // @param {Function} callback
  93019. function bindToMany( observables, attribute, callback ) {
  93020. if ( this._bindings.size > 1 ) {
  93021. /**
  93022. * Binding one attribute to many observables only possible with one attribute.
  93023. *
  93024. * @error observable-bind-to-many-not-one-binding
  93025. */
  93026. throw new _ckeditorerror__WEBPACK_IMPORTED_MODULE_1__["default"]( 'observable-bind-to-many-not-one-binding', this );
  93027. }
  93028. this.to(
  93029. // Bind to #attribute of each observable...
  93030. ...getBindingTargets( observables, attribute ),
  93031. // ...using given callback to parse attribute values.
  93032. callback
  93033. );
  93034. }
  93035. // Returns an array of binding components for
  93036. // {@link Observable#bind} from a set of iterable observables.
  93037. //
  93038. // @param {Array.<Observable>} observables
  93039. // @param {String} attribute
  93040. // @returns {Array.<String|Observable>}
  93041. function getBindingTargets( observables, attribute ) {
  93042. const observableAndAttributePairs = observables.map( observable => [ observable, attribute ] );
  93043. // Merge pairs to one-dimension array of observables and attributes.
  93044. return Array.prototype.concat.apply( [], observableAndAttributePairs );
  93045. }
  93046. // Check if all entries of the array are of `String` type.
  93047. //
  93048. // @private
  93049. // @param {Array} arr An array to be checked.
  93050. // @returns {Boolean}
  93051. function isStringArray( arr ) {
  93052. return arr.every( a => typeof a == 'string' );
  93053. }
  93054. // Parses and validates {@link Observable#bind}`.to( args )` arguments and returns
  93055. // an object with a parsed structure. For example
  93056. //
  93057. // A.bind( 'x' ).to( B, 'a', C, 'b', call );
  93058. //
  93059. // becomes
  93060. //
  93061. // {
  93062. // to: [
  93063. // { observable: B, properties: [ 'a' ] },
  93064. // { observable: C, properties: [ 'b' ] },
  93065. // ],
  93066. // callback: call
  93067. // }
  93068. //
  93069. // @private
  93070. // @param {...*} args Arguments of {@link Observable#bind}`.to( args )`.
  93071. // @returns {Object}
  93072. function parseBindToArgs( ...args ) {
  93073. // Eliminate A.bind( 'x' ).to()
  93074. if ( !args.length ) {
  93075. /**
  93076. * Invalid argument syntax in `to()`.
  93077. *
  93078. * @error observable-bind-to-parse-error
  93079. */
  93080. throw new _ckeditorerror__WEBPACK_IMPORTED_MODULE_1__["default"]( 'observable-bind-to-parse-error', null );
  93081. }
  93082. const parsed = { to: [] };
  93083. let lastObservable;
  93084. if ( typeof args[ args.length - 1 ] == 'function' ) {
  93085. parsed.callback = args.pop();
  93086. }
  93087. args.forEach( a => {
  93088. if ( typeof a == 'string' ) {
  93089. lastObservable.properties.push( a );
  93090. } else if ( typeof a == 'object' ) {
  93091. lastObservable = { observable: a, properties: [] };
  93092. parsed.to.push( lastObservable );
  93093. } else {
  93094. throw new _ckeditorerror__WEBPACK_IMPORTED_MODULE_1__["default"]( 'observable-bind-to-parse-error', null );
  93095. }
  93096. } );
  93097. return parsed;
  93098. }
  93099. // Synchronizes {@link module:utils/observablemixin#_boundObservables} with {@link Binding}.
  93100. //
  93101. // @private
  93102. // @param {Binding} binding A binding to store in {@link Observable#_boundObservables}.
  93103. // @param {Observable} toObservable A observable, which is a new component of `binding`.
  93104. // @param {String} toPropertyName A name of `toObservable`'s property, a new component of the `binding`.
  93105. function updateBoundObservables( observable, binding, toObservable, toPropertyName ) {
  93106. const boundObservables = observable[ boundObservablesSymbol ];
  93107. const bindingsToObservable = boundObservables.get( toObservable );
  93108. const bindings = bindingsToObservable || {};
  93109. if ( !bindings[ toPropertyName ] ) {
  93110. bindings[ toPropertyName ] = new Set();
  93111. }
  93112. // Pass the binding to a corresponding Set in `observable._boundObservables`.
  93113. bindings[ toPropertyName ].add( binding );
  93114. if ( !bindingsToObservable ) {
  93115. boundObservables.set( toObservable, bindings );
  93116. }
  93117. }
  93118. // Synchronizes {@link Observable#_boundProperties} and {@link Observable#_boundObservables}
  93119. // with {@link BindChain}.
  93120. //
  93121. // Assuming the following binding being created
  93122. //
  93123. // A.bind( 'a', 'b' ).to( B, 'x', 'y' );
  93124. //
  93125. // the following bindings were initialized by {@link Observable#bind} in {@link BindChain#_bindings}:
  93126. //
  93127. // {
  93128. // a: { observable: A, property: 'a', to: [] },
  93129. // b: { observable: A, property: 'b', to: [] },
  93130. // }
  93131. //
  93132. // Iterate over all bindings in this chain and fill their `to` properties with
  93133. // corresponding to( ... ) arguments (components of the binding), so
  93134. //
  93135. // {
  93136. // a: { observable: A, property: 'a', to: [ B, 'x' ] },
  93137. // b: { observable: A, property: 'b', to: [ B, 'y' ] },
  93138. // }
  93139. //
  93140. // Then update the structure of {@link Observable#_boundObservables} with updated
  93141. // binding, so it becomes:
  93142. //
  93143. // Map( {
  93144. // B: {
  93145. // x: Set( [
  93146. // { observable: A, property: 'a', to: [ [ B, 'x' ] ] }
  93147. // ] ),
  93148. // y: Set( [
  93149. // { observable: A, property: 'b', to: [ [ B, 'y' ] ] },
  93150. // ] )
  93151. // }
  93152. // } )
  93153. //
  93154. // @private
  93155. // @param {BindChain} chain The binding initialized by {@link Observable#bind}.
  93156. function updateBindToBound( chain ) {
  93157. let toProperty;
  93158. chain._bindings.forEach( ( binding, propertyName ) => {
  93159. // Note: For a binding without a callback, this will run only once
  93160. // like in A.bind( 'x', 'y' ).to( B, 'a', 'b' )
  93161. // TODO: ES6 destructuring.
  93162. chain._to.forEach( to => {
  93163. toProperty = to.properties[ binding.callback ? 0 : chain._bindProperties.indexOf( propertyName ) ];
  93164. binding.to.push( [ to.observable, toProperty ] );
  93165. updateBoundObservables( chain._observable, binding, to.observable, toProperty );
  93166. } );
  93167. } );
  93168. }
  93169. // Updates an property of a {@link Observable} with a value
  93170. // determined by an entry in {@link Observable#_boundProperties}.
  93171. //
  93172. // @private
  93173. // @param {Observable} observable A observable which property is to be updated.
  93174. // @param {String} propertyName An property to be updated.
  93175. function updateBoundObservableProperty( observable, propertyName ) {
  93176. const boundProperties = observable[ boundPropertiesSymbol ];
  93177. const binding = boundProperties.get( propertyName );
  93178. let propertyValue;
  93179. // When a binding with callback is created like
  93180. //
  93181. // A.bind( 'a' ).to( B, 'b', C, 'c', callback );
  93182. //
  93183. // collect B.b and C.c, then pass them to callback to set A.a.
  93184. if ( binding.callback ) {
  93185. propertyValue = binding.callback.apply( observable, binding.to.map( to => to[ 0 ][ to[ 1 ] ] ) );
  93186. } else {
  93187. propertyValue = binding.to[ 0 ];
  93188. propertyValue = propertyValue[ 0 ][ propertyValue[ 1 ] ];
  93189. }
  93190. if ( Object.prototype.hasOwnProperty.call( observable, propertyName ) ) {
  93191. observable[ propertyName ] = propertyValue;
  93192. } else {
  93193. observable.set( propertyName, propertyValue );
  93194. }
  93195. }
  93196. // Starts listening to changes in {@link BindChain._to} observables to update
  93197. // {@link BindChain._observable} {@link BindChain._bindProperties}. Also sets the
  93198. // initial state of {@link BindChain._observable}.
  93199. //
  93200. // @private
  93201. // @param {BindChain} chain The chain initialized by {@link Observable#bind}.
  93202. function attachBindToListeners( observable, toBindings ) {
  93203. toBindings.forEach( to => {
  93204. const boundObservables = observable[ boundObservablesSymbol ];
  93205. let bindings;
  93206. // If there's already a chain between the observables (`observable` listens to
  93207. // `to.observable`), there's no need to create another `change` event listener.
  93208. if ( !boundObservables.get( to.observable ) ) {
  93209. observable.listenTo( to.observable, 'change', ( evt, propertyName ) => {
  93210. bindings = boundObservables.get( to.observable )[ propertyName ];
  93211. // Note: to.observable will fire for any property change, react
  93212. // to changes of properties which are bound only.
  93213. if ( bindings ) {
  93214. bindings.forEach( binding => {
  93215. updateBoundObservableProperty( observable, binding.property );
  93216. } );
  93217. }
  93218. } );
  93219. }
  93220. } );
  93221. }
  93222. /**
  93223. * An interface which adds "observable properties" and data binding functionality.
  93224. *
  93225. * Can be easily implemented by a class by mixing the {@link module:utils/observablemixin~ObservableMixin} mixin.
  93226. *
  93227. * Read more about the usage of this interface in the:
  93228. * * {@glink framework/guides/architecture/core-editor-architecture#event-system-and-observables "Event system and observables"}
  93229. * section of the {@glink framework/guides/architecture/core-editor-architecture "Core editor architecture"} guide,
  93230. * * {@glink framework/guides/deep-dive/observables "Observables" deep dive} guide.
  93231. *
  93232. * @interface Observable
  93233. * @extends module:utils/emittermixin~Emitter
  93234. */
  93235. /**
  93236. * Fired when a property changed value.
  93237. *
  93238. * observable.set( 'prop', 1 );
  93239. *
  93240. * observable.on( 'change:prop', ( evt, propertyName, newValue, oldValue ) => {
  93241. * console.log( `${ propertyName } has changed from ${ oldValue } to ${ newValue }` );
  93242. * } );
  93243. *
  93244. * observable.prop = 2; // -> 'prop has changed from 1 to 2'
  93245. *
  93246. * @event change:{property}
  93247. * @param {String} name The property name.
  93248. * @param {*} value The new property value.
  93249. * @param {*} oldValue The previous property value.
  93250. */
  93251. /**
  93252. * Fired when a property value is going to be set but is not set yet (before the `change` event is fired).
  93253. *
  93254. * You can control the final value of the property by using
  93255. * the {@link module:utils/eventinfo~EventInfo#return event's `return` property}.
  93256. *
  93257. * observable.set( 'prop', 1 );
  93258. *
  93259. * observable.on( 'set:prop', ( evt, propertyName, newValue, oldValue ) => {
  93260. * console.log( `Value is going to be changed from ${ oldValue } to ${ newValue }` );
  93261. * console.log( `Current property value is ${ observable[ propertyName ] }` );
  93262. *
  93263. * // Let's override the value.
  93264. * evt.return = 3;
  93265. * } );
  93266. *
  93267. * observable.on( 'change:prop', ( evt, propertyName, newValue, oldValue ) => {
  93268. * console.log( `Value has changed from ${ oldValue } to ${ newValue }` );
  93269. * } );
  93270. *
  93271. * observable.prop = 2; // -> 'Value is going to be changed from 1 to 2'
  93272. * // -> 'Current property value is 1'
  93273. * // -> 'Value has changed from 1 to 3'
  93274. *
  93275. * **Note:** The event is fired even when the new value is the same as the old value.
  93276. *
  93277. * @event set:{property}
  93278. * @param {String} name The property name.
  93279. * @param {*} value The new property value.
  93280. * @param {*} oldValue The previous property value.
  93281. */
  93282. /**
  93283. * Creates and sets the value of an observable property of this object. Such a property becomes a part
  93284. * of the state and is observable.
  93285. *
  93286. * It accepts also a single object literal containing key/value pairs with properties to be set.
  93287. *
  93288. * This method throws the `observable-set-cannot-override` error if the observable instance already
  93289. * has a property with the given property name. This prevents from mistakenly overriding existing
  93290. * properties and methods, but means that `foo.set( 'bar', 1 )` may be slightly slower than `foo.bar = 1`.
  93291. *
  93292. * @method #set
  93293. * @param {String|Object} name The property's name or object with `name=>value` pairs.
  93294. * @param {*} [value] The property's value (if `name` was passed in the first parameter).
  93295. */
  93296. /**
  93297. * Binds {@link #set observable properties} to other objects implementing the
  93298. * {@link module:utils/observablemixin~Observable} interface.
  93299. *
  93300. * Read more in the {@glink framework/guides/deep-dive/observables#property-bindings dedicated guide}
  93301. * covering the topic of property bindings with some additional examples.
  93302. *
  93303. * Consider two objects: a `button` and an associated `command` (both `Observable`).
  93304. *
  93305. * A simple property binding could be as follows:
  93306. *
  93307. * button.bind( 'isEnabled' ).to( command, 'isEnabled' );
  93308. *
  93309. * or even shorter:
  93310. *
  93311. * button.bind( 'isEnabled' ).to( command );
  93312. *
  93313. * which works in the following way:
  93314. *
  93315. * * `button.isEnabled` **instantly equals** `command.isEnabled`,
  93316. * * whenever `command.isEnabled` changes, `button.isEnabled` will immediately reflect its value.
  93317. *
  93318. * **Note**: To release the binding, use {@link module:utils/observablemixin~Observable#unbind}.
  93319. *
  93320. * You can also "rename" the property in the binding by specifying the new name in the `to()` chain:
  93321. *
  93322. * button.bind( 'isEnabled' ).to( command, 'isWorking' );
  93323. *
  93324. * It is possible to bind more than one property at a time to shorten the code:
  93325. *
  93326. * button.bind( 'isEnabled', 'value' ).to( command );
  93327. *
  93328. * which corresponds to:
  93329. *
  93330. * button.bind( 'isEnabled' ).to( command );
  93331. * button.bind( 'value' ).to( command );
  93332. *
  93333. * The binding can include more than one observable, combining multiple data sources in a custom callback:
  93334. *
  93335. * button.bind( 'isEnabled' ).to( command, 'isEnabled', ui, 'isVisible',
  93336. * ( isCommandEnabled, isUIVisible ) => isCommandEnabled && isUIVisible );
  93337. *
  93338. * Using a custom callback allows processing the value before passing it to the target property:
  93339. *
  93340. * button.bind( 'isEnabled' ).to( command, 'value', value => value === 'heading1' );
  93341. *
  93342. * It is also possible to bind to the same property in an array of observables.
  93343. * To bind a `button` to multiple commands (also `Observables`) so that each and every one of them
  93344. * must be enabled for the button to become enabled, use the following code:
  93345. *
  93346. * button.bind( 'isEnabled' ).toMany( [ commandA, commandB, commandC ], 'isEnabled',
  93347. * ( isAEnabled, isBEnabled, isCEnabled ) => isAEnabled && isBEnabled && isCEnabled );
  93348. *
  93349. * @method #bind
  93350. * @param {...String} bindProperties Observable properties that will be bound to other observable(s).
  93351. * @returns {Object} The bind chain with the `to()` and `toMany()` methods.
  93352. */
  93353. /**
  93354. * Removes the binding created with {@link #bind}.
  93355. *
  93356. * // Removes the binding for the 'a' property.
  93357. * A.unbind( 'a' );
  93358. *
  93359. * // Removes bindings for all properties.
  93360. * A.unbind();
  93361. *
  93362. * @method #unbind
  93363. * @param {...String} [unbindProperties] Observable properties to be unbound. All the bindings will
  93364. * be released if no properties are provided.
  93365. */
  93366. /**
  93367. * Turns the given methods of this object into event-based ones. This means that the new method will fire an event
  93368. * (named after the method) and the original action will be plugged as a listener to that event.
  93369. *
  93370. * Read more in the {@glink framework/guides/deep-dive/observables#decorating-object-methods dedicated guide}
  93371. * covering the topic of decorating methods with some additional examples.
  93372. *
  93373. * Decorating the method does not change its behavior (it only adds an event),
  93374. * but it allows to modify it later on by listening to the method's event.
  93375. *
  93376. * For example, to cancel the method execution the event can be {@link module:utils/eventinfo~EventInfo#stop stopped}:
  93377. *
  93378. * class Foo {
  93379. * constructor() {
  93380. * this.decorate( 'method' );
  93381. * }
  93382. *
  93383. * method() {
  93384. * console.log( 'called!' );
  93385. * }
  93386. * }
  93387. *
  93388. * const foo = new Foo();
  93389. * foo.on( 'method', ( evt ) => {
  93390. * evt.stop();
  93391. * }, { priority: 'high' } );
  93392. *
  93393. * foo.method(); // Nothing is logged.
  93394. *
  93395. *
  93396. * **Note**: The high {@link module:utils/priorities~PriorityString priority} listener
  93397. * has been used to execute this particular callback before the one which calls the original method
  93398. * (which uses the "normal" priority).
  93399. *
  93400. * It is also possible to change the returned value:
  93401. *
  93402. * foo.on( 'method', ( evt ) => {
  93403. * evt.return = 'Foo!';
  93404. * } );
  93405. *
  93406. * foo.method(); // -> 'Foo'
  93407. *
  93408. * Finally, it is possible to access and modify the arguments the method is called with:
  93409. *
  93410. * method( a, b ) {
  93411. * console.log( `${ a }, ${ b }` );
  93412. * }
  93413. *
  93414. * // ...
  93415. *
  93416. * foo.on( 'method', ( evt, args ) => {
  93417. * args[ 0 ] = 3;
  93418. *
  93419. * console.log( args[ 1 ] ); // -> 2
  93420. * }, { priority: 'high' } );
  93421. *
  93422. * foo.method( 1, 2 ); // -> '3, 2'
  93423. *
  93424. * @method #decorate
  93425. * @param {String} methodName Name of the method to decorate.
  93426. */
  93427. /***/ }),
  93428. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/priorities.js":
  93429. /*!******************************************************************!*\
  93430. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/priorities.js ***!
  93431. \******************************************************************/
  93432. /*! exports provided: default */
  93433. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  93434. "use strict";
  93435. __webpack_require__.r(__webpack_exports__);
  93436. /**
  93437. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  93438. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  93439. */
  93440. /**
  93441. * @module utils/priorities
  93442. */
  93443. /**
  93444. * String representing a priority value.
  93445. *
  93446. * @typedef {'highest'|'high'|'normal'|'low'|'lowest'} module:utils/priorities~PriorityString
  93447. */
  93448. /**
  93449. * Provides group of constants to use instead of hardcoding numeric priority values.
  93450. *
  93451. * @namespace
  93452. */
  93453. const priorities = {
  93454. /**
  93455. * Converts a string with priority name to it's numeric value. If `Number` is given, it just returns it.
  93456. *
  93457. * @static
  93458. * @param {module:utils/priorities~PriorityString|Number} priority Priority to convert.
  93459. * @returns {Number} Converted priority.
  93460. */
  93461. get( priority ) {
  93462. if ( typeof priority != 'number' ) {
  93463. return this[ priority ] || this.normal;
  93464. } else {
  93465. return priority;
  93466. }
  93467. },
  93468. highest: 100000,
  93469. high: 1000,
  93470. normal: 0,
  93471. low: -1000,
  93472. lowest: -100000
  93473. };
  93474. /* harmony default export */ __webpack_exports__["default"] = (priorities);
  93475. /***/ }),
  93476. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/spy.js":
  93477. /*!***********************************************************!*\
  93478. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/spy.js ***!
  93479. \***********************************************************/
  93480. /*! exports provided: default */
  93481. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  93482. "use strict";
  93483. __webpack_require__.r(__webpack_exports__);
  93484. /**
  93485. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  93486. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  93487. */
  93488. /**
  93489. * @module utils/spy
  93490. */
  93491. /**
  93492. * Creates a spy function (ala Sinon.js) that can be used to inspect call to it.
  93493. *
  93494. * The following are the present features:
  93495. *
  93496. * * spy.called: property set to `true` if the function has been called at least once.
  93497. *
  93498. * @returns {Function} The spy function.
  93499. */
  93500. function spy() {
  93501. return function spy() {
  93502. spy.called = true;
  93503. };
  93504. }
  93505. /* harmony default export */ __webpack_exports__["default"] = (spy);
  93506. /***/ }),
  93507. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/toarray.js":
  93508. /*!***************************************************************!*\
  93509. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/toarray.js ***!
  93510. \***************************************************************/
  93511. /*! exports provided: default */
  93512. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  93513. "use strict";
  93514. __webpack_require__.r(__webpack_exports__);
  93515. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return toArray; });
  93516. /**
  93517. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  93518. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  93519. */
  93520. /**
  93521. * @module utils/toarray
  93522. */
  93523. /**
  93524. * Transforms any value to an array. If the provided value is already an array, it is returned unchanged.
  93525. *
  93526. * @param {*} data The value to transform to an array.
  93527. * @returns {Array} An array created from data.
  93528. */
  93529. function toArray( data ) {
  93530. return Array.isArray( data ) ? data : [ data ];
  93531. }
  93532. /***/ }),
  93533. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/tomap.js":
  93534. /*!*************************************************************!*\
  93535. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/tomap.js ***!
  93536. \*************************************************************/
  93537. /*! exports provided: default */
  93538. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  93539. "use strict";
  93540. __webpack_require__.r(__webpack_exports__);
  93541. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return toMap; });
  93542. /* harmony import */ var _objecttomap__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./objecttomap */ "./node_modules/@ckeditor/ckeditor5-utils/src/objecttomap.js");
  93543. /* harmony import */ var _isiterable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isiterable */ "./node_modules/@ckeditor/ckeditor5-utils/src/isiterable.js");
  93544. /**
  93545. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  93546. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  93547. */
  93548. /**
  93549. * @module utils/tomap
  93550. */
  93551. /**
  93552. * Transforms object or iterable to map. Iterable needs to be in the format acceptable by the `Map` constructor.
  93553. *
  93554. * map = toMap( { 'foo': 1, 'bar': 2 } );
  93555. * map = toMap( [ [ 'foo', 1 ], [ 'bar', 2 ] ] );
  93556. * map = toMap( anotherMap );
  93557. *
  93558. * @param {Object|Iterable} data Object or iterable to transform.
  93559. * @returns {Map} Map created from data.
  93560. */
  93561. function toMap( data ) {
  93562. if ( Object(_isiterable__WEBPACK_IMPORTED_MODULE_1__["default"])( data ) ) {
  93563. return new Map( data );
  93564. } else {
  93565. return Object(_objecttomap__WEBPACK_IMPORTED_MODULE_0__["default"])( data );
  93566. }
  93567. }
  93568. /***/ }),
  93569. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/translation-service.js":
  93570. /*!***************************************************************************!*\
  93571. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/translation-service.js ***!
  93572. \***************************************************************************/
  93573. /*! exports provided: add, _translate, _clear */
  93574. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  93575. "use strict";
  93576. __webpack_require__.r(__webpack_exports__);
  93577. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "add", function() { return add; });
  93578. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_translate", function() { return _translate; });
  93579. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_clear", function() { return _clear; });
  93580. /* harmony import */ var _ckeditorerror__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  93581. /**
  93582. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  93583. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  93584. */
  93585. /* globals window */
  93586. /**
  93587. * @module utils/translation-service
  93588. */
  93589. /* istanbul ignore else */
  93590. if ( !window.CKEDITOR_TRANSLATIONS ) {
  93591. window.CKEDITOR_TRANSLATIONS = {};
  93592. }
  93593. /**
  93594. * Adds translations to existing ones or overrides the existing translations. These translations will later
  93595. * be available for the {@link module:utils/locale~Locale#t `t()`} function.
  93596. *
  93597. * The `translations` is an object which consists of `messageId: translation` pairs. Note that the message ID can be
  93598. * either constructed from the message string or from the message ID if it was passed
  93599. * (this happens rarely and mostly for short messages or messages with placeholders).
  93600. * Since the editor displays only the message string, the message ID can be found either in the source code or in the
  93601. * built translations for another language.
  93602. *
  93603. * add( 'pl', {
  93604. * 'Cancel': 'Anuluj',
  93605. * 'IMAGE': 'obraz', // Note that the `IMAGE` comes from the message ID, while the string can be `image`.
  93606. * } );
  93607. *
  93608. * If the message is supposed to support various plural forms, make sure to provide an array with the singular form and all plural forms:
  93609. *
  93610. * add( 'pl', {
  93611. * 'Add space': [ 'Dodaj spację', 'Dodaj %0 spacje', 'Dodaj %0 spacji' ]
  93612. * } );
  93613. *
  93614. * You should also specify the third argument (the `getPluralForm()` function) that will be used to determine the plural form if no
  93615. * language file was loaded for that language. All language files coming from CKEditor 5 sources will have this option set, so
  93616. * these plural form rules will be reused by other translations added to the registered languages. The `getPluralForm()` function
  93617. * can return either a Boolean or a number.
  93618. *
  93619. * add( 'en', {
  93620. * // ... Translations.
  93621. * }, n => n !== 1 );
  93622. * add( 'pl', {
  93623. * // ... Translations.
  93624. * }, n => n == 1 ? 0 : n % 10 >= 2 && n % 10 <= 4 && ( n % 100 < 10 || n % 100 >= 20 ) ? 1 : 2 );
  93625. *
  93626. * All translations extend the global `window.CKEDITOR_TRANSLATIONS` object. An example of this object can be found below:
  93627. *
  93628. * {
  93629. * pl: {
  93630. * dictionary: {
  93631. * 'Cancel': 'Anuluj',
  93632. * 'Add space': [ 'Dodaj spację', 'Dodaj %0 spacje', 'Dodaj %0 spacji' ]
  93633. * },
  93634. * // A function that returns the plural form index.
  93635. * getPluralForm: n => n !==1
  93636. * }
  93637. * // Other languages.
  93638. * }
  93639. *
  93640. * If you cannot import this function from this module (e.g. because you use a CKEditor 5 build), you can
  93641. * still add translations by extending the global `window.CKEDITOR_TRANSLATIONS` object by using a function like
  93642. * the one below:
  93643. *
  93644. * function addTranslations( language, translations, getPluralForm ) {
  93645. * if ( !window.CKEDITOR_TRANSLATIONS ) {
  93646. * window.CKEDITOR_TRANSLATIONS = {};
  93647. * }
  93648. * if ( !window.CKEDITOR_TRANSLATIONS[ language ] ) {
  93649. * window.CKEDITOR_TRANSLATIONS[ language ] = {};
  93650. * }
  93651. *
  93652. * const languageTranslations = window.CKEDITOR_TRANSLATIONS[ language ];
  93653. *
  93654. * languageTranslations.dictionary = languageTranslations.dictionary || {};
  93655. * languageTranslations.getPluralForm = getPluralForm || languageTranslations.getPluralForm;
  93656. *
  93657. * // Extend the dictionary for the given language.
  93658. * Object.assign( languageTranslations.dictionary, translations );
  93659. * }
  93660. *
  93661. * @param {String} language Target language.
  93662. * @param {Object.<String,*>} translations An object with translations which will be added to the dictionary.
  93663. * For each message ID the value should be either a translation or an array of translations if the message
  93664. * should support plural forms.
  93665. * @param {Function} getPluralForm A function that returns the plural form index (a number).
  93666. */
  93667. function add( language, translations, getPluralForm ) {
  93668. if ( !window.CKEDITOR_TRANSLATIONS[ language ] ) {
  93669. window.CKEDITOR_TRANSLATIONS[ language ] = {};
  93670. }
  93671. const languageTranslations = window.CKEDITOR_TRANSLATIONS[ language ];
  93672. languageTranslations.dictionary = languageTranslations.dictionary || {};
  93673. languageTranslations.getPluralForm = getPluralForm || languageTranslations.getPluralForm;
  93674. Object.assign( languageTranslations.dictionary, translations );
  93675. }
  93676. /**
  93677. * **Note:** This method is internal, use {@link module:utils/locale~Locale#t the `t()` function} instead to translate
  93678. * the editor UI parts.
  93679. *
  93680. * This function is responsible for translating messages to the specified language. It uses translations added perviously
  93681. * by {@link module:utils/translation-service~add} (a translations dictionary and the `getPluralForm()` function
  93682. * to provide accurate translations of plural forms).
  93683. *
  93684. * When no translation is defined in the dictionary or the dictionary does not exist, this function returns
  93685. * the original message string or the message plural depending on the number of elements.
  93686. *
  93687. * translate( 'pl', { string: 'Cancel' } ); // 'Cancel'
  93688. *
  93689. * The third optional argument is the number of elements, based on which the single form or one of the plural forms
  93690. * should be picked when the message is supposed to support various plural forms.
  93691. *
  93692. * translate( 'en', { string: 'Add a space', plural: 'Add %0 spaces' }, 1 ); // 'Add a space'
  93693. * translate( 'en', { string: 'Add a space', plural: 'Add %0 spaces' }, 3 ); // 'Add %0 spaces'
  93694. *
  93695. * The message should provide an ID using the `id` property when the message strings are not unique and their
  93696. * translations should be different.
  93697. *
  93698. * translate( 'en', { string: 'image', id: 'ADD_IMAGE' } );
  93699. * translate( 'en', { string: 'image', id: 'AN_IMAGE' } );
  93700. *
  93701. * @protected
  93702. * @param {String} language Target language.
  93703. * @param {module:utils/translation-service~Message|String} message A message that will be translated.
  93704. * @param {Number} [quantity] The number of elements for which a plural form should be picked from the target language dictionary.
  93705. * @returns {String} Translated sentence.
  93706. */
  93707. function _translate( language, message, quantity = 1 ) {
  93708. if ( typeof quantity !== 'number' ) {
  93709. /**
  93710. * An incorrect value was passed to the translation function. This was probably caused
  93711. * by an incorrect message interpolation of a plural form. Note that for messages supporting plural forms
  93712. * the second argument of the `t()` function should always be a number or an array with a number as the first element.
  93713. *
  93714. * @error translation-service-quantity-not-a-number
  93715. */
  93716. throw new _ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"]( 'translation-service-quantity-not-a-number', null, { quantity } );
  93717. }
  93718. const numberOfLanguages = getNumberOfLanguages();
  93719. if ( numberOfLanguages === 1 ) {
  93720. // Override the language to the only supported one.
  93721. // This can't be done in the `Locale` class, because the translations comes after the `Locale` class initialization.
  93722. language = Object.keys( window.CKEDITOR_TRANSLATIONS )[ 0 ];
  93723. }
  93724. const messageId = message.id || message.string;
  93725. if ( numberOfLanguages === 0 || !hasTranslation( language, messageId ) ) {
  93726. if ( quantity !== 1 ) {
  93727. // Return the default plural form that was passed in the `message.plural` parameter.
  93728. return message.plural;
  93729. }
  93730. return message.string;
  93731. }
  93732. const dictionary = window.CKEDITOR_TRANSLATIONS[ language ].dictionary;
  93733. const getPluralForm = window.CKEDITOR_TRANSLATIONS[ language ].getPluralForm || ( n => n === 1 ? 0 : 1 );
  93734. if ( typeof dictionary[ messageId ] === 'string' ) {
  93735. return dictionary[ messageId ];
  93736. }
  93737. const pluralFormIndex = Number( getPluralForm( quantity ) );
  93738. // Note: The `translate` function is not responsible for replacing `%0, %1, ...` with values.
  93739. return dictionary[ messageId ][ pluralFormIndex ];
  93740. }
  93741. /**
  93742. * Clears dictionaries for test purposes.
  93743. *
  93744. * @protected
  93745. */
  93746. function _clear() {
  93747. window.CKEDITOR_TRANSLATIONS = {};
  93748. }
  93749. // Checks whether the dictionary exists and translation in that dictionary exists.
  93750. function hasTranslation( language, messageId ) {
  93751. return (
  93752. !!window.CKEDITOR_TRANSLATIONS[ language ] &&
  93753. !!window.CKEDITOR_TRANSLATIONS[ language ].dictionary[ messageId ]
  93754. );
  93755. }
  93756. function getNumberOfLanguages() {
  93757. return Object.keys( window.CKEDITOR_TRANSLATIONS ).length;
  93758. }
  93759. /**
  93760. * The internationalization message interface. A message that implements this interface can be passed to the `t()` function
  93761. * to be translated to the target UI language.
  93762. *
  93763. * @typedef {Object} module:utils/translation-service~Message
  93764. *
  93765. * @property {String} string The message string to translate. Acts as a default translation if the translation for a given language
  93766. * is not defined. When the message is supposed to support plural forms, the string should be the English singular form of the message.
  93767. * @property {String} [id] The message ID. If passed, the message ID is taken from this property instead of the `message.string`.
  93768. * This property is useful when various messages share the same message string, for example, the `editor` string in `in the editor`
  93769. * and `my editor` sentences.
  93770. * @property {String} [plural] The plural form of the message. This property should be skipped when a message is not supposed
  93771. * to support plural forms. Otherwise it should always be set to a string with the English plural form of the message.
  93772. */
  93773. /***/ }),
  93774. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/uid.js":
  93775. /*!***********************************************************!*\
  93776. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/uid.js ***!
  93777. \***********************************************************/
  93778. /*! exports provided: default */
  93779. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  93780. "use strict";
  93781. __webpack_require__.r(__webpack_exports__);
  93782. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return uid; });
  93783. /**
  93784. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  93785. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  93786. */
  93787. /**
  93788. * @module utils/uid
  93789. */
  93790. // A hash table of hex numbers to avoid using toString() in uid() which is costly.
  93791. // [ '00', '01', '02', ..., 'fe', 'ff' ]
  93792. const HEX_NUMBERS = new Array( 256 ).fill()
  93793. .map( ( val, index ) => ( '0' + ( index ).toString( 16 ) ).slice( -2 ) );
  93794. /**
  93795. * Returns a unique id. The id starts with an "e" character and a randomly generated string of
  93796. * 32 alphanumeric characters.
  93797. *
  93798. * **Note**: The characters the unique id is built from correspond to the hex number notation
  93799. * (from "0" to "9", from "a" to "f"). In other words, each id corresponds to an "e" followed
  93800. * by 16 8-bit numbers next to each other.
  93801. *
  93802. * @returns {String} An unique id string.
  93803. */
  93804. function uid() {
  93805. // Let's create some positive random 32bit integers first.
  93806. //
  93807. // 1. Math.random() is a float between 0 and 1.
  93808. // 2. 0x100000000 is 2^32 = 4294967296.
  93809. // 3. >>> 0 enforces integer (in JS all numbers are floating point).
  93810. //
  93811. // For instance:
  93812. // Math.random() * 0x100000000 = 3366450031.853859
  93813. // but
  93814. // Math.random() * 0x100000000 >>> 0 = 3366450031.
  93815. const r1 = Math.random() * 0x100000000 >>> 0;
  93816. const r2 = Math.random() * 0x100000000 >>> 0;
  93817. const r3 = Math.random() * 0x100000000 >>> 0;
  93818. const r4 = Math.random() * 0x100000000 >>> 0;
  93819. // Make sure that id does not start with number.
  93820. return 'e' +
  93821. HEX_NUMBERS[ r1 >> 0 & 0xFF ] +
  93822. HEX_NUMBERS[ r1 >> 8 & 0xFF ] +
  93823. HEX_NUMBERS[ r1 >> 16 & 0xFF ] +
  93824. HEX_NUMBERS[ r1 >> 24 & 0xFF ] +
  93825. HEX_NUMBERS[ r2 >> 0 & 0xFF ] +
  93826. HEX_NUMBERS[ r2 >> 8 & 0xFF ] +
  93827. HEX_NUMBERS[ r2 >> 16 & 0xFF ] +
  93828. HEX_NUMBERS[ r2 >> 24 & 0xFF ] +
  93829. HEX_NUMBERS[ r3 >> 0 & 0xFF ] +
  93830. HEX_NUMBERS[ r3 >> 8 & 0xFF ] +
  93831. HEX_NUMBERS[ r3 >> 16 & 0xFF ] +
  93832. HEX_NUMBERS[ r3 >> 24 & 0xFF ] +
  93833. HEX_NUMBERS[ r4 >> 0 & 0xFF ] +
  93834. HEX_NUMBERS[ r4 >> 8 & 0xFF ] +
  93835. HEX_NUMBERS[ r4 >> 16 & 0xFF ] +
  93836. HEX_NUMBERS[ r4 >> 24 & 0xFF ];
  93837. }
  93838. /***/ }),
  93839. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/unicode.js":
  93840. /*!***************************************************************!*\
  93841. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/unicode.js ***!
  93842. \***************************************************************/
  93843. /*! exports provided: isCombiningMark, isHighSurrogateHalf, isLowSurrogateHalf, isInsideSurrogatePair, isInsideCombinedSymbol */
  93844. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  93845. "use strict";
  93846. __webpack_require__.r(__webpack_exports__);
  93847. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isCombiningMark", function() { return isCombiningMark; });
  93848. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isHighSurrogateHalf", function() { return isHighSurrogateHalf; });
  93849. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isLowSurrogateHalf", function() { return isLowSurrogateHalf; });
  93850. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isInsideSurrogatePair", function() { return isInsideSurrogatePair; });
  93851. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isInsideCombinedSymbol", function() { return isInsideCombinedSymbol; });
  93852. /**
  93853. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  93854. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  93855. */
  93856. /**
  93857. * Set of utils to handle unicode characters.
  93858. *
  93859. * @module utils/unicode
  93860. */
  93861. /**
  93862. * Checks whether given `character` is a combining mark.
  93863. *
  93864. * @param {String} character Character to check.
  93865. * @returns {Boolean}
  93866. */
  93867. function isCombiningMark( character ) {
  93868. // eslint-disable-next-line no-misleading-character-class
  93869. return !!character && character.length == 1 && /[\u0300-\u036f\u1ab0-\u1aff\u1dc0-\u1dff\u20d0-\u20ff\ufe20-\ufe2f]/.test( character );
  93870. }
  93871. /**
  93872. * Checks whether given `character` is a high half of surrogate pair.
  93873. *
  93874. * Using UTF-16 terminology, a surrogate pair denotes UTF-16 character using two UTF-8 characters. The surrogate pair
  93875. * consist of high surrogate pair character followed by low surrogate pair character.
  93876. *
  93877. * @param {String} character Character to check.
  93878. * @returns {Boolean}
  93879. */
  93880. function isHighSurrogateHalf( character ) {
  93881. return !!character && character.length == 1 && /[\ud800-\udbff]/.test( character );
  93882. }
  93883. /**
  93884. * Checks whether given `character` is a low half of surrogate pair.
  93885. *
  93886. * Using UTF-16 terminology, a surrogate pair denotes UTF-16 character using two UTF-8 characters. The surrogate pair
  93887. * consist of high surrogate pair character followed by low surrogate pair character.
  93888. *
  93889. * @param {String} character Character to check.
  93890. * @returns {Boolean}
  93891. */
  93892. function isLowSurrogateHalf( character ) {
  93893. return !!character && character.length == 1 && /[\udc00-\udfff]/.test( character );
  93894. }
  93895. /**
  93896. * Checks whether given offset in a string is inside a surrogate pair (between two surrogate halves).
  93897. *
  93898. * @param {String} string String to check.
  93899. * @param {Number} offset Offset to check.
  93900. * @returns {Boolean}
  93901. */
  93902. function isInsideSurrogatePair( string, offset ) {
  93903. return isHighSurrogateHalf( string.charAt( offset - 1 ) ) && isLowSurrogateHalf( string.charAt( offset ) );
  93904. }
  93905. /**
  93906. * Checks whether given offset in a string is between base character and combining mark or between two combining marks.
  93907. *
  93908. * @param {String} string String to check.
  93909. * @param {Number} offset Offset to check.
  93910. * @returns {Boolean}
  93911. */
  93912. function isInsideCombinedSymbol( string, offset ) {
  93913. return isCombiningMark( string.charAt( offset ) );
  93914. }
  93915. /***/ }),
  93916. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/version.js":
  93917. /*!***************************************************************!*\
  93918. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/version.js ***!
  93919. \***************************************************************/
  93920. /*! exports provided: default */
  93921. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  93922. "use strict";
  93923. __webpack_require__.r(__webpack_exports__);
  93924. /* WEBPACK VAR INJECTION */(function(global) {/* harmony import */ var _ckeditorerror__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  93925. /**
  93926. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  93927. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  93928. */
  93929. /**
  93930. * @module utils/version
  93931. */
  93932. /* globals window, global */
  93933. const version = '28.0.0';
  93934. /* harmony default export */ __webpack_exports__["default"] = (version);
  93935. /* istanbul ignore next */
  93936. const windowOrGlobal = typeof window === 'object' ? window : global;
  93937. /* istanbul ignore next */
  93938. if ( windowOrGlobal.CKEDITOR_VERSION ) {
  93939. /**
  93940. * This error is thrown when due to a mistake in how CKEditor 5 was installed or initialized, some
  93941. * of its modules were duplicated (evaluated and executed twice). Module duplication leads to inevitable runtime
  93942. * errors.
  93943. *
  93944. * There are many situations in which some modules can be loaded twice. In the worst case scenario,
  93945. * you may need to check your project for each of these issues and fix them all.
  93946. *
  93947. * # Trying to add a plugin to an existing build
  93948. *
  93949. * If you import an existing CKEditor 5 build and a plugin like this:
  93950. *
  93951. * import ClassicEditor from '@ckeditor/ckeditor5-build-classic';
  93952. * import Highlight from '@ckeditor/ckeditor5-highlight/src/highlight';
  93953. *
  93954. * Then your project loads some CKEditor 5 packages twice. How does it happen?
  93955. *
  93956. * The build package contains a file which is already compiled with webpack. This means
  93957. * that it contains all the necessary code from e.g. `@ckeditor/ckeditor5-engine` and `@ckeditor/ckeditor5-utils`.
  93958. *
  93959. * However, the `Highlight` plugin imports some of the modules from these packages, too. If you ask webpack to
  93960. * build such a project, you will end up with the modules being included (and run) twice &mdash; first, because they are
  93961. * included inside the build package, and second, because they are required by the `Highlight` plugin.
  93962. *
  93963. * Therefore, **you must never add plugins to an existing build** unless your plugin has no dependencies.
  93964. *
  93965. * Adding plugins to a build is done by taking the source version of this build (so, before it was built with webpack)
  93966. * and adding plugins there. In this situation, webpack will know that it only needs to load each plugin once.
  93967. *
  93968. * Read more in the {@glink builds/guides/integration/installing-plugins "Installing plugins"} guide.
  93969. *
  93970. * # Confused an editor build with an editor implementation
  93971. *
  93972. * This scenario is very similar to the previous one, but has a different origin.
  93973. *
  93974. * Let's assume that you wanted to use CKEditor 5 from source, as explained in the
  93975. * {@glink builds/guides/integration/advanced-setup#scenario-2-building-from-source "Building from source"} section
  93976. * or in the {@glink framework/guides/quick-start "Quick start"} guide of CKEditor 5 Framework.
  93977. *
  93978. * The correct way to do so is to import an editor and plugins and run them together like this:
  93979. *
  93980. * import ClassicEditor from '@ckeditor/ckeditor5-editor-classic/src/classiceditor';
  93981. * import Essentials from '@ckeditor/ckeditor5-essentials/src/essentials';
  93982. * import Paragraph from '@ckeditor/ckeditor5-paragraph/src/paragraph';
  93983. * import Bold from '@ckeditor/ckeditor5-basic-styles/src/bold';
  93984. * import Italic from '@ckeditor/ckeditor5-basic-styles/src/italic';
  93985. *
  93986. * ClassicEditor
  93987. * .create( document.querySelector( '#editor' ), {
  93988. * plugins: [ Essentials, Paragraph, Bold, Italic ],
  93989. * toolbar: [ 'bold', 'italic' ]
  93990. * } )
  93991. * .then( editor => {
  93992. * console.log( 'Editor was initialized', editor );
  93993. * } )
  93994. * .catch( error => {
  93995. * console.error( error.stack );
  93996. * } );
  93997. *
  93998. * However, you might have mistakenly imported a build instead of the source `ClassicEditor`. In this case
  93999. * your imports will look like this:
  94000. *
  94001. * import ClassicEditor from '@ckeditor/ckeditor5-build-classic';
  94002. * import Essentials from '@ckeditor/ckeditor5-essentials/src/essentials';
  94003. * import Paragraph from '@ckeditor/ckeditor5-paragraph/src/paragraph';
  94004. * import Bold from '@ckeditor/ckeditor5-basic-styles/src/bold';
  94005. * import Italic from '@ckeditor/ckeditor5-basic-styles/src/italic';
  94006. *
  94007. * This creates the same situation as in the previous section because you use a build together with source plugins.
  94008. *
  94009. * Remember: `@ckeditor/ckeditor5-build-*` packages contain editor builds and `@ckeditor/ckeditor5-editor-*` contain source editors.
  94010. *
  94011. * # Loading two or more builds on one page
  94012. *
  94013. * If you use CKEditor 5 builds, you might have loaded two (or more) `ckeditor.js` files on one web page.
  94014. * Check your web page for duplicated `<script>` elements or make sure your page builder/bundler includes CKEditor only once.
  94015. *
  94016. * If you want to use two different types of editors at once, see the
  94017. * {@glink builds/guides/integration/advanced-setup#scenario-3-using-two-different-editors "Using two different editors"}
  94018. * section.
  94019. *
  94020. * # Using outdated packages
  94021. *
  94022. * Building CKEditor 5 from source requires using multiple npm packages. These packages have their dependencies
  94023. * to other packages. If you use the latest version of, for example, `@ckeditor/ckeditor5-editor-classic` with
  94024. * an outdated version of `@ckeditor/ckeditor5-image`, npm or yarn will need to install two different versions of
  94025. * `@ckeditor/ckeditor5-core` because `@ckeditor/ckeditor5-editor-classic` and `@ckeditor/ckeditor5-image` may require
  94026. * different versions of the core package.
  94027. *
  94028. * The solution to this issue is to update all packages to their latest version. We recommend
  94029. * using tools like [`npm-check-updates`](https://www.npmjs.com/package/npm-check-updates) which simplify this process.
  94030. *
  94031. * # Conflicting version of dependencies
  94032. *
  94033. * This is a special case of the previous scenario. If you use CKEditor 5 with some third-party plugins,
  94034. * it may happen that even if you use the latest versions of the official packages and the latest version of
  94035. * these third-party packages, there will be a conflict between some of their dependencies.
  94036. *
  94037. * Such a problem can be resolved by either downgrading CKEditor 5 packages (which we do not recommend) or
  94038. * asking the author of the third-party package to upgrade its depdendencies (or forking their project and doing this yourself).
  94039. *
  94040. * **Note:** All official CKEditor 5 packages (excluding integrations and `ckeditor5-dev-*` packages) are released in the
  94041. * 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
  94042. * whether you use packages coming from the same CKEditor 5 version. You can read more about versioning in the
  94043. * {@glink framework/guides/support/versioning-policy Versioning policy} guide.
  94044. *
  94045. * # Packages were duplicated in `node_modules`
  94046. *
  94047. * In some situations, especially when calling `npm install` multiple times, it may happen
  94048. * that npm will not correctly "deduplicate" packages.
  94049. *
  94050. * Normally, npm deduplicates all packages so, for example, `@ckeditor/ckeditor5-core` is installed only once in `node_modules/`.
  94051. * However, it is known to fail to do so from time to time.
  94052. *
  94053. * We recommend checking if any of the steps listed below help:
  94054. *
  94055. * * `rm -rf node_modules && npm install` to make sure you have a clean `node_modules/` directory. This step
  94056. * is known to help in most cases.
  94057. * * If you use `yarn.lock` or `package-lock.json`, remove it before `npm install`.
  94058. * * Check whether all CKEditor 5 packages are up to date and reinstall them
  94059. * if you changed anything (`rm -rf node_modules && npm install`).
  94060. *
  94061. * If all packages are correct and compatible with each other, the steps above are known to help. If not, you may
  94062. * try to check with `npm ls` how many times packages like `@ckeditor/ckeditor5-core`, `@ckeditor/ckeditor5-engine` and
  94063. *`@ckeditor/ckeditor5-utils` are installed. If more than once, verify which package causes that.
  94064. *
  94065. * @error ckeditor-duplicated-modules
  94066. */
  94067. throw new _ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"](
  94068. 'ckeditor-duplicated-modules',
  94069. null
  94070. );
  94071. } else {
  94072. windowOrGlobal.CKEDITOR_VERSION = version;
  94073. }
  94074. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js")))
  94075. /***/ }),
  94076. /***/ "./node_modules/@ckeditor/ckeditor5-widget/src/highlightstack.js":
  94077. /*!***********************************************************************!*\
  94078. !*** ./node_modules/@ckeditor/ckeditor5-widget/src/highlightstack.js ***!
  94079. \***********************************************************************/
  94080. /*! exports provided: default */
  94081. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  94082. "use strict";
  94083. __webpack_require__.r(__webpack_exports__);
  94084. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return HighlightStack; });
  94085. /* 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");
  94086. /* 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");
  94087. /**
  94088. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  94089. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  94090. */
  94091. /**
  94092. * @module widget/highlightstack
  94093. */
  94094. /**
  94095. * Class used to handle correct order of highlights on elements.
  94096. *
  94097. * When different highlights are applied to same element correct order should be preserved:
  94098. *
  94099. * * highlight with highest priority should be applied,
  94100. * * if two highlights have same priority - sort by CSS class provided in
  94101. * {@link module:engine/conversion/downcasthelpers~HighlightDescriptor}.
  94102. *
  94103. * This way, highlight will be applied with the same rules it is applied on texts.
  94104. */
  94105. class HighlightStack {
  94106. /**
  94107. * Creates class instance.
  94108. */
  94109. constructor() {
  94110. this._stack = [];
  94111. }
  94112. /**
  94113. * Adds highlight descriptor to the stack.
  94114. *
  94115. * @fires change:top
  94116. * @param {module:engine/conversion/downcasthelpers~HighlightDescriptor} descriptor
  94117. * @param {module:engine/view/downcastwriter~DowncastWriter} writer
  94118. */
  94119. add( descriptor, writer ) {
  94120. const stack = this._stack;
  94121. // Save top descriptor and insert new one. If top is changed - fire event.
  94122. const oldTop = stack[ 0 ];
  94123. this._insertDescriptor( descriptor );
  94124. const newTop = stack[ 0 ];
  94125. // When new object is at the top and stores different information.
  94126. if ( oldTop !== newTop && !compareDescriptors( oldTop, newTop ) ) {
  94127. this.fire( 'change:top', {
  94128. oldDescriptor: oldTop,
  94129. newDescriptor: newTop,
  94130. writer
  94131. } );
  94132. }
  94133. }
  94134. /**
  94135. * Removes highlight descriptor from the stack.
  94136. *
  94137. * @fires change:top
  94138. * @param {String} id Id of the descriptor to remove.
  94139. * @param {module:engine/view/downcastwriter~DowncastWriter} writer
  94140. */
  94141. remove( id, writer ) {
  94142. const stack = this._stack;
  94143. const oldTop = stack[ 0 ];
  94144. this._removeDescriptor( id );
  94145. const newTop = stack[ 0 ];
  94146. // When new object is at the top and stores different information.
  94147. if ( oldTop !== newTop && !compareDescriptors( oldTop, newTop ) ) {
  94148. this.fire( 'change:top', {
  94149. oldDescriptor: oldTop,
  94150. newDescriptor: newTop,
  94151. writer
  94152. } );
  94153. }
  94154. }
  94155. /**
  94156. * Inserts given descriptor in correct place in the stack. It also takes care about updating information when
  94157. * descriptor with same id is already present.
  94158. *
  94159. * @private
  94160. * @param {module:engine/conversion/downcasthelpers~HighlightDescriptor} descriptor
  94161. */
  94162. _insertDescriptor( descriptor ) {
  94163. const stack = this._stack;
  94164. const index = stack.findIndex( item => item.id === descriptor.id );
  94165. // Inserting exact same descriptor - do nothing.
  94166. if ( compareDescriptors( descriptor, stack[ index ] ) ) {
  94167. return;
  94168. }
  94169. // If descriptor with same id but with different information is on the stack - remove it.
  94170. if ( index > -1 ) {
  94171. stack.splice( index, 1 );
  94172. }
  94173. // Find correct place to insert descriptor in the stack.
  94174. // It have different information (for example priority) so it must be re-inserted in correct place.
  94175. let i = 0;
  94176. while ( stack[ i ] && shouldABeBeforeB( stack[ i ], descriptor ) ) {
  94177. i++;
  94178. }
  94179. stack.splice( i, 0, descriptor );
  94180. }
  94181. /**
  94182. * Removes descriptor with given id from the stack.
  94183. *
  94184. * @private
  94185. * @param {String} id Descriptor's id.
  94186. */
  94187. _removeDescriptor( id ) {
  94188. const stack = this._stack;
  94189. const index = stack.findIndex( item => item.id === id );
  94190. // If descriptor with same id is on the list - remove it.
  94191. if ( index > -1 ) {
  94192. stack.splice( index, 1 );
  94193. }
  94194. }
  94195. }
  94196. Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_1__["default"])( HighlightStack, _ckeditor_ckeditor5_utils_src_emittermixin__WEBPACK_IMPORTED_MODULE_0__["default"] );
  94197. // Compares two descriptors by checking their priority and class list.
  94198. //
  94199. // @param {module:engine/conversion/downcasthelpers~HighlightDescriptor} a
  94200. // @param {module:engine/conversion/downcasthelpers~HighlightDescriptor} b
  94201. // @returns {Boolean} Returns true if both descriptors are defined and have same priority and classes.
  94202. function compareDescriptors( a, b ) {
  94203. return a && b && a.priority == b.priority && classesToString( a.classes ) == classesToString( b.classes );
  94204. }
  94205. // Checks whenever first descriptor should be placed in the stack before second one.
  94206. //
  94207. // @param {module:engine/conversion/downcasthelpers~HighlightDescriptor} a
  94208. // @param {module:engine/conversion/downcasthelpers~HighlightDescriptor} b
  94209. // @returns {Boolean}
  94210. function shouldABeBeforeB( a, b ) {
  94211. if ( a.priority > b.priority ) {
  94212. return true;
  94213. } else if ( a.priority < b.priority ) {
  94214. return false;
  94215. }
  94216. // When priorities are equal and names are different - use classes to compare.
  94217. return classesToString( a.classes ) > classesToString( b.classes );
  94218. }
  94219. // Converts CSS classes passed with {@link module:engine/conversion/downcasthelpers~HighlightDescriptor} to
  94220. // sorted string.
  94221. //
  94222. // @param {String|Array<String>} descriptor
  94223. // @returns {String}
  94224. function classesToString( classes ) {
  94225. return Array.isArray( classes ) ? classes.sort().join( ',' ) : classes;
  94226. }
  94227. /**
  94228. * Fired when top element on {@link module:widget/highlightstack~HighlightStack} has been changed
  94229. *
  94230. * @event change:top
  94231. * @param {Object} data Additional information about the change.
  94232. * @param {module:engine/conversion/downcasthelpers~HighlightDescriptor} [data.newDescriptor] New highlight
  94233. * descriptor. It will be `undefined` when last descriptor is removed from the stack.
  94234. * @param {module:engine/conversion/downcasthelpers~HighlightDescriptor} [data.oldDescriptor] Old highlight
  94235. * descriptor. It will be `undefined` when first descriptor is added to the stack.
  94236. * @param {module:engine/view/downcastwriter~DowncastWriter} writer View writer that can be used to modify element.
  94237. */
  94238. /***/ }),
  94239. /***/ "./node_modules/@ckeditor/ckeditor5-widget/src/index.js":
  94240. /*!**************************************************************!*\
  94241. !*** ./node_modules/@ckeditor/ckeditor5-widget/src/index.js ***!
  94242. \**************************************************************/
  94243. /*! exports provided: Widget, WidgetToolbarRepository, WidgetResize, WidgetTypeAround, WIDGET_CLASS_NAME, WIDGET_SELECTED_CLASS_NAME, isWidget, toWidget, setHighlightHandling, setLabel, getLabel, toWidgetEditable, findOptimalInsertionPosition, checkSelectionOnObject, viewToModelPositionOutsideModelElement, centeredBalloonPositionForLongWidgets */
  94244. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  94245. "use strict";
  94246. __webpack_require__.r(__webpack_exports__);
  94247. /* harmony import */ var _widget__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./widget */ "./node_modules/@ckeditor/ckeditor5-widget/src/widget.js");
  94248. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Widget", function() { return _widget__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  94249. /* harmony import */ var _widgettoolbarrepository__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./widgettoolbarrepository */ "./node_modules/@ckeditor/ckeditor5-widget/src/widgettoolbarrepository.js");
  94250. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "WidgetToolbarRepository", function() { return _widgettoolbarrepository__WEBPACK_IMPORTED_MODULE_1__["default"]; });
  94251. /* harmony import */ var _widgetresize__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./widgetresize */ "./node_modules/@ckeditor/ckeditor5-widget/src/widgetresize.js");
  94252. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "WidgetResize", function() { return _widgetresize__WEBPACK_IMPORTED_MODULE_2__["default"]; });
  94253. /* harmony import */ var _widgettypearound_widgettypearound__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./widgettypearound/widgettypearound */ "./node_modules/@ckeditor/ckeditor5-widget/src/widgettypearound/widgettypearound.js");
  94254. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "WidgetTypeAround", function() { return _widgettypearound_widgettypearound__WEBPACK_IMPORTED_MODULE_3__["default"]; });
  94255. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./utils */ "./node_modules/@ckeditor/ckeditor5-widget/src/utils.js");
  94256. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "WIDGET_CLASS_NAME", function() { return _utils__WEBPACK_IMPORTED_MODULE_4__["WIDGET_CLASS_NAME"]; });
  94257. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "WIDGET_SELECTED_CLASS_NAME", function() { return _utils__WEBPACK_IMPORTED_MODULE_4__["WIDGET_SELECTED_CLASS_NAME"]; });
  94258. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isWidget", function() { return _utils__WEBPACK_IMPORTED_MODULE_4__["isWidget"]; });
  94259. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toWidget", function() { return _utils__WEBPACK_IMPORTED_MODULE_4__["toWidget"]; });
  94260. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "setHighlightHandling", function() { return _utils__WEBPACK_IMPORTED_MODULE_4__["setHighlightHandling"]; });
  94261. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "setLabel", function() { return _utils__WEBPACK_IMPORTED_MODULE_4__["setLabel"]; });
  94262. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getLabel", function() { return _utils__WEBPACK_IMPORTED_MODULE_4__["getLabel"]; });
  94263. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toWidgetEditable", function() { return _utils__WEBPACK_IMPORTED_MODULE_4__["toWidgetEditable"]; });
  94264. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "findOptimalInsertionPosition", function() { return _utils__WEBPACK_IMPORTED_MODULE_4__["findOptimalInsertionPosition"]; });
  94265. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "checkSelectionOnObject", function() { return _utils__WEBPACK_IMPORTED_MODULE_4__["checkSelectionOnObject"]; });
  94266. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "viewToModelPositionOutsideModelElement", function() { return _utils__WEBPACK_IMPORTED_MODULE_4__["viewToModelPositionOutsideModelElement"]; });
  94267. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "centeredBalloonPositionForLongWidgets", function() { return _utils__WEBPACK_IMPORTED_MODULE_4__["centeredBalloonPositionForLongWidgets"]; });
  94268. /**
  94269. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  94270. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  94271. */
  94272. /***/ }),
  94273. /***/ "./node_modules/@ckeditor/ckeditor5-widget/src/utils.js":
  94274. /*!**************************************************************!*\
  94275. !*** ./node_modules/@ckeditor/ckeditor5-widget/src/utils.js ***!
  94276. \**************************************************************/
  94277. /*! exports provided: WIDGET_CLASS_NAME, WIDGET_SELECTED_CLASS_NAME, isWidget, toWidget, setHighlightHandling, setLabel, getLabel, toWidgetEditable, findOptimalInsertionPosition, checkSelectionOnObject, viewToModelPositionOutsideModelElement, centeredBalloonPositionForLongWidgets */
  94278. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  94279. "use strict";
  94280. __webpack_require__.r(__webpack_exports__);
  94281. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "WIDGET_CLASS_NAME", function() { return WIDGET_CLASS_NAME; });
  94282. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "WIDGET_SELECTED_CLASS_NAME", function() { return WIDGET_SELECTED_CLASS_NAME; });
  94283. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isWidget", function() { return isWidget; });
  94284. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toWidget", function() { return toWidget; });
  94285. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setHighlightHandling", function() { return setHighlightHandling; });
  94286. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setLabel", function() { return setLabel; });
  94287. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getLabel", function() { return getLabel; });
  94288. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toWidgetEditable", function() { return toWidgetEditable; });
  94289. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "findOptimalInsertionPosition", function() { return findOptimalInsertionPosition; });
  94290. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "checkSelectionOnObject", function() { return checkSelectionOnObject; });
  94291. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "viewToModelPositionOutsideModelElement", function() { return viewToModelPositionOutsideModelElement; });
  94292. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "centeredBalloonPositionForLongWidgets", function() { return centeredBalloonPositionForLongWidgets; });
  94293. /* 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");
  94294. /* harmony import */ var _ckeditor_ckeditor5_utils_src_dom_global__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/dom/global */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/global.js");
  94295. /* 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");
  94296. /* 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");
  94297. /* harmony import */ var _ckeditor_ckeditor5_utils_src_toarray__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/toarray */ "./node_modules/@ckeditor/ckeditor5-utils/src/toarray.js");
  94298. /* harmony import */ var _highlightstack__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./highlightstack */ "./node_modules/@ckeditor/ckeditor5-widget/src/highlightstack.js");
  94299. /* harmony import */ var _widgettypearound_utils__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./widgettypearound/utils */ "./node_modules/@ckeditor/ckeditor5-widget/src/widgettypearound/utils.js");
  94300. /* harmony import */ var _ckeditor_ckeditor5_ui_src_icon_iconview__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @ckeditor/ckeditor5-ui/src/icon/iconview */ "./node_modules/@ckeditor/ckeditor5-ui/src/icon/iconview.js");
  94301. /* harmony import */ var _theme_icons_drag_handle_svg__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../theme/icons/drag-handle.svg */ "./node_modules/@ckeditor/ckeditor5-widget/theme/icons/drag-handle.svg");
  94302. /**
  94303. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  94304. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  94305. */
  94306. /**
  94307. * @module widget/utils
  94308. */
  94309. /**
  94310. * CSS class added to each widget element.
  94311. *
  94312. * @const {String}
  94313. */
  94314. const WIDGET_CLASS_NAME = 'ck-widget';
  94315. /**
  94316. * CSS class added to currently selected widget element.
  94317. *
  94318. * @const {String}
  94319. */
  94320. const WIDGET_SELECTED_CLASS_NAME = 'ck-widget_selected';
  94321. /**
  94322. * Returns `true` if given {@link module:engine/view/node~Node} is an {@link module:engine/view/element~Element} and a widget.
  94323. *
  94324. * @param {module:engine/view/node~Node} node
  94325. * @returns {Boolean}
  94326. */
  94327. function isWidget( node ) {
  94328. if ( !node.is( 'element' ) ) {
  94329. return false;
  94330. }
  94331. return !!node.getCustomProperty( 'widget' );
  94332. }
  94333. /**
  94334. * Converts the given {@link module:engine/view/element~Element} to a widget in the following way:
  94335. *
  94336. * * sets the `contenteditable` attribute to `"false"`,
  94337. * * adds the `ck-widget` CSS class,
  94338. * * adds a custom {@link module:engine/view/element~Element#getFillerOffset `getFillerOffset()`} method returning `null`,
  94339. * * adds a custom property allowing to recognize widget elements by using {@link ~isWidget `isWidget()`},
  94340. * * implements the {@link ~setHighlightHandling view highlight on widgets}.
  94341. *
  94342. * This function needs to be used in conjunction with
  94343. * {@link module:engine/conversion/downcasthelpers~DowncastHelpers downcast conversion helpers}
  94344. * like {@link module:engine/conversion/downcasthelpers~DowncastHelpers#elementToElement `elementToElement()`}.
  94345. * Moreover, typically you will want to use `toWidget()` only for `editingDowncast`, while keeping the `dataDowncast` clean.
  94346. *
  94347. * For example, in order to convert a `<widget>` model element to `<div class="widget">` in the view, you can define
  94348. * such converters:
  94349. *
  94350. * editor.conversion.for( 'editingDowncast' )
  94351. * .elementToElement( {
  94352. * model: 'widget',
  94353. * view: ( modelItem, { writer } ) => {
  94354. * const div = writer.createContainerElement( 'div', { class: 'widget' } );
  94355. *
  94356. * return toWidget( div, writer, { label: 'some widget' } );
  94357. * }
  94358. * } );
  94359. *
  94360. * editor.conversion.for( 'dataDowncast' )
  94361. * .elementToElement( {
  94362. * model: 'widget',
  94363. * view: ( modelItem, { writer } ) => {
  94364. * return writer.createContainerElement( 'div', { class: 'widget' } );
  94365. * }
  94366. * } );
  94367. *
  94368. * See the full source code of the widget (with a nested editable) schema definition and converters in
  94369. * [this sample](https://github.com/ckeditor/ckeditor5-widget/blob/master/tests/manual/widget-with-nestededitable.js).
  94370. *
  94371. * @param {module:engine/view/element~Element} element
  94372. * @param {module:engine/view/downcastwriter~DowncastWriter} writer
  94373. * @param {Object} [options={}]
  94374. * @param {String|Function} [options.label] Element's label provided to the {@link ~setLabel} function. It can be passed as
  94375. * a plain string or a function returning a string. It represents the widget for assistive technologies (like screen readers).
  94376. * @param {Boolean} [options.hasSelectionHandle=false] If `true`, the widget will have a selection handle added.
  94377. * @returns {module:engine/view/element~Element} Returns the same element.
  94378. */
  94379. function toWidget( element, writer, options = {} ) {
  94380. if ( !element.is( 'containerElement' ) ) {
  94381. /**
  94382. * The element passed to `toWidget()` must be a {@link module:engine/view/containerelement~ContainerElement}
  94383. * instance.
  94384. *
  94385. * @error widget-to-widget-wrong-element-type
  94386. * @param {String} element The view element passed to `toWidget()`.
  94387. */
  94388. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_3__["default"](
  94389. 'widget-to-widget-wrong-element-type',
  94390. null,
  94391. { element }
  94392. );
  94393. }
  94394. writer.setAttribute( 'contenteditable', 'false', element );
  94395. writer.addClass( WIDGET_CLASS_NAME, element );
  94396. writer.setCustomProperty( 'widget', true, element );
  94397. element.getFillerOffset = getFillerOffset;
  94398. if ( options.label ) {
  94399. setLabel( element, options.label, writer );
  94400. }
  94401. if ( options.hasSelectionHandle ) {
  94402. addSelectionHandle( element, writer );
  94403. }
  94404. setHighlightHandling( element, writer, addHighlight, removeHighlight );
  94405. return element;
  94406. }
  94407. // Default handler for adding a highlight on a widget.
  94408. // It adds CSS class and attributes basing on the given highlight descriptor.
  94409. //
  94410. // @param {module:engine/view/element~Element} element
  94411. // @param {module:engine/conversion/downcasthelpers~HighlightDescriptor} descriptor
  94412. // @param {module:engine/view/downcastwriter~DowncastWriter} writer
  94413. function addHighlight( element, descriptor, writer ) {
  94414. if ( descriptor.classes ) {
  94415. writer.addClass( Object(_ckeditor_ckeditor5_utils_src_toarray__WEBPACK_IMPORTED_MODULE_4__["default"])( descriptor.classes ), element );
  94416. }
  94417. if ( descriptor.attributes ) {
  94418. for ( const key in descriptor.attributes ) {
  94419. writer.setAttribute( key, descriptor.attributes[ key ], element );
  94420. }
  94421. }
  94422. }
  94423. // Default handler for removing a highlight from a widget.
  94424. // It removes CSS class and attributes basing on the given highlight descriptor.
  94425. //
  94426. // @param {module:engine/view/element~Element} element
  94427. // @param {module:engine/conversion/downcasthelpers~HighlightDescriptor} descriptor
  94428. // @param {module:engine/view/downcastwriter~DowncastWriter} writer
  94429. function removeHighlight( element, descriptor, writer ) {
  94430. if ( descriptor.classes ) {
  94431. writer.removeClass( Object(_ckeditor_ckeditor5_utils_src_toarray__WEBPACK_IMPORTED_MODULE_4__["default"])( descriptor.classes ), element );
  94432. }
  94433. if ( descriptor.attributes ) {
  94434. for ( const key in descriptor.attributes ) {
  94435. writer.removeAttribute( key, element );
  94436. }
  94437. }
  94438. }
  94439. /**
  94440. * Sets highlight handling methods. Uses {@link module:widget/highlightstack~HighlightStack} to
  94441. * properly determine which highlight descriptor should be used at given time.
  94442. *
  94443. * @param {module:engine/view/element~Element} element
  94444. * @param {module:engine/view/downcastwriter~DowncastWriter} writer
  94445. * @param {Function} add
  94446. * @param {Function} remove
  94447. */
  94448. function setHighlightHandling( element, writer, add, remove ) {
  94449. const stack = new _highlightstack__WEBPACK_IMPORTED_MODULE_5__["default"]();
  94450. stack.on( 'change:top', ( evt, data ) => {
  94451. if ( data.oldDescriptor ) {
  94452. remove( element, data.oldDescriptor, data.writer );
  94453. }
  94454. if ( data.newDescriptor ) {
  94455. add( element, data.newDescriptor, data.writer );
  94456. }
  94457. } );
  94458. writer.setCustomProperty( 'addHighlight', ( element, descriptor, writer ) => stack.add( descriptor, writer ), element );
  94459. writer.setCustomProperty( 'removeHighlight', ( element, id, writer ) => stack.remove( id, writer ), element );
  94460. }
  94461. /**
  94462. * Sets label for given element.
  94463. * It can be passed as a plain string or a function returning a string. Function will be called each time label is retrieved by
  94464. * {@link ~getLabel `getLabel()`}.
  94465. *
  94466. * @param {module:engine/view/element~Element} element
  94467. * @param {String|Function} labelOrCreator
  94468. * @param {module:engine/view/downcastwriter~DowncastWriter} writer
  94469. */
  94470. function setLabel( element, labelOrCreator, writer ) {
  94471. writer.setCustomProperty( 'widgetLabel', labelOrCreator, element );
  94472. }
  94473. /**
  94474. * Returns the label of the provided element.
  94475. *
  94476. * @param {module:engine/view/element~Element} element
  94477. * @returns {String}
  94478. */
  94479. function getLabel( element ) {
  94480. const labelCreator = element.getCustomProperty( 'widgetLabel' );
  94481. if ( !labelCreator ) {
  94482. return '';
  94483. }
  94484. return typeof labelCreator == 'function' ? labelCreator() : labelCreator;
  94485. }
  94486. /**
  94487. * Adds functionality to the provided {@link module:engine/view/editableelement~EditableElement} to act as a widget's editable:
  94488. *
  94489. * * sets the `contenteditable` attribute to `true` when {@link module:engine/view/editableelement~EditableElement#isReadOnly} is `false`,
  94490. * otherwise sets it to `false`,
  94491. * * adds the `ck-editor__editable` and `ck-editor__nested-editable` CSS classes,
  94492. * * adds the `ck-editor__nested-editable_focused` CSS class when the editable is focused and removes it when it is blurred.
  94493. *
  94494. * Similarly to {@link ~toWidget `toWidget()`} this function should be used in `editingDowncast` only and it is usually
  94495. * used together with {@link module:engine/conversion/downcasthelpers~DowncastHelpers#elementToElement `elementToElement()`}.
  94496. *
  94497. * For example, in order to convert a `<nested>` model element to `<div class="nested">` in the view, you can define
  94498. * such converters:
  94499. *
  94500. * editor.conversion.for( 'editingDowncast' )
  94501. * .elementToElement( {
  94502. * model: 'nested',
  94503. * view: ( modelItem, { writer } ) => {
  94504. * const div = writer.createEditableElement( 'div', { class: 'nested' } );
  94505. *
  94506. * return toWidgetEditable( nested, writer );
  94507. * }
  94508. * } );
  94509. *
  94510. * editor.conversion.for( 'dataDowncast' )
  94511. * .elementToElement( {
  94512. * model: 'nested',
  94513. * view: ( modelItem, { writer } ) => {
  94514. * return writer.createContainerElement( 'div', { class: 'nested' } );
  94515. * }
  94516. * } );
  94517. *
  94518. * See the full source code of the widget (with nested editable) schema definition and converters in
  94519. * [this sample](https://github.com/ckeditor/ckeditor5-widget/blob/master/tests/manual/widget-with-nestededitable.js).
  94520. *
  94521. * @param {module:engine/view/editableelement~EditableElement} editable
  94522. * @param {module:engine/view/downcastwriter~DowncastWriter} writer
  94523. * @returns {module:engine/view/editableelement~EditableElement} Returns the same element that was provided in the `editable` parameter
  94524. */
  94525. function toWidgetEditable( editable, writer ) {
  94526. writer.addClass( [ 'ck-editor__editable', 'ck-editor__nested-editable' ], editable );
  94527. // Set initial contenteditable value.
  94528. writer.setAttribute( 'contenteditable', editable.isReadOnly ? 'false' : 'true', editable );
  94529. // Bind the contenteditable property to element#isReadOnly.
  94530. editable.on( 'change:isReadOnly', ( evt, property, is ) => {
  94531. writer.setAttribute( 'contenteditable', is ? 'false' : 'true', editable );
  94532. } );
  94533. editable.on( 'change:isFocused', ( evt, property, is ) => {
  94534. if ( is ) {
  94535. writer.addClass( 'ck-editor__nested-editable_focused', editable );
  94536. } else {
  94537. writer.removeClass( 'ck-editor__nested-editable_focused', editable );
  94538. }
  94539. } );
  94540. return editable;
  94541. }
  94542. /**
  94543. * Returns a model position which is optimal (in terms of UX) for inserting a widget block.
  94544. *
  94545. * For instance, if a selection is in the middle of a paragraph, the position before this paragraph
  94546. * will be returned so that it is not split. If the selection is at the end of a paragraph,
  94547. * the position after this paragraph will be returned.
  94548. *
  94549. * Note: If the selection is placed in an empty block, that block will be returned. If that position
  94550. * is then passed to {@link module:engine/model/model~Model#insertContent},
  94551. * the block will be fully replaced by the image.
  94552. *
  94553. * @param {module:engine/model/selection~Selection|module:engine/model/documentselection~DocumentSelection} selection
  94554. * The selection based on which the insertion position should be calculated.
  94555. * @param {module:engine/model/model~Model} model Model instance.
  94556. * @returns {module:engine/model/position~Position} The optimal position.
  94557. */
  94558. function findOptimalInsertionPosition( selection, model ) {
  94559. const selectedElement = selection.getSelectedElement();
  94560. if ( selectedElement ) {
  94561. const typeAroundFakeCaretPosition = Object(_widgettypearound_utils__WEBPACK_IMPORTED_MODULE_6__["getTypeAroundFakeCaretPosition"])( selection );
  94562. // If the WidgetTypeAround "fake caret" is displayed, use its position for the insertion
  94563. // to provide the most predictable UX (https://github.com/ckeditor/ckeditor5/issues/7438).
  94564. if ( typeAroundFakeCaretPosition ) {
  94565. return model.createPositionAt( selectedElement, typeAroundFakeCaretPosition );
  94566. }
  94567. if ( model.schema.isBlock( selectedElement ) ) {
  94568. return model.createPositionAfter( selectedElement );
  94569. }
  94570. }
  94571. const firstBlock = selection.getSelectedBlocks().next().value;
  94572. if ( firstBlock ) {
  94573. // If inserting into an empty block – return position in that block. It will get
  94574. // replaced with the image by insertContent(). #42.
  94575. if ( firstBlock.isEmpty ) {
  94576. return model.createPositionAt( firstBlock, 0 );
  94577. }
  94578. const positionAfter = model.createPositionAfter( firstBlock );
  94579. // If selection is at the end of the block - return position after the block.
  94580. if ( selection.focus.isTouching( positionAfter ) ) {
  94581. return positionAfter;
  94582. }
  94583. // Otherwise return position before the block.
  94584. return model.createPositionBefore( firstBlock );
  94585. }
  94586. return selection.focus;
  94587. }
  94588. /**
  94589. * Checks if the selection is on an object.
  94590. *
  94591. * @param {module:engine/model/selection~Selection|module:engine/model/documentselection~DocumentSelection} selection
  94592. * @param {module:engine/model/schema~Schema} schema
  94593. * @returns {Boolean}
  94594. */
  94595. function checkSelectionOnObject( selection, schema ) {
  94596. const selectedElement = selection.getSelectedElement();
  94597. return !!selectedElement && schema.isObject( selectedElement );
  94598. }
  94599. /**
  94600. * A util to be used in order to map view positions to correct model positions when implementing a widget
  94601. * which renders non-empty view element for an empty model element.
  94602. *
  94603. * For example:
  94604. *
  94605. * // Model:
  94606. * <placeholder type="name"></placeholder>
  94607. *
  94608. * // View:
  94609. * <span class="placeholder">name</span>
  94610. *
  94611. * In such case, view positions inside `<span>` cannot be correct mapped to the model (because the model element is empty).
  94612. * To handle mapping positions inside `<span class="placeholder">` to the model use this util as follows:
  94613. *
  94614. * editor.editing.mapper.on(
  94615. * 'viewToModelPosition',
  94616. * viewToModelPositionOutsideModelElement( model, viewElement => viewElement.hasClass( 'placeholder' ) )
  94617. * );
  94618. *
  94619. * The callback will try to map the view offset of selection to an expected model position.
  94620. *
  94621. * 1. When the position is at the end (or in the middle) of the inline widget:
  94622. *
  94623. * // View:
  94624. * <p>foo <span class="placeholder">name|</span> bar</p>
  94625. *
  94626. * // Model:
  94627. * <paragraph>foo <placeholder type="name"></placeholder>| bar</paragraph>
  94628. *
  94629. * 2. When the position is at the beginning of the inline widget:
  94630. *
  94631. * // View:
  94632. * <p>foo <span class="placeholder">|name</span> bar</p>
  94633. *
  94634. * // Model:
  94635. * <paragraph>foo |<placeholder type="name"></placeholder> bar</paragraph>
  94636. *
  94637. * @param {module:engine/model/model~Model} model Model instance on which the callback operates.
  94638. * @param {Function} viewElementMatcher Function that is passed a view element and should return `true` if the custom mapping
  94639. * should be applied to the given view element.
  94640. * @return {Function}
  94641. */
  94642. function viewToModelPositionOutsideModelElement( model, viewElementMatcher ) {
  94643. return ( evt, data ) => {
  94644. const { mapper, viewPosition } = data;
  94645. const viewParent = mapper.findMappedViewAncestor( viewPosition );
  94646. if ( !viewElementMatcher( viewParent ) ) {
  94647. return;
  94648. }
  94649. const modelParent = mapper.toModelElement( viewParent );
  94650. data.modelPosition = model.createPositionAt( modelParent, viewPosition.isAtStart ? 'before' : 'after' );
  94651. };
  94652. }
  94653. /**
  94654. * A positioning function passed to the {@link module:utils/dom/position~getOptimalPosition} helper as a last resort
  94655. * when attaching {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView balloon UI} to widgets.
  94656. * It comes in handy when a widget is longer than the visual viewport of the web browser and/or upper/lower boundaries
  94657. * of a widget are off screen because of the web page scroll.
  94658. *
  94659. * ┌─┄┄┄┄┄┄┄┄┄Widget┄┄┄┄┄┄┄┄┄┐
  94660. * ┊ ┊
  94661. * ┌────────────Viewport───────────┐ ┌──╁─────────Viewport────────╁──┐
  94662. * │ ┏━━━━━━━━━━Widget━━━━━━━━━┓ │ │ ┃ ^ ┃ │
  94663. * │ ┃ ^ ┃ │ │ ┃ ╭───────/ \───────╮ ┃ │
  94664. * │ ┃ ╭───────/ \───────╮ ┃ │ │ ┃ │ Balloon │ ┃ │
  94665. * │ ┃ │ Balloon │ ┃ │ │ ┃ ╰─────────────────╯ ┃ │
  94666. * │ ┃ ╰─────────────────╯ ┃ │ │ ┃ ┃ │
  94667. * │ ┃ ┃ │ │ ┃ ┃ │
  94668. * │ ┃ ┃ │ │ ┃ ┃ │
  94669. * │ ┃ ┃ │ │ ┃ ┃ │
  94670. * │ ┃ ┃ │ │ ┃ ┃ │
  94671. * │ ┃ ┃ │ │ ┃ ┃ │
  94672. * │ ┃ ┃ │ │ ┃ ┃ │
  94673. * └──╀─────────────────────────╀──┘ └──╀─────────────────────────╀──┘
  94674. * ┊ ┊ ┊ ┊
  94675. * ┊ ┊ └┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┘
  94676. * ┊ ┊
  94677. * └┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┘
  94678. *
  94679. * **Note**: Works best if used together with
  94680. * {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView.defaultPositions default `BalloonPanelView` positions}
  94681. * like `northArrowSouth` and `southArrowNorth`; the transition between these two and this position is smooth.
  94682. *
  94683. * @param {module:utils/dom/rect~Rect} widgetRect A rect of the widget.
  94684. * @param {module:utils/dom/rect~Rect} balloonRect A rect of the balloon.
  94685. * @returns {module:utils/dom/position~Position|null}
  94686. */
  94687. function centeredBalloonPositionForLongWidgets( widgetRect, balloonRect ) {
  94688. const viewportRect = new _ckeditor_ckeditor5_utils_src_dom_rect__WEBPACK_IMPORTED_MODULE_2__["default"]( _ckeditor_ckeditor5_utils_src_dom_global__WEBPACK_IMPORTED_MODULE_1__["default"].window );
  94689. const viewportWidgetInsersectionRect = viewportRect.getIntersection( widgetRect );
  94690. const balloonTotalHeight = balloonRect.height + _ckeditor_ckeditor5_ui_src_panel_balloon_balloonpanelview__WEBPACK_IMPORTED_MODULE_0__["default"].arrowVerticalOffset;
  94691. // If there is enough space above or below the widget then this position should not be used.
  94692. if ( widgetRect.top - balloonTotalHeight > viewportRect.top || widgetRect.bottom + balloonTotalHeight < viewportRect.bottom ) {
  94693. return null;
  94694. }
  94695. // Because this is a last resort positioning, to keep things simple we're not playing with positions of the arrow
  94696. // like, for instance, "south west" or whatever. Just try to keep the balloon in the middle of the visible area of
  94697. // the widget for as long as it is possible. If the widgets becomes invisible (because cropped by the viewport),
  94698. // just... place the balloon in the middle of it (because why not?).
  94699. const targetRect = viewportWidgetInsersectionRect || widgetRect;
  94700. const left = targetRect.left + targetRect.width / 2 - balloonRect.width / 2;
  94701. return {
  94702. top: Math.max( widgetRect.top, 0 ) + _ckeditor_ckeditor5_ui_src_panel_balloon_balloonpanelview__WEBPACK_IMPORTED_MODULE_0__["default"].arrowVerticalOffset,
  94703. left,
  94704. name: 'arrow_n'
  94705. };
  94706. }
  94707. // Default filler offset function applied to all widget elements.
  94708. //
  94709. // @returns {null}
  94710. function getFillerOffset() {
  94711. return null;
  94712. }
  94713. // Adds a drag handle to the widget.
  94714. //
  94715. // @param {module:engine/view/containerelement~ContainerElement}
  94716. // @param {module:engine/view/downcastwriter~DowncastWriter} writer
  94717. function addSelectionHandle( widgetElement, writer ) {
  94718. const selectionHandle = writer.createUIElement( 'div', { class: 'ck ck-widget__selection-handle' }, function( domDocument ) {
  94719. const domElement = this.toDomElement( domDocument );
  94720. // Use the IconView from the ui library.
  94721. const icon = new _ckeditor_ckeditor5_ui_src_icon_iconview__WEBPACK_IMPORTED_MODULE_7__["default"]();
  94722. icon.set( 'content', _theme_icons_drag_handle_svg__WEBPACK_IMPORTED_MODULE_8__["default"] );
  94723. // Render the icon view right away to append its #element to the selectionHandle DOM element.
  94724. icon.render();
  94725. domElement.appendChild( icon.element );
  94726. return domElement;
  94727. } );
  94728. // Append the selection handle into the widget wrapper.
  94729. writer.insert( writer.createPositionAt( widgetElement, 0 ), selectionHandle );
  94730. writer.addClass( [ 'ck-widget_with-selection-handle' ], widgetElement );
  94731. }
  94732. /***/ }),
  94733. /***/ "./node_modules/@ckeditor/ckeditor5-widget/src/verticalnavigation.js":
  94734. /*!***************************************************************************!*\
  94735. !*** ./node_modules/@ckeditor/ckeditor5-widget/src/verticalnavigation.js ***!
  94736. \***************************************************************************/
  94737. /*! exports provided: default */
  94738. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  94739. "use strict";
  94740. __webpack_require__.r(__webpack_exports__);
  94741. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return verticalNavigationHandler; });
  94742. /* 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");
  94743. /* 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");
  94744. /**
  94745. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  94746. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  94747. */
  94748. /**
  94749. * @module widget/verticalnavigationhandler
  94750. */
  94751. /**
  94752. * Returns 'keydown' handler for up/down arrow keys that modifies the caret movement if it's in a text line next to an object.
  94753. *
  94754. * @param {module:engine/controller/editingcontroller~EditingController} editing The editing controller.
  94755. * @returns {Function}
  94756. */
  94757. function verticalNavigationHandler( editing ) {
  94758. const model = editing.model;
  94759. return ( evt, data ) => {
  94760. const arrowUpPressed = data.keyCode == _ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_0__["keyCodes"].arrowup;
  94761. const arrowDownPressed = data.keyCode == _ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_0__["keyCodes"].arrowdown;
  94762. const expandSelection = data.shiftKey;
  94763. const selection = model.document.selection;
  94764. if ( !arrowUpPressed && !arrowDownPressed ) {
  94765. return;
  94766. }
  94767. const isForward = arrowDownPressed;
  94768. // Navigation is in the opposite direction than the selection direction so this is shrinking of the selection.
  94769. // Selection for sure will not approach any object.
  94770. if ( expandSelection && selectionWillShrink( selection, isForward ) ) {
  94771. return;
  94772. }
  94773. // Find a range between selection and closest limit element.
  94774. const range = findTextRangeFromSelection( editing, selection, isForward );
  94775. if ( !range || range.isCollapsed ) {
  94776. return;
  94777. }
  94778. // If the range is a single line (there is no word wrapping) then move the selection to the position closest to the limit element.
  94779. //
  94780. // We can't move the selection directly to the isObject element (eg. table cell) because of dual position at the end/beginning
  94781. // of wrapped line (it's at the same time at the end of one line and at the start of the next line).
  94782. if ( isSingleLineRange( editing, range, isForward ) ) {
  94783. model.change( writer => {
  94784. const newPosition = isForward ? range.end : range.start;
  94785. if ( expandSelection ) {
  94786. const newSelection = model.createSelection( selection.anchor );
  94787. newSelection.setFocus( newPosition );
  94788. writer.setSelection( newSelection );
  94789. } else {
  94790. writer.setSelection( newPosition );
  94791. }
  94792. } );
  94793. evt.stop();
  94794. data.preventDefault();
  94795. data.stopPropagation();
  94796. }
  94797. };
  94798. }
  94799. // Finds the range between selection and closest limit element (in the direction of navigation).
  94800. // The position next to limit element is adjusted to the closest allowed `$text` position.
  94801. //
  94802. // Returns `null` if, according to the schema, the resulting range cannot contain a `$text` element.
  94803. //
  94804. // @param {module:engine/controller/editingcontroller~EditingController} editing The editing controller.
  94805. // @param {module:engine/model/selection~Selection} selection The current selection.
  94806. // @param {Boolean} isForward The expected navigation direction.
  94807. // @returns {module:engine/model/range~Range|null}
  94808. //
  94809. function findTextRangeFromSelection( editing, selection, isForward ) {
  94810. const model = editing.model;
  94811. if ( isForward ) {
  94812. const startPosition = selection.isCollapsed ? selection.focus : selection.getLastPosition();
  94813. const endPosition = getNearestNonInlineLimit( model, startPosition, 'forward' );
  94814. // There is no limit element, browser should handle this.
  94815. if ( !endPosition ) {
  94816. return null;
  94817. }
  94818. const range = model.createRange( startPosition, endPosition );
  94819. const lastRangePosition = getNearestTextPosition( model.schema, range, 'backward' );
  94820. if ( lastRangePosition && startPosition.isBefore( lastRangePosition ) ) {
  94821. return model.createRange( startPosition, lastRangePosition );
  94822. }
  94823. return null;
  94824. } else {
  94825. const endPosition = selection.isCollapsed ? selection.focus : selection.getFirstPosition();
  94826. const startPosition = getNearestNonInlineLimit( model, endPosition, 'backward' );
  94827. // There is no limit element, browser should handle this.
  94828. if ( !startPosition ) {
  94829. return null;
  94830. }
  94831. const range = model.createRange( startPosition, endPosition );
  94832. const firstRangePosition = getNearestTextPosition( model.schema, range, 'forward' );
  94833. if ( firstRangePosition && endPosition.isAfter( firstRangePosition ) ) {
  94834. return model.createRange( firstRangePosition, endPosition );
  94835. }
  94836. return null;
  94837. }
  94838. }
  94839. // Finds the limit element position that is closest to startPosition.
  94840. //
  94841. // @param {module:engine/model/model~Model} model
  94842. // @param {<module:engine/model/position~Position>} startPosition
  94843. // @param {'forward'|'backward'} direction Search direction.
  94844. // @returns {<module:engine/model/position~Position>|null}
  94845. //
  94846. function getNearestNonInlineLimit( model, startPosition, direction ) {
  94847. const schema = model.schema;
  94848. const range = model.createRangeIn( startPosition.root );
  94849. const walkerValueType = direction == 'forward' ? 'elementStart' : 'elementEnd';
  94850. for ( const { previousPosition, item, type } of range.getWalker( { startPosition, direction } ) ) {
  94851. if ( schema.isLimit( item ) && !schema.isInline( item ) ) {
  94852. return previousPosition;
  94853. }
  94854. // Stop looking for isLimit element if the next element is a block element (it is for sure not single line).
  94855. if ( type == walkerValueType && schema.isBlock( item ) ) {
  94856. return null;
  94857. }
  94858. }
  94859. return null;
  94860. }
  94861. // Basing on the provided range, finds the first or last (depending on `direction`) position inside the range
  94862. // that can contain `$text` (according to schema).
  94863. //
  94864. // @param {module:engine/model/schema~Schema} schema The schema.
  94865. // @param {module:engine/model/range~Range} range The range to find the position in.
  94866. // @param {'forward'|'backward'} direction Search direction.
  94867. // @returns {module:engine/model/position~Position} The nearest selection range.
  94868. //
  94869. function getNearestTextPosition( schema, range, direction ) {
  94870. const position = direction == 'backward' ? range.end : range.start;
  94871. if ( schema.checkChild( position, '$text' ) ) {
  94872. return position;
  94873. }
  94874. for ( const { nextPosition } of range.getWalker( { direction } ) ) {
  94875. if ( schema.checkChild( nextPosition, '$text' ) ) {
  94876. return nextPosition;
  94877. }
  94878. }
  94879. }
  94880. // Checks if the DOM range corresponding to the provided model range renders as a single line by analyzing DOMRects
  94881. // (verifying if they visually wrap content to the next line).
  94882. //
  94883. // @param {module:engine/controller/editingcontroller~EditingController} editing The editing controller.
  94884. // @param {module:engine/model/range~Range} modelRange The current table cell content range.
  94885. // @param {Boolean} isForward The expected navigation direction.
  94886. // @returns {Boolean}
  94887. //
  94888. function isSingleLineRange( editing, modelRange, isForward ) {
  94889. const model = editing.model;
  94890. const domConverter = editing.view.domConverter;
  94891. // Wrapped lines contain exactly the same position at the end of current line
  94892. // and at the beginning of next line. That position's client rect is at the end
  94893. // of current line. In case of caret at first position of the last line that 'dual'
  94894. // position would be detected as it's not the last line.
  94895. if ( isForward ) {
  94896. const probe = model.createSelection( modelRange.start );
  94897. model.modifySelection( probe );
  94898. // If the new position is at the end of the container then we can't use this position
  94899. // because it would provide incorrect result for eg caption of image and selection
  94900. // just before end of it. Also in this case there is no "dual" position.
  94901. if ( !probe.focus.isAtEnd && !modelRange.start.isEqual( probe.focus ) ) {
  94902. modelRange = model.createRange( probe.focus, modelRange.end );
  94903. }
  94904. }
  94905. const viewRange = editing.mapper.toViewRange( modelRange );
  94906. const domRange = domConverter.viewRangeToDom( viewRange );
  94907. const rects = _ckeditor_ckeditor5_utils_src_dom_rect__WEBPACK_IMPORTED_MODULE_1__["default"].getDomRangeRects( domRange );
  94908. let boundaryVerticalPosition;
  94909. for ( const rect of rects ) {
  94910. if ( boundaryVerticalPosition === undefined ) {
  94911. boundaryVerticalPosition = Math.round( rect.bottom );
  94912. continue;
  94913. }
  94914. // Let's check if this rect is in new line.
  94915. if ( Math.round( rect.top ) >= boundaryVerticalPosition ) {
  94916. return false;
  94917. }
  94918. boundaryVerticalPosition = Math.max( boundaryVerticalPosition, Math.round( rect.bottom ) );
  94919. }
  94920. return true;
  94921. }
  94922. function selectionWillShrink( selection, isForward ) {
  94923. return !selection.isCollapsed && selection.isBackward == isForward;
  94924. }
  94925. /***/ }),
  94926. /***/ "./node_modules/@ckeditor/ckeditor5-widget/src/widget.js":
  94927. /*!***************************************************************!*\
  94928. !*** ./node_modules/@ckeditor/ckeditor5-widget/src/widget.js ***!
  94929. \***************************************************************/
  94930. /*! exports provided: default */
  94931. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  94932. "use strict";
  94933. __webpack_require__.r(__webpack_exports__);
  94934. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Widget; });
  94935. /* 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");
  94936. /* 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");
  94937. /* harmony import */ var _widgettypearound_widgettypearound__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./widgettypearound/widgettypearound */ "./node_modules/@ckeditor/ckeditor5-widget/src/widgettypearound/widgettypearound.js");
  94938. /* harmony import */ var _ckeditor_ckeditor5_typing_src_delete__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-typing/src/delete */ "./node_modules/@ckeditor/ckeditor5-typing/src/delete.js");
  94939. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./utils */ "./node_modules/@ckeditor/ckeditor5-widget/src/utils.js");
  94940. /* harmony import */ var _ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/keyboard */ "./node_modules/@ckeditor/ckeditor5-utils/src/keyboard.js");
  94941. /* harmony import */ var _ckeditor_ckeditor5_utils_src_env__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/env */ "./node_modules/@ckeditor/ckeditor5-utils/src/env.js");
  94942. /* harmony import */ var _theme_widget_css__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../theme/widget.css */ "./node_modules/@ckeditor/ckeditor5-widget/theme/widget.css");
  94943. /* harmony import */ var _theme_widget_css__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_theme_widget_css__WEBPACK_IMPORTED_MODULE_7__);
  94944. /* harmony import */ var _verticalnavigation__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./verticalnavigation */ "./node_modules/@ckeditor/ckeditor5-widget/src/verticalnavigation.js");
  94945. /**
  94946. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  94947. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  94948. */
  94949. /**
  94950. * @module widget/widget
  94951. */
  94952. /**
  94953. * The widget plugin. It enables base support for widgets.
  94954. *
  94955. * See {@glink api/widget package page} for more details and documentation.
  94956. *
  94957. * This plugin enables multiple behaviors required by widgets:
  94958. *
  94959. * * The model to view selection converter for the editing pipeline (it handles widget custom selection rendering).
  94960. * If a converted selection wraps around a widget element, that selection is marked as
  94961. * {@link module:engine/view/selection~Selection#isFake fake}. Additionally, the `ck-widget_selected` CSS class
  94962. * is added to indicate that widget has been selected.
  94963. * * The mouse and keyboard events handling on and around widget elements.
  94964. *
  94965. * @extends module:core/plugin~Plugin
  94966. */
  94967. class Widget extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
  94968. /**
  94969. * @inheritDoc
  94970. */
  94971. static get pluginName() {
  94972. return 'Widget';
  94973. }
  94974. /**
  94975. * @inheritDoc
  94976. */
  94977. static get requires() {
  94978. return [ _widgettypearound_widgettypearound__WEBPACK_IMPORTED_MODULE_2__["default"], _ckeditor_ckeditor5_typing_src_delete__WEBPACK_IMPORTED_MODULE_3__["default"] ];
  94979. }
  94980. /**
  94981. * @inheritDoc
  94982. */
  94983. init() {
  94984. const view = this.editor.editing.view;
  94985. const viewDocument = view.document;
  94986. /**
  94987. * Holds previously selected widgets.
  94988. *
  94989. * @private
  94990. * @type {Set.<module:engine/view/element~Element>}
  94991. */
  94992. this._previouslySelected = new Set();
  94993. // Model to view selection converter.
  94994. // Converts selection placed over widget element to fake selection
  94995. this.editor.editing.downcastDispatcher.on( 'selection', ( evt, data, conversionApi ) => {
  94996. // Remove selected class from previously selected widgets.
  94997. this._clearPreviouslySelectedWidgets( conversionApi.writer );
  94998. const viewWriter = conversionApi.writer;
  94999. const viewSelection = viewWriter.document.selection;
  95000. const selectedElement = viewSelection.getSelectedElement();
  95001. let lastMarked = null;
  95002. for ( const range of viewSelection.getRanges() ) {
  95003. for ( const value of range ) {
  95004. const node = value.item;
  95005. // Do not mark nested widgets in selected one. See: #57.
  95006. if ( Object(_utils__WEBPACK_IMPORTED_MODULE_4__["isWidget"])( node ) && !isChild( node, lastMarked ) ) {
  95007. viewWriter.addClass( _utils__WEBPACK_IMPORTED_MODULE_4__["WIDGET_SELECTED_CLASS_NAME"], node );
  95008. this._previouslySelected.add( node );
  95009. lastMarked = node;
  95010. // Check if widget is a single element selected.
  95011. if ( node == selectedElement ) {
  95012. viewWriter.setSelection( viewSelection.getRanges(), { fake: true, label: Object(_utils__WEBPACK_IMPORTED_MODULE_4__["getLabel"])( selectedElement ) } );
  95013. }
  95014. }
  95015. }
  95016. }
  95017. }, { priority: 'low' } );
  95018. // If mouse down is pressed on widget - create selection over whole widget.
  95019. view.addObserver( _ckeditor_ckeditor5_engine_src_view_observer_mouseobserver__WEBPACK_IMPORTED_MODULE_1__["default"] );
  95020. this.listenTo( viewDocument, 'mousedown', ( ...args ) => this._onMousedown( ...args ) );
  95021. // There are two keydown listeners working on different priorities. This allows other
  95022. // features such as WidgetTypeAround or TableKeyboard to attach their listeners in between
  95023. // and customize the behavior even further in different content/selection scenarios.
  95024. //
  95025. // * The first listener handles changing the selection on arrow key press
  95026. // if the widget is selected or if the selection is next to a widget and the widget
  95027. // should become selected upon the arrow key press.
  95028. //
  95029. // * The second (late) listener makes sure the default browser action on arrow key press is
  95030. // prevented when a widget is selected. This prevents the selection from being moved
  95031. // from a fake selection container.
  95032. this.listenTo( viewDocument, 'arrowKey', ( ...args ) => {
  95033. this._handleSelectionChangeOnArrowKeyPress( ...args );
  95034. }, { context: [ _utils__WEBPACK_IMPORTED_MODULE_4__["isWidget"], '$text' ] } );
  95035. this.listenTo( viewDocument, 'arrowKey', ( ...args ) => {
  95036. this._preventDefaultOnArrowKeyPress( ...args );
  95037. }, { context: '$root' } );
  95038. this.listenTo( viewDocument, 'arrowKey', Object(_verticalnavigation__WEBPACK_IMPORTED_MODULE_8__["default"])( this.editor.editing ), { context: '$text' } );
  95039. // Handle custom delete behaviour.
  95040. this.listenTo( viewDocument, 'delete', ( evt, data ) => {
  95041. if ( this._handleDelete( data.direction == 'forward' ) ) {
  95042. data.preventDefault();
  95043. evt.stop();
  95044. }
  95045. }, { context: '$root' } );
  95046. }
  95047. /**
  95048. * Handles {@link module:engine/view/document~Document#event:mousedown mousedown} events on widget elements.
  95049. *
  95050. * @private
  95051. * @param {module:utils/eventinfo~EventInfo} eventInfo
  95052. * @param {module:engine/view/observer/domeventdata~DomEventData} domEventData
  95053. */
  95054. _onMousedown( eventInfo, domEventData ) {
  95055. const editor = this.editor;
  95056. const view = editor.editing.view;
  95057. const viewDocument = view.document;
  95058. let element = domEventData.target;
  95059. // Do nothing for single or double click inside nested editable.
  95060. if ( isInsideNestedEditable( element ) ) {
  95061. // But at least triple click inside nested editable causes broken selection in Safari.
  95062. // For such event, we select the entire nested editable element.
  95063. // See: https://github.com/ckeditor/ckeditor5/issues/1463.
  95064. if ( ( _ckeditor_ckeditor5_utils_src_env__WEBPACK_IMPORTED_MODULE_6__["default"].isSafari || _ckeditor_ckeditor5_utils_src_env__WEBPACK_IMPORTED_MODULE_6__["default"].isGecko ) && domEventData.domEvent.detail >= 3 ) {
  95065. const mapper = editor.editing.mapper;
  95066. const viewElement = element.is( 'attributeElement' ) ?
  95067. element.findAncestor( element => !element.is( 'attributeElement' ) ) : element;
  95068. const modelElement = mapper.toModelElement( viewElement );
  95069. domEventData.preventDefault();
  95070. this.editor.model.change( writer => {
  95071. writer.setSelection( modelElement, 'in' );
  95072. } );
  95073. }
  95074. return;
  95075. }
  95076. // If target is not a widget element - check if one of the ancestors is.
  95077. if ( !Object(_utils__WEBPACK_IMPORTED_MODULE_4__["isWidget"])( element ) ) {
  95078. element = element.findAncestor( _utils__WEBPACK_IMPORTED_MODULE_4__["isWidget"] );
  95079. if ( !element ) {
  95080. return;
  95081. }
  95082. }
  95083. // On Android selection would jump to the first table cell, on other devices
  95084. // we can't block it (and don't need to) because of drag and drop support.
  95085. if ( _ckeditor_ckeditor5_utils_src_env__WEBPACK_IMPORTED_MODULE_6__["default"].isAndroid ) {
  95086. domEventData.preventDefault();
  95087. }
  95088. // Focus editor if is not focused already.
  95089. if ( !viewDocument.isFocused ) {
  95090. view.focus();
  95091. }
  95092. // Create model selection over widget.
  95093. const modelElement = editor.editing.mapper.toModelElement( element );
  95094. this._setSelectionOverElement( modelElement );
  95095. }
  95096. /**
  95097. * Handles {@link module:engine/view/document~Document#event:keydown keydown} events and changes
  95098. * the model selection when:
  95099. *
  95100. * * arrow key is pressed when the widget is selected,
  95101. * * the selection is next to a widget and the widget should become selected upon the arrow key press.
  95102. *
  95103. * See {@link #_preventDefaultOnArrowKeyPress}.
  95104. *
  95105. * @private
  95106. * @param {module:utils/eventinfo~EventInfo} eventInfo
  95107. * @param {module:engine/view/observer/domeventdata~DomEventData} domEventData
  95108. */
  95109. _handleSelectionChangeOnArrowKeyPress( eventInfo, domEventData ) {
  95110. const keyCode = domEventData.keyCode;
  95111. const model = this.editor.model;
  95112. const schema = model.schema;
  95113. const modelSelection = model.document.selection;
  95114. const objectElement = modelSelection.getSelectedElement();
  95115. const isForward = Object(_ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_5__["isForwardArrowKeyCode"])( keyCode, this.editor.locale.contentLanguageDirection );
  95116. // If object element is selected.
  95117. if ( objectElement && schema.isObject( objectElement ) ) {
  95118. const position = isForward ? modelSelection.getLastPosition() : modelSelection.getFirstPosition();
  95119. const newRange = schema.getNearestSelectionRange( position, isForward ? 'forward' : 'backward' );
  95120. if ( newRange ) {
  95121. model.change( writer => {
  95122. writer.setSelection( newRange );
  95123. } );
  95124. domEventData.preventDefault();
  95125. eventInfo.stop();
  95126. }
  95127. return;
  95128. }
  95129. // If selection is next to object element.
  95130. // Return if not collapsed.
  95131. if ( !modelSelection.isCollapsed ) {
  95132. return;
  95133. }
  95134. const objectElementNextToSelection = this._getObjectElementNextToSelection( isForward );
  95135. if ( objectElementNextToSelection && schema.isObject( objectElementNextToSelection ) ) {
  95136. this._setSelectionOverElement( objectElementNextToSelection );
  95137. domEventData.preventDefault();
  95138. eventInfo.stop();
  95139. }
  95140. }
  95141. /**
  95142. * Handles {@link module:engine/view/document~Document#event:keydown keydown} events and prevents
  95143. * the default browser behavior to make sure the fake selection is not being moved from a fake selection
  95144. * container.
  95145. *
  95146. * See {@link #_handleSelectionChangeOnArrowKeyPress}.
  95147. *
  95148. * @private
  95149. * @param {module:utils/eventinfo~EventInfo} eventInfo
  95150. * @param {module:engine/view/observer/domeventdata~DomEventData} domEventData
  95151. */
  95152. _preventDefaultOnArrowKeyPress( eventInfo, domEventData ) {
  95153. const model = this.editor.model;
  95154. const schema = model.schema;
  95155. const objectElement = model.document.selection.getSelectedElement();
  95156. // If object element is selected.
  95157. if ( objectElement && schema.isObject( objectElement ) ) {
  95158. domEventData.preventDefault();
  95159. eventInfo.stop();
  95160. }
  95161. }
  95162. /**
  95163. * Handles delete keys: backspace and delete.
  95164. *
  95165. * @private
  95166. * @param {Boolean} isForward Set to true if delete was performed in forward direction.
  95167. * @returns {Boolean|undefined} Returns `true` if keys were handled correctly.
  95168. */
  95169. _handleDelete( isForward ) {
  95170. // Do nothing when the read only mode is enabled.
  95171. if ( this.editor.isReadOnly ) {
  95172. return;
  95173. }
  95174. const modelDocument = this.editor.model.document;
  95175. const modelSelection = modelDocument.selection;
  95176. // Do nothing on non-collapsed selection.
  95177. if ( !modelSelection.isCollapsed ) {
  95178. return;
  95179. }
  95180. const objectElement = this._getObjectElementNextToSelection( isForward );
  95181. if ( objectElement ) {
  95182. this.editor.model.change( writer => {
  95183. let previousNode = modelSelection.anchor.parent;
  95184. // Remove previous element if empty.
  95185. while ( previousNode.isEmpty ) {
  95186. const nodeToRemove = previousNode;
  95187. previousNode = nodeToRemove.parent;
  95188. writer.remove( nodeToRemove );
  95189. }
  95190. this._setSelectionOverElement( objectElement );
  95191. } );
  95192. return true;
  95193. }
  95194. }
  95195. /**
  95196. * Sets {@link module:engine/model/selection~Selection document's selection} over given element.
  95197. *
  95198. * @protected
  95199. * @param {module:engine/model/element~Element} element
  95200. */
  95201. _setSelectionOverElement( element ) {
  95202. this.editor.model.change( writer => {
  95203. writer.setSelection( writer.createRangeOn( element ) );
  95204. } );
  95205. }
  95206. /**
  95207. * Checks if {@link module:engine/model/element~Element element} placed next to the current
  95208. * {@link module:engine/model/selection~Selection model selection} exists and is marked in
  95209. * {@link module:engine/model/schema~Schema schema} as `object`.
  95210. *
  95211. * @protected
  95212. * @param {Boolean} forward Direction of checking.
  95213. * @returns {module:engine/model/element~Element|null}
  95214. */
  95215. _getObjectElementNextToSelection( forward ) {
  95216. const model = this.editor.model;
  95217. const schema = model.schema;
  95218. const modelSelection = model.document.selection;
  95219. // Clone current selection to use it as a probe. We must leave default selection as it is so it can return
  95220. // to its current state after undo.
  95221. const probe = model.createSelection( modelSelection );
  95222. model.modifySelection( probe, { direction: forward ? 'forward' : 'backward' } );
  95223. const objectElement = forward ? probe.focus.nodeBefore : probe.focus.nodeAfter;
  95224. if ( !!objectElement && schema.isObject( objectElement ) ) {
  95225. return objectElement;
  95226. }
  95227. return null;
  95228. }
  95229. /**
  95230. * Removes CSS class from previously selected widgets.
  95231. *
  95232. * @private
  95233. * @param {module:engine/view/downcastwriter~DowncastWriter} writer
  95234. */
  95235. _clearPreviouslySelectedWidgets( writer ) {
  95236. for ( const widget of this._previouslySelected ) {
  95237. writer.removeClass( _utils__WEBPACK_IMPORTED_MODULE_4__["WIDGET_SELECTED_CLASS_NAME"], widget );
  95238. }
  95239. this._previouslySelected.clear();
  95240. }
  95241. }
  95242. // Returns `true` when element is a nested editable or is placed inside one.
  95243. //
  95244. // @param {module:engine/view/element~Element}
  95245. // @returns {Boolean}
  95246. function isInsideNestedEditable( element ) {
  95247. while ( element ) {
  95248. if ( element.is( 'editableElement' ) && !element.is( 'rootElement' ) ) {
  95249. return true;
  95250. }
  95251. // Click on nested widget should select it.
  95252. if ( Object(_utils__WEBPACK_IMPORTED_MODULE_4__["isWidget"])( element ) ) {
  95253. return false;
  95254. }
  95255. element = element.parent;
  95256. }
  95257. return false;
  95258. }
  95259. // Checks whether the specified `element` is a child of the `parent` element.
  95260. //
  95261. // @param {module:engine/view/element~Element} element An element to check.
  95262. // @param {module:engine/view/element~Element|null} parent A parent for the element.
  95263. // @returns {Boolean}
  95264. function isChild( element, parent ) {
  95265. if ( !parent ) {
  95266. return false;
  95267. }
  95268. return Array.from( element.getAncestors() ).includes( parent );
  95269. }
  95270. /***/ }),
  95271. /***/ "./node_modules/@ckeditor/ckeditor5-widget/src/widgetresize.js":
  95272. /*!*********************************************************************!*\
  95273. !*** ./node_modules/@ckeditor/ckeditor5-widget/src/widgetresize.js ***!
  95274. \*********************************************************************/
  95275. /*! exports provided: default */
  95276. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  95277. "use strict";
  95278. __webpack_require__.r(__webpack_exports__);
  95279. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return WidgetResize; });
  95280. /* 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");
  95281. /* harmony import */ var _widgetresize_resizer__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./widgetresize/resizer */ "./node_modules/@ckeditor/ckeditor5-widget/src/widgetresize/resizer.js");
  95282. /* 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");
  95283. /* 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");
  95284. /* 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");
  95285. /* 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");
  95286. /* 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");
  95287. /* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! lodash-es */ "./node_modules/lodash-es/lodash.js");
  95288. /* harmony import */ var _theme_widgetresize_css__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../theme/widgetresize.css */ "./node_modules/@ckeditor/ckeditor5-widget/theme/widgetresize.css");
  95289. /* harmony import */ var _theme_widgetresize_css__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_theme_widgetresize_css__WEBPACK_IMPORTED_MODULE_8__);
  95290. /**
  95291. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  95292. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  95293. */
  95294. /**
  95295. * @module widget/widgetresize
  95296. */
  95297. /**
  95298. * The widget resize feature plugin.
  95299. *
  95300. * Use the {@link module:widget/widgetresize~WidgetResize#attachTo} method to create a resizer for the specified widget.
  95301. *
  95302. * @extends module:core/plugin~Plugin
  95303. * @mixes module:utils/observablemixin~ObservableMixin
  95304. */
  95305. class WidgetResize extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
  95306. /**
  95307. * @inheritDoc
  95308. */
  95309. static get pluginName() {
  95310. return 'WidgetResize';
  95311. }
  95312. /**
  95313. * @inheritDoc
  95314. */
  95315. init() {
  95316. /**
  95317. * The currently visible resizer.
  95318. *
  95319. * @observable
  95320. * @member {module:widget/widgetresize/resizer~Resizer|null} #visibleResizer
  95321. */
  95322. this.set( 'visibleResizer', null );
  95323. /**
  95324. * References an active resizer.
  95325. *
  95326. * Active resizer means a resizer which handle is actively used by the end user.
  95327. *
  95328. * @protected
  95329. * @observable
  95330. * @member {module:widget/widgetresize/resizer~Resizer|null} #_activeResizer
  95331. */
  95332. this.set( '_activeResizer', null );
  95333. /**
  95334. * A map of resizers created using this plugin instance.
  95335. *
  95336. * @private
  95337. * @type {Map.<module:engine/view/containerelement~ContainerElement, module:widget/widgetresize/resizer~Resizer>}
  95338. */
  95339. this._resizers = new Map();
  95340. const domDocument = _ckeditor_ckeditor5_utils_src_dom_global__WEBPACK_IMPORTED_MODULE_3__["default"].window.document;
  95341. this.editor.model.schema.setAttributeProperties( 'width', {
  95342. isFormatting: true
  95343. } );
  95344. this.editor.editing.view.addObserver( _ckeditor_ckeditor5_engine_src_view_observer_mouseobserver__WEBPACK_IMPORTED_MODULE_5__["default"] );
  95345. this._observer = Object.create( _ckeditor_ckeditor5_utils_src_dom_emittermixin__WEBPACK_IMPORTED_MODULE_2__["default"] );
  95346. this.listenTo( this.editor.editing.view.document, 'mousedown', this._mouseDownListener.bind( this ), { priority: 'high' } );
  95347. this._observer.listenTo( domDocument, 'mousemove', this._mouseMoveListener.bind( this ) );
  95348. this._observer.listenTo( domDocument, 'mouseup', this._mouseUpListener.bind( this ) );
  95349. const redrawFocusedResizer = () => {
  95350. if ( this.visibleResizer ) {
  95351. this.visibleResizer.redraw();
  95352. }
  95353. };
  95354. this._redrawFocusedResizerThrottled = Object(lodash_es__WEBPACK_IMPORTED_MODULE_7__["throttle"])( redrawFocusedResizer, 200 );
  95355. // Redraws occurring upon a change of visible resizer must not be throttled, as it is crucial for the initial
  95356. // render. Without it the resizer frame would be misaligned with resizing host for a fraction of second.
  95357. this.on( 'change:visibleResizer', redrawFocusedResizer );
  95358. // Redrawing on any change of the UI of the editor (including content changes).
  95359. this.editor.ui.on( 'update', this._redrawFocusedResizerThrottled );
  95360. // Resizers need to be redrawn upon window resize, because new window might shrink resize host.
  95361. this._observer.listenTo( _ckeditor_ckeditor5_utils_src_dom_global__WEBPACK_IMPORTED_MODULE_3__["default"].window, 'resize', this._redrawFocusedResizerThrottled );
  95362. const viewSelection = this.editor.editing.view.document.selection;
  95363. viewSelection.on( 'change', () => {
  95364. const selectedElement = viewSelection.getSelectedElement();
  95365. this.visibleResizer = this.getResizerByViewElement( selectedElement ) || null;
  95366. } );
  95367. }
  95368. /**
  95369. * @inheritDoc
  95370. */
  95371. destroy() {
  95372. this._observer.stopListening();
  95373. for ( const resizer of this._resizers.values() ) {
  95374. resizer.destroy();
  95375. }
  95376. this._redrawFocusedResizerThrottled.cancel();
  95377. }
  95378. /**
  95379. * @param {module:widget/widgetresize~ResizerOptions} [options] Resizer options.
  95380. * @returns {module:widget/widgetresize/resizer~Resizer}
  95381. */
  95382. attachTo( options ) {
  95383. const resizer = new _widgetresize_resizer__WEBPACK_IMPORTED_MODULE_1__["default"]( options );
  95384. const plugins = this.editor.plugins;
  95385. resizer.attach();
  95386. if ( plugins.has( 'WidgetToolbarRepository' ) ) {
  95387. // Hiding widget toolbar to improve the performance
  95388. // (https://github.com/ckeditor/ckeditor5-widget/pull/112#issuecomment-564528765).
  95389. const widgetToolbarRepository = plugins.get( 'WidgetToolbarRepository' );
  95390. resizer.on( 'begin', () => {
  95391. widgetToolbarRepository.forceDisabled( 'resize' );
  95392. }, { priority: 'lowest' } );
  95393. resizer.on( 'cancel', () => {
  95394. widgetToolbarRepository.clearForceDisabled( 'resize' );
  95395. }, { priority: 'highest' } );
  95396. resizer.on( 'commit', () => {
  95397. widgetToolbarRepository.clearForceDisabled( 'resize' );
  95398. }, { priority: 'highest' } );
  95399. }
  95400. this._resizers.set( options.viewElement, resizer );
  95401. const viewSelection = this.editor.editing.view.document.selection;
  95402. const selectedElement = viewSelection.getSelectedElement();
  95403. // If the element the resizer is created for is currently focused, it should become visible.
  95404. if ( this.getResizerByViewElement( selectedElement ) == resizer ) {
  95405. this.visibleResizer = resizer;
  95406. }
  95407. return resizer;
  95408. }
  95409. /**
  95410. * Returns a resizer created for a given view element (widget element).
  95411. *
  95412. * @param {module:engine/view/containerelement~ContainerElement} viewElement View element associated with the resizer.
  95413. * @returns {module:widget/widgetresize/resizer~Resizer|undefined}
  95414. */
  95415. getResizerByViewElement( viewElement ) {
  95416. return this._resizers.get( viewElement );
  95417. }
  95418. /**
  95419. * Returns a resizer that contains a given resize handle.
  95420. *
  95421. * @protected
  95422. * @param {HTMLElement} domResizeHandle
  95423. * @returns {module:widget/widgetresize/resizer~Resizer}
  95424. */
  95425. _getResizerByHandle( domResizeHandle ) {
  95426. for ( const resizer of this._resizers.values() ) {
  95427. if ( resizer.containsHandle( domResizeHandle ) ) {
  95428. return resizer;
  95429. }
  95430. }
  95431. }
  95432. /**
  95433. * @protected
  95434. * @param {module:utils/eventinfo~EventInfo} event
  95435. * @param {Event} domEventData Native DOM event.
  95436. */
  95437. _mouseDownListener( event, domEventData ) {
  95438. const resizeHandle = domEventData.domTarget;
  95439. if ( !_widgetresize_resizer__WEBPACK_IMPORTED_MODULE_1__["default"].isResizeHandle( resizeHandle ) ) {
  95440. return;
  95441. }
  95442. this._activeResizer = this._getResizerByHandle( resizeHandle );
  95443. if ( this._activeResizer ) {
  95444. this._activeResizer.begin( resizeHandle );
  95445. // Do not call other events when resizing. See: #6755.
  95446. event.stop();
  95447. domEventData.preventDefault();
  95448. }
  95449. }
  95450. /**
  95451. * @protected
  95452. * @param {module:utils/eventinfo~EventInfo} event
  95453. * @param {Event} domEventData Native DOM event.
  95454. */
  95455. _mouseMoveListener( event, domEventData ) {
  95456. if ( this._activeResizer ) {
  95457. this._activeResizer.updateSize( domEventData );
  95458. }
  95459. }
  95460. /**
  95461. * @protected
  95462. */
  95463. _mouseUpListener() {
  95464. if ( this._activeResizer ) {
  95465. this._activeResizer.commit();
  95466. this._activeResizer = null;
  95467. }
  95468. }
  95469. }
  95470. Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_6__["default"])( WidgetResize, _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_4__["default"] );
  95471. /**
  95472. * Interface describing a resizer. It allows to specify the resizing host, custom logic for calculating aspect ratio, etc.
  95473. *
  95474. * @interface ResizerOptions
  95475. */
  95476. /**
  95477. * Editor instance associated with the resizer.
  95478. *
  95479. * @member {module:core/editor/editor~Editor} module:widget/widgetresize~ResizerOptions#editor
  95480. */
  95481. /**
  95482. * @member {module:engine/model/element~Element} module:widget/widgetresize~ResizerOptions#modelElement
  95483. */
  95484. /**
  95485. * A view of an element to be resized. Typically it's the main widget's view instance.
  95486. *
  95487. * @member {module:engine/view/containerelement~ContainerElement} module:widget/widgetresize~ResizerOptions#viewElement
  95488. */
  95489. /**
  95490. * A callback to be executed once the resizing process is done.
  95491. *
  95492. * It receives a `Number` (`newValue`) as a parameter.
  95493. *
  95494. * For example, {@link module:image/imageresize~ImageResize} uses it to execute the resize image command
  95495. * which puts the new value into the model.
  95496. *
  95497. * ```js
  95498. * {
  95499. * editor,
  95500. * modelElement: data.item,
  95501. * viewElement: widget,
  95502. *
  95503. * onCommit( newValue ) {
  95504. * editor.execute( 'resizeImage', { width: newValue } );
  95505. * }
  95506. * };
  95507. * ```
  95508. *
  95509. *
  95510. * @member {Function} module:widget/widgetresize~ResizerOptions#onCommit
  95511. */
  95512. /**
  95513. * @member {Function} module:widget/widgetresize~ResizerOptions#getResizeHost
  95514. */
  95515. /**
  95516. * @member {Function} module:widget/widgetresize~ResizerOptions#isCentered
  95517. */
  95518. /***/ }),
  95519. /***/ "./node_modules/@ckeditor/ckeditor5-widget/src/widgetresize/resizer.js":
  95520. /*!*****************************************************************************!*\
  95521. !*** ./node_modules/@ckeditor/ckeditor5-widget/src/widgetresize/resizer.js ***!
  95522. \*****************************************************************************/
  95523. /*! exports provided: default */
  95524. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  95525. "use strict";
  95526. __webpack_require__.r(__webpack_exports__);
  95527. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Resizer; });
  95528. /* 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");
  95529. /* 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");
  95530. /* 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");
  95531. /* 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");
  95532. /* 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");
  95533. /* 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");
  95534. /* harmony import */ var _resizerstate__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./resizerstate */ "./node_modules/@ckeditor/ckeditor5-widget/src/widgetresize/resizerstate.js");
  95535. /**
  95536. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  95537. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  95538. */
  95539. /**
  95540. * @module widget/widgetresize/resizer
  95541. */
  95542. /**
  95543. * Represents a resizer for a single resizable object.
  95544. *
  95545. * @mixes module:utils/observablemixin~ObservableMixin
  95546. */
  95547. class Resizer {
  95548. /**
  95549. * @param {module:widget/widgetresize~ResizerOptions} options Resizer options.
  95550. */
  95551. constructor( options ) {
  95552. /**
  95553. * Stores the state of the resizable host geometry, such as the original width, the currently proposed height, etc.
  95554. *
  95555. * Note that a new state is created for each resize transaction.
  95556. *
  95557. * @readonly
  95558. * @member {module:widget/widgetresize/resizerstate~ResizerState} #state
  95559. */
  95560. /**
  95561. * A view displaying the proposed new element size during the resizing.
  95562. *
  95563. * @protected
  95564. * @readonly
  95565. * @member {module:widget/widgetresize/resizer~SizeView} #_sizeUI
  95566. */
  95567. /**
  95568. * Options passed to the {@link #constructor}.
  95569. *
  95570. * @private
  95571. * @type {module:widget/widgetresize~ResizerOptions}
  95572. */
  95573. this._options = options;
  95574. /**
  95575. * Container of the entire resize UI.
  95576. *
  95577. * Note that this property is initialized only after the element bound with the resizer is drawn
  95578. * so it will be a `null` when uninitialized.
  95579. *
  95580. * @private
  95581. * @type {HTMLElement|null}
  95582. */
  95583. this._domResizerWrapper = null;
  95584. /**
  95585. * A wrapper that is controlled by the resizer. This is usually a widget element.
  95586. *
  95587. * @private
  95588. * @type {module:engine/view/element~Element|null}
  95589. */
  95590. this._viewResizerWrapper = null;
  95591. /**
  95592. * The width of the resized {@link module:widget/widgetresize~ResizerOptions#viewElement viewElement} before the resizing started.
  95593. *
  95594. * @private
  95595. * @member {Number|String|undefined} #_initialViewWidth
  95596. */
  95597. /**
  95598. * @observable
  95599. */
  95600. this.set( 'isEnabled', true );
  95601. this.decorate( 'begin' );
  95602. this.decorate( 'cancel' );
  95603. this.decorate( 'commit' );
  95604. this.decorate( 'updateSize' );
  95605. this.on( 'commit', event => {
  95606. // State might not be initialized yet. In this case, prevent further handling and make sure that the resizer is
  95607. // cleaned up (#5195).
  95608. if ( !this.state.proposedWidth && !this.state.proposedWidthPercents ) {
  95609. this._cleanup();
  95610. event.stop();
  95611. }
  95612. }, { priority: 'high' } );
  95613. this.on( 'change:isEnabled', () => {
  95614. // We should redraw the resize handles when the plugin is enabled again.
  95615. // Otherwise they won't show up.
  95616. if ( this.isEnabled ) {
  95617. this.redraw();
  95618. }
  95619. } );
  95620. }
  95621. /**
  95622. * Attaches the resizer to the DOM.
  95623. */
  95624. attach() {
  95625. const that = this;
  95626. const widgetElement = this._options.viewElement;
  95627. const editingView = this._options.editor.editing.view;
  95628. editingView.change( writer => {
  95629. const viewResizerWrapper = writer.createUIElement( 'div', {
  95630. class: 'ck ck-reset_all ck-widget__resizer'
  95631. }, function( domDocument ) {
  95632. const domElement = this.toDomElement( domDocument );
  95633. that._appendHandles( domElement );
  95634. that._appendSizeUI( domElement );
  95635. that._domResizerWrapper = domElement;
  95636. that.on( 'change:isEnabled', ( evt, propName, newValue ) => {
  95637. domElement.style.display = newValue ? '' : 'none';
  95638. } );
  95639. domElement.style.display = that.isEnabled ? '' : 'none';
  95640. return domElement;
  95641. } );
  95642. // Append the resizer wrapper to the widget's wrapper.
  95643. writer.insert( writer.createPositionAt( widgetElement, 'end' ), viewResizerWrapper );
  95644. writer.addClass( 'ck-widget_with-resizer', widgetElement );
  95645. this._viewResizerWrapper = viewResizerWrapper;
  95646. } );
  95647. }
  95648. /**
  95649. * Starts the resizing process.
  95650. *
  95651. * Creates a new {@link #state} for the current process.
  95652. *
  95653. * @fires begin
  95654. * @param {HTMLElement} domResizeHandle Clicked handle.
  95655. */
  95656. begin( domResizeHandle ) {
  95657. this.state = new _resizerstate__WEBPACK_IMPORTED_MODULE_6__["default"]( this._options );
  95658. this._sizeUI.bindToState( this._options, this.state );
  95659. this._initialViewWidth = this._options.viewElement.getStyle( 'width' );
  95660. this.state.begin( domResizeHandle, this._getHandleHost(), this._getResizeHost() );
  95661. }
  95662. /**
  95663. * Updates the proposed size based on `domEventData`.
  95664. *
  95665. * @fires updateSize
  95666. * @param {Event} domEventData
  95667. */
  95668. updateSize( domEventData ) {
  95669. const newSize = this._proposeNewSize( domEventData );
  95670. const editingView = this._options.editor.editing.view;
  95671. editingView.change( writer => {
  95672. const unit = this._options.unit || '%';
  95673. const newWidth = ( unit === '%' ? newSize.widthPercents : newSize.width ) + unit;
  95674. writer.setStyle( 'width', newWidth, this._options.viewElement );
  95675. } );
  95676. // Get an actual image width, and:
  95677. // * reflect this size to the resize wrapper
  95678. // * apply this **real** size to the state
  95679. const domHandleHost = this._getHandleHost();
  95680. const domHandleHostRect = new _ckeditor_ckeditor5_utils_src_dom_rect__WEBPACK_IMPORTED_MODULE_2__["default"]( domHandleHost );
  95681. newSize.handleHostWidth = Math.round( domHandleHostRect.width );
  95682. newSize.handleHostHeight = Math.round( domHandleHostRect.height );
  95683. // Handle max-width limitation.
  95684. const domResizeHostRect = new _ckeditor_ckeditor5_utils_src_dom_rect__WEBPACK_IMPORTED_MODULE_2__["default"]( domHandleHost );
  95685. newSize.width = Math.round( domResizeHostRect.width );
  95686. newSize.height = Math.round( domResizeHostRect.height );
  95687. this.redraw( domHandleHostRect );
  95688. this.state.update( newSize );
  95689. }
  95690. /**
  95691. * Applies the geometry proposed with the resizer.
  95692. *
  95693. * @fires commit
  95694. */
  95695. commit() {
  95696. const unit = this._options.unit || '%';
  95697. const newValue = ( unit === '%' ? this.state.proposedWidthPercents : this.state.proposedWidth ) + unit;
  95698. // Both cleanup and onCommit callback are very likely to make view changes. Ensure that it is made in a single step.
  95699. this._options.editor.editing.view.change( () => {
  95700. this._cleanup();
  95701. this._options.onCommit( newValue );
  95702. } );
  95703. }
  95704. /**
  95705. * Cancels and rejects the proposed resize dimensions, hiding the UI.
  95706. *
  95707. * @fires cancel
  95708. */
  95709. cancel() {
  95710. this._cleanup();
  95711. }
  95712. /**
  95713. * Destroys the resizer.
  95714. */
  95715. destroy() {
  95716. this.cancel();
  95717. }
  95718. /**
  95719. * Redraws the resizer.
  95720. *
  95721. * @param {module:utils/dom/rect~Rect} [handleHostRect] Handle host rectangle might be given to improve performance.
  95722. */
  95723. redraw( handleHostRect ) {
  95724. const domWrapper = this._domResizerWrapper;
  95725. // Refresh only if resizer exists in the DOM.
  95726. if ( !existsInDom( domWrapper ) ) {
  95727. return;
  95728. }
  95729. const widgetWrapper = domWrapper.parentElement;
  95730. const handleHost = this._getHandleHost();
  95731. const resizerWrapper = this._viewResizerWrapper;
  95732. const currentDimensions = [
  95733. resizerWrapper.getStyle( 'width' ),
  95734. resizerWrapper.getStyle( 'height' ),
  95735. resizerWrapper.getStyle( 'left' ),
  95736. resizerWrapper.getStyle( 'top' )
  95737. ];
  95738. let newDimensions;
  95739. if ( widgetWrapper.isSameNode( handleHost ) ) {
  95740. const clientRect = handleHostRect || new _ckeditor_ckeditor5_utils_src_dom_rect__WEBPACK_IMPORTED_MODULE_2__["default"]( handleHost );
  95741. newDimensions = [
  95742. clientRect.width + 'px',
  95743. clientRect.height + 'px',
  95744. undefined,
  95745. undefined
  95746. ];
  95747. }
  95748. // In case a resizing host is not a widget wrapper, we need to compensate
  95749. // for any additional offsets the resize host might have. E.g. wrapper padding
  95750. // or simply another editable. By doing that the border and resizers are shown
  95751. // only around the resize host.
  95752. else {
  95753. newDimensions = [
  95754. handleHost.offsetWidth + 'px',
  95755. handleHost.offsetHeight + 'px',
  95756. handleHost.offsetLeft + 'px',
  95757. handleHost.offsetTop + 'px'
  95758. ];
  95759. }
  95760. // Make changes to the view only if the resizer should actually get new dimensions.
  95761. // Otherwise, if View#change() was always called, this would cause EditorUI#update
  95762. // loops because the WidgetResize plugin listens to EditorUI#update and updates
  95763. // the resizer.
  95764. // https://github.com/ckeditor/ckeditor5/issues/7633
  95765. if ( Object(_ckeditor_ckeditor5_utils_src_comparearrays__WEBPACK_IMPORTED_MODULE_3__["default"])( currentDimensions, newDimensions ) !== 'same' ) {
  95766. this._options.editor.editing.view.change( writer => {
  95767. writer.setStyle( {
  95768. width: newDimensions[ 0 ],
  95769. height: newDimensions[ 1 ],
  95770. left: newDimensions[ 2 ],
  95771. top: newDimensions[ 3 ]
  95772. }, resizerWrapper );
  95773. } );
  95774. }
  95775. }
  95776. containsHandle( domElement ) {
  95777. return this._domResizerWrapper.contains( domElement );
  95778. }
  95779. static isResizeHandle( domElement ) {
  95780. return domElement.classList.contains( 'ck-widget__resizer__handle' );
  95781. }
  95782. /**
  95783. * Cleans up the context state.
  95784. *
  95785. * @protected
  95786. */
  95787. _cleanup() {
  95788. this._sizeUI.dismiss();
  95789. this._sizeUI.isVisible = false;
  95790. const editingView = this._options.editor.editing.view;
  95791. editingView.change( writer => {
  95792. writer.setStyle( 'width', this._initialViewWidth, this._options.viewElement );
  95793. } );
  95794. }
  95795. /**
  95796. * Calculates the proposed size as the resize handles are dragged.
  95797. *
  95798. * @private
  95799. * @param {Event} domEventData Event data that caused the size update request. It should be used to calculate the proposed size.
  95800. * @returns {Object} return
  95801. * @returns {Number} return.width Proposed width.
  95802. * @returns {Number} return.height Proposed height.
  95803. */
  95804. _proposeNewSize( domEventData ) {
  95805. const state = this.state;
  95806. const currentCoordinates = extractCoordinates( domEventData );
  95807. const isCentered = this._options.isCentered ? this._options.isCentered( this ) : true;
  95808. // Enlargement defines how much the resize host has changed in a given axis. Naturally it could be a negative number
  95809. // meaning that it has been shrunk.
  95810. //
  95811. // +----------------+--+
  95812. // | | |
  95813. // | img | |
  95814. // | /handle host | |
  95815. // +----------------+ | ^
  95816. // | | | - enlarge y
  95817. // +-------------------+ v
  95818. // <-->
  95819. // enlarge x
  95820. const enlargement = {
  95821. x: state._referenceCoordinates.x - ( currentCoordinates.x + state.originalWidth ),
  95822. y: ( currentCoordinates.y - state.originalHeight ) - state._referenceCoordinates.y
  95823. };
  95824. if ( isCentered && state.activeHandlePosition.endsWith( '-right' ) ) {
  95825. enlargement.x = currentCoordinates.x - ( state._referenceCoordinates.x + state.originalWidth );
  95826. }
  95827. // Objects needs to be resized twice as much in horizontal axis if centered, since enlargement is counted from
  95828. // one resized corner to your cursor. It needs to be duplicated to compensate for the other side too.
  95829. if ( isCentered ) {
  95830. enlargement.x *= 2;
  95831. }
  95832. // const resizeHost = this._getResizeHost();
  95833. // The size proposed by the user. It does not consider the aspect ratio.
  95834. const proposedSize = {
  95835. width: Math.abs( state.originalWidth + enlargement.x ),
  95836. height: Math.abs( state.originalHeight + enlargement.y )
  95837. };
  95838. // Dominant determination must take the ratio into account.
  95839. proposedSize.dominant = proposedSize.width / state.aspectRatio > proposedSize.height ? 'width' : 'height';
  95840. proposedSize.max = proposedSize[ proposedSize.dominant ];
  95841. // Proposed size, respecting the aspect ratio.
  95842. const targetSize = {
  95843. width: proposedSize.width,
  95844. height: proposedSize.height
  95845. };
  95846. if ( proposedSize.dominant == 'width' ) {
  95847. targetSize.height = targetSize.width / state.aspectRatio;
  95848. } else {
  95849. targetSize.width = targetSize.height * state.aspectRatio;
  95850. }
  95851. return {
  95852. width: Math.round( targetSize.width ),
  95853. height: Math.round( targetSize.height ),
  95854. widthPercents: Math.min( Math.round( state.originalWidthPercents / state.originalWidth * targetSize.width * 100 ) / 100, 100 )
  95855. };
  95856. }
  95857. /**
  95858. * Obtains the resize host.
  95859. *
  95860. * Resize host is an object that receives dimensions which are the result of resizing.
  95861. *
  95862. * @protected
  95863. * @returns {HTMLElement}
  95864. */
  95865. _getResizeHost() {
  95866. const widgetWrapper = this._domResizerWrapper.parentElement;
  95867. return this._options.getResizeHost( widgetWrapper );
  95868. }
  95869. /**
  95870. * Obtains the handle host.
  95871. *
  95872. * Handle host is an object that the handles are aligned to.
  95873. *
  95874. * Handle host will not always be an entire widget itself. Take an image as an example. The image widget
  95875. * contains an image and a caption. Only the image should be surrounded with handles.
  95876. *
  95877. * @protected
  95878. * @returns {HTMLElement}
  95879. */
  95880. _getHandleHost() {
  95881. const widgetWrapper = this._domResizerWrapper.parentElement;
  95882. return this._options.getHandleHost( widgetWrapper );
  95883. }
  95884. /**
  95885. * Renders the resize handles in the DOM.
  95886. *
  95887. * @private
  95888. * @param {HTMLElement} domElement The resizer wrapper.
  95889. */
  95890. _appendHandles( domElement ) {
  95891. const resizerPositions = [ 'top-left', 'top-right', 'bottom-right', 'bottom-left' ];
  95892. for ( const currentPosition of resizerPositions ) {
  95893. domElement.appendChild( ( new _ckeditor_ckeditor5_ui_src_template__WEBPACK_IMPORTED_MODULE_1__["default"]( {
  95894. tag: 'div',
  95895. attributes: {
  95896. class: `ck-widget__resizer__handle ${ getResizerClass( currentPosition ) }`
  95897. }
  95898. } ).render() ) );
  95899. }
  95900. }
  95901. /**
  95902. * Sets up the {@link #_sizeUI} property and adds it to the passed `domElement`.
  95903. *
  95904. * @private
  95905. * @param {HTMLElement} domElement
  95906. */
  95907. _appendSizeUI( domElement ) {
  95908. const sizeUI = new SizeView();
  95909. // Make sure icon#element is rendered before passing to appendChild().
  95910. sizeUI.render();
  95911. this._sizeUI = sizeUI;
  95912. domElement.appendChild( sizeUI.element );
  95913. }
  95914. /**
  95915. * @event begin
  95916. */
  95917. /**
  95918. * @event updateSize
  95919. */
  95920. /**
  95921. * @event commit
  95922. */
  95923. /**
  95924. * @event cancel
  95925. */
  95926. }
  95927. Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_5__["default"])( Resizer, _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_4__["default"] );
  95928. /**
  95929. * A view displaying the proposed new element size during the resizing.
  95930. *
  95931. * @extends {module:ui/view~View}
  95932. */
  95933. class SizeView extends _ckeditor_ckeditor5_ui_src_view__WEBPACK_IMPORTED_MODULE_0__["default"] {
  95934. constructor() {
  95935. super();
  95936. const bind = this.bindTemplate;
  95937. this.setTemplate( {
  95938. tag: 'div',
  95939. attributes: {
  95940. class: [
  95941. 'ck',
  95942. 'ck-size-view',
  95943. bind.to( 'activeHandlePosition', value => value ? `ck-orientation-${ value }` : '' )
  95944. ],
  95945. style: {
  95946. display: bind.if( 'isVisible', 'none', visible => !visible )
  95947. }
  95948. },
  95949. children: [ {
  95950. text: bind.to( 'label' )
  95951. } ]
  95952. } );
  95953. }
  95954. bindToState( options, resizerState ) {
  95955. this.bind( 'isVisible' ).to( resizerState, 'proposedWidth', resizerState, 'proposedHeight', ( width, height ) =>
  95956. width !== null && height !== null );
  95957. this.bind( 'label' ).to(
  95958. resizerState, 'proposedHandleHostWidth',
  95959. resizerState, 'proposedHandleHostHeight',
  95960. resizerState, 'proposedWidthPercents',
  95961. ( width, height, widthPercents ) => {
  95962. if ( options.unit === 'px' ) {
  95963. return `${ width }×${ height }`;
  95964. } else {
  95965. return `${ widthPercents }%`;
  95966. }
  95967. }
  95968. );
  95969. this.bind( 'activeHandlePosition' ).to( resizerState );
  95970. }
  95971. dismiss() {
  95972. this.unbind();
  95973. this.isVisible = false;
  95974. }
  95975. }
  95976. // @private
  95977. // @param {String} resizerPosition Expected resizer position like `"top-left"`, `"bottom-right"`.
  95978. // @returns {String} A prefixed HTML class name for the resizer element
  95979. function getResizerClass( resizerPosition ) {
  95980. return `ck-widget__resizer__handle-${ resizerPosition }`;
  95981. }
  95982. function extractCoordinates( event ) {
  95983. return {
  95984. x: event.pageX,
  95985. y: event.pageY
  95986. };
  95987. }
  95988. function existsInDom( element ) {
  95989. return element && element.ownerDocument && element.ownerDocument.contains( element );
  95990. }
  95991. /***/ }),
  95992. /***/ "./node_modules/@ckeditor/ckeditor5-widget/src/widgetresize/resizerstate.js":
  95993. /*!**********************************************************************************!*\
  95994. !*** ./node_modules/@ckeditor/ckeditor5-widget/src/widgetresize/resizerstate.js ***!
  95995. \**********************************************************************************/
  95996. /*! exports provided: default */
  95997. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  95998. "use strict";
  95999. __webpack_require__.r(__webpack_exports__);
  96000. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ResizeState; });
  96001. /* 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");
  96002. /* 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");
  96003. /* 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");
  96004. /**
  96005. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  96006. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  96007. */
  96008. /**
  96009. * @module widget/widgetresize/resizerstate
  96010. */
  96011. /**
  96012. * Stores the internal state of a single resizable object.
  96013. *
  96014. */
  96015. class ResizeState {
  96016. /**
  96017. * @param {module:widget/widgetresize~ResizerOptions} options Resizer options.
  96018. */
  96019. constructor( options ) {
  96020. /**
  96021. * The original width (pixels) of the resized object when the resize process was started.
  96022. *
  96023. * @readonly
  96024. * @member {Number} #originalWidth
  96025. */
  96026. /**
  96027. * The original height (pixels) of the resized object when the resize process was started.
  96028. *
  96029. * @readonly
  96030. * @member {Number} #originalHeight
  96031. */
  96032. /**
  96033. * The original width (percents) of the resized object when the resize process was started.
  96034. *
  96035. * @readonly
  96036. * @member {Number} #originalWidthPercents
  96037. */
  96038. /**
  96039. * The position of the handle that initiated the resizing. E.g. `"top-left"`, `"bottom-right"` etc. or `null`
  96040. * if unknown.
  96041. *
  96042. * @readonly
  96043. * @observable
  96044. * @member {String|null} #activeHandlePosition
  96045. */
  96046. this.set( 'activeHandlePosition', null );
  96047. /**
  96048. * The width (percents) proposed, but not committed yet, in the current resize process.
  96049. *
  96050. * @readonly
  96051. * @observable
  96052. * @member {Number|null} #proposedWidthPercents
  96053. */
  96054. this.set( 'proposedWidthPercents', null );
  96055. /**
  96056. * The width (pixels) proposed, but not committed yet, in the current resize process.
  96057. *
  96058. * @readonly
  96059. * @observable
  96060. * @member {Number|null} #proposedWidthPixels
  96061. */
  96062. this.set( 'proposedWidth', null );
  96063. /**
  96064. * The height (pixels) proposed, but not committed yet, in the current resize process.
  96065. *
  96066. * @readonly
  96067. * @observable
  96068. * @member {Number|null} #proposedHeightPixels
  96069. */
  96070. this.set( 'proposedHeight', null );
  96071. this.set( 'proposedHandleHostWidth', null );
  96072. this.set( 'proposedHandleHostHeight', null );
  96073. /**
  96074. * A width to height ratio of the resized image.
  96075. *
  96076. * @readonly
  96077. * @member {Number} #aspectRatio
  96078. */
  96079. /**
  96080. * @private
  96081. * @type {module:widget/widgetresize~ResizerOptions}
  96082. */
  96083. this._options = options;
  96084. /**
  96085. * The reference point of the resizer where the dragging started. It is used to measure the distance the user cursor
  96086. * traveled, so how much the image should be enlarged.
  96087. * This information is only known after the DOM was rendered, so it will be updated later.
  96088. *
  96089. * @private
  96090. * @type {Object}
  96091. */
  96092. this._referenceCoordinates = null;
  96093. }
  96094. /**
  96095. *
  96096. * @param {HTMLElement} domResizeHandle The handle used to calculate the reference point.
  96097. * @param {HTMLElement} domHandleHost
  96098. * @param {HTMLElement} domResizeHost
  96099. */
  96100. begin( domResizeHandle, domHandleHost, domResizeHost ) {
  96101. const clientRect = new _ckeditor_ckeditor5_utils_src_dom_rect__WEBPACK_IMPORTED_MODULE_0__["default"]( domHandleHost );
  96102. this.activeHandlePosition = getHandlePosition( domResizeHandle );
  96103. this._referenceCoordinates = getAbsoluteBoundaryPoint( domHandleHost, getOppositePosition( this.activeHandlePosition ) );
  96104. this.originalWidth = clientRect.width;
  96105. this.originalHeight = clientRect.height;
  96106. this.aspectRatio = clientRect.width / clientRect.height;
  96107. const widthStyle = domResizeHost.style.width;
  96108. if ( widthStyle && widthStyle.match( /^\d+(\.\d*)?%$/ ) ) {
  96109. this.originalWidthPercents = parseFloat( widthStyle );
  96110. } else {
  96111. this.originalWidthPercents = calculateHostPercentageWidth( domResizeHost, clientRect );
  96112. }
  96113. }
  96114. update( newSize ) {
  96115. this.proposedWidth = newSize.width;
  96116. this.proposedHeight = newSize.height;
  96117. this.proposedWidthPercents = newSize.widthPercents;
  96118. this.proposedHandleHostWidth = newSize.handleHostWidth;
  96119. this.proposedHandleHostHeight = newSize.handleHostHeight;
  96120. }
  96121. }
  96122. Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_2__["default"])( ResizeState, _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_1__["default"] );
  96123. // Calculates a relative width of a `domResizeHost` compared to it's parent in percents.
  96124. //
  96125. // @private
  96126. // @param {HTMLElement} domResizeHost
  96127. // @param {module:utils/dom/rect~Rect} resizeHostRect
  96128. // @returns {Number}
  96129. function calculateHostPercentageWidth( domResizeHost, resizeHostRect ) {
  96130. const domResizeHostParent = domResizeHost.parentElement;
  96131. // Need to use computed style as it properly excludes parent's paddings from the returned value.
  96132. const parentWidth = parseFloat( domResizeHostParent.ownerDocument.defaultView.getComputedStyle( domResizeHostParent ).width );
  96133. return resizeHostRect.width / parentWidth * 100;
  96134. }
  96135. // Returns coordinates of the top-left corner of an element, relative to the document's top-left corner.
  96136. //
  96137. // @private
  96138. // @param {HTMLElement} element
  96139. // @param {String} resizerPosition The position of the resize handle, e.g. `"top-left"`, `"bottom-right"`.
  96140. // @returns {Object} return
  96141. // @returns {Number} return.x
  96142. // @returns {Number} return.y
  96143. function getAbsoluteBoundaryPoint( element, resizerPosition ) {
  96144. const elementRect = new _ckeditor_ckeditor5_utils_src_dom_rect__WEBPACK_IMPORTED_MODULE_0__["default"]( element );
  96145. const positionParts = resizerPosition.split( '-' );
  96146. const ret = {
  96147. x: positionParts[ 1 ] == 'right' ? elementRect.right : elementRect.left,
  96148. y: positionParts[ 0 ] == 'bottom' ? elementRect.bottom : elementRect.top
  96149. };
  96150. ret.x += element.ownerDocument.defaultView.scrollX;
  96151. ret.y += element.ownerDocument.defaultView.scrollY;
  96152. return ret;
  96153. }
  96154. // @private
  96155. // @param {String} resizerPosition The expected resizer position, like `"top-left"`, `"bottom-right"`.
  96156. // @returns {String} A prefixed HTML class name for the resizer element.
  96157. function getResizerHandleClass( resizerPosition ) {
  96158. return `ck-widget__resizer__handle-${ resizerPosition }`;
  96159. }
  96160. // Determines the position of a given resize handle.
  96161. //
  96162. // @private
  96163. // @param {HTMLElement} domHandle Handle used to calculate the reference point.
  96164. // @returns {String|undefined} Returns a string like `"top-left"` or `undefined` if not matched.
  96165. function getHandlePosition( domHandle ) {
  96166. const resizerPositions = [ 'top-left', 'top-right', 'bottom-right', 'bottom-left' ];
  96167. for ( const position of resizerPositions ) {
  96168. if ( domHandle.classList.contains( getResizerHandleClass( position ) ) ) {
  96169. return position;
  96170. }
  96171. }
  96172. }
  96173. // @private
  96174. // @param {String} position Like `"top-left"`.
  96175. // @returns {String} Inverted `position`, e.g. it returns `"bottom-right"` if `"top-left"` was given as `position`.
  96176. function getOppositePosition( position ) {
  96177. const parts = position.split( '-' );
  96178. const replacements = {
  96179. top: 'bottom',
  96180. bottom: 'top',
  96181. left: 'right',
  96182. right: 'left'
  96183. };
  96184. return `${ replacements[ parts[ 0 ] ] }-${ replacements[ parts[ 1 ] ] }`;
  96185. }
  96186. /***/ }),
  96187. /***/ "./node_modules/@ckeditor/ckeditor5-widget/src/widgettoolbarrepository.js":
  96188. /*!********************************************************************************!*\
  96189. !*** ./node_modules/@ckeditor/ckeditor5-widget/src/widgettoolbarrepository.js ***!
  96190. \********************************************************************************/
  96191. /*! exports provided: default */
  96192. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  96193. "use strict";
  96194. __webpack_require__.r(__webpack_exports__);
  96195. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return WidgetToolbarRepository; });
  96196. /* 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");
  96197. /* 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");
  96198. /* 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");
  96199. /* 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");
  96200. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./utils */ "./node_modules/@ckeditor/ckeditor5-widget/src/utils.js");
  96201. /* 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");
  96202. /**
  96203. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  96204. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  96205. */
  96206. /**
  96207. * @module widget/widgettoolbarrepository
  96208. */
  96209. /**
  96210. * Widget toolbar repository plugin. A central point for registering widget toolbars. This plugin handles the whole
  96211. * toolbar rendering process and exposes a concise API.
  96212. *
  96213. * To add a toolbar for your widget use the {@link ~WidgetToolbarRepository#register `WidgetToolbarRepository#register()`} method.
  96214. *
  96215. * The following example comes from the {@link module:image/imagetoolbar~ImageToolbar} plugin:
  96216. *
  96217. * class ImageToolbar extends Plugin {
  96218. * static get requires() {
  96219. * return [ WidgetToolbarRepository ];
  96220. * }
  96221. *
  96222. * afterInit() {
  96223. * const editor = this.editor;
  96224. * const widgetToolbarRepository = editor.plugins.get( WidgetToolbarRepository );
  96225. *
  96226. * widgetToolbarRepository.register( 'image', {
  96227. * items: editor.config.get( 'image.toolbar' ),
  96228. * getRelatedElement: getSelectedImageWidget
  96229. * } );
  96230. * }
  96231. * }
  96232. */
  96233. class WidgetToolbarRepository extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
  96234. /**
  96235. * @inheritDoc
  96236. */
  96237. static get requires() {
  96238. return [ _ckeditor_ckeditor5_ui_src_panel_balloon_contextualballoon__WEBPACK_IMPORTED_MODULE_1__["default"] ];
  96239. }
  96240. /**
  96241. * @inheritDoc
  96242. */
  96243. static get pluginName() {
  96244. return 'WidgetToolbarRepository';
  96245. }
  96246. /**
  96247. * @inheritDoc
  96248. */
  96249. init() {
  96250. const editor = this.editor;
  96251. // Disables the default balloon toolbar for all widgets.
  96252. if ( editor.plugins.has( 'BalloonToolbar' ) ) {
  96253. const balloonToolbar = editor.plugins.get( 'BalloonToolbar' );
  96254. this.listenTo( balloonToolbar, 'show', evt => {
  96255. if ( isWidgetSelected( editor.editing.view.document.selection ) ) {
  96256. evt.stop();
  96257. }
  96258. }, { priority: 'high' } );
  96259. }
  96260. /**
  96261. * A map of toolbar definitions.
  96262. *
  96263. * @protected
  96264. * @member {Map.<String,module:widget/widgettoolbarrepository~WidgetRepositoryToolbarDefinition>} #_toolbarDefinitions
  96265. */
  96266. this._toolbarDefinitions = new Map();
  96267. /**
  96268. * @private
  96269. */
  96270. this._balloon = this.editor.plugins.get( 'ContextualBalloon' );
  96271. this.on( 'change:isEnabled', () => {
  96272. this._updateToolbarsVisibility();
  96273. } );
  96274. this.listenTo( editor.ui, 'update', () => {
  96275. this._updateToolbarsVisibility();
  96276. } );
  96277. // UI#update is not fired after focus is back in editor, we need to check if balloon panel should be visible.
  96278. this.listenTo( editor.ui.focusTracker, 'change:isFocused', () => {
  96279. this._updateToolbarsVisibility();
  96280. }, { priority: 'low' } );
  96281. }
  96282. destroy() {
  96283. super.destroy();
  96284. for ( const toolbarConfig of this._toolbarDefinitions.values() ) {
  96285. toolbarConfig.view.destroy();
  96286. }
  96287. }
  96288. /**
  96289. * Registers toolbar in the WidgetToolbarRepository. It renders it in the `ContextualBalloon` based on the value of the invoked
  96290. * `getRelatedElement` function. Toolbar items are gathered from `items` array.
  96291. * The balloon's CSS class is by default `ck-toolbar-container` and may be override with the `balloonClassName` option.
  96292. *
  96293. * Note: This method should be called in the {@link module:core/plugin~PluginInterface#afterInit `Plugin#afterInit()`}
  96294. * callback (or later) to make sure that the given toolbar items were already registered by other plugins.
  96295. *
  96296. * @param {String} toolbarId An id for the toolbar. Used to
  96297. * @param {Object} options
  96298. * @param {String} [options.ariaLabel] Label used by assistive technologies to describe this toolbar element.
  96299. * @param {Array.<String>} options.items Array of toolbar items.
  96300. * @param {Function} options.getRelatedElement Callback which returns an element the toolbar should be attached to.
  96301. * @param {String} [options.balloonClassName='ck-toolbar-container'] CSS class for the widget balloon.
  96302. */
  96303. register( toolbarId, { ariaLabel, items, getRelatedElement, balloonClassName = 'ck-toolbar-container' } ) {
  96304. // Trying to register a toolbar without any item.
  96305. if ( !items.length ) {
  96306. /**
  96307. * When {@link #register} a new toolbar, you need to provide a non-empty array with
  96308. * the items that will be inserted into the toolbar.
  96309. *
  96310. * @error widget-toolbar-no-items
  96311. */
  96312. Object(_ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_5__["logWarning"])( 'widget-toolbar-no-items', { toolbarId } );
  96313. return;
  96314. }
  96315. const editor = this.editor;
  96316. const t = editor.t;
  96317. const toolbarView = new _ckeditor_ckeditor5_ui_src_toolbar_toolbarview__WEBPACK_IMPORTED_MODULE_2__["default"]( editor.locale );
  96318. toolbarView.ariaLabel = ariaLabel || t( 'Widget toolbar' );
  96319. if ( this._toolbarDefinitions.has( toolbarId ) ) {
  96320. /**
  96321. * Toolbar with the given id was already added.
  96322. *
  96323. * @error widget-toolbar-duplicated
  96324. * @param toolbarId Toolbar id.
  96325. */
  96326. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_5__["default"]( 'widget-toolbar-duplicated', this, { toolbarId } );
  96327. }
  96328. toolbarView.fillFromConfig( items, editor.ui.componentFactory );
  96329. this._toolbarDefinitions.set( toolbarId, {
  96330. view: toolbarView,
  96331. getRelatedElement,
  96332. balloonClassName
  96333. } );
  96334. }
  96335. /**
  96336. * Iterates over stored toolbars and makes them visible or hidden.
  96337. *
  96338. * @private
  96339. */
  96340. _updateToolbarsVisibility() {
  96341. let maxRelatedElementDepth = 0;
  96342. let deepestRelatedElement = null;
  96343. let deepestToolbarDefinition = null;
  96344. for ( const definition of this._toolbarDefinitions.values() ) {
  96345. const relatedElement = definition.getRelatedElement( this.editor.editing.view.document.selection );
  96346. if ( !this.isEnabled || !relatedElement ) {
  96347. if ( this._isToolbarInBalloon( definition ) ) {
  96348. this._hideToolbar( definition );
  96349. }
  96350. } else if ( !this.editor.ui.focusTracker.isFocused ) {
  96351. if ( this._isToolbarVisible( definition ) ) {
  96352. this._hideToolbar( definition );
  96353. }
  96354. } else {
  96355. const relatedElementDepth = relatedElement.getAncestors().length;
  96356. // Many toolbars can express willingness to be displayed but they do not know about
  96357. // each other. Figure out which toolbar is deepest in the view tree to decide which
  96358. // should be displayed. For instance, if a selected image is inside a table cell, display
  96359. // the ImageToolbar rather than the TableToolbar (#60).
  96360. if ( relatedElementDepth > maxRelatedElementDepth ) {
  96361. maxRelatedElementDepth = relatedElementDepth;
  96362. deepestRelatedElement = relatedElement;
  96363. deepestToolbarDefinition = definition;
  96364. }
  96365. }
  96366. }
  96367. if ( deepestToolbarDefinition ) {
  96368. this._showToolbar( deepestToolbarDefinition, deepestRelatedElement );
  96369. }
  96370. }
  96371. /**
  96372. * Hides the given toolbar.
  96373. *
  96374. * @private
  96375. * @param {module:widget/widgettoolbarrepository~WidgetRepositoryToolbarDefinition} toolbarDefinition
  96376. */
  96377. _hideToolbar( toolbarDefinition ) {
  96378. this._balloon.remove( toolbarDefinition.view );
  96379. this.stopListening( this._balloon, 'change:visibleView' );
  96380. }
  96381. /**
  96382. * Shows up the toolbar if the toolbar is not visible.
  96383. * Otherwise, repositions the toolbar's balloon when toolbar's view is the most top view in balloon stack.
  96384. *
  96385. * It might happen here that the toolbar's view is under another view. Then do nothing as the other toolbar view
  96386. * should be still visible after the {@link module:core/editor/editorui~EditorUI#event:update}.
  96387. *
  96388. * @private
  96389. * @param {module:widget/widgettoolbarrepository~WidgetRepositoryToolbarDefinition} toolbarDefinition
  96390. * @param {module:engine/view/element~Element} relatedElement
  96391. */
  96392. _showToolbar( toolbarDefinition, relatedElement ) {
  96393. if ( this._isToolbarVisible( toolbarDefinition ) ) {
  96394. repositionContextualBalloon( this.editor, relatedElement );
  96395. } else if ( !this._isToolbarInBalloon( toolbarDefinition ) ) {
  96396. this._balloon.add( {
  96397. view: toolbarDefinition.view,
  96398. position: getBalloonPositionData( this.editor, relatedElement ),
  96399. balloonClassName: toolbarDefinition.balloonClassName
  96400. } );
  96401. // Update toolbar position each time stack with toolbar view is switched to visible.
  96402. // This is in a case target element has changed when toolbar was in invisible stack
  96403. // e.g. target image was wrapped by a block quote.
  96404. // See https://github.com/ckeditor/ckeditor5-widget/issues/92.
  96405. this.listenTo( this._balloon, 'change:visibleView', () => {
  96406. for ( const definition of this._toolbarDefinitions.values() ) {
  96407. if ( this._isToolbarVisible( definition ) ) {
  96408. const relatedElement = definition.getRelatedElement( this.editor.editing.view.document.selection );
  96409. repositionContextualBalloon( this.editor, relatedElement );
  96410. }
  96411. }
  96412. } );
  96413. }
  96414. }
  96415. /**
  96416. * @private
  96417. * @param {Object} toolbar
  96418. * @returns {Boolean}
  96419. */
  96420. _isToolbarVisible( toolbar ) {
  96421. return this._balloon.visibleView === toolbar.view;
  96422. }
  96423. /**
  96424. * @private
  96425. * @param {Object} toolbar
  96426. * @returns {Boolean}
  96427. */
  96428. _isToolbarInBalloon( toolbar ) {
  96429. return this._balloon.hasView( toolbar.view );
  96430. }
  96431. }
  96432. function repositionContextualBalloon( editor, relatedElement ) {
  96433. const balloon = editor.plugins.get( 'ContextualBalloon' );
  96434. const position = getBalloonPositionData( editor, relatedElement );
  96435. balloon.updatePosition( position );
  96436. }
  96437. function getBalloonPositionData( editor, relatedElement ) {
  96438. const editingView = editor.editing.view;
  96439. const defaultPositions = _ckeditor_ckeditor5_ui_src_panel_balloon_balloonpanelview__WEBPACK_IMPORTED_MODULE_3__["default"].defaultPositions;
  96440. return {
  96441. target: editingView.domConverter.mapViewToDom( relatedElement ),
  96442. positions: [
  96443. defaultPositions.northArrowSouth,
  96444. defaultPositions.northArrowSouthWest,
  96445. defaultPositions.northArrowSouthEast,
  96446. defaultPositions.southArrowNorth,
  96447. defaultPositions.southArrowNorthWest,
  96448. defaultPositions.southArrowNorthEast,
  96449. _utils__WEBPACK_IMPORTED_MODULE_4__["centeredBalloonPositionForLongWidgets"]
  96450. ]
  96451. };
  96452. }
  96453. function isWidgetSelected( selection ) {
  96454. const viewElement = selection.getSelectedElement();
  96455. return !!( viewElement && Object(_utils__WEBPACK_IMPORTED_MODULE_4__["isWidget"])( viewElement ) );
  96456. }
  96457. /**
  96458. * The toolbar definition object used by the toolbar repository to manage toolbars.
  96459. * It contains information necessary to display the toolbar in the
  96460. * {@link module:ui/panel/balloon/contextualballoon~ContextualBalloon contextual balloon} and
  96461. * update it during its life (display) cycle.
  96462. *
  96463. * @typedef {Object} module:widget/widgettoolbarrepository~WidgetRepositoryToolbarDefinition
  96464. *
  96465. * @property {module:ui/view~View} view The UI view of the toolbar.
  96466. * @property {Function} getRelatedElement A function that returns an engine {@link module:engine/view/view~View}
  96467. * element the toolbar is to be attached to. For instance, an image widget or a table widget (or `null` when
  96468. * there is no such element). The function accepts an instance of {@link module:engine/view/selection~Selection}.
  96469. * @property {String} balloonClassName CSS class for the widget balloon when a toolbar is displayed.
  96470. */
  96471. /***/ }),
  96472. /***/ "./node_modules/@ckeditor/ckeditor5-widget/src/widgettypearound/utils.js":
  96473. /*!*******************************************************************************!*\
  96474. !*** ./node_modules/@ckeditor/ckeditor5-widget/src/widgettypearound/utils.js ***!
  96475. \*******************************************************************************/
  96476. /*! exports provided: TYPE_AROUND_SELECTION_ATTRIBUTE, isTypeAroundWidget, getClosestTypeAroundDomButton, getTypeAroundButtonPosition, getClosestWidgetViewElement, getTypeAroundFakeCaretPosition */
  96477. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  96478. "use strict";
  96479. __webpack_require__.r(__webpack_exports__);
  96480. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TYPE_AROUND_SELECTION_ATTRIBUTE", function() { return TYPE_AROUND_SELECTION_ATTRIBUTE; });
  96481. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isTypeAroundWidget", function() { return isTypeAroundWidget; });
  96482. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getClosestTypeAroundDomButton", function() { return getClosestTypeAroundDomButton; });
  96483. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getTypeAroundButtonPosition", function() { return getTypeAroundButtonPosition; });
  96484. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getClosestWidgetViewElement", function() { return getClosestWidgetViewElement; });
  96485. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getTypeAroundFakeCaretPosition", function() { return getTypeAroundFakeCaretPosition; });
  96486. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils */ "./node_modules/@ckeditor/ckeditor5-widget/src/utils.js");
  96487. /**
  96488. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  96489. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  96490. */
  96491. /**
  96492. * @module widget/widgettypearound/utils
  96493. */
  96494. /**
  96495. * The name of the type around model selection attribute responsible for
  96496. * displaying a fake caret next to a selected widget.
  96497. */
  96498. const TYPE_AROUND_SELECTION_ATTRIBUTE = 'widget-type-around';
  96499. /**
  96500. * Checks if an element is a widget that qualifies to get the widget type around UI.
  96501. *
  96502. * @param {module:engine/view/element~Element} viewElement
  96503. * @param {module:engine/model/element~Element} modelElement
  96504. * @param {module:engine/model/schema~Schema} schema
  96505. * @returns {Boolean}
  96506. */
  96507. function isTypeAroundWidget( viewElement, modelElement, schema ) {
  96508. return viewElement && Object(_utils__WEBPACK_IMPORTED_MODULE_0__["isWidget"])( viewElement ) && !schema.isInline( modelElement );
  96509. }
  96510. /**
  96511. * For the passed HTML element, this helper finds the closest widget type around button ancestor.
  96512. *
  96513. * @param {HTMLElement} domElement
  96514. * @returns {HTMLElement|null}
  96515. */
  96516. function getClosestTypeAroundDomButton( domElement ) {
  96517. return domElement.closest( '.ck-widget__type-around__button' );
  96518. }
  96519. /**
  96520. * For the passed widget type around button element, this helper determines at which position
  96521. * the paragraph would be inserted into the content if, for instance, the button was
  96522. * clicked by the user.
  96523. *
  96524. * @param {HTMLElement} domElement
  96525. * @returns {'before'|'after'} The position of the button.
  96526. */
  96527. function getTypeAroundButtonPosition( domElement ) {
  96528. return domElement.classList.contains( 'ck-widget__type-around__button_before' ) ? 'before' : 'after';
  96529. }
  96530. /**
  96531. * For the passed HTML element, this helper returns the closest view widget ancestor.
  96532. *
  96533. * @param {HTMLElement} domElement
  96534. * @param {module:engine/view/domconverter~DomConverter} domConverter
  96535. * @returns {module:engine/view/element~Element}
  96536. */
  96537. function getClosestWidgetViewElement( domElement, domConverter ) {
  96538. const widgetDomElement = domElement.closest( '.ck-widget' );
  96539. return domConverter.mapDomToView( widgetDomElement );
  96540. }
  96541. /**
  96542. * For the passed selection instance, it returns the position of the fake caret displayed next to a widget.
  96543. *
  96544. * **Note**: If the fake caret is not currently displayed, `null` is returned.
  96545. *
  96546. * @param {module:engine/model/selection~Selection|module:engine/model/documentselection~DocumentSelection} selection
  96547. * @returns {'before'|'after'|null} The position of the fake caret or `null` when none is present.
  96548. */
  96549. function getTypeAroundFakeCaretPosition( selection ) {
  96550. return selection.getAttribute( TYPE_AROUND_SELECTION_ATTRIBUTE );
  96551. }
  96552. /***/ }),
  96553. /***/ "./node_modules/@ckeditor/ckeditor5-widget/src/widgettypearound/widgettypearound.js":
  96554. /*!******************************************************************************************!*\
  96555. !*** ./node_modules/@ckeditor/ckeditor5-widget/src/widgettypearound/widgettypearound.js ***!
  96556. \******************************************************************************************/
  96557. /*! exports provided: default */
  96558. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  96559. "use strict";
  96560. __webpack_require__.r(__webpack_exports__);
  96561. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return WidgetTypeAround; });
  96562. /* 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");
  96563. /* 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");
  96564. /* 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");
  96565. /* harmony import */ var _ckeditor_ckeditor5_typing_src_delete__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-typing/src/delete */ "./node_modules/@ckeditor/ckeditor5-typing/src/delete.js");
  96566. /* 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");
  96567. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./utils */ "./node_modules/@ckeditor/ckeditor5-widget/src/widgettypearound/utils.js");
  96568. /* harmony import */ var _ckeditor_ckeditor5_typing_src_utils_injectunsafekeystrokeshandling__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @ckeditor/ckeditor5-typing/src/utils/injectunsafekeystrokeshandling */ "./node_modules/@ckeditor/ckeditor5-typing/src/utils/injectunsafekeystrokeshandling.js");
  96569. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../utils */ "./node_modules/@ckeditor/ckeditor5-widget/src/utils.js");
  96570. /* harmony import */ var _theme_icons_return_arrow_svg__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../theme/icons/return-arrow.svg */ "./node_modules/@ckeditor/ckeditor5-widget/theme/icons/return-arrow.svg");
  96571. /* harmony import */ var _theme_widgettypearound_css__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../theme/widgettypearound.css */ "./node_modules/@ckeditor/ckeditor5-widget/theme/widgettypearound.css");
  96572. /* harmony import */ var _theme_widgettypearound_css__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_theme_widgettypearound_css__WEBPACK_IMPORTED_MODULE_9__);
  96573. /**
  96574. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  96575. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  96576. */
  96577. /* global DOMParser */
  96578. /**
  96579. * @module widget/widgettypearound
  96580. */
  96581. const POSSIBLE_INSERTION_POSITIONS = [ 'before', 'after' ];
  96582. // Do the SVG parsing once and then clone the result <svg> DOM element for each new button.
  96583. const RETURN_ARROW_ICON_ELEMENT = new DOMParser().parseFromString( _theme_icons_return_arrow_svg__WEBPACK_IMPORTED_MODULE_8__["default"], 'image/svg+xml' ).firstChild;
  96584. const PLUGIN_DISABLED_EDITING_ROOT_CLASS = 'ck-widget__type-around_disabled';
  96585. /**
  96586. * A plugin that allows users to type around widgets where normally it is impossible to place the caret due
  96587. * to limitations of web browsers. These "tight spots" occur, for instance, before (or after) a widget being
  96588. * the first (or last) child of its parent or between two block widgets.
  96589. *
  96590. * This plugin extends the {@link module:widget/widget~Widget `Widget`} plugin and injects the user interface
  96591. * with two buttons into each widget instance in the editor. Each of the buttons can be clicked by the
  96592. * user if the widget is next to the "tight spot". Once clicked, a paragraph is created with the selection anchored
  96593. * in it so that users can type (or insert content, paste, etc.) straight away.
  96594. *
  96595. * @extends module:core/plugin~Plugin
  96596. */
  96597. class WidgetTypeAround extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
  96598. /**
  96599. * @inheritDoc
  96600. */
  96601. static get pluginName() {
  96602. return 'WidgetTypeAround';
  96603. }
  96604. /**
  96605. * @inheritDoc
  96606. */
  96607. static get requires() {
  96608. return [ _ckeditor_ckeditor5_enter_src_enter__WEBPACK_IMPORTED_MODULE_2__["default"], _ckeditor_ckeditor5_typing_src_delete__WEBPACK_IMPORTED_MODULE_3__["default"] ];
  96609. }
  96610. /**
  96611. * @inheritDoc
  96612. */
  96613. constructor( editor ) {
  96614. super( editor );
  96615. /**
  96616. * A reference to the model widget element that has the fake caret active
  96617. * on either side of it. It is later used to remove CSS classes associated with the fake caret
  96618. * when the widget no longer needs it.
  96619. *
  96620. * @private
  96621. * @member {module:engine/model/element~Element|null}
  96622. */
  96623. this._currentFakeCaretModelElement = null;
  96624. }
  96625. /**
  96626. * @inheritDoc
  96627. */
  96628. init() {
  96629. const editor = this.editor;
  96630. const editingView = editor.editing.view;
  96631. // Set a CSS class on the view editing root when the plugin is disabled so all the buttons
  96632. // and lines visually disappear. All the interactions are disabled in individual plugin methods.
  96633. this.on( 'change:isEnabled', ( evt, data, isEnabled ) => {
  96634. editingView.change( writer => {
  96635. for ( const root of editingView.document.roots ) {
  96636. if ( isEnabled ) {
  96637. writer.removeClass( PLUGIN_DISABLED_EDITING_ROOT_CLASS, root );
  96638. } else {
  96639. writer.addClass( PLUGIN_DISABLED_EDITING_ROOT_CLASS, root );
  96640. }
  96641. }
  96642. } );
  96643. if ( !isEnabled ) {
  96644. editor.model.change( writer => {
  96645. writer.removeSelectionAttribute( _utils__WEBPACK_IMPORTED_MODULE_5__["TYPE_AROUND_SELECTION_ATTRIBUTE"] );
  96646. } );
  96647. }
  96648. } );
  96649. this._enableTypeAroundUIInjection();
  96650. this._enableInsertingParagraphsOnButtonClick();
  96651. this._enableInsertingParagraphsOnEnterKeypress();
  96652. this._enableInsertingParagraphsOnTypingKeystroke();
  96653. this._enableTypeAroundFakeCaretActivationUsingKeyboardArrows();
  96654. this._enableDeleteIntegration();
  96655. this._enableInsertContentIntegration();
  96656. this._enableDeleteContentIntegration();
  96657. }
  96658. /**
  96659. * @inheritDoc
  96660. */
  96661. destroy() {
  96662. this._currentFakeCaretModelElement = null;
  96663. }
  96664. /**
  96665. * Inserts a new paragraph next to a widget element with the selection anchored in it.
  96666. *
  96667. * **Note**: This method is heavily user-oriented and will both focus the editing view and scroll
  96668. * the viewport to the selection in the inserted paragraph.
  96669. *
  96670. * @protected
  96671. * @param {module:engine/model/element~Element} widgetModelElement The model widget element next to which a paragraph is inserted.
  96672. * @param {'before'|'after'} position The position where the paragraph is inserted. Either `'before'` or `'after'` the widget.
  96673. */
  96674. _insertParagraph( widgetModelElement, position ) {
  96675. const editor = this.editor;
  96676. const editingView = editor.editing.view;
  96677. editor.execute( 'insertParagraph', {
  96678. position: editor.model.createPositionAt( widgetModelElement, position )
  96679. } );
  96680. editingView.focus();
  96681. editingView.scrollToTheSelection();
  96682. }
  96683. /**
  96684. * A wrapper for the {@link module:utils/emittermixin~EmitterMixin#listenTo} method that executes the callbacks only
  96685. * when the plugin {@link #isEnabled is enabled}.
  96686. *
  96687. * @private
  96688. * @param {module:utils/emittermixin~Emitter} emitter The object that fires the event.
  96689. * @param {String} event The name of the event.
  96690. * @param {Function} callback The function to be called on event.
  96691. * @param {Object} [options={}] Additional options.
  96692. * @param {module:utils/priorities~PriorityString|Number} [options.priority='normal'] The priority of this event callback. The higher
  96693. * the priority value the sooner the callback will be fired. Events having the same priority are called in the
  96694. * order they were added.
  96695. */
  96696. _listenToIfEnabled( emitter, event, callback, options ) {
  96697. this.listenTo( emitter, event, ( ...args ) => {
  96698. // Do not respond if the plugin is disabled.
  96699. if ( this.isEnabled ) {
  96700. callback( ...args );
  96701. }
  96702. }, options );
  96703. }
  96704. /**
  96705. * Similar to {@link #_insertParagraph}, this method inserts a paragraph except that it
  96706. * does not expect a position. Instead, it performs the insertion next to a selected widget
  96707. * according to the `widget-type-around` model selection attribute value (fake caret position).
  96708. *
  96709. * Because this method requires the `widget-type-around` attribute to be set,
  96710. * the insertion can only happen when the widget's fake caret is active (e.g. activated
  96711. * using the keyboard).
  96712. *
  96713. * @private
  96714. * @returns {Boolean} Returns `true` when the paragraph was inserted (the attribute was present) and `false` otherwise.
  96715. */
  96716. _insertParagraphAccordingToFakeCaretPosition() {
  96717. const editor = this.editor;
  96718. const model = editor.model;
  96719. const modelSelection = model.document.selection;
  96720. const typeAroundFakeCaretPosition = Object(_utils__WEBPACK_IMPORTED_MODULE_5__["getTypeAroundFakeCaretPosition"])( modelSelection );
  96721. if ( !typeAroundFakeCaretPosition ) {
  96722. return false;
  96723. }
  96724. const selectedModelElement = modelSelection.getSelectedElement();
  96725. this._insertParagraph( selectedModelElement, typeAroundFakeCaretPosition );
  96726. return true;
  96727. }
  96728. /**
  96729. * Creates a listener in the editing conversion pipeline that injects the widget type around
  96730. * UI into every single widget instance created in the editor.
  96731. *
  96732. * The UI is delivered as a {@link module:engine/view/uielement~UIElement}
  96733. * wrapper which renders DOM buttons that users can use to insert paragraphs.
  96734. *
  96735. * @private
  96736. */
  96737. _enableTypeAroundUIInjection() {
  96738. const editor = this.editor;
  96739. const schema = editor.model.schema;
  96740. const t = editor.locale.t;
  96741. const buttonTitles = {
  96742. before: t( 'Insert paragraph before block' ),
  96743. after: t( 'Insert paragraph after block' )
  96744. };
  96745. editor.editing.downcastDispatcher.on( 'insert', ( evt, data, conversionApi ) => {
  96746. const viewElement = conversionApi.mapper.toViewElement( data.item );
  96747. // Filter out non-widgets and inline widgets.
  96748. if ( Object(_utils__WEBPACK_IMPORTED_MODULE_5__["isTypeAroundWidget"])( viewElement, data.item, schema ) ) {
  96749. injectUIIntoWidget( conversionApi.writer, buttonTitles, viewElement );
  96750. }
  96751. }, { priority: 'low' } );
  96752. }
  96753. /**
  96754. * Brings support for the fake caret that appears when either:
  96755. *
  96756. * * the selection moves to a widget from a position next to it using arrow keys,
  96757. * * the arrow key is pressed when the widget is already selected.
  96758. *
  96759. * The fake caret lets the user know that they can start typing or just press
  96760. * <kbd>Enter</kbd> to insert a paragraph at the position next to a widget as suggested by the fake caret.
  96761. *
  96762. * The fake caret disappears when the user changes the selection or the editor
  96763. * gets blurred.
  96764. *
  96765. * The whole idea is as follows:
  96766. *
  96767. * 1. A user does one of the 2 scenarios described at the beginning.
  96768. * 2. The "keydown" listener is executed and the decision is made whether to show or hide the fake caret.
  96769. * 3. If it should show up, the `widget-type-around` model selection attribute is set indicating
  96770. * on which side of the widget it should appear.
  96771. * 4. The selection dispatcher reacts to the selection attribute and sets CSS classes responsible for the
  96772. * fake caret on the view widget.
  96773. * 5. If the fake caret should disappear, the selection attribute is removed and the dispatcher
  96774. * does the CSS class clean-up in the view.
  96775. * 6. Additionally, `change:range` and `FocusTracker#isFocused` listeners also remove the selection
  96776. * attribute (the former also removes widget CSS classes).
  96777. *
  96778. * @private
  96779. */
  96780. _enableTypeAroundFakeCaretActivationUsingKeyboardArrows() {
  96781. const editor = this.editor;
  96782. const model = editor.model;
  96783. const modelSelection = model.document.selection;
  96784. const schema = model.schema;
  96785. const editingView = editor.editing.view;
  96786. // This is the main listener responsible for the fake caret.
  96787. // Note: The priority must precede the default Widget class keydown handler ("high").
  96788. this._listenToIfEnabled( editingView.document, 'arrowKey', ( evt, domEventData ) => {
  96789. this._handleArrowKeyPress( evt, domEventData );
  96790. }, { context: [ _utils__WEBPACK_IMPORTED_MODULE_7__["isWidget"], '$text' ], priority: 'high' } );
  96791. // This listener makes sure the widget type around selection attribute will be gone from the model
  96792. // selection as soon as the model range changes. This attribute only makes sense when a widget is selected
  96793. // (and the "fake horizontal caret" is visible) so whenever the range changes (e.g. selection moved somewhere else),
  96794. // let's get rid of the attribute so that the selection downcast dispatcher isn't even bothered.
  96795. this._listenToIfEnabled( modelSelection, 'change:range', ( evt, data ) => {
  96796. // Do not reset the selection attribute when the change was indirect.
  96797. if ( !data.directChange ) {
  96798. return;
  96799. }
  96800. // Get rid of the widget type around attribute of the selection on every change:range.
  96801. // If the range changes, it means for sure, the user is no longer in the active ("fake horizontal caret") mode.
  96802. editor.model.change( writer => {
  96803. writer.removeSelectionAttribute( _utils__WEBPACK_IMPORTED_MODULE_5__["TYPE_AROUND_SELECTION_ATTRIBUTE"] );
  96804. } );
  96805. } );
  96806. // Get rid of the widget type around attribute of the selection on every document change
  96807. // that makes widget not selected any more (i.e. widget was removed).
  96808. this._listenToIfEnabled( model.document, 'change:data', () => {
  96809. const selectedModelElement = modelSelection.getSelectedElement();
  96810. if ( selectedModelElement ) {
  96811. const selectedViewElement = editor.editing.mapper.toViewElement( selectedModelElement );
  96812. if ( Object(_utils__WEBPACK_IMPORTED_MODULE_5__["isTypeAroundWidget"])( selectedViewElement, selectedModelElement, schema ) ) {
  96813. return;
  96814. }
  96815. }
  96816. editor.model.change( writer => {
  96817. writer.removeSelectionAttribute( _utils__WEBPACK_IMPORTED_MODULE_5__["TYPE_AROUND_SELECTION_ATTRIBUTE"] );
  96818. } );
  96819. } );
  96820. // React to changes of the model selection attribute made by the arrow keys listener.
  96821. // If the block widget is selected and the attribute changes, downcast the attribute to special
  96822. // CSS classes associated with the active ("fake horizontal caret") mode of the widget.
  96823. this._listenToIfEnabled( editor.editing.downcastDispatcher, 'selection', ( evt, data, conversionApi ) => {
  96824. const writer = conversionApi.writer;
  96825. if ( this._currentFakeCaretModelElement ) {
  96826. const selectedViewElement = conversionApi.mapper.toViewElement( this._currentFakeCaretModelElement );
  96827. if ( selectedViewElement ) {
  96828. // Get rid of CSS classes associated with the active ("fake horizontal caret") mode from the view widget.
  96829. writer.removeClass( POSSIBLE_INSERTION_POSITIONS.map( positionToWidgetCssClass ), selectedViewElement );
  96830. this._currentFakeCaretModelElement = null;
  96831. }
  96832. }
  96833. const selectedModelElement = data.selection.getSelectedElement();
  96834. if ( !selectedModelElement ) {
  96835. return;
  96836. }
  96837. const selectedViewElement = conversionApi.mapper.toViewElement( selectedModelElement );
  96838. if ( !Object(_utils__WEBPACK_IMPORTED_MODULE_5__["isTypeAroundWidget"])( selectedViewElement, selectedModelElement, schema ) ) {
  96839. return;
  96840. }
  96841. const typeAroundFakeCaretPosition = Object(_utils__WEBPACK_IMPORTED_MODULE_5__["getTypeAroundFakeCaretPosition"])( data.selection );
  96842. if ( !typeAroundFakeCaretPosition ) {
  96843. return;
  96844. }
  96845. writer.addClass( positionToWidgetCssClass( typeAroundFakeCaretPosition ), selectedViewElement );
  96846. // Remember the view widget that got the "fake-caret" CSS class. This class should be removed ASAP when the
  96847. // selection changes
  96848. this._currentFakeCaretModelElement = selectedModelElement;
  96849. } );
  96850. this._listenToIfEnabled( editor.ui.focusTracker, 'change:isFocused', ( evt, name, isFocused ) => {
  96851. if ( !isFocused ) {
  96852. editor.model.change( writer => {
  96853. writer.removeSelectionAttribute( _utils__WEBPACK_IMPORTED_MODULE_5__["TYPE_AROUND_SELECTION_ATTRIBUTE"] );
  96854. } );
  96855. }
  96856. } );
  96857. function positionToWidgetCssClass( position ) {
  96858. return `ck-widget_type-around_show-fake-caret_${ position }`;
  96859. }
  96860. }
  96861. /**
  96862. * A listener executed on each "keydown" in the view document, a part of
  96863. * {@link #_enableTypeAroundFakeCaretActivationUsingKeyboardArrows}.
  96864. *
  96865. * It decides whether the arrow keypress should activate the fake caret or not (also whether it should
  96866. * be deactivated).
  96867. *
  96868. * The fake caret activation is done by setting the `widget-type-around` model selection attribute
  96869. * in this listener, and stopping and preventing the event that would normally be handled by the widget
  96870. * plugin that is responsible for the regular keyboard navigation near/across all widgets (that
  96871. * includes inline widgets, which are ignored by the widget type around plugin).
  96872. *
  96873. * @private
  96874. */
  96875. _handleArrowKeyPress( evt, domEventData ) {
  96876. const editor = this.editor;
  96877. const model = editor.model;
  96878. const modelSelection = model.document.selection;
  96879. const schema = model.schema;
  96880. const editingView = editor.editing.view;
  96881. const keyCode = domEventData.keyCode;
  96882. const isForward = Object(_ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_4__["isForwardArrowKeyCode"])( keyCode, editor.locale.contentLanguageDirection );
  96883. const selectedViewElement = editingView.document.selection.getSelectedElement();
  96884. const selectedModelElement = editor.editing.mapper.toModelElement( selectedViewElement );
  96885. let shouldStopAndPreventDefault;
  96886. // Handle keyboard navigation when a type-around-compatible widget is currently selected.
  96887. if ( Object(_utils__WEBPACK_IMPORTED_MODULE_5__["isTypeAroundWidget"])( selectedViewElement, selectedModelElement, schema ) ) {
  96888. shouldStopAndPreventDefault = this._handleArrowKeyPressOnSelectedWidget( isForward );
  96889. }
  96890. // Handle keyboard arrow navigation when the selection is next to a type-around-compatible widget
  96891. // and the widget is about to be selected.
  96892. else if ( modelSelection.isCollapsed ) {
  96893. shouldStopAndPreventDefault = this._handleArrowKeyPressWhenSelectionNextToAWidget( isForward );
  96894. }
  96895. if ( shouldStopAndPreventDefault ) {
  96896. domEventData.preventDefault();
  96897. evt.stop();
  96898. }
  96899. }
  96900. /**
  96901. * Handles the keyboard navigation on "keydown" when a widget is currently selected and activates or deactivates
  96902. * the fake caret for that widget, depending on the current value of the `widget-type-around` model
  96903. * selection attribute and the direction of the pressed arrow key.
  96904. *
  96905. * @private
  96906. * @param {Boolean} isForward `true` when the pressed arrow key was responsible for the forward model selection movement
  96907. * as in {@link module:utils/keyboard~isForwardArrowKeyCode}.
  96908. * @returns {Boolean} Returns `true` when the keypress was handled and no other keydown listener of the editor should
  96909. * process the event any further. Returns `false` otherwise.
  96910. */
  96911. _handleArrowKeyPressOnSelectedWidget( isForward ) {
  96912. const editor = this.editor;
  96913. const model = editor.model;
  96914. const modelSelection = model.document.selection;
  96915. const typeAroundFakeCaretPosition = Object(_utils__WEBPACK_IMPORTED_MODULE_5__["getTypeAroundFakeCaretPosition"])( modelSelection );
  96916. return model.change( writer => {
  96917. // If the fake caret is displayed...
  96918. if ( typeAroundFakeCaretPosition ) {
  96919. const isLeavingWidget = typeAroundFakeCaretPosition === ( isForward ? 'after' : 'before' );
  96920. // If the keyboard arrow works against the value of the selection attribute...
  96921. // then remove the selection attribute but prevent default DOM actions
  96922. // and do not let the Widget plugin listener move the selection. This brings
  96923. // the widget back to the state, for instance, like if was selected using the mouse.
  96924. //
  96925. // **Note**: If leaving the widget when the fake caret is active, then the default
  96926. // Widget handler will change the selection and, in turn, this will automatically discard
  96927. // the selection attribute.
  96928. if ( !isLeavingWidget ) {
  96929. writer.removeSelectionAttribute( _utils__WEBPACK_IMPORTED_MODULE_5__["TYPE_AROUND_SELECTION_ATTRIBUTE"] );
  96930. return true;
  96931. }
  96932. }
  96933. // If the fake caret wasn't displayed, let's set it now according to the direction of the arrow
  96934. // key press. This also means we cannot let the Widget plugin listener move the selection.
  96935. else {
  96936. writer.setSelectionAttribute( _utils__WEBPACK_IMPORTED_MODULE_5__["TYPE_AROUND_SELECTION_ATTRIBUTE"], isForward ? 'after' : 'before' );
  96937. return true;
  96938. }
  96939. return false;
  96940. } );
  96941. }
  96942. /**
  96943. * Handles the keyboard navigation on "keydown" when **no** widget is selected but the selection is **directly** next
  96944. * to one and upon the fake caret should become active for this widget upon arrow keypress
  96945. * (AKA entering/selecting the widget).
  96946. *
  96947. * **Note**: This code mirrors the implementation from the widget plugin but also adds the selection attribute.
  96948. * Unfortunately, there is no safe way to let the widget plugin do the selection part first and then just set the
  96949. * selection attribute here in the widget type around plugin. This is why this code must duplicate some from the widget plugin.
  96950. *
  96951. * @private
  96952. * @param {Boolean} isForward `true` when the pressed arrow key was responsible for the forward model selection movement
  96953. * as in {@link module:utils/keyboard~isForwardArrowKeyCode}.
  96954. * @returns {Boolean} Returns `true` when the keypress was handled and no other keydown listener of the editor should
  96955. * process the event any further. Returns `false` otherwise.
  96956. */
  96957. _handleArrowKeyPressWhenSelectionNextToAWidget( isForward ) {
  96958. const editor = this.editor;
  96959. const model = editor.model;
  96960. const schema = model.schema;
  96961. const widgetPlugin = editor.plugins.get( 'Widget' );
  96962. // This is the widget the selection is about to be set on.
  96963. const modelElementNextToSelection = widgetPlugin._getObjectElementNextToSelection( isForward );
  96964. const viewElementNextToSelection = editor.editing.mapper.toViewElement( modelElementNextToSelection );
  96965. if ( Object(_utils__WEBPACK_IMPORTED_MODULE_5__["isTypeAroundWidget"])( viewElementNextToSelection, modelElementNextToSelection, schema ) ) {
  96966. model.change( writer => {
  96967. widgetPlugin._setSelectionOverElement( modelElementNextToSelection );
  96968. writer.setSelectionAttribute( _utils__WEBPACK_IMPORTED_MODULE_5__["TYPE_AROUND_SELECTION_ATTRIBUTE"], isForward ? 'before' : 'after' );
  96969. } );
  96970. // The change() block above does the same job as the Widget plugin. The event can
  96971. // be safely canceled.
  96972. return true;
  96973. }
  96974. return false;
  96975. }
  96976. /**
  96977. * Registers a `mousedown` listener for the view document which intercepts events
  96978. * coming from the widget type around UI, which happens when a user clicks one of the buttons
  96979. * that insert a paragraph next to a widget.
  96980. *
  96981. * @private
  96982. */
  96983. _enableInsertingParagraphsOnButtonClick() {
  96984. const editor = this.editor;
  96985. const editingView = editor.editing.view;
  96986. this._listenToIfEnabled( editingView.document, 'mousedown', ( evt, domEventData ) => {
  96987. const button = Object(_utils__WEBPACK_IMPORTED_MODULE_5__["getClosestTypeAroundDomButton"])( domEventData.domTarget );
  96988. if ( !button ) {
  96989. return;
  96990. }
  96991. const buttonPosition = Object(_utils__WEBPACK_IMPORTED_MODULE_5__["getTypeAroundButtonPosition"])( button );
  96992. const widgetViewElement = Object(_utils__WEBPACK_IMPORTED_MODULE_5__["getClosestWidgetViewElement"])( button, editingView.domConverter );
  96993. const widgetModelElement = editor.editing.mapper.toModelElement( widgetViewElement );
  96994. this._insertParagraph( widgetModelElement, buttonPosition );
  96995. domEventData.preventDefault();
  96996. evt.stop();
  96997. } );
  96998. }
  96999. /**
  97000. * Creates the <kbd>Enter</kbd> key listener on the view document that allows the user to insert a paragraph
  97001. * near the widget when either:
  97002. *
  97003. * * The fake caret was first activated using the arrow keys,
  97004. * * The entire widget is selected in the model.
  97005. *
  97006. * In the first case, the new paragraph is inserted according to the `widget-type-around` selection
  97007. * attribute (see {@link #_handleArrowKeyPress}).
  97008. *
  97009. * In the second case, the new paragraph is inserted based on whether a soft (<kbd>Shift</kbd>+<kbd>Enter</kbd>) keystroke
  97010. * was pressed or not.
  97011. *
  97012. * @private
  97013. */
  97014. _enableInsertingParagraphsOnEnterKeypress() {
  97015. const editor = this.editor;
  97016. const selection = editor.model.document.selection;
  97017. const editingView = editor.editing.view;
  97018. this._listenToIfEnabled( editingView.document, 'enter', ( evt, domEventData ) => {
  97019. // This event could be triggered from inside the widget but we are interested
  97020. // only when the widget is selected itself.
  97021. if ( evt.eventPhase != 'atTarget' ) {
  97022. return;
  97023. }
  97024. const selectedModelElement = selection.getSelectedElement();
  97025. const selectedViewElement = editor.editing.mapper.toViewElement( selectedModelElement );
  97026. const schema = editor.model.schema;
  97027. let wasHandled;
  97028. // First check if the widget is selected and there's a type around selection attribute associated
  97029. // with the fake caret that would tell where to insert a new paragraph.
  97030. if ( this._insertParagraphAccordingToFakeCaretPosition() ) {
  97031. wasHandled = true;
  97032. }
  97033. // Then, if there is no selection attribute associated with the fake caret, check if the widget
  97034. // simply is selected and create a new paragraph according to the keystroke (Shift+)Enter.
  97035. else if ( Object(_utils__WEBPACK_IMPORTED_MODULE_5__["isTypeAroundWidget"])( selectedViewElement, selectedModelElement, schema ) ) {
  97036. this._insertParagraph( selectedModelElement, domEventData.isSoft ? 'before' : 'after' );
  97037. wasHandled = true;
  97038. }
  97039. if ( wasHandled ) {
  97040. domEventData.preventDefault();
  97041. evt.stop();
  97042. }
  97043. }, { context: _utils__WEBPACK_IMPORTED_MODULE_7__["isWidget"] } );
  97044. }
  97045. /**
  97046. * Similar to the {@link #_enableInsertingParagraphsOnEnterKeypress}, it allows the user
  97047. * to insert a paragraph next to a widget when the fake caret was activated using arrow
  97048. * keys but it responds to typing keystrokes instead of <kbd>Enter</kbd>.
  97049. *
  97050. * "Typing keystrokes" are keystrokes that insert new content into the document,
  97051. * for instance, letters ("a") or numbers ("4"). The "keydown" listener enabled by this method
  97052. * will insert a new paragraph according to the `widget-type-around` model selection attribute
  97053. * as the user simply starts typing, which creates the impression that the fake caret
  97054. * behaves like a real one rendered by the browser (AKA your text appears where the caret was).
  97055. *
  97056. * **Note**: At the moment this listener creates 2 undo steps: one for the `insertParagraph` command
  97057. * and another one for actual typing. It is not a disaster but this may need to be fixed
  97058. * sooner or later.
  97059. *
  97060. * Learn more in {@link module:typing/utils/injectunsafekeystrokeshandling}.
  97061. *
  97062. * @private
  97063. */
  97064. _enableInsertingParagraphsOnTypingKeystroke() {
  97065. const editor = this.editor;
  97066. const editingView = editor.editing.view;
  97067. const keyCodesHandledSomewhereElse = [
  97068. _ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_4__["keyCodes"].enter,
  97069. _ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_4__["keyCodes"].delete,
  97070. _ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_4__["keyCodes"].backspace
  97071. ];
  97072. // Note: The priority must precede the default observers.
  97073. this._listenToIfEnabled( editingView.document, 'keydown', ( evt, domEventData ) => {
  97074. // Don't handle enter/backspace/delete here. They are handled in dedicated listeners.
  97075. if ( !keyCodesHandledSomewhereElse.includes( domEventData.keyCode ) && !Object(_ckeditor_ckeditor5_typing_src_utils_injectunsafekeystrokeshandling__WEBPACK_IMPORTED_MODULE_6__["isNonTypingKeystroke"])( domEventData ) ) {
  97076. this._insertParagraphAccordingToFakeCaretPosition();
  97077. }
  97078. }, { priority: 'high' } );
  97079. }
  97080. /**
  97081. * It creates a "delete" event listener on the view document to handle cases when the <kbd>Delete</kbd> or <kbd>Backspace</kbd>
  97082. * is pressed and the fake caret is currently active.
  97083. *
  97084. * The fake caret should create an illusion of a real browser caret so that when it appears before or after
  97085. * a widget, pressing <kbd>Delete</kbd> or <kbd>Backspace</kbd> should remove a widget or delete the content
  97086. * before or after a widget (depending on the content surrounding the widget).
  97087. *
  97088. * @private
  97089. */
  97090. _enableDeleteIntegration() {
  97091. const editor = this.editor;
  97092. const editingView = editor.editing.view;
  97093. const model = editor.model;
  97094. const schema = model.schema;
  97095. this._listenToIfEnabled( editingView.document, 'delete', ( evt, domEventData ) => {
  97096. // This event could be triggered from inside the widget but we are interested
  97097. // only when the widget is selected itself.
  97098. if ( evt.eventPhase != 'atTarget' ) {
  97099. return;
  97100. }
  97101. const typeAroundFakeCaretPosition = Object(_utils__WEBPACK_IMPORTED_MODULE_5__["getTypeAroundFakeCaretPosition"])( model.document.selection );
  97102. // This listener handles only these cases when the fake caret is active.
  97103. if ( !typeAroundFakeCaretPosition ) {
  97104. return;
  97105. }
  97106. const direction = domEventData.direction;
  97107. const selectedModelWidget = model.document.selection.getSelectedElement();
  97108. const isFakeCaretBefore = typeAroundFakeCaretPosition === 'before';
  97109. const isDeleteForward = direction == 'forward';
  97110. const shouldDeleteEntireWidget = isFakeCaretBefore === isDeleteForward;
  97111. if ( shouldDeleteEntireWidget ) {
  97112. editor.execute( 'delete', {
  97113. selection: model.createSelection( selectedModelWidget, 'on' )
  97114. } );
  97115. } else {
  97116. const range = schema.getNearestSelectionRange(
  97117. model.createPositionAt( selectedModelWidget, typeAroundFakeCaretPosition ),
  97118. direction
  97119. );
  97120. // If there is somewhere to move selection to, then there will be something to delete.
  97121. if ( range ) {
  97122. // If the range is NOT collapsed, then we know that the range contains an object (see getNearestSelectionRange() docs).
  97123. if ( !range.isCollapsed ) {
  97124. model.change( writer => {
  97125. writer.setSelection( range );
  97126. editor.execute( isDeleteForward ? 'deleteForward' : 'delete' );
  97127. } );
  97128. } else {
  97129. const probe = model.createSelection( range.start );
  97130. model.modifySelection( probe, { direction } );
  97131. // If the range is collapsed, let's see if a non-collapsed range exists that can could be deleted.
  97132. // If such range exists, use the editor command because it it safe for collaboration (it merges where it can).
  97133. if ( !probe.focus.isEqual( range.start ) ) {
  97134. model.change( writer => {
  97135. writer.setSelection( range );
  97136. editor.execute( isDeleteForward ? 'deleteForward' : 'delete' );
  97137. } );
  97138. }
  97139. // If there is no non-collapsed range to be deleted then we are sure that there is an empty element
  97140. // next to a widget that should be removed. "delete" and "deleteForward" commands cannot get rid of it
  97141. // so calling Model#deleteContent here manually.
  97142. else {
  97143. const deepestEmptyRangeAncestor = getDeepestEmptyElementAncestor( schema, range.start.parent );
  97144. model.deleteContent( model.createSelection( deepestEmptyRangeAncestor, 'on' ), {
  97145. doNotAutoparagraph: true
  97146. } );
  97147. }
  97148. }
  97149. }
  97150. }
  97151. // If some content was deleted, don't let the handler from the Widget plugin kick in.
  97152. // If nothing was deleted, then the default handler will have nothing to do anyway.
  97153. domEventData.preventDefault();
  97154. evt.stop();
  97155. }, { context: _utils__WEBPACK_IMPORTED_MODULE_7__["isWidget"] } );
  97156. }
  97157. /**
  97158. * Attaches the {@link module:engine/model/model~Model#event:insertContent} event listener that, for instance, allows the user to paste
  97159. * content near a widget when the fake caret is first activated using the arrow keys.
  97160. *
  97161. * The content is inserted according to the `widget-type-around` selection attribute (see {@link #_handleArrowKeyPress}).
  97162. *
  97163. * @private
  97164. */
  97165. _enableInsertContentIntegration() {
  97166. const editor = this.editor;
  97167. const model = this.editor.model;
  97168. const documentSelection = model.document.selection;
  97169. this._listenToIfEnabled( editor.model, 'insertContent', ( evt, [ content, selectable ] ) => {
  97170. if ( selectable && !selectable.is( 'documentSelection' ) ) {
  97171. return;
  97172. }
  97173. const typeAroundFakeCaretPosition = Object(_utils__WEBPACK_IMPORTED_MODULE_5__["getTypeAroundFakeCaretPosition"])( documentSelection );
  97174. if ( !typeAroundFakeCaretPosition ) {
  97175. return;
  97176. }
  97177. evt.stop();
  97178. return model.change( writer => {
  97179. const selectedElement = documentSelection.getSelectedElement();
  97180. const position = model.createPositionAt( selectedElement, typeAroundFakeCaretPosition );
  97181. const selection = writer.createSelection( position );
  97182. const result = model.insertContent( content, selection );
  97183. writer.setSelection( selection );
  97184. return result;
  97185. } );
  97186. }, { priority: 'high' } );
  97187. }
  97188. /**
  97189. * Attaches the {@link module:engine/model/model~Model#event:deleteContent} event listener to block the event when the fake
  97190. * caret is active.
  97191. *
  97192. * This is required for cases that trigger {@link module:engine/model/model~Model#deleteContent `model.deleteContent()`}
  97193. * before calling {@link module:engine/model/model~Model#insertContent `model.insertContent()`} like, for instance,
  97194. * plain text pasting.
  97195. *
  97196. * @private
  97197. */
  97198. _enableDeleteContentIntegration() {
  97199. const editor = this.editor;
  97200. const model = this.editor.model;
  97201. const documentSelection = model.document.selection;
  97202. this._listenToIfEnabled( editor.model, 'deleteContent', ( evt, [ selection ] ) => {
  97203. if ( selection && !selection.is( 'documentSelection' ) ) {
  97204. return;
  97205. }
  97206. const typeAroundFakeCaretPosition = Object(_utils__WEBPACK_IMPORTED_MODULE_5__["getTypeAroundFakeCaretPosition"])( documentSelection );
  97207. // Disable removing the selection content while pasting plain text.
  97208. if ( typeAroundFakeCaretPosition ) {
  97209. evt.stop();
  97210. }
  97211. }, { priority: 'high' } );
  97212. }
  97213. }
  97214. // Injects the type around UI into a view widget instance.
  97215. //
  97216. // @param {module:engine/view/downcastwriter~DowncastWriter} viewWriter
  97217. // @param {Object.<String,String>} buttonTitles
  97218. // @param {module:engine/view/element~Element} widgetViewElement
  97219. function injectUIIntoWidget( viewWriter, buttonTitles, widgetViewElement ) {
  97220. const typeAroundWrapper = viewWriter.createUIElement( 'div', {
  97221. class: 'ck ck-reset_all ck-widget__type-around'
  97222. }, function( domDocument ) {
  97223. const wrapperDomElement = this.toDomElement( domDocument );
  97224. injectButtons( wrapperDomElement, buttonTitles );
  97225. injectFakeCaret( wrapperDomElement );
  97226. return wrapperDomElement;
  97227. } );
  97228. // Inject the type around wrapper into the widget's wrapper.
  97229. viewWriter.insert( viewWriter.createPositionAt( widgetViewElement, 'end' ), typeAroundWrapper );
  97230. }
  97231. // FYI: Not using the IconView class because each instance would need to be destroyed to avoid memory leaks
  97232. // and it's pretty hard to figure out when a view (widget) is gone for good so it's cheaper to use raw
  97233. // <svg> here.
  97234. //
  97235. // @param {HTMLElement} wrapperDomElement
  97236. // @param {Object.<String,String>} buttonTitles
  97237. function injectButtons( wrapperDomElement, buttonTitles ) {
  97238. for ( const position of POSSIBLE_INSERTION_POSITIONS ) {
  97239. const buttonTemplate = new _ckeditor_ckeditor5_ui_src_template__WEBPACK_IMPORTED_MODULE_1__["default"]( {
  97240. tag: 'div',
  97241. attributes: {
  97242. class: [
  97243. 'ck',
  97244. 'ck-widget__type-around__button',
  97245. `ck-widget__type-around__button_${ position }`
  97246. ],
  97247. title: buttonTitles[ position ]
  97248. },
  97249. children: [
  97250. wrapperDomElement.ownerDocument.importNode( RETURN_ARROW_ICON_ELEMENT, true )
  97251. ]
  97252. } );
  97253. wrapperDomElement.appendChild( buttonTemplate.render() );
  97254. }
  97255. }
  97256. // @param {HTMLElement} wrapperDomElement
  97257. function injectFakeCaret( wrapperDomElement ) {
  97258. const caretTemplate = new _ckeditor_ckeditor5_ui_src_template__WEBPACK_IMPORTED_MODULE_1__["default"]( {
  97259. tag: 'div',
  97260. attributes: {
  97261. class: [
  97262. 'ck',
  97263. 'ck-widget__type-around__fake-caret'
  97264. ]
  97265. }
  97266. } );
  97267. wrapperDomElement.appendChild( caretTemplate.render() );
  97268. }
  97269. // Returns the ancestor of an element closest to the root which is empty. For instance,
  97270. // for `<baz>`:
  97271. //
  97272. // <foo>abc<bar><baz></baz></bar></foo>
  97273. //
  97274. // it returns `<bar>`.
  97275. //
  97276. // @param {module:engine/model/schema~Schema} schema
  97277. // @param {module:engine/model/element~Element} element
  97278. // @returns {module:engine/model/element~Element|null}
  97279. function getDeepestEmptyElementAncestor( schema, element ) {
  97280. let deepestEmptyAncestor = element;
  97281. for ( const ancestor of element.getAncestors( { parentFirst: true } ) ) {
  97282. if ( ancestor.childCount > 1 || schema.isLimit( ancestor ) ) {
  97283. break;
  97284. }
  97285. deepestEmptyAncestor = ancestor;
  97286. }
  97287. return deepestEmptyAncestor;
  97288. }
  97289. /***/ }),
  97290. /***/ "./node_modules/@ckeditor/ckeditor5-widget/theme/icons/drag-handle.svg":
  97291. /*!*****************************************************************************!*\
  97292. !*** ./node_modules/@ckeditor/ckeditor5-widget/theme/icons/drag-handle.svg ***!
  97293. \*****************************************************************************/
  97294. /*! exports provided: default */
  97295. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  97296. "use strict";
  97297. __webpack_require__.r(__webpack_exports__);
  97298. /* 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>");
  97299. /***/ }),
  97300. /***/ "./node_modules/@ckeditor/ckeditor5-widget/theme/icons/return-arrow.svg":
  97301. /*!******************************************************************************!*\
  97302. !*** ./node_modules/@ckeditor/ckeditor5-widget/theme/icons/return-arrow.svg ***!
  97303. \******************************************************************************/
  97304. /*! exports provided: default */
  97305. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  97306. "use strict";
  97307. __webpack_require__.r(__webpack_exports__);
  97308. /* 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.038m-2 2 2 2.038\"/></svg>");
  97309. /***/ }),
  97310. /***/ "./node_modules/@ckeditor/ckeditor5-widget/theme/widget.css":
  97311. /*!******************************************************************!*\
  97312. !*** ./node_modules/@ckeditor/ckeditor5-widget/theme/widget.css ***!
  97313. \******************************************************************/
  97314. /*! no static exports found */
  97315. /***/ (function(module, exports, __webpack_require__) {
  97316. var api = __webpack_require__(/*! ../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  97317. 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");
  97318. content = content.__esModule ? content.default : content;
  97319. if (typeof content === 'string') {
  97320. content = [[module.i, content, '']];
  97321. }
  97322. var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
  97323. options.insert = "head";
  97324. options.singleton = true;
  97325. var update = api(content, options);
  97326. module.exports = content.locals || {};
  97327. /***/ }),
  97328. /***/ "./node_modules/@ckeditor/ckeditor5-widget/theme/widgetresize.css":
  97329. /*!************************************************************************!*\
  97330. !*** ./node_modules/@ckeditor/ckeditor5-widget/theme/widgetresize.css ***!
  97331. \************************************************************************/
  97332. /*! no static exports found */
  97333. /***/ (function(module, exports, __webpack_require__) {
  97334. var api = __webpack_require__(/*! ../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  97335. 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");
  97336. content = content.__esModule ? content.default : content;
  97337. if (typeof content === 'string') {
  97338. content = [[module.i, content, '']];
  97339. }
  97340. var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
  97341. options.insert = "head";
  97342. options.singleton = true;
  97343. var update = api(content, options);
  97344. module.exports = content.locals || {};
  97345. /***/ }),
  97346. /***/ "./node_modules/@ckeditor/ckeditor5-widget/theme/widgettypearound.css":
  97347. /*!****************************************************************************!*\
  97348. !*** ./node_modules/@ckeditor/ckeditor5-widget/theme/widgettypearound.css ***!
  97349. \****************************************************************************/
  97350. /*! no static exports found */
  97351. /***/ (function(module, exports, __webpack_require__) {
  97352. var api = __webpack_require__(/*! ../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  97353. 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");
  97354. content = content.__esModule ? content.default : content;
  97355. if (typeof content === 'string') {
  97356. content = [[module.i, content, '']];
  97357. }
  97358. var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
  97359. options.insert = "head";
  97360. options.singleton = true;
  97361. var update = api(content, options);
  97362. module.exports = content.locals || {};
  97363. /***/ }),
  97364. /***/ "./node_modules/ckeditor5/src/clipboard.js":
  97365. /*!*************************************************!*\
  97366. !*** ./node_modules/ckeditor5/src/clipboard.js ***!
  97367. \*************************************************/
  97368. /*! exports provided: Clipboard, ClipboardPipeline, DragDrop, PastePlainText */
  97369. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  97370. "use strict";
  97371. __webpack_require__.r(__webpack_exports__);
  97372. /* harmony import */ var _ckeditor_ckeditor5_clipboard__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-clipboard */ "./node_modules/@ckeditor/ckeditor5-clipboard/src/index.js");
  97373. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Clipboard", function() { return _ckeditor_ckeditor5_clipboard__WEBPACK_IMPORTED_MODULE_0__["Clipboard"]; });
  97374. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ClipboardPipeline", function() { return _ckeditor_ckeditor5_clipboard__WEBPACK_IMPORTED_MODULE_0__["ClipboardPipeline"]; });
  97375. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DragDrop", function() { return _ckeditor_ckeditor5_clipboard__WEBPACK_IMPORTED_MODULE_0__["DragDrop"]; });
  97376. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PastePlainText", function() { return _ckeditor_ckeditor5_clipboard__WEBPACK_IMPORTED_MODULE_0__["PastePlainText"]; });
  97377. /**
  97378. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  97379. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  97380. */
  97381. /**
  97382. * @module ckeditor5/clipboard
  97383. */
  97384. /***/ }),
  97385. /***/ "./node_modules/ckeditor5/src/core.js":
  97386. /*!********************************************!*\
  97387. !*** ./node_modules/ckeditor5/src/core.js ***!
  97388. \********************************************/
  97389. /*! exports provided: Plugin, Command, MultiCommand, Context, ContextPlugin, Editor, EditorUI, attachToForm, DataApiMixin, ElementApiMixin, secureSourceElement, PendingActions, icons */
  97390. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  97391. "use strict";
  97392. __webpack_require__.r(__webpack_exports__);
  97393. /* harmony import */ var _ckeditor_ckeditor5_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core */ "./node_modules/@ckeditor/ckeditor5-core/src/index.js");
  97394. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Plugin", function() { return _ckeditor_ckeditor5_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"]; });
  97395. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Command", function() { return _ckeditor_ckeditor5_core__WEBPACK_IMPORTED_MODULE_0__["Command"]; });
  97396. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MultiCommand", function() { return _ckeditor_ckeditor5_core__WEBPACK_IMPORTED_MODULE_0__["MultiCommand"]; });
  97397. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Context", function() { return _ckeditor_ckeditor5_core__WEBPACK_IMPORTED_MODULE_0__["Context"]; });
  97398. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ContextPlugin", function() { return _ckeditor_ckeditor5_core__WEBPACK_IMPORTED_MODULE_0__["ContextPlugin"]; });
  97399. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Editor", function() { return _ckeditor_ckeditor5_core__WEBPACK_IMPORTED_MODULE_0__["Editor"]; });
  97400. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "EditorUI", function() { return _ckeditor_ckeditor5_core__WEBPACK_IMPORTED_MODULE_0__["EditorUI"]; });
  97401. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "attachToForm", function() { return _ckeditor_ckeditor5_core__WEBPACK_IMPORTED_MODULE_0__["attachToForm"]; });
  97402. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DataApiMixin", function() { return _ckeditor_ckeditor5_core__WEBPACK_IMPORTED_MODULE_0__["DataApiMixin"]; });
  97403. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ElementApiMixin", function() { return _ckeditor_ckeditor5_core__WEBPACK_IMPORTED_MODULE_0__["ElementApiMixin"]; });
  97404. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "secureSourceElement", function() { return _ckeditor_ckeditor5_core__WEBPACK_IMPORTED_MODULE_0__["secureSourceElement"]; });
  97405. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PendingActions", function() { return _ckeditor_ckeditor5_core__WEBPACK_IMPORTED_MODULE_0__["PendingActions"]; });
  97406. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "icons", function() { return _ckeditor_ckeditor5_core__WEBPACK_IMPORTED_MODULE_0__["icons"]; });
  97407. /**
  97408. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  97409. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  97410. */
  97411. /**
  97412. * @module ckeditor5/core
  97413. */
  97414. /***/ }),
  97415. /***/ "./node_modules/ckeditor5/src/engine.js":
  97416. /*!**********************************************!*\
  97417. !*** ./node_modules/ckeditor5/src/engine.js ***!
  97418. \**********************************************/
  97419. /*! exports provided: enablePlaceholder, disablePlaceholder, showPlaceholder, hidePlaceholder, needsPlaceholder, EditingController, DataController, Conversion, HtmlDataProcessor, InsertOperation, MarkerOperation, OperationFactory, transformSets, DocumentSelection, Range, LiveRange, LivePosition, Model, TreeWalker, Element, DomConverter, ViewDocument, getFillerOffset, Observer, ClickObserver, DomEventObserver, MouseObserver, DowncastWriter, UpcastWriter, Matcher, DomEventData, StylesProcessor, addBackgroundRules, addBorderRules, addMarginRules, addPaddingRules, isColor, isLineStyle, isLength, isPercentage, isRepeat, isPosition, isAttachment, isURL, getBoxSidesValues, getBoxSidesValueReducer, getBoxSidesShorthandValue, getPositionShorthandNormalizer, getShorthandValues */
  97420. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  97421. "use strict";
  97422. __webpack_require__.r(__webpack_exports__);
  97423. /* harmony import */ var _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-engine */ "./node_modules/@ckeditor/ckeditor5-engine/src/index.js");
  97424. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "enablePlaceholder", function() { return _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__["enablePlaceholder"]; });
  97425. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "disablePlaceholder", function() { return _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__["disablePlaceholder"]; });
  97426. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "showPlaceholder", function() { return _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__["showPlaceholder"]; });
  97427. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "hidePlaceholder", function() { return _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__["hidePlaceholder"]; });
  97428. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "needsPlaceholder", function() { return _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__["needsPlaceholder"]; });
  97429. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "EditingController", function() { return _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__["EditingController"]; });
  97430. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DataController", function() { return _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__["DataController"]; });
  97431. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Conversion", function() { return _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__["Conversion"]; });
  97432. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "HtmlDataProcessor", function() { return _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__["HtmlDataProcessor"]; });
  97433. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "InsertOperation", function() { return _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__["InsertOperation"]; });
  97434. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MarkerOperation", function() { return _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__["MarkerOperation"]; });
  97435. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "OperationFactory", function() { return _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__["OperationFactory"]; });
  97436. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "transformSets", function() { return _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__["transformSets"]; });
  97437. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DocumentSelection", function() { return _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__["DocumentSelection"]; });
  97438. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Range", function() { return _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__["Range"]; });
  97439. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "LiveRange", function() { return _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__["LiveRange"]; });
  97440. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "LivePosition", function() { return _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__["LivePosition"]; });
  97441. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Model", function() { return _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__["Model"]; });
  97442. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TreeWalker", function() { return _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__["TreeWalker"]; });
  97443. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Element", function() { return _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__["Element"]; });
  97444. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DomConverter", function() { return _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__["DomConverter"]; });
  97445. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ViewDocument", function() { return _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__["ViewDocument"]; });
  97446. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getFillerOffset", function() { return _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__["getFillerOffset"]; });
  97447. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Observer", function() { return _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__["Observer"]; });
  97448. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ClickObserver", function() { return _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__["ClickObserver"]; });
  97449. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DomEventObserver", function() { return _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__["DomEventObserver"]; });
  97450. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MouseObserver", function() { return _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__["MouseObserver"]; });
  97451. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DowncastWriter", function() { return _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__["DowncastWriter"]; });
  97452. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "UpcastWriter", function() { return _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__["UpcastWriter"]; });
  97453. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Matcher", function() { return _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__["Matcher"]; });
  97454. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DomEventData", function() { return _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__["DomEventData"]; });
  97455. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "StylesProcessor", function() { return _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__["StylesProcessor"]; });
  97456. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "addBackgroundRules", function() { return _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__["addBackgroundRules"]; });
  97457. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "addBorderRules", function() { return _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__["addBorderRules"]; });
  97458. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "addMarginRules", function() { return _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__["addMarginRules"]; });
  97459. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "addPaddingRules", function() { return _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__["addPaddingRules"]; });
  97460. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isColor", function() { return _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__["isColor"]; });
  97461. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isLineStyle", function() { return _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__["isLineStyle"]; });
  97462. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isLength", function() { return _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__["isLength"]; });
  97463. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isPercentage", function() { return _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__["isPercentage"]; });
  97464. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isRepeat", function() { return _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__["isRepeat"]; });
  97465. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isPosition", function() { return _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__["isPosition"]; });
  97466. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isAttachment", function() { return _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__["isAttachment"]; });
  97467. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isURL", function() { return _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__["isURL"]; });
  97468. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getBoxSidesValues", function() { return _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__["getBoxSidesValues"]; });
  97469. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getBoxSidesValueReducer", function() { return _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__["getBoxSidesValueReducer"]; });
  97470. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getBoxSidesShorthandValue", function() { return _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__["getBoxSidesShorthandValue"]; });
  97471. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getPositionShorthandNormalizer", function() { return _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__["getPositionShorthandNormalizer"]; });
  97472. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getShorthandValues", function() { return _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__["getShorthandValues"]; });
  97473. /**
  97474. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  97475. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  97476. */
  97477. /**
  97478. * @module ckeditor5/engine
  97479. */
  97480. /***/ }),
  97481. /***/ "./node_modules/ckeditor5/src/enter.js":
  97482. /*!*********************************************!*\
  97483. !*** ./node_modules/ckeditor5/src/enter.js ***!
  97484. \*********************************************/
  97485. /*! exports provided: Enter, ShiftEnter */
  97486. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  97487. "use strict";
  97488. __webpack_require__.r(__webpack_exports__);
  97489. /* harmony import */ var _ckeditor_ckeditor5_enter__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-enter */ "./node_modules/@ckeditor/ckeditor5-enter/src/index.js");
  97490. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Enter", function() { return _ckeditor_ckeditor5_enter__WEBPACK_IMPORTED_MODULE_0__["Enter"]; });
  97491. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ShiftEnter", function() { return _ckeditor_ckeditor5_enter__WEBPACK_IMPORTED_MODULE_0__["ShiftEnter"]; });
  97492. /**
  97493. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  97494. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  97495. */
  97496. /**
  97497. * @module ckeditor5/enter
  97498. */
  97499. /***/ }),
  97500. /***/ "./node_modules/ckeditor5/src/paragraph.js":
  97501. /*!*************************************************!*\
  97502. !*** ./node_modules/ckeditor5/src/paragraph.js ***!
  97503. \*************************************************/
  97504. /*! exports provided: Paragraph, ParagraphButtonUI */
  97505. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  97506. "use strict";
  97507. __webpack_require__.r(__webpack_exports__);
  97508. /* harmony import */ var _ckeditor_ckeditor5_paragraph__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-paragraph */ "./node_modules/@ckeditor/ckeditor5-paragraph/src/index.js");
  97509. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Paragraph", function() { return _ckeditor_ckeditor5_paragraph__WEBPACK_IMPORTED_MODULE_0__["Paragraph"]; });
  97510. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ParagraphButtonUI", function() { return _ckeditor_ckeditor5_paragraph__WEBPACK_IMPORTED_MODULE_0__["ParagraphButtonUI"]; });
  97511. /**
  97512. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  97513. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  97514. */
  97515. /**
  97516. * @module ckeditor5/paragraph
  97517. */
  97518. /***/ }),
  97519. /***/ "./node_modules/ckeditor5/src/select-all.js":
  97520. /*!**************************************************!*\
  97521. !*** ./node_modules/ckeditor5/src/select-all.js ***!
  97522. \**************************************************/
  97523. /*! exports provided: SelectAll, SelectAllEditing, SelectAllUI */
  97524. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  97525. "use strict";
  97526. __webpack_require__.r(__webpack_exports__);
  97527. /* harmony import */ var _ckeditor_ckeditor5_select_all__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-select-all */ "./node_modules/@ckeditor/ckeditor5-select-all/src/index.js");
  97528. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SelectAll", function() { return _ckeditor_ckeditor5_select_all__WEBPACK_IMPORTED_MODULE_0__["SelectAll"]; });
  97529. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SelectAllEditing", function() { return _ckeditor_ckeditor5_select_all__WEBPACK_IMPORTED_MODULE_0__["SelectAllEditing"]; });
  97530. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SelectAllUI", function() { return _ckeditor_ckeditor5_select_all__WEBPACK_IMPORTED_MODULE_0__["SelectAllUI"]; });
  97531. /**
  97532. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  97533. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  97534. */
  97535. /**
  97536. * @module ckeditor5/select-all
  97537. */
  97538. /***/ }),
  97539. /***/ "./node_modules/ckeditor5/src/typing.js":
  97540. /*!**********************************************!*\
  97541. !*** ./node_modules/ckeditor5/src/typing.js ***!
  97542. \**********************************************/
  97543. /*! exports provided: Typing, Input, Delete, TextWatcher, TwoStepCaretMovement, TextTransformation, inlineHighlight, findAttributeRange, getLastTextLine, isNonTypingKeystroke */
  97544. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  97545. "use strict";
  97546. __webpack_require__.r(__webpack_exports__);
  97547. /* harmony import */ var _ckeditor_ckeditor5_typing__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-typing */ "./node_modules/@ckeditor/ckeditor5-typing/src/index.js");
  97548. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Typing", function() { return _ckeditor_ckeditor5_typing__WEBPACK_IMPORTED_MODULE_0__["Typing"]; });
  97549. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Input", function() { return _ckeditor_ckeditor5_typing__WEBPACK_IMPORTED_MODULE_0__["Input"]; });
  97550. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Delete", function() { return _ckeditor_ckeditor5_typing__WEBPACK_IMPORTED_MODULE_0__["Delete"]; });
  97551. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TextWatcher", function() { return _ckeditor_ckeditor5_typing__WEBPACK_IMPORTED_MODULE_0__["TextWatcher"]; });
  97552. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TwoStepCaretMovement", function() { return _ckeditor_ckeditor5_typing__WEBPACK_IMPORTED_MODULE_0__["TwoStepCaretMovement"]; });
  97553. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TextTransformation", function() { return _ckeditor_ckeditor5_typing__WEBPACK_IMPORTED_MODULE_0__["TextTransformation"]; });
  97554. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "inlineHighlight", function() { return _ckeditor_ckeditor5_typing__WEBPACK_IMPORTED_MODULE_0__["inlineHighlight"]; });
  97555. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "findAttributeRange", function() { return _ckeditor_ckeditor5_typing__WEBPACK_IMPORTED_MODULE_0__["findAttributeRange"]; });
  97556. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getLastTextLine", function() { return _ckeditor_ckeditor5_typing__WEBPACK_IMPORTED_MODULE_0__["getLastTextLine"]; });
  97557. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isNonTypingKeystroke", function() { return _ckeditor_ckeditor5_typing__WEBPACK_IMPORTED_MODULE_0__["isNonTypingKeystroke"]; });
  97558. /**
  97559. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  97560. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  97561. */
  97562. /**
  97563. * @module ckeditor5/typing
  97564. */
  97565. /***/ }),
  97566. /***/ "./node_modules/ckeditor5/src/ui.js":
  97567. /*!******************************************!*\
  97568. !*** ./node_modules/ckeditor5/src/ui.js ***!
  97569. \******************************************/
  97570. /*! exports provided: clickOutsideHandler, injectCssTransitionDisabler, submitHandler, BodyCollection, ButtonView, SwitchButtonView, getLocalizedColorOptions, normalizeColorOptions, normalizeSingleColorDefinition, ColorGridView, ColorTileView, DropdownButtonView, SplitButtonView, createDropdown, addToolbarToDropdown, addListToDropdown, EditorUIView, BoxedEditorUIView, InlineEditableUIView, FormHeaderView, FocusCycler, IconView, InputTextView, LabelView, LabeledFieldView, createLabeledInputText, createLabeledDropdown, ListItemView, ListView, Notification, Model, BalloonPanelView, ContextualBalloon, StickyPanelView, TooltipView, Template, ToolbarView, ToolbarSeparatorView, enableToolbarKeyboardFocus, normalizeToolbarConfig, BalloonToolbar, BlockToolbar, View, ViewCollection */
  97571. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  97572. "use strict";
  97573. __webpack_require__.r(__webpack_exports__);
  97574. /* harmony import */ var _ckeditor_ckeditor5_ui__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-ui */ "./node_modules/@ckeditor/ckeditor5-ui/src/index.js");
  97575. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "clickOutsideHandler", function() { return _ckeditor_ckeditor5_ui__WEBPACK_IMPORTED_MODULE_0__["clickOutsideHandler"]; });
  97576. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "injectCssTransitionDisabler", function() { return _ckeditor_ckeditor5_ui__WEBPACK_IMPORTED_MODULE_0__["injectCssTransitionDisabler"]; });
  97577. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "submitHandler", function() { return _ckeditor_ckeditor5_ui__WEBPACK_IMPORTED_MODULE_0__["submitHandler"]; });
  97578. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "BodyCollection", function() { return _ckeditor_ckeditor5_ui__WEBPACK_IMPORTED_MODULE_0__["BodyCollection"]; });
  97579. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ButtonView", function() { return _ckeditor_ckeditor5_ui__WEBPACK_IMPORTED_MODULE_0__["ButtonView"]; });
  97580. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SwitchButtonView", function() { return _ckeditor_ckeditor5_ui__WEBPACK_IMPORTED_MODULE_0__["SwitchButtonView"]; });
  97581. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getLocalizedColorOptions", function() { return _ckeditor_ckeditor5_ui__WEBPACK_IMPORTED_MODULE_0__["getLocalizedColorOptions"]; });
  97582. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "normalizeColorOptions", function() { return _ckeditor_ckeditor5_ui__WEBPACK_IMPORTED_MODULE_0__["normalizeColorOptions"]; });
  97583. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "normalizeSingleColorDefinition", function() { return _ckeditor_ckeditor5_ui__WEBPACK_IMPORTED_MODULE_0__["normalizeSingleColorDefinition"]; });
  97584. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ColorGridView", function() { return _ckeditor_ckeditor5_ui__WEBPACK_IMPORTED_MODULE_0__["ColorGridView"]; });
  97585. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ColorTileView", function() { return _ckeditor_ckeditor5_ui__WEBPACK_IMPORTED_MODULE_0__["ColorTileView"]; });
  97586. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DropdownButtonView", function() { return _ckeditor_ckeditor5_ui__WEBPACK_IMPORTED_MODULE_0__["DropdownButtonView"]; });
  97587. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SplitButtonView", function() { return _ckeditor_ckeditor5_ui__WEBPACK_IMPORTED_MODULE_0__["SplitButtonView"]; });
  97588. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "createDropdown", function() { return _ckeditor_ckeditor5_ui__WEBPACK_IMPORTED_MODULE_0__["createDropdown"]; });
  97589. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "addToolbarToDropdown", function() { return _ckeditor_ckeditor5_ui__WEBPACK_IMPORTED_MODULE_0__["addToolbarToDropdown"]; });
  97590. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "addListToDropdown", function() { return _ckeditor_ckeditor5_ui__WEBPACK_IMPORTED_MODULE_0__["addListToDropdown"]; });
  97591. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "EditorUIView", function() { return _ckeditor_ckeditor5_ui__WEBPACK_IMPORTED_MODULE_0__["EditorUIView"]; });
  97592. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "BoxedEditorUIView", function() { return _ckeditor_ckeditor5_ui__WEBPACK_IMPORTED_MODULE_0__["BoxedEditorUIView"]; });
  97593. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "InlineEditableUIView", function() { return _ckeditor_ckeditor5_ui__WEBPACK_IMPORTED_MODULE_0__["InlineEditableUIView"]; });
  97594. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FormHeaderView", function() { return _ckeditor_ckeditor5_ui__WEBPACK_IMPORTED_MODULE_0__["FormHeaderView"]; });
  97595. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FocusCycler", function() { return _ckeditor_ckeditor5_ui__WEBPACK_IMPORTED_MODULE_0__["FocusCycler"]; });
  97596. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "IconView", function() { return _ckeditor_ckeditor5_ui__WEBPACK_IMPORTED_MODULE_0__["IconView"]; });
  97597. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "InputTextView", function() { return _ckeditor_ckeditor5_ui__WEBPACK_IMPORTED_MODULE_0__["InputTextView"]; });
  97598. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "LabelView", function() { return _ckeditor_ckeditor5_ui__WEBPACK_IMPORTED_MODULE_0__["LabelView"]; });
  97599. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "LabeledFieldView", function() { return _ckeditor_ckeditor5_ui__WEBPACK_IMPORTED_MODULE_0__["LabeledFieldView"]; });
  97600. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "createLabeledInputText", function() { return _ckeditor_ckeditor5_ui__WEBPACK_IMPORTED_MODULE_0__["createLabeledInputText"]; });
  97601. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "createLabeledDropdown", function() { return _ckeditor_ckeditor5_ui__WEBPACK_IMPORTED_MODULE_0__["createLabeledDropdown"]; });
  97602. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ListItemView", function() { return _ckeditor_ckeditor5_ui__WEBPACK_IMPORTED_MODULE_0__["ListItemView"]; });
  97603. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ListView", function() { return _ckeditor_ckeditor5_ui__WEBPACK_IMPORTED_MODULE_0__["ListView"]; });
  97604. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Notification", function() { return _ckeditor_ckeditor5_ui__WEBPACK_IMPORTED_MODULE_0__["Notification"]; });
  97605. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Model", function() { return _ckeditor_ckeditor5_ui__WEBPACK_IMPORTED_MODULE_0__["Model"]; });
  97606. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "BalloonPanelView", function() { return _ckeditor_ckeditor5_ui__WEBPACK_IMPORTED_MODULE_0__["BalloonPanelView"]; });
  97607. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ContextualBalloon", function() { return _ckeditor_ckeditor5_ui__WEBPACK_IMPORTED_MODULE_0__["ContextualBalloon"]; });
  97608. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "StickyPanelView", function() { return _ckeditor_ckeditor5_ui__WEBPACK_IMPORTED_MODULE_0__["StickyPanelView"]; });
  97609. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TooltipView", function() { return _ckeditor_ckeditor5_ui__WEBPACK_IMPORTED_MODULE_0__["TooltipView"]; });
  97610. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Template", function() { return _ckeditor_ckeditor5_ui__WEBPACK_IMPORTED_MODULE_0__["Template"]; });
  97611. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ToolbarView", function() { return _ckeditor_ckeditor5_ui__WEBPACK_IMPORTED_MODULE_0__["ToolbarView"]; });
  97612. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ToolbarSeparatorView", function() { return _ckeditor_ckeditor5_ui__WEBPACK_IMPORTED_MODULE_0__["ToolbarSeparatorView"]; });
  97613. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "enableToolbarKeyboardFocus", function() { return _ckeditor_ckeditor5_ui__WEBPACK_IMPORTED_MODULE_0__["enableToolbarKeyboardFocus"]; });
  97614. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "normalizeToolbarConfig", function() { return _ckeditor_ckeditor5_ui__WEBPACK_IMPORTED_MODULE_0__["normalizeToolbarConfig"]; });
  97615. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "BalloonToolbar", function() { return _ckeditor_ckeditor5_ui__WEBPACK_IMPORTED_MODULE_0__["BalloonToolbar"]; });
  97616. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "BlockToolbar", function() { return _ckeditor_ckeditor5_ui__WEBPACK_IMPORTED_MODULE_0__["BlockToolbar"]; });
  97617. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "View", function() { return _ckeditor_ckeditor5_ui__WEBPACK_IMPORTED_MODULE_0__["View"]; });
  97618. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ViewCollection", function() { return _ckeditor_ckeditor5_ui__WEBPACK_IMPORTED_MODULE_0__["ViewCollection"]; });
  97619. /**
  97620. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  97621. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  97622. */
  97623. /**
  97624. * @module ckeditor5/ui
  97625. */
  97626. /***/ }),
  97627. /***/ "./node_modules/ckeditor5/src/undo.js":
  97628. /*!********************************************!*\
  97629. !*** ./node_modules/ckeditor5/src/undo.js ***!
  97630. \********************************************/
  97631. /*! exports provided: Undo, UndoEditing, UndoUi */
  97632. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  97633. "use strict";
  97634. __webpack_require__.r(__webpack_exports__);
  97635. /* harmony import */ var _ckeditor_ckeditor5_undo__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-undo */ "./node_modules/@ckeditor/ckeditor5-undo/src/index.js");
  97636. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Undo", function() { return _ckeditor_ckeditor5_undo__WEBPACK_IMPORTED_MODULE_0__["Undo"]; });
  97637. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "UndoEditing", function() { return _ckeditor_ckeditor5_undo__WEBPACK_IMPORTED_MODULE_0__["UndoEditing"]; });
  97638. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "UndoUi", function() { return _ckeditor_ckeditor5_undo__WEBPACK_IMPORTED_MODULE_0__["UndoUi"]; });
  97639. /**
  97640. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  97641. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  97642. */
  97643. /**
  97644. * @module ckeditor5/undo
  97645. */
  97646. /***/ }),
  97647. /***/ "./node_modules/ckeditor5/src/upload.js":
  97648. /*!**********************************************!*\
  97649. !*** ./node_modules/ckeditor5/src/upload.js ***!
  97650. \**********************************************/
  97651. /*! exports provided: FileRepository, FileDialogButtonView, Base64UploadAdapter, SimpleUploadAdapter */
  97652. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  97653. "use strict";
  97654. __webpack_require__.r(__webpack_exports__);
  97655. /* harmony import */ var _ckeditor_ckeditor5_upload__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-upload */ "./node_modules/@ckeditor/ckeditor5-upload/src/index.js");
  97656. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FileRepository", function() { return _ckeditor_ckeditor5_upload__WEBPACK_IMPORTED_MODULE_0__["FileRepository"]; });
  97657. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FileDialogButtonView", function() { return _ckeditor_ckeditor5_upload__WEBPACK_IMPORTED_MODULE_0__["FileDialogButtonView"]; });
  97658. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Base64UploadAdapter", function() { return _ckeditor_ckeditor5_upload__WEBPACK_IMPORTED_MODULE_0__["Base64UploadAdapter"]; });
  97659. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SimpleUploadAdapter", function() { return _ckeditor_ckeditor5_upload__WEBPACK_IMPORTED_MODULE_0__["SimpleUploadAdapter"]; });
  97660. /**
  97661. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  97662. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  97663. */
  97664. /**
  97665. * @module ckeditor5/upload
  97666. */
  97667. /***/ }),
  97668. /***/ "./node_modules/ckeditor5/src/utils.js":
  97669. /*!*********************************************!*\
  97670. !*** ./node_modules/ckeditor5/src/utils.js ***!
  97671. \*********************************************/
  97672. /*! exports provided: env, diff, mix, EmitterMixin, ObservableMixin, CKEditorError, logError, logWarning, ElementReplacer, createElement, DomEmitterMixin, global, getDataFromElement, Rect, ResizeObserver, setDataInElement, toUnit, keyCodes, getCode, parseKeystroke, getEnvKeystrokeText, isArrowKeyCode, getLocalizedArrowKeyCodeDirection, isForwardArrowKeyCode, getLanguageDirection, Locale, Collection, first, FocusTracker, KeystrokeHandler, toArray, toMap, priorities, uid, version */
  97673. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  97674. "use strict";
  97675. __webpack_require__.r(__webpack_exports__);
  97676. /* harmony import */ var _ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils */ "./node_modules/@ckeditor/ckeditor5-utils/src/index.js");
  97677. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "env", function() { return _ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_0__["env"]; });
  97678. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "diff", function() { return _ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_0__["diff"]; });
  97679. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "mix", function() { return _ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_0__["mix"]; });
  97680. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "EmitterMixin", function() { return _ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_0__["EmitterMixin"]; });
  97681. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ObservableMixin", function() { return _ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_0__["ObservableMixin"]; });
  97682. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CKEditorError", function() { return _ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_0__["CKEditorError"]; });
  97683. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "logError", function() { return _ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_0__["logError"]; });
  97684. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "logWarning", function() { return _ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_0__["logWarning"]; });
  97685. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ElementReplacer", function() { return _ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_0__["ElementReplacer"]; });
  97686. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "createElement", function() { return _ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_0__["createElement"]; });
  97687. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DomEmitterMixin", function() { return _ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_0__["DomEmitterMixin"]; });
  97688. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "global", function() { return _ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_0__["global"]; });
  97689. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getDataFromElement", function() { return _ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_0__["getDataFromElement"]; });
  97690. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Rect", function() { return _ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_0__["Rect"]; });
  97691. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ResizeObserver", function() { return _ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_0__["ResizeObserver"]; });
  97692. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "setDataInElement", function() { return _ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_0__["setDataInElement"]; });
  97693. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toUnit", function() { return _ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_0__["toUnit"]; });
  97694. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "keyCodes", function() { return _ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_0__["keyCodes"]; });
  97695. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getCode", function() { return _ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_0__["getCode"]; });
  97696. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "parseKeystroke", function() { return _ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_0__["parseKeystroke"]; });
  97697. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getEnvKeystrokeText", function() { return _ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_0__["getEnvKeystrokeText"]; });
  97698. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isArrowKeyCode", function() { return _ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_0__["isArrowKeyCode"]; });
  97699. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getLocalizedArrowKeyCodeDirection", function() { return _ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_0__["getLocalizedArrowKeyCodeDirection"]; });
  97700. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isForwardArrowKeyCode", function() { return _ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_0__["isForwardArrowKeyCode"]; });
  97701. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getLanguageDirection", function() { return _ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_0__["getLanguageDirection"]; });
  97702. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Locale", function() { return _ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_0__["Locale"]; });
  97703. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Collection", function() { return _ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_0__["Collection"]; });
  97704. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "first", function() { return _ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_0__["first"]; });
  97705. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FocusTracker", function() { return _ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_0__["FocusTracker"]; });
  97706. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "KeystrokeHandler", function() { return _ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_0__["KeystrokeHandler"]; });
  97707. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toArray", function() { return _ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_0__["toArray"]; });
  97708. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toMap", function() { return _ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_0__["toMap"]; });
  97709. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "priorities", function() { return _ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_0__["priorities"]; });
  97710. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "uid", function() { return _ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_0__["uid"]; });
  97711. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "version", function() { return _ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_0__["version"]; });
  97712. /**
  97713. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  97714. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  97715. */
  97716. /**
  97717. * @module ckeditor5/utils
  97718. */
  97719. /***/ }),
  97720. /***/ "./node_modules/ckeditor5/src/widget.js":
  97721. /*!**********************************************!*\
  97722. !*** ./node_modules/ckeditor5/src/widget.js ***!
  97723. \**********************************************/
  97724. /*! exports provided: Widget, WidgetToolbarRepository, WidgetResize, WidgetTypeAround, WIDGET_CLASS_NAME, WIDGET_SELECTED_CLASS_NAME, isWidget, toWidget, setHighlightHandling, setLabel, getLabel, toWidgetEditable, findOptimalInsertionPosition, checkSelectionOnObject, viewToModelPositionOutsideModelElement, centeredBalloonPositionForLongWidgets */
  97725. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  97726. "use strict";
  97727. __webpack_require__.r(__webpack_exports__);
  97728. /* harmony import */ var _ckeditor_ckeditor5_widget__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-widget */ "./node_modules/@ckeditor/ckeditor5-widget/src/index.js");
  97729. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Widget", function() { return _ckeditor_ckeditor5_widget__WEBPACK_IMPORTED_MODULE_0__["Widget"]; });
  97730. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "WidgetToolbarRepository", function() { return _ckeditor_ckeditor5_widget__WEBPACK_IMPORTED_MODULE_0__["WidgetToolbarRepository"]; });
  97731. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "WidgetResize", function() { return _ckeditor_ckeditor5_widget__WEBPACK_IMPORTED_MODULE_0__["WidgetResize"]; });
  97732. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "WidgetTypeAround", function() { return _ckeditor_ckeditor5_widget__WEBPACK_IMPORTED_MODULE_0__["WidgetTypeAround"]; });
  97733. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "WIDGET_CLASS_NAME", function() { return _ckeditor_ckeditor5_widget__WEBPACK_IMPORTED_MODULE_0__["WIDGET_CLASS_NAME"]; });
  97734. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "WIDGET_SELECTED_CLASS_NAME", function() { return _ckeditor_ckeditor5_widget__WEBPACK_IMPORTED_MODULE_0__["WIDGET_SELECTED_CLASS_NAME"]; });
  97735. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isWidget", function() { return _ckeditor_ckeditor5_widget__WEBPACK_IMPORTED_MODULE_0__["isWidget"]; });
  97736. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toWidget", function() { return _ckeditor_ckeditor5_widget__WEBPACK_IMPORTED_MODULE_0__["toWidget"]; });
  97737. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "setHighlightHandling", function() { return _ckeditor_ckeditor5_widget__WEBPACK_IMPORTED_MODULE_0__["setHighlightHandling"]; });
  97738. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "setLabel", function() { return _ckeditor_ckeditor5_widget__WEBPACK_IMPORTED_MODULE_0__["setLabel"]; });
  97739. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getLabel", function() { return _ckeditor_ckeditor5_widget__WEBPACK_IMPORTED_MODULE_0__["getLabel"]; });
  97740. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toWidgetEditable", function() { return _ckeditor_ckeditor5_widget__WEBPACK_IMPORTED_MODULE_0__["toWidgetEditable"]; });
  97741. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "findOptimalInsertionPosition", function() { return _ckeditor_ckeditor5_widget__WEBPACK_IMPORTED_MODULE_0__["findOptimalInsertionPosition"]; });
  97742. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "checkSelectionOnObject", function() { return _ckeditor_ckeditor5_widget__WEBPACK_IMPORTED_MODULE_0__["checkSelectionOnObject"]; });
  97743. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "viewToModelPositionOutsideModelElement", function() { return _ckeditor_ckeditor5_widget__WEBPACK_IMPORTED_MODULE_0__["viewToModelPositionOutsideModelElement"]; });
  97744. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "centeredBalloonPositionForLongWidgets", function() { return _ckeditor_ckeditor5_widget__WEBPACK_IMPORTED_MODULE_0__["centeredBalloonPositionForLongWidgets"]; });
  97745. /**
  97746. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  97747. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  97748. */
  97749. /**
  97750. * @module ckeditor5/widget
  97751. */
  97752. /***/ }),
  97753. /***/ "./node_modules/lodash-es/_DataView.js":
  97754. /*!*********************************************!*\
  97755. !*** ./node_modules/lodash-es/_DataView.js ***!
  97756. \*********************************************/
  97757. /*! exports provided: default */
  97758. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  97759. "use strict";
  97760. __webpack_require__.r(__webpack_exports__);
  97761. /* harmony import */ var _getNative_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_getNative.js */ "./node_modules/lodash-es/_getNative.js");
  97762. /* harmony import */ var _root_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_root.js */ "./node_modules/lodash-es/_root.js");
  97763. /* Built-in method references that are verified to be native. */
  97764. var DataView = Object(_getNative_js__WEBPACK_IMPORTED_MODULE_0__["default"])(_root_js__WEBPACK_IMPORTED_MODULE_1__["default"], 'DataView');
  97765. /* harmony default export */ __webpack_exports__["default"] = (DataView);
  97766. /***/ }),
  97767. /***/ "./node_modules/lodash-es/_Hash.js":
  97768. /*!*****************************************!*\
  97769. !*** ./node_modules/lodash-es/_Hash.js ***!
  97770. \*****************************************/
  97771. /*! exports provided: default */
  97772. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  97773. "use strict";
  97774. __webpack_require__.r(__webpack_exports__);
  97775. /* harmony import */ var _hashClear_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_hashClear.js */ "./node_modules/lodash-es/_hashClear.js");
  97776. /* harmony import */ var _hashDelete_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_hashDelete.js */ "./node_modules/lodash-es/_hashDelete.js");
  97777. /* harmony import */ var _hashGet_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_hashGet.js */ "./node_modules/lodash-es/_hashGet.js");
  97778. /* harmony import */ var _hashHas_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_hashHas.js */ "./node_modules/lodash-es/_hashHas.js");
  97779. /* harmony import */ var _hashSet_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_hashSet.js */ "./node_modules/lodash-es/_hashSet.js");
  97780. /**
  97781. * Creates a hash object.
  97782. *
  97783. * @private
  97784. * @constructor
  97785. * @param {Array} [entries] The key-value pairs to cache.
  97786. */
  97787. function Hash(entries) {
  97788. var index = -1,
  97789. length = entries == null ? 0 : entries.length;
  97790. this.clear();
  97791. while (++index < length) {
  97792. var entry = entries[index];
  97793. this.set(entry[0], entry[1]);
  97794. }
  97795. }
  97796. // Add methods to `Hash`.
  97797. Hash.prototype.clear = _hashClear_js__WEBPACK_IMPORTED_MODULE_0__["default"];
  97798. Hash.prototype['delete'] = _hashDelete_js__WEBPACK_IMPORTED_MODULE_1__["default"];
  97799. Hash.prototype.get = _hashGet_js__WEBPACK_IMPORTED_MODULE_2__["default"];
  97800. Hash.prototype.has = _hashHas_js__WEBPACK_IMPORTED_MODULE_3__["default"];
  97801. Hash.prototype.set = _hashSet_js__WEBPACK_IMPORTED_MODULE_4__["default"];
  97802. /* harmony default export */ __webpack_exports__["default"] = (Hash);
  97803. /***/ }),
  97804. /***/ "./node_modules/lodash-es/_LazyWrapper.js":
  97805. /*!************************************************!*\
  97806. !*** ./node_modules/lodash-es/_LazyWrapper.js ***!
  97807. \************************************************/
  97808. /*! exports provided: default */
  97809. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  97810. "use strict";
  97811. __webpack_require__.r(__webpack_exports__);
  97812. /* harmony import */ var _baseCreate_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseCreate.js */ "./node_modules/lodash-es/_baseCreate.js");
  97813. /* harmony import */ var _baseLodash_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseLodash.js */ "./node_modules/lodash-es/_baseLodash.js");
  97814. /** Used as references for the maximum length and index of an array. */
  97815. var MAX_ARRAY_LENGTH = 4294967295;
  97816. /**
  97817. * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation.
  97818. *
  97819. * @private
  97820. * @constructor
  97821. * @param {*} value The value to wrap.
  97822. */
  97823. function LazyWrapper(value) {
  97824. this.__wrapped__ = value;
  97825. this.__actions__ = [];
  97826. this.__dir__ = 1;
  97827. this.__filtered__ = false;
  97828. this.__iteratees__ = [];
  97829. this.__takeCount__ = MAX_ARRAY_LENGTH;
  97830. this.__views__ = [];
  97831. }
  97832. // Ensure `LazyWrapper` is an instance of `baseLodash`.
  97833. LazyWrapper.prototype = Object(_baseCreate_js__WEBPACK_IMPORTED_MODULE_0__["default"])(_baseLodash_js__WEBPACK_IMPORTED_MODULE_1__["default"].prototype);
  97834. LazyWrapper.prototype.constructor = LazyWrapper;
  97835. /* harmony default export */ __webpack_exports__["default"] = (LazyWrapper);
  97836. /***/ }),
  97837. /***/ "./node_modules/lodash-es/_ListCache.js":
  97838. /*!**********************************************!*\
  97839. !*** ./node_modules/lodash-es/_ListCache.js ***!
  97840. \**********************************************/
  97841. /*! exports provided: default */
  97842. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  97843. "use strict";
  97844. __webpack_require__.r(__webpack_exports__);
  97845. /* harmony import */ var _listCacheClear_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_listCacheClear.js */ "./node_modules/lodash-es/_listCacheClear.js");
  97846. /* harmony import */ var _listCacheDelete_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_listCacheDelete.js */ "./node_modules/lodash-es/_listCacheDelete.js");
  97847. /* harmony import */ var _listCacheGet_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_listCacheGet.js */ "./node_modules/lodash-es/_listCacheGet.js");
  97848. /* harmony import */ var _listCacheHas_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_listCacheHas.js */ "./node_modules/lodash-es/_listCacheHas.js");
  97849. /* harmony import */ var _listCacheSet_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_listCacheSet.js */ "./node_modules/lodash-es/_listCacheSet.js");
  97850. /**
  97851. * Creates an list cache object.
  97852. *
  97853. * @private
  97854. * @constructor
  97855. * @param {Array} [entries] The key-value pairs to cache.
  97856. */
  97857. function ListCache(entries) {
  97858. var index = -1,
  97859. length = entries == null ? 0 : entries.length;
  97860. this.clear();
  97861. while (++index < length) {
  97862. var entry = entries[index];
  97863. this.set(entry[0], entry[1]);
  97864. }
  97865. }
  97866. // Add methods to `ListCache`.
  97867. ListCache.prototype.clear = _listCacheClear_js__WEBPACK_IMPORTED_MODULE_0__["default"];
  97868. ListCache.prototype['delete'] = _listCacheDelete_js__WEBPACK_IMPORTED_MODULE_1__["default"];
  97869. ListCache.prototype.get = _listCacheGet_js__WEBPACK_IMPORTED_MODULE_2__["default"];
  97870. ListCache.prototype.has = _listCacheHas_js__WEBPACK_IMPORTED_MODULE_3__["default"];
  97871. ListCache.prototype.set = _listCacheSet_js__WEBPACK_IMPORTED_MODULE_4__["default"];
  97872. /* harmony default export */ __webpack_exports__["default"] = (ListCache);
  97873. /***/ }),
  97874. /***/ "./node_modules/lodash-es/_LodashWrapper.js":
  97875. /*!**************************************************!*\
  97876. !*** ./node_modules/lodash-es/_LodashWrapper.js ***!
  97877. \**************************************************/
  97878. /*! exports provided: default */
  97879. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  97880. "use strict";
  97881. __webpack_require__.r(__webpack_exports__);
  97882. /* harmony import */ var _baseCreate_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseCreate.js */ "./node_modules/lodash-es/_baseCreate.js");
  97883. /* harmony import */ var _baseLodash_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseLodash.js */ "./node_modules/lodash-es/_baseLodash.js");
  97884. /**
  97885. * The base constructor for creating `lodash` wrapper objects.
  97886. *
  97887. * @private
  97888. * @param {*} value The value to wrap.
  97889. * @param {boolean} [chainAll] Enable explicit method chain sequences.
  97890. */
  97891. function LodashWrapper(value, chainAll) {
  97892. this.__wrapped__ = value;
  97893. this.__actions__ = [];
  97894. this.__chain__ = !!chainAll;
  97895. this.__index__ = 0;
  97896. this.__values__ = undefined;
  97897. }
  97898. LodashWrapper.prototype = Object(_baseCreate_js__WEBPACK_IMPORTED_MODULE_0__["default"])(_baseLodash_js__WEBPACK_IMPORTED_MODULE_1__["default"].prototype);
  97899. LodashWrapper.prototype.constructor = LodashWrapper;
  97900. /* harmony default export */ __webpack_exports__["default"] = (LodashWrapper);
  97901. /***/ }),
  97902. /***/ "./node_modules/lodash-es/_Map.js":
  97903. /*!****************************************!*\
  97904. !*** ./node_modules/lodash-es/_Map.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 _getNative_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_getNative.js */ "./node_modules/lodash-es/_getNative.js");
  97911. /* harmony import */ var _root_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_root.js */ "./node_modules/lodash-es/_root.js");
  97912. /* Built-in method references that are verified to be native. */
  97913. var Map = Object(_getNative_js__WEBPACK_IMPORTED_MODULE_0__["default"])(_root_js__WEBPACK_IMPORTED_MODULE_1__["default"], 'Map');
  97914. /* harmony default export */ __webpack_exports__["default"] = (Map);
  97915. /***/ }),
  97916. /***/ "./node_modules/lodash-es/_MapCache.js":
  97917. /*!*********************************************!*\
  97918. !*** ./node_modules/lodash-es/_MapCache.js ***!
  97919. \*********************************************/
  97920. /*! exports provided: default */
  97921. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  97922. "use strict";
  97923. __webpack_require__.r(__webpack_exports__);
  97924. /* harmony import */ var _mapCacheClear_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_mapCacheClear.js */ "./node_modules/lodash-es/_mapCacheClear.js");
  97925. /* harmony import */ var _mapCacheDelete_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_mapCacheDelete.js */ "./node_modules/lodash-es/_mapCacheDelete.js");
  97926. /* harmony import */ var _mapCacheGet_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_mapCacheGet.js */ "./node_modules/lodash-es/_mapCacheGet.js");
  97927. /* harmony import */ var _mapCacheHas_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_mapCacheHas.js */ "./node_modules/lodash-es/_mapCacheHas.js");
  97928. /* harmony import */ var _mapCacheSet_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_mapCacheSet.js */ "./node_modules/lodash-es/_mapCacheSet.js");
  97929. /**
  97930. * Creates a map cache object to store key-value pairs.
  97931. *
  97932. * @private
  97933. * @constructor
  97934. * @param {Array} [entries] The key-value pairs to cache.
  97935. */
  97936. function MapCache(entries) {
  97937. var index = -1,
  97938. length = entries == null ? 0 : entries.length;
  97939. this.clear();
  97940. while (++index < length) {
  97941. var entry = entries[index];
  97942. this.set(entry[0], entry[1]);
  97943. }
  97944. }
  97945. // Add methods to `MapCache`.
  97946. MapCache.prototype.clear = _mapCacheClear_js__WEBPACK_IMPORTED_MODULE_0__["default"];
  97947. MapCache.prototype['delete'] = _mapCacheDelete_js__WEBPACK_IMPORTED_MODULE_1__["default"];
  97948. MapCache.prototype.get = _mapCacheGet_js__WEBPACK_IMPORTED_MODULE_2__["default"];
  97949. MapCache.prototype.has = _mapCacheHas_js__WEBPACK_IMPORTED_MODULE_3__["default"];
  97950. MapCache.prototype.set = _mapCacheSet_js__WEBPACK_IMPORTED_MODULE_4__["default"];
  97951. /* harmony default export */ __webpack_exports__["default"] = (MapCache);
  97952. /***/ }),
  97953. /***/ "./node_modules/lodash-es/_Promise.js":
  97954. /*!********************************************!*\
  97955. !*** ./node_modules/lodash-es/_Promise.js ***!
  97956. \********************************************/
  97957. /*! exports provided: default */
  97958. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  97959. "use strict";
  97960. __webpack_require__.r(__webpack_exports__);
  97961. /* harmony import */ var _getNative_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_getNative.js */ "./node_modules/lodash-es/_getNative.js");
  97962. /* harmony import */ var _root_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_root.js */ "./node_modules/lodash-es/_root.js");
  97963. /* Built-in method references that are verified to be native. */
  97964. var Promise = Object(_getNative_js__WEBPACK_IMPORTED_MODULE_0__["default"])(_root_js__WEBPACK_IMPORTED_MODULE_1__["default"], 'Promise');
  97965. /* harmony default export */ __webpack_exports__["default"] = (Promise);
  97966. /***/ }),
  97967. /***/ "./node_modules/lodash-es/_Set.js":
  97968. /*!****************************************!*\
  97969. !*** ./node_modules/lodash-es/_Set.js ***!
  97970. \****************************************/
  97971. /*! exports provided: default */
  97972. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  97973. "use strict";
  97974. __webpack_require__.r(__webpack_exports__);
  97975. /* harmony import */ var _getNative_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_getNative.js */ "./node_modules/lodash-es/_getNative.js");
  97976. /* harmony import */ var _root_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_root.js */ "./node_modules/lodash-es/_root.js");
  97977. /* Built-in method references that are verified to be native. */
  97978. var Set = Object(_getNative_js__WEBPACK_IMPORTED_MODULE_0__["default"])(_root_js__WEBPACK_IMPORTED_MODULE_1__["default"], 'Set');
  97979. /* harmony default export */ __webpack_exports__["default"] = (Set);
  97980. /***/ }),
  97981. /***/ "./node_modules/lodash-es/_SetCache.js":
  97982. /*!*********************************************!*\
  97983. !*** ./node_modules/lodash-es/_SetCache.js ***!
  97984. \*********************************************/
  97985. /*! exports provided: default */
  97986. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  97987. "use strict";
  97988. __webpack_require__.r(__webpack_exports__);
  97989. /* harmony import */ var _MapCache_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_MapCache.js */ "./node_modules/lodash-es/_MapCache.js");
  97990. /* harmony import */ var _setCacheAdd_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_setCacheAdd.js */ "./node_modules/lodash-es/_setCacheAdd.js");
  97991. /* harmony import */ var _setCacheHas_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_setCacheHas.js */ "./node_modules/lodash-es/_setCacheHas.js");
  97992. /**
  97993. *
  97994. * Creates an array cache object to store unique values.
  97995. *
  97996. * @private
  97997. * @constructor
  97998. * @param {Array} [values] The values to cache.
  97999. */
  98000. function SetCache(values) {
  98001. var index = -1,
  98002. length = values == null ? 0 : values.length;
  98003. this.__data__ = new _MapCache_js__WEBPACK_IMPORTED_MODULE_0__["default"];
  98004. while (++index < length) {
  98005. this.add(values[index]);
  98006. }
  98007. }
  98008. // Add methods to `SetCache`.
  98009. SetCache.prototype.add = SetCache.prototype.push = _setCacheAdd_js__WEBPACK_IMPORTED_MODULE_1__["default"];
  98010. SetCache.prototype.has = _setCacheHas_js__WEBPACK_IMPORTED_MODULE_2__["default"];
  98011. /* harmony default export */ __webpack_exports__["default"] = (SetCache);
  98012. /***/ }),
  98013. /***/ "./node_modules/lodash-es/_Stack.js":
  98014. /*!******************************************!*\
  98015. !*** ./node_modules/lodash-es/_Stack.js ***!
  98016. \******************************************/
  98017. /*! exports provided: default */
  98018. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  98019. "use strict";
  98020. __webpack_require__.r(__webpack_exports__);
  98021. /* harmony import */ var _ListCache_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_ListCache.js */ "./node_modules/lodash-es/_ListCache.js");
  98022. /* harmony import */ var _stackClear_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_stackClear.js */ "./node_modules/lodash-es/_stackClear.js");
  98023. /* harmony import */ var _stackDelete_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_stackDelete.js */ "./node_modules/lodash-es/_stackDelete.js");
  98024. /* harmony import */ var _stackGet_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_stackGet.js */ "./node_modules/lodash-es/_stackGet.js");
  98025. /* harmony import */ var _stackHas_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_stackHas.js */ "./node_modules/lodash-es/_stackHas.js");
  98026. /* harmony import */ var _stackSet_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./_stackSet.js */ "./node_modules/lodash-es/_stackSet.js");
  98027. /**
  98028. * Creates a stack cache object to store key-value pairs.
  98029. *
  98030. * @private
  98031. * @constructor
  98032. * @param {Array} [entries] The key-value pairs to cache.
  98033. */
  98034. function Stack(entries) {
  98035. var data = this.__data__ = new _ListCache_js__WEBPACK_IMPORTED_MODULE_0__["default"](entries);
  98036. this.size = data.size;
  98037. }
  98038. // Add methods to `Stack`.
  98039. Stack.prototype.clear = _stackClear_js__WEBPACK_IMPORTED_MODULE_1__["default"];
  98040. Stack.prototype['delete'] = _stackDelete_js__WEBPACK_IMPORTED_MODULE_2__["default"];
  98041. Stack.prototype.get = _stackGet_js__WEBPACK_IMPORTED_MODULE_3__["default"];
  98042. Stack.prototype.has = _stackHas_js__WEBPACK_IMPORTED_MODULE_4__["default"];
  98043. Stack.prototype.set = _stackSet_js__WEBPACK_IMPORTED_MODULE_5__["default"];
  98044. /* harmony default export */ __webpack_exports__["default"] = (Stack);
  98045. /***/ }),
  98046. /***/ "./node_modules/lodash-es/_Symbol.js":
  98047. /*!*******************************************!*\
  98048. !*** ./node_modules/lodash-es/_Symbol.js ***!
  98049. \*******************************************/
  98050. /*! exports provided: default */
  98051. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  98052. "use strict";
  98053. __webpack_require__.r(__webpack_exports__);
  98054. /* harmony import */ var _root_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_root.js */ "./node_modules/lodash-es/_root.js");
  98055. /** Built-in value references. */
  98056. var Symbol = _root_js__WEBPACK_IMPORTED_MODULE_0__["default"].Symbol;
  98057. /* harmony default export */ __webpack_exports__["default"] = (Symbol);
  98058. /***/ }),
  98059. /***/ "./node_modules/lodash-es/_Uint8Array.js":
  98060. /*!***********************************************!*\
  98061. !*** ./node_modules/lodash-es/_Uint8Array.js ***!
  98062. \***********************************************/
  98063. /*! exports provided: default */
  98064. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  98065. "use strict";
  98066. __webpack_require__.r(__webpack_exports__);
  98067. /* harmony import */ var _root_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_root.js */ "./node_modules/lodash-es/_root.js");
  98068. /** Built-in value references. */
  98069. var Uint8Array = _root_js__WEBPACK_IMPORTED_MODULE_0__["default"].Uint8Array;
  98070. /* harmony default export */ __webpack_exports__["default"] = (Uint8Array);
  98071. /***/ }),
  98072. /***/ "./node_modules/lodash-es/_WeakMap.js":
  98073. /*!********************************************!*\
  98074. !*** ./node_modules/lodash-es/_WeakMap.js ***!
  98075. \********************************************/
  98076. /*! exports provided: default */
  98077. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  98078. "use strict";
  98079. __webpack_require__.r(__webpack_exports__);
  98080. /* harmony import */ var _getNative_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_getNative.js */ "./node_modules/lodash-es/_getNative.js");
  98081. /* harmony import */ var _root_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_root.js */ "./node_modules/lodash-es/_root.js");
  98082. /* Built-in method references that are verified to be native. */
  98083. var WeakMap = Object(_getNative_js__WEBPACK_IMPORTED_MODULE_0__["default"])(_root_js__WEBPACK_IMPORTED_MODULE_1__["default"], 'WeakMap');
  98084. /* harmony default export */ __webpack_exports__["default"] = (WeakMap);
  98085. /***/ }),
  98086. /***/ "./node_modules/lodash-es/_apply.js":
  98087. /*!******************************************!*\
  98088. !*** ./node_modules/lodash-es/_apply.js ***!
  98089. \******************************************/
  98090. /*! exports provided: default */
  98091. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  98092. "use strict";
  98093. __webpack_require__.r(__webpack_exports__);
  98094. /**
  98095. * A faster alternative to `Function#apply`, this function invokes `func`
  98096. * with the `this` binding of `thisArg` and the arguments of `args`.
  98097. *
  98098. * @private
  98099. * @param {Function} func The function to invoke.
  98100. * @param {*} thisArg The `this` binding of `func`.
  98101. * @param {Array} args The arguments to invoke `func` with.
  98102. * @returns {*} Returns the result of `func`.
  98103. */
  98104. function apply(func, thisArg, args) {
  98105. switch (args.length) {
  98106. case 0: return func.call(thisArg);
  98107. case 1: return func.call(thisArg, args[0]);
  98108. case 2: return func.call(thisArg, args[0], args[1]);
  98109. case 3: return func.call(thisArg, args[0], args[1], args[2]);
  98110. }
  98111. return func.apply(thisArg, args);
  98112. }
  98113. /* harmony default export */ __webpack_exports__["default"] = (apply);
  98114. /***/ }),
  98115. /***/ "./node_modules/lodash-es/_arrayAggregator.js":
  98116. /*!****************************************************!*\
  98117. !*** ./node_modules/lodash-es/_arrayAggregator.js ***!
  98118. \****************************************************/
  98119. /*! exports provided: default */
  98120. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  98121. "use strict";
  98122. __webpack_require__.r(__webpack_exports__);
  98123. /**
  98124. * A specialized version of `baseAggregator` for arrays.
  98125. *
  98126. * @private
  98127. * @param {Array} [array] The array to iterate over.
  98128. * @param {Function} setter The function to set `accumulator` values.
  98129. * @param {Function} iteratee The iteratee to transform keys.
  98130. * @param {Object} accumulator The initial aggregated object.
  98131. * @returns {Function} Returns `accumulator`.
  98132. */
  98133. function arrayAggregator(array, setter, iteratee, accumulator) {
  98134. var index = -1,
  98135. length = array == null ? 0 : array.length;
  98136. while (++index < length) {
  98137. var value = array[index];
  98138. setter(accumulator, value, iteratee(value), array);
  98139. }
  98140. return accumulator;
  98141. }
  98142. /* harmony default export */ __webpack_exports__["default"] = (arrayAggregator);
  98143. /***/ }),
  98144. /***/ "./node_modules/lodash-es/_arrayEach.js":
  98145. /*!**********************************************!*\
  98146. !*** ./node_modules/lodash-es/_arrayEach.js ***!
  98147. \**********************************************/
  98148. /*! exports provided: default */
  98149. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  98150. "use strict";
  98151. __webpack_require__.r(__webpack_exports__);
  98152. /**
  98153. * A specialized version of `_.forEach` for arrays without support for
  98154. * iteratee shorthands.
  98155. *
  98156. * @private
  98157. * @param {Array} [array] The array to iterate over.
  98158. * @param {Function} iteratee The function invoked per iteration.
  98159. * @returns {Array} Returns `array`.
  98160. */
  98161. function arrayEach(array, iteratee) {
  98162. var index = -1,
  98163. length = array == null ? 0 : array.length;
  98164. while (++index < length) {
  98165. if (iteratee(array[index], index, array) === false) {
  98166. break;
  98167. }
  98168. }
  98169. return array;
  98170. }
  98171. /* harmony default export */ __webpack_exports__["default"] = (arrayEach);
  98172. /***/ }),
  98173. /***/ "./node_modules/lodash-es/_arrayEachRight.js":
  98174. /*!***************************************************!*\
  98175. !*** ./node_modules/lodash-es/_arrayEachRight.js ***!
  98176. \***************************************************/
  98177. /*! exports provided: default */
  98178. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  98179. "use strict";
  98180. __webpack_require__.r(__webpack_exports__);
  98181. /**
  98182. * A specialized version of `_.forEachRight` for arrays without support for
  98183. * iteratee shorthands.
  98184. *
  98185. * @private
  98186. * @param {Array} [array] The array to iterate over.
  98187. * @param {Function} iteratee The function invoked per iteration.
  98188. * @returns {Array} Returns `array`.
  98189. */
  98190. function arrayEachRight(array, iteratee) {
  98191. var length = array == null ? 0 : array.length;
  98192. while (length--) {
  98193. if (iteratee(array[length], length, array) === false) {
  98194. break;
  98195. }
  98196. }
  98197. return array;
  98198. }
  98199. /* harmony default export */ __webpack_exports__["default"] = (arrayEachRight);
  98200. /***/ }),
  98201. /***/ "./node_modules/lodash-es/_arrayEvery.js":
  98202. /*!***********************************************!*\
  98203. !*** ./node_modules/lodash-es/_arrayEvery.js ***!
  98204. \***********************************************/
  98205. /*! exports provided: default */
  98206. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  98207. "use strict";
  98208. __webpack_require__.r(__webpack_exports__);
  98209. /**
  98210. * A specialized version of `_.every` for arrays without support for
  98211. * iteratee shorthands.
  98212. *
  98213. * @private
  98214. * @param {Array} [array] The array to iterate over.
  98215. * @param {Function} predicate The function invoked per iteration.
  98216. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  98217. * else `false`.
  98218. */
  98219. function arrayEvery(array, predicate) {
  98220. var index = -1,
  98221. length = array == null ? 0 : array.length;
  98222. while (++index < length) {
  98223. if (!predicate(array[index], index, array)) {
  98224. return false;
  98225. }
  98226. }
  98227. return true;
  98228. }
  98229. /* harmony default export */ __webpack_exports__["default"] = (arrayEvery);
  98230. /***/ }),
  98231. /***/ "./node_modules/lodash-es/_arrayFilter.js":
  98232. /*!************************************************!*\
  98233. !*** ./node_modules/lodash-es/_arrayFilter.js ***!
  98234. \************************************************/
  98235. /*! exports provided: default */
  98236. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  98237. "use strict";
  98238. __webpack_require__.r(__webpack_exports__);
  98239. /**
  98240. * A specialized version of `_.filter` for arrays without support for
  98241. * iteratee shorthands.
  98242. *
  98243. * @private
  98244. * @param {Array} [array] The array to iterate over.
  98245. * @param {Function} predicate The function invoked per iteration.
  98246. * @returns {Array} Returns the new filtered array.
  98247. */
  98248. function arrayFilter(array, predicate) {
  98249. var index = -1,
  98250. length = array == null ? 0 : array.length,
  98251. resIndex = 0,
  98252. result = [];
  98253. while (++index < length) {
  98254. var value = array[index];
  98255. if (predicate(value, index, array)) {
  98256. result[resIndex++] = value;
  98257. }
  98258. }
  98259. return result;
  98260. }
  98261. /* harmony default export */ __webpack_exports__["default"] = (arrayFilter);
  98262. /***/ }),
  98263. /***/ "./node_modules/lodash-es/_arrayIncludes.js":
  98264. /*!**************************************************!*\
  98265. !*** ./node_modules/lodash-es/_arrayIncludes.js ***!
  98266. \**************************************************/
  98267. /*! exports provided: default */
  98268. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  98269. "use strict";
  98270. __webpack_require__.r(__webpack_exports__);
  98271. /* harmony import */ var _baseIndexOf_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseIndexOf.js */ "./node_modules/lodash-es/_baseIndexOf.js");
  98272. /**
  98273. * A specialized version of `_.includes` for arrays without support for
  98274. * specifying an index to search from.
  98275. *
  98276. * @private
  98277. * @param {Array} [array] The array to inspect.
  98278. * @param {*} target The value to search for.
  98279. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  98280. */
  98281. function arrayIncludes(array, value) {
  98282. var length = array == null ? 0 : array.length;
  98283. return !!length && Object(_baseIndexOf_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, value, 0) > -1;
  98284. }
  98285. /* harmony default export */ __webpack_exports__["default"] = (arrayIncludes);
  98286. /***/ }),
  98287. /***/ "./node_modules/lodash-es/_arrayIncludesWith.js":
  98288. /*!******************************************************!*\
  98289. !*** ./node_modules/lodash-es/_arrayIncludesWith.js ***!
  98290. \******************************************************/
  98291. /*! exports provided: default */
  98292. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  98293. "use strict";
  98294. __webpack_require__.r(__webpack_exports__);
  98295. /**
  98296. * This function is like `arrayIncludes` except that it accepts a comparator.
  98297. *
  98298. * @private
  98299. * @param {Array} [array] The array to inspect.
  98300. * @param {*} target The value to search for.
  98301. * @param {Function} comparator The comparator invoked per element.
  98302. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  98303. */
  98304. function arrayIncludesWith(array, value, comparator) {
  98305. var index = -1,
  98306. length = array == null ? 0 : array.length;
  98307. while (++index < length) {
  98308. if (comparator(value, array[index])) {
  98309. return true;
  98310. }
  98311. }
  98312. return false;
  98313. }
  98314. /* harmony default export */ __webpack_exports__["default"] = (arrayIncludesWith);
  98315. /***/ }),
  98316. /***/ "./node_modules/lodash-es/_arrayLikeKeys.js":
  98317. /*!**************************************************!*\
  98318. !*** ./node_modules/lodash-es/_arrayLikeKeys.js ***!
  98319. \**************************************************/
  98320. /*! exports provided: default */
  98321. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  98322. "use strict";
  98323. __webpack_require__.r(__webpack_exports__);
  98324. /* harmony import */ var _baseTimes_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseTimes.js */ "./node_modules/lodash-es/_baseTimes.js");
  98325. /* harmony import */ var _isArguments_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isArguments.js */ "./node_modules/lodash-es/isArguments.js");
  98326. /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
  98327. /* harmony import */ var _isBuffer_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./isBuffer.js */ "./node_modules/lodash-es/isBuffer.js");
  98328. /* harmony import */ var _isIndex_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_isIndex.js */ "./node_modules/lodash-es/_isIndex.js");
  98329. /* harmony import */ var _isTypedArray_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./isTypedArray.js */ "./node_modules/lodash-es/isTypedArray.js");
  98330. /** Used for built-in method references. */
  98331. var objectProto = Object.prototype;
  98332. /** Used to check objects for own properties. */
  98333. var hasOwnProperty = objectProto.hasOwnProperty;
  98334. /**
  98335. * Creates an array of the enumerable property names of the array-like `value`.
  98336. *
  98337. * @private
  98338. * @param {*} value The value to query.
  98339. * @param {boolean} inherited Specify returning inherited property names.
  98340. * @returns {Array} Returns the array of property names.
  98341. */
  98342. function arrayLikeKeys(value, inherited) {
  98343. var isArr = Object(_isArray_js__WEBPACK_IMPORTED_MODULE_2__["default"])(value),
  98344. isArg = !isArr && Object(_isArguments_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value),
  98345. isBuff = !isArr && !isArg && Object(_isBuffer_js__WEBPACK_IMPORTED_MODULE_3__["default"])(value),
  98346. isType = !isArr && !isArg && !isBuff && Object(_isTypedArray_js__WEBPACK_IMPORTED_MODULE_5__["default"])(value),
  98347. skipIndexes = isArr || isArg || isBuff || isType,
  98348. result = skipIndexes ? Object(_baseTimes_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value.length, String) : [],
  98349. length = result.length;
  98350. for (var key in value) {
  98351. if ((inherited || hasOwnProperty.call(value, key)) &&
  98352. !(skipIndexes && (
  98353. // Safari 9 has enumerable `arguments.length` in strict mode.
  98354. key == 'length' ||
  98355. // Node.js 0.10 has enumerable non-index properties on buffers.
  98356. (isBuff && (key == 'offset' || key == 'parent')) ||
  98357. // PhantomJS 2 has enumerable non-index properties on typed arrays.
  98358. (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
  98359. // Skip index properties.
  98360. Object(_isIndex_js__WEBPACK_IMPORTED_MODULE_4__["default"])(key, length)
  98361. ))) {
  98362. result.push(key);
  98363. }
  98364. }
  98365. return result;
  98366. }
  98367. /* harmony default export */ __webpack_exports__["default"] = (arrayLikeKeys);
  98368. /***/ }),
  98369. /***/ "./node_modules/lodash-es/_arrayMap.js":
  98370. /*!*********************************************!*\
  98371. !*** ./node_modules/lodash-es/_arrayMap.js ***!
  98372. \*********************************************/
  98373. /*! exports provided: default */
  98374. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  98375. "use strict";
  98376. __webpack_require__.r(__webpack_exports__);
  98377. /**
  98378. * A specialized version of `_.map` for arrays without support for iteratee
  98379. * shorthands.
  98380. *
  98381. * @private
  98382. * @param {Array} [array] The array to iterate over.
  98383. * @param {Function} iteratee The function invoked per iteration.
  98384. * @returns {Array} Returns the new mapped array.
  98385. */
  98386. function arrayMap(array, iteratee) {
  98387. var index = -1,
  98388. length = array == null ? 0 : array.length,
  98389. result = Array(length);
  98390. while (++index < length) {
  98391. result[index] = iteratee(array[index], index, array);
  98392. }
  98393. return result;
  98394. }
  98395. /* harmony default export */ __webpack_exports__["default"] = (arrayMap);
  98396. /***/ }),
  98397. /***/ "./node_modules/lodash-es/_arrayPush.js":
  98398. /*!**********************************************!*\
  98399. !*** ./node_modules/lodash-es/_arrayPush.js ***!
  98400. \**********************************************/
  98401. /*! exports provided: default */
  98402. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  98403. "use strict";
  98404. __webpack_require__.r(__webpack_exports__);
  98405. /**
  98406. * Appends the elements of `values` to `array`.
  98407. *
  98408. * @private
  98409. * @param {Array} array The array to modify.
  98410. * @param {Array} values The values to append.
  98411. * @returns {Array} Returns `array`.
  98412. */
  98413. function arrayPush(array, values) {
  98414. var index = -1,
  98415. length = values.length,
  98416. offset = array.length;
  98417. while (++index < length) {
  98418. array[offset + index] = values[index];
  98419. }
  98420. return array;
  98421. }
  98422. /* harmony default export */ __webpack_exports__["default"] = (arrayPush);
  98423. /***/ }),
  98424. /***/ "./node_modules/lodash-es/_arrayReduce.js":
  98425. /*!************************************************!*\
  98426. !*** ./node_modules/lodash-es/_arrayReduce.js ***!
  98427. \************************************************/
  98428. /*! exports provided: default */
  98429. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  98430. "use strict";
  98431. __webpack_require__.r(__webpack_exports__);
  98432. /**
  98433. * A specialized version of `_.reduce` for arrays without support for
  98434. * iteratee shorthands.
  98435. *
  98436. * @private
  98437. * @param {Array} [array] The array to iterate over.
  98438. * @param {Function} iteratee The function invoked per iteration.
  98439. * @param {*} [accumulator] The initial value.
  98440. * @param {boolean} [initAccum] Specify using the first element of `array` as
  98441. * the initial value.
  98442. * @returns {*} Returns the accumulated value.
  98443. */
  98444. function arrayReduce(array, iteratee, accumulator, initAccum) {
  98445. var index = -1,
  98446. length = array == null ? 0 : array.length;
  98447. if (initAccum && length) {
  98448. accumulator = array[++index];
  98449. }
  98450. while (++index < length) {
  98451. accumulator = iteratee(accumulator, array[index], index, array);
  98452. }
  98453. return accumulator;
  98454. }
  98455. /* harmony default export */ __webpack_exports__["default"] = (arrayReduce);
  98456. /***/ }),
  98457. /***/ "./node_modules/lodash-es/_arrayReduceRight.js":
  98458. /*!*****************************************************!*\
  98459. !*** ./node_modules/lodash-es/_arrayReduceRight.js ***!
  98460. \*****************************************************/
  98461. /*! exports provided: default */
  98462. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  98463. "use strict";
  98464. __webpack_require__.r(__webpack_exports__);
  98465. /**
  98466. * A specialized version of `_.reduceRight` for arrays without support for
  98467. * iteratee shorthands.
  98468. *
  98469. * @private
  98470. * @param {Array} [array] The array to iterate over.
  98471. * @param {Function} iteratee The function invoked per iteration.
  98472. * @param {*} [accumulator] The initial value.
  98473. * @param {boolean} [initAccum] Specify using the last element of `array` as
  98474. * the initial value.
  98475. * @returns {*} Returns the accumulated value.
  98476. */
  98477. function arrayReduceRight(array, iteratee, accumulator, initAccum) {
  98478. var length = array == null ? 0 : array.length;
  98479. if (initAccum && length) {
  98480. accumulator = array[--length];
  98481. }
  98482. while (length--) {
  98483. accumulator = iteratee(accumulator, array[length], length, array);
  98484. }
  98485. return accumulator;
  98486. }
  98487. /* harmony default export */ __webpack_exports__["default"] = (arrayReduceRight);
  98488. /***/ }),
  98489. /***/ "./node_modules/lodash-es/_arraySample.js":
  98490. /*!************************************************!*\
  98491. !*** ./node_modules/lodash-es/_arraySample.js ***!
  98492. \************************************************/
  98493. /*! exports provided: default */
  98494. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  98495. "use strict";
  98496. __webpack_require__.r(__webpack_exports__);
  98497. /* harmony import */ var _baseRandom_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseRandom.js */ "./node_modules/lodash-es/_baseRandom.js");
  98498. /**
  98499. * A specialized version of `_.sample` for arrays.
  98500. *
  98501. * @private
  98502. * @param {Array} array The array to sample.
  98503. * @returns {*} Returns the random element.
  98504. */
  98505. function arraySample(array) {
  98506. var length = array.length;
  98507. return length ? array[Object(_baseRandom_js__WEBPACK_IMPORTED_MODULE_0__["default"])(0, length - 1)] : undefined;
  98508. }
  98509. /* harmony default export */ __webpack_exports__["default"] = (arraySample);
  98510. /***/ }),
  98511. /***/ "./node_modules/lodash-es/_arraySampleSize.js":
  98512. /*!****************************************************!*\
  98513. !*** ./node_modules/lodash-es/_arraySampleSize.js ***!
  98514. \****************************************************/
  98515. /*! exports provided: default */
  98516. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  98517. "use strict";
  98518. __webpack_require__.r(__webpack_exports__);
  98519. /* harmony import */ var _baseClamp_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseClamp.js */ "./node_modules/lodash-es/_baseClamp.js");
  98520. /* harmony import */ var _copyArray_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_copyArray.js */ "./node_modules/lodash-es/_copyArray.js");
  98521. /* harmony import */ var _shuffleSelf_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_shuffleSelf.js */ "./node_modules/lodash-es/_shuffleSelf.js");
  98522. /**
  98523. * A specialized version of `_.sampleSize` for arrays.
  98524. *
  98525. * @private
  98526. * @param {Array} array The array to sample.
  98527. * @param {number} n The number of elements to sample.
  98528. * @returns {Array} Returns the random elements.
  98529. */
  98530. function arraySampleSize(array, n) {
  98531. 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));
  98532. }
  98533. /* harmony default export */ __webpack_exports__["default"] = (arraySampleSize);
  98534. /***/ }),
  98535. /***/ "./node_modules/lodash-es/_arrayShuffle.js":
  98536. /*!*************************************************!*\
  98537. !*** ./node_modules/lodash-es/_arrayShuffle.js ***!
  98538. \*************************************************/
  98539. /*! exports provided: default */
  98540. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  98541. "use strict";
  98542. __webpack_require__.r(__webpack_exports__);
  98543. /* harmony import */ var _copyArray_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_copyArray.js */ "./node_modules/lodash-es/_copyArray.js");
  98544. /* harmony import */ var _shuffleSelf_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_shuffleSelf.js */ "./node_modules/lodash-es/_shuffleSelf.js");
  98545. /**
  98546. * A specialized version of `_.shuffle` for arrays.
  98547. *
  98548. * @private
  98549. * @param {Array} array The array to shuffle.
  98550. * @returns {Array} Returns the new shuffled array.
  98551. */
  98552. function arrayShuffle(array) {
  98553. return Object(_shuffleSelf_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Object(_copyArray_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array));
  98554. }
  98555. /* harmony default export */ __webpack_exports__["default"] = (arrayShuffle);
  98556. /***/ }),
  98557. /***/ "./node_modules/lodash-es/_arraySome.js":
  98558. /*!**********************************************!*\
  98559. !*** ./node_modules/lodash-es/_arraySome.js ***!
  98560. \**********************************************/
  98561. /*! exports provided: default */
  98562. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  98563. "use strict";
  98564. __webpack_require__.r(__webpack_exports__);
  98565. /**
  98566. * A specialized version of `_.some` for arrays without support for iteratee
  98567. * shorthands.
  98568. *
  98569. * @private
  98570. * @param {Array} [array] The array to iterate over.
  98571. * @param {Function} predicate The function invoked per iteration.
  98572. * @returns {boolean} Returns `true` if any element passes the predicate check,
  98573. * else `false`.
  98574. */
  98575. function arraySome(array, predicate) {
  98576. var index = -1,
  98577. length = array == null ? 0 : array.length;
  98578. while (++index < length) {
  98579. if (predicate(array[index], index, array)) {
  98580. return true;
  98581. }
  98582. }
  98583. return false;
  98584. }
  98585. /* harmony default export */ __webpack_exports__["default"] = (arraySome);
  98586. /***/ }),
  98587. /***/ "./node_modules/lodash-es/_asciiSize.js":
  98588. /*!**********************************************!*\
  98589. !*** ./node_modules/lodash-es/_asciiSize.js ***!
  98590. \**********************************************/
  98591. /*! exports provided: default */
  98592. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  98593. "use strict";
  98594. __webpack_require__.r(__webpack_exports__);
  98595. /* harmony import */ var _baseProperty_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseProperty.js */ "./node_modules/lodash-es/_baseProperty.js");
  98596. /**
  98597. * Gets the size of an ASCII `string`.
  98598. *
  98599. * @private
  98600. * @param {string} string The string inspect.
  98601. * @returns {number} Returns the string size.
  98602. */
  98603. var asciiSize = Object(_baseProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])('length');
  98604. /* harmony default export */ __webpack_exports__["default"] = (asciiSize);
  98605. /***/ }),
  98606. /***/ "./node_modules/lodash-es/_asciiToArray.js":
  98607. /*!*************************************************!*\
  98608. !*** ./node_modules/lodash-es/_asciiToArray.js ***!
  98609. \*************************************************/
  98610. /*! exports provided: default */
  98611. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  98612. "use strict";
  98613. __webpack_require__.r(__webpack_exports__);
  98614. /**
  98615. * Converts an ASCII `string` to an array.
  98616. *
  98617. * @private
  98618. * @param {string} string The string to convert.
  98619. * @returns {Array} Returns the converted array.
  98620. */
  98621. function asciiToArray(string) {
  98622. return string.split('');
  98623. }
  98624. /* harmony default export */ __webpack_exports__["default"] = (asciiToArray);
  98625. /***/ }),
  98626. /***/ "./node_modules/lodash-es/_asciiWords.js":
  98627. /*!***********************************************!*\
  98628. !*** ./node_modules/lodash-es/_asciiWords.js ***!
  98629. \***********************************************/
  98630. /*! exports provided: default */
  98631. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  98632. "use strict";
  98633. __webpack_require__.r(__webpack_exports__);
  98634. /** Used to match words composed of alphanumeric characters. */
  98635. var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
  98636. /**
  98637. * Splits an ASCII `string` into an array of its words.
  98638. *
  98639. * @private
  98640. * @param {string} The string to inspect.
  98641. * @returns {Array} Returns the words of `string`.
  98642. */
  98643. function asciiWords(string) {
  98644. return string.match(reAsciiWord) || [];
  98645. }
  98646. /* harmony default export */ __webpack_exports__["default"] = (asciiWords);
  98647. /***/ }),
  98648. /***/ "./node_modules/lodash-es/_assignMergeValue.js":
  98649. /*!*****************************************************!*\
  98650. !*** ./node_modules/lodash-es/_assignMergeValue.js ***!
  98651. \*****************************************************/
  98652. /*! exports provided: default */
  98653. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  98654. "use strict";
  98655. __webpack_require__.r(__webpack_exports__);
  98656. /* harmony import */ var _baseAssignValue_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseAssignValue.js */ "./node_modules/lodash-es/_baseAssignValue.js");
  98657. /* harmony import */ var _eq_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./eq.js */ "./node_modules/lodash-es/eq.js");
  98658. /**
  98659. * This function is like `assignValue` except that it doesn't assign
  98660. * `undefined` values.
  98661. *
  98662. * @private
  98663. * @param {Object} object The object to modify.
  98664. * @param {string} key The key of the property to assign.
  98665. * @param {*} value The value to assign.
  98666. */
  98667. function assignMergeValue(object, key, value) {
  98668. if ((value !== undefined && !Object(_eq_js__WEBPACK_IMPORTED_MODULE_1__["default"])(object[key], value)) ||
  98669. (value === undefined && !(key in object))) {
  98670. Object(_baseAssignValue_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, key, value);
  98671. }
  98672. }
  98673. /* harmony default export */ __webpack_exports__["default"] = (assignMergeValue);
  98674. /***/ }),
  98675. /***/ "./node_modules/lodash-es/_assignValue.js":
  98676. /*!************************************************!*\
  98677. !*** ./node_modules/lodash-es/_assignValue.js ***!
  98678. \************************************************/
  98679. /*! exports provided: default */
  98680. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  98681. "use strict";
  98682. __webpack_require__.r(__webpack_exports__);
  98683. /* harmony import */ var _baseAssignValue_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseAssignValue.js */ "./node_modules/lodash-es/_baseAssignValue.js");
  98684. /* harmony import */ var _eq_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./eq.js */ "./node_modules/lodash-es/eq.js");
  98685. /** Used for built-in method references. */
  98686. var objectProto = Object.prototype;
  98687. /** Used to check objects for own properties. */
  98688. var hasOwnProperty = objectProto.hasOwnProperty;
  98689. /**
  98690. * Assigns `value` to `key` of `object` if the existing value is not equivalent
  98691. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  98692. * for equality comparisons.
  98693. *
  98694. * @private
  98695. * @param {Object} object The object to modify.
  98696. * @param {string} key The key of the property to assign.
  98697. * @param {*} value The value to assign.
  98698. */
  98699. function assignValue(object, key, value) {
  98700. var objValue = object[key];
  98701. if (!(hasOwnProperty.call(object, key) && Object(_eq_js__WEBPACK_IMPORTED_MODULE_1__["default"])(objValue, value)) ||
  98702. (value === undefined && !(key in object))) {
  98703. Object(_baseAssignValue_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, key, value);
  98704. }
  98705. }
  98706. /* harmony default export */ __webpack_exports__["default"] = (assignValue);
  98707. /***/ }),
  98708. /***/ "./node_modules/lodash-es/_assocIndexOf.js":
  98709. /*!*************************************************!*\
  98710. !*** ./node_modules/lodash-es/_assocIndexOf.js ***!
  98711. \*************************************************/
  98712. /*! exports provided: default */
  98713. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  98714. "use strict";
  98715. __webpack_require__.r(__webpack_exports__);
  98716. /* harmony import */ var _eq_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./eq.js */ "./node_modules/lodash-es/eq.js");
  98717. /**
  98718. * Gets the index at which the `key` is found in `array` of key-value pairs.
  98719. *
  98720. * @private
  98721. * @param {Array} array The array to inspect.
  98722. * @param {*} key The key to search for.
  98723. * @returns {number} Returns the index of the matched value, else `-1`.
  98724. */
  98725. function assocIndexOf(array, key) {
  98726. var length = array.length;
  98727. while (length--) {
  98728. if (Object(_eq_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array[length][0], key)) {
  98729. return length;
  98730. }
  98731. }
  98732. return -1;
  98733. }
  98734. /* harmony default export */ __webpack_exports__["default"] = (assocIndexOf);
  98735. /***/ }),
  98736. /***/ "./node_modules/lodash-es/_baseAggregator.js":
  98737. /*!***************************************************!*\
  98738. !*** ./node_modules/lodash-es/_baseAggregator.js ***!
  98739. \***************************************************/
  98740. /*! exports provided: default */
  98741. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  98742. "use strict";
  98743. __webpack_require__.r(__webpack_exports__);
  98744. /* harmony import */ var _baseEach_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseEach.js */ "./node_modules/lodash-es/_baseEach.js");
  98745. /**
  98746. * Aggregates elements of `collection` on `accumulator` with keys transformed
  98747. * by `iteratee` and values set by `setter`.
  98748. *
  98749. * @private
  98750. * @param {Array|Object} collection The collection to iterate over.
  98751. * @param {Function} setter The function to set `accumulator` values.
  98752. * @param {Function} iteratee The iteratee to transform keys.
  98753. * @param {Object} accumulator The initial aggregated object.
  98754. * @returns {Function} Returns `accumulator`.
  98755. */
  98756. function baseAggregator(collection, setter, iteratee, accumulator) {
  98757. Object(_baseEach_js__WEBPACK_IMPORTED_MODULE_0__["default"])(collection, function(value, key, collection) {
  98758. setter(accumulator, value, iteratee(value), collection);
  98759. });
  98760. return accumulator;
  98761. }
  98762. /* harmony default export */ __webpack_exports__["default"] = (baseAggregator);
  98763. /***/ }),
  98764. /***/ "./node_modules/lodash-es/_baseAssign.js":
  98765. /*!***********************************************!*\
  98766. !*** ./node_modules/lodash-es/_baseAssign.js ***!
  98767. \***********************************************/
  98768. /*! exports provided: default */
  98769. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  98770. "use strict";
  98771. __webpack_require__.r(__webpack_exports__);
  98772. /* harmony import */ var _copyObject_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_copyObject.js */ "./node_modules/lodash-es/_copyObject.js");
  98773. /* harmony import */ var _keys_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./keys.js */ "./node_modules/lodash-es/keys.js");
  98774. /**
  98775. * The base implementation of `_.assign` without support for multiple sources
  98776. * or `customizer` functions.
  98777. *
  98778. * @private
  98779. * @param {Object} object The destination object.
  98780. * @param {Object} source The source object.
  98781. * @returns {Object} Returns `object`.
  98782. */
  98783. function baseAssign(object, source) {
  98784. return object && Object(_copyObject_js__WEBPACK_IMPORTED_MODULE_0__["default"])(source, Object(_keys_js__WEBPACK_IMPORTED_MODULE_1__["default"])(source), object);
  98785. }
  98786. /* harmony default export */ __webpack_exports__["default"] = (baseAssign);
  98787. /***/ }),
  98788. /***/ "./node_modules/lodash-es/_baseAssignIn.js":
  98789. /*!*************************************************!*\
  98790. !*** ./node_modules/lodash-es/_baseAssignIn.js ***!
  98791. \*************************************************/
  98792. /*! exports provided: default */
  98793. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  98794. "use strict";
  98795. __webpack_require__.r(__webpack_exports__);
  98796. /* harmony import */ var _copyObject_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_copyObject.js */ "./node_modules/lodash-es/_copyObject.js");
  98797. /* harmony import */ var _keysIn_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./keysIn.js */ "./node_modules/lodash-es/keysIn.js");
  98798. /**
  98799. * The base implementation of `_.assignIn` without support for multiple sources
  98800. * or `customizer` functions.
  98801. *
  98802. * @private
  98803. * @param {Object} object The destination object.
  98804. * @param {Object} source The source object.
  98805. * @returns {Object} Returns `object`.
  98806. */
  98807. function baseAssignIn(object, source) {
  98808. return object && Object(_copyObject_js__WEBPACK_IMPORTED_MODULE_0__["default"])(source, Object(_keysIn_js__WEBPACK_IMPORTED_MODULE_1__["default"])(source), object);
  98809. }
  98810. /* harmony default export */ __webpack_exports__["default"] = (baseAssignIn);
  98811. /***/ }),
  98812. /***/ "./node_modules/lodash-es/_baseAssignValue.js":
  98813. /*!****************************************************!*\
  98814. !*** ./node_modules/lodash-es/_baseAssignValue.js ***!
  98815. \****************************************************/
  98816. /*! exports provided: default */
  98817. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  98818. "use strict";
  98819. __webpack_require__.r(__webpack_exports__);
  98820. /* harmony import */ var _defineProperty_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_defineProperty.js */ "./node_modules/lodash-es/_defineProperty.js");
  98821. /**
  98822. * The base implementation of `assignValue` and `assignMergeValue` without
  98823. * value checks.
  98824. *
  98825. * @private
  98826. * @param {Object} object The object to modify.
  98827. * @param {string} key The key of the property to assign.
  98828. * @param {*} value The value to assign.
  98829. */
  98830. function baseAssignValue(object, key, value) {
  98831. if (key == '__proto__' && _defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"]) {
  98832. Object(_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, key, {
  98833. 'configurable': true,
  98834. 'enumerable': true,
  98835. 'value': value,
  98836. 'writable': true
  98837. });
  98838. } else {
  98839. object[key] = value;
  98840. }
  98841. }
  98842. /* harmony default export */ __webpack_exports__["default"] = (baseAssignValue);
  98843. /***/ }),
  98844. /***/ "./node_modules/lodash-es/_baseAt.js":
  98845. /*!*******************************************!*\
  98846. !*** ./node_modules/lodash-es/_baseAt.js ***!
  98847. \*******************************************/
  98848. /*! exports provided: default */
  98849. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  98850. "use strict";
  98851. __webpack_require__.r(__webpack_exports__);
  98852. /* harmony import */ var _get_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./get.js */ "./node_modules/lodash-es/get.js");
  98853. /**
  98854. * The base implementation of `_.at` without support for individual paths.
  98855. *
  98856. * @private
  98857. * @param {Object} object The object to iterate over.
  98858. * @param {string[]} paths The property paths to pick.
  98859. * @returns {Array} Returns the picked elements.
  98860. */
  98861. function baseAt(object, paths) {
  98862. var index = -1,
  98863. length = paths.length,
  98864. result = Array(length),
  98865. skip = object == null;
  98866. while (++index < length) {
  98867. result[index] = skip ? undefined : Object(_get_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, paths[index]);
  98868. }
  98869. return result;
  98870. }
  98871. /* harmony default export */ __webpack_exports__["default"] = (baseAt);
  98872. /***/ }),
  98873. /***/ "./node_modules/lodash-es/_baseClamp.js":
  98874. /*!**********************************************!*\
  98875. !*** ./node_modules/lodash-es/_baseClamp.js ***!
  98876. \**********************************************/
  98877. /*! exports provided: default */
  98878. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  98879. "use strict";
  98880. __webpack_require__.r(__webpack_exports__);
  98881. /**
  98882. * The base implementation of `_.clamp` which doesn't coerce arguments.
  98883. *
  98884. * @private
  98885. * @param {number} number The number to clamp.
  98886. * @param {number} [lower] The lower bound.
  98887. * @param {number} upper The upper bound.
  98888. * @returns {number} Returns the clamped number.
  98889. */
  98890. function baseClamp(number, lower, upper) {
  98891. if (number === number) {
  98892. if (upper !== undefined) {
  98893. number = number <= upper ? number : upper;
  98894. }
  98895. if (lower !== undefined) {
  98896. number = number >= lower ? number : lower;
  98897. }
  98898. }
  98899. return number;
  98900. }
  98901. /* harmony default export */ __webpack_exports__["default"] = (baseClamp);
  98902. /***/ }),
  98903. /***/ "./node_modules/lodash-es/_baseClone.js":
  98904. /*!**********************************************!*\
  98905. !*** ./node_modules/lodash-es/_baseClone.js ***!
  98906. \**********************************************/
  98907. /*! exports provided: default */
  98908. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  98909. "use strict";
  98910. __webpack_require__.r(__webpack_exports__);
  98911. /* harmony import */ var _Stack_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_Stack.js */ "./node_modules/lodash-es/_Stack.js");
  98912. /* harmony import */ var _arrayEach_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_arrayEach.js */ "./node_modules/lodash-es/_arrayEach.js");
  98913. /* harmony import */ var _assignValue_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_assignValue.js */ "./node_modules/lodash-es/_assignValue.js");
  98914. /* harmony import */ var _baseAssign_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_baseAssign.js */ "./node_modules/lodash-es/_baseAssign.js");
  98915. /* harmony import */ var _baseAssignIn_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_baseAssignIn.js */ "./node_modules/lodash-es/_baseAssignIn.js");
  98916. /* harmony import */ var _cloneBuffer_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./_cloneBuffer.js */ "./node_modules/lodash-es/_cloneBuffer.js");
  98917. /* harmony import */ var _copyArray_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./_copyArray.js */ "./node_modules/lodash-es/_copyArray.js");
  98918. /* harmony import */ var _copySymbols_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./_copySymbols.js */ "./node_modules/lodash-es/_copySymbols.js");
  98919. /* harmony import */ var _copySymbolsIn_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./_copySymbolsIn.js */ "./node_modules/lodash-es/_copySymbolsIn.js");
  98920. /* harmony import */ var _getAllKeys_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./_getAllKeys.js */ "./node_modules/lodash-es/_getAllKeys.js");
  98921. /* harmony import */ var _getAllKeysIn_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./_getAllKeysIn.js */ "./node_modules/lodash-es/_getAllKeysIn.js");
  98922. /* harmony import */ var _getTag_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./_getTag.js */ "./node_modules/lodash-es/_getTag.js");
  98923. /* harmony import */ var _initCloneArray_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./_initCloneArray.js */ "./node_modules/lodash-es/_initCloneArray.js");
  98924. /* harmony import */ var _initCloneByTag_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./_initCloneByTag.js */ "./node_modules/lodash-es/_initCloneByTag.js");
  98925. /* harmony import */ var _initCloneObject_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./_initCloneObject.js */ "./node_modules/lodash-es/_initCloneObject.js");
  98926. /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
  98927. /* harmony import */ var _isBuffer_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./isBuffer.js */ "./node_modules/lodash-es/isBuffer.js");
  98928. /* harmony import */ var _isMap_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./isMap.js */ "./node_modules/lodash-es/isMap.js");
  98929. /* harmony import */ var _isObject_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./isObject.js */ "./node_modules/lodash-es/isObject.js");
  98930. /* harmony import */ var _isSet_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./isSet.js */ "./node_modules/lodash-es/isSet.js");
  98931. /* harmony import */ var _keys_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./keys.js */ "./node_modules/lodash-es/keys.js");
  98932. /* harmony import */ var _keysIn_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./keysIn.js */ "./node_modules/lodash-es/keysIn.js");
  98933. /** Used to compose bitmasks for cloning. */
  98934. var CLONE_DEEP_FLAG = 1,
  98935. CLONE_FLAT_FLAG = 2,
  98936. CLONE_SYMBOLS_FLAG = 4;
  98937. /** `Object#toString` result references. */
  98938. var argsTag = '[object Arguments]',
  98939. arrayTag = '[object Array]',
  98940. boolTag = '[object Boolean]',
  98941. dateTag = '[object Date]',
  98942. errorTag = '[object Error]',
  98943. funcTag = '[object Function]',
  98944. genTag = '[object GeneratorFunction]',
  98945. mapTag = '[object Map]',
  98946. numberTag = '[object Number]',
  98947. objectTag = '[object Object]',
  98948. regexpTag = '[object RegExp]',
  98949. setTag = '[object Set]',
  98950. stringTag = '[object String]',
  98951. symbolTag = '[object Symbol]',
  98952. weakMapTag = '[object WeakMap]';
  98953. var arrayBufferTag = '[object ArrayBuffer]',
  98954. dataViewTag = '[object DataView]',
  98955. float32Tag = '[object Float32Array]',
  98956. float64Tag = '[object Float64Array]',
  98957. int8Tag = '[object Int8Array]',
  98958. int16Tag = '[object Int16Array]',
  98959. int32Tag = '[object Int32Array]',
  98960. uint8Tag = '[object Uint8Array]',
  98961. uint8ClampedTag = '[object Uint8ClampedArray]',
  98962. uint16Tag = '[object Uint16Array]',
  98963. uint32Tag = '[object Uint32Array]';
  98964. /** Used to identify `toStringTag` values supported by `_.clone`. */
  98965. var cloneableTags = {};
  98966. cloneableTags[argsTag] = cloneableTags[arrayTag] =
  98967. cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =
  98968. cloneableTags[boolTag] = cloneableTags[dateTag] =
  98969. cloneableTags[float32Tag] = cloneableTags[float64Tag] =
  98970. cloneableTags[int8Tag] = cloneableTags[int16Tag] =
  98971. cloneableTags[int32Tag] = cloneableTags[mapTag] =
  98972. cloneableTags[numberTag] = cloneableTags[objectTag] =
  98973. cloneableTags[regexpTag] = cloneableTags[setTag] =
  98974. cloneableTags[stringTag] = cloneableTags[symbolTag] =
  98975. cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =
  98976. cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
  98977. cloneableTags[errorTag] = cloneableTags[funcTag] =
  98978. cloneableTags[weakMapTag] = false;
  98979. /**
  98980. * The base implementation of `_.clone` and `_.cloneDeep` which tracks
  98981. * traversed objects.
  98982. *
  98983. * @private
  98984. * @param {*} value The value to clone.
  98985. * @param {boolean} bitmask The bitmask flags.
  98986. * 1 - Deep clone
  98987. * 2 - Flatten inherited properties
  98988. * 4 - Clone symbols
  98989. * @param {Function} [customizer] The function to customize cloning.
  98990. * @param {string} [key] The key of `value`.
  98991. * @param {Object} [object] The parent object of `value`.
  98992. * @param {Object} [stack] Tracks traversed objects and their clone counterparts.
  98993. * @returns {*} Returns the cloned value.
  98994. */
  98995. function baseClone(value, bitmask, customizer, key, object, stack) {
  98996. var result,
  98997. isDeep = bitmask & CLONE_DEEP_FLAG,
  98998. isFlat = bitmask & CLONE_FLAT_FLAG,
  98999. isFull = bitmask & CLONE_SYMBOLS_FLAG;
  99000. if (customizer) {
  99001. result = object ? customizer(value, key, object, stack) : customizer(value);
  99002. }
  99003. if (result !== undefined) {
  99004. return result;
  99005. }
  99006. if (!Object(_isObject_js__WEBPACK_IMPORTED_MODULE_18__["default"])(value)) {
  99007. return value;
  99008. }
  99009. var isArr = Object(_isArray_js__WEBPACK_IMPORTED_MODULE_15__["default"])(value);
  99010. if (isArr) {
  99011. result = Object(_initCloneArray_js__WEBPACK_IMPORTED_MODULE_12__["default"])(value);
  99012. if (!isDeep) {
  99013. return Object(_copyArray_js__WEBPACK_IMPORTED_MODULE_6__["default"])(value, result);
  99014. }
  99015. } else {
  99016. var tag = Object(_getTag_js__WEBPACK_IMPORTED_MODULE_11__["default"])(value),
  99017. isFunc = tag == funcTag || tag == genTag;
  99018. if (Object(_isBuffer_js__WEBPACK_IMPORTED_MODULE_16__["default"])(value)) {
  99019. return Object(_cloneBuffer_js__WEBPACK_IMPORTED_MODULE_5__["default"])(value, isDeep);
  99020. }
  99021. if (tag == objectTag || tag == argsTag || (isFunc && !object)) {
  99022. result = (isFlat || isFunc) ? {} : Object(_initCloneObject_js__WEBPACK_IMPORTED_MODULE_14__["default"])(value);
  99023. if (!isDeep) {
  99024. return isFlat
  99025. ? Object(_copySymbolsIn_js__WEBPACK_IMPORTED_MODULE_8__["default"])(value, Object(_baseAssignIn_js__WEBPACK_IMPORTED_MODULE_4__["default"])(result, value))
  99026. : Object(_copySymbols_js__WEBPACK_IMPORTED_MODULE_7__["default"])(value, Object(_baseAssign_js__WEBPACK_IMPORTED_MODULE_3__["default"])(result, value));
  99027. }
  99028. } else {
  99029. if (!cloneableTags[tag]) {
  99030. return object ? value : {};
  99031. }
  99032. result = Object(_initCloneByTag_js__WEBPACK_IMPORTED_MODULE_13__["default"])(value, tag, isDeep);
  99033. }
  99034. }
  99035. // Check for circular references and return its corresponding clone.
  99036. stack || (stack = new _Stack_js__WEBPACK_IMPORTED_MODULE_0__["default"]);
  99037. var stacked = stack.get(value);
  99038. if (stacked) {
  99039. return stacked;
  99040. }
  99041. stack.set(value, result);
  99042. if (Object(_isSet_js__WEBPACK_IMPORTED_MODULE_19__["default"])(value)) {
  99043. value.forEach(function(subValue) {
  99044. result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));
  99045. });
  99046. } else if (Object(_isMap_js__WEBPACK_IMPORTED_MODULE_17__["default"])(value)) {
  99047. value.forEach(function(subValue, key) {
  99048. result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));
  99049. });
  99050. }
  99051. var keysFunc = isFull
  99052. ? (isFlat ? _getAllKeysIn_js__WEBPACK_IMPORTED_MODULE_10__["default"] : _getAllKeys_js__WEBPACK_IMPORTED_MODULE_9__["default"])
  99053. : (isFlat ? _keysIn_js__WEBPACK_IMPORTED_MODULE_21__["default"] : _keys_js__WEBPACK_IMPORTED_MODULE_20__["default"]);
  99054. var props = isArr ? undefined : keysFunc(value);
  99055. Object(_arrayEach_js__WEBPACK_IMPORTED_MODULE_1__["default"])(props || value, function(subValue, key) {
  99056. if (props) {
  99057. key = subValue;
  99058. subValue = value[key];
  99059. }
  99060. // Recursively populate clone (susceptible to call stack limits).
  99061. Object(_assignValue_js__WEBPACK_IMPORTED_MODULE_2__["default"])(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));
  99062. });
  99063. return result;
  99064. }
  99065. /* harmony default export */ __webpack_exports__["default"] = (baseClone);
  99066. /***/ }),
  99067. /***/ "./node_modules/lodash-es/_baseConforms.js":
  99068. /*!*************************************************!*\
  99069. !*** ./node_modules/lodash-es/_baseConforms.js ***!
  99070. \*************************************************/
  99071. /*! exports provided: default */
  99072. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  99073. "use strict";
  99074. __webpack_require__.r(__webpack_exports__);
  99075. /* harmony import */ var _baseConformsTo_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseConformsTo.js */ "./node_modules/lodash-es/_baseConformsTo.js");
  99076. /* harmony import */ var _keys_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./keys.js */ "./node_modules/lodash-es/keys.js");
  99077. /**
  99078. * The base implementation of `_.conforms` which doesn't clone `source`.
  99079. *
  99080. * @private
  99081. * @param {Object} source The object of property predicates to conform to.
  99082. * @returns {Function} Returns the new spec function.
  99083. */
  99084. function baseConforms(source) {
  99085. var props = Object(_keys_js__WEBPACK_IMPORTED_MODULE_1__["default"])(source);
  99086. return function(object) {
  99087. return Object(_baseConformsTo_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, source, props);
  99088. };
  99089. }
  99090. /* harmony default export */ __webpack_exports__["default"] = (baseConforms);
  99091. /***/ }),
  99092. /***/ "./node_modules/lodash-es/_baseConformsTo.js":
  99093. /*!***************************************************!*\
  99094. !*** ./node_modules/lodash-es/_baseConformsTo.js ***!
  99095. \***************************************************/
  99096. /*! exports provided: default */
  99097. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  99098. "use strict";
  99099. __webpack_require__.r(__webpack_exports__);
  99100. /**
  99101. * The base implementation of `_.conformsTo` which accepts `props` to check.
  99102. *
  99103. * @private
  99104. * @param {Object} object The object to inspect.
  99105. * @param {Object} source The object of property predicates to conform to.
  99106. * @returns {boolean} Returns `true` if `object` conforms, else `false`.
  99107. */
  99108. function baseConformsTo(object, source, props) {
  99109. var length = props.length;
  99110. if (object == null) {
  99111. return !length;
  99112. }
  99113. object = Object(object);
  99114. while (length--) {
  99115. var key = props[length],
  99116. predicate = source[key],
  99117. value = object[key];
  99118. if ((value === undefined && !(key in object)) || !predicate(value)) {
  99119. return false;
  99120. }
  99121. }
  99122. return true;
  99123. }
  99124. /* harmony default export */ __webpack_exports__["default"] = (baseConformsTo);
  99125. /***/ }),
  99126. /***/ "./node_modules/lodash-es/_baseCreate.js":
  99127. /*!***********************************************!*\
  99128. !*** ./node_modules/lodash-es/_baseCreate.js ***!
  99129. \***********************************************/
  99130. /*! exports provided: default */
  99131. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  99132. "use strict";
  99133. __webpack_require__.r(__webpack_exports__);
  99134. /* harmony import */ var _isObject_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isObject.js */ "./node_modules/lodash-es/isObject.js");
  99135. /** Built-in value references. */
  99136. var objectCreate = Object.create;
  99137. /**
  99138. * The base implementation of `_.create` without support for assigning
  99139. * properties to the created object.
  99140. *
  99141. * @private
  99142. * @param {Object} proto The object to inherit from.
  99143. * @returns {Object} Returns the new object.
  99144. */
  99145. var baseCreate = (function() {
  99146. function object() {}
  99147. return function(proto) {
  99148. if (!Object(_isObject_js__WEBPACK_IMPORTED_MODULE_0__["default"])(proto)) {
  99149. return {};
  99150. }
  99151. if (objectCreate) {
  99152. return objectCreate(proto);
  99153. }
  99154. object.prototype = proto;
  99155. var result = new object;
  99156. object.prototype = undefined;
  99157. return result;
  99158. };
  99159. }());
  99160. /* harmony default export */ __webpack_exports__["default"] = (baseCreate);
  99161. /***/ }),
  99162. /***/ "./node_modules/lodash-es/_baseDelay.js":
  99163. /*!**********************************************!*\
  99164. !*** ./node_modules/lodash-es/_baseDelay.js ***!
  99165. \**********************************************/
  99166. /*! exports provided: default */
  99167. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  99168. "use strict";
  99169. __webpack_require__.r(__webpack_exports__);
  99170. /** Error message constants. */
  99171. var FUNC_ERROR_TEXT = 'Expected a function';
  99172. /**
  99173. * The base implementation of `_.delay` and `_.defer` which accepts `args`
  99174. * to provide to `func`.
  99175. *
  99176. * @private
  99177. * @param {Function} func The function to delay.
  99178. * @param {number} wait The number of milliseconds to delay invocation.
  99179. * @param {Array} args The arguments to provide to `func`.
  99180. * @returns {number|Object} Returns the timer id or timeout object.
  99181. */
  99182. function baseDelay(func, wait, args) {
  99183. if (typeof func != 'function') {
  99184. throw new TypeError(FUNC_ERROR_TEXT);
  99185. }
  99186. return setTimeout(function() { func.apply(undefined, args); }, wait);
  99187. }
  99188. /* harmony default export */ __webpack_exports__["default"] = (baseDelay);
  99189. /***/ }),
  99190. /***/ "./node_modules/lodash-es/_baseDifference.js":
  99191. /*!***************************************************!*\
  99192. !*** ./node_modules/lodash-es/_baseDifference.js ***!
  99193. \***************************************************/
  99194. /*! exports provided: default */
  99195. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  99196. "use strict";
  99197. __webpack_require__.r(__webpack_exports__);
  99198. /* harmony import */ var _SetCache_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_SetCache.js */ "./node_modules/lodash-es/_SetCache.js");
  99199. /* harmony import */ var _arrayIncludes_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_arrayIncludes.js */ "./node_modules/lodash-es/_arrayIncludes.js");
  99200. /* harmony import */ var _arrayIncludesWith_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_arrayIncludesWith.js */ "./node_modules/lodash-es/_arrayIncludesWith.js");
  99201. /* harmony import */ var _arrayMap_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_arrayMap.js */ "./node_modules/lodash-es/_arrayMap.js");
  99202. /* harmony import */ var _baseUnary_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_baseUnary.js */ "./node_modules/lodash-es/_baseUnary.js");
  99203. /* harmony import */ var _cacheHas_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./_cacheHas.js */ "./node_modules/lodash-es/_cacheHas.js");
  99204. /** Used as the size to enable large array optimizations. */
  99205. var LARGE_ARRAY_SIZE = 200;
  99206. /**
  99207. * The base implementation of methods like `_.difference` without support
  99208. * for excluding multiple arrays or iteratee shorthands.
  99209. *
  99210. * @private
  99211. * @param {Array} array The array to inspect.
  99212. * @param {Array} values The values to exclude.
  99213. * @param {Function} [iteratee] The iteratee invoked per element.
  99214. * @param {Function} [comparator] The comparator invoked per element.
  99215. * @returns {Array} Returns the new array of filtered values.
  99216. */
  99217. function baseDifference(array, values, iteratee, comparator) {
  99218. var index = -1,
  99219. includes = _arrayIncludes_js__WEBPACK_IMPORTED_MODULE_1__["default"],
  99220. isCommon = true,
  99221. length = array.length,
  99222. result = [],
  99223. valuesLength = values.length;
  99224. if (!length) {
  99225. return result;
  99226. }
  99227. if (iteratee) {
  99228. values = Object(_arrayMap_js__WEBPACK_IMPORTED_MODULE_3__["default"])(values, Object(_baseUnary_js__WEBPACK_IMPORTED_MODULE_4__["default"])(iteratee));
  99229. }
  99230. if (comparator) {
  99231. includes = _arrayIncludesWith_js__WEBPACK_IMPORTED_MODULE_2__["default"];
  99232. isCommon = false;
  99233. }
  99234. else if (values.length >= LARGE_ARRAY_SIZE) {
  99235. includes = _cacheHas_js__WEBPACK_IMPORTED_MODULE_5__["default"];
  99236. isCommon = false;
  99237. values = new _SetCache_js__WEBPACK_IMPORTED_MODULE_0__["default"](values);
  99238. }
  99239. outer:
  99240. while (++index < length) {
  99241. var value = array[index],
  99242. computed = iteratee == null ? value : iteratee(value);
  99243. value = (comparator || value !== 0) ? value : 0;
  99244. if (isCommon && computed === computed) {
  99245. var valuesIndex = valuesLength;
  99246. while (valuesIndex--) {
  99247. if (values[valuesIndex] === computed) {
  99248. continue outer;
  99249. }
  99250. }
  99251. result.push(value);
  99252. }
  99253. else if (!includes(values, computed, comparator)) {
  99254. result.push(value);
  99255. }
  99256. }
  99257. return result;
  99258. }
  99259. /* harmony default export */ __webpack_exports__["default"] = (baseDifference);
  99260. /***/ }),
  99261. /***/ "./node_modules/lodash-es/_baseEach.js":
  99262. /*!*********************************************!*\
  99263. !*** ./node_modules/lodash-es/_baseEach.js ***!
  99264. \*********************************************/
  99265. /*! exports provided: default */
  99266. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  99267. "use strict";
  99268. __webpack_require__.r(__webpack_exports__);
  99269. /* harmony import */ var _baseForOwn_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseForOwn.js */ "./node_modules/lodash-es/_baseForOwn.js");
  99270. /* harmony import */ var _createBaseEach_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_createBaseEach.js */ "./node_modules/lodash-es/_createBaseEach.js");
  99271. /**
  99272. * The base implementation of `_.forEach` without support for iteratee shorthands.
  99273. *
  99274. * @private
  99275. * @param {Array|Object} collection The collection to iterate over.
  99276. * @param {Function} iteratee The function invoked per iteration.
  99277. * @returns {Array|Object} Returns `collection`.
  99278. */
  99279. var baseEach = Object(_createBaseEach_js__WEBPACK_IMPORTED_MODULE_1__["default"])(_baseForOwn_js__WEBPACK_IMPORTED_MODULE_0__["default"]);
  99280. /* harmony default export */ __webpack_exports__["default"] = (baseEach);
  99281. /***/ }),
  99282. /***/ "./node_modules/lodash-es/_baseEachRight.js":
  99283. /*!**************************************************!*\
  99284. !*** ./node_modules/lodash-es/_baseEachRight.js ***!
  99285. \**************************************************/
  99286. /*! exports provided: default */
  99287. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  99288. "use strict";
  99289. __webpack_require__.r(__webpack_exports__);
  99290. /* harmony import */ var _baseForOwnRight_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseForOwnRight.js */ "./node_modules/lodash-es/_baseForOwnRight.js");
  99291. /* harmony import */ var _createBaseEach_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_createBaseEach.js */ "./node_modules/lodash-es/_createBaseEach.js");
  99292. /**
  99293. * The base implementation of `_.forEachRight` without support for iteratee shorthands.
  99294. *
  99295. * @private
  99296. * @param {Array|Object} collection The collection to iterate over.
  99297. * @param {Function} iteratee The function invoked per iteration.
  99298. * @returns {Array|Object} Returns `collection`.
  99299. */
  99300. var baseEachRight = Object(_createBaseEach_js__WEBPACK_IMPORTED_MODULE_1__["default"])(_baseForOwnRight_js__WEBPACK_IMPORTED_MODULE_0__["default"], true);
  99301. /* harmony default export */ __webpack_exports__["default"] = (baseEachRight);
  99302. /***/ }),
  99303. /***/ "./node_modules/lodash-es/_baseEvery.js":
  99304. /*!**********************************************!*\
  99305. !*** ./node_modules/lodash-es/_baseEvery.js ***!
  99306. \**********************************************/
  99307. /*! exports provided: default */
  99308. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  99309. "use strict";
  99310. __webpack_require__.r(__webpack_exports__);
  99311. /* harmony import */ var _baseEach_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseEach.js */ "./node_modules/lodash-es/_baseEach.js");
  99312. /**
  99313. * The base implementation of `_.every` without support for iteratee shorthands.
  99314. *
  99315. * @private
  99316. * @param {Array|Object} collection The collection to iterate over.
  99317. * @param {Function} predicate The function invoked per iteration.
  99318. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  99319. * else `false`
  99320. */
  99321. function baseEvery(collection, predicate) {
  99322. var result = true;
  99323. Object(_baseEach_js__WEBPACK_IMPORTED_MODULE_0__["default"])(collection, function(value, index, collection) {
  99324. result = !!predicate(value, index, collection);
  99325. return result;
  99326. });
  99327. return result;
  99328. }
  99329. /* harmony default export */ __webpack_exports__["default"] = (baseEvery);
  99330. /***/ }),
  99331. /***/ "./node_modules/lodash-es/_baseExtremum.js":
  99332. /*!*************************************************!*\
  99333. !*** ./node_modules/lodash-es/_baseExtremum.js ***!
  99334. \*************************************************/
  99335. /*! exports provided: default */
  99336. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  99337. "use strict";
  99338. __webpack_require__.r(__webpack_exports__);
  99339. /* harmony import */ var _isSymbol_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isSymbol.js */ "./node_modules/lodash-es/isSymbol.js");
  99340. /**
  99341. * The base implementation of methods like `_.max` and `_.min` which accepts a
  99342. * `comparator` to determine the extremum value.
  99343. *
  99344. * @private
  99345. * @param {Array} array The array to iterate over.
  99346. * @param {Function} iteratee The iteratee invoked per iteration.
  99347. * @param {Function} comparator The comparator used to compare values.
  99348. * @returns {*} Returns the extremum value.
  99349. */
  99350. function baseExtremum(array, iteratee, comparator) {
  99351. var index = -1,
  99352. length = array.length;
  99353. while (++index < length) {
  99354. var value = array[index],
  99355. current = iteratee(value);
  99356. if (current != null && (computed === undefined
  99357. ? (current === current && !Object(_isSymbol_js__WEBPACK_IMPORTED_MODULE_0__["default"])(current))
  99358. : comparator(current, computed)
  99359. )) {
  99360. var computed = current,
  99361. result = value;
  99362. }
  99363. }
  99364. return result;
  99365. }
  99366. /* harmony default export */ __webpack_exports__["default"] = (baseExtremum);
  99367. /***/ }),
  99368. /***/ "./node_modules/lodash-es/_baseFill.js":
  99369. /*!*********************************************!*\
  99370. !*** ./node_modules/lodash-es/_baseFill.js ***!
  99371. \*********************************************/
  99372. /*! exports provided: default */
  99373. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  99374. "use strict";
  99375. __webpack_require__.r(__webpack_exports__);
  99376. /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
  99377. /* harmony import */ var _toLength_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./toLength.js */ "./node_modules/lodash-es/toLength.js");
  99378. /**
  99379. * The base implementation of `_.fill` without an iteratee call guard.
  99380. *
  99381. * @private
  99382. * @param {Array} array The array to fill.
  99383. * @param {*} value The value to fill `array` with.
  99384. * @param {number} [start=0] The start position.
  99385. * @param {number} [end=array.length] The end position.
  99386. * @returns {Array} Returns `array`.
  99387. */
  99388. function baseFill(array, value, start, end) {
  99389. var length = array.length;
  99390. start = Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_0__["default"])(start);
  99391. if (start < 0) {
  99392. start = -start > length ? 0 : (length + start);
  99393. }
  99394. end = (end === undefined || end > length) ? length : Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_0__["default"])(end);
  99395. if (end < 0) {
  99396. end += length;
  99397. }
  99398. end = start > end ? 0 : Object(_toLength_js__WEBPACK_IMPORTED_MODULE_1__["default"])(end);
  99399. while (start < end) {
  99400. array[start++] = value;
  99401. }
  99402. return array;
  99403. }
  99404. /* harmony default export */ __webpack_exports__["default"] = (baseFill);
  99405. /***/ }),
  99406. /***/ "./node_modules/lodash-es/_baseFilter.js":
  99407. /*!***********************************************!*\
  99408. !*** ./node_modules/lodash-es/_baseFilter.js ***!
  99409. \***********************************************/
  99410. /*! exports provided: default */
  99411. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  99412. "use strict";
  99413. __webpack_require__.r(__webpack_exports__);
  99414. /* harmony import */ var _baseEach_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseEach.js */ "./node_modules/lodash-es/_baseEach.js");
  99415. /**
  99416. * The base implementation of `_.filter` without support for iteratee shorthands.
  99417. *
  99418. * @private
  99419. * @param {Array|Object} collection The collection to iterate over.
  99420. * @param {Function} predicate The function invoked per iteration.
  99421. * @returns {Array} Returns the new filtered array.
  99422. */
  99423. function baseFilter(collection, predicate) {
  99424. var result = [];
  99425. Object(_baseEach_js__WEBPACK_IMPORTED_MODULE_0__["default"])(collection, function(value, index, collection) {
  99426. if (predicate(value, index, collection)) {
  99427. result.push(value);
  99428. }
  99429. });
  99430. return result;
  99431. }
  99432. /* harmony default export */ __webpack_exports__["default"] = (baseFilter);
  99433. /***/ }),
  99434. /***/ "./node_modules/lodash-es/_baseFindIndex.js":
  99435. /*!**************************************************!*\
  99436. !*** ./node_modules/lodash-es/_baseFindIndex.js ***!
  99437. \**************************************************/
  99438. /*! exports provided: default */
  99439. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  99440. "use strict";
  99441. __webpack_require__.r(__webpack_exports__);
  99442. /**
  99443. * The base implementation of `_.findIndex` and `_.findLastIndex` without
  99444. * support for iteratee shorthands.
  99445. *
  99446. * @private
  99447. * @param {Array} array The array to inspect.
  99448. * @param {Function} predicate The function invoked per iteration.
  99449. * @param {number} fromIndex The index to search from.
  99450. * @param {boolean} [fromRight] Specify iterating from right to left.
  99451. * @returns {number} Returns the index of the matched value, else `-1`.
  99452. */
  99453. function baseFindIndex(array, predicate, fromIndex, fromRight) {
  99454. var length = array.length,
  99455. index = fromIndex + (fromRight ? 1 : -1);
  99456. while ((fromRight ? index-- : ++index < length)) {
  99457. if (predicate(array[index], index, array)) {
  99458. return index;
  99459. }
  99460. }
  99461. return -1;
  99462. }
  99463. /* harmony default export */ __webpack_exports__["default"] = (baseFindIndex);
  99464. /***/ }),
  99465. /***/ "./node_modules/lodash-es/_baseFindKey.js":
  99466. /*!************************************************!*\
  99467. !*** ./node_modules/lodash-es/_baseFindKey.js ***!
  99468. \************************************************/
  99469. /*! exports provided: default */
  99470. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  99471. "use strict";
  99472. __webpack_require__.r(__webpack_exports__);
  99473. /**
  99474. * The base implementation of methods like `_.findKey` and `_.findLastKey`,
  99475. * without support for iteratee shorthands, which iterates over `collection`
  99476. * using `eachFunc`.
  99477. *
  99478. * @private
  99479. * @param {Array|Object} collection The collection to inspect.
  99480. * @param {Function} predicate The function invoked per iteration.
  99481. * @param {Function} eachFunc The function to iterate over `collection`.
  99482. * @returns {*} Returns the found element or its key, else `undefined`.
  99483. */
  99484. function baseFindKey(collection, predicate, eachFunc) {
  99485. var result;
  99486. eachFunc(collection, function(value, key, collection) {
  99487. if (predicate(value, key, collection)) {
  99488. result = key;
  99489. return false;
  99490. }
  99491. });
  99492. return result;
  99493. }
  99494. /* harmony default export */ __webpack_exports__["default"] = (baseFindKey);
  99495. /***/ }),
  99496. /***/ "./node_modules/lodash-es/_baseFlatten.js":
  99497. /*!************************************************!*\
  99498. !*** ./node_modules/lodash-es/_baseFlatten.js ***!
  99499. \************************************************/
  99500. /*! exports provided: default */
  99501. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  99502. "use strict";
  99503. __webpack_require__.r(__webpack_exports__);
  99504. /* harmony import */ var _arrayPush_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayPush.js */ "./node_modules/lodash-es/_arrayPush.js");
  99505. /* harmony import */ var _isFlattenable_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_isFlattenable.js */ "./node_modules/lodash-es/_isFlattenable.js");
  99506. /**
  99507. * The base implementation of `_.flatten` with support for restricting flattening.
  99508. *
  99509. * @private
  99510. * @param {Array} array The array to flatten.
  99511. * @param {number} depth The maximum recursion depth.
  99512. * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.
  99513. * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.
  99514. * @param {Array} [result=[]] The initial result value.
  99515. * @returns {Array} Returns the new flattened array.
  99516. */
  99517. function baseFlatten(array, depth, predicate, isStrict, result) {
  99518. var index = -1,
  99519. length = array.length;
  99520. predicate || (predicate = _isFlattenable_js__WEBPACK_IMPORTED_MODULE_1__["default"]);
  99521. result || (result = []);
  99522. while (++index < length) {
  99523. var value = array[index];
  99524. if (depth > 0 && predicate(value)) {
  99525. if (depth > 1) {
  99526. // Recursively flatten arrays (susceptible to call stack limits).
  99527. baseFlatten(value, depth - 1, predicate, isStrict, result);
  99528. } else {
  99529. Object(_arrayPush_js__WEBPACK_IMPORTED_MODULE_0__["default"])(result, value);
  99530. }
  99531. } else if (!isStrict) {
  99532. result[result.length] = value;
  99533. }
  99534. }
  99535. return result;
  99536. }
  99537. /* harmony default export */ __webpack_exports__["default"] = (baseFlatten);
  99538. /***/ }),
  99539. /***/ "./node_modules/lodash-es/_baseFor.js":
  99540. /*!********************************************!*\
  99541. !*** ./node_modules/lodash-es/_baseFor.js ***!
  99542. \********************************************/
  99543. /*! exports provided: default */
  99544. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  99545. "use strict";
  99546. __webpack_require__.r(__webpack_exports__);
  99547. /* harmony import */ var _createBaseFor_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createBaseFor.js */ "./node_modules/lodash-es/_createBaseFor.js");
  99548. /**
  99549. * The base implementation of `baseForOwn` which iterates over `object`
  99550. * properties returned by `keysFunc` and invokes `iteratee` for each property.
  99551. * Iteratee functions may exit iteration early by explicitly returning `false`.
  99552. *
  99553. * @private
  99554. * @param {Object} object The object to iterate over.
  99555. * @param {Function} iteratee The function invoked per iteration.
  99556. * @param {Function} keysFunc The function to get the keys of `object`.
  99557. * @returns {Object} Returns `object`.
  99558. */
  99559. var baseFor = Object(_createBaseFor_js__WEBPACK_IMPORTED_MODULE_0__["default"])();
  99560. /* harmony default export */ __webpack_exports__["default"] = (baseFor);
  99561. /***/ }),
  99562. /***/ "./node_modules/lodash-es/_baseForOwn.js":
  99563. /*!***********************************************!*\
  99564. !*** ./node_modules/lodash-es/_baseForOwn.js ***!
  99565. \***********************************************/
  99566. /*! exports provided: default */
  99567. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  99568. "use strict";
  99569. __webpack_require__.r(__webpack_exports__);
  99570. /* harmony import */ var _baseFor_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseFor.js */ "./node_modules/lodash-es/_baseFor.js");
  99571. /* harmony import */ var _keys_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./keys.js */ "./node_modules/lodash-es/keys.js");
  99572. /**
  99573. * The base implementation of `_.forOwn` without support for iteratee shorthands.
  99574. *
  99575. * @private
  99576. * @param {Object} object The object to iterate over.
  99577. * @param {Function} iteratee The function invoked per iteration.
  99578. * @returns {Object} Returns `object`.
  99579. */
  99580. function baseForOwn(object, iteratee) {
  99581. return object && Object(_baseFor_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, iteratee, _keys_js__WEBPACK_IMPORTED_MODULE_1__["default"]);
  99582. }
  99583. /* harmony default export */ __webpack_exports__["default"] = (baseForOwn);
  99584. /***/ }),
  99585. /***/ "./node_modules/lodash-es/_baseForOwnRight.js":
  99586. /*!****************************************************!*\
  99587. !*** ./node_modules/lodash-es/_baseForOwnRight.js ***!
  99588. \****************************************************/
  99589. /*! exports provided: default */
  99590. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  99591. "use strict";
  99592. __webpack_require__.r(__webpack_exports__);
  99593. /* harmony import */ var _baseForRight_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseForRight.js */ "./node_modules/lodash-es/_baseForRight.js");
  99594. /* harmony import */ var _keys_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./keys.js */ "./node_modules/lodash-es/keys.js");
  99595. /**
  99596. * The base implementation of `_.forOwnRight` without support for iteratee shorthands.
  99597. *
  99598. * @private
  99599. * @param {Object} object The object to iterate over.
  99600. * @param {Function} iteratee The function invoked per iteration.
  99601. * @returns {Object} Returns `object`.
  99602. */
  99603. function baseForOwnRight(object, iteratee) {
  99604. return object && Object(_baseForRight_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, iteratee, _keys_js__WEBPACK_IMPORTED_MODULE_1__["default"]);
  99605. }
  99606. /* harmony default export */ __webpack_exports__["default"] = (baseForOwnRight);
  99607. /***/ }),
  99608. /***/ "./node_modules/lodash-es/_baseForRight.js":
  99609. /*!*************************************************!*\
  99610. !*** ./node_modules/lodash-es/_baseForRight.js ***!
  99611. \*************************************************/
  99612. /*! exports provided: default */
  99613. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  99614. "use strict";
  99615. __webpack_require__.r(__webpack_exports__);
  99616. /* harmony import */ var _createBaseFor_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createBaseFor.js */ "./node_modules/lodash-es/_createBaseFor.js");
  99617. /**
  99618. * This function is like `baseFor` except that it iterates over properties
  99619. * in the opposite order.
  99620. *
  99621. * @private
  99622. * @param {Object} object The object to iterate over.
  99623. * @param {Function} iteratee The function invoked per iteration.
  99624. * @param {Function} keysFunc The function to get the keys of `object`.
  99625. * @returns {Object} Returns `object`.
  99626. */
  99627. var baseForRight = Object(_createBaseFor_js__WEBPACK_IMPORTED_MODULE_0__["default"])(true);
  99628. /* harmony default export */ __webpack_exports__["default"] = (baseForRight);
  99629. /***/ }),
  99630. /***/ "./node_modules/lodash-es/_baseFunctions.js":
  99631. /*!**************************************************!*\
  99632. !*** ./node_modules/lodash-es/_baseFunctions.js ***!
  99633. \**************************************************/
  99634. /*! exports provided: default */
  99635. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  99636. "use strict";
  99637. __webpack_require__.r(__webpack_exports__);
  99638. /* harmony import */ var _arrayFilter_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayFilter.js */ "./node_modules/lodash-es/_arrayFilter.js");
  99639. /* harmony import */ var _isFunction_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isFunction.js */ "./node_modules/lodash-es/isFunction.js");
  99640. /**
  99641. * The base implementation of `_.functions` which creates an array of
  99642. * `object` function property names filtered from `props`.
  99643. *
  99644. * @private
  99645. * @param {Object} object The object to inspect.
  99646. * @param {Array} props The property names to filter.
  99647. * @returns {Array} Returns the function names.
  99648. */
  99649. function baseFunctions(object, props) {
  99650. return Object(_arrayFilter_js__WEBPACK_IMPORTED_MODULE_0__["default"])(props, function(key) {
  99651. return Object(_isFunction_js__WEBPACK_IMPORTED_MODULE_1__["default"])(object[key]);
  99652. });
  99653. }
  99654. /* harmony default export */ __webpack_exports__["default"] = (baseFunctions);
  99655. /***/ }),
  99656. /***/ "./node_modules/lodash-es/_baseGet.js":
  99657. /*!********************************************!*\
  99658. !*** ./node_modules/lodash-es/_baseGet.js ***!
  99659. \********************************************/
  99660. /*! exports provided: default */
  99661. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  99662. "use strict";
  99663. __webpack_require__.r(__webpack_exports__);
  99664. /* harmony import */ var _castPath_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_castPath.js */ "./node_modules/lodash-es/_castPath.js");
  99665. /* harmony import */ var _toKey_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_toKey.js */ "./node_modules/lodash-es/_toKey.js");
  99666. /**
  99667. * The base implementation of `_.get` without support for default values.
  99668. *
  99669. * @private
  99670. * @param {Object} object The object to query.
  99671. * @param {Array|string} path The path of the property to get.
  99672. * @returns {*} Returns the resolved value.
  99673. */
  99674. function baseGet(object, path) {
  99675. path = Object(_castPath_js__WEBPACK_IMPORTED_MODULE_0__["default"])(path, object);
  99676. var index = 0,
  99677. length = path.length;
  99678. while (object != null && index < length) {
  99679. object = object[Object(_toKey_js__WEBPACK_IMPORTED_MODULE_1__["default"])(path[index++])];
  99680. }
  99681. return (index && index == length) ? object : undefined;
  99682. }
  99683. /* harmony default export */ __webpack_exports__["default"] = (baseGet);
  99684. /***/ }),
  99685. /***/ "./node_modules/lodash-es/_baseGetAllKeys.js":
  99686. /*!***************************************************!*\
  99687. !*** ./node_modules/lodash-es/_baseGetAllKeys.js ***!
  99688. \***************************************************/
  99689. /*! exports provided: default */
  99690. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  99691. "use strict";
  99692. __webpack_require__.r(__webpack_exports__);
  99693. /* harmony import */ var _arrayPush_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayPush.js */ "./node_modules/lodash-es/_arrayPush.js");
  99694. /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
  99695. /**
  99696. * The base implementation of `getAllKeys` and `getAllKeysIn` which uses
  99697. * `keysFunc` and `symbolsFunc` to get the enumerable property names and
  99698. * symbols of `object`.
  99699. *
  99700. * @private
  99701. * @param {Object} object The object to query.
  99702. * @param {Function} keysFunc The function to get the keys of `object`.
  99703. * @param {Function} symbolsFunc The function to get the symbols of `object`.
  99704. * @returns {Array} Returns the array of property names and symbols.
  99705. */
  99706. function baseGetAllKeys(object, keysFunc, symbolsFunc) {
  99707. var result = keysFunc(object);
  99708. return Object(_isArray_js__WEBPACK_IMPORTED_MODULE_1__["default"])(object) ? result : Object(_arrayPush_js__WEBPACK_IMPORTED_MODULE_0__["default"])(result, symbolsFunc(object));
  99709. }
  99710. /* harmony default export */ __webpack_exports__["default"] = (baseGetAllKeys);
  99711. /***/ }),
  99712. /***/ "./node_modules/lodash-es/_baseGetTag.js":
  99713. /*!***********************************************!*\
  99714. !*** ./node_modules/lodash-es/_baseGetTag.js ***!
  99715. \***********************************************/
  99716. /*! exports provided: default */
  99717. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  99718. "use strict";
  99719. __webpack_require__.r(__webpack_exports__);
  99720. /* harmony import */ var _Symbol_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_Symbol.js */ "./node_modules/lodash-es/_Symbol.js");
  99721. /* harmony import */ var _getRawTag_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_getRawTag.js */ "./node_modules/lodash-es/_getRawTag.js");
  99722. /* harmony import */ var _objectToString_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_objectToString.js */ "./node_modules/lodash-es/_objectToString.js");
  99723. /** `Object#toString` result references. */
  99724. var nullTag = '[object Null]',
  99725. undefinedTag = '[object Undefined]';
  99726. /** Built-in value references. */
  99727. var symToStringTag = _Symbol_js__WEBPACK_IMPORTED_MODULE_0__["default"] ? _Symbol_js__WEBPACK_IMPORTED_MODULE_0__["default"].toStringTag : undefined;
  99728. /**
  99729. * The base implementation of `getTag` without fallbacks for buggy environments.
  99730. *
  99731. * @private
  99732. * @param {*} value The value to query.
  99733. * @returns {string} Returns the `toStringTag`.
  99734. */
  99735. function baseGetTag(value) {
  99736. if (value == null) {
  99737. return value === undefined ? undefinedTag : nullTag;
  99738. }
  99739. return (symToStringTag && symToStringTag in Object(value))
  99740. ? Object(_getRawTag_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value)
  99741. : Object(_objectToString_js__WEBPACK_IMPORTED_MODULE_2__["default"])(value);
  99742. }
  99743. /* harmony default export */ __webpack_exports__["default"] = (baseGetTag);
  99744. /***/ }),
  99745. /***/ "./node_modules/lodash-es/_baseGt.js":
  99746. /*!*******************************************!*\
  99747. !*** ./node_modules/lodash-es/_baseGt.js ***!
  99748. \*******************************************/
  99749. /*! exports provided: default */
  99750. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  99751. "use strict";
  99752. __webpack_require__.r(__webpack_exports__);
  99753. /**
  99754. * The base implementation of `_.gt` which doesn't coerce arguments.
  99755. *
  99756. * @private
  99757. * @param {*} value The value to compare.
  99758. * @param {*} other The other value to compare.
  99759. * @returns {boolean} Returns `true` if `value` is greater than `other`,
  99760. * else `false`.
  99761. */
  99762. function baseGt(value, other) {
  99763. return value > other;
  99764. }
  99765. /* harmony default export */ __webpack_exports__["default"] = (baseGt);
  99766. /***/ }),
  99767. /***/ "./node_modules/lodash-es/_baseHas.js":
  99768. /*!********************************************!*\
  99769. !*** ./node_modules/lodash-es/_baseHas.js ***!
  99770. \********************************************/
  99771. /*! exports provided: default */
  99772. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  99773. "use strict";
  99774. __webpack_require__.r(__webpack_exports__);
  99775. /** Used for built-in method references. */
  99776. var objectProto = Object.prototype;
  99777. /** Used to check objects for own properties. */
  99778. var hasOwnProperty = objectProto.hasOwnProperty;
  99779. /**
  99780. * The base implementation of `_.has` without support for deep paths.
  99781. *
  99782. * @private
  99783. * @param {Object} [object] The object to query.
  99784. * @param {Array|string} key The key to check.
  99785. * @returns {boolean} Returns `true` if `key` exists, else `false`.
  99786. */
  99787. function baseHas(object, key) {
  99788. return object != null && hasOwnProperty.call(object, key);
  99789. }
  99790. /* harmony default export */ __webpack_exports__["default"] = (baseHas);
  99791. /***/ }),
  99792. /***/ "./node_modules/lodash-es/_baseHasIn.js":
  99793. /*!**********************************************!*\
  99794. !*** ./node_modules/lodash-es/_baseHasIn.js ***!
  99795. \**********************************************/
  99796. /*! exports provided: default */
  99797. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  99798. "use strict";
  99799. __webpack_require__.r(__webpack_exports__);
  99800. /**
  99801. * The base implementation of `_.hasIn` without support for deep paths.
  99802. *
  99803. * @private
  99804. * @param {Object} [object] The object to query.
  99805. * @param {Array|string} key The key to check.
  99806. * @returns {boolean} Returns `true` if `key` exists, else `false`.
  99807. */
  99808. function baseHasIn(object, key) {
  99809. return object != null && key in Object(object);
  99810. }
  99811. /* harmony default export */ __webpack_exports__["default"] = (baseHasIn);
  99812. /***/ }),
  99813. /***/ "./node_modules/lodash-es/_baseInRange.js":
  99814. /*!************************************************!*\
  99815. !*** ./node_modules/lodash-es/_baseInRange.js ***!
  99816. \************************************************/
  99817. /*! exports provided: default */
  99818. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  99819. "use strict";
  99820. __webpack_require__.r(__webpack_exports__);
  99821. /* Built-in method references for those with the same name as other `lodash` methods. */
  99822. var nativeMax = Math.max,
  99823. nativeMin = Math.min;
  99824. /**
  99825. * The base implementation of `_.inRange` which doesn't coerce arguments.
  99826. *
  99827. * @private
  99828. * @param {number} number The number to check.
  99829. * @param {number} start The start of the range.
  99830. * @param {number} end The end of the range.
  99831. * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
  99832. */
  99833. function baseInRange(number, start, end) {
  99834. return number >= nativeMin(start, end) && number < nativeMax(start, end);
  99835. }
  99836. /* harmony default export */ __webpack_exports__["default"] = (baseInRange);
  99837. /***/ }),
  99838. /***/ "./node_modules/lodash-es/_baseIndexOf.js":
  99839. /*!************************************************!*\
  99840. !*** ./node_modules/lodash-es/_baseIndexOf.js ***!
  99841. \************************************************/
  99842. /*! exports provided: default */
  99843. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  99844. "use strict";
  99845. __webpack_require__.r(__webpack_exports__);
  99846. /* harmony import */ var _baseFindIndex_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseFindIndex.js */ "./node_modules/lodash-es/_baseFindIndex.js");
  99847. /* harmony import */ var _baseIsNaN_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseIsNaN.js */ "./node_modules/lodash-es/_baseIsNaN.js");
  99848. /* harmony import */ var _strictIndexOf_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_strictIndexOf.js */ "./node_modules/lodash-es/_strictIndexOf.js");
  99849. /**
  99850. * The base implementation of `_.indexOf` without `fromIndex` bounds checks.
  99851. *
  99852. * @private
  99853. * @param {Array} array The array to inspect.
  99854. * @param {*} value The value to search for.
  99855. * @param {number} fromIndex The index to search from.
  99856. * @returns {number} Returns the index of the matched value, else `-1`.
  99857. */
  99858. function baseIndexOf(array, value, fromIndex) {
  99859. return value === value
  99860. ? Object(_strictIndexOf_js__WEBPACK_IMPORTED_MODULE_2__["default"])(array, value, fromIndex)
  99861. : Object(_baseFindIndex_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, _baseIsNaN_js__WEBPACK_IMPORTED_MODULE_1__["default"], fromIndex);
  99862. }
  99863. /* harmony default export */ __webpack_exports__["default"] = (baseIndexOf);
  99864. /***/ }),
  99865. /***/ "./node_modules/lodash-es/_baseIndexOfWith.js":
  99866. /*!****************************************************!*\
  99867. !*** ./node_modules/lodash-es/_baseIndexOfWith.js ***!
  99868. \****************************************************/
  99869. /*! exports provided: default */
  99870. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  99871. "use strict";
  99872. __webpack_require__.r(__webpack_exports__);
  99873. /**
  99874. * This function is like `baseIndexOf` except that it accepts a comparator.
  99875. *
  99876. * @private
  99877. * @param {Array} array The array to inspect.
  99878. * @param {*} value The value to search for.
  99879. * @param {number} fromIndex The index to search from.
  99880. * @param {Function} comparator The comparator invoked per element.
  99881. * @returns {number} Returns the index of the matched value, else `-1`.
  99882. */
  99883. function baseIndexOfWith(array, value, fromIndex, comparator) {
  99884. var index = fromIndex - 1,
  99885. length = array.length;
  99886. while (++index < length) {
  99887. if (comparator(array[index], value)) {
  99888. return index;
  99889. }
  99890. }
  99891. return -1;
  99892. }
  99893. /* harmony default export */ __webpack_exports__["default"] = (baseIndexOfWith);
  99894. /***/ }),
  99895. /***/ "./node_modules/lodash-es/_baseIntersection.js":
  99896. /*!*****************************************************!*\
  99897. !*** ./node_modules/lodash-es/_baseIntersection.js ***!
  99898. \*****************************************************/
  99899. /*! exports provided: default */
  99900. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  99901. "use strict";
  99902. __webpack_require__.r(__webpack_exports__);
  99903. /* harmony import */ var _SetCache_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_SetCache.js */ "./node_modules/lodash-es/_SetCache.js");
  99904. /* harmony import */ var _arrayIncludes_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_arrayIncludes.js */ "./node_modules/lodash-es/_arrayIncludes.js");
  99905. /* harmony import */ var _arrayIncludesWith_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_arrayIncludesWith.js */ "./node_modules/lodash-es/_arrayIncludesWith.js");
  99906. /* harmony import */ var _arrayMap_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_arrayMap.js */ "./node_modules/lodash-es/_arrayMap.js");
  99907. /* harmony import */ var _baseUnary_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_baseUnary.js */ "./node_modules/lodash-es/_baseUnary.js");
  99908. /* harmony import */ var _cacheHas_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./_cacheHas.js */ "./node_modules/lodash-es/_cacheHas.js");
  99909. /* Built-in method references for those with the same name as other `lodash` methods. */
  99910. var nativeMin = Math.min;
  99911. /**
  99912. * The base implementation of methods like `_.intersection`, without support
  99913. * for iteratee shorthands, that accepts an array of arrays to inspect.
  99914. *
  99915. * @private
  99916. * @param {Array} arrays The arrays to inspect.
  99917. * @param {Function} [iteratee] The iteratee invoked per element.
  99918. * @param {Function} [comparator] The comparator invoked per element.
  99919. * @returns {Array} Returns the new array of shared values.
  99920. */
  99921. function baseIntersection(arrays, iteratee, comparator) {
  99922. var includes = comparator ? _arrayIncludesWith_js__WEBPACK_IMPORTED_MODULE_2__["default"] : _arrayIncludes_js__WEBPACK_IMPORTED_MODULE_1__["default"],
  99923. length = arrays[0].length,
  99924. othLength = arrays.length,
  99925. othIndex = othLength,
  99926. caches = Array(othLength),
  99927. maxLength = Infinity,
  99928. result = [];
  99929. while (othIndex--) {
  99930. var array = arrays[othIndex];
  99931. if (othIndex && iteratee) {
  99932. array = Object(_arrayMap_js__WEBPACK_IMPORTED_MODULE_3__["default"])(array, Object(_baseUnary_js__WEBPACK_IMPORTED_MODULE_4__["default"])(iteratee));
  99933. }
  99934. maxLength = nativeMin(array.length, maxLength);
  99935. caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120))
  99936. ? new _SetCache_js__WEBPACK_IMPORTED_MODULE_0__["default"](othIndex && array)
  99937. : undefined;
  99938. }
  99939. array = arrays[0];
  99940. var index = -1,
  99941. seen = caches[0];
  99942. outer:
  99943. while (++index < length && result.length < maxLength) {
  99944. var value = array[index],
  99945. computed = iteratee ? iteratee(value) : value;
  99946. value = (comparator || value !== 0) ? value : 0;
  99947. if (!(seen
  99948. ? Object(_cacheHas_js__WEBPACK_IMPORTED_MODULE_5__["default"])(seen, computed)
  99949. : includes(result, computed, comparator)
  99950. )) {
  99951. othIndex = othLength;
  99952. while (--othIndex) {
  99953. var cache = caches[othIndex];
  99954. if (!(cache
  99955. ? Object(_cacheHas_js__WEBPACK_IMPORTED_MODULE_5__["default"])(cache, computed)
  99956. : includes(arrays[othIndex], computed, comparator))
  99957. ) {
  99958. continue outer;
  99959. }
  99960. }
  99961. if (seen) {
  99962. seen.push(computed);
  99963. }
  99964. result.push(value);
  99965. }
  99966. }
  99967. return result;
  99968. }
  99969. /* harmony default export */ __webpack_exports__["default"] = (baseIntersection);
  99970. /***/ }),
  99971. /***/ "./node_modules/lodash-es/_baseInverter.js":
  99972. /*!*************************************************!*\
  99973. !*** ./node_modules/lodash-es/_baseInverter.js ***!
  99974. \*************************************************/
  99975. /*! exports provided: default */
  99976. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  99977. "use strict";
  99978. __webpack_require__.r(__webpack_exports__);
  99979. /* harmony import */ var _baseForOwn_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseForOwn.js */ "./node_modules/lodash-es/_baseForOwn.js");
  99980. /**
  99981. * The base implementation of `_.invert` and `_.invertBy` which inverts
  99982. * `object` with values transformed by `iteratee` and set by `setter`.
  99983. *
  99984. * @private
  99985. * @param {Object} object The object to iterate over.
  99986. * @param {Function} setter The function to set `accumulator` values.
  99987. * @param {Function} iteratee The iteratee to transform values.
  99988. * @param {Object} accumulator The initial inverted object.
  99989. * @returns {Function} Returns `accumulator`.
  99990. */
  99991. function baseInverter(object, setter, iteratee, accumulator) {
  99992. Object(_baseForOwn_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, function(value, key, object) {
  99993. setter(accumulator, iteratee(value), key, object);
  99994. });
  99995. return accumulator;
  99996. }
  99997. /* harmony default export */ __webpack_exports__["default"] = (baseInverter);
  99998. /***/ }),
  99999. /***/ "./node_modules/lodash-es/_baseInvoke.js":
  100000. /*!***********************************************!*\
  100001. !*** ./node_modules/lodash-es/_baseInvoke.js ***!
  100002. \***********************************************/
  100003. /*! exports provided: default */
  100004. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  100005. "use strict";
  100006. __webpack_require__.r(__webpack_exports__);
  100007. /* harmony import */ var _apply_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_apply.js */ "./node_modules/lodash-es/_apply.js");
  100008. /* harmony import */ var _castPath_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_castPath.js */ "./node_modules/lodash-es/_castPath.js");
  100009. /* harmony import */ var _last_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./last.js */ "./node_modules/lodash-es/last.js");
  100010. /* harmony import */ var _parent_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_parent.js */ "./node_modules/lodash-es/_parent.js");
  100011. /* harmony import */ var _toKey_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_toKey.js */ "./node_modules/lodash-es/_toKey.js");
  100012. /**
  100013. * The base implementation of `_.invoke` without support for individual
  100014. * method arguments.
  100015. *
  100016. * @private
  100017. * @param {Object} object The object to query.
  100018. * @param {Array|string} path The path of the method to invoke.
  100019. * @param {Array} args The arguments to invoke the method with.
  100020. * @returns {*} Returns the result of the invoked method.
  100021. */
  100022. function baseInvoke(object, path, args) {
  100023. path = Object(_castPath_js__WEBPACK_IMPORTED_MODULE_1__["default"])(path, object);
  100024. object = Object(_parent_js__WEBPACK_IMPORTED_MODULE_3__["default"])(object, path);
  100025. var func = object == null ? object : object[Object(_toKey_js__WEBPACK_IMPORTED_MODULE_4__["default"])(Object(_last_js__WEBPACK_IMPORTED_MODULE_2__["default"])(path))];
  100026. return func == null ? undefined : Object(_apply_js__WEBPACK_IMPORTED_MODULE_0__["default"])(func, object, args);
  100027. }
  100028. /* harmony default export */ __webpack_exports__["default"] = (baseInvoke);
  100029. /***/ }),
  100030. /***/ "./node_modules/lodash-es/_baseIsArguments.js":
  100031. /*!****************************************************!*\
  100032. !*** ./node_modules/lodash-es/_baseIsArguments.js ***!
  100033. \****************************************************/
  100034. /*! exports provided: default */
  100035. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  100036. "use strict";
  100037. __webpack_require__.r(__webpack_exports__);
  100038. /* harmony import */ var _baseGetTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseGetTag.js */ "./node_modules/lodash-es/_baseGetTag.js");
  100039. /* harmony import */ var _isObjectLike_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isObjectLike.js */ "./node_modules/lodash-es/isObjectLike.js");
  100040. /** `Object#toString` result references. */
  100041. var argsTag = '[object Arguments]';
  100042. /**
  100043. * The base implementation of `_.isArguments`.
  100044. *
  100045. * @private
  100046. * @param {*} value The value to check.
  100047. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  100048. */
  100049. function baseIsArguments(value) {
  100050. return Object(_isObjectLike_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value) && Object(_baseGetTag_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value) == argsTag;
  100051. }
  100052. /* harmony default export */ __webpack_exports__["default"] = (baseIsArguments);
  100053. /***/ }),
  100054. /***/ "./node_modules/lodash-es/_baseIsArrayBuffer.js":
  100055. /*!******************************************************!*\
  100056. !*** ./node_modules/lodash-es/_baseIsArrayBuffer.js ***!
  100057. \******************************************************/
  100058. /*! exports provided: default */
  100059. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  100060. "use strict";
  100061. __webpack_require__.r(__webpack_exports__);
  100062. /* harmony import */ var _baseGetTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseGetTag.js */ "./node_modules/lodash-es/_baseGetTag.js");
  100063. /* harmony import */ var _isObjectLike_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isObjectLike.js */ "./node_modules/lodash-es/isObjectLike.js");
  100064. var arrayBufferTag = '[object ArrayBuffer]';
  100065. /**
  100066. * The base implementation of `_.isArrayBuffer` without Node.js optimizations.
  100067. *
  100068. * @private
  100069. * @param {*} value The value to check.
  100070. * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
  100071. */
  100072. function baseIsArrayBuffer(value) {
  100073. return Object(_isObjectLike_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value) && Object(_baseGetTag_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value) == arrayBufferTag;
  100074. }
  100075. /* harmony default export */ __webpack_exports__["default"] = (baseIsArrayBuffer);
  100076. /***/ }),
  100077. /***/ "./node_modules/lodash-es/_baseIsDate.js":
  100078. /*!***********************************************!*\
  100079. !*** ./node_modules/lodash-es/_baseIsDate.js ***!
  100080. \***********************************************/
  100081. /*! exports provided: default */
  100082. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  100083. "use strict";
  100084. __webpack_require__.r(__webpack_exports__);
  100085. /* harmony import */ var _baseGetTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseGetTag.js */ "./node_modules/lodash-es/_baseGetTag.js");
  100086. /* harmony import */ var _isObjectLike_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isObjectLike.js */ "./node_modules/lodash-es/isObjectLike.js");
  100087. /** `Object#toString` result references. */
  100088. var dateTag = '[object Date]';
  100089. /**
  100090. * The base implementation of `_.isDate` without Node.js optimizations.
  100091. *
  100092. * @private
  100093. * @param {*} value The value to check.
  100094. * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
  100095. */
  100096. function baseIsDate(value) {
  100097. return Object(_isObjectLike_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value) && Object(_baseGetTag_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value) == dateTag;
  100098. }
  100099. /* harmony default export */ __webpack_exports__["default"] = (baseIsDate);
  100100. /***/ }),
  100101. /***/ "./node_modules/lodash-es/_baseIsEqual.js":
  100102. /*!************************************************!*\
  100103. !*** ./node_modules/lodash-es/_baseIsEqual.js ***!
  100104. \************************************************/
  100105. /*! exports provided: default */
  100106. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  100107. "use strict";
  100108. __webpack_require__.r(__webpack_exports__);
  100109. /* harmony import */ var _baseIsEqualDeep_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseIsEqualDeep.js */ "./node_modules/lodash-es/_baseIsEqualDeep.js");
  100110. /* harmony import */ var _isObjectLike_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isObjectLike.js */ "./node_modules/lodash-es/isObjectLike.js");
  100111. /**
  100112. * The base implementation of `_.isEqual` which supports partial comparisons
  100113. * and tracks traversed objects.
  100114. *
  100115. * @private
  100116. * @param {*} value The value to compare.
  100117. * @param {*} other The other value to compare.
  100118. * @param {boolean} bitmask The bitmask flags.
  100119. * 1 - Unordered comparison
  100120. * 2 - Partial comparison
  100121. * @param {Function} [customizer] The function to customize comparisons.
  100122. * @param {Object} [stack] Tracks traversed `value` and `other` objects.
  100123. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  100124. */
  100125. function baseIsEqual(value, other, bitmask, customizer, stack) {
  100126. if (value === other) {
  100127. return true;
  100128. }
  100129. if (value == null || other == null || (!Object(_isObjectLike_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value) && !Object(_isObjectLike_js__WEBPACK_IMPORTED_MODULE_1__["default"])(other))) {
  100130. return value !== value && other !== other;
  100131. }
  100132. return Object(_baseIsEqualDeep_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value, other, bitmask, customizer, baseIsEqual, stack);
  100133. }
  100134. /* harmony default export */ __webpack_exports__["default"] = (baseIsEqual);
  100135. /***/ }),
  100136. /***/ "./node_modules/lodash-es/_baseIsEqualDeep.js":
  100137. /*!****************************************************!*\
  100138. !*** ./node_modules/lodash-es/_baseIsEqualDeep.js ***!
  100139. \****************************************************/
  100140. /*! exports provided: default */
  100141. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  100142. "use strict";
  100143. __webpack_require__.r(__webpack_exports__);
  100144. /* harmony import */ var _Stack_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_Stack.js */ "./node_modules/lodash-es/_Stack.js");
  100145. /* harmony import */ var _equalArrays_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_equalArrays.js */ "./node_modules/lodash-es/_equalArrays.js");
  100146. /* harmony import */ var _equalByTag_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_equalByTag.js */ "./node_modules/lodash-es/_equalByTag.js");
  100147. /* harmony import */ var _equalObjects_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_equalObjects.js */ "./node_modules/lodash-es/_equalObjects.js");
  100148. /* harmony import */ var _getTag_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_getTag.js */ "./node_modules/lodash-es/_getTag.js");
  100149. /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
  100150. /* harmony import */ var _isBuffer_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./isBuffer.js */ "./node_modules/lodash-es/isBuffer.js");
  100151. /* harmony import */ var _isTypedArray_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./isTypedArray.js */ "./node_modules/lodash-es/isTypedArray.js");
  100152. /** Used to compose bitmasks for value comparisons. */
  100153. var COMPARE_PARTIAL_FLAG = 1;
  100154. /** `Object#toString` result references. */
  100155. var argsTag = '[object Arguments]',
  100156. arrayTag = '[object Array]',
  100157. objectTag = '[object Object]';
  100158. /** Used for built-in method references. */
  100159. var objectProto = Object.prototype;
  100160. /** Used to check objects for own properties. */
  100161. var hasOwnProperty = objectProto.hasOwnProperty;
  100162. /**
  100163. * A specialized version of `baseIsEqual` for arrays and objects which performs
  100164. * deep comparisons and tracks traversed objects enabling objects with circular
  100165. * references to be compared.
  100166. *
  100167. * @private
  100168. * @param {Object} object The object to compare.
  100169. * @param {Object} other The other object to compare.
  100170. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  100171. * @param {Function} customizer The function to customize comparisons.
  100172. * @param {Function} equalFunc The function to determine equivalents of values.
  100173. * @param {Object} [stack] Tracks traversed `object` and `other` objects.
  100174. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  100175. */
  100176. function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
  100177. var objIsArr = Object(_isArray_js__WEBPACK_IMPORTED_MODULE_5__["default"])(object),
  100178. othIsArr = Object(_isArray_js__WEBPACK_IMPORTED_MODULE_5__["default"])(other),
  100179. objTag = objIsArr ? arrayTag : Object(_getTag_js__WEBPACK_IMPORTED_MODULE_4__["default"])(object),
  100180. othTag = othIsArr ? arrayTag : Object(_getTag_js__WEBPACK_IMPORTED_MODULE_4__["default"])(other);
  100181. objTag = objTag == argsTag ? objectTag : objTag;
  100182. othTag = othTag == argsTag ? objectTag : othTag;
  100183. var objIsObj = objTag == objectTag,
  100184. othIsObj = othTag == objectTag,
  100185. isSameTag = objTag == othTag;
  100186. if (isSameTag && Object(_isBuffer_js__WEBPACK_IMPORTED_MODULE_6__["default"])(object)) {
  100187. if (!Object(_isBuffer_js__WEBPACK_IMPORTED_MODULE_6__["default"])(other)) {
  100188. return false;
  100189. }
  100190. objIsArr = true;
  100191. objIsObj = false;
  100192. }
  100193. if (isSameTag && !objIsObj) {
  100194. stack || (stack = new _Stack_js__WEBPACK_IMPORTED_MODULE_0__["default"]);
  100195. return (objIsArr || Object(_isTypedArray_js__WEBPACK_IMPORTED_MODULE_7__["default"])(object))
  100196. ? Object(_equalArrays_js__WEBPACK_IMPORTED_MODULE_1__["default"])(object, other, bitmask, customizer, equalFunc, stack)
  100197. : Object(_equalByTag_js__WEBPACK_IMPORTED_MODULE_2__["default"])(object, other, objTag, bitmask, customizer, equalFunc, stack);
  100198. }
  100199. if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
  100200. var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
  100201. othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
  100202. if (objIsWrapped || othIsWrapped) {
  100203. var objUnwrapped = objIsWrapped ? object.value() : object,
  100204. othUnwrapped = othIsWrapped ? other.value() : other;
  100205. stack || (stack = new _Stack_js__WEBPACK_IMPORTED_MODULE_0__["default"]);
  100206. return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
  100207. }
  100208. }
  100209. if (!isSameTag) {
  100210. return false;
  100211. }
  100212. stack || (stack = new _Stack_js__WEBPACK_IMPORTED_MODULE_0__["default"]);
  100213. return Object(_equalObjects_js__WEBPACK_IMPORTED_MODULE_3__["default"])(object, other, bitmask, customizer, equalFunc, stack);
  100214. }
  100215. /* harmony default export */ __webpack_exports__["default"] = (baseIsEqualDeep);
  100216. /***/ }),
  100217. /***/ "./node_modules/lodash-es/_baseIsMap.js":
  100218. /*!**********************************************!*\
  100219. !*** ./node_modules/lodash-es/_baseIsMap.js ***!
  100220. \**********************************************/
  100221. /*! exports provided: default */
  100222. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  100223. "use strict";
  100224. __webpack_require__.r(__webpack_exports__);
  100225. /* harmony import */ var _getTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_getTag.js */ "./node_modules/lodash-es/_getTag.js");
  100226. /* harmony import */ var _isObjectLike_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isObjectLike.js */ "./node_modules/lodash-es/isObjectLike.js");
  100227. /** `Object#toString` result references. */
  100228. var mapTag = '[object Map]';
  100229. /**
  100230. * The base implementation of `_.isMap` without Node.js optimizations.
  100231. *
  100232. * @private
  100233. * @param {*} value The value to check.
  100234. * @returns {boolean} Returns `true` if `value` is a map, else `false`.
  100235. */
  100236. function baseIsMap(value) {
  100237. return Object(_isObjectLike_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value) && Object(_getTag_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value) == mapTag;
  100238. }
  100239. /* harmony default export */ __webpack_exports__["default"] = (baseIsMap);
  100240. /***/ }),
  100241. /***/ "./node_modules/lodash-es/_baseIsMatch.js":
  100242. /*!************************************************!*\
  100243. !*** ./node_modules/lodash-es/_baseIsMatch.js ***!
  100244. \************************************************/
  100245. /*! exports provided: default */
  100246. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  100247. "use strict";
  100248. __webpack_require__.r(__webpack_exports__);
  100249. /* harmony import */ var _Stack_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_Stack.js */ "./node_modules/lodash-es/_Stack.js");
  100250. /* harmony import */ var _baseIsEqual_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseIsEqual.js */ "./node_modules/lodash-es/_baseIsEqual.js");
  100251. /** Used to compose bitmasks for value comparisons. */
  100252. var COMPARE_PARTIAL_FLAG = 1,
  100253. COMPARE_UNORDERED_FLAG = 2;
  100254. /**
  100255. * The base implementation of `_.isMatch` without support for iteratee shorthands.
  100256. *
  100257. * @private
  100258. * @param {Object} object The object to inspect.
  100259. * @param {Object} source The object of property values to match.
  100260. * @param {Array} matchData The property names, values, and compare flags to match.
  100261. * @param {Function} [customizer] The function to customize comparisons.
  100262. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  100263. */
  100264. function baseIsMatch(object, source, matchData, customizer) {
  100265. var index = matchData.length,
  100266. length = index,
  100267. noCustomizer = !customizer;
  100268. if (object == null) {
  100269. return !length;
  100270. }
  100271. object = Object(object);
  100272. while (index--) {
  100273. var data = matchData[index];
  100274. if ((noCustomizer && data[2])
  100275. ? data[1] !== object[data[0]]
  100276. : !(data[0] in object)
  100277. ) {
  100278. return false;
  100279. }
  100280. }
  100281. while (++index < length) {
  100282. data = matchData[index];
  100283. var key = data[0],
  100284. objValue = object[key],
  100285. srcValue = data[1];
  100286. if (noCustomizer && data[2]) {
  100287. if (objValue === undefined && !(key in object)) {
  100288. return false;
  100289. }
  100290. } else {
  100291. var stack = new _Stack_js__WEBPACK_IMPORTED_MODULE_0__["default"];
  100292. if (customizer) {
  100293. var result = customizer(objValue, srcValue, key, object, source, stack);
  100294. }
  100295. if (!(result === undefined
  100296. ? Object(_baseIsEqual_js__WEBPACK_IMPORTED_MODULE_1__["default"])(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack)
  100297. : result
  100298. )) {
  100299. return false;
  100300. }
  100301. }
  100302. }
  100303. return true;
  100304. }
  100305. /* harmony default export */ __webpack_exports__["default"] = (baseIsMatch);
  100306. /***/ }),
  100307. /***/ "./node_modules/lodash-es/_baseIsNaN.js":
  100308. /*!**********************************************!*\
  100309. !*** ./node_modules/lodash-es/_baseIsNaN.js ***!
  100310. \**********************************************/
  100311. /*! exports provided: default */
  100312. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  100313. "use strict";
  100314. __webpack_require__.r(__webpack_exports__);
  100315. /**
  100316. * The base implementation of `_.isNaN` without support for number objects.
  100317. *
  100318. * @private
  100319. * @param {*} value The value to check.
  100320. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  100321. */
  100322. function baseIsNaN(value) {
  100323. return value !== value;
  100324. }
  100325. /* harmony default export */ __webpack_exports__["default"] = (baseIsNaN);
  100326. /***/ }),
  100327. /***/ "./node_modules/lodash-es/_baseIsNative.js":
  100328. /*!*************************************************!*\
  100329. !*** ./node_modules/lodash-es/_baseIsNative.js ***!
  100330. \*************************************************/
  100331. /*! exports provided: default */
  100332. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  100333. "use strict";
  100334. __webpack_require__.r(__webpack_exports__);
  100335. /* harmony import */ var _isFunction_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isFunction.js */ "./node_modules/lodash-es/isFunction.js");
  100336. /* harmony import */ var _isMasked_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_isMasked.js */ "./node_modules/lodash-es/_isMasked.js");
  100337. /* harmony import */ var _isObject_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./isObject.js */ "./node_modules/lodash-es/isObject.js");
  100338. /* harmony import */ var _toSource_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_toSource.js */ "./node_modules/lodash-es/_toSource.js");
  100339. /**
  100340. * Used to match `RegExp`
  100341. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  100342. */
  100343. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
  100344. /** Used to detect host constructors (Safari). */
  100345. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  100346. /** Used for built-in method references. */
  100347. var funcProto = Function.prototype,
  100348. objectProto = Object.prototype;
  100349. /** Used to resolve the decompiled source of functions. */
  100350. var funcToString = funcProto.toString;
  100351. /** Used to check objects for own properties. */
  100352. var hasOwnProperty = objectProto.hasOwnProperty;
  100353. /** Used to detect if a method is native. */
  100354. var reIsNative = RegExp('^' +
  100355. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  100356. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  100357. );
  100358. /**
  100359. * The base implementation of `_.isNative` without bad shim checks.
  100360. *
  100361. * @private
  100362. * @param {*} value The value to check.
  100363. * @returns {boolean} Returns `true` if `value` is a native function,
  100364. * else `false`.
  100365. */
  100366. function baseIsNative(value) {
  100367. if (!Object(_isObject_js__WEBPACK_IMPORTED_MODULE_2__["default"])(value) || Object(_isMasked_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value)) {
  100368. return false;
  100369. }
  100370. var pattern = Object(_isFunction_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value) ? reIsNative : reIsHostCtor;
  100371. return pattern.test(Object(_toSource_js__WEBPACK_IMPORTED_MODULE_3__["default"])(value));
  100372. }
  100373. /* harmony default export */ __webpack_exports__["default"] = (baseIsNative);
  100374. /***/ }),
  100375. /***/ "./node_modules/lodash-es/_baseIsRegExp.js":
  100376. /*!*************************************************!*\
  100377. !*** ./node_modules/lodash-es/_baseIsRegExp.js ***!
  100378. \*************************************************/
  100379. /*! exports provided: default */
  100380. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  100381. "use strict";
  100382. __webpack_require__.r(__webpack_exports__);
  100383. /* harmony import */ var _baseGetTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseGetTag.js */ "./node_modules/lodash-es/_baseGetTag.js");
  100384. /* harmony import */ var _isObjectLike_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isObjectLike.js */ "./node_modules/lodash-es/isObjectLike.js");
  100385. /** `Object#toString` result references. */
  100386. var regexpTag = '[object RegExp]';
  100387. /**
  100388. * The base implementation of `_.isRegExp` without Node.js optimizations.
  100389. *
  100390. * @private
  100391. * @param {*} value The value to check.
  100392. * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
  100393. */
  100394. function baseIsRegExp(value) {
  100395. return Object(_isObjectLike_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value) && Object(_baseGetTag_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value) == regexpTag;
  100396. }
  100397. /* harmony default export */ __webpack_exports__["default"] = (baseIsRegExp);
  100398. /***/ }),
  100399. /***/ "./node_modules/lodash-es/_baseIsSet.js":
  100400. /*!**********************************************!*\
  100401. !*** ./node_modules/lodash-es/_baseIsSet.js ***!
  100402. \**********************************************/
  100403. /*! exports provided: default */
  100404. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  100405. "use strict";
  100406. __webpack_require__.r(__webpack_exports__);
  100407. /* harmony import */ var _getTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_getTag.js */ "./node_modules/lodash-es/_getTag.js");
  100408. /* harmony import */ var _isObjectLike_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isObjectLike.js */ "./node_modules/lodash-es/isObjectLike.js");
  100409. /** `Object#toString` result references. */
  100410. var setTag = '[object Set]';
  100411. /**
  100412. * The base implementation of `_.isSet` without Node.js optimizations.
  100413. *
  100414. * @private
  100415. * @param {*} value The value to check.
  100416. * @returns {boolean} Returns `true` if `value` is a set, else `false`.
  100417. */
  100418. function baseIsSet(value) {
  100419. return Object(_isObjectLike_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value) && Object(_getTag_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value) == setTag;
  100420. }
  100421. /* harmony default export */ __webpack_exports__["default"] = (baseIsSet);
  100422. /***/ }),
  100423. /***/ "./node_modules/lodash-es/_baseIsTypedArray.js":
  100424. /*!*****************************************************!*\
  100425. !*** ./node_modules/lodash-es/_baseIsTypedArray.js ***!
  100426. \*****************************************************/
  100427. /*! exports provided: default */
  100428. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  100429. "use strict";
  100430. __webpack_require__.r(__webpack_exports__);
  100431. /* harmony import */ var _baseGetTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseGetTag.js */ "./node_modules/lodash-es/_baseGetTag.js");
  100432. /* harmony import */ var _isLength_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isLength.js */ "./node_modules/lodash-es/isLength.js");
  100433. /* harmony import */ var _isObjectLike_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./isObjectLike.js */ "./node_modules/lodash-es/isObjectLike.js");
  100434. /** `Object#toString` result references. */
  100435. var argsTag = '[object Arguments]',
  100436. arrayTag = '[object Array]',
  100437. boolTag = '[object Boolean]',
  100438. dateTag = '[object Date]',
  100439. errorTag = '[object Error]',
  100440. funcTag = '[object Function]',
  100441. mapTag = '[object Map]',
  100442. numberTag = '[object Number]',
  100443. objectTag = '[object Object]',
  100444. regexpTag = '[object RegExp]',
  100445. setTag = '[object Set]',
  100446. stringTag = '[object String]',
  100447. weakMapTag = '[object WeakMap]';
  100448. var arrayBufferTag = '[object ArrayBuffer]',
  100449. dataViewTag = '[object DataView]',
  100450. float32Tag = '[object Float32Array]',
  100451. float64Tag = '[object Float64Array]',
  100452. int8Tag = '[object Int8Array]',
  100453. int16Tag = '[object Int16Array]',
  100454. int32Tag = '[object Int32Array]',
  100455. uint8Tag = '[object Uint8Array]',
  100456. uint8ClampedTag = '[object Uint8ClampedArray]',
  100457. uint16Tag = '[object Uint16Array]',
  100458. uint32Tag = '[object Uint32Array]';
  100459. /** Used to identify `toStringTag` values of typed arrays. */
  100460. var typedArrayTags = {};
  100461. typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
  100462. typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
  100463. typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
  100464. typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
  100465. typedArrayTags[uint32Tag] = true;
  100466. typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
  100467. typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
  100468. typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =
  100469. typedArrayTags[errorTag] = typedArrayTags[funcTag] =
  100470. typedArrayTags[mapTag] = typedArrayTags[numberTag] =
  100471. typedArrayTags[objectTag] = typedArrayTags[regexpTag] =
  100472. typedArrayTags[setTag] = typedArrayTags[stringTag] =
  100473. typedArrayTags[weakMapTag] = false;
  100474. /**
  100475. * The base implementation of `_.isTypedArray` without Node.js optimizations.
  100476. *
  100477. * @private
  100478. * @param {*} value The value to check.
  100479. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  100480. */
  100481. function baseIsTypedArray(value) {
  100482. return Object(_isObjectLike_js__WEBPACK_IMPORTED_MODULE_2__["default"])(value) &&
  100483. Object(_isLength_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value.length) && !!typedArrayTags[Object(_baseGetTag_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value)];
  100484. }
  100485. /* harmony default export */ __webpack_exports__["default"] = (baseIsTypedArray);
  100486. /***/ }),
  100487. /***/ "./node_modules/lodash-es/_baseIteratee.js":
  100488. /*!*************************************************!*\
  100489. !*** ./node_modules/lodash-es/_baseIteratee.js ***!
  100490. \*************************************************/
  100491. /*! exports provided: default */
  100492. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  100493. "use strict";
  100494. __webpack_require__.r(__webpack_exports__);
  100495. /* harmony import */ var _baseMatches_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseMatches.js */ "./node_modules/lodash-es/_baseMatches.js");
  100496. /* harmony import */ var _baseMatchesProperty_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseMatchesProperty.js */ "./node_modules/lodash-es/_baseMatchesProperty.js");
  100497. /* harmony import */ var _identity_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./identity.js */ "./node_modules/lodash-es/identity.js");
  100498. /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
  100499. /* harmony import */ var _property_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./property.js */ "./node_modules/lodash-es/property.js");
  100500. /**
  100501. * The base implementation of `_.iteratee`.
  100502. *
  100503. * @private
  100504. * @param {*} [value=_.identity] The value to convert to an iteratee.
  100505. * @returns {Function} Returns the iteratee.
  100506. */
  100507. function baseIteratee(value) {
  100508. // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.
  100509. // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.
  100510. if (typeof value == 'function') {
  100511. return value;
  100512. }
  100513. if (value == null) {
  100514. return _identity_js__WEBPACK_IMPORTED_MODULE_2__["default"];
  100515. }
  100516. if (typeof value == 'object') {
  100517. return Object(_isArray_js__WEBPACK_IMPORTED_MODULE_3__["default"])(value)
  100518. ? Object(_baseMatchesProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value[0], value[1])
  100519. : Object(_baseMatches_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value);
  100520. }
  100521. return Object(_property_js__WEBPACK_IMPORTED_MODULE_4__["default"])(value);
  100522. }
  100523. /* harmony default export */ __webpack_exports__["default"] = (baseIteratee);
  100524. /***/ }),
  100525. /***/ "./node_modules/lodash-es/_baseKeys.js":
  100526. /*!*********************************************!*\
  100527. !*** ./node_modules/lodash-es/_baseKeys.js ***!
  100528. \*********************************************/
  100529. /*! exports provided: default */
  100530. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  100531. "use strict";
  100532. __webpack_require__.r(__webpack_exports__);
  100533. /* harmony import */ var _isPrototype_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_isPrototype.js */ "./node_modules/lodash-es/_isPrototype.js");
  100534. /* harmony import */ var _nativeKeys_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_nativeKeys.js */ "./node_modules/lodash-es/_nativeKeys.js");
  100535. /** Used for built-in method references. */
  100536. var objectProto = Object.prototype;
  100537. /** Used to check objects for own properties. */
  100538. var hasOwnProperty = objectProto.hasOwnProperty;
  100539. /**
  100540. * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
  100541. *
  100542. * @private
  100543. * @param {Object} object The object to query.
  100544. * @returns {Array} Returns the array of property names.
  100545. */
  100546. function baseKeys(object) {
  100547. if (!Object(_isPrototype_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object)) {
  100548. return Object(_nativeKeys_js__WEBPACK_IMPORTED_MODULE_1__["default"])(object);
  100549. }
  100550. var result = [];
  100551. for (var key in Object(object)) {
  100552. if (hasOwnProperty.call(object, key) && key != 'constructor') {
  100553. result.push(key);
  100554. }
  100555. }
  100556. return result;
  100557. }
  100558. /* harmony default export */ __webpack_exports__["default"] = (baseKeys);
  100559. /***/ }),
  100560. /***/ "./node_modules/lodash-es/_baseKeysIn.js":
  100561. /*!***********************************************!*\
  100562. !*** ./node_modules/lodash-es/_baseKeysIn.js ***!
  100563. \***********************************************/
  100564. /*! exports provided: default */
  100565. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  100566. "use strict";
  100567. __webpack_require__.r(__webpack_exports__);
  100568. /* harmony import */ var _isObject_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isObject.js */ "./node_modules/lodash-es/isObject.js");
  100569. /* harmony import */ var _isPrototype_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_isPrototype.js */ "./node_modules/lodash-es/_isPrototype.js");
  100570. /* harmony import */ var _nativeKeysIn_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_nativeKeysIn.js */ "./node_modules/lodash-es/_nativeKeysIn.js");
  100571. /** Used for built-in method references. */
  100572. var objectProto = Object.prototype;
  100573. /** Used to check objects for own properties. */
  100574. var hasOwnProperty = objectProto.hasOwnProperty;
  100575. /**
  100576. * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.
  100577. *
  100578. * @private
  100579. * @param {Object} object The object to query.
  100580. * @returns {Array} Returns the array of property names.
  100581. */
  100582. function baseKeysIn(object) {
  100583. if (!Object(_isObject_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object)) {
  100584. return Object(_nativeKeysIn_js__WEBPACK_IMPORTED_MODULE_2__["default"])(object);
  100585. }
  100586. var isProto = Object(_isPrototype_js__WEBPACK_IMPORTED_MODULE_1__["default"])(object),
  100587. result = [];
  100588. for (var key in object) {
  100589. if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
  100590. result.push(key);
  100591. }
  100592. }
  100593. return result;
  100594. }
  100595. /* harmony default export */ __webpack_exports__["default"] = (baseKeysIn);
  100596. /***/ }),
  100597. /***/ "./node_modules/lodash-es/_baseLodash.js":
  100598. /*!***********************************************!*\
  100599. !*** ./node_modules/lodash-es/_baseLodash.js ***!
  100600. \***********************************************/
  100601. /*! exports provided: default */
  100602. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  100603. "use strict";
  100604. __webpack_require__.r(__webpack_exports__);
  100605. /**
  100606. * The function whose prototype chain sequence wrappers inherit from.
  100607. *
  100608. * @private
  100609. */
  100610. function baseLodash() {
  100611. // No operation performed.
  100612. }
  100613. /* harmony default export */ __webpack_exports__["default"] = (baseLodash);
  100614. /***/ }),
  100615. /***/ "./node_modules/lodash-es/_baseLt.js":
  100616. /*!*******************************************!*\
  100617. !*** ./node_modules/lodash-es/_baseLt.js ***!
  100618. \*******************************************/
  100619. /*! exports provided: default */
  100620. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  100621. "use strict";
  100622. __webpack_require__.r(__webpack_exports__);
  100623. /**
  100624. * The base implementation of `_.lt` which doesn't coerce arguments.
  100625. *
  100626. * @private
  100627. * @param {*} value The value to compare.
  100628. * @param {*} other The other value to compare.
  100629. * @returns {boolean} Returns `true` if `value` is less than `other`,
  100630. * else `false`.
  100631. */
  100632. function baseLt(value, other) {
  100633. return value < other;
  100634. }
  100635. /* harmony default export */ __webpack_exports__["default"] = (baseLt);
  100636. /***/ }),
  100637. /***/ "./node_modules/lodash-es/_baseMap.js":
  100638. /*!********************************************!*\
  100639. !*** ./node_modules/lodash-es/_baseMap.js ***!
  100640. \********************************************/
  100641. /*! exports provided: default */
  100642. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  100643. "use strict";
  100644. __webpack_require__.r(__webpack_exports__);
  100645. /* harmony import */ var _baseEach_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseEach.js */ "./node_modules/lodash-es/_baseEach.js");
  100646. /* harmony import */ var _isArrayLike_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isArrayLike.js */ "./node_modules/lodash-es/isArrayLike.js");
  100647. /**
  100648. * The base implementation of `_.map` without support for iteratee shorthands.
  100649. *
  100650. * @private
  100651. * @param {Array|Object} collection The collection to iterate over.
  100652. * @param {Function} iteratee The function invoked per iteration.
  100653. * @returns {Array} Returns the new mapped array.
  100654. */
  100655. function baseMap(collection, iteratee) {
  100656. var index = -1,
  100657. result = Object(_isArrayLike_js__WEBPACK_IMPORTED_MODULE_1__["default"])(collection) ? Array(collection.length) : [];
  100658. Object(_baseEach_js__WEBPACK_IMPORTED_MODULE_0__["default"])(collection, function(value, key, collection) {
  100659. result[++index] = iteratee(value, key, collection);
  100660. });
  100661. return result;
  100662. }
  100663. /* harmony default export */ __webpack_exports__["default"] = (baseMap);
  100664. /***/ }),
  100665. /***/ "./node_modules/lodash-es/_baseMatches.js":
  100666. /*!************************************************!*\
  100667. !*** ./node_modules/lodash-es/_baseMatches.js ***!
  100668. \************************************************/
  100669. /*! exports provided: default */
  100670. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  100671. "use strict";
  100672. __webpack_require__.r(__webpack_exports__);
  100673. /* harmony import */ var _baseIsMatch_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseIsMatch.js */ "./node_modules/lodash-es/_baseIsMatch.js");
  100674. /* harmony import */ var _getMatchData_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_getMatchData.js */ "./node_modules/lodash-es/_getMatchData.js");
  100675. /* harmony import */ var _matchesStrictComparable_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_matchesStrictComparable.js */ "./node_modules/lodash-es/_matchesStrictComparable.js");
  100676. /**
  100677. * The base implementation of `_.matches` which doesn't clone `source`.
  100678. *
  100679. * @private
  100680. * @param {Object} source The object of property values to match.
  100681. * @returns {Function} Returns the new spec function.
  100682. */
  100683. function baseMatches(source) {
  100684. var matchData = Object(_getMatchData_js__WEBPACK_IMPORTED_MODULE_1__["default"])(source);
  100685. if (matchData.length == 1 && matchData[0][2]) {
  100686. return Object(_matchesStrictComparable_js__WEBPACK_IMPORTED_MODULE_2__["default"])(matchData[0][0], matchData[0][1]);
  100687. }
  100688. return function(object) {
  100689. return object === source || Object(_baseIsMatch_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, source, matchData);
  100690. };
  100691. }
  100692. /* harmony default export */ __webpack_exports__["default"] = (baseMatches);
  100693. /***/ }),
  100694. /***/ "./node_modules/lodash-es/_baseMatchesProperty.js":
  100695. /*!********************************************************!*\
  100696. !*** ./node_modules/lodash-es/_baseMatchesProperty.js ***!
  100697. \********************************************************/
  100698. /*! exports provided: default */
  100699. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  100700. "use strict";
  100701. __webpack_require__.r(__webpack_exports__);
  100702. /* harmony import */ var _baseIsEqual_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseIsEqual.js */ "./node_modules/lodash-es/_baseIsEqual.js");
  100703. /* harmony import */ var _get_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./get.js */ "./node_modules/lodash-es/get.js");
  100704. /* harmony import */ var _hasIn_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./hasIn.js */ "./node_modules/lodash-es/hasIn.js");
  100705. /* harmony import */ var _isKey_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_isKey.js */ "./node_modules/lodash-es/_isKey.js");
  100706. /* harmony import */ var _isStrictComparable_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_isStrictComparable.js */ "./node_modules/lodash-es/_isStrictComparable.js");
  100707. /* harmony import */ var _matchesStrictComparable_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./_matchesStrictComparable.js */ "./node_modules/lodash-es/_matchesStrictComparable.js");
  100708. /* harmony import */ var _toKey_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./_toKey.js */ "./node_modules/lodash-es/_toKey.js");
  100709. /** Used to compose bitmasks for value comparisons. */
  100710. var COMPARE_PARTIAL_FLAG = 1,
  100711. COMPARE_UNORDERED_FLAG = 2;
  100712. /**
  100713. * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.
  100714. *
  100715. * @private
  100716. * @param {string} path The path of the property to get.
  100717. * @param {*} srcValue The value to match.
  100718. * @returns {Function} Returns the new spec function.
  100719. */
  100720. function baseMatchesProperty(path, srcValue) {
  100721. if (Object(_isKey_js__WEBPACK_IMPORTED_MODULE_3__["default"])(path) && Object(_isStrictComparable_js__WEBPACK_IMPORTED_MODULE_4__["default"])(srcValue)) {
  100722. return Object(_matchesStrictComparable_js__WEBPACK_IMPORTED_MODULE_5__["default"])(Object(_toKey_js__WEBPACK_IMPORTED_MODULE_6__["default"])(path), srcValue);
  100723. }
  100724. return function(object) {
  100725. var objValue = Object(_get_js__WEBPACK_IMPORTED_MODULE_1__["default"])(object, path);
  100726. return (objValue === undefined && objValue === srcValue)
  100727. ? Object(_hasIn_js__WEBPACK_IMPORTED_MODULE_2__["default"])(object, path)
  100728. : Object(_baseIsEqual_js__WEBPACK_IMPORTED_MODULE_0__["default"])(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
  100729. };
  100730. }
  100731. /* harmony default export */ __webpack_exports__["default"] = (baseMatchesProperty);
  100732. /***/ }),
  100733. /***/ "./node_modules/lodash-es/_baseMean.js":
  100734. /*!*********************************************!*\
  100735. !*** ./node_modules/lodash-es/_baseMean.js ***!
  100736. \*********************************************/
  100737. /*! exports provided: default */
  100738. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  100739. "use strict";
  100740. __webpack_require__.r(__webpack_exports__);
  100741. /* harmony import */ var _baseSum_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseSum.js */ "./node_modules/lodash-es/_baseSum.js");
  100742. /** Used as references for various `Number` constants. */
  100743. var NAN = 0 / 0;
  100744. /**
  100745. * The base implementation of `_.mean` and `_.meanBy` without support for
  100746. * iteratee shorthands.
  100747. *
  100748. * @private
  100749. * @param {Array} array The array to iterate over.
  100750. * @param {Function} iteratee The function invoked per iteration.
  100751. * @returns {number} Returns the mean.
  100752. */
  100753. function baseMean(array, iteratee) {
  100754. var length = array == null ? 0 : array.length;
  100755. return length ? (Object(_baseSum_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, iteratee) / length) : NAN;
  100756. }
  100757. /* harmony default export */ __webpack_exports__["default"] = (baseMean);
  100758. /***/ }),
  100759. /***/ "./node_modules/lodash-es/_baseMerge.js":
  100760. /*!**********************************************!*\
  100761. !*** ./node_modules/lodash-es/_baseMerge.js ***!
  100762. \**********************************************/
  100763. /*! exports provided: default */
  100764. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  100765. "use strict";
  100766. __webpack_require__.r(__webpack_exports__);
  100767. /* harmony import */ var _Stack_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_Stack.js */ "./node_modules/lodash-es/_Stack.js");
  100768. /* harmony import */ var _assignMergeValue_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_assignMergeValue.js */ "./node_modules/lodash-es/_assignMergeValue.js");
  100769. /* harmony import */ var _baseFor_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseFor.js */ "./node_modules/lodash-es/_baseFor.js");
  100770. /* harmony import */ var _baseMergeDeep_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_baseMergeDeep.js */ "./node_modules/lodash-es/_baseMergeDeep.js");
  100771. /* harmony import */ var _isObject_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./isObject.js */ "./node_modules/lodash-es/isObject.js");
  100772. /* harmony import */ var _keysIn_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./keysIn.js */ "./node_modules/lodash-es/keysIn.js");
  100773. /* harmony import */ var _safeGet_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./_safeGet.js */ "./node_modules/lodash-es/_safeGet.js");
  100774. /**
  100775. * The base implementation of `_.merge` without support for multiple sources.
  100776. *
  100777. * @private
  100778. * @param {Object} object The destination object.
  100779. * @param {Object} source The source object.
  100780. * @param {number} srcIndex The index of `source`.
  100781. * @param {Function} [customizer] The function to customize merged values.
  100782. * @param {Object} [stack] Tracks traversed source values and their merged
  100783. * counterparts.
  100784. */
  100785. function baseMerge(object, source, srcIndex, customizer, stack) {
  100786. if (object === source) {
  100787. return;
  100788. }
  100789. Object(_baseFor_js__WEBPACK_IMPORTED_MODULE_2__["default"])(source, function(srcValue, key) {
  100790. stack || (stack = new _Stack_js__WEBPACK_IMPORTED_MODULE_0__["default"]);
  100791. if (Object(_isObject_js__WEBPACK_IMPORTED_MODULE_4__["default"])(srcValue)) {
  100792. Object(_baseMergeDeep_js__WEBPACK_IMPORTED_MODULE_3__["default"])(object, source, key, srcIndex, baseMerge, customizer, stack);
  100793. }
  100794. else {
  100795. var newValue = customizer
  100796. ? customizer(Object(_safeGet_js__WEBPACK_IMPORTED_MODULE_6__["default"])(object, key), srcValue, (key + ''), object, source, stack)
  100797. : undefined;
  100798. if (newValue === undefined) {
  100799. newValue = srcValue;
  100800. }
  100801. Object(_assignMergeValue_js__WEBPACK_IMPORTED_MODULE_1__["default"])(object, key, newValue);
  100802. }
  100803. }, _keysIn_js__WEBPACK_IMPORTED_MODULE_5__["default"]);
  100804. }
  100805. /* harmony default export */ __webpack_exports__["default"] = (baseMerge);
  100806. /***/ }),
  100807. /***/ "./node_modules/lodash-es/_baseMergeDeep.js":
  100808. /*!**************************************************!*\
  100809. !*** ./node_modules/lodash-es/_baseMergeDeep.js ***!
  100810. \**************************************************/
  100811. /*! exports provided: default */
  100812. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  100813. "use strict";
  100814. __webpack_require__.r(__webpack_exports__);
  100815. /* harmony import */ var _assignMergeValue_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_assignMergeValue.js */ "./node_modules/lodash-es/_assignMergeValue.js");
  100816. /* harmony import */ var _cloneBuffer_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_cloneBuffer.js */ "./node_modules/lodash-es/_cloneBuffer.js");
  100817. /* harmony import */ var _cloneTypedArray_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_cloneTypedArray.js */ "./node_modules/lodash-es/_cloneTypedArray.js");
  100818. /* harmony import */ var _copyArray_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_copyArray.js */ "./node_modules/lodash-es/_copyArray.js");
  100819. /* harmony import */ var _initCloneObject_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_initCloneObject.js */ "./node_modules/lodash-es/_initCloneObject.js");
  100820. /* harmony import */ var _isArguments_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./isArguments.js */ "./node_modules/lodash-es/isArguments.js");
  100821. /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
  100822. /* harmony import */ var _isArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./isArrayLikeObject.js */ "./node_modules/lodash-es/isArrayLikeObject.js");
  100823. /* harmony import */ var _isBuffer_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./isBuffer.js */ "./node_modules/lodash-es/isBuffer.js");
  100824. /* harmony import */ var _isFunction_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./isFunction.js */ "./node_modules/lodash-es/isFunction.js");
  100825. /* harmony import */ var _isObject_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./isObject.js */ "./node_modules/lodash-es/isObject.js");
  100826. /* harmony import */ var _isPlainObject_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./isPlainObject.js */ "./node_modules/lodash-es/isPlainObject.js");
  100827. /* harmony import */ var _isTypedArray_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./isTypedArray.js */ "./node_modules/lodash-es/isTypedArray.js");
  100828. /* harmony import */ var _safeGet_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./_safeGet.js */ "./node_modules/lodash-es/_safeGet.js");
  100829. /* harmony import */ var _toPlainObject_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./toPlainObject.js */ "./node_modules/lodash-es/toPlainObject.js");
  100830. /**
  100831. * A specialized version of `baseMerge` for arrays and objects which performs
  100832. * deep merges and tracks traversed objects enabling objects with circular
  100833. * references to be merged.
  100834. *
  100835. * @private
  100836. * @param {Object} object The destination object.
  100837. * @param {Object} source The source object.
  100838. * @param {string} key The key of the value to merge.
  100839. * @param {number} srcIndex The index of `source`.
  100840. * @param {Function} mergeFunc The function to merge values.
  100841. * @param {Function} [customizer] The function to customize assigned values.
  100842. * @param {Object} [stack] Tracks traversed source values and their merged
  100843. * counterparts.
  100844. */
  100845. function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {
  100846. var objValue = Object(_safeGet_js__WEBPACK_IMPORTED_MODULE_13__["default"])(object, key),
  100847. srcValue = Object(_safeGet_js__WEBPACK_IMPORTED_MODULE_13__["default"])(source, key),
  100848. stacked = stack.get(srcValue);
  100849. if (stacked) {
  100850. Object(_assignMergeValue_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, key, stacked);
  100851. return;
  100852. }
  100853. var newValue = customizer
  100854. ? customizer(objValue, srcValue, (key + ''), object, source, stack)
  100855. : undefined;
  100856. var isCommon = newValue === undefined;
  100857. if (isCommon) {
  100858. var isArr = Object(_isArray_js__WEBPACK_IMPORTED_MODULE_6__["default"])(srcValue),
  100859. isBuff = !isArr && Object(_isBuffer_js__WEBPACK_IMPORTED_MODULE_8__["default"])(srcValue),
  100860. isTyped = !isArr && !isBuff && Object(_isTypedArray_js__WEBPACK_IMPORTED_MODULE_12__["default"])(srcValue);
  100861. newValue = srcValue;
  100862. if (isArr || isBuff || isTyped) {
  100863. if (Object(_isArray_js__WEBPACK_IMPORTED_MODULE_6__["default"])(objValue)) {
  100864. newValue = objValue;
  100865. }
  100866. else if (Object(_isArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_7__["default"])(objValue)) {
  100867. newValue = Object(_copyArray_js__WEBPACK_IMPORTED_MODULE_3__["default"])(objValue);
  100868. }
  100869. else if (isBuff) {
  100870. isCommon = false;
  100871. newValue = Object(_cloneBuffer_js__WEBPACK_IMPORTED_MODULE_1__["default"])(srcValue, true);
  100872. }
  100873. else if (isTyped) {
  100874. isCommon = false;
  100875. newValue = Object(_cloneTypedArray_js__WEBPACK_IMPORTED_MODULE_2__["default"])(srcValue, true);
  100876. }
  100877. else {
  100878. newValue = [];
  100879. }
  100880. }
  100881. else if (Object(_isPlainObject_js__WEBPACK_IMPORTED_MODULE_11__["default"])(srcValue) || Object(_isArguments_js__WEBPACK_IMPORTED_MODULE_5__["default"])(srcValue)) {
  100882. newValue = objValue;
  100883. if (Object(_isArguments_js__WEBPACK_IMPORTED_MODULE_5__["default"])(objValue)) {
  100884. newValue = Object(_toPlainObject_js__WEBPACK_IMPORTED_MODULE_14__["default"])(objValue);
  100885. }
  100886. else if (!Object(_isObject_js__WEBPACK_IMPORTED_MODULE_10__["default"])(objValue) || Object(_isFunction_js__WEBPACK_IMPORTED_MODULE_9__["default"])(objValue)) {
  100887. newValue = Object(_initCloneObject_js__WEBPACK_IMPORTED_MODULE_4__["default"])(srcValue);
  100888. }
  100889. }
  100890. else {
  100891. isCommon = false;
  100892. }
  100893. }
  100894. if (isCommon) {
  100895. // Recursively merge objects and arrays (susceptible to call stack limits).
  100896. stack.set(srcValue, newValue);
  100897. mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
  100898. stack['delete'](srcValue);
  100899. }
  100900. Object(_assignMergeValue_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, key, newValue);
  100901. }
  100902. /* harmony default export */ __webpack_exports__["default"] = (baseMergeDeep);
  100903. /***/ }),
  100904. /***/ "./node_modules/lodash-es/_baseNth.js":
  100905. /*!********************************************!*\
  100906. !*** ./node_modules/lodash-es/_baseNth.js ***!
  100907. \********************************************/
  100908. /*! exports provided: default */
  100909. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  100910. "use strict";
  100911. __webpack_require__.r(__webpack_exports__);
  100912. /* harmony import */ var _isIndex_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_isIndex.js */ "./node_modules/lodash-es/_isIndex.js");
  100913. /**
  100914. * The base implementation of `_.nth` which doesn't coerce arguments.
  100915. *
  100916. * @private
  100917. * @param {Array} array The array to query.
  100918. * @param {number} n The index of the element to return.
  100919. * @returns {*} Returns the nth element of `array`.
  100920. */
  100921. function baseNth(array, n) {
  100922. var length = array.length;
  100923. if (!length) {
  100924. return;
  100925. }
  100926. n += n < 0 ? length : 0;
  100927. return Object(_isIndex_js__WEBPACK_IMPORTED_MODULE_0__["default"])(n, length) ? array[n] : undefined;
  100928. }
  100929. /* harmony default export */ __webpack_exports__["default"] = (baseNth);
  100930. /***/ }),
  100931. /***/ "./node_modules/lodash-es/_baseOrderBy.js":
  100932. /*!************************************************!*\
  100933. !*** ./node_modules/lodash-es/_baseOrderBy.js ***!
  100934. \************************************************/
  100935. /*! exports provided: default */
  100936. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  100937. "use strict";
  100938. __webpack_require__.r(__webpack_exports__);
  100939. /* harmony import */ var _arrayMap_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayMap.js */ "./node_modules/lodash-es/_arrayMap.js");
  100940. /* harmony import */ var _baseGet_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseGet.js */ "./node_modules/lodash-es/_baseGet.js");
  100941. /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
  100942. /* harmony import */ var _baseMap_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_baseMap.js */ "./node_modules/lodash-es/_baseMap.js");
  100943. /* harmony import */ var _baseSortBy_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_baseSortBy.js */ "./node_modules/lodash-es/_baseSortBy.js");
  100944. /* harmony import */ var _baseUnary_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./_baseUnary.js */ "./node_modules/lodash-es/_baseUnary.js");
  100945. /* harmony import */ var _compareMultiple_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./_compareMultiple.js */ "./node_modules/lodash-es/_compareMultiple.js");
  100946. /* harmony import */ var _identity_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./identity.js */ "./node_modules/lodash-es/identity.js");
  100947. /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
  100948. /**
  100949. * The base implementation of `_.orderBy` without param guards.
  100950. *
  100951. * @private
  100952. * @param {Array|Object} collection The collection to iterate over.
  100953. * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.
  100954. * @param {string[]} orders The sort orders of `iteratees`.
  100955. * @returns {Array} Returns the new sorted array.
  100956. */
  100957. function baseOrderBy(collection, iteratees, orders) {
  100958. if (iteratees.length) {
  100959. iteratees = Object(_arrayMap_js__WEBPACK_IMPORTED_MODULE_0__["default"])(iteratees, function(iteratee) {
  100960. if (Object(_isArray_js__WEBPACK_IMPORTED_MODULE_8__["default"])(iteratee)) {
  100961. return function(value) {
  100962. return Object(_baseGet_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value, iteratee.length === 1 ? iteratee[0] : iteratee);
  100963. }
  100964. }
  100965. return iteratee;
  100966. });
  100967. } else {
  100968. iteratees = [_identity_js__WEBPACK_IMPORTED_MODULE_7__["default"]];
  100969. }
  100970. var index = -1;
  100971. 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"]));
  100972. var result = Object(_baseMap_js__WEBPACK_IMPORTED_MODULE_3__["default"])(collection, function(value, key, collection) {
  100973. var criteria = Object(_arrayMap_js__WEBPACK_IMPORTED_MODULE_0__["default"])(iteratees, function(iteratee) {
  100974. return iteratee(value);
  100975. });
  100976. return { 'criteria': criteria, 'index': ++index, 'value': value };
  100977. });
  100978. return Object(_baseSortBy_js__WEBPACK_IMPORTED_MODULE_4__["default"])(result, function(object, other) {
  100979. return Object(_compareMultiple_js__WEBPACK_IMPORTED_MODULE_6__["default"])(object, other, orders);
  100980. });
  100981. }
  100982. /* harmony default export */ __webpack_exports__["default"] = (baseOrderBy);
  100983. /***/ }),
  100984. /***/ "./node_modules/lodash-es/_basePick.js":
  100985. /*!*********************************************!*\
  100986. !*** ./node_modules/lodash-es/_basePick.js ***!
  100987. \*********************************************/
  100988. /*! exports provided: default */
  100989. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  100990. "use strict";
  100991. __webpack_require__.r(__webpack_exports__);
  100992. /* harmony import */ var _basePickBy_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_basePickBy.js */ "./node_modules/lodash-es/_basePickBy.js");
  100993. /* harmony import */ var _hasIn_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./hasIn.js */ "./node_modules/lodash-es/hasIn.js");
  100994. /**
  100995. * The base implementation of `_.pick` without support for individual
  100996. * property identifiers.
  100997. *
  100998. * @private
  100999. * @param {Object} object The source object.
  101000. * @param {string[]} paths The property paths to pick.
  101001. * @returns {Object} Returns the new object.
  101002. */
  101003. function basePick(object, paths) {
  101004. return Object(_basePickBy_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, paths, function(value, path) {
  101005. return Object(_hasIn_js__WEBPACK_IMPORTED_MODULE_1__["default"])(object, path);
  101006. });
  101007. }
  101008. /* harmony default export */ __webpack_exports__["default"] = (basePick);
  101009. /***/ }),
  101010. /***/ "./node_modules/lodash-es/_basePickBy.js":
  101011. /*!***********************************************!*\
  101012. !*** ./node_modules/lodash-es/_basePickBy.js ***!
  101013. \***********************************************/
  101014. /*! exports provided: default */
  101015. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  101016. "use strict";
  101017. __webpack_require__.r(__webpack_exports__);
  101018. /* harmony import */ var _baseGet_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseGet.js */ "./node_modules/lodash-es/_baseGet.js");
  101019. /* harmony import */ var _baseSet_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseSet.js */ "./node_modules/lodash-es/_baseSet.js");
  101020. /* harmony import */ var _castPath_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_castPath.js */ "./node_modules/lodash-es/_castPath.js");
  101021. /**
  101022. * The base implementation of `_.pickBy` without support for iteratee shorthands.
  101023. *
  101024. * @private
  101025. * @param {Object} object The source object.
  101026. * @param {string[]} paths The property paths to pick.
  101027. * @param {Function} predicate The function invoked per property.
  101028. * @returns {Object} Returns the new object.
  101029. */
  101030. function basePickBy(object, paths, predicate) {
  101031. var index = -1,
  101032. length = paths.length,
  101033. result = {};
  101034. while (++index < length) {
  101035. var path = paths[index],
  101036. value = Object(_baseGet_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, path);
  101037. if (predicate(value, path)) {
  101038. Object(_baseSet_js__WEBPACK_IMPORTED_MODULE_1__["default"])(result, Object(_castPath_js__WEBPACK_IMPORTED_MODULE_2__["default"])(path, object), value);
  101039. }
  101040. }
  101041. return result;
  101042. }
  101043. /* harmony default export */ __webpack_exports__["default"] = (basePickBy);
  101044. /***/ }),
  101045. /***/ "./node_modules/lodash-es/_baseProperty.js":
  101046. /*!*************************************************!*\
  101047. !*** ./node_modules/lodash-es/_baseProperty.js ***!
  101048. \*************************************************/
  101049. /*! exports provided: default */
  101050. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  101051. "use strict";
  101052. __webpack_require__.r(__webpack_exports__);
  101053. /**
  101054. * The base implementation of `_.property` without support for deep paths.
  101055. *
  101056. * @private
  101057. * @param {string} key The key of the property to get.
  101058. * @returns {Function} Returns the new accessor function.
  101059. */
  101060. function baseProperty(key) {
  101061. return function(object) {
  101062. return object == null ? undefined : object[key];
  101063. };
  101064. }
  101065. /* harmony default export */ __webpack_exports__["default"] = (baseProperty);
  101066. /***/ }),
  101067. /***/ "./node_modules/lodash-es/_basePropertyDeep.js":
  101068. /*!*****************************************************!*\
  101069. !*** ./node_modules/lodash-es/_basePropertyDeep.js ***!
  101070. \*****************************************************/
  101071. /*! exports provided: default */
  101072. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  101073. "use strict";
  101074. __webpack_require__.r(__webpack_exports__);
  101075. /* harmony import */ var _baseGet_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseGet.js */ "./node_modules/lodash-es/_baseGet.js");
  101076. /**
  101077. * A specialized version of `baseProperty` which supports deep paths.
  101078. *
  101079. * @private
  101080. * @param {Array|string} path The path of the property to get.
  101081. * @returns {Function} Returns the new accessor function.
  101082. */
  101083. function basePropertyDeep(path) {
  101084. return function(object) {
  101085. return Object(_baseGet_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, path);
  101086. };
  101087. }
  101088. /* harmony default export */ __webpack_exports__["default"] = (basePropertyDeep);
  101089. /***/ }),
  101090. /***/ "./node_modules/lodash-es/_basePropertyOf.js":
  101091. /*!***************************************************!*\
  101092. !*** ./node_modules/lodash-es/_basePropertyOf.js ***!
  101093. \***************************************************/
  101094. /*! exports provided: default */
  101095. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  101096. "use strict";
  101097. __webpack_require__.r(__webpack_exports__);
  101098. /**
  101099. * The base implementation of `_.propertyOf` without support for deep paths.
  101100. *
  101101. * @private
  101102. * @param {Object} object The object to query.
  101103. * @returns {Function} Returns the new accessor function.
  101104. */
  101105. function basePropertyOf(object) {
  101106. return function(key) {
  101107. return object == null ? undefined : object[key];
  101108. };
  101109. }
  101110. /* harmony default export */ __webpack_exports__["default"] = (basePropertyOf);
  101111. /***/ }),
  101112. /***/ "./node_modules/lodash-es/_basePullAll.js":
  101113. /*!************************************************!*\
  101114. !*** ./node_modules/lodash-es/_basePullAll.js ***!
  101115. \************************************************/
  101116. /*! exports provided: default */
  101117. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  101118. "use strict";
  101119. __webpack_require__.r(__webpack_exports__);
  101120. /* harmony import */ var _arrayMap_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayMap.js */ "./node_modules/lodash-es/_arrayMap.js");
  101121. /* harmony import */ var _baseIndexOf_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseIndexOf.js */ "./node_modules/lodash-es/_baseIndexOf.js");
  101122. /* harmony import */ var _baseIndexOfWith_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseIndexOfWith.js */ "./node_modules/lodash-es/_baseIndexOfWith.js");
  101123. /* harmony import */ var _baseUnary_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_baseUnary.js */ "./node_modules/lodash-es/_baseUnary.js");
  101124. /* harmony import */ var _copyArray_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_copyArray.js */ "./node_modules/lodash-es/_copyArray.js");
  101125. /** Used for built-in method references. */
  101126. var arrayProto = Array.prototype;
  101127. /** Built-in value references. */
  101128. var splice = arrayProto.splice;
  101129. /**
  101130. * The base implementation of `_.pullAllBy` without support for iteratee
  101131. * shorthands.
  101132. *
  101133. * @private
  101134. * @param {Array} array The array to modify.
  101135. * @param {Array} values The values to remove.
  101136. * @param {Function} [iteratee] The iteratee invoked per element.
  101137. * @param {Function} [comparator] The comparator invoked per element.
  101138. * @returns {Array} Returns `array`.
  101139. */
  101140. function basePullAll(array, values, iteratee, comparator) {
  101141. var indexOf = comparator ? _baseIndexOfWith_js__WEBPACK_IMPORTED_MODULE_2__["default"] : _baseIndexOf_js__WEBPACK_IMPORTED_MODULE_1__["default"],
  101142. index = -1,
  101143. length = values.length,
  101144. seen = array;
  101145. if (array === values) {
  101146. values = Object(_copyArray_js__WEBPACK_IMPORTED_MODULE_4__["default"])(values);
  101147. }
  101148. if (iteratee) {
  101149. seen = Object(_arrayMap_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, Object(_baseUnary_js__WEBPACK_IMPORTED_MODULE_3__["default"])(iteratee));
  101150. }
  101151. while (++index < length) {
  101152. var fromIndex = 0,
  101153. value = values[index],
  101154. computed = iteratee ? iteratee(value) : value;
  101155. while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) {
  101156. if (seen !== array) {
  101157. splice.call(seen, fromIndex, 1);
  101158. }
  101159. splice.call(array, fromIndex, 1);
  101160. }
  101161. }
  101162. return array;
  101163. }
  101164. /* harmony default export */ __webpack_exports__["default"] = (basePullAll);
  101165. /***/ }),
  101166. /***/ "./node_modules/lodash-es/_basePullAt.js":
  101167. /*!***********************************************!*\
  101168. !*** ./node_modules/lodash-es/_basePullAt.js ***!
  101169. \***********************************************/
  101170. /*! exports provided: default */
  101171. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  101172. "use strict";
  101173. __webpack_require__.r(__webpack_exports__);
  101174. /* harmony import */ var _baseUnset_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseUnset.js */ "./node_modules/lodash-es/_baseUnset.js");
  101175. /* harmony import */ var _isIndex_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_isIndex.js */ "./node_modules/lodash-es/_isIndex.js");
  101176. /** Used for built-in method references. */
  101177. var arrayProto = Array.prototype;
  101178. /** Built-in value references. */
  101179. var splice = arrayProto.splice;
  101180. /**
  101181. * The base implementation of `_.pullAt` without support for individual
  101182. * indexes or capturing the removed elements.
  101183. *
  101184. * @private
  101185. * @param {Array} array The array to modify.
  101186. * @param {number[]} indexes The indexes of elements to remove.
  101187. * @returns {Array} Returns `array`.
  101188. */
  101189. function basePullAt(array, indexes) {
  101190. var length = array ? indexes.length : 0,
  101191. lastIndex = length - 1;
  101192. while (length--) {
  101193. var index = indexes[length];
  101194. if (length == lastIndex || index !== previous) {
  101195. var previous = index;
  101196. if (Object(_isIndex_js__WEBPACK_IMPORTED_MODULE_1__["default"])(index)) {
  101197. splice.call(array, index, 1);
  101198. } else {
  101199. Object(_baseUnset_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, index);
  101200. }
  101201. }
  101202. }
  101203. return array;
  101204. }
  101205. /* harmony default export */ __webpack_exports__["default"] = (basePullAt);
  101206. /***/ }),
  101207. /***/ "./node_modules/lodash-es/_baseRandom.js":
  101208. /*!***********************************************!*\
  101209. !*** ./node_modules/lodash-es/_baseRandom.js ***!
  101210. \***********************************************/
  101211. /*! exports provided: default */
  101212. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  101213. "use strict";
  101214. __webpack_require__.r(__webpack_exports__);
  101215. /* Built-in method references for those with the same name as other `lodash` methods. */
  101216. var nativeFloor = Math.floor,
  101217. nativeRandom = Math.random;
  101218. /**
  101219. * The base implementation of `_.random` without support for returning
  101220. * floating-point numbers.
  101221. *
  101222. * @private
  101223. * @param {number} lower The lower bound.
  101224. * @param {number} upper The upper bound.
  101225. * @returns {number} Returns the random number.
  101226. */
  101227. function baseRandom(lower, upper) {
  101228. return lower + nativeFloor(nativeRandom() * (upper - lower + 1));
  101229. }
  101230. /* harmony default export */ __webpack_exports__["default"] = (baseRandom);
  101231. /***/ }),
  101232. /***/ "./node_modules/lodash-es/_baseRange.js":
  101233. /*!**********************************************!*\
  101234. !*** ./node_modules/lodash-es/_baseRange.js ***!
  101235. \**********************************************/
  101236. /*! exports provided: default */
  101237. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  101238. "use strict";
  101239. __webpack_require__.r(__webpack_exports__);
  101240. /* Built-in method references for those with the same name as other `lodash` methods. */
  101241. var nativeCeil = Math.ceil,
  101242. nativeMax = Math.max;
  101243. /**
  101244. * The base implementation of `_.range` and `_.rangeRight` which doesn't
  101245. * coerce arguments.
  101246. *
  101247. * @private
  101248. * @param {number} start The start of the range.
  101249. * @param {number} end The end of the range.
  101250. * @param {number} step The value to increment or decrement by.
  101251. * @param {boolean} [fromRight] Specify iterating from right to left.
  101252. * @returns {Array} Returns the range of numbers.
  101253. */
  101254. function baseRange(start, end, step, fromRight) {
  101255. var index = -1,
  101256. length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),
  101257. result = Array(length);
  101258. while (length--) {
  101259. result[fromRight ? length : ++index] = start;
  101260. start += step;
  101261. }
  101262. return result;
  101263. }
  101264. /* harmony default export */ __webpack_exports__["default"] = (baseRange);
  101265. /***/ }),
  101266. /***/ "./node_modules/lodash-es/_baseReduce.js":
  101267. /*!***********************************************!*\
  101268. !*** ./node_modules/lodash-es/_baseReduce.js ***!
  101269. \***********************************************/
  101270. /*! exports provided: default */
  101271. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  101272. "use strict";
  101273. __webpack_require__.r(__webpack_exports__);
  101274. /**
  101275. * The base implementation of `_.reduce` and `_.reduceRight`, without support
  101276. * for iteratee shorthands, which iterates over `collection` using `eachFunc`.
  101277. *
  101278. * @private
  101279. * @param {Array|Object} collection The collection to iterate over.
  101280. * @param {Function} iteratee The function invoked per iteration.
  101281. * @param {*} accumulator The initial value.
  101282. * @param {boolean} initAccum Specify using the first or last element of
  101283. * `collection` as the initial value.
  101284. * @param {Function} eachFunc The function to iterate over `collection`.
  101285. * @returns {*} Returns the accumulated value.
  101286. */
  101287. function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {
  101288. eachFunc(collection, function(value, index, collection) {
  101289. accumulator = initAccum
  101290. ? (initAccum = false, value)
  101291. : iteratee(accumulator, value, index, collection);
  101292. });
  101293. return accumulator;
  101294. }
  101295. /* harmony default export */ __webpack_exports__["default"] = (baseReduce);
  101296. /***/ }),
  101297. /***/ "./node_modules/lodash-es/_baseRepeat.js":
  101298. /*!***********************************************!*\
  101299. !*** ./node_modules/lodash-es/_baseRepeat.js ***!
  101300. \***********************************************/
  101301. /*! exports provided: default */
  101302. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  101303. "use strict";
  101304. __webpack_require__.r(__webpack_exports__);
  101305. /** Used as references for various `Number` constants. */
  101306. var MAX_SAFE_INTEGER = 9007199254740991;
  101307. /* Built-in method references for those with the same name as other `lodash` methods. */
  101308. var nativeFloor = Math.floor;
  101309. /**
  101310. * The base implementation of `_.repeat` which doesn't coerce arguments.
  101311. *
  101312. * @private
  101313. * @param {string} string The string to repeat.
  101314. * @param {number} n The number of times to repeat the string.
  101315. * @returns {string} Returns the repeated string.
  101316. */
  101317. function baseRepeat(string, n) {
  101318. var result = '';
  101319. if (!string || n < 1 || n > MAX_SAFE_INTEGER) {
  101320. return result;
  101321. }
  101322. // Leverage the exponentiation by squaring algorithm for a faster repeat.
  101323. // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details.
  101324. do {
  101325. if (n % 2) {
  101326. result += string;
  101327. }
  101328. n = nativeFloor(n / 2);
  101329. if (n) {
  101330. string += string;
  101331. }
  101332. } while (n);
  101333. return result;
  101334. }
  101335. /* harmony default export */ __webpack_exports__["default"] = (baseRepeat);
  101336. /***/ }),
  101337. /***/ "./node_modules/lodash-es/_baseRest.js":
  101338. /*!*********************************************!*\
  101339. !*** ./node_modules/lodash-es/_baseRest.js ***!
  101340. \*********************************************/
  101341. /*! exports provided: default */
  101342. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  101343. "use strict";
  101344. __webpack_require__.r(__webpack_exports__);
  101345. /* harmony import */ var _identity_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./identity.js */ "./node_modules/lodash-es/identity.js");
  101346. /* harmony import */ var _overRest_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_overRest.js */ "./node_modules/lodash-es/_overRest.js");
  101347. /* harmony import */ var _setToString_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_setToString.js */ "./node_modules/lodash-es/_setToString.js");
  101348. /**
  101349. * The base implementation of `_.rest` which doesn't validate or coerce arguments.
  101350. *
  101351. * @private
  101352. * @param {Function} func The function to apply a rest parameter to.
  101353. * @param {number} [start=func.length-1] The start position of the rest parameter.
  101354. * @returns {Function} Returns the new function.
  101355. */
  101356. function baseRest(func, start) {
  101357. 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 + '');
  101358. }
  101359. /* harmony default export */ __webpack_exports__["default"] = (baseRest);
  101360. /***/ }),
  101361. /***/ "./node_modules/lodash-es/_baseSample.js":
  101362. /*!***********************************************!*\
  101363. !*** ./node_modules/lodash-es/_baseSample.js ***!
  101364. \***********************************************/
  101365. /*! exports provided: default */
  101366. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  101367. "use strict";
  101368. __webpack_require__.r(__webpack_exports__);
  101369. /* harmony import */ var _arraySample_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arraySample.js */ "./node_modules/lodash-es/_arraySample.js");
  101370. /* harmony import */ var _values_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./values.js */ "./node_modules/lodash-es/values.js");
  101371. /**
  101372. * The base implementation of `_.sample`.
  101373. *
  101374. * @private
  101375. * @param {Array|Object} collection The collection to sample.
  101376. * @returns {*} Returns the random element.
  101377. */
  101378. function baseSample(collection) {
  101379. return Object(_arraySample_js__WEBPACK_IMPORTED_MODULE_0__["default"])(Object(_values_js__WEBPACK_IMPORTED_MODULE_1__["default"])(collection));
  101380. }
  101381. /* harmony default export */ __webpack_exports__["default"] = (baseSample);
  101382. /***/ }),
  101383. /***/ "./node_modules/lodash-es/_baseSampleSize.js":
  101384. /*!***************************************************!*\
  101385. !*** ./node_modules/lodash-es/_baseSampleSize.js ***!
  101386. \***************************************************/
  101387. /*! exports provided: default */
  101388. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  101389. "use strict";
  101390. __webpack_require__.r(__webpack_exports__);
  101391. /* harmony import */ var _baseClamp_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseClamp.js */ "./node_modules/lodash-es/_baseClamp.js");
  101392. /* harmony import */ var _shuffleSelf_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_shuffleSelf.js */ "./node_modules/lodash-es/_shuffleSelf.js");
  101393. /* harmony import */ var _values_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./values.js */ "./node_modules/lodash-es/values.js");
  101394. /**
  101395. * The base implementation of `_.sampleSize` without param guards.
  101396. *
  101397. * @private
  101398. * @param {Array|Object} collection The collection to sample.
  101399. * @param {number} n The number of elements to sample.
  101400. * @returns {Array} Returns the random elements.
  101401. */
  101402. function baseSampleSize(collection, n) {
  101403. var array = Object(_values_js__WEBPACK_IMPORTED_MODULE_2__["default"])(collection);
  101404. return Object(_shuffleSelf_js__WEBPACK_IMPORTED_MODULE_1__["default"])(array, Object(_baseClamp_js__WEBPACK_IMPORTED_MODULE_0__["default"])(n, 0, array.length));
  101405. }
  101406. /* harmony default export */ __webpack_exports__["default"] = (baseSampleSize);
  101407. /***/ }),
  101408. /***/ "./node_modules/lodash-es/_baseSet.js":
  101409. /*!********************************************!*\
  101410. !*** ./node_modules/lodash-es/_baseSet.js ***!
  101411. \********************************************/
  101412. /*! exports provided: default */
  101413. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  101414. "use strict";
  101415. __webpack_require__.r(__webpack_exports__);
  101416. /* harmony import */ var _assignValue_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_assignValue.js */ "./node_modules/lodash-es/_assignValue.js");
  101417. /* harmony import */ var _castPath_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_castPath.js */ "./node_modules/lodash-es/_castPath.js");
  101418. /* harmony import */ var _isIndex_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_isIndex.js */ "./node_modules/lodash-es/_isIndex.js");
  101419. /* harmony import */ var _isObject_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./isObject.js */ "./node_modules/lodash-es/isObject.js");
  101420. /* harmony import */ var _toKey_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_toKey.js */ "./node_modules/lodash-es/_toKey.js");
  101421. /**
  101422. * The base implementation of `_.set`.
  101423. *
  101424. * @private
  101425. * @param {Object} object The object to modify.
  101426. * @param {Array|string} path The path of the property to set.
  101427. * @param {*} value The value to set.
  101428. * @param {Function} [customizer] The function to customize path creation.
  101429. * @returns {Object} Returns `object`.
  101430. */
  101431. function baseSet(object, path, value, customizer) {
  101432. if (!Object(_isObject_js__WEBPACK_IMPORTED_MODULE_3__["default"])(object)) {
  101433. return object;
  101434. }
  101435. path = Object(_castPath_js__WEBPACK_IMPORTED_MODULE_1__["default"])(path, object);
  101436. var index = -1,
  101437. length = path.length,
  101438. lastIndex = length - 1,
  101439. nested = object;
  101440. while (nested != null && ++index < length) {
  101441. var key = Object(_toKey_js__WEBPACK_IMPORTED_MODULE_4__["default"])(path[index]),
  101442. newValue = value;
  101443. if (key === '__proto__' || key === 'constructor' || key === 'prototype') {
  101444. return object;
  101445. }
  101446. if (index != lastIndex) {
  101447. var objValue = nested[key];
  101448. newValue = customizer ? customizer(objValue, key, nested) : undefined;
  101449. if (newValue === undefined) {
  101450. newValue = Object(_isObject_js__WEBPACK_IMPORTED_MODULE_3__["default"])(objValue)
  101451. ? objValue
  101452. : (Object(_isIndex_js__WEBPACK_IMPORTED_MODULE_2__["default"])(path[index + 1]) ? [] : {});
  101453. }
  101454. }
  101455. Object(_assignValue_js__WEBPACK_IMPORTED_MODULE_0__["default"])(nested, key, newValue);
  101456. nested = nested[key];
  101457. }
  101458. return object;
  101459. }
  101460. /* harmony default export */ __webpack_exports__["default"] = (baseSet);
  101461. /***/ }),
  101462. /***/ "./node_modules/lodash-es/_baseSetData.js":
  101463. /*!************************************************!*\
  101464. !*** ./node_modules/lodash-es/_baseSetData.js ***!
  101465. \************************************************/
  101466. /*! exports provided: default */
  101467. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  101468. "use strict";
  101469. __webpack_require__.r(__webpack_exports__);
  101470. /* harmony import */ var _identity_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./identity.js */ "./node_modules/lodash-es/identity.js");
  101471. /* harmony import */ var _metaMap_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_metaMap.js */ "./node_modules/lodash-es/_metaMap.js");
  101472. /**
  101473. * The base implementation of `setData` without support for hot loop shorting.
  101474. *
  101475. * @private
  101476. * @param {Function} func The function to associate metadata with.
  101477. * @param {*} data The metadata.
  101478. * @returns {Function} Returns `func`.
  101479. */
  101480. var baseSetData = !_metaMap_js__WEBPACK_IMPORTED_MODULE_1__["default"] ? _identity_js__WEBPACK_IMPORTED_MODULE_0__["default"] : function(func, data) {
  101481. _metaMap_js__WEBPACK_IMPORTED_MODULE_1__["default"].set(func, data);
  101482. return func;
  101483. };
  101484. /* harmony default export */ __webpack_exports__["default"] = (baseSetData);
  101485. /***/ }),
  101486. /***/ "./node_modules/lodash-es/_baseSetToString.js":
  101487. /*!****************************************************!*\
  101488. !*** ./node_modules/lodash-es/_baseSetToString.js ***!
  101489. \****************************************************/
  101490. /*! exports provided: default */
  101491. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  101492. "use strict";
  101493. __webpack_require__.r(__webpack_exports__);
  101494. /* harmony import */ var _constant_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./constant.js */ "./node_modules/lodash-es/constant.js");
  101495. /* harmony import */ var _defineProperty_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_defineProperty.js */ "./node_modules/lodash-es/_defineProperty.js");
  101496. /* harmony import */ var _identity_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./identity.js */ "./node_modules/lodash-es/identity.js");
  101497. /**
  101498. * The base implementation of `setToString` without support for hot loop shorting.
  101499. *
  101500. * @private
  101501. * @param {Function} func The function to modify.
  101502. * @param {Function} string The `toString` result.
  101503. * @returns {Function} Returns `func`.
  101504. */
  101505. var baseSetToString = !_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"] ? _identity_js__WEBPACK_IMPORTED_MODULE_2__["default"] : function(func, string) {
  101506. return Object(_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(func, 'toString', {
  101507. 'configurable': true,
  101508. 'enumerable': false,
  101509. 'value': Object(_constant_js__WEBPACK_IMPORTED_MODULE_0__["default"])(string),
  101510. 'writable': true
  101511. });
  101512. };
  101513. /* harmony default export */ __webpack_exports__["default"] = (baseSetToString);
  101514. /***/ }),
  101515. /***/ "./node_modules/lodash-es/_baseShuffle.js":
  101516. /*!************************************************!*\
  101517. !*** ./node_modules/lodash-es/_baseShuffle.js ***!
  101518. \************************************************/
  101519. /*! exports provided: default */
  101520. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  101521. "use strict";
  101522. __webpack_require__.r(__webpack_exports__);
  101523. /* harmony import */ var _shuffleSelf_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_shuffleSelf.js */ "./node_modules/lodash-es/_shuffleSelf.js");
  101524. /* harmony import */ var _values_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./values.js */ "./node_modules/lodash-es/values.js");
  101525. /**
  101526. * The base implementation of `_.shuffle`.
  101527. *
  101528. * @private
  101529. * @param {Array|Object} collection The collection to shuffle.
  101530. * @returns {Array} Returns the new shuffled array.
  101531. */
  101532. function baseShuffle(collection) {
  101533. return Object(_shuffleSelf_js__WEBPACK_IMPORTED_MODULE_0__["default"])(Object(_values_js__WEBPACK_IMPORTED_MODULE_1__["default"])(collection));
  101534. }
  101535. /* harmony default export */ __webpack_exports__["default"] = (baseShuffle);
  101536. /***/ }),
  101537. /***/ "./node_modules/lodash-es/_baseSlice.js":
  101538. /*!**********************************************!*\
  101539. !*** ./node_modules/lodash-es/_baseSlice.js ***!
  101540. \**********************************************/
  101541. /*! exports provided: default */
  101542. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  101543. "use strict";
  101544. __webpack_require__.r(__webpack_exports__);
  101545. /**
  101546. * The base implementation of `_.slice` without an iteratee call guard.
  101547. *
  101548. * @private
  101549. * @param {Array} array The array to slice.
  101550. * @param {number} [start=0] The start position.
  101551. * @param {number} [end=array.length] The end position.
  101552. * @returns {Array} Returns the slice of `array`.
  101553. */
  101554. function baseSlice(array, start, end) {
  101555. var index = -1,
  101556. length = array.length;
  101557. if (start < 0) {
  101558. start = -start > length ? 0 : (length + start);
  101559. }
  101560. end = end > length ? length : end;
  101561. if (end < 0) {
  101562. end += length;
  101563. }
  101564. length = start > end ? 0 : ((end - start) >>> 0);
  101565. start >>>= 0;
  101566. var result = Array(length);
  101567. while (++index < length) {
  101568. result[index] = array[index + start];
  101569. }
  101570. return result;
  101571. }
  101572. /* harmony default export */ __webpack_exports__["default"] = (baseSlice);
  101573. /***/ }),
  101574. /***/ "./node_modules/lodash-es/_baseSome.js":
  101575. /*!*********************************************!*\
  101576. !*** ./node_modules/lodash-es/_baseSome.js ***!
  101577. \*********************************************/
  101578. /*! exports provided: default */
  101579. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  101580. "use strict";
  101581. __webpack_require__.r(__webpack_exports__);
  101582. /* harmony import */ var _baseEach_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseEach.js */ "./node_modules/lodash-es/_baseEach.js");
  101583. /**
  101584. * The base implementation of `_.some` without support for iteratee shorthands.
  101585. *
  101586. * @private
  101587. * @param {Array|Object} collection The collection to iterate over.
  101588. * @param {Function} predicate The function invoked per iteration.
  101589. * @returns {boolean} Returns `true` if any element passes the predicate check,
  101590. * else `false`.
  101591. */
  101592. function baseSome(collection, predicate) {
  101593. var result;
  101594. Object(_baseEach_js__WEBPACK_IMPORTED_MODULE_0__["default"])(collection, function(value, index, collection) {
  101595. result = predicate(value, index, collection);
  101596. return !result;
  101597. });
  101598. return !!result;
  101599. }
  101600. /* harmony default export */ __webpack_exports__["default"] = (baseSome);
  101601. /***/ }),
  101602. /***/ "./node_modules/lodash-es/_baseSortBy.js":
  101603. /*!***********************************************!*\
  101604. !*** ./node_modules/lodash-es/_baseSortBy.js ***!
  101605. \***********************************************/
  101606. /*! exports provided: default */
  101607. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  101608. "use strict";
  101609. __webpack_require__.r(__webpack_exports__);
  101610. /**
  101611. * The base implementation of `_.sortBy` which uses `comparer` to define the
  101612. * sort order of `array` and replaces criteria objects with their corresponding
  101613. * values.
  101614. *
  101615. * @private
  101616. * @param {Array} array The array to sort.
  101617. * @param {Function} comparer The function to define sort order.
  101618. * @returns {Array} Returns `array`.
  101619. */
  101620. function baseSortBy(array, comparer) {
  101621. var length = array.length;
  101622. array.sort(comparer);
  101623. while (length--) {
  101624. array[length] = array[length].value;
  101625. }
  101626. return array;
  101627. }
  101628. /* harmony default export */ __webpack_exports__["default"] = (baseSortBy);
  101629. /***/ }),
  101630. /***/ "./node_modules/lodash-es/_baseSortedIndex.js":
  101631. /*!****************************************************!*\
  101632. !*** ./node_modules/lodash-es/_baseSortedIndex.js ***!
  101633. \****************************************************/
  101634. /*! exports provided: default */
  101635. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  101636. "use strict";
  101637. __webpack_require__.r(__webpack_exports__);
  101638. /* harmony import */ var _baseSortedIndexBy_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseSortedIndexBy.js */ "./node_modules/lodash-es/_baseSortedIndexBy.js");
  101639. /* harmony import */ var _identity_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./identity.js */ "./node_modules/lodash-es/identity.js");
  101640. /* harmony import */ var _isSymbol_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./isSymbol.js */ "./node_modules/lodash-es/isSymbol.js");
  101641. /** Used as references for the maximum length and index of an array. */
  101642. var MAX_ARRAY_LENGTH = 4294967295,
  101643. HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;
  101644. /**
  101645. * The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which
  101646. * performs a binary search of `array` to determine the index at which `value`
  101647. * should be inserted into `array` in order to maintain its sort order.
  101648. *
  101649. * @private
  101650. * @param {Array} array The sorted array to inspect.
  101651. * @param {*} value The value to evaluate.
  101652. * @param {boolean} [retHighest] Specify returning the highest qualified index.
  101653. * @returns {number} Returns the index at which `value` should be inserted
  101654. * into `array`.
  101655. */
  101656. function baseSortedIndex(array, value, retHighest) {
  101657. var low = 0,
  101658. high = array == null ? low : array.length;
  101659. if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) {
  101660. while (low < high) {
  101661. var mid = (low + high) >>> 1,
  101662. computed = array[mid];
  101663. if (computed !== null && !Object(_isSymbol_js__WEBPACK_IMPORTED_MODULE_2__["default"])(computed) &&
  101664. (retHighest ? (computed <= value) : (computed < value))) {
  101665. low = mid + 1;
  101666. } else {
  101667. high = mid;
  101668. }
  101669. }
  101670. return high;
  101671. }
  101672. return Object(_baseSortedIndexBy_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, value, _identity_js__WEBPACK_IMPORTED_MODULE_1__["default"], retHighest);
  101673. }
  101674. /* harmony default export */ __webpack_exports__["default"] = (baseSortedIndex);
  101675. /***/ }),
  101676. /***/ "./node_modules/lodash-es/_baseSortedIndexBy.js":
  101677. /*!******************************************************!*\
  101678. !*** ./node_modules/lodash-es/_baseSortedIndexBy.js ***!
  101679. \******************************************************/
  101680. /*! exports provided: default */
  101681. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  101682. "use strict";
  101683. __webpack_require__.r(__webpack_exports__);
  101684. /* harmony import */ var _isSymbol_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isSymbol.js */ "./node_modules/lodash-es/isSymbol.js");
  101685. /** Used as references for the maximum length and index of an array. */
  101686. var MAX_ARRAY_LENGTH = 4294967295,
  101687. MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1;
  101688. /* Built-in method references for those with the same name as other `lodash` methods. */
  101689. var nativeFloor = Math.floor,
  101690. nativeMin = Math.min;
  101691. /**
  101692. * The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy`
  101693. * which invokes `iteratee` for `value` and each element of `array` to compute
  101694. * their sort ranking. The iteratee is invoked with one argument; (value).
  101695. *
  101696. * @private
  101697. * @param {Array} array The sorted array to inspect.
  101698. * @param {*} value The value to evaluate.
  101699. * @param {Function} iteratee The iteratee invoked per element.
  101700. * @param {boolean} [retHighest] Specify returning the highest qualified index.
  101701. * @returns {number} Returns the index at which `value` should be inserted
  101702. * into `array`.
  101703. */
  101704. function baseSortedIndexBy(array, value, iteratee, retHighest) {
  101705. var low = 0,
  101706. high = array == null ? 0 : array.length;
  101707. if (high === 0) {
  101708. return 0;
  101709. }
  101710. value = iteratee(value);
  101711. var valIsNaN = value !== value,
  101712. valIsNull = value === null,
  101713. valIsSymbol = Object(_isSymbol_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value),
  101714. valIsUndefined = value === undefined;
  101715. while (low < high) {
  101716. var mid = nativeFloor((low + high) / 2),
  101717. computed = iteratee(array[mid]),
  101718. othIsDefined = computed !== undefined,
  101719. othIsNull = computed === null,
  101720. othIsReflexive = computed === computed,
  101721. othIsSymbol = Object(_isSymbol_js__WEBPACK_IMPORTED_MODULE_0__["default"])(computed);
  101722. if (valIsNaN) {
  101723. var setLow = retHighest || othIsReflexive;
  101724. } else if (valIsUndefined) {
  101725. setLow = othIsReflexive && (retHighest || othIsDefined);
  101726. } else if (valIsNull) {
  101727. setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull);
  101728. } else if (valIsSymbol) {
  101729. setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol);
  101730. } else if (othIsNull || othIsSymbol) {
  101731. setLow = false;
  101732. } else {
  101733. setLow = retHighest ? (computed <= value) : (computed < value);
  101734. }
  101735. if (setLow) {
  101736. low = mid + 1;
  101737. } else {
  101738. high = mid;
  101739. }
  101740. }
  101741. return nativeMin(high, MAX_ARRAY_INDEX);
  101742. }
  101743. /* harmony default export */ __webpack_exports__["default"] = (baseSortedIndexBy);
  101744. /***/ }),
  101745. /***/ "./node_modules/lodash-es/_baseSortedUniq.js":
  101746. /*!***************************************************!*\
  101747. !*** ./node_modules/lodash-es/_baseSortedUniq.js ***!
  101748. \***************************************************/
  101749. /*! exports provided: default */
  101750. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  101751. "use strict";
  101752. __webpack_require__.r(__webpack_exports__);
  101753. /* harmony import */ var _eq_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./eq.js */ "./node_modules/lodash-es/eq.js");
  101754. /**
  101755. * The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without
  101756. * support for iteratee shorthands.
  101757. *
  101758. * @private
  101759. * @param {Array} array The array to inspect.
  101760. * @param {Function} [iteratee] The iteratee invoked per element.
  101761. * @returns {Array} Returns the new duplicate free array.
  101762. */
  101763. function baseSortedUniq(array, iteratee) {
  101764. var index = -1,
  101765. length = array.length,
  101766. resIndex = 0,
  101767. result = [];
  101768. while (++index < length) {
  101769. var value = array[index],
  101770. computed = iteratee ? iteratee(value) : value;
  101771. if (!index || !Object(_eq_js__WEBPACK_IMPORTED_MODULE_0__["default"])(computed, seen)) {
  101772. var seen = computed;
  101773. result[resIndex++] = value === 0 ? 0 : value;
  101774. }
  101775. }
  101776. return result;
  101777. }
  101778. /* harmony default export */ __webpack_exports__["default"] = (baseSortedUniq);
  101779. /***/ }),
  101780. /***/ "./node_modules/lodash-es/_baseSum.js":
  101781. /*!********************************************!*\
  101782. !*** ./node_modules/lodash-es/_baseSum.js ***!
  101783. \********************************************/
  101784. /*! exports provided: default */
  101785. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  101786. "use strict";
  101787. __webpack_require__.r(__webpack_exports__);
  101788. /**
  101789. * The base implementation of `_.sum` and `_.sumBy` without support for
  101790. * iteratee shorthands.
  101791. *
  101792. * @private
  101793. * @param {Array} array The array to iterate over.
  101794. * @param {Function} iteratee The function invoked per iteration.
  101795. * @returns {number} Returns the sum.
  101796. */
  101797. function baseSum(array, iteratee) {
  101798. var result,
  101799. index = -1,
  101800. length = array.length;
  101801. while (++index < length) {
  101802. var current = iteratee(array[index]);
  101803. if (current !== undefined) {
  101804. result = result === undefined ? current : (result + current);
  101805. }
  101806. }
  101807. return result;
  101808. }
  101809. /* harmony default export */ __webpack_exports__["default"] = (baseSum);
  101810. /***/ }),
  101811. /***/ "./node_modules/lodash-es/_baseTimes.js":
  101812. /*!**********************************************!*\
  101813. !*** ./node_modules/lodash-es/_baseTimes.js ***!
  101814. \**********************************************/
  101815. /*! exports provided: default */
  101816. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  101817. "use strict";
  101818. __webpack_require__.r(__webpack_exports__);
  101819. /**
  101820. * The base implementation of `_.times` without support for iteratee shorthands
  101821. * or max array length checks.
  101822. *
  101823. * @private
  101824. * @param {number} n The number of times to invoke `iteratee`.
  101825. * @param {Function} iteratee The function invoked per iteration.
  101826. * @returns {Array} Returns the array of results.
  101827. */
  101828. function baseTimes(n, iteratee) {
  101829. var index = -1,
  101830. result = Array(n);
  101831. while (++index < n) {
  101832. result[index] = iteratee(index);
  101833. }
  101834. return result;
  101835. }
  101836. /* harmony default export */ __webpack_exports__["default"] = (baseTimes);
  101837. /***/ }),
  101838. /***/ "./node_modules/lodash-es/_baseToNumber.js":
  101839. /*!*************************************************!*\
  101840. !*** ./node_modules/lodash-es/_baseToNumber.js ***!
  101841. \*************************************************/
  101842. /*! exports provided: default */
  101843. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  101844. "use strict";
  101845. __webpack_require__.r(__webpack_exports__);
  101846. /* harmony import */ var _isSymbol_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isSymbol.js */ "./node_modules/lodash-es/isSymbol.js");
  101847. /** Used as references for various `Number` constants. */
  101848. var NAN = 0 / 0;
  101849. /**
  101850. * The base implementation of `_.toNumber` which doesn't ensure correct
  101851. * conversions of binary, hexadecimal, or octal string values.
  101852. *
  101853. * @private
  101854. * @param {*} value The value to process.
  101855. * @returns {number} Returns the number.
  101856. */
  101857. function baseToNumber(value) {
  101858. if (typeof value == 'number') {
  101859. return value;
  101860. }
  101861. if (Object(_isSymbol_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value)) {
  101862. return NAN;
  101863. }
  101864. return +value;
  101865. }
  101866. /* harmony default export */ __webpack_exports__["default"] = (baseToNumber);
  101867. /***/ }),
  101868. /***/ "./node_modules/lodash-es/_baseToPairs.js":
  101869. /*!************************************************!*\
  101870. !*** ./node_modules/lodash-es/_baseToPairs.js ***!
  101871. \************************************************/
  101872. /*! exports provided: default */
  101873. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  101874. "use strict";
  101875. __webpack_require__.r(__webpack_exports__);
  101876. /* harmony import */ var _arrayMap_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayMap.js */ "./node_modules/lodash-es/_arrayMap.js");
  101877. /**
  101878. * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array
  101879. * of key-value pairs for `object` corresponding to the property names of `props`.
  101880. *
  101881. * @private
  101882. * @param {Object} object The object to query.
  101883. * @param {Array} props The property names to get values for.
  101884. * @returns {Object} Returns the key-value pairs.
  101885. */
  101886. function baseToPairs(object, props) {
  101887. return Object(_arrayMap_js__WEBPACK_IMPORTED_MODULE_0__["default"])(props, function(key) {
  101888. return [key, object[key]];
  101889. });
  101890. }
  101891. /* harmony default export */ __webpack_exports__["default"] = (baseToPairs);
  101892. /***/ }),
  101893. /***/ "./node_modules/lodash-es/_baseToString.js":
  101894. /*!*************************************************!*\
  101895. !*** ./node_modules/lodash-es/_baseToString.js ***!
  101896. \*************************************************/
  101897. /*! exports provided: default */
  101898. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  101899. "use strict";
  101900. __webpack_require__.r(__webpack_exports__);
  101901. /* harmony import */ var _Symbol_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_Symbol.js */ "./node_modules/lodash-es/_Symbol.js");
  101902. /* harmony import */ var _arrayMap_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_arrayMap.js */ "./node_modules/lodash-es/_arrayMap.js");
  101903. /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
  101904. /* harmony import */ var _isSymbol_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./isSymbol.js */ "./node_modules/lodash-es/isSymbol.js");
  101905. /** Used as references for various `Number` constants. */
  101906. var INFINITY = 1 / 0;
  101907. /** Used to convert symbols to primitives and strings. */
  101908. var symbolProto = _Symbol_js__WEBPACK_IMPORTED_MODULE_0__["default"] ? _Symbol_js__WEBPACK_IMPORTED_MODULE_0__["default"].prototype : undefined,
  101909. symbolToString = symbolProto ? symbolProto.toString : undefined;
  101910. /**
  101911. * The base implementation of `_.toString` which doesn't convert nullish
  101912. * values to empty strings.
  101913. *
  101914. * @private
  101915. * @param {*} value The value to process.
  101916. * @returns {string} Returns the string.
  101917. */
  101918. function baseToString(value) {
  101919. // Exit early for strings to avoid a performance hit in some environments.
  101920. if (typeof value == 'string') {
  101921. return value;
  101922. }
  101923. if (Object(_isArray_js__WEBPACK_IMPORTED_MODULE_2__["default"])(value)) {
  101924. // Recursively convert values (susceptible to call stack limits).
  101925. return Object(_arrayMap_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value, baseToString) + '';
  101926. }
  101927. if (Object(_isSymbol_js__WEBPACK_IMPORTED_MODULE_3__["default"])(value)) {
  101928. return symbolToString ? symbolToString.call(value) : '';
  101929. }
  101930. var result = (value + '');
  101931. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  101932. }
  101933. /* harmony default export */ __webpack_exports__["default"] = (baseToString);
  101934. /***/ }),
  101935. /***/ "./node_modules/lodash-es/_baseTrim.js":
  101936. /*!*********************************************!*\
  101937. !*** ./node_modules/lodash-es/_baseTrim.js ***!
  101938. \*********************************************/
  101939. /*! exports provided: default */
  101940. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  101941. "use strict";
  101942. __webpack_require__.r(__webpack_exports__);
  101943. /* harmony import */ var _trimmedEndIndex_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_trimmedEndIndex.js */ "./node_modules/lodash-es/_trimmedEndIndex.js");
  101944. /** Used to match leading whitespace. */
  101945. var reTrimStart = /^\s+/;
  101946. /**
  101947. * The base implementation of `_.trim`.
  101948. *
  101949. * @private
  101950. * @param {string} string The string to trim.
  101951. * @returns {string} Returns the trimmed string.
  101952. */
  101953. function baseTrim(string) {
  101954. return string
  101955. ? string.slice(0, Object(_trimmedEndIndex_js__WEBPACK_IMPORTED_MODULE_0__["default"])(string) + 1).replace(reTrimStart, '')
  101956. : string;
  101957. }
  101958. /* harmony default export */ __webpack_exports__["default"] = (baseTrim);
  101959. /***/ }),
  101960. /***/ "./node_modules/lodash-es/_baseUnary.js":
  101961. /*!**********************************************!*\
  101962. !*** ./node_modules/lodash-es/_baseUnary.js ***!
  101963. \**********************************************/
  101964. /*! exports provided: default */
  101965. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  101966. "use strict";
  101967. __webpack_require__.r(__webpack_exports__);
  101968. /**
  101969. * The base implementation of `_.unary` without support for storing metadata.
  101970. *
  101971. * @private
  101972. * @param {Function} func The function to cap arguments for.
  101973. * @returns {Function} Returns the new capped function.
  101974. */
  101975. function baseUnary(func) {
  101976. return function(value) {
  101977. return func(value);
  101978. };
  101979. }
  101980. /* harmony default export */ __webpack_exports__["default"] = (baseUnary);
  101981. /***/ }),
  101982. /***/ "./node_modules/lodash-es/_baseUniq.js":
  101983. /*!*********************************************!*\
  101984. !*** ./node_modules/lodash-es/_baseUniq.js ***!
  101985. \*********************************************/
  101986. /*! exports provided: default */
  101987. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  101988. "use strict";
  101989. __webpack_require__.r(__webpack_exports__);
  101990. /* harmony import */ var _SetCache_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_SetCache.js */ "./node_modules/lodash-es/_SetCache.js");
  101991. /* harmony import */ var _arrayIncludes_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_arrayIncludes.js */ "./node_modules/lodash-es/_arrayIncludes.js");
  101992. /* harmony import */ var _arrayIncludesWith_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_arrayIncludesWith.js */ "./node_modules/lodash-es/_arrayIncludesWith.js");
  101993. /* harmony import */ var _cacheHas_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_cacheHas.js */ "./node_modules/lodash-es/_cacheHas.js");
  101994. /* harmony import */ var _createSet_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_createSet.js */ "./node_modules/lodash-es/_createSet.js");
  101995. /* harmony import */ var _setToArray_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./_setToArray.js */ "./node_modules/lodash-es/_setToArray.js");
  101996. /** Used as the size to enable large array optimizations. */
  101997. var LARGE_ARRAY_SIZE = 200;
  101998. /**
  101999. * The base implementation of `_.uniqBy` without support for iteratee shorthands.
  102000. *
  102001. * @private
  102002. * @param {Array} array The array to inspect.
  102003. * @param {Function} [iteratee] The iteratee invoked per element.
  102004. * @param {Function} [comparator] The comparator invoked per element.
  102005. * @returns {Array} Returns the new duplicate free array.
  102006. */
  102007. function baseUniq(array, iteratee, comparator) {
  102008. var index = -1,
  102009. includes = _arrayIncludes_js__WEBPACK_IMPORTED_MODULE_1__["default"],
  102010. length = array.length,
  102011. isCommon = true,
  102012. result = [],
  102013. seen = result;
  102014. if (comparator) {
  102015. isCommon = false;
  102016. includes = _arrayIncludesWith_js__WEBPACK_IMPORTED_MODULE_2__["default"];
  102017. }
  102018. else if (length >= LARGE_ARRAY_SIZE) {
  102019. var set = iteratee ? null : Object(_createSet_js__WEBPACK_IMPORTED_MODULE_4__["default"])(array);
  102020. if (set) {
  102021. return Object(_setToArray_js__WEBPACK_IMPORTED_MODULE_5__["default"])(set);
  102022. }
  102023. isCommon = false;
  102024. includes = _cacheHas_js__WEBPACK_IMPORTED_MODULE_3__["default"];
  102025. seen = new _SetCache_js__WEBPACK_IMPORTED_MODULE_0__["default"];
  102026. }
  102027. else {
  102028. seen = iteratee ? [] : result;
  102029. }
  102030. outer:
  102031. while (++index < length) {
  102032. var value = array[index],
  102033. computed = iteratee ? iteratee(value) : value;
  102034. value = (comparator || value !== 0) ? value : 0;
  102035. if (isCommon && computed === computed) {
  102036. var seenIndex = seen.length;
  102037. while (seenIndex--) {
  102038. if (seen[seenIndex] === computed) {
  102039. continue outer;
  102040. }
  102041. }
  102042. if (iteratee) {
  102043. seen.push(computed);
  102044. }
  102045. result.push(value);
  102046. }
  102047. else if (!includes(seen, computed, comparator)) {
  102048. if (seen !== result) {
  102049. seen.push(computed);
  102050. }
  102051. result.push(value);
  102052. }
  102053. }
  102054. return result;
  102055. }
  102056. /* harmony default export */ __webpack_exports__["default"] = (baseUniq);
  102057. /***/ }),
  102058. /***/ "./node_modules/lodash-es/_baseUnset.js":
  102059. /*!**********************************************!*\
  102060. !*** ./node_modules/lodash-es/_baseUnset.js ***!
  102061. \**********************************************/
  102062. /*! exports provided: default */
  102063. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  102064. "use strict";
  102065. __webpack_require__.r(__webpack_exports__);
  102066. /* harmony import */ var _castPath_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_castPath.js */ "./node_modules/lodash-es/_castPath.js");
  102067. /* harmony import */ var _last_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./last.js */ "./node_modules/lodash-es/last.js");
  102068. /* harmony import */ var _parent_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_parent.js */ "./node_modules/lodash-es/_parent.js");
  102069. /* harmony import */ var _toKey_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_toKey.js */ "./node_modules/lodash-es/_toKey.js");
  102070. /**
  102071. * The base implementation of `_.unset`.
  102072. *
  102073. * @private
  102074. * @param {Object} object The object to modify.
  102075. * @param {Array|string} path The property path to unset.
  102076. * @returns {boolean} Returns `true` if the property is deleted, else `false`.
  102077. */
  102078. function baseUnset(object, path) {
  102079. path = Object(_castPath_js__WEBPACK_IMPORTED_MODULE_0__["default"])(path, object);
  102080. object = Object(_parent_js__WEBPACK_IMPORTED_MODULE_2__["default"])(object, path);
  102081. return object == null || delete object[Object(_toKey_js__WEBPACK_IMPORTED_MODULE_3__["default"])(Object(_last_js__WEBPACK_IMPORTED_MODULE_1__["default"])(path))];
  102082. }
  102083. /* harmony default export */ __webpack_exports__["default"] = (baseUnset);
  102084. /***/ }),
  102085. /***/ "./node_modules/lodash-es/_baseUpdate.js":
  102086. /*!***********************************************!*\
  102087. !*** ./node_modules/lodash-es/_baseUpdate.js ***!
  102088. \***********************************************/
  102089. /*! exports provided: default */
  102090. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  102091. "use strict";
  102092. __webpack_require__.r(__webpack_exports__);
  102093. /* harmony import */ var _baseGet_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseGet.js */ "./node_modules/lodash-es/_baseGet.js");
  102094. /* harmony import */ var _baseSet_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseSet.js */ "./node_modules/lodash-es/_baseSet.js");
  102095. /**
  102096. * The base implementation of `_.update`.
  102097. *
  102098. * @private
  102099. * @param {Object} object The object to modify.
  102100. * @param {Array|string} path The path of the property to update.
  102101. * @param {Function} updater The function to produce the updated value.
  102102. * @param {Function} [customizer] The function to customize path creation.
  102103. * @returns {Object} Returns `object`.
  102104. */
  102105. function baseUpdate(object, path, updater, customizer) {
  102106. return Object(_baseSet_js__WEBPACK_IMPORTED_MODULE_1__["default"])(object, path, updater(Object(_baseGet_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, path)), customizer);
  102107. }
  102108. /* harmony default export */ __webpack_exports__["default"] = (baseUpdate);
  102109. /***/ }),
  102110. /***/ "./node_modules/lodash-es/_baseValues.js":
  102111. /*!***********************************************!*\
  102112. !*** ./node_modules/lodash-es/_baseValues.js ***!
  102113. \***********************************************/
  102114. /*! exports provided: default */
  102115. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  102116. "use strict";
  102117. __webpack_require__.r(__webpack_exports__);
  102118. /* harmony import */ var _arrayMap_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayMap.js */ "./node_modules/lodash-es/_arrayMap.js");
  102119. /**
  102120. * The base implementation of `_.values` and `_.valuesIn` which creates an
  102121. * array of `object` property values corresponding to the property names
  102122. * of `props`.
  102123. *
  102124. * @private
  102125. * @param {Object} object The object to query.
  102126. * @param {Array} props The property names to get values for.
  102127. * @returns {Object} Returns the array of property values.
  102128. */
  102129. function baseValues(object, props) {
  102130. return Object(_arrayMap_js__WEBPACK_IMPORTED_MODULE_0__["default"])(props, function(key) {
  102131. return object[key];
  102132. });
  102133. }
  102134. /* harmony default export */ __webpack_exports__["default"] = (baseValues);
  102135. /***/ }),
  102136. /***/ "./node_modules/lodash-es/_baseWhile.js":
  102137. /*!**********************************************!*\
  102138. !*** ./node_modules/lodash-es/_baseWhile.js ***!
  102139. \**********************************************/
  102140. /*! exports provided: default */
  102141. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  102142. "use strict";
  102143. __webpack_require__.r(__webpack_exports__);
  102144. /* harmony import */ var _baseSlice_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseSlice.js */ "./node_modules/lodash-es/_baseSlice.js");
  102145. /**
  102146. * The base implementation of methods like `_.dropWhile` and `_.takeWhile`
  102147. * without support for iteratee shorthands.
  102148. *
  102149. * @private
  102150. * @param {Array} array The array to query.
  102151. * @param {Function} predicate The function invoked per iteration.
  102152. * @param {boolean} [isDrop] Specify dropping elements instead of taking them.
  102153. * @param {boolean} [fromRight] Specify iterating from right to left.
  102154. * @returns {Array} Returns the slice of `array`.
  102155. */
  102156. function baseWhile(array, predicate, isDrop, fromRight) {
  102157. var length = array.length,
  102158. index = fromRight ? length : -1;
  102159. while ((fromRight ? index-- : ++index < length) &&
  102160. predicate(array[index], index, array)) {}
  102161. return isDrop
  102162. ? Object(_baseSlice_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length))
  102163. : Object(_baseSlice_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, (fromRight ? index + 1 : 0), (fromRight ? length : index));
  102164. }
  102165. /* harmony default export */ __webpack_exports__["default"] = (baseWhile);
  102166. /***/ }),
  102167. /***/ "./node_modules/lodash-es/_baseWrapperValue.js":
  102168. /*!*****************************************************!*\
  102169. !*** ./node_modules/lodash-es/_baseWrapperValue.js ***!
  102170. \*****************************************************/
  102171. /*! exports provided: default */
  102172. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  102173. "use strict";
  102174. __webpack_require__.r(__webpack_exports__);
  102175. /* harmony import */ var _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_LazyWrapper.js */ "./node_modules/lodash-es/_LazyWrapper.js");
  102176. /* harmony import */ var _arrayPush_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_arrayPush.js */ "./node_modules/lodash-es/_arrayPush.js");
  102177. /* harmony import */ var _arrayReduce_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_arrayReduce.js */ "./node_modules/lodash-es/_arrayReduce.js");
  102178. /**
  102179. * The base implementation of `wrapperValue` which returns the result of
  102180. * performing a sequence of actions on the unwrapped `value`, where each
  102181. * successive action is supplied the return value of the previous.
  102182. *
  102183. * @private
  102184. * @param {*} value The unwrapped value.
  102185. * @param {Array} actions Actions to perform to resolve the unwrapped value.
  102186. * @returns {*} Returns the resolved value.
  102187. */
  102188. function baseWrapperValue(value, actions) {
  102189. var result = value;
  102190. if (result instanceof _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_0__["default"]) {
  102191. result = result.value();
  102192. }
  102193. return Object(_arrayReduce_js__WEBPACK_IMPORTED_MODULE_2__["default"])(actions, function(result, action) {
  102194. return action.func.apply(action.thisArg, Object(_arrayPush_js__WEBPACK_IMPORTED_MODULE_1__["default"])([result], action.args));
  102195. }, result);
  102196. }
  102197. /* harmony default export */ __webpack_exports__["default"] = (baseWrapperValue);
  102198. /***/ }),
  102199. /***/ "./node_modules/lodash-es/_baseXor.js":
  102200. /*!********************************************!*\
  102201. !*** ./node_modules/lodash-es/_baseXor.js ***!
  102202. \********************************************/
  102203. /*! exports provided: default */
  102204. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  102205. "use strict";
  102206. __webpack_require__.r(__webpack_exports__);
  102207. /* harmony import */ var _baseDifference_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseDifference.js */ "./node_modules/lodash-es/_baseDifference.js");
  102208. /* harmony import */ var _baseFlatten_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseFlatten.js */ "./node_modules/lodash-es/_baseFlatten.js");
  102209. /* harmony import */ var _baseUniq_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseUniq.js */ "./node_modules/lodash-es/_baseUniq.js");
  102210. /**
  102211. * The base implementation of methods like `_.xor`, without support for
  102212. * iteratee shorthands, that accepts an array of arrays to inspect.
  102213. *
  102214. * @private
  102215. * @param {Array} arrays The arrays to inspect.
  102216. * @param {Function} [iteratee] The iteratee invoked per element.
  102217. * @param {Function} [comparator] The comparator invoked per element.
  102218. * @returns {Array} Returns the new array of values.
  102219. */
  102220. function baseXor(arrays, iteratee, comparator) {
  102221. var length = arrays.length;
  102222. if (length < 2) {
  102223. return length ? Object(_baseUniq_js__WEBPACK_IMPORTED_MODULE_2__["default"])(arrays[0]) : [];
  102224. }
  102225. var index = -1,
  102226. result = Array(length);
  102227. while (++index < length) {
  102228. var array = arrays[index],
  102229. othIndex = -1;
  102230. while (++othIndex < length) {
  102231. if (othIndex != index) {
  102232. result[index] = Object(_baseDifference_js__WEBPACK_IMPORTED_MODULE_0__["default"])(result[index] || array, arrays[othIndex], iteratee, comparator);
  102233. }
  102234. }
  102235. }
  102236. return Object(_baseUniq_js__WEBPACK_IMPORTED_MODULE_2__["default"])(Object(_baseFlatten_js__WEBPACK_IMPORTED_MODULE_1__["default"])(result, 1), iteratee, comparator);
  102237. }
  102238. /* harmony default export */ __webpack_exports__["default"] = (baseXor);
  102239. /***/ }),
  102240. /***/ "./node_modules/lodash-es/_baseZipObject.js":
  102241. /*!**************************************************!*\
  102242. !*** ./node_modules/lodash-es/_baseZipObject.js ***!
  102243. \**************************************************/
  102244. /*! exports provided: default */
  102245. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  102246. "use strict";
  102247. __webpack_require__.r(__webpack_exports__);
  102248. /**
  102249. * This base implementation of `_.zipObject` which assigns values using `assignFunc`.
  102250. *
  102251. * @private
  102252. * @param {Array} props The property identifiers.
  102253. * @param {Array} values The property values.
  102254. * @param {Function} assignFunc The function to assign values.
  102255. * @returns {Object} Returns the new object.
  102256. */
  102257. function baseZipObject(props, values, assignFunc) {
  102258. var index = -1,
  102259. length = props.length,
  102260. valsLength = values.length,
  102261. result = {};
  102262. while (++index < length) {
  102263. var value = index < valsLength ? values[index] : undefined;
  102264. assignFunc(result, props[index], value);
  102265. }
  102266. return result;
  102267. }
  102268. /* harmony default export */ __webpack_exports__["default"] = (baseZipObject);
  102269. /***/ }),
  102270. /***/ "./node_modules/lodash-es/_cacheHas.js":
  102271. /*!*********************************************!*\
  102272. !*** ./node_modules/lodash-es/_cacheHas.js ***!
  102273. \*********************************************/
  102274. /*! exports provided: default */
  102275. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  102276. "use strict";
  102277. __webpack_require__.r(__webpack_exports__);
  102278. /**
  102279. * Checks if a `cache` value for `key` exists.
  102280. *
  102281. * @private
  102282. * @param {Object} cache The cache to query.
  102283. * @param {string} key The key of the entry to check.
  102284. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  102285. */
  102286. function cacheHas(cache, key) {
  102287. return cache.has(key);
  102288. }
  102289. /* harmony default export */ __webpack_exports__["default"] = (cacheHas);
  102290. /***/ }),
  102291. /***/ "./node_modules/lodash-es/_castArrayLikeObject.js":
  102292. /*!********************************************************!*\
  102293. !*** ./node_modules/lodash-es/_castArrayLikeObject.js ***!
  102294. \********************************************************/
  102295. /*! exports provided: default */
  102296. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  102297. "use strict";
  102298. __webpack_require__.r(__webpack_exports__);
  102299. /* harmony import */ var _isArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isArrayLikeObject.js */ "./node_modules/lodash-es/isArrayLikeObject.js");
  102300. /**
  102301. * Casts `value` to an empty array if it's not an array like object.
  102302. *
  102303. * @private
  102304. * @param {*} value The value to inspect.
  102305. * @returns {Array|Object} Returns the cast array-like object.
  102306. */
  102307. function castArrayLikeObject(value) {
  102308. return Object(_isArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value) ? value : [];
  102309. }
  102310. /* harmony default export */ __webpack_exports__["default"] = (castArrayLikeObject);
  102311. /***/ }),
  102312. /***/ "./node_modules/lodash-es/_castFunction.js":
  102313. /*!*************************************************!*\
  102314. !*** ./node_modules/lodash-es/_castFunction.js ***!
  102315. \*************************************************/
  102316. /*! exports provided: default */
  102317. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  102318. "use strict";
  102319. __webpack_require__.r(__webpack_exports__);
  102320. /* harmony import */ var _identity_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./identity.js */ "./node_modules/lodash-es/identity.js");
  102321. /**
  102322. * Casts `value` to `identity` if it's not a function.
  102323. *
  102324. * @private
  102325. * @param {*} value The value to inspect.
  102326. * @returns {Function} Returns cast function.
  102327. */
  102328. function castFunction(value) {
  102329. return typeof value == 'function' ? value : _identity_js__WEBPACK_IMPORTED_MODULE_0__["default"];
  102330. }
  102331. /* harmony default export */ __webpack_exports__["default"] = (castFunction);
  102332. /***/ }),
  102333. /***/ "./node_modules/lodash-es/_castPath.js":
  102334. /*!*********************************************!*\
  102335. !*** ./node_modules/lodash-es/_castPath.js ***!
  102336. \*********************************************/
  102337. /*! exports provided: default */
  102338. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  102339. "use strict";
  102340. __webpack_require__.r(__webpack_exports__);
  102341. /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
  102342. /* harmony import */ var _isKey_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_isKey.js */ "./node_modules/lodash-es/_isKey.js");
  102343. /* harmony import */ var _stringToPath_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_stringToPath.js */ "./node_modules/lodash-es/_stringToPath.js");
  102344. /* harmony import */ var _toString_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./toString.js */ "./node_modules/lodash-es/toString.js");
  102345. /**
  102346. * Casts `value` to a path array if it's not one.
  102347. *
  102348. * @private
  102349. * @param {*} value The value to inspect.
  102350. * @param {Object} [object] The object to query keys on.
  102351. * @returns {Array} Returns the cast property path array.
  102352. */
  102353. function castPath(value, object) {
  102354. if (Object(_isArray_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value)) {
  102355. return value;
  102356. }
  102357. 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));
  102358. }
  102359. /* harmony default export */ __webpack_exports__["default"] = (castPath);
  102360. /***/ }),
  102361. /***/ "./node_modules/lodash-es/_castRest.js":
  102362. /*!*********************************************!*\
  102363. !*** ./node_modules/lodash-es/_castRest.js ***!
  102364. \*********************************************/
  102365. /*! exports provided: default */
  102366. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  102367. "use strict";
  102368. __webpack_require__.r(__webpack_exports__);
  102369. /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
  102370. /**
  102371. * A `baseRest` alias which can be replaced with `identity` by module
  102372. * replacement plugins.
  102373. *
  102374. * @private
  102375. * @type {Function}
  102376. * @param {Function} func The function to apply a rest parameter to.
  102377. * @returns {Function} Returns the new function.
  102378. */
  102379. var castRest = _baseRest_js__WEBPACK_IMPORTED_MODULE_0__["default"];
  102380. /* harmony default export */ __webpack_exports__["default"] = (castRest);
  102381. /***/ }),
  102382. /***/ "./node_modules/lodash-es/_castSlice.js":
  102383. /*!**********************************************!*\
  102384. !*** ./node_modules/lodash-es/_castSlice.js ***!
  102385. \**********************************************/
  102386. /*! exports provided: default */
  102387. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  102388. "use strict";
  102389. __webpack_require__.r(__webpack_exports__);
  102390. /* harmony import */ var _baseSlice_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseSlice.js */ "./node_modules/lodash-es/_baseSlice.js");
  102391. /**
  102392. * Casts `array` to a slice if it's needed.
  102393. *
  102394. * @private
  102395. * @param {Array} array The array to inspect.
  102396. * @param {number} start The start position.
  102397. * @param {number} [end=array.length] The end position.
  102398. * @returns {Array} Returns the cast slice.
  102399. */
  102400. function castSlice(array, start, end) {
  102401. var length = array.length;
  102402. end = end === undefined ? length : end;
  102403. return (!start && end >= length) ? array : Object(_baseSlice_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, start, end);
  102404. }
  102405. /* harmony default export */ __webpack_exports__["default"] = (castSlice);
  102406. /***/ }),
  102407. /***/ "./node_modules/lodash-es/_charsEndIndex.js":
  102408. /*!**************************************************!*\
  102409. !*** ./node_modules/lodash-es/_charsEndIndex.js ***!
  102410. \**************************************************/
  102411. /*! exports provided: default */
  102412. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  102413. "use strict";
  102414. __webpack_require__.r(__webpack_exports__);
  102415. /* harmony import */ var _baseIndexOf_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseIndexOf.js */ "./node_modules/lodash-es/_baseIndexOf.js");
  102416. /**
  102417. * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol
  102418. * that is not found in the character symbols.
  102419. *
  102420. * @private
  102421. * @param {Array} strSymbols The string symbols to inspect.
  102422. * @param {Array} chrSymbols The character symbols to find.
  102423. * @returns {number} Returns the index of the last unmatched string symbol.
  102424. */
  102425. function charsEndIndex(strSymbols, chrSymbols) {
  102426. var index = strSymbols.length;
  102427. while (index-- && Object(_baseIndexOf_js__WEBPACK_IMPORTED_MODULE_0__["default"])(chrSymbols, strSymbols[index], 0) > -1) {}
  102428. return index;
  102429. }
  102430. /* harmony default export */ __webpack_exports__["default"] = (charsEndIndex);
  102431. /***/ }),
  102432. /***/ "./node_modules/lodash-es/_charsStartIndex.js":
  102433. /*!****************************************************!*\
  102434. !*** ./node_modules/lodash-es/_charsStartIndex.js ***!
  102435. \****************************************************/
  102436. /*! exports provided: default */
  102437. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  102438. "use strict";
  102439. __webpack_require__.r(__webpack_exports__);
  102440. /* harmony import */ var _baseIndexOf_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseIndexOf.js */ "./node_modules/lodash-es/_baseIndexOf.js");
  102441. /**
  102442. * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol
  102443. * that is not found in the character symbols.
  102444. *
  102445. * @private
  102446. * @param {Array} strSymbols The string symbols to inspect.
  102447. * @param {Array} chrSymbols The character symbols to find.
  102448. * @returns {number} Returns the index of the first unmatched string symbol.
  102449. */
  102450. function charsStartIndex(strSymbols, chrSymbols) {
  102451. var index = -1,
  102452. length = strSymbols.length;
  102453. while (++index < length && Object(_baseIndexOf_js__WEBPACK_IMPORTED_MODULE_0__["default"])(chrSymbols, strSymbols[index], 0) > -1) {}
  102454. return index;
  102455. }
  102456. /* harmony default export */ __webpack_exports__["default"] = (charsStartIndex);
  102457. /***/ }),
  102458. /***/ "./node_modules/lodash-es/_cloneArrayBuffer.js":
  102459. /*!*****************************************************!*\
  102460. !*** ./node_modules/lodash-es/_cloneArrayBuffer.js ***!
  102461. \*****************************************************/
  102462. /*! exports provided: default */
  102463. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  102464. "use strict";
  102465. __webpack_require__.r(__webpack_exports__);
  102466. /* harmony import */ var _Uint8Array_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_Uint8Array.js */ "./node_modules/lodash-es/_Uint8Array.js");
  102467. /**
  102468. * Creates a clone of `arrayBuffer`.
  102469. *
  102470. * @private
  102471. * @param {ArrayBuffer} arrayBuffer The array buffer to clone.
  102472. * @returns {ArrayBuffer} Returns the cloned array buffer.
  102473. */
  102474. function cloneArrayBuffer(arrayBuffer) {
  102475. var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
  102476. new _Uint8Array_js__WEBPACK_IMPORTED_MODULE_0__["default"](result).set(new _Uint8Array_js__WEBPACK_IMPORTED_MODULE_0__["default"](arrayBuffer));
  102477. return result;
  102478. }
  102479. /* harmony default export */ __webpack_exports__["default"] = (cloneArrayBuffer);
  102480. /***/ }),
  102481. /***/ "./node_modules/lodash-es/_cloneBuffer.js":
  102482. /*!************************************************!*\
  102483. !*** ./node_modules/lodash-es/_cloneBuffer.js ***!
  102484. \************************************************/
  102485. /*! exports provided: default */
  102486. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  102487. "use strict";
  102488. __webpack_require__.r(__webpack_exports__);
  102489. /* WEBPACK VAR INJECTION */(function(module) {/* harmony import */ var _root_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_root.js */ "./node_modules/lodash-es/_root.js");
  102490. /** Detect free variable `exports`. */
  102491. var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;
  102492. /** Detect free variable `module`. */
  102493. var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;
  102494. /** Detect the popular CommonJS extension `module.exports`. */
  102495. var moduleExports = freeModule && freeModule.exports === freeExports;
  102496. /** Built-in value references. */
  102497. var Buffer = moduleExports ? _root_js__WEBPACK_IMPORTED_MODULE_0__["default"].Buffer : undefined,
  102498. allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined;
  102499. /**
  102500. * Creates a clone of `buffer`.
  102501. *
  102502. * @private
  102503. * @param {Buffer} buffer The buffer to clone.
  102504. * @param {boolean} [isDeep] Specify a deep clone.
  102505. * @returns {Buffer} Returns the cloned buffer.
  102506. */
  102507. function cloneBuffer(buffer, isDeep) {
  102508. if (isDeep) {
  102509. return buffer.slice();
  102510. }
  102511. var length = buffer.length,
  102512. result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
  102513. buffer.copy(result);
  102514. return result;
  102515. }
  102516. /* harmony default export */ __webpack_exports__["default"] = (cloneBuffer);
  102517. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/harmony-module.js */ "./node_modules/webpack/buildin/harmony-module.js")(module)))
  102518. /***/ }),
  102519. /***/ "./node_modules/lodash-es/_cloneDataView.js":
  102520. /*!**************************************************!*\
  102521. !*** ./node_modules/lodash-es/_cloneDataView.js ***!
  102522. \**************************************************/
  102523. /*! exports provided: default */
  102524. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  102525. "use strict";
  102526. __webpack_require__.r(__webpack_exports__);
  102527. /* harmony import */ var _cloneArrayBuffer_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_cloneArrayBuffer.js */ "./node_modules/lodash-es/_cloneArrayBuffer.js");
  102528. /**
  102529. * Creates a clone of `dataView`.
  102530. *
  102531. * @private
  102532. * @param {Object} dataView The data view to clone.
  102533. * @param {boolean} [isDeep] Specify a deep clone.
  102534. * @returns {Object} Returns the cloned data view.
  102535. */
  102536. function cloneDataView(dataView, isDeep) {
  102537. var buffer = isDeep ? Object(_cloneArrayBuffer_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dataView.buffer) : dataView.buffer;
  102538. return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
  102539. }
  102540. /* harmony default export */ __webpack_exports__["default"] = (cloneDataView);
  102541. /***/ }),
  102542. /***/ "./node_modules/lodash-es/_cloneRegExp.js":
  102543. /*!************************************************!*\
  102544. !*** ./node_modules/lodash-es/_cloneRegExp.js ***!
  102545. \************************************************/
  102546. /*! exports provided: default */
  102547. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  102548. "use strict";
  102549. __webpack_require__.r(__webpack_exports__);
  102550. /** Used to match `RegExp` flags from their coerced string values. */
  102551. var reFlags = /\w*$/;
  102552. /**
  102553. * Creates a clone of `regexp`.
  102554. *
  102555. * @private
  102556. * @param {Object} regexp The regexp to clone.
  102557. * @returns {Object} Returns the cloned regexp.
  102558. */
  102559. function cloneRegExp(regexp) {
  102560. var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
  102561. result.lastIndex = regexp.lastIndex;
  102562. return result;
  102563. }
  102564. /* harmony default export */ __webpack_exports__["default"] = (cloneRegExp);
  102565. /***/ }),
  102566. /***/ "./node_modules/lodash-es/_cloneSymbol.js":
  102567. /*!************************************************!*\
  102568. !*** ./node_modules/lodash-es/_cloneSymbol.js ***!
  102569. \************************************************/
  102570. /*! exports provided: default */
  102571. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  102572. "use strict";
  102573. __webpack_require__.r(__webpack_exports__);
  102574. /* harmony import */ var _Symbol_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_Symbol.js */ "./node_modules/lodash-es/_Symbol.js");
  102575. /** Used to convert symbols to primitives and strings. */
  102576. var symbolProto = _Symbol_js__WEBPACK_IMPORTED_MODULE_0__["default"] ? _Symbol_js__WEBPACK_IMPORTED_MODULE_0__["default"].prototype : undefined,
  102577. symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;
  102578. /**
  102579. * Creates a clone of the `symbol` object.
  102580. *
  102581. * @private
  102582. * @param {Object} symbol The symbol object to clone.
  102583. * @returns {Object} Returns the cloned symbol object.
  102584. */
  102585. function cloneSymbol(symbol) {
  102586. return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
  102587. }
  102588. /* harmony default export */ __webpack_exports__["default"] = (cloneSymbol);
  102589. /***/ }),
  102590. /***/ "./node_modules/lodash-es/_cloneTypedArray.js":
  102591. /*!****************************************************!*\
  102592. !*** ./node_modules/lodash-es/_cloneTypedArray.js ***!
  102593. \****************************************************/
  102594. /*! exports provided: default */
  102595. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  102596. "use strict";
  102597. __webpack_require__.r(__webpack_exports__);
  102598. /* harmony import */ var _cloneArrayBuffer_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_cloneArrayBuffer.js */ "./node_modules/lodash-es/_cloneArrayBuffer.js");
  102599. /**
  102600. * Creates a clone of `typedArray`.
  102601. *
  102602. * @private
  102603. * @param {Object} typedArray The typed array to clone.
  102604. * @param {boolean} [isDeep] Specify a deep clone.
  102605. * @returns {Object} Returns the cloned typed array.
  102606. */
  102607. function cloneTypedArray(typedArray, isDeep) {
  102608. var buffer = isDeep ? Object(_cloneArrayBuffer_js__WEBPACK_IMPORTED_MODULE_0__["default"])(typedArray.buffer) : typedArray.buffer;
  102609. return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
  102610. }
  102611. /* harmony default export */ __webpack_exports__["default"] = (cloneTypedArray);
  102612. /***/ }),
  102613. /***/ "./node_modules/lodash-es/_compareAscending.js":
  102614. /*!*****************************************************!*\
  102615. !*** ./node_modules/lodash-es/_compareAscending.js ***!
  102616. \*****************************************************/
  102617. /*! exports provided: default */
  102618. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  102619. "use strict";
  102620. __webpack_require__.r(__webpack_exports__);
  102621. /* harmony import */ var _isSymbol_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isSymbol.js */ "./node_modules/lodash-es/isSymbol.js");
  102622. /**
  102623. * Compares values to sort them in ascending order.
  102624. *
  102625. * @private
  102626. * @param {*} value The value to compare.
  102627. * @param {*} other The other value to compare.
  102628. * @returns {number} Returns the sort order indicator for `value`.
  102629. */
  102630. function compareAscending(value, other) {
  102631. if (value !== other) {
  102632. var valIsDefined = value !== undefined,
  102633. valIsNull = value === null,
  102634. valIsReflexive = value === value,
  102635. valIsSymbol = Object(_isSymbol_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value);
  102636. var othIsDefined = other !== undefined,
  102637. othIsNull = other === null,
  102638. othIsReflexive = other === other,
  102639. othIsSymbol = Object(_isSymbol_js__WEBPACK_IMPORTED_MODULE_0__["default"])(other);
  102640. if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) ||
  102641. (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) ||
  102642. (valIsNull && othIsDefined && othIsReflexive) ||
  102643. (!valIsDefined && othIsReflexive) ||
  102644. !valIsReflexive) {
  102645. return 1;
  102646. }
  102647. if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) ||
  102648. (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) ||
  102649. (othIsNull && valIsDefined && valIsReflexive) ||
  102650. (!othIsDefined && valIsReflexive) ||
  102651. !othIsReflexive) {
  102652. return -1;
  102653. }
  102654. }
  102655. return 0;
  102656. }
  102657. /* harmony default export */ __webpack_exports__["default"] = (compareAscending);
  102658. /***/ }),
  102659. /***/ "./node_modules/lodash-es/_compareMultiple.js":
  102660. /*!****************************************************!*\
  102661. !*** ./node_modules/lodash-es/_compareMultiple.js ***!
  102662. \****************************************************/
  102663. /*! exports provided: default */
  102664. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  102665. "use strict";
  102666. __webpack_require__.r(__webpack_exports__);
  102667. /* harmony import */ var _compareAscending_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_compareAscending.js */ "./node_modules/lodash-es/_compareAscending.js");
  102668. /**
  102669. * Used by `_.orderBy` to compare multiple properties of a value to another
  102670. * and stable sort them.
  102671. *
  102672. * If `orders` is unspecified, all values are sorted in ascending order. Otherwise,
  102673. * specify an order of "desc" for descending or "asc" for ascending sort order
  102674. * of corresponding values.
  102675. *
  102676. * @private
  102677. * @param {Object} object The object to compare.
  102678. * @param {Object} other The other object to compare.
  102679. * @param {boolean[]|string[]} orders The order to sort by for each property.
  102680. * @returns {number} Returns the sort order indicator for `object`.
  102681. */
  102682. function compareMultiple(object, other, orders) {
  102683. var index = -1,
  102684. objCriteria = object.criteria,
  102685. othCriteria = other.criteria,
  102686. length = objCriteria.length,
  102687. ordersLength = orders.length;
  102688. while (++index < length) {
  102689. var result = Object(_compareAscending_js__WEBPACK_IMPORTED_MODULE_0__["default"])(objCriteria[index], othCriteria[index]);
  102690. if (result) {
  102691. if (index >= ordersLength) {
  102692. return result;
  102693. }
  102694. var order = orders[index];
  102695. return result * (order == 'desc' ? -1 : 1);
  102696. }
  102697. }
  102698. // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications
  102699. // that causes it, under certain circumstances, to provide the same value for
  102700. // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247
  102701. // for more details.
  102702. //
  102703. // This also ensures a stable sort in V8 and other engines.
  102704. // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details.
  102705. return object.index - other.index;
  102706. }
  102707. /* harmony default export */ __webpack_exports__["default"] = (compareMultiple);
  102708. /***/ }),
  102709. /***/ "./node_modules/lodash-es/_composeArgs.js":
  102710. /*!************************************************!*\
  102711. !*** ./node_modules/lodash-es/_composeArgs.js ***!
  102712. \************************************************/
  102713. /*! exports provided: default */
  102714. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  102715. "use strict";
  102716. __webpack_require__.r(__webpack_exports__);
  102717. /* Built-in method references for those with the same name as other `lodash` methods. */
  102718. var nativeMax = Math.max;
  102719. /**
  102720. * Creates an array that is the composition of partially applied arguments,
  102721. * placeholders, and provided arguments into a single array of arguments.
  102722. *
  102723. * @private
  102724. * @param {Array} args The provided arguments.
  102725. * @param {Array} partials The arguments to prepend to those provided.
  102726. * @param {Array} holders The `partials` placeholder indexes.
  102727. * @params {boolean} [isCurried] Specify composing for a curried function.
  102728. * @returns {Array} Returns the new array of composed arguments.
  102729. */
  102730. function composeArgs(args, partials, holders, isCurried) {
  102731. var argsIndex = -1,
  102732. argsLength = args.length,
  102733. holdersLength = holders.length,
  102734. leftIndex = -1,
  102735. leftLength = partials.length,
  102736. rangeLength = nativeMax(argsLength - holdersLength, 0),
  102737. result = Array(leftLength + rangeLength),
  102738. isUncurried = !isCurried;
  102739. while (++leftIndex < leftLength) {
  102740. result[leftIndex] = partials[leftIndex];
  102741. }
  102742. while (++argsIndex < holdersLength) {
  102743. if (isUncurried || argsIndex < argsLength) {
  102744. result[holders[argsIndex]] = args[argsIndex];
  102745. }
  102746. }
  102747. while (rangeLength--) {
  102748. result[leftIndex++] = args[argsIndex++];
  102749. }
  102750. return result;
  102751. }
  102752. /* harmony default export */ __webpack_exports__["default"] = (composeArgs);
  102753. /***/ }),
  102754. /***/ "./node_modules/lodash-es/_composeArgsRight.js":
  102755. /*!*****************************************************!*\
  102756. !*** ./node_modules/lodash-es/_composeArgsRight.js ***!
  102757. \*****************************************************/
  102758. /*! exports provided: default */
  102759. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  102760. "use strict";
  102761. __webpack_require__.r(__webpack_exports__);
  102762. /* Built-in method references for those with the same name as other `lodash` methods. */
  102763. var nativeMax = Math.max;
  102764. /**
  102765. * This function is like `composeArgs` except that the arguments composition
  102766. * is tailored for `_.partialRight`.
  102767. *
  102768. * @private
  102769. * @param {Array} args The provided arguments.
  102770. * @param {Array} partials The arguments to append to those provided.
  102771. * @param {Array} holders The `partials` placeholder indexes.
  102772. * @params {boolean} [isCurried] Specify composing for a curried function.
  102773. * @returns {Array} Returns the new array of composed arguments.
  102774. */
  102775. function composeArgsRight(args, partials, holders, isCurried) {
  102776. var argsIndex = -1,
  102777. argsLength = args.length,
  102778. holdersIndex = -1,
  102779. holdersLength = holders.length,
  102780. rightIndex = -1,
  102781. rightLength = partials.length,
  102782. rangeLength = nativeMax(argsLength - holdersLength, 0),
  102783. result = Array(rangeLength + rightLength),
  102784. isUncurried = !isCurried;
  102785. while (++argsIndex < rangeLength) {
  102786. result[argsIndex] = args[argsIndex];
  102787. }
  102788. var offset = argsIndex;
  102789. while (++rightIndex < rightLength) {
  102790. result[offset + rightIndex] = partials[rightIndex];
  102791. }
  102792. while (++holdersIndex < holdersLength) {
  102793. if (isUncurried || argsIndex < argsLength) {
  102794. result[offset + holders[holdersIndex]] = args[argsIndex++];
  102795. }
  102796. }
  102797. return result;
  102798. }
  102799. /* harmony default export */ __webpack_exports__["default"] = (composeArgsRight);
  102800. /***/ }),
  102801. /***/ "./node_modules/lodash-es/_copyArray.js":
  102802. /*!**********************************************!*\
  102803. !*** ./node_modules/lodash-es/_copyArray.js ***!
  102804. \**********************************************/
  102805. /*! exports provided: default */
  102806. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  102807. "use strict";
  102808. __webpack_require__.r(__webpack_exports__);
  102809. /**
  102810. * Copies the values of `source` to `array`.
  102811. *
  102812. * @private
  102813. * @param {Array} source The array to copy values from.
  102814. * @param {Array} [array=[]] The array to copy values to.
  102815. * @returns {Array} Returns `array`.
  102816. */
  102817. function copyArray(source, array) {
  102818. var index = -1,
  102819. length = source.length;
  102820. array || (array = Array(length));
  102821. while (++index < length) {
  102822. array[index] = source[index];
  102823. }
  102824. return array;
  102825. }
  102826. /* harmony default export */ __webpack_exports__["default"] = (copyArray);
  102827. /***/ }),
  102828. /***/ "./node_modules/lodash-es/_copyObject.js":
  102829. /*!***********************************************!*\
  102830. !*** ./node_modules/lodash-es/_copyObject.js ***!
  102831. \***********************************************/
  102832. /*! exports provided: default */
  102833. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  102834. "use strict";
  102835. __webpack_require__.r(__webpack_exports__);
  102836. /* harmony import */ var _assignValue_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_assignValue.js */ "./node_modules/lodash-es/_assignValue.js");
  102837. /* harmony import */ var _baseAssignValue_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseAssignValue.js */ "./node_modules/lodash-es/_baseAssignValue.js");
  102838. /**
  102839. * Copies properties of `source` to `object`.
  102840. *
  102841. * @private
  102842. * @param {Object} source The object to copy properties from.
  102843. * @param {Array} props The property identifiers to copy.
  102844. * @param {Object} [object={}] The object to copy properties to.
  102845. * @param {Function} [customizer] The function to customize copied values.
  102846. * @returns {Object} Returns `object`.
  102847. */
  102848. function copyObject(source, props, object, customizer) {
  102849. var isNew = !object;
  102850. object || (object = {});
  102851. var index = -1,
  102852. length = props.length;
  102853. while (++index < length) {
  102854. var key = props[index];
  102855. var newValue = customizer
  102856. ? customizer(object[key], source[key], key, object, source)
  102857. : undefined;
  102858. if (newValue === undefined) {
  102859. newValue = source[key];
  102860. }
  102861. if (isNew) {
  102862. Object(_baseAssignValue_js__WEBPACK_IMPORTED_MODULE_1__["default"])(object, key, newValue);
  102863. } else {
  102864. Object(_assignValue_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, key, newValue);
  102865. }
  102866. }
  102867. return object;
  102868. }
  102869. /* harmony default export */ __webpack_exports__["default"] = (copyObject);
  102870. /***/ }),
  102871. /***/ "./node_modules/lodash-es/_copySymbols.js":
  102872. /*!************************************************!*\
  102873. !*** ./node_modules/lodash-es/_copySymbols.js ***!
  102874. \************************************************/
  102875. /*! exports provided: default */
  102876. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  102877. "use strict";
  102878. __webpack_require__.r(__webpack_exports__);
  102879. /* harmony import */ var _copyObject_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_copyObject.js */ "./node_modules/lodash-es/_copyObject.js");
  102880. /* harmony import */ var _getSymbols_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_getSymbols.js */ "./node_modules/lodash-es/_getSymbols.js");
  102881. /**
  102882. * Copies own symbols of `source` to `object`.
  102883. *
  102884. * @private
  102885. * @param {Object} source The object to copy symbols from.
  102886. * @param {Object} [object={}] The object to copy symbols to.
  102887. * @returns {Object} Returns `object`.
  102888. */
  102889. function copySymbols(source, object) {
  102890. return Object(_copyObject_js__WEBPACK_IMPORTED_MODULE_0__["default"])(source, Object(_getSymbols_js__WEBPACK_IMPORTED_MODULE_1__["default"])(source), object);
  102891. }
  102892. /* harmony default export */ __webpack_exports__["default"] = (copySymbols);
  102893. /***/ }),
  102894. /***/ "./node_modules/lodash-es/_copySymbolsIn.js":
  102895. /*!**************************************************!*\
  102896. !*** ./node_modules/lodash-es/_copySymbolsIn.js ***!
  102897. \**************************************************/
  102898. /*! exports provided: default */
  102899. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  102900. "use strict";
  102901. __webpack_require__.r(__webpack_exports__);
  102902. /* harmony import */ var _copyObject_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_copyObject.js */ "./node_modules/lodash-es/_copyObject.js");
  102903. /* harmony import */ var _getSymbolsIn_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_getSymbolsIn.js */ "./node_modules/lodash-es/_getSymbolsIn.js");
  102904. /**
  102905. * Copies own and inherited symbols of `source` to `object`.
  102906. *
  102907. * @private
  102908. * @param {Object} source The object to copy symbols from.
  102909. * @param {Object} [object={}] The object to copy symbols to.
  102910. * @returns {Object} Returns `object`.
  102911. */
  102912. function copySymbolsIn(source, object) {
  102913. return Object(_copyObject_js__WEBPACK_IMPORTED_MODULE_0__["default"])(source, Object(_getSymbolsIn_js__WEBPACK_IMPORTED_MODULE_1__["default"])(source), object);
  102914. }
  102915. /* harmony default export */ __webpack_exports__["default"] = (copySymbolsIn);
  102916. /***/ }),
  102917. /***/ "./node_modules/lodash-es/_coreJsData.js":
  102918. /*!***********************************************!*\
  102919. !*** ./node_modules/lodash-es/_coreJsData.js ***!
  102920. \***********************************************/
  102921. /*! exports provided: default */
  102922. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  102923. "use strict";
  102924. __webpack_require__.r(__webpack_exports__);
  102925. /* harmony import */ var _root_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_root.js */ "./node_modules/lodash-es/_root.js");
  102926. /** Used to detect overreaching core-js shims. */
  102927. var coreJsData = _root_js__WEBPACK_IMPORTED_MODULE_0__["default"]['__core-js_shared__'];
  102928. /* harmony default export */ __webpack_exports__["default"] = (coreJsData);
  102929. /***/ }),
  102930. /***/ "./node_modules/lodash-es/_countHolders.js":
  102931. /*!*************************************************!*\
  102932. !*** ./node_modules/lodash-es/_countHolders.js ***!
  102933. \*************************************************/
  102934. /*! exports provided: default */
  102935. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  102936. "use strict";
  102937. __webpack_require__.r(__webpack_exports__);
  102938. /**
  102939. * Gets the number of `placeholder` occurrences in `array`.
  102940. *
  102941. * @private
  102942. * @param {Array} array The array to inspect.
  102943. * @param {*} placeholder The placeholder to search for.
  102944. * @returns {number} Returns the placeholder count.
  102945. */
  102946. function countHolders(array, placeholder) {
  102947. var length = array.length,
  102948. result = 0;
  102949. while (length--) {
  102950. if (array[length] === placeholder) {
  102951. ++result;
  102952. }
  102953. }
  102954. return result;
  102955. }
  102956. /* harmony default export */ __webpack_exports__["default"] = (countHolders);
  102957. /***/ }),
  102958. /***/ "./node_modules/lodash-es/_createAggregator.js":
  102959. /*!*****************************************************!*\
  102960. !*** ./node_modules/lodash-es/_createAggregator.js ***!
  102961. \*****************************************************/
  102962. /*! exports provided: default */
  102963. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  102964. "use strict";
  102965. __webpack_require__.r(__webpack_exports__);
  102966. /* harmony import */ var _arrayAggregator_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayAggregator.js */ "./node_modules/lodash-es/_arrayAggregator.js");
  102967. /* harmony import */ var _baseAggregator_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseAggregator.js */ "./node_modules/lodash-es/_baseAggregator.js");
  102968. /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
  102969. /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
  102970. /**
  102971. * Creates a function like `_.groupBy`.
  102972. *
  102973. * @private
  102974. * @param {Function} setter The function to set accumulator values.
  102975. * @param {Function} [initializer] The accumulator object initializer.
  102976. * @returns {Function} Returns the new aggregator function.
  102977. */
  102978. function createAggregator(setter, initializer) {
  102979. return function(collection, iteratee) {
  102980. 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"],
  102981. accumulator = initializer ? initializer() : {};
  102982. return func(collection, setter, Object(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_2__["default"])(iteratee, 2), accumulator);
  102983. };
  102984. }
  102985. /* harmony default export */ __webpack_exports__["default"] = (createAggregator);
  102986. /***/ }),
  102987. /***/ "./node_modules/lodash-es/_createAssigner.js":
  102988. /*!***************************************************!*\
  102989. !*** ./node_modules/lodash-es/_createAssigner.js ***!
  102990. \***************************************************/
  102991. /*! exports provided: default */
  102992. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  102993. "use strict";
  102994. __webpack_require__.r(__webpack_exports__);
  102995. /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
  102996. /* harmony import */ var _isIterateeCall_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_isIterateeCall.js */ "./node_modules/lodash-es/_isIterateeCall.js");
  102997. /**
  102998. * Creates a function like `_.assign`.
  102999. *
  103000. * @private
  103001. * @param {Function} assigner The function to assign values.
  103002. * @returns {Function} Returns the new assigner function.
  103003. */
  103004. function createAssigner(assigner) {
  103005. return Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function(object, sources) {
  103006. var index = -1,
  103007. length = sources.length,
  103008. customizer = length > 1 ? sources[length - 1] : undefined,
  103009. guard = length > 2 ? sources[2] : undefined;
  103010. customizer = (assigner.length > 3 && typeof customizer == 'function')
  103011. ? (length--, customizer)
  103012. : undefined;
  103013. if (guard && Object(_isIterateeCall_js__WEBPACK_IMPORTED_MODULE_1__["default"])(sources[0], sources[1], guard)) {
  103014. customizer = length < 3 ? undefined : customizer;
  103015. length = 1;
  103016. }
  103017. object = Object(object);
  103018. while (++index < length) {
  103019. var source = sources[index];
  103020. if (source) {
  103021. assigner(object, source, index, customizer);
  103022. }
  103023. }
  103024. return object;
  103025. });
  103026. }
  103027. /* harmony default export */ __webpack_exports__["default"] = (createAssigner);
  103028. /***/ }),
  103029. /***/ "./node_modules/lodash-es/_createBaseEach.js":
  103030. /*!***************************************************!*\
  103031. !*** ./node_modules/lodash-es/_createBaseEach.js ***!
  103032. \***************************************************/
  103033. /*! exports provided: default */
  103034. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  103035. "use strict";
  103036. __webpack_require__.r(__webpack_exports__);
  103037. /* harmony import */ var _isArrayLike_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isArrayLike.js */ "./node_modules/lodash-es/isArrayLike.js");
  103038. /**
  103039. * Creates a `baseEach` or `baseEachRight` function.
  103040. *
  103041. * @private
  103042. * @param {Function} eachFunc The function to iterate over a collection.
  103043. * @param {boolean} [fromRight] Specify iterating from right to left.
  103044. * @returns {Function} Returns the new base function.
  103045. */
  103046. function createBaseEach(eachFunc, fromRight) {
  103047. return function(collection, iteratee) {
  103048. if (collection == null) {
  103049. return collection;
  103050. }
  103051. if (!Object(_isArrayLike_js__WEBPACK_IMPORTED_MODULE_0__["default"])(collection)) {
  103052. return eachFunc(collection, iteratee);
  103053. }
  103054. var length = collection.length,
  103055. index = fromRight ? length : -1,
  103056. iterable = Object(collection);
  103057. while ((fromRight ? index-- : ++index < length)) {
  103058. if (iteratee(iterable[index], index, iterable) === false) {
  103059. break;
  103060. }
  103061. }
  103062. return collection;
  103063. };
  103064. }
  103065. /* harmony default export */ __webpack_exports__["default"] = (createBaseEach);
  103066. /***/ }),
  103067. /***/ "./node_modules/lodash-es/_createBaseFor.js":
  103068. /*!**************************************************!*\
  103069. !*** ./node_modules/lodash-es/_createBaseFor.js ***!
  103070. \**************************************************/
  103071. /*! exports provided: default */
  103072. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  103073. "use strict";
  103074. __webpack_require__.r(__webpack_exports__);
  103075. /**
  103076. * Creates a base function for methods like `_.forIn` and `_.forOwn`.
  103077. *
  103078. * @private
  103079. * @param {boolean} [fromRight] Specify iterating from right to left.
  103080. * @returns {Function} Returns the new base function.
  103081. */
  103082. function createBaseFor(fromRight) {
  103083. return function(object, iteratee, keysFunc) {
  103084. var index = -1,
  103085. iterable = Object(object),
  103086. props = keysFunc(object),
  103087. length = props.length;
  103088. while (length--) {
  103089. var key = props[fromRight ? length : ++index];
  103090. if (iteratee(iterable[key], key, iterable) === false) {
  103091. break;
  103092. }
  103093. }
  103094. return object;
  103095. };
  103096. }
  103097. /* harmony default export */ __webpack_exports__["default"] = (createBaseFor);
  103098. /***/ }),
  103099. /***/ "./node_modules/lodash-es/_createBind.js":
  103100. /*!***********************************************!*\
  103101. !*** ./node_modules/lodash-es/_createBind.js ***!
  103102. \***********************************************/
  103103. /*! exports provided: default */
  103104. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  103105. "use strict";
  103106. __webpack_require__.r(__webpack_exports__);
  103107. /* harmony import */ var _createCtor_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createCtor.js */ "./node_modules/lodash-es/_createCtor.js");
  103108. /* harmony import */ var _root_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_root.js */ "./node_modules/lodash-es/_root.js");
  103109. /** Used to compose bitmasks for function metadata. */
  103110. var WRAP_BIND_FLAG = 1;
  103111. /**
  103112. * Creates a function that wraps `func` to invoke it with the optional `this`
  103113. * binding of `thisArg`.
  103114. *
  103115. * @private
  103116. * @param {Function} func The function to wrap.
  103117. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  103118. * @param {*} [thisArg] The `this` binding of `func`.
  103119. * @returns {Function} Returns the new wrapped function.
  103120. */
  103121. function createBind(func, bitmask, thisArg) {
  103122. var isBind = bitmask & WRAP_BIND_FLAG,
  103123. Ctor = Object(_createCtor_js__WEBPACK_IMPORTED_MODULE_0__["default"])(func);
  103124. function wrapper() {
  103125. var fn = (this && this !== _root_js__WEBPACK_IMPORTED_MODULE_1__["default"] && this instanceof wrapper) ? Ctor : func;
  103126. return fn.apply(isBind ? thisArg : this, arguments);
  103127. }
  103128. return wrapper;
  103129. }
  103130. /* harmony default export */ __webpack_exports__["default"] = (createBind);
  103131. /***/ }),
  103132. /***/ "./node_modules/lodash-es/_createCaseFirst.js":
  103133. /*!****************************************************!*\
  103134. !*** ./node_modules/lodash-es/_createCaseFirst.js ***!
  103135. \****************************************************/
  103136. /*! exports provided: default */
  103137. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  103138. "use strict";
  103139. __webpack_require__.r(__webpack_exports__);
  103140. /* harmony import */ var _castSlice_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_castSlice.js */ "./node_modules/lodash-es/_castSlice.js");
  103141. /* harmony import */ var _hasUnicode_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_hasUnicode.js */ "./node_modules/lodash-es/_hasUnicode.js");
  103142. /* harmony import */ var _stringToArray_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_stringToArray.js */ "./node_modules/lodash-es/_stringToArray.js");
  103143. /* harmony import */ var _toString_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./toString.js */ "./node_modules/lodash-es/toString.js");
  103144. /**
  103145. * Creates a function like `_.lowerFirst`.
  103146. *
  103147. * @private
  103148. * @param {string} methodName The name of the `String` case method to use.
  103149. * @returns {Function} Returns the new case function.
  103150. */
  103151. function createCaseFirst(methodName) {
  103152. return function(string) {
  103153. string = Object(_toString_js__WEBPACK_IMPORTED_MODULE_3__["default"])(string);
  103154. var strSymbols = Object(_hasUnicode_js__WEBPACK_IMPORTED_MODULE_1__["default"])(string)
  103155. ? Object(_stringToArray_js__WEBPACK_IMPORTED_MODULE_2__["default"])(string)
  103156. : undefined;
  103157. var chr = strSymbols
  103158. ? strSymbols[0]
  103159. : string.charAt(0);
  103160. var trailing = strSymbols
  103161. ? Object(_castSlice_js__WEBPACK_IMPORTED_MODULE_0__["default"])(strSymbols, 1).join('')
  103162. : string.slice(1);
  103163. return chr[methodName]() + trailing;
  103164. };
  103165. }
  103166. /* harmony default export */ __webpack_exports__["default"] = (createCaseFirst);
  103167. /***/ }),
  103168. /***/ "./node_modules/lodash-es/_createCompounder.js":
  103169. /*!*****************************************************!*\
  103170. !*** ./node_modules/lodash-es/_createCompounder.js ***!
  103171. \*****************************************************/
  103172. /*! exports provided: default */
  103173. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  103174. "use strict";
  103175. __webpack_require__.r(__webpack_exports__);
  103176. /* harmony import */ var _arrayReduce_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayReduce.js */ "./node_modules/lodash-es/_arrayReduce.js");
  103177. /* harmony import */ var _deburr_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./deburr.js */ "./node_modules/lodash-es/deburr.js");
  103178. /* harmony import */ var _words_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./words.js */ "./node_modules/lodash-es/words.js");
  103179. /** Used to compose unicode capture groups. */
  103180. var rsApos = "['\u2019]";
  103181. /** Used to match apostrophes. */
  103182. var reApos = RegExp(rsApos, 'g');
  103183. /**
  103184. * Creates a function like `_.camelCase`.
  103185. *
  103186. * @private
  103187. * @param {Function} callback The function to combine each word.
  103188. * @returns {Function} Returns the new compounder function.
  103189. */
  103190. function createCompounder(callback) {
  103191. return function(string) {
  103192. 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, '');
  103193. };
  103194. }
  103195. /* harmony default export */ __webpack_exports__["default"] = (createCompounder);
  103196. /***/ }),
  103197. /***/ "./node_modules/lodash-es/_createCtor.js":
  103198. /*!***********************************************!*\
  103199. !*** ./node_modules/lodash-es/_createCtor.js ***!
  103200. \***********************************************/
  103201. /*! exports provided: default */
  103202. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  103203. "use strict";
  103204. __webpack_require__.r(__webpack_exports__);
  103205. /* harmony import */ var _baseCreate_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseCreate.js */ "./node_modules/lodash-es/_baseCreate.js");
  103206. /* harmony import */ var _isObject_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isObject.js */ "./node_modules/lodash-es/isObject.js");
  103207. /**
  103208. * Creates a function that produces an instance of `Ctor` regardless of
  103209. * whether it was invoked as part of a `new` expression or by `call` or `apply`.
  103210. *
  103211. * @private
  103212. * @param {Function} Ctor The constructor to wrap.
  103213. * @returns {Function} Returns the new wrapped function.
  103214. */
  103215. function createCtor(Ctor) {
  103216. return function() {
  103217. // Use a `switch` statement to work with class constructors. See
  103218. // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist
  103219. // for more details.
  103220. var args = arguments;
  103221. switch (args.length) {
  103222. case 0: return new Ctor;
  103223. case 1: return new Ctor(args[0]);
  103224. case 2: return new Ctor(args[0], args[1]);
  103225. case 3: return new Ctor(args[0], args[1], args[2]);
  103226. case 4: return new Ctor(args[0], args[1], args[2], args[3]);
  103227. case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]);
  103228. case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);
  103229. case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
  103230. }
  103231. var thisBinding = Object(_baseCreate_js__WEBPACK_IMPORTED_MODULE_0__["default"])(Ctor.prototype),
  103232. result = Ctor.apply(thisBinding, args);
  103233. // Mimic the constructor's `return` behavior.
  103234. // See https://es5.github.io/#x13.2.2 for more details.
  103235. return Object(_isObject_js__WEBPACK_IMPORTED_MODULE_1__["default"])(result) ? result : thisBinding;
  103236. };
  103237. }
  103238. /* harmony default export */ __webpack_exports__["default"] = (createCtor);
  103239. /***/ }),
  103240. /***/ "./node_modules/lodash-es/_createCurry.js":
  103241. /*!************************************************!*\
  103242. !*** ./node_modules/lodash-es/_createCurry.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 _apply_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_apply.js */ "./node_modules/lodash-es/_apply.js");
  103249. /* harmony import */ var _createCtor_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_createCtor.js */ "./node_modules/lodash-es/_createCtor.js");
  103250. /* harmony import */ var _createHybrid_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_createHybrid.js */ "./node_modules/lodash-es/_createHybrid.js");
  103251. /* harmony import */ var _createRecurry_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_createRecurry.js */ "./node_modules/lodash-es/_createRecurry.js");
  103252. /* harmony import */ var _getHolder_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_getHolder.js */ "./node_modules/lodash-es/_getHolder.js");
  103253. /* harmony import */ var _replaceHolders_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./_replaceHolders.js */ "./node_modules/lodash-es/_replaceHolders.js");
  103254. /* harmony import */ var _root_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./_root.js */ "./node_modules/lodash-es/_root.js");
  103255. /**
  103256. * Creates a function that wraps `func` to enable currying.
  103257. *
  103258. * @private
  103259. * @param {Function} func The function to wrap.
  103260. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  103261. * @param {number} arity The arity of `func`.
  103262. * @returns {Function} Returns the new wrapped function.
  103263. */
  103264. function createCurry(func, bitmask, arity) {
  103265. var Ctor = Object(_createCtor_js__WEBPACK_IMPORTED_MODULE_1__["default"])(func);
  103266. function wrapper() {
  103267. var length = arguments.length,
  103268. args = Array(length),
  103269. index = length,
  103270. placeholder = Object(_getHolder_js__WEBPACK_IMPORTED_MODULE_4__["default"])(wrapper);
  103271. while (index--) {
  103272. args[index] = arguments[index];
  103273. }
  103274. var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder)
  103275. ? []
  103276. : Object(_replaceHolders_js__WEBPACK_IMPORTED_MODULE_5__["default"])(args, placeholder);
  103277. length -= holders.length;
  103278. if (length < arity) {
  103279. return Object(_createRecurry_js__WEBPACK_IMPORTED_MODULE_3__["default"])(
  103280. func, bitmask, _createHybrid_js__WEBPACK_IMPORTED_MODULE_2__["default"], wrapper.placeholder, undefined,
  103281. args, holders, undefined, undefined, arity - length);
  103282. }
  103283. var fn = (this && this !== _root_js__WEBPACK_IMPORTED_MODULE_6__["default"] && this instanceof wrapper) ? Ctor : func;
  103284. return Object(_apply_js__WEBPACK_IMPORTED_MODULE_0__["default"])(fn, this, args);
  103285. }
  103286. return wrapper;
  103287. }
  103288. /* harmony default export */ __webpack_exports__["default"] = (createCurry);
  103289. /***/ }),
  103290. /***/ "./node_modules/lodash-es/_createFind.js":
  103291. /*!***********************************************!*\
  103292. !*** ./node_modules/lodash-es/_createFind.js ***!
  103293. \***********************************************/
  103294. /*! exports provided: default */
  103295. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  103296. "use strict";
  103297. __webpack_require__.r(__webpack_exports__);
  103298. /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
  103299. /* harmony import */ var _isArrayLike_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isArrayLike.js */ "./node_modules/lodash-es/isArrayLike.js");
  103300. /* harmony import */ var _keys_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./keys.js */ "./node_modules/lodash-es/keys.js");
  103301. /**
  103302. * Creates a `_.find` or `_.findLast` function.
  103303. *
  103304. * @private
  103305. * @param {Function} findIndexFunc The function to find the collection index.
  103306. * @returns {Function} Returns the new find function.
  103307. */
  103308. function createFind(findIndexFunc) {
  103309. return function(collection, predicate, fromIndex) {
  103310. var iterable = Object(collection);
  103311. if (!Object(_isArrayLike_js__WEBPACK_IMPORTED_MODULE_1__["default"])(collection)) {
  103312. var iteratee = Object(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_0__["default"])(predicate, 3);
  103313. collection = Object(_keys_js__WEBPACK_IMPORTED_MODULE_2__["default"])(collection);
  103314. predicate = function(key) { return iteratee(iterable[key], key, iterable); };
  103315. }
  103316. var index = findIndexFunc(collection, predicate, fromIndex);
  103317. return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined;
  103318. };
  103319. }
  103320. /* harmony default export */ __webpack_exports__["default"] = (createFind);
  103321. /***/ }),
  103322. /***/ "./node_modules/lodash-es/_createFlow.js":
  103323. /*!***********************************************!*\
  103324. !*** ./node_modules/lodash-es/_createFlow.js ***!
  103325. \***********************************************/
  103326. /*! exports provided: default */
  103327. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  103328. "use strict";
  103329. __webpack_require__.r(__webpack_exports__);
  103330. /* harmony import */ var _LodashWrapper_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_LodashWrapper.js */ "./node_modules/lodash-es/_LodashWrapper.js");
  103331. /* harmony import */ var _flatRest_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_flatRest.js */ "./node_modules/lodash-es/_flatRest.js");
  103332. /* harmony import */ var _getData_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_getData.js */ "./node_modules/lodash-es/_getData.js");
  103333. /* harmony import */ var _getFuncName_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_getFuncName.js */ "./node_modules/lodash-es/_getFuncName.js");
  103334. /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
  103335. /* harmony import */ var _isLaziable_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./_isLaziable.js */ "./node_modules/lodash-es/_isLaziable.js");
  103336. /** Error message constants. */
  103337. var FUNC_ERROR_TEXT = 'Expected a function';
  103338. /** Used to compose bitmasks for function metadata. */
  103339. var WRAP_CURRY_FLAG = 8,
  103340. WRAP_PARTIAL_FLAG = 32,
  103341. WRAP_ARY_FLAG = 128,
  103342. WRAP_REARG_FLAG = 256;
  103343. /**
  103344. * Creates a `_.flow` or `_.flowRight` function.
  103345. *
  103346. * @private
  103347. * @param {boolean} [fromRight] Specify iterating from right to left.
  103348. * @returns {Function} Returns the new flow function.
  103349. */
  103350. function createFlow(fromRight) {
  103351. return Object(_flatRest_js__WEBPACK_IMPORTED_MODULE_1__["default"])(function(funcs) {
  103352. var length = funcs.length,
  103353. index = length,
  103354. prereq = _LodashWrapper_js__WEBPACK_IMPORTED_MODULE_0__["default"].prototype.thru;
  103355. if (fromRight) {
  103356. funcs.reverse();
  103357. }
  103358. while (index--) {
  103359. var func = funcs[index];
  103360. if (typeof func != 'function') {
  103361. throw new TypeError(FUNC_ERROR_TEXT);
  103362. }
  103363. if (prereq && !wrapper && Object(_getFuncName_js__WEBPACK_IMPORTED_MODULE_3__["default"])(func) == 'wrapper') {
  103364. var wrapper = new _LodashWrapper_js__WEBPACK_IMPORTED_MODULE_0__["default"]([], true);
  103365. }
  103366. }
  103367. index = wrapper ? index : length;
  103368. while (++index < length) {
  103369. func = funcs[index];
  103370. var funcName = Object(_getFuncName_js__WEBPACK_IMPORTED_MODULE_3__["default"])(func),
  103371. data = funcName == 'wrapper' ? Object(_getData_js__WEBPACK_IMPORTED_MODULE_2__["default"])(func) : undefined;
  103372. if (data && Object(_isLaziable_js__WEBPACK_IMPORTED_MODULE_5__["default"])(data[0]) &&
  103373. data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) &&
  103374. !data[4].length && data[9] == 1
  103375. ) {
  103376. wrapper = wrapper[Object(_getFuncName_js__WEBPACK_IMPORTED_MODULE_3__["default"])(data[0])].apply(wrapper, data[3]);
  103377. } else {
  103378. wrapper = (func.length == 1 && Object(_isLaziable_js__WEBPACK_IMPORTED_MODULE_5__["default"])(func))
  103379. ? wrapper[funcName]()
  103380. : wrapper.thru(func);
  103381. }
  103382. }
  103383. return function() {
  103384. var args = arguments,
  103385. value = args[0];
  103386. if (wrapper && args.length == 1 && Object(_isArray_js__WEBPACK_IMPORTED_MODULE_4__["default"])(value)) {
  103387. return wrapper.plant(value).value();
  103388. }
  103389. var index = 0,
  103390. result = length ? funcs[index].apply(this, args) : value;
  103391. while (++index < length) {
  103392. result = funcs[index].call(this, result);
  103393. }
  103394. return result;
  103395. };
  103396. });
  103397. }
  103398. /* harmony default export */ __webpack_exports__["default"] = (createFlow);
  103399. /***/ }),
  103400. /***/ "./node_modules/lodash-es/_createHybrid.js":
  103401. /*!*************************************************!*\
  103402. !*** ./node_modules/lodash-es/_createHybrid.js ***!
  103403. \*************************************************/
  103404. /*! exports provided: default */
  103405. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  103406. "use strict";
  103407. __webpack_require__.r(__webpack_exports__);
  103408. /* harmony import */ var _composeArgs_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_composeArgs.js */ "./node_modules/lodash-es/_composeArgs.js");
  103409. /* harmony import */ var _composeArgsRight_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_composeArgsRight.js */ "./node_modules/lodash-es/_composeArgsRight.js");
  103410. /* harmony import */ var _countHolders_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_countHolders.js */ "./node_modules/lodash-es/_countHolders.js");
  103411. /* harmony import */ var _createCtor_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_createCtor.js */ "./node_modules/lodash-es/_createCtor.js");
  103412. /* harmony import */ var _createRecurry_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_createRecurry.js */ "./node_modules/lodash-es/_createRecurry.js");
  103413. /* harmony import */ var _getHolder_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./_getHolder.js */ "./node_modules/lodash-es/_getHolder.js");
  103414. /* harmony import */ var _reorder_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./_reorder.js */ "./node_modules/lodash-es/_reorder.js");
  103415. /* harmony import */ var _replaceHolders_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./_replaceHolders.js */ "./node_modules/lodash-es/_replaceHolders.js");
  103416. /* harmony import */ var _root_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./_root.js */ "./node_modules/lodash-es/_root.js");
  103417. /** Used to compose bitmasks for function metadata. */
  103418. var WRAP_BIND_FLAG = 1,
  103419. WRAP_BIND_KEY_FLAG = 2,
  103420. WRAP_CURRY_FLAG = 8,
  103421. WRAP_CURRY_RIGHT_FLAG = 16,
  103422. WRAP_ARY_FLAG = 128,
  103423. WRAP_FLIP_FLAG = 512;
  103424. /**
  103425. * Creates a function that wraps `func` to invoke it with optional `this`
  103426. * binding of `thisArg`, partial application, and currying.
  103427. *
  103428. * @private
  103429. * @param {Function|string} func The function or method name to wrap.
  103430. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  103431. * @param {*} [thisArg] The `this` binding of `func`.
  103432. * @param {Array} [partials] The arguments to prepend to those provided to
  103433. * the new function.
  103434. * @param {Array} [holders] The `partials` placeholder indexes.
  103435. * @param {Array} [partialsRight] The arguments to append to those provided
  103436. * to the new function.
  103437. * @param {Array} [holdersRight] The `partialsRight` placeholder indexes.
  103438. * @param {Array} [argPos] The argument positions of the new function.
  103439. * @param {number} [ary] The arity cap of `func`.
  103440. * @param {number} [arity] The arity of `func`.
  103441. * @returns {Function} Returns the new wrapped function.
  103442. */
  103443. function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) {
  103444. var isAry = bitmask & WRAP_ARY_FLAG,
  103445. isBind = bitmask & WRAP_BIND_FLAG,
  103446. isBindKey = bitmask & WRAP_BIND_KEY_FLAG,
  103447. isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG),
  103448. isFlip = bitmask & WRAP_FLIP_FLAG,
  103449. Ctor = isBindKey ? undefined : Object(_createCtor_js__WEBPACK_IMPORTED_MODULE_3__["default"])(func);
  103450. function wrapper() {
  103451. var length = arguments.length,
  103452. args = Array(length),
  103453. index = length;
  103454. while (index--) {
  103455. args[index] = arguments[index];
  103456. }
  103457. if (isCurried) {
  103458. var placeholder = Object(_getHolder_js__WEBPACK_IMPORTED_MODULE_5__["default"])(wrapper),
  103459. holdersCount = Object(_countHolders_js__WEBPACK_IMPORTED_MODULE_2__["default"])(args, placeholder);
  103460. }
  103461. if (partials) {
  103462. args = Object(_composeArgs_js__WEBPACK_IMPORTED_MODULE_0__["default"])(args, partials, holders, isCurried);
  103463. }
  103464. if (partialsRight) {
  103465. args = Object(_composeArgsRight_js__WEBPACK_IMPORTED_MODULE_1__["default"])(args, partialsRight, holdersRight, isCurried);
  103466. }
  103467. length -= holdersCount;
  103468. if (isCurried && length < arity) {
  103469. var newHolders = Object(_replaceHolders_js__WEBPACK_IMPORTED_MODULE_7__["default"])(args, placeholder);
  103470. return Object(_createRecurry_js__WEBPACK_IMPORTED_MODULE_4__["default"])(
  103471. func, bitmask, createHybrid, wrapper.placeholder, thisArg,
  103472. args, newHolders, argPos, ary, arity - length
  103473. );
  103474. }
  103475. var thisBinding = isBind ? thisArg : this,
  103476. fn = isBindKey ? thisBinding[func] : func;
  103477. length = args.length;
  103478. if (argPos) {
  103479. args = Object(_reorder_js__WEBPACK_IMPORTED_MODULE_6__["default"])(args, argPos);
  103480. } else if (isFlip && length > 1) {
  103481. args.reverse();
  103482. }
  103483. if (isAry && ary < length) {
  103484. args.length = ary;
  103485. }
  103486. if (this && this !== _root_js__WEBPACK_IMPORTED_MODULE_8__["default"] && this instanceof wrapper) {
  103487. fn = Ctor || Object(_createCtor_js__WEBPACK_IMPORTED_MODULE_3__["default"])(fn);
  103488. }
  103489. return fn.apply(thisBinding, args);
  103490. }
  103491. return wrapper;
  103492. }
  103493. /* harmony default export */ __webpack_exports__["default"] = (createHybrid);
  103494. /***/ }),
  103495. /***/ "./node_modules/lodash-es/_createInverter.js":
  103496. /*!***************************************************!*\
  103497. !*** ./node_modules/lodash-es/_createInverter.js ***!
  103498. \***************************************************/
  103499. /*! exports provided: default */
  103500. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  103501. "use strict";
  103502. __webpack_require__.r(__webpack_exports__);
  103503. /* harmony import */ var _baseInverter_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseInverter.js */ "./node_modules/lodash-es/_baseInverter.js");
  103504. /**
  103505. * Creates a function like `_.invertBy`.
  103506. *
  103507. * @private
  103508. * @param {Function} setter The function to set accumulator values.
  103509. * @param {Function} toIteratee The function to resolve iteratees.
  103510. * @returns {Function} Returns the new inverter function.
  103511. */
  103512. function createInverter(setter, toIteratee) {
  103513. return function(object, iteratee) {
  103514. return Object(_baseInverter_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, setter, toIteratee(iteratee), {});
  103515. };
  103516. }
  103517. /* harmony default export */ __webpack_exports__["default"] = (createInverter);
  103518. /***/ }),
  103519. /***/ "./node_modules/lodash-es/_createMathOperation.js":
  103520. /*!********************************************************!*\
  103521. !*** ./node_modules/lodash-es/_createMathOperation.js ***!
  103522. \********************************************************/
  103523. /*! exports provided: default */
  103524. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  103525. "use strict";
  103526. __webpack_require__.r(__webpack_exports__);
  103527. /* harmony import */ var _baseToNumber_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseToNumber.js */ "./node_modules/lodash-es/_baseToNumber.js");
  103528. /* harmony import */ var _baseToString_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseToString.js */ "./node_modules/lodash-es/_baseToString.js");
  103529. /**
  103530. * Creates a function that performs a mathematical operation on two values.
  103531. *
  103532. * @private
  103533. * @param {Function} operator The function to perform the operation.
  103534. * @param {number} [defaultValue] The value used for `undefined` arguments.
  103535. * @returns {Function} Returns the new mathematical operation function.
  103536. */
  103537. function createMathOperation(operator, defaultValue) {
  103538. return function(value, other) {
  103539. var result;
  103540. if (value === undefined && other === undefined) {
  103541. return defaultValue;
  103542. }
  103543. if (value !== undefined) {
  103544. result = value;
  103545. }
  103546. if (other !== undefined) {
  103547. if (result === undefined) {
  103548. return other;
  103549. }
  103550. if (typeof value == 'string' || typeof other == 'string') {
  103551. value = Object(_baseToString_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value);
  103552. other = Object(_baseToString_js__WEBPACK_IMPORTED_MODULE_1__["default"])(other);
  103553. } else {
  103554. value = Object(_baseToNumber_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value);
  103555. other = Object(_baseToNumber_js__WEBPACK_IMPORTED_MODULE_0__["default"])(other);
  103556. }
  103557. result = operator(value, other);
  103558. }
  103559. return result;
  103560. };
  103561. }
  103562. /* harmony default export */ __webpack_exports__["default"] = (createMathOperation);
  103563. /***/ }),
  103564. /***/ "./node_modules/lodash-es/_createOver.js":
  103565. /*!***********************************************!*\
  103566. !*** ./node_modules/lodash-es/_createOver.js ***!
  103567. \***********************************************/
  103568. /*! exports provided: default */
  103569. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  103570. "use strict";
  103571. __webpack_require__.r(__webpack_exports__);
  103572. /* harmony import */ var _apply_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_apply.js */ "./node_modules/lodash-es/_apply.js");
  103573. /* harmony import */ var _arrayMap_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_arrayMap.js */ "./node_modules/lodash-es/_arrayMap.js");
  103574. /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
  103575. /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
  103576. /* harmony import */ var _baseUnary_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_baseUnary.js */ "./node_modules/lodash-es/_baseUnary.js");
  103577. /* harmony import */ var _flatRest_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./_flatRest.js */ "./node_modules/lodash-es/_flatRest.js");
  103578. /**
  103579. * Creates a function like `_.over`.
  103580. *
  103581. * @private
  103582. * @param {Function} arrayFunc The function to iterate over iteratees.
  103583. * @returns {Function} Returns the new over function.
  103584. */
  103585. function createOver(arrayFunc) {
  103586. return Object(_flatRest_js__WEBPACK_IMPORTED_MODULE_5__["default"])(function(iteratees) {
  103587. 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"]));
  103588. return Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_3__["default"])(function(args) {
  103589. var thisArg = this;
  103590. return arrayFunc(iteratees, function(iteratee) {
  103591. return Object(_apply_js__WEBPACK_IMPORTED_MODULE_0__["default"])(iteratee, thisArg, args);
  103592. });
  103593. });
  103594. });
  103595. }
  103596. /* harmony default export */ __webpack_exports__["default"] = (createOver);
  103597. /***/ }),
  103598. /***/ "./node_modules/lodash-es/_createPadding.js":
  103599. /*!**************************************************!*\
  103600. !*** ./node_modules/lodash-es/_createPadding.js ***!
  103601. \**************************************************/
  103602. /*! exports provided: default */
  103603. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  103604. "use strict";
  103605. __webpack_require__.r(__webpack_exports__);
  103606. /* harmony import */ var _baseRepeat_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseRepeat.js */ "./node_modules/lodash-es/_baseRepeat.js");
  103607. /* harmony import */ var _baseToString_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseToString.js */ "./node_modules/lodash-es/_baseToString.js");
  103608. /* harmony import */ var _castSlice_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_castSlice.js */ "./node_modules/lodash-es/_castSlice.js");
  103609. /* harmony import */ var _hasUnicode_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_hasUnicode.js */ "./node_modules/lodash-es/_hasUnicode.js");
  103610. /* harmony import */ var _stringSize_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_stringSize.js */ "./node_modules/lodash-es/_stringSize.js");
  103611. /* harmony import */ var _stringToArray_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./_stringToArray.js */ "./node_modules/lodash-es/_stringToArray.js");
  103612. /* Built-in method references for those with the same name as other `lodash` methods. */
  103613. var nativeCeil = Math.ceil;
  103614. /**
  103615. * Creates the padding for `string` based on `length`. The `chars` string
  103616. * is truncated if the number of characters exceeds `length`.
  103617. *
  103618. * @private
  103619. * @param {number} length The padding length.
  103620. * @param {string} [chars=' '] The string used as padding.
  103621. * @returns {string} Returns the padding for `string`.
  103622. */
  103623. function createPadding(length, chars) {
  103624. chars = chars === undefined ? ' ' : Object(_baseToString_js__WEBPACK_IMPORTED_MODULE_1__["default"])(chars);
  103625. var charsLength = chars.length;
  103626. if (charsLength < 2) {
  103627. return charsLength ? Object(_baseRepeat_js__WEBPACK_IMPORTED_MODULE_0__["default"])(chars, length) : chars;
  103628. }
  103629. var result = Object(_baseRepeat_js__WEBPACK_IMPORTED_MODULE_0__["default"])(chars, nativeCeil(length / Object(_stringSize_js__WEBPACK_IMPORTED_MODULE_4__["default"])(chars)));
  103630. return Object(_hasUnicode_js__WEBPACK_IMPORTED_MODULE_3__["default"])(chars)
  103631. ? Object(_castSlice_js__WEBPACK_IMPORTED_MODULE_2__["default"])(Object(_stringToArray_js__WEBPACK_IMPORTED_MODULE_5__["default"])(result), 0, length).join('')
  103632. : result.slice(0, length);
  103633. }
  103634. /* harmony default export */ __webpack_exports__["default"] = (createPadding);
  103635. /***/ }),
  103636. /***/ "./node_modules/lodash-es/_createPartial.js":
  103637. /*!**************************************************!*\
  103638. !*** ./node_modules/lodash-es/_createPartial.js ***!
  103639. \**************************************************/
  103640. /*! exports provided: default */
  103641. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  103642. "use strict";
  103643. __webpack_require__.r(__webpack_exports__);
  103644. /* harmony import */ var _apply_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_apply.js */ "./node_modules/lodash-es/_apply.js");
  103645. /* harmony import */ var _createCtor_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_createCtor.js */ "./node_modules/lodash-es/_createCtor.js");
  103646. /* harmony import */ var _root_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_root.js */ "./node_modules/lodash-es/_root.js");
  103647. /** Used to compose bitmasks for function metadata. */
  103648. var WRAP_BIND_FLAG = 1;
  103649. /**
  103650. * Creates a function that wraps `func` to invoke it with the `this` binding
  103651. * of `thisArg` and `partials` prepended to the arguments it receives.
  103652. *
  103653. * @private
  103654. * @param {Function} func The function to wrap.
  103655. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  103656. * @param {*} thisArg The `this` binding of `func`.
  103657. * @param {Array} partials The arguments to prepend to those provided to
  103658. * the new function.
  103659. * @returns {Function} Returns the new wrapped function.
  103660. */
  103661. function createPartial(func, bitmask, thisArg, partials) {
  103662. var isBind = bitmask & WRAP_BIND_FLAG,
  103663. Ctor = Object(_createCtor_js__WEBPACK_IMPORTED_MODULE_1__["default"])(func);
  103664. function wrapper() {
  103665. var argsIndex = -1,
  103666. argsLength = arguments.length,
  103667. leftIndex = -1,
  103668. leftLength = partials.length,
  103669. args = Array(leftLength + argsLength),
  103670. fn = (this && this !== _root_js__WEBPACK_IMPORTED_MODULE_2__["default"] && this instanceof wrapper) ? Ctor : func;
  103671. while (++leftIndex < leftLength) {
  103672. args[leftIndex] = partials[leftIndex];
  103673. }
  103674. while (argsLength--) {
  103675. args[leftIndex++] = arguments[++argsIndex];
  103676. }
  103677. return Object(_apply_js__WEBPACK_IMPORTED_MODULE_0__["default"])(fn, isBind ? thisArg : this, args);
  103678. }
  103679. return wrapper;
  103680. }
  103681. /* harmony default export */ __webpack_exports__["default"] = (createPartial);
  103682. /***/ }),
  103683. /***/ "./node_modules/lodash-es/_createRange.js":
  103684. /*!************************************************!*\
  103685. !*** ./node_modules/lodash-es/_createRange.js ***!
  103686. \************************************************/
  103687. /*! exports provided: default */
  103688. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  103689. "use strict";
  103690. __webpack_require__.r(__webpack_exports__);
  103691. /* harmony import */ var _baseRange_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseRange.js */ "./node_modules/lodash-es/_baseRange.js");
  103692. /* harmony import */ var _isIterateeCall_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_isIterateeCall.js */ "./node_modules/lodash-es/_isIterateeCall.js");
  103693. /* harmony import */ var _toFinite_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./toFinite.js */ "./node_modules/lodash-es/toFinite.js");
  103694. /**
  103695. * Creates a `_.range` or `_.rangeRight` function.
  103696. *
  103697. * @private
  103698. * @param {boolean} [fromRight] Specify iterating from right to left.
  103699. * @returns {Function} Returns the new range function.
  103700. */
  103701. function createRange(fromRight) {
  103702. return function(start, end, step) {
  103703. if (step && typeof step != 'number' && Object(_isIterateeCall_js__WEBPACK_IMPORTED_MODULE_1__["default"])(start, end, step)) {
  103704. end = step = undefined;
  103705. }
  103706. // Ensure the sign of `-0` is preserved.
  103707. start = Object(_toFinite_js__WEBPACK_IMPORTED_MODULE_2__["default"])(start);
  103708. if (end === undefined) {
  103709. end = start;
  103710. start = 0;
  103711. } else {
  103712. end = Object(_toFinite_js__WEBPACK_IMPORTED_MODULE_2__["default"])(end);
  103713. }
  103714. step = step === undefined ? (start < end ? 1 : -1) : Object(_toFinite_js__WEBPACK_IMPORTED_MODULE_2__["default"])(step);
  103715. return Object(_baseRange_js__WEBPACK_IMPORTED_MODULE_0__["default"])(start, end, step, fromRight);
  103716. };
  103717. }
  103718. /* harmony default export */ __webpack_exports__["default"] = (createRange);
  103719. /***/ }),
  103720. /***/ "./node_modules/lodash-es/_createRecurry.js":
  103721. /*!**************************************************!*\
  103722. !*** ./node_modules/lodash-es/_createRecurry.js ***!
  103723. \**************************************************/
  103724. /*! exports provided: default */
  103725. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  103726. "use strict";
  103727. __webpack_require__.r(__webpack_exports__);
  103728. /* harmony import */ var _isLaziable_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_isLaziable.js */ "./node_modules/lodash-es/_isLaziable.js");
  103729. /* harmony import */ var _setData_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_setData.js */ "./node_modules/lodash-es/_setData.js");
  103730. /* harmony import */ var _setWrapToString_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_setWrapToString.js */ "./node_modules/lodash-es/_setWrapToString.js");
  103731. /** Used to compose bitmasks for function metadata. */
  103732. var WRAP_BIND_FLAG = 1,
  103733. WRAP_BIND_KEY_FLAG = 2,
  103734. WRAP_CURRY_BOUND_FLAG = 4,
  103735. WRAP_CURRY_FLAG = 8,
  103736. WRAP_PARTIAL_FLAG = 32,
  103737. WRAP_PARTIAL_RIGHT_FLAG = 64;
  103738. /**
  103739. * Creates a function that wraps `func` to continue currying.
  103740. *
  103741. * @private
  103742. * @param {Function} func The function to wrap.
  103743. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  103744. * @param {Function} wrapFunc The function to create the `func` wrapper.
  103745. * @param {*} placeholder The placeholder value.
  103746. * @param {*} [thisArg] The `this` binding of `func`.
  103747. * @param {Array} [partials] The arguments to prepend to those provided to
  103748. * the new function.
  103749. * @param {Array} [holders] The `partials` placeholder indexes.
  103750. * @param {Array} [argPos] The argument positions of the new function.
  103751. * @param {number} [ary] The arity cap of `func`.
  103752. * @param {number} [arity] The arity of `func`.
  103753. * @returns {Function} Returns the new wrapped function.
  103754. */
  103755. function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) {
  103756. var isCurry = bitmask & WRAP_CURRY_FLAG,
  103757. newHolders = isCurry ? holders : undefined,
  103758. newHoldersRight = isCurry ? undefined : holders,
  103759. newPartials = isCurry ? partials : undefined,
  103760. newPartialsRight = isCurry ? undefined : partials;
  103761. bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG);
  103762. bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG);
  103763. if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) {
  103764. bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG);
  103765. }
  103766. var newData = [
  103767. func, bitmask, thisArg, newPartials, newHolders, newPartialsRight,
  103768. newHoldersRight, argPos, ary, arity
  103769. ];
  103770. var result = wrapFunc.apply(undefined, newData);
  103771. if (Object(_isLaziable_js__WEBPACK_IMPORTED_MODULE_0__["default"])(func)) {
  103772. Object(_setData_js__WEBPACK_IMPORTED_MODULE_1__["default"])(result, newData);
  103773. }
  103774. result.placeholder = placeholder;
  103775. return Object(_setWrapToString_js__WEBPACK_IMPORTED_MODULE_2__["default"])(result, func, bitmask);
  103776. }
  103777. /* harmony default export */ __webpack_exports__["default"] = (createRecurry);
  103778. /***/ }),
  103779. /***/ "./node_modules/lodash-es/_createRelationalOperation.js":
  103780. /*!**************************************************************!*\
  103781. !*** ./node_modules/lodash-es/_createRelationalOperation.js ***!
  103782. \**************************************************************/
  103783. /*! exports provided: default */
  103784. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  103785. "use strict";
  103786. __webpack_require__.r(__webpack_exports__);
  103787. /* harmony import */ var _toNumber_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./toNumber.js */ "./node_modules/lodash-es/toNumber.js");
  103788. /**
  103789. * Creates a function that performs a relational operation on two values.
  103790. *
  103791. * @private
  103792. * @param {Function} operator The function to perform the operation.
  103793. * @returns {Function} Returns the new relational operation function.
  103794. */
  103795. function createRelationalOperation(operator) {
  103796. return function(value, other) {
  103797. if (!(typeof value == 'string' && typeof other == 'string')) {
  103798. value = Object(_toNumber_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value);
  103799. other = Object(_toNumber_js__WEBPACK_IMPORTED_MODULE_0__["default"])(other);
  103800. }
  103801. return operator(value, other);
  103802. };
  103803. }
  103804. /* harmony default export */ __webpack_exports__["default"] = (createRelationalOperation);
  103805. /***/ }),
  103806. /***/ "./node_modules/lodash-es/_createRound.js":
  103807. /*!************************************************!*\
  103808. !*** ./node_modules/lodash-es/_createRound.js ***!
  103809. \************************************************/
  103810. /*! exports provided: default */
  103811. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  103812. "use strict";
  103813. __webpack_require__.r(__webpack_exports__);
  103814. /* harmony import */ var _root_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_root.js */ "./node_modules/lodash-es/_root.js");
  103815. /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
  103816. /* harmony import */ var _toNumber_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./toNumber.js */ "./node_modules/lodash-es/toNumber.js");
  103817. /* harmony import */ var _toString_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./toString.js */ "./node_modules/lodash-es/toString.js");
  103818. /* Built-in method references for those with the same name as other `lodash` methods. */
  103819. var nativeIsFinite = _root_js__WEBPACK_IMPORTED_MODULE_0__["default"].isFinite,
  103820. nativeMin = Math.min;
  103821. /**
  103822. * Creates a function like `_.round`.
  103823. *
  103824. * @private
  103825. * @param {string} methodName The name of the `Math` method to use when rounding.
  103826. * @returns {Function} Returns the new round function.
  103827. */
  103828. function createRound(methodName) {
  103829. var func = Math[methodName];
  103830. return function(number, precision) {
  103831. number = Object(_toNumber_js__WEBPACK_IMPORTED_MODULE_2__["default"])(number);
  103832. precision = precision == null ? 0 : nativeMin(Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_1__["default"])(precision), 292);
  103833. if (precision && nativeIsFinite(number)) {
  103834. // Shift with exponential notation to avoid floating-point issues.
  103835. // See [MDN](https://mdn.io/round#Examples) for more details.
  103836. var pair = (Object(_toString_js__WEBPACK_IMPORTED_MODULE_3__["default"])(number) + 'e').split('e'),
  103837. value = func(pair[0] + 'e' + (+pair[1] + precision));
  103838. pair = (Object(_toString_js__WEBPACK_IMPORTED_MODULE_3__["default"])(value) + 'e').split('e');
  103839. return +(pair[0] + 'e' + (+pair[1] - precision));
  103840. }
  103841. return func(number);
  103842. };
  103843. }
  103844. /* harmony default export */ __webpack_exports__["default"] = (createRound);
  103845. /***/ }),
  103846. /***/ "./node_modules/lodash-es/_createSet.js":
  103847. /*!**********************************************!*\
  103848. !*** ./node_modules/lodash-es/_createSet.js ***!
  103849. \**********************************************/
  103850. /*! exports provided: default */
  103851. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  103852. "use strict";
  103853. __webpack_require__.r(__webpack_exports__);
  103854. /* harmony import */ var _Set_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_Set.js */ "./node_modules/lodash-es/_Set.js");
  103855. /* harmony import */ var _noop_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./noop.js */ "./node_modules/lodash-es/noop.js");
  103856. /* harmony import */ var _setToArray_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_setToArray.js */ "./node_modules/lodash-es/_setToArray.js");
  103857. /** Used as references for various `Number` constants. */
  103858. var INFINITY = 1 / 0;
  103859. /**
  103860. * Creates a set object of `values`.
  103861. *
  103862. * @private
  103863. * @param {Array} values The values to add to the set.
  103864. * @returns {Object} Returns the new set.
  103865. */
  103866. 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) {
  103867. return new _Set_js__WEBPACK_IMPORTED_MODULE_0__["default"](values);
  103868. };
  103869. /* harmony default export */ __webpack_exports__["default"] = (createSet);
  103870. /***/ }),
  103871. /***/ "./node_modules/lodash-es/_createToPairs.js":
  103872. /*!**************************************************!*\
  103873. !*** ./node_modules/lodash-es/_createToPairs.js ***!
  103874. \**************************************************/
  103875. /*! exports provided: default */
  103876. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  103877. "use strict";
  103878. __webpack_require__.r(__webpack_exports__);
  103879. /* harmony import */ var _baseToPairs_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseToPairs.js */ "./node_modules/lodash-es/_baseToPairs.js");
  103880. /* harmony import */ var _getTag_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_getTag.js */ "./node_modules/lodash-es/_getTag.js");
  103881. /* harmony import */ var _mapToArray_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_mapToArray.js */ "./node_modules/lodash-es/_mapToArray.js");
  103882. /* harmony import */ var _setToPairs_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_setToPairs.js */ "./node_modules/lodash-es/_setToPairs.js");
  103883. /** `Object#toString` result references. */
  103884. var mapTag = '[object Map]',
  103885. setTag = '[object Set]';
  103886. /**
  103887. * Creates a `_.toPairs` or `_.toPairsIn` function.
  103888. *
  103889. * @private
  103890. * @param {Function} keysFunc The function to get the keys of a given object.
  103891. * @returns {Function} Returns the new pairs function.
  103892. */
  103893. function createToPairs(keysFunc) {
  103894. return function(object) {
  103895. var tag = Object(_getTag_js__WEBPACK_IMPORTED_MODULE_1__["default"])(object);
  103896. if (tag == mapTag) {
  103897. return Object(_mapToArray_js__WEBPACK_IMPORTED_MODULE_2__["default"])(object);
  103898. }
  103899. if (tag == setTag) {
  103900. return Object(_setToPairs_js__WEBPACK_IMPORTED_MODULE_3__["default"])(object);
  103901. }
  103902. return Object(_baseToPairs_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, keysFunc(object));
  103903. };
  103904. }
  103905. /* harmony default export */ __webpack_exports__["default"] = (createToPairs);
  103906. /***/ }),
  103907. /***/ "./node_modules/lodash-es/_createWrap.js":
  103908. /*!***********************************************!*\
  103909. !*** ./node_modules/lodash-es/_createWrap.js ***!
  103910. \***********************************************/
  103911. /*! exports provided: default */
  103912. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  103913. "use strict";
  103914. __webpack_require__.r(__webpack_exports__);
  103915. /* harmony import */ var _baseSetData_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseSetData.js */ "./node_modules/lodash-es/_baseSetData.js");
  103916. /* harmony import */ var _createBind_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_createBind.js */ "./node_modules/lodash-es/_createBind.js");
  103917. /* harmony import */ var _createCurry_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_createCurry.js */ "./node_modules/lodash-es/_createCurry.js");
  103918. /* harmony import */ var _createHybrid_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_createHybrid.js */ "./node_modules/lodash-es/_createHybrid.js");
  103919. /* harmony import */ var _createPartial_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_createPartial.js */ "./node_modules/lodash-es/_createPartial.js");
  103920. /* harmony import */ var _getData_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./_getData.js */ "./node_modules/lodash-es/_getData.js");
  103921. /* harmony import */ var _mergeData_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./_mergeData.js */ "./node_modules/lodash-es/_mergeData.js");
  103922. /* harmony import */ var _setData_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./_setData.js */ "./node_modules/lodash-es/_setData.js");
  103923. /* harmony import */ var _setWrapToString_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./_setWrapToString.js */ "./node_modules/lodash-es/_setWrapToString.js");
  103924. /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
  103925. /** Error message constants. */
  103926. var FUNC_ERROR_TEXT = 'Expected a function';
  103927. /** Used to compose bitmasks for function metadata. */
  103928. var WRAP_BIND_FLAG = 1,
  103929. WRAP_BIND_KEY_FLAG = 2,
  103930. WRAP_CURRY_FLAG = 8,
  103931. WRAP_CURRY_RIGHT_FLAG = 16,
  103932. WRAP_PARTIAL_FLAG = 32,
  103933. WRAP_PARTIAL_RIGHT_FLAG = 64;
  103934. /* Built-in method references for those with the same name as other `lodash` methods. */
  103935. var nativeMax = Math.max;
  103936. /**
  103937. * Creates a function that either curries or invokes `func` with optional
  103938. * `this` binding and partially applied arguments.
  103939. *
  103940. * @private
  103941. * @param {Function|string} func The function or method name to wrap.
  103942. * @param {number} bitmask The bitmask flags.
  103943. * 1 - `_.bind`
  103944. * 2 - `_.bindKey`
  103945. * 4 - `_.curry` or `_.curryRight` of a bound function
  103946. * 8 - `_.curry`
  103947. * 16 - `_.curryRight`
  103948. * 32 - `_.partial`
  103949. * 64 - `_.partialRight`
  103950. * 128 - `_.rearg`
  103951. * 256 - `_.ary`
  103952. * 512 - `_.flip`
  103953. * @param {*} [thisArg] The `this` binding of `func`.
  103954. * @param {Array} [partials] The arguments to be partially applied.
  103955. * @param {Array} [holders] The `partials` placeholder indexes.
  103956. * @param {Array} [argPos] The argument positions of the new function.
  103957. * @param {number} [ary] The arity cap of `func`.
  103958. * @param {number} [arity] The arity of `func`.
  103959. * @returns {Function} Returns the new wrapped function.
  103960. */
  103961. function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) {
  103962. var isBindKey = bitmask & WRAP_BIND_KEY_FLAG;
  103963. if (!isBindKey && typeof func != 'function') {
  103964. throw new TypeError(FUNC_ERROR_TEXT);
  103965. }
  103966. var length = partials ? partials.length : 0;
  103967. if (!length) {
  103968. bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG);
  103969. partials = holders = undefined;
  103970. }
  103971. ary = ary === undefined ? ary : nativeMax(Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_9__["default"])(ary), 0);
  103972. arity = arity === undefined ? arity : Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_9__["default"])(arity);
  103973. length -= holders ? holders.length : 0;
  103974. if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) {
  103975. var partialsRight = partials,
  103976. holdersRight = holders;
  103977. partials = holders = undefined;
  103978. }
  103979. var data = isBindKey ? undefined : Object(_getData_js__WEBPACK_IMPORTED_MODULE_5__["default"])(func);
  103980. var newData = [
  103981. func, bitmask, thisArg, partials, holders, partialsRight, holdersRight,
  103982. argPos, ary, arity
  103983. ];
  103984. if (data) {
  103985. Object(_mergeData_js__WEBPACK_IMPORTED_MODULE_6__["default"])(newData, data);
  103986. }
  103987. func = newData[0];
  103988. bitmask = newData[1];
  103989. thisArg = newData[2];
  103990. partials = newData[3];
  103991. holders = newData[4];
  103992. arity = newData[9] = newData[9] === undefined
  103993. ? (isBindKey ? 0 : func.length)
  103994. : nativeMax(newData[9] - length, 0);
  103995. if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) {
  103996. bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG);
  103997. }
  103998. if (!bitmask || bitmask == WRAP_BIND_FLAG) {
  103999. var result = Object(_createBind_js__WEBPACK_IMPORTED_MODULE_1__["default"])(func, bitmask, thisArg);
  104000. } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) {
  104001. result = Object(_createCurry_js__WEBPACK_IMPORTED_MODULE_2__["default"])(func, bitmask, arity);
  104002. } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) {
  104003. result = Object(_createPartial_js__WEBPACK_IMPORTED_MODULE_4__["default"])(func, bitmask, thisArg, partials);
  104004. } else {
  104005. result = _createHybrid_js__WEBPACK_IMPORTED_MODULE_3__["default"].apply(undefined, newData);
  104006. }
  104007. var setter = data ? _baseSetData_js__WEBPACK_IMPORTED_MODULE_0__["default"] : _setData_js__WEBPACK_IMPORTED_MODULE_7__["default"];
  104008. return Object(_setWrapToString_js__WEBPACK_IMPORTED_MODULE_8__["default"])(setter(result, newData), func, bitmask);
  104009. }
  104010. /* harmony default export */ __webpack_exports__["default"] = (createWrap);
  104011. /***/ }),
  104012. /***/ "./node_modules/lodash-es/_customDefaultsAssignIn.js":
  104013. /*!***********************************************************!*\
  104014. !*** ./node_modules/lodash-es/_customDefaultsAssignIn.js ***!
  104015. \***********************************************************/
  104016. /*! exports provided: default */
  104017. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  104018. "use strict";
  104019. __webpack_require__.r(__webpack_exports__);
  104020. /* harmony import */ var _eq_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./eq.js */ "./node_modules/lodash-es/eq.js");
  104021. /** Used for built-in method references. */
  104022. var objectProto = Object.prototype;
  104023. /** Used to check objects for own properties. */
  104024. var hasOwnProperty = objectProto.hasOwnProperty;
  104025. /**
  104026. * Used by `_.defaults` to customize its `_.assignIn` use to assign properties
  104027. * of source objects to the destination object for all destination properties
  104028. * that resolve to `undefined`.
  104029. *
  104030. * @private
  104031. * @param {*} objValue The destination value.
  104032. * @param {*} srcValue The source value.
  104033. * @param {string} key The key of the property to assign.
  104034. * @param {Object} object The parent object of `objValue`.
  104035. * @returns {*} Returns the value to assign.
  104036. */
  104037. function customDefaultsAssignIn(objValue, srcValue, key, object) {
  104038. if (objValue === undefined ||
  104039. (Object(_eq_js__WEBPACK_IMPORTED_MODULE_0__["default"])(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) {
  104040. return srcValue;
  104041. }
  104042. return objValue;
  104043. }
  104044. /* harmony default export */ __webpack_exports__["default"] = (customDefaultsAssignIn);
  104045. /***/ }),
  104046. /***/ "./node_modules/lodash-es/_customDefaultsMerge.js":
  104047. /*!********************************************************!*\
  104048. !*** ./node_modules/lodash-es/_customDefaultsMerge.js ***!
  104049. \********************************************************/
  104050. /*! exports provided: default */
  104051. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  104052. "use strict";
  104053. __webpack_require__.r(__webpack_exports__);
  104054. /* harmony import */ var _baseMerge_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseMerge.js */ "./node_modules/lodash-es/_baseMerge.js");
  104055. /* harmony import */ var _isObject_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isObject.js */ "./node_modules/lodash-es/isObject.js");
  104056. /**
  104057. * Used by `_.defaultsDeep` to customize its `_.merge` use to merge source
  104058. * objects into destination objects that are passed thru.
  104059. *
  104060. * @private
  104061. * @param {*} objValue The destination value.
  104062. * @param {*} srcValue The source value.
  104063. * @param {string} key The key of the property to merge.
  104064. * @param {Object} object The parent object of `objValue`.
  104065. * @param {Object} source The parent object of `srcValue`.
  104066. * @param {Object} [stack] Tracks traversed source values and their merged
  104067. * counterparts.
  104068. * @returns {*} Returns the value to assign.
  104069. */
  104070. function customDefaultsMerge(objValue, srcValue, key, object, source, stack) {
  104071. if (Object(_isObject_js__WEBPACK_IMPORTED_MODULE_1__["default"])(objValue) && Object(_isObject_js__WEBPACK_IMPORTED_MODULE_1__["default"])(srcValue)) {
  104072. // Recursively merge objects and arrays (susceptible to call stack limits).
  104073. stack.set(srcValue, objValue);
  104074. Object(_baseMerge_js__WEBPACK_IMPORTED_MODULE_0__["default"])(objValue, srcValue, undefined, customDefaultsMerge, stack);
  104075. stack['delete'](srcValue);
  104076. }
  104077. return objValue;
  104078. }
  104079. /* harmony default export */ __webpack_exports__["default"] = (customDefaultsMerge);
  104080. /***/ }),
  104081. /***/ "./node_modules/lodash-es/_customOmitClone.js":
  104082. /*!****************************************************!*\
  104083. !*** ./node_modules/lodash-es/_customOmitClone.js ***!
  104084. \****************************************************/
  104085. /*! exports provided: default */
  104086. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  104087. "use strict";
  104088. __webpack_require__.r(__webpack_exports__);
  104089. /* harmony import */ var _isPlainObject_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isPlainObject.js */ "./node_modules/lodash-es/isPlainObject.js");
  104090. /**
  104091. * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain
  104092. * objects.
  104093. *
  104094. * @private
  104095. * @param {*} value The value to inspect.
  104096. * @param {string} key The key of the property to inspect.
  104097. * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`.
  104098. */
  104099. function customOmitClone(value) {
  104100. return Object(_isPlainObject_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value) ? undefined : value;
  104101. }
  104102. /* harmony default export */ __webpack_exports__["default"] = (customOmitClone);
  104103. /***/ }),
  104104. /***/ "./node_modules/lodash-es/_deburrLetter.js":
  104105. /*!*************************************************!*\
  104106. !*** ./node_modules/lodash-es/_deburrLetter.js ***!
  104107. \*************************************************/
  104108. /*! exports provided: default */
  104109. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  104110. "use strict";
  104111. __webpack_require__.r(__webpack_exports__);
  104112. /* harmony import */ var _basePropertyOf_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_basePropertyOf.js */ "./node_modules/lodash-es/_basePropertyOf.js");
  104113. /** Used to map Latin Unicode letters to basic Latin letters. */
  104114. var deburredLetters = {
  104115. // Latin-1 Supplement block.
  104116. '\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A',
  104117. '\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a',
  104118. '\xc7': 'C', '\xe7': 'c',
  104119. '\xd0': 'D', '\xf0': 'd',
  104120. '\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E',
  104121. '\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e',
  104122. '\xcc': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I',
  104123. '\xec': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i',
  104124. '\xd1': 'N', '\xf1': 'n',
  104125. '\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O',
  104126. '\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o',
  104127. '\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U',
  104128. '\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u',
  104129. '\xdd': 'Y', '\xfd': 'y', '\xff': 'y',
  104130. '\xc6': 'Ae', '\xe6': 'ae',
  104131. '\xde': 'Th', '\xfe': 'th',
  104132. '\xdf': 'ss',
  104133. // Latin Extended-A block.
  104134. '\u0100': 'A', '\u0102': 'A', '\u0104': 'A',
  104135. '\u0101': 'a', '\u0103': 'a', '\u0105': 'a',
  104136. '\u0106': 'C', '\u0108': 'C', '\u010a': 'C', '\u010c': 'C',
  104137. '\u0107': 'c', '\u0109': 'c', '\u010b': 'c', '\u010d': 'c',
  104138. '\u010e': 'D', '\u0110': 'D', '\u010f': 'd', '\u0111': 'd',
  104139. '\u0112': 'E', '\u0114': 'E', '\u0116': 'E', '\u0118': 'E', '\u011a': 'E',
  104140. '\u0113': 'e', '\u0115': 'e', '\u0117': 'e', '\u0119': 'e', '\u011b': 'e',
  104141. '\u011c': 'G', '\u011e': 'G', '\u0120': 'G', '\u0122': 'G',
  104142. '\u011d': 'g', '\u011f': 'g', '\u0121': 'g', '\u0123': 'g',
  104143. '\u0124': 'H', '\u0126': 'H', '\u0125': 'h', '\u0127': 'h',
  104144. '\u0128': 'I', '\u012a': 'I', '\u012c': 'I', '\u012e': 'I', '\u0130': 'I',
  104145. '\u0129': 'i', '\u012b': 'i', '\u012d': 'i', '\u012f': 'i', '\u0131': 'i',
  104146. '\u0134': 'J', '\u0135': 'j',
  104147. '\u0136': 'K', '\u0137': 'k', '\u0138': 'k',
  104148. '\u0139': 'L', '\u013b': 'L', '\u013d': 'L', '\u013f': 'L', '\u0141': 'L',
  104149. '\u013a': 'l', '\u013c': 'l', '\u013e': 'l', '\u0140': 'l', '\u0142': 'l',
  104150. '\u0143': 'N', '\u0145': 'N', '\u0147': 'N', '\u014a': 'N',
  104151. '\u0144': 'n', '\u0146': 'n', '\u0148': 'n', '\u014b': 'n',
  104152. '\u014c': 'O', '\u014e': 'O', '\u0150': 'O',
  104153. '\u014d': 'o', '\u014f': 'o', '\u0151': 'o',
  104154. '\u0154': 'R', '\u0156': 'R', '\u0158': 'R',
  104155. '\u0155': 'r', '\u0157': 'r', '\u0159': 'r',
  104156. '\u015a': 'S', '\u015c': 'S', '\u015e': 'S', '\u0160': 'S',
  104157. '\u015b': 's', '\u015d': 's', '\u015f': 's', '\u0161': 's',
  104158. '\u0162': 'T', '\u0164': 'T', '\u0166': 'T',
  104159. '\u0163': 't', '\u0165': 't', '\u0167': 't',
  104160. '\u0168': 'U', '\u016a': 'U', '\u016c': 'U', '\u016e': 'U', '\u0170': 'U', '\u0172': 'U',
  104161. '\u0169': 'u', '\u016b': 'u', '\u016d': 'u', '\u016f': 'u', '\u0171': 'u', '\u0173': 'u',
  104162. '\u0174': 'W', '\u0175': 'w',
  104163. '\u0176': 'Y', '\u0177': 'y', '\u0178': 'Y',
  104164. '\u0179': 'Z', '\u017b': 'Z', '\u017d': 'Z',
  104165. '\u017a': 'z', '\u017c': 'z', '\u017e': 'z',
  104166. '\u0132': 'IJ', '\u0133': 'ij',
  104167. '\u0152': 'Oe', '\u0153': 'oe',
  104168. '\u0149': "'n", '\u017f': 's'
  104169. };
  104170. /**
  104171. * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A
  104172. * letters to basic Latin letters.
  104173. *
  104174. * @private
  104175. * @param {string} letter The matched letter to deburr.
  104176. * @returns {string} Returns the deburred letter.
  104177. */
  104178. var deburrLetter = Object(_basePropertyOf_js__WEBPACK_IMPORTED_MODULE_0__["default"])(deburredLetters);
  104179. /* harmony default export */ __webpack_exports__["default"] = (deburrLetter);
  104180. /***/ }),
  104181. /***/ "./node_modules/lodash-es/_defineProperty.js":
  104182. /*!***************************************************!*\
  104183. !*** ./node_modules/lodash-es/_defineProperty.js ***!
  104184. \***************************************************/
  104185. /*! exports provided: default */
  104186. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  104187. "use strict";
  104188. __webpack_require__.r(__webpack_exports__);
  104189. /* harmony import */ var _getNative_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_getNative.js */ "./node_modules/lodash-es/_getNative.js");
  104190. var defineProperty = (function() {
  104191. try {
  104192. var func = Object(_getNative_js__WEBPACK_IMPORTED_MODULE_0__["default"])(Object, 'defineProperty');
  104193. func({}, '', {});
  104194. return func;
  104195. } catch (e) {}
  104196. }());
  104197. /* harmony default export */ __webpack_exports__["default"] = (defineProperty);
  104198. /***/ }),
  104199. /***/ "./node_modules/lodash-es/_equalArrays.js":
  104200. /*!************************************************!*\
  104201. !*** ./node_modules/lodash-es/_equalArrays.js ***!
  104202. \************************************************/
  104203. /*! exports provided: default */
  104204. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  104205. "use strict";
  104206. __webpack_require__.r(__webpack_exports__);
  104207. /* harmony import */ var _SetCache_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_SetCache.js */ "./node_modules/lodash-es/_SetCache.js");
  104208. /* harmony import */ var _arraySome_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_arraySome.js */ "./node_modules/lodash-es/_arraySome.js");
  104209. /* harmony import */ var _cacheHas_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_cacheHas.js */ "./node_modules/lodash-es/_cacheHas.js");
  104210. /** Used to compose bitmasks for value comparisons. */
  104211. var COMPARE_PARTIAL_FLAG = 1,
  104212. COMPARE_UNORDERED_FLAG = 2;
  104213. /**
  104214. * A specialized version of `baseIsEqualDeep` for arrays with support for
  104215. * partial deep comparisons.
  104216. *
  104217. * @private
  104218. * @param {Array} array The array to compare.
  104219. * @param {Array} other The other array to compare.
  104220. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  104221. * @param {Function} customizer The function to customize comparisons.
  104222. * @param {Function} equalFunc The function to determine equivalents of values.
  104223. * @param {Object} stack Tracks traversed `array` and `other` objects.
  104224. * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
  104225. */
  104226. function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
  104227. var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
  104228. arrLength = array.length,
  104229. othLength = other.length;
  104230. if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
  104231. return false;
  104232. }
  104233. // Check that cyclic values are equal.
  104234. var arrStacked = stack.get(array);
  104235. var othStacked = stack.get(other);
  104236. if (arrStacked && othStacked) {
  104237. return arrStacked == other && othStacked == array;
  104238. }
  104239. var index = -1,
  104240. result = true,
  104241. seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new _SetCache_js__WEBPACK_IMPORTED_MODULE_0__["default"] : undefined;
  104242. stack.set(array, other);
  104243. stack.set(other, array);
  104244. // Ignore non-index properties.
  104245. while (++index < arrLength) {
  104246. var arrValue = array[index],
  104247. othValue = other[index];
  104248. if (customizer) {
  104249. var compared = isPartial
  104250. ? customizer(othValue, arrValue, index, other, array, stack)
  104251. : customizer(arrValue, othValue, index, array, other, stack);
  104252. }
  104253. if (compared !== undefined) {
  104254. if (compared) {
  104255. continue;
  104256. }
  104257. result = false;
  104258. break;
  104259. }
  104260. // Recursively compare arrays (susceptible to call stack limits).
  104261. if (seen) {
  104262. if (!Object(_arraySome_js__WEBPACK_IMPORTED_MODULE_1__["default"])(other, function(othValue, othIndex) {
  104263. if (!Object(_cacheHas_js__WEBPACK_IMPORTED_MODULE_2__["default"])(seen, othIndex) &&
  104264. (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
  104265. return seen.push(othIndex);
  104266. }
  104267. })) {
  104268. result = false;
  104269. break;
  104270. }
  104271. } else if (!(
  104272. arrValue === othValue ||
  104273. equalFunc(arrValue, othValue, bitmask, customizer, stack)
  104274. )) {
  104275. result = false;
  104276. break;
  104277. }
  104278. }
  104279. stack['delete'](array);
  104280. stack['delete'](other);
  104281. return result;
  104282. }
  104283. /* harmony default export */ __webpack_exports__["default"] = (equalArrays);
  104284. /***/ }),
  104285. /***/ "./node_modules/lodash-es/_equalByTag.js":
  104286. /*!***********************************************!*\
  104287. !*** ./node_modules/lodash-es/_equalByTag.js ***!
  104288. \***********************************************/
  104289. /*! exports provided: default */
  104290. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  104291. "use strict";
  104292. __webpack_require__.r(__webpack_exports__);
  104293. /* harmony import */ var _Symbol_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_Symbol.js */ "./node_modules/lodash-es/_Symbol.js");
  104294. /* harmony import */ var _Uint8Array_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_Uint8Array.js */ "./node_modules/lodash-es/_Uint8Array.js");
  104295. /* harmony import */ var _eq_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./eq.js */ "./node_modules/lodash-es/eq.js");
  104296. /* harmony import */ var _equalArrays_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_equalArrays.js */ "./node_modules/lodash-es/_equalArrays.js");
  104297. /* harmony import */ var _mapToArray_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_mapToArray.js */ "./node_modules/lodash-es/_mapToArray.js");
  104298. /* harmony import */ var _setToArray_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./_setToArray.js */ "./node_modules/lodash-es/_setToArray.js");
  104299. /** Used to compose bitmasks for value comparisons. */
  104300. var COMPARE_PARTIAL_FLAG = 1,
  104301. COMPARE_UNORDERED_FLAG = 2;
  104302. /** `Object#toString` result references. */
  104303. var boolTag = '[object Boolean]',
  104304. dateTag = '[object Date]',
  104305. errorTag = '[object Error]',
  104306. mapTag = '[object Map]',
  104307. numberTag = '[object Number]',
  104308. regexpTag = '[object RegExp]',
  104309. setTag = '[object Set]',
  104310. stringTag = '[object String]',
  104311. symbolTag = '[object Symbol]';
  104312. var arrayBufferTag = '[object ArrayBuffer]',
  104313. dataViewTag = '[object DataView]';
  104314. /** Used to convert symbols to primitives and strings. */
  104315. var symbolProto = _Symbol_js__WEBPACK_IMPORTED_MODULE_0__["default"] ? _Symbol_js__WEBPACK_IMPORTED_MODULE_0__["default"].prototype : undefined,
  104316. symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;
  104317. /**
  104318. * A specialized version of `baseIsEqualDeep` for comparing objects of
  104319. * the same `toStringTag`.
  104320. *
  104321. * **Note:** This function only supports comparing values with tags of
  104322. * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
  104323. *
  104324. * @private
  104325. * @param {Object} object The object to compare.
  104326. * @param {Object} other The other object to compare.
  104327. * @param {string} tag The `toStringTag` of the objects to compare.
  104328. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  104329. * @param {Function} customizer The function to customize comparisons.
  104330. * @param {Function} equalFunc The function to determine equivalents of values.
  104331. * @param {Object} stack Tracks traversed `object` and `other` objects.
  104332. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  104333. */
  104334. function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
  104335. switch (tag) {
  104336. case dataViewTag:
  104337. if ((object.byteLength != other.byteLength) ||
  104338. (object.byteOffset != other.byteOffset)) {
  104339. return false;
  104340. }
  104341. object = object.buffer;
  104342. other = other.buffer;
  104343. case arrayBufferTag:
  104344. if ((object.byteLength != other.byteLength) ||
  104345. !equalFunc(new _Uint8Array_js__WEBPACK_IMPORTED_MODULE_1__["default"](object), new _Uint8Array_js__WEBPACK_IMPORTED_MODULE_1__["default"](other))) {
  104346. return false;
  104347. }
  104348. return true;
  104349. case boolTag:
  104350. case dateTag:
  104351. case numberTag:
  104352. // Coerce booleans to `1` or `0` and dates to milliseconds.
  104353. // Invalid dates are coerced to `NaN`.
  104354. return Object(_eq_js__WEBPACK_IMPORTED_MODULE_2__["default"])(+object, +other);
  104355. case errorTag:
  104356. return object.name == other.name && object.message == other.message;
  104357. case regexpTag:
  104358. case stringTag:
  104359. // Coerce regexes to strings and treat strings, primitives and objects,
  104360. // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring
  104361. // for more details.
  104362. return object == (other + '');
  104363. case mapTag:
  104364. var convert = _mapToArray_js__WEBPACK_IMPORTED_MODULE_4__["default"];
  104365. case setTag:
  104366. var isPartial = bitmask & COMPARE_PARTIAL_FLAG;
  104367. convert || (convert = _setToArray_js__WEBPACK_IMPORTED_MODULE_5__["default"]);
  104368. if (object.size != other.size && !isPartial) {
  104369. return false;
  104370. }
  104371. // Assume cyclic values are equal.
  104372. var stacked = stack.get(object);
  104373. if (stacked) {
  104374. return stacked == other;
  104375. }
  104376. bitmask |= COMPARE_UNORDERED_FLAG;
  104377. // Recursively compare objects (susceptible to call stack limits).
  104378. stack.set(object, other);
  104379. var result = Object(_equalArrays_js__WEBPACK_IMPORTED_MODULE_3__["default"])(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
  104380. stack['delete'](object);
  104381. return result;
  104382. case symbolTag:
  104383. if (symbolValueOf) {
  104384. return symbolValueOf.call(object) == symbolValueOf.call(other);
  104385. }
  104386. }
  104387. return false;
  104388. }
  104389. /* harmony default export */ __webpack_exports__["default"] = (equalByTag);
  104390. /***/ }),
  104391. /***/ "./node_modules/lodash-es/_equalObjects.js":
  104392. /*!*************************************************!*\
  104393. !*** ./node_modules/lodash-es/_equalObjects.js ***!
  104394. \*************************************************/
  104395. /*! exports provided: default */
  104396. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  104397. "use strict";
  104398. __webpack_require__.r(__webpack_exports__);
  104399. /* harmony import */ var _getAllKeys_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_getAllKeys.js */ "./node_modules/lodash-es/_getAllKeys.js");
  104400. /** Used to compose bitmasks for value comparisons. */
  104401. var COMPARE_PARTIAL_FLAG = 1;
  104402. /** Used for built-in method references. */
  104403. var objectProto = Object.prototype;
  104404. /** Used to check objects for own properties. */
  104405. var hasOwnProperty = objectProto.hasOwnProperty;
  104406. /**
  104407. * A specialized version of `baseIsEqualDeep` for objects with support for
  104408. * partial deep comparisons.
  104409. *
  104410. * @private
  104411. * @param {Object} object The object to compare.
  104412. * @param {Object} other The other object to compare.
  104413. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  104414. * @param {Function} customizer The function to customize comparisons.
  104415. * @param {Function} equalFunc The function to determine equivalents of values.
  104416. * @param {Object} stack Tracks traversed `object` and `other` objects.
  104417. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  104418. */
  104419. function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
  104420. var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
  104421. objProps = Object(_getAllKeys_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object),
  104422. objLength = objProps.length,
  104423. othProps = Object(_getAllKeys_js__WEBPACK_IMPORTED_MODULE_0__["default"])(other),
  104424. othLength = othProps.length;
  104425. if (objLength != othLength && !isPartial) {
  104426. return false;
  104427. }
  104428. var index = objLength;
  104429. while (index--) {
  104430. var key = objProps[index];
  104431. if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
  104432. return false;
  104433. }
  104434. }
  104435. // Check that cyclic values are equal.
  104436. var objStacked = stack.get(object);
  104437. var othStacked = stack.get(other);
  104438. if (objStacked && othStacked) {
  104439. return objStacked == other && othStacked == object;
  104440. }
  104441. var result = true;
  104442. stack.set(object, other);
  104443. stack.set(other, object);
  104444. var skipCtor = isPartial;
  104445. while (++index < objLength) {
  104446. key = objProps[index];
  104447. var objValue = object[key],
  104448. othValue = other[key];
  104449. if (customizer) {
  104450. var compared = isPartial
  104451. ? customizer(othValue, objValue, key, other, object, stack)
  104452. : customizer(objValue, othValue, key, object, other, stack);
  104453. }
  104454. // Recursively compare objects (susceptible to call stack limits).
  104455. if (!(compared === undefined
  104456. ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))
  104457. : compared
  104458. )) {
  104459. result = false;
  104460. break;
  104461. }
  104462. skipCtor || (skipCtor = key == 'constructor');
  104463. }
  104464. if (result && !skipCtor) {
  104465. var objCtor = object.constructor,
  104466. othCtor = other.constructor;
  104467. // Non `Object` object instances with different constructors are not equal.
  104468. if (objCtor != othCtor &&
  104469. ('constructor' in object && 'constructor' in other) &&
  104470. !(typeof objCtor == 'function' && objCtor instanceof objCtor &&
  104471. typeof othCtor == 'function' && othCtor instanceof othCtor)) {
  104472. result = false;
  104473. }
  104474. }
  104475. stack['delete'](object);
  104476. stack['delete'](other);
  104477. return result;
  104478. }
  104479. /* harmony default export */ __webpack_exports__["default"] = (equalObjects);
  104480. /***/ }),
  104481. /***/ "./node_modules/lodash-es/_escapeHtmlChar.js":
  104482. /*!***************************************************!*\
  104483. !*** ./node_modules/lodash-es/_escapeHtmlChar.js ***!
  104484. \***************************************************/
  104485. /*! exports provided: default */
  104486. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  104487. "use strict";
  104488. __webpack_require__.r(__webpack_exports__);
  104489. /* harmony import */ var _basePropertyOf_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_basePropertyOf.js */ "./node_modules/lodash-es/_basePropertyOf.js");
  104490. /** Used to map characters to HTML entities. */
  104491. var htmlEscapes = {
  104492. '&': '&amp;',
  104493. '<': '&lt;',
  104494. '>': '&gt;',
  104495. '"': '&quot;',
  104496. "'": '&#39;'
  104497. };
  104498. /**
  104499. * Used by `_.escape` to convert characters to HTML entities.
  104500. *
  104501. * @private
  104502. * @param {string} chr The matched character to escape.
  104503. * @returns {string} Returns the escaped character.
  104504. */
  104505. var escapeHtmlChar = Object(_basePropertyOf_js__WEBPACK_IMPORTED_MODULE_0__["default"])(htmlEscapes);
  104506. /* harmony default export */ __webpack_exports__["default"] = (escapeHtmlChar);
  104507. /***/ }),
  104508. /***/ "./node_modules/lodash-es/_escapeStringChar.js":
  104509. /*!*****************************************************!*\
  104510. !*** ./node_modules/lodash-es/_escapeStringChar.js ***!
  104511. \*****************************************************/
  104512. /*! exports provided: default */
  104513. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  104514. "use strict";
  104515. __webpack_require__.r(__webpack_exports__);
  104516. /** Used to escape characters for inclusion in compiled string literals. */
  104517. var stringEscapes = {
  104518. '\\': '\\',
  104519. "'": "'",
  104520. '\n': 'n',
  104521. '\r': 'r',
  104522. '\u2028': 'u2028',
  104523. '\u2029': 'u2029'
  104524. };
  104525. /**
  104526. * Used by `_.template` to escape characters for inclusion in compiled string literals.
  104527. *
  104528. * @private
  104529. * @param {string} chr The matched character to escape.
  104530. * @returns {string} Returns the escaped character.
  104531. */
  104532. function escapeStringChar(chr) {
  104533. return '\\' + stringEscapes[chr];
  104534. }
  104535. /* harmony default export */ __webpack_exports__["default"] = (escapeStringChar);
  104536. /***/ }),
  104537. /***/ "./node_modules/lodash-es/_flatRest.js":
  104538. /*!*********************************************!*\
  104539. !*** ./node_modules/lodash-es/_flatRest.js ***!
  104540. \*********************************************/
  104541. /*! exports provided: default */
  104542. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  104543. "use strict";
  104544. __webpack_require__.r(__webpack_exports__);
  104545. /* harmony import */ var _flatten_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./flatten.js */ "./node_modules/lodash-es/flatten.js");
  104546. /* harmony import */ var _overRest_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_overRest.js */ "./node_modules/lodash-es/_overRest.js");
  104547. /* harmony import */ var _setToString_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_setToString.js */ "./node_modules/lodash-es/_setToString.js");
  104548. /**
  104549. * A specialized version of `baseRest` which flattens the rest array.
  104550. *
  104551. * @private
  104552. * @param {Function} func The function to apply a rest parameter to.
  104553. * @returns {Function} Returns the new function.
  104554. */
  104555. function flatRest(func) {
  104556. 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 + '');
  104557. }
  104558. /* harmony default export */ __webpack_exports__["default"] = (flatRest);
  104559. /***/ }),
  104560. /***/ "./node_modules/lodash-es/_freeGlobal.js":
  104561. /*!***********************************************!*\
  104562. !*** ./node_modules/lodash-es/_freeGlobal.js ***!
  104563. \***********************************************/
  104564. /*! exports provided: default */
  104565. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  104566. "use strict";
  104567. __webpack_require__.r(__webpack_exports__);
  104568. /* WEBPACK VAR INJECTION */(function(global) {/** Detect free variable `global` from Node.js. */
  104569. var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
  104570. /* harmony default export */ __webpack_exports__["default"] = (freeGlobal);
  104571. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js")))
  104572. /***/ }),
  104573. /***/ "./node_modules/lodash-es/_getAllKeys.js":
  104574. /*!***********************************************!*\
  104575. !*** ./node_modules/lodash-es/_getAllKeys.js ***!
  104576. \***********************************************/
  104577. /*! exports provided: default */
  104578. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  104579. "use strict";
  104580. __webpack_require__.r(__webpack_exports__);
  104581. /* harmony import */ var _baseGetAllKeys_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseGetAllKeys.js */ "./node_modules/lodash-es/_baseGetAllKeys.js");
  104582. /* harmony import */ var _getSymbols_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_getSymbols.js */ "./node_modules/lodash-es/_getSymbols.js");
  104583. /* harmony import */ var _keys_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./keys.js */ "./node_modules/lodash-es/keys.js");
  104584. /**
  104585. * Creates an array of own enumerable property names and symbols of `object`.
  104586. *
  104587. * @private
  104588. * @param {Object} object The object to query.
  104589. * @returns {Array} Returns the array of property names and symbols.
  104590. */
  104591. function getAllKeys(object) {
  104592. return Object(_baseGetAllKeys_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, _keys_js__WEBPACK_IMPORTED_MODULE_2__["default"], _getSymbols_js__WEBPACK_IMPORTED_MODULE_1__["default"]);
  104593. }
  104594. /* harmony default export */ __webpack_exports__["default"] = (getAllKeys);
  104595. /***/ }),
  104596. /***/ "./node_modules/lodash-es/_getAllKeysIn.js":
  104597. /*!*************************************************!*\
  104598. !*** ./node_modules/lodash-es/_getAllKeysIn.js ***!
  104599. \*************************************************/
  104600. /*! exports provided: default */
  104601. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  104602. "use strict";
  104603. __webpack_require__.r(__webpack_exports__);
  104604. /* harmony import */ var _baseGetAllKeys_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseGetAllKeys.js */ "./node_modules/lodash-es/_baseGetAllKeys.js");
  104605. /* harmony import */ var _getSymbolsIn_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_getSymbolsIn.js */ "./node_modules/lodash-es/_getSymbolsIn.js");
  104606. /* harmony import */ var _keysIn_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./keysIn.js */ "./node_modules/lodash-es/keysIn.js");
  104607. /**
  104608. * Creates an array of own and inherited enumerable property names and
  104609. * symbols of `object`.
  104610. *
  104611. * @private
  104612. * @param {Object} object The object to query.
  104613. * @returns {Array} Returns the array of property names and symbols.
  104614. */
  104615. function getAllKeysIn(object) {
  104616. return Object(_baseGetAllKeys_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, _keysIn_js__WEBPACK_IMPORTED_MODULE_2__["default"], _getSymbolsIn_js__WEBPACK_IMPORTED_MODULE_1__["default"]);
  104617. }
  104618. /* harmony default export */ __webpack_exports__["default"] = (getAllKeysIn);
  104619. /***/ }),
  104620. /***/ "./node_modules/lodash-es/_getData.js":
  104621. /*!********************************************!*\
  104622. !*** ./node_modules/lodash-es/_getData.js ***!
  104623. \********************************************/
  104624. /*! exports provided: default */
  104625. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  104626. "use strict";
  104627. __webpack_require__.r(__webpack_exports__);
  104628. /* harmony import */ var _metaMap_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_metaMap.js */ "./node_modules/lodash-es/_metaMap.js");
  104629. /* harmony import */ var _noop_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./noop.js */ "./node_modules/lodash-es/noop.js");
  104630. /**
  104631. * Gets metadata for `func`.
  104632. *
  104633. * @private
  104634. * @param {Function} func The function to query.
  104635. * @returns {*} Returns the metadata for `func`.
  104636. */
  104637. var getData = !_metaMap_js__WEBPACK_IMPORTED_MODULE_0__["default"] ? _noop_js__WEBPACK_IMPORTED_MODULE_1__["default"] : function(func) {
  104638. return _metaMap_js__WEBPACK_IMPORTED_MODULE_0__["default"].get(func);
  104639. };
  104640. /* harmony default export */ __webpack_exports__["default"] = (getData);
  104641. /***/ }),
  104642. /***/ "./node_modules/lodash-es/_getFuncName.js":
  104643. /*!************************************************!*\
  104644. !*** ./node_modules/lodash-es/_getFuncName.js ***!
  104645. \************************************************/
  104646. /*! exports provided: default */
  104647. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  104648. "use strict";
  104649. __webpack_require__.r(__webpack_exports__);
  104650. /* harmony import */ var _realNames_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_realNames.js */ "./node_modules/lodash-es/_realNames.js");
  104651. /** Used for built-in method references. */
  104652. var objectProto = Object.prototype;
  104653. /** Used to check objects for own properties. */
  104654. var hasOwnProperty = objectProto.hasOwnProperty;
  104655. /**
  104656. * Gets the name of `func`.
  104657. *
  104658. * @private
  104659. * @param {Function} func The function to query.
  104660. * @returns {string} Returns the function name.
  104661. */
  104662. function getFuncName(func) {
  104663. var result = (func.name + ''),
  104664. array = _realNames_js__WEBPACK_IMPORTED_MODULE_0__["default"][result],
  104665. length = hasOwnProperty.call(_realNames_js__WEBPACK_IMPORTED_MODULE_0__["default"], result) ? array.length : 0;
  104666. while (length--) {
  104667. var data = array[length],
  104668. otherFunc = data.func;
  104669. if (otherFunc == null || otherFunc == func) {
  104670. return data.name;
  104671. }
  104672. }
  104673. return result;
  104674. }
  104675. /* harmony default export */ __webpack_exports__["default"] = (getFuncName);
  104676. /***/ }),
  104677. /***/ "./node_modules/lodash-es/_getHolder.js":
  104678. /*!**********************************************!*\
  104679. !*** ./node_modules/lodash-es/_getHolder.js ***!
  104680. \**********************************************/
  104681. /*! exports provided: default */
  104682. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  104683. "use strict";
  104684. __webpack_require__.r(__webpack_exports__);
  104685. /**
  104686. * Gets the argument placeholder value for `func`.
  104687. *
  104688. * @private
  104689. * @param {Function} func The function to inspect.
  104690. * @returns {*} Returns the placeholder value.
  104691. */
  104692. function getHolder(func) {
  104693. var object = func;
  104694. return object.placeholder;
  104695. }
  104696. /* harmony default export */ __webpack_exports__["default"] = (getHolder);
  104697. /***/ }),
  104698. /***/ "./node_modules/lodash-es/_getMapData.js":
  104699. /*!***********************************************!*\
  104700. !*** ./node_modules/lodash-es/_getMapData.js ***!
  104701. \***********************************************/
  104702. /*! exports provided: default */
  104703. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  104704. "use strict";
  104705. __webpack_require__.r(__webpack_exports__);
  104706. /* harmony import */ var _isKeyable_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_isKeyable.js */ "./node_modules/lodash-es/_isKeyable.js");
  104707. /**
  104708. * Gets the data for `map`.
  104709. *
  104710. * @private
  104711. * @param {Object} map The map to query.
  104712. * @param {string} key The reference key.
  104713. * @returns {*} Returns the map data.
  104714. */
  104715. function getMapData(map, key) {
  104716. var data = map.__data__;
  104717. return Object(_isKeyable_js__WEBPACK_IMPORTED_MODULE_0__["default"])(key)
  104718. ? data[typeof key == 'string' ? 'string' : 'hash']
  104719. : data.map;
  104720. }
  104721. /* harmony default export */ __webpack_exports__["default"] = (getMapData);
  104722. /***/ }),
  104723. /***/ "./node_modules/lodash-es/_getMatchData.js":
  104724. /*!*************************************************!*\
  104725. !*** ./node_modules/lodash-es/_getMatchData.js ***!
  104726. \*************************************************/
  104727. /*! exports provided: default */
  104728. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  104729. "use strict";
  104730. __webpack_require__.r(__webpack_exports__);
  104731. /* harmony import */ var _isStrictComparable_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_isStrictComparable.js */ "./node_modules/lodash-es/_isStrictComparable.js");
  104732. /* harmony import */ var _keys_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./keys.js */ "./node_modules/lodash-es/keys.js");
  104733. /**
  104734. * Gets the property names, values, and compare flags of `object`.
  104735. *
  104736. * @private
  104737. * @param {Object} object The object to query.
  104738. * @returns {Array} Returns the match data of `object`.
  104739. */
  104740. function getMatchData(object) {
  104741. var result = Object(_keys_js__WEBPACK_IMPORTED_MODULE_1__["default"])(object),
  104742. length = result.length;
  104743. while (length--) {
  104744. var key = result[length],
  104745. value = object[key];
  104746. result[length] = [key, value, Object(_isStrictComparable_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value)];
  104747. }
  104748. return result;
  104749. }
  104750. /* harmony default export */ __webpack_exports__["default"] = (getMatchData);
  104751. /***/ }),
  104752. /***/ "./node_modules/lodash-es/_getNative.js":
  104753. /*!**********************************************!*\
  104754. !*** ./node_modules/lodash-es/_getNative.js ***!
  104755. \**********************************************/
  104756. /*! exports provided: default */
  104757. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  104758. "use strict";
  104759. __webpack_require__.r(__webpack_exports__);
  104760. /* harmony import */ var _baseIsNative_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseIsNative.js */ "./node_modules/lodash-es/_baseIsNative.js");
  104761. /* harmony import */ var _getValue_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_getValue.js */ "./node_modules/lodash-es/_getValue.js");
  104762. /**
  104763. * Gets the native function at `key` of `object`.
  104764. *
  104765. * @private
  104766. * @param {Object} object The object to query.
  104767. * @param {string} key The key of the method to get.
  104768. * @returns {*} Returns the function if it's native, else `undefined`.
  104769. */
  104770. function getNative(object, key) {
  104771. var value = Object(_getValue_js__WEBPACK_IMPORTED_MODULE_1__["default"])(object, key);
  104772. return Object(_baseIsNative_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value) ? value : undefined;
  104773. }
  104774. /* harmony default export */ __webpack_exports__["default"] = (getNative);
  104775. /***/ }),
  104776. /***/ "./node_modules/lodash-es/_getPrototype.js":
  104777. /*!*************************************************!*\
  104778. !*** ./node_modules/lodash-es/_getPrototype.js ***!
  104779. \*************************************************/
  104780. /*! exports provided: default */
  104781. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  104782. "use strict";
  104783. __webpack_require__.r(__webpack_exports__);
  104784. /* harmony import */ var _overArg_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_overArg.js */ "./node_modules/lodash-es/_overArg.js");
  104785. /** Built-in value references. */
  104786. var getPrototype = Object(_overArg_js__WEBPACK_IMPORTED_MODULE_0__["default"])(Object.getPrototypeOf, Object);
  104787. /* harmony default export */ __webpack_exports__["default"] = (getPrototype);
  104788. /***/ }),
  104789. /***/ "./node_modules/lodash-es/_getRawTag.js":
  104790. /*!**********************************************!*\
  104791. !*** ./node_modules/lodash-es/_getRawTag.js ***!
  104792. \**********************************************/
  104793. /*! exports provided: default */
  104794. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  104795. "use strict";
  104796. __webpack_require__.r(__webpack_exports__);
  104797. /* harmony import */ var _Symbol_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_Symbol.js */ "./node_modules/lodash-es/_Symbol.js");
  104798. /** Used for built-in method references. */
  104799. var objectProto = Object.prototype;
  104800. /** Used to check objects for own properties. */
  104801. var hasOwnProperty = objectProto.hasOwnProperty;
  104802. /**
  104803. * Used to resolve the
  104804. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  104805. * of values.
  104806. */
  104807. var nativeObjectToString = objectProto.toString;
  104808. /** Built-in value references. */
  104809. var symToStringTag = _Symbol_js__WEBPACK_IMPORTED_MODULE_0__["default"] ? _Symbol_js__WEBPACK_IMPORTED_MODULE_0__["default"].toStringTag : undefined;
  104810. /**
  104811. * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
  104812. *
  104813. * @private
  104814. * @param {*} value The value to query.
  104815. * @returns {string} Returns the raw `toStringTag`.
  104816. */
  104817. function getRawTag(value) {
  104818. var isOwn = hasOwnProperty.call(value, symToStringTag),
  104819. tag = value[symToStringTag];
  104820. try {
  104821. value[symToStringTag] = undefined;
  104822. var unmasked = true;
  104823. } catch (e) {}
  104824. var result = nativeObjectToString.call(value);
  104825. if (unmasked) {
  104826. if (isOwn) {
  104827. value[symToStringTag] = tag;
  104828. } else {
  104829. delete value[symToStringTag];
  104830. }
  104831. }
  104832. return result;
  104833. }
  104834. /* harmony default export */ __webpack_exports__["default"] = (getRawTag);
  104835. /***/ }),
  104836. /***/ "./node_modules/lodash-es/_getSymbols.js":
  104837. /*!***********************************************!*\
  104838. !*** ./node_modules/lodash-es/_getSymbols.js ***!
  104839. \***********************************************/
  104840. /*! exports provided: default */
  104841. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  104842. "use strict";
  104843. __webpack_require__.r(__webpack_exports__);
  104844. /* harmony import */ var _arrayFilter_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayFilter.js */ "./node_modules/lodash-es/_arrayFilter.js");
  104845. /* harmony import */ var _stubArray_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./stubArray.js */ "./node_modules/lodash-es/stubArray.js");
  104846. /** Used for built-in method references. */
  104847. var objectProto = Object.prototype;
  104848. /** Built-in value references. */
  104849. var propertyIsEnumerable = objectProto.propertyIsEnumerable;
  104850. /* Built-in method references for those with the same name as other `lodash` methods. */
  104851. var nativeGetSymbols = Object.getOwnPropertySymbols;
  104852. /**
  104853. * Creates an array of the own enumerable symbols of `object`.
  104854. *
  104855. * @private
  104856. * @param {Object} object The object to query.
  104857. * @returns {Array} Returns the array of symbols.
  104858. */
  104859. var getSymbols = !nativeGetSymbols ? _stubArray_js__WEBPACK_IMPORTED_MODULE_1__["default"] : function(object) {
  104860. if (object == null) {
  104861. return [];
  104862. }
  104863. object = Object(object);
  104864. return Object(_arrayFilter_js__WEBPACK_IMPORTED_MODULE_0__["default"])(nativeGetSymbols(object), function(symbol) {
  104865. return propertyIsEnumerable.call(object, symbol);
  104866. });
  104867. };
  104868. /* harmony default export */ __webpack_exports__["default"] = (getSymbols);
  104869. /***/ }),
  104870. /***/ "./node_modules/lodash-es/_getSymbolsIn.js":
  104871. /*!*************************************************!*\
  104872. !*** ./node_modules/lodash-es/_getSymbolsIn.js ***!
  104873. \*************************************************/
  104874. /*! exports provided: default */
  104875. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  104876. "use strict";
  104877. __webpack_require__.r(__webpack_exports__);
  104878. /* harmony import */ var _arrayPush_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayPush.js */ "./node_modules/lodash-es/_arrayPush.js");
  104879. /* harmony import */ var _getPrototype_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_getPrototype.js */ "./node_modules/lodash-es/_getPrototype.js");
  104880. /* harmony import */ var _getSymbols_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_getSymbols.js */ "./node_modules/lodash-es/_getSymbols.js");
  104881. /* harmony import */ var _stubArray_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./stubArray.js */ "./node_modules/lodash-es/stubArray.js");
  104882. /* Built-in method references for those with the same name as other `lodash` methods. */
  104883. var nativeGetSymbols = Object.getOwnPropertySymbols;
  104884. /**
  104885. * Creates an array of the own and inherited enumerable symbols of `object`.
  104886. *
  104887. * @private
  104888. * @param {Object} object The object to query.
  104889. * @returns {Array} Returns the array of symbols.
  104890. */
  104891. var getSymbolsIn = !nativeGetSymbols ? _stubArray_js__WEBPACK_IMPORTED_MODULE_3__["default"] : function(object) {
  104892. var result = [];
  104893. while (object) {
  104894. Object(_arrayPush_js__WEBPACK_IMPORTED_MODULE_0__["default"])(result, Object(_getSymbols_js__WEBPACK_IMPORTED_MODULE_2__["default"])(object));
  104895. object = Object(_getPrototype_js__WEBPACK_IMPORTED_MODULE_1__["default"])(object);
  104896. }
  104897. return result;
  104898. };
  104899. /* harmony default export */ __webpack_exports__["default"] = (getSymbolsIn);
  104900. /***/ }),
  104901. /***/ "./node_modules/lodash-es/_getTag.js":
  104902. /*!*******************************************!*\
  104903. !*** ./node_modules/lodash-es/_getTag.js ***!
  104904. \*******************************************/
  104905. /*! exports provided: default */
  104906. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  104907. "use strict";
  104908. __webpack_require__.r(__webpack_exports__);
  104909. /* harmony import */ var _DataView_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_DataView.js */ "./node_modules/lodash-es/_DataView.js");
  104910. /* harmony import */ var _Map_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_Map.js */ "./node_modules/lodash-es/_Map.js");
  104911. /* harmony import */ var _Promise_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_Promise.js */ "./node_modules/lodash-es/_Promise.js");
  104912. /* harmony import */ var _Set_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_Set.js */ "./node_modules/lodash-es/_Set.js");
  104913. /* harmony import */ var _WeakMap_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_WeakMap.js */ "./node_modules/lodash-es/_WeakMap.js");
  104914. /* harmony import */ var _baseGetTag_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./_baseGetTag.js */ "./node_modules/lodash-es/_baseGetTag.js");
  104915. /* harmony import */ var _toSource_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./_toSource.js */ "./node_modules/lodash-es/_toSource.js");
  104916. /** `Object#toString` result references. */
  104917. var mapTag = '[object Map]',
  104918. objectTag = '[object Object]',
  104919. promiseTag = '[object Promise]',
  104920. setTag = '[object Set]',
  104921. weakMapTag = '[object WeakMap]';
  104922. var dataViewTag = '[object DataView]';
  104923. /** Used to detect maps, sets, and weakmaps. */
  104924. var dataViewCtorString = Object(_toSource_js__WEBPACK_IMPORTED_MODULE_6__["default"])(_DataView_js__WEBPACK_IMPORTED_MODULE_0__["default"]),
  104925. mapCtorString = Object(_toSource_js__WEBPACK_IMPORTED_MODULE_6__["default"])(_Map_js__WEBPACK_IMPORTED_MODULE_1__["default"]),
  104926. promiseCtorString = Object(_toSource_js__WEBPACK_IMPORTED_MODULE_6__["default"])(_Promise_js__WEBPACK_IMPORTED_MODULE_2__["default"]),
  104927. setCtorString = Object(_toSource_js__WEBPACK_IMPORTED_MODULE_6__["default"])(_Set_js__WEBPACK_IMPORTED_MODULE_3__["default"]),
  104928. weakMapCtorString = Object(_toSource_js__WEBPACK_IMPORTED_MODULE_6__["default"])(_WeakMap_js__WEBPACK_IMPORTED_MODULE_4__["default"]);
  104929. /**
  104930. * Gets the `toStringTag` of `value`.
  104931. *
  104932. * @private
  104933. * @param {*} value The value to query.
  104934. * @returns {string} Returns the `toStringTag`.
  104935. */
  104936. var getTag = _baseGetTag_js__WEBPACK_IMPORTED_MODULE_5__["default"];
  104937. // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
  104938. if ((_DataView_js__WEBPACK_IMPORTED_MODULE_0__["default"] && getTag(new _DataView_js__WEBPACK_IMPORTED_MODULE_0__["default"](new ArrayBuffer(1))) != dataViewTag) ||
  104939. (_Map_js__WEBPACK_IMPORTED_MODULE_1__["default"] && getTag(new _Map_js__WEBPACK_IMPORTED_MODULE_1__["default"]) != mapTag) ||
  104940. (_Promise_js__WEBPACK_IMPORTED_MODULE_2__["default"] && getTag(_Promise_js__WEBPACK_IMPORTED_MODULE_2__["default"].resolve()) != promiseTag) ||
  104941. (_Set_js__WEBPACK_IMPORTED_MODULE_3__["default"] && getTag(new _Set_js__WEBPACK_IMPORTED_MODULE_3__["default"]) != setTag) ||
  104942. (_WeakMap_js__WEBPACK_IMPORTED_MODULE_4__["default"] && getTag(new _WeakMap_js__WEBPACK_IMPORTED_MODULE_4__["default"]) != weakMapTag)) {
  104943. getTag = function(value) {
  104944. var result = Object(_baseGetTag_js__WEBPACK_IMPORTED_MODULE_5__["default"])(value),
  104945. Ctor = result == objectTag ? value.constructor : undefined,
  104946. ctorString = Ctor ? Object(_toSource_js__WEBPACK_IMPORTED_MODULE_6__["default"])(Ctor) : '';
  104947. if (ctorString) {
  104948. switch (ctorString) {
  104949. case dataViewCtorString: return dataViewTag;
  104950. case mapCtorString: return mapTag;
  104951. case promiseCtorString: return promiseTag;
  104952. case setCtorString: return setTag;
  104953. case weakMapCtorString: return weakMapTag;
  104954. }
  104955. }
  104956. return result;
  104957. };
  104958. }
  104959. /* harmony default export */ __webpack_exports__["default"] = (getTag);
  104960. /***/ }),
  104961. /***/ "./node_modules/lodash-es/_getValue.js":
  104962. /*!*********************************************!*\
  104963. !*** ./node_modules/lodash-es/_getValue.js ***!
  104964. \*********************************************/
  104965. /*! exports provided: default */
  104966. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  104967. "use strict";
  104968. __webpack_require__.r(__webpack_exports__);
  104969. /**
  104970. * Gets the value at `key` of `object`.
  104971. *
  104972. * @private
  104973. * @param {Object} [object] The object to query.
  104974. * @param {string} key The key of the property to get.
  104975. * @returns {*} Returns the property value.
  104976. */
  104977. function getValue(object, key) {
  104978. return object == null ? undefined : object[key];
  104979. }
  104980. /* harmony default export */ __webpack_exports__["default"] = (getValue);
  104981. /***/ }),
  104982. /***/ "./node_modules/lodash-es/_getView.js":
  104983. /*!********************************************!*\
  104984. !*** ./node_modules/lodash-es/_getView.js ***!
  104985. \********************************************/
  104986. /*! exports provided: default */
  104987. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  104988. "use strict";
  104989. __webpack_require__.r(__webpack_exports__);
  104990. /* Built-in method references for those with the same name as other `lodash` methods. */
  104991. var nativeMax = Math.max,
  104992. nativeMin = Math.min;
  104993. /**
  104994. * Gets the view, applying any `transforms` to the `start` and `end` positions.
  104995. *
  104996. * @private
  104997. * @param {number} start The start of the view.
  104998. * @param {number} end The end of the view.
  104999. * @param {Array} transforms The transformations to apply to the view.
  105000. * @returns {Object} Returns an object containing the `start` and `end`
  105001. * positions of the view.
  105002. */
  105003. function getView(start, end, transforms) {
  105004. var index = -1,
  105005. length = transforms.length;
  105006. while (++index < length) {
  105007. var data = transforms[index],
  105008. size = data.size;
  105009. switch (data.type) {
  105010. case 'drop': start += size; break;
  105011. case 'dropRight': end -= size; break;
  105012. case 'take': end = nativeMin(end, start + size); break;
  105013. case 'takeRight': start = nativeMax(start, end - size); break;
  105014. }
  105015. }
  105016. return { 'start': start, 'end': end };
  105017. }
  105018. /* harmony default export */ __webpack_exports__["default"] = (getView);
  105019. /***/ }),
  105020. /***/ "./node_modules/lodash-es/_getWrapDetails.js":
  105021. /*!***************************************************!*\
  105022. !*** ./node_modules/lodash-es/_getWrapDetails.js ***!
  105023. \***************************************************/
  105024. /*! exports provided: default */
  105025. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  105026. "use strict";
  105027. __webpack_require__.r(__webpack_exports__);
  105028. /** Used to match wrap detail comments. */
  105029. var reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/,
  105030. reSplitDetails = /,? & /;
  105031. /**
  105032. * Extracts wrapper details from the `source` body comment.
  105033. *
  105034. * @private
  105035. * @param {string} source The source to inspect.
  105036. * @returns {Array} Returns the wrapper details.
  105037. */
  105038. function getWrapDetails(source) {
  105039. var match = source.match(reWrapDetails);
  105040. return match ? match[1].split(reSplitDetails) : [];
  105041. }
  105042. /* harmony default export */ __webpack_exports__["default"] = (getWrapDetails);
  105043. /***/ }),
  105044. /***/ "./node_modules/lodash-es/_hasPath.js":
  105045. /*!********************************************!*\
  105046. !*** ./node_modules/lodash-es/_hasPath.js ***!
  105047. \********************************************/
  105048. /*! exports provided: default */
  105049. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  105050. "use strict";
  105051. __webpack_require__.r(__webpack_exports__);
  105052. /* harmony import */ var _castPath_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_castPath.js */ "./node_modules/lodash-es/_castPath.js");
  105053. /* harmony import */ var _isArguments_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isArguments.js */ "./node_modules/lodash-es/isArguments.js");
  105054. /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
  105055. /* harmony import */ var _isIndex_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_isIndex.js */ "./node_modules/lodash-es/_isIndex.js");
  105056. /* harmony import */ var _isLength_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./isLength.js */ "./node_modules/lodash-es/isLength.js");
  105057. /* harmony import */ var _toKey_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./_toKey.js */ "./node_modules/lodash-es/_toKey.js");
  105058. /**
  105059. * Checks if `path` exists on `object`.
  105060. *
  105061. * @private
  105062. * @param {Object} object The object to query.
  105063. * @param {Array|string} path The path to check.
  105064. * @param {Function} hasFunc The function to check properties.
  105065. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  105066. */
  105067. function hasPath(object, path, hasFunc) {
  105068. path = Object(_castPath_js__WEBPACK_IMPORTED_MODULE_0__["default"])(path, object);
  105069. var index = -1,
  105070. length = path.length,
  105071. result = false;
  105072. while (++index < length) {
  105073. var key = Object(_toKey_js__WEBPACK_IMPORTED_MODULE_5__["default"])(path[index]);
  105074. if (!(result = object != null && hasFunc(object, key))) {
  105075. break;
  105076. }
  105077. object = object[key];
  105078. }
  105079. if (result || ++index != length) {
  105080. return result;
  105081. }
  105082. length = object == null ? 0 : object.length;
  105083. return !!length && Object(_isLength_js__WEBPACK_IMPORTED_MODULE_4__["default"])(length) && Object(_isIndex_js__WEBPACK_IMPORTED_MODULE_3__["default"])(key, length) &&
  105084. (Object(_isArray_js__WEBPACK_IMPORTED_MODULE_2__["default"])(object) || Object(_isArguments_js__WEBPACK_IMPORTED_MODULE_1__["default"])(object));
  105085. }
  105086. /* harmony default export */ __webpack_exports__["default"] = (hasPath);
  105087. /***/ }),
  105088. /***/ "./node_modules/lodash-es/_hasUnicode.js":
  105089. /*!***********************************************!*\
  105090. !*** ./node_modules/lodash-es/_hasUnicode.js ***!
  105091. \***********************************************/
  105092. /*! exports provided: default */
  105093. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  105094. "use strict";
  105095. __webpack_require__.r(__webpack_exports__);
  105096. /** Used to compose unicode character classes. */
  105097. var rsAstralRange = '\\ud800-\\udfff',
  105098. rsComboMarksRange = '\\u0300-\\u036f',
  105099. reComboHalfMarksRange = '\\ufe20-\\ufe2f',
  105100. rsComboSymbolsRange = '\\u20d0-\\u20ff',
  105101. rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,
  105102. rsVarRange = '\\ufe0e\\ufe0f';
  105103. /** Used to compose unicode capture groups. */
  105104. var rsZWJ = '\\u200d';
  105105. /** 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/). */
  105106. var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']');
  105107. /**
  105108. * Checks if `string` contains Unicode symbols.
  105109. *
  105110. * @private
  105111. * @param {string} string The string to inspect.
  105112. * @returns {boolean} Returns `true` if a symbol is found, else `false`.
  105113. */
  105114. function hasUnicode(string) {
  105115. return reHasUnicode.test(string);
  105116. }
  105117. /* harmony default export */ __webpack_exports__["default"] = (hasUnicode);
  105118. /***/ }),
  105119. /***/ "./node_modules/lodash-es/_hasUnicodeWord.js":
  105120. /*!***************************************************!*\
  105121. !*** ./node_modules/lodash-es/_hasUnicodeWord.js ***!
  105122. \***************************************************/
  105123. /*! exports provided: default */
  105124. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  105125. "use strict";
  105126. __webpack_require__.r(__webpack_exports__);
  105127. /** Used to detect strings that need a more robust regexp to match words. */
  105128. 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 ]/;
  105129. /**
  105130. * Checks if `string` contains a word composed of Unicode symbols.
  105131. *
  105132. * @private
  105133. * @param {string} string The string to inspect.
  105134. * @returns {boolean} Returns `true` if a word is found, else `false`.
  105135. */
  105136. function hasUnicodeWord(string) {
  105137. return reHasUnicodeWord.test(string);
  105138. }
  105139. /* harmony default export */ __webpack_exports__["default"] = (hasUnicodeWord);
  105140. /***/ }),
  105141. /***/ "./node_modules/lodash-es/_hashClear.js":
  105142. /*!**********************************************!*\
  105143. !*** ./node_modules/lodash-es/_hashClear.js ***!
  105144. \**********************************************/
  105145. /*! exports provided: default */
  105146. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  105147. "use strict";
  105148. __webpack_require__.r(__webpack_exports__);
  105149. /* harmony import */ var _nativeCreate_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_nativeCreate.js */ "./node_modules/lodash-es/_nativeCreate.js");
  105150. /**
  105151. * Removes all key-value entries from the hash.
  105152. *
  105153. * @private
  105154. * @name clear
  105155. * @memberOf Hash
  105156. */
  105157. function hashClear() {
  105158. this.__data__ = _nativeCreate_js__WEBPACK_IMPORTED_MODULE_0__["default"] ? Object(_nativeCreate_js__WEBPACK_IMPORTED_MODULE_0__["default"])(null) : {};
  105159. this.size = 0;
  105160. }
  105161. /* harmony default export */ __webpack_exports__["default"] = (hashClear);
  105162. /***/ }),
  105163. /***/ "./node_modules/lodash-es/_hashDelete.js":
  105164. /*!***********************************************!*\
  105165. !*** ./node_modules/lodash-es/_hashDelete.js ***!
  105166. \***********************************************/
  105167. /*! exports provided: default */
  105168. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  105169. "use strict";
  105170. __webpack_require__.r(__webpack_exports__);
  105171. /**
  105172. * Removes `key` and its value from the hash.
  105173. *
  105174. * @private
  105175. * @name delete
  105176. * @memberOf Hash
  105177. * @param {Object} hash The hash to modify.
  105178. * @param {string} key The key of the value to remove.
  105179. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  105180. */
  105181. function hashDelete(key) {
  105182. var result = this.has(key) && delete this.__data__[key];
  105183. this.size -= result ? 1 : 0;
  105184. return result;
  105185. }
  105186. /* harmony default export */ __webpack_exports__["default"] = (hashDelete);
  105187. /***/ }),
  105188. /***/ "./node_modules/lodash-es/_hashGet.js":
  105189. /*!********************************************!*\
  105190. !*** ./node_modules/lodash-es/_hashGet.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 _nativeCreate_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_nativeCreate.js */ "./node_modules/lodash-es/_nativeCreate.js");
  105197. /** Used to stand-in for `undefined` hash values. */
  105198. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  105199. /** Used for built-in method references. */
  105200. var objectProto = Object.prototype;
  105201. /** Used to check objects for own properties. */
  105202. var hasOwnProperty = objectProto.hasOwnProperty;
  105203. /**
  105204. * Gets the hash value for `key`.
  105205. *
  105206. * @private
  105207. * @name get
  105208. * @memberOf Hash
  105209. * @param {string} key The key of the value to get.
  105210. * @returns {*} Returns the entry value.
  105211. */
  105212. function hashGet(key) {
  105213. var data = this.__data__;
  105214. if (_nativeCreate_js__WEBPACK_IMPORTED_MODULE_0__["default"]) {
  105215. var result = data[key];
  105216. return result === HASH_UNDEFINED ? undefined : result;
  105217. }
  105218. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  105219. }
  105220. /* harmony default export */ __webpack_exports__["default"] = (hashGet);
  105221. /***/ }),
  105222. /***/ "./node_modules/lodash-es/_hashHas.js":
  105223. /*!********************************************!*\
  105224. !*** ./node_modules/lodash-es/_hashHas.js ***!
  105225. \********************************************/
  105226. /*! exports provided: default */
  105227. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  105228. "use strict";
  105229. __webpack_require__.r(__webpack_exports__);
  105230. /* harmony import */ var _nativeCreate_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_nativeCreate.js */ "./node_modules/lodash-es/_nativeCreate.js");
  105231. /** Used for built-in method references. */
  105232. var objectProto = Object.prototype;
  105233. /** Used to check objects for own properties. */
  105234. var hasOwnProperty = objectProto.hasOwnProperty;
  105235. /**
  105236. * Checks if a hash value for `key` exists.
  105237. *
  105238. * @private
  105239. * @name has
  105240. * @memberOf Hash
  105241. * @param {string} key The key of the entry to check.
  105242. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  105243. */
  105244. function hashHas(key) {
  105245. var data = this.__data__;
  105246. return _nativeCreate_js__WEBPACK_IMPORTED_MODULE_0__["default"] ? (data[key] !== undefined) : hasOwnProperty.call(data, key);
  105247. }
  105248. /* harmony default export */ __webpack_exports__["default"] = (hashHas);
  105249. /***/ }),
  105250. /***/ "./node_modules/lodash-es/_hashSet.js":
  105251. /*!********************************************!*\
  105252. !*** ./node_modules/lodash-es/_hashSet.js ***!
  105253. \********************************************/
  105254. /*! exports provided: default */
  105255. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  105256. "use strict";
  105257. __webpack_require__.r(__webpack_exports__);
  105258. /* harmony import */ var _nativeCreate_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_nativeCreate.js */ "./node_modules/lodash-es/_nativeCreate.js");
  105259. /** Used to stand-in for `undefined` hash values. */
  105260. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  105261. /**
  105262. * Sets the hash `key` to `value`.
  105263. *
  105264. * @private
  105265. * @name set
  105266. * @memberOf Hash
  105267. * @param {string} key The key of the value to set.
  105268. * @param {*} value The value to set.
  105269. * @returns {Object} Returns the hash instance.
  105270. */
  105271. function hashSet(key, value) {
  105272. var data = this.__data__;
  105273. this.size += this.has(key) ? 0 : 1;
  105274. data[key] = (_nativeCreate_js__WEBPACK_IMPORTED_MODULE_0__["default"] && value === undefined) ? HASH_UNDEFINED : value;
  105275. return this;
  105276. }
  105277. /* harmony default export */ __webpack_exports__["default"] = (hashSet);
  105278. /***/ }),
  105279. /***/ "./node_modules/lodash-es/_initCloneArray.js":
  105280. /*!***************************************************!*\
  105281. !*** ./node_modules/lodash-es/_initCloneArray.js ***!
  105282. \***************************************************/
  105283. /*! exports provided: default */
  105284. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  105285. "use strict";
  105286. __webpack_require__.r(__webpack_exports__);
  105287. /** Used for built-in method references. */
  105288. var objectProto = Object.prototype;
  105289. /** Used to check objects for own properties. */
  105290. var hasOwnProperty = objectProto.hasOwnProperty;
  105291. /**
  105292. * Initializes an array clone.
  105293. *
  105294. * @private
  105295. * @param {Array} array The array to clone.
  105296. * @returns {Array} Returns the initialized clone.
  105297. */
  105298. function initCloneArray(array) {
  105299. var length = array.length,
  105300. result = new array.constructor(length);
  105301. // Add properties assigned by `RegExp#exec`.
  105302. if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
  105303. result.index = array.index;
  105304. result.input = array.input;
  105305. }
  105306. return result;
  105307. }
  105308. /* harmony default export */ __webpack_exports__["default"] = (initCloneArray);
  105309. /***/ }),
  105310. /***/ "./node_modules/lodash-es/_initCloneByTag.js":
  105311. /*!***************************************************!*\
  105312. !*** ./node_modules/lodash-es/_initCloneByTag.js ***!
  105313. \***************************************************/
  105314. /*! exports provided: default */
  105315. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  105316. "use strict";
  105317. __webpack_require__.r(__webpack_exports__);
  105318. /* harmony import */ var _cloneArrayBuffer_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_cloneArrayBuffer.js */ "./node_modules/lodash-es/_cloneArrayBuffer.js");
  105319. /* harmony import */ var _cloneDataView_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_cloneDataView.js */ "./node_modules/lodash-es/_cloneDataView.js");
  105320. /* harmony import */ var _cloneRegExp_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_cloneRegExp.js */ "./node_modules/lodash-es/_cloneRegExp.js");
  105321. /* harmony import */ var _cloneSymbol_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_cloneSymbol.js */ "./node_modules/lodash-es/_cloneSymbol.js");
  105322. /* harmony import */ var _cloneTypedArray_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_cloneTypedArray.js */ "./node_modules/lodash-es/_cloneTypedArray.js");
  105323. /** `Object#toString` result references. */
  105324. var boolTag = '[object Boolean]',
  105325. dateTag = '[object Date]',
  105326. mapTag = '[object Map]',
  105327. numberTag = '[object Number]',
  105328. regexpTag = '[object RegExp]',
  105329. setTag = '[object Set]',
  105330. stringTag = '[object String]',
  105331. symbolTag = '[object Symbol]';
  105332. var arrayBufferTag = '[object ArrayBuffer]',
  105333. dataViewTag = '[object DataView]',
  105334. float32Tag = '[object Float32Array]',
  105335. float64Tag = '[object Float64Array]',
  105336. int8Tag = '[object Int8Array]',
  105337. int16Tag = '[object Int16Array]',
  105338. int32Tag = '[object Int32Array]',
  105339. uint8Tag = '[object Uint8Array]',
  105340. uint8ClampedTag = '[object Uint8ClampedArray]',
  105341. uint16Tag = '[object Uint16Array]',
  105342. uint32Tag = '[object Uint32Array]';
  105343. /**
  105344. * Initializes an object clone based on its `toStringTag`.
  105345. *
  105346. * **Note:** This function only supports cloning values with tags of
  105347. * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.
  105348. *
  105349. * @private
  105350. * @param {Object} object The object to clone.
  105351. * @param {string} tag The `toStringTag` of the object to clone.
  105352. * @param {boolean} [isDeep] Specify a deep clone.
  105353. * @returns {Object} Returns the initialized clone.
  105354. */
  105355. function initCloneByTag(object, tag, isDeep) {
  105356. var Ctor = object.constructor;
  105357. switch (tag) {
  105358. case arrayBufferTag:
  105359. return Object(_cloneArrayBuffer_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object);
  105360. case boolTag:
  105361. case dateTag:
  105362. return new Ctor(+object);
  105363. case dataViewTag:
  105364. return Object(_cloneDataView_js__WEBPACK_IMPORTED_MODULE_1__["default"])(object, isDeep);
  105365. case float32Tag: case float64Tag:
  105366. case int8Tag: case int16Tag: case int32Tag:
  105367. case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:
  105368. return Object(_cloneTypedArray_js__WEBPACK_IMPORTED_MODULE_4__["default"])(object, isDeep);
  105369. case mapTag:
  105370. return new Ctor;
  105371. case numberTag:
  105372. case stringTag:
  105373. return new Ctor(object);
  105374. case regexpTag:
  105375. return Object(_cloneRegExp_js__WEBPACK_IMPORTED_MODULE_2__["default"])(object);
  105376. case setTag:
  105377. return new Ctor;
  105378. case symbolTag:
  105379. return Object(_cloneSymbol_js__WEBPACK_IMPORTED_MODULE_3__["default"])(object);
  105380. }
  105381. }
  105382. /* harmony default export */ __webpack_exports__["default"] = (initCloneByTag);
  105383. /***/ }),
  105384. /***/ "./node_modules/lodash-es/_initCloneObject.js":
  105385. /*!****************************************************!*\
  105386. !*** ./node_modules/lodash-es/_initCloneObject.js ***!
  105387. \****************************************************/
  105388. /*! exports provided: default */
  105389. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  105390. "use strict";
  105391. __webpack_require__.r(__webpack_exports__);
  105392. /* harmony import */ var _baseCreate_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseCreate.js */ "./node_modules/lodash-es/_baseCreate.js");
  105393. /* harmony import */ var _getPrototype_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_getPrototype.js */ "./node_modules/lodash-es/_getPrototype.js");
  105394. /* harmony import */ var _isPrototype_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_isPrototype.js */ "./node_modules/lodash-es/_isPrototype.js");
  105395. /**
  105396. * Initializes an object clone.
  105397. *
  105398. * @private
  105399. * @param {Object} object The object to clone.
  105400. * @returns {Object} Returns the initialized clone.
  105401. */
  105402. function initCloneObject(object) {
  105403. return (typeof object.constructor == 'function' && !Object(_isPrototype_js__WEBPACK_IMPORTED_MODULE_2__["default"])(object))
  105404. ? Object(_baseCreate_js__WEBPACK_IMPORTED_MODULE_0__["default"])(Object(_getPrototype_js__WEBPACK_IMPORTED_MODULE_1__["default"])(object))
  105405. : {};
  105406. }
  105407. /* harmony default export */ __webpack_exports__["default"] = (initCloneObject);
  105408. /***/ }),
  105409. /***/ "./node_modules/lodash-es/_insertWrapDetails.js":
  105410. /*!******************************************************!*\
  105411. !*** ./node_modules/lodash-es/_insertWrapDetails.js ***!
  105412. \******************************************************/
  105413. /*! exports provided: default */
  105414. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  105415. "use strict";
  105416. __webpack_require__.r(__webpack_exports__);
  105417. /** Used to match wrap detail comments. */
  105418. var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/;
  105419. /**
  105420. * Inserts wrapper `details` in a comment at the top of the `source` body.
  105421. *
  105422. * @private
  105423. * @param {string} source The source to modify.
  105424. * @returns {Array} details The details to insert.
  105425. * @returns {string} Returns the modified source.
  105426. */
  105427. function insertWrapDetails(source, details) {
  105428. var length = details.length;
  105429. if (!length) {
  105430. return source;
  105431. }
  105432. var lastIndex = length - 1;
  105433. details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex];
  105434. details = details.join(length > 2 ? ', ' : ' ');
  105435. return source.replace(reWrapComment, '{\n/* [wrapped with ' + details + '] */\n');
  105436. }
  105437. /* harmony default export */ __webpack_exports__["default"] = (insertWrapDetails);
  105438. /***/ }),
  105439. /***/ "./node_modules/lodash-es/_isFlattenable.js":
  105440. /*!**************************************************!*\
  105441. !*** ./node_modules/lodash-es/_isFlattenable.js ***!
  105442. \**************************************************/
  105443. /*! exports provided: default */
  105444. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  105445. "use strict";
  105446. __webpack_require__.r(__webpack_exports__);
  105447. /* harmony import */ var _Symbol_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_Symbol.js */ "./node_modules/lodash-es/_Symbol.js");
  105448. /* harmony import */ var _isArguments_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isArguments.js */ "./node_modules/lodash-es/isArguments.js");
  105449. /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
  105450. /** Built-in value references. */
  105451. var spreadableSymbol = _Symbol_js__WEBPACK_IMPORTED_MODULE_0__["default"] ? _Symbol_js__WEBPACK_IMPORTED_MODULE_0__["default"].isConcatSpreadable : undefined;
  105452. /**
  105453. * Checks if `value` is a flattenable `arguments` object or array.
  105454. *
  105455. * @private
  105456. * @param {*} value The value to check.
  105457. * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.
  105458. */
  105459. function isFlattenable(value) {
  105460. return Object(_isArray_js__WEBPACK_IMPORTED_MODULE_2__["default"])(value) || Object(_isArguments_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value) ||
  105461. !!(spreadableSymbol && value && value[spreadableSymbol]);
  105462. }
  105463. /* harmony default export */ __webpack_exports__["default"] = (isFlattenable);
  105464. /***/ }),
  105465. /***/ "./node_modules/lodash-es/_isIndex.js":
  105466. /*!********************************************!*\
  105467. !*** ./node_modules/lodash-es/_isIndex.js ***!
  105468. \********************************************/
  105469. /*! exports provided: default */
  105470. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  105471. "use strict";
  105472. __webpack_require__.r(__webpack_exports__);
  105473. /** Used as references for various `Number` constants. */
  105474. var MAX_SAFE_INTEGER = 9007199254740991;
  105475. /** Used to detect unsigned integer values. */
  105476. var reIsUint = /^(?:0|[1-9]\d*)$/;
  105477. /**
  105478. * Checks if `value` is a valid array-like index.
  105479. *
  105480. * @private
  105481. * @param {*} value The value to check.
  105482. * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
  105483. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
  105484. */
  105485. function isIndex(value, length) {
  105486. var type = typeof value;
  105487. length = length == null ? MAX_SAFE_INTEGER : length;
  105488. return !!length &&
  105489. (type == 'number' ||
  105490. (type != 'symbol' && reIsUint.test(value))) &&
  105491. (value > -1 && value % 1 == 0 && value < length);
  105492. }
  105493. /* harmony default export */ __webpack_exports__["default"] = (isIndex);
  105494. /***/ }),
  105495. /***/ "./node_modules/lodash-es/_isIterateeCall.js":
  105496. /*!***************************************************!*\
  105497. !*** ./node_modules/lodash-es/_isIterateeCall.js ***!
  105498. \***************************************************/
  105499. /*! exports provided: default */
  105500. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  105501. "use strict";
  105502. __webpack_require__.r(__webpack_exports__);
  105503. /* harmony import */ var _eq_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./eq.js */ "./node_modules/lodash-es/eq.js");
  105504. /* harmony import */ var _isArrayLike_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isArrayLike.js */ "./node_modules/lodash-es/isArrayLike.js");
  105505. /* harmony import */ var _isIndex_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_isIndex.js */ "./node_modules/lodash-es/_isIndex.js");
  105506. /* harmony import */ var _isObject_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./isObject.js */ "./node_modules/lodash-es/isObject.js");
  105507. /**
  105508. * Checks if the given arguments are from an iteratee call.
  105509. *
  105510. * @private
  105511. * @param {*} value The potential iteratee value argument.
  105512. * @param {*} index The potential iteratee index or key argument.
  105513. * @param {*} object The potential iteratee object argument.
  105514. * @returns {boolean} Returns `true` if the arguments are from an iteratee call,
  105515. * else `false`.
  105516. */
  105517. function isIterateeCall(value, index, object) {
  105518. if (!Object(_isObject_js__WEBPACK_IMPORTED_MODULE_3__["default"])(object)) {
  105519. return false;
  105520. }
  105521. var type = typeof index;
  105522. if (type == 'number'
  105523. ? (Object(_isArrayLike_js__WEBPACK_IMPORTED_MODULE_1__["default"])(object) && Object(_isIndex_js__WEBPACK_IMPORTED_MODULE_2__["default"])(index, object.length))
  105524. : (type == 'string' && index in object)
  105525. ) {
  105526. return Object(_eq_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object[index], value);
  105527. }
  105528. return false;
  105529. }
  105530. /* harmony default export */ __webpack_exports__["default"] = (isIterateeCall);
  105531. /***/ }),
  105532. /***/ "./node_modules/lodash-es/_isKey.js":
  105533. /*!******************************************!*\
  105534. !*** ./node_modules/lodash-es/_isKey.js ***!
  105535. \******************************************/
  105536. /*! exports provided: default */
  105537. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  105538. "use strict";
  105539. __webpack_require__.r(__webpack_exports__);
  105540. /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
  105541. /* harmony import */ var _isSymbol_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isSymbol.js */ "./node_modules/lodash-es/isSymbol.js");
  105542. /** Used to match property names within property paths. */
  105543. var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
  105544. reIsPlainProp = /^\w*$/;
  105545. /**
  105546. * Checks if `value` is a property name and not a property path.
  105547. *
  105548. * @private
  105549. * @param {*} value The value to check.
  105550. * @param {Object} [object] The object to query keys on.
  105551. * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
  105552. */
  105553. function isKey(value, object) {
  105554. if (Object(_isArray_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value)) {
  105555. return false;
  105556. }
  105557. var type = typeof value;
  105558. if (type == 'number' || type == 'symbol' || type == 'boolean' ||
  105559. value == null || Object(_isSymbol_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value)) {
  105560. return true;
  105561. }
  105562. return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
  105563. (object != null && value in Object(object));
  105564. }
  105565. /* harmony default export */ __webpack_exports__["default"] = (isKey);
  105566. /***/ }),
  105567. /***/ "./node_modules/lodash-es/_isKeyable.js":
  105568. /*!**********************************************!*\
  105569. !*** ./node_modules/lodash-es/_isKeyable.js ***!
  105570. \**********************************************/
  105571. /*! exports provided: default */
  105572. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  105573. "use strict";
  105574. __webpack_require__.r(__webpack_exports__);
  105575. /**
  105576. * Checks if `value` is suitable for use as unique object key.
  105577. *
  105578. * @private
  105579. * @param {*} value The value to check.
  105580. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  105581. */
  105582. function isKeyable(value) {
  105583. var type = typeof value;
  105584. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  105585. ? (value !== '__proto__')
  105586. : (value === null);
  105587. }
  105588. /* harmony default export */ __webpack_exports__["default"] = (isKeyable);
  105589. /***/ }),
  105590. /***/ "./node_modules/lodash-es/_isLaziable.js":
  105591. /*!***********************************************!*\
  105592. !*** ./node_modules/lodash-es/_isLaziable.js ***!
  105593. \***********************************************/
  105594. /*! exports provided: default */
  105595. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  105596. "use strict";
  105597. __webpack_require__.r(__webpack_exports__);
  105598. /* harmony import */ var _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_LazyWrapper.js */ "./node_modules/lodash-es/_LazyWrapper.js");
  105599. /* harmony import */ var _getData_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_getData.js */ "./node_modules/lodash-es/_getData.js");
  105600. /* harmony import */ var _getFuncName_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_getFuncName.js */ "./node_modules/lodash-es/_getFuncName.js");
  105601. /* harmony import */ var _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./wrapperLodash.js */ "./node_modules/lodash-es/wrapperLodash.js");
  105602. /**
  105603. * Checks if `func` has a lazy counterpart.
  105604. *
  105605. * @private
  105606. * @param {Function} func The function to check.
  105607. * @returns {boolean} Returns `true` if `func` has a lazy counterpart,
  105608. * else `false`.
  105609. */
  105610. function isLaziable(func) {
  105611. var funcName = Object(_getFuncName_js__WEBPACK_IMPORTED_MODULE_2__["default"])(func),
  105612. other = _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_3__["default"][funcName];
  105613. if (typeof other != 'function' || !(funcName in _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_0__["default"].prototype)) {
  105614. return false;
  105615. }
  105616. if (func === other) {
  105617. return true;
  105618. }
  105619. var data = Object(_getData_js__WEBPACK_IMPORTED_MODULE_1__["default"])(other);
  105620. return !!data && func === data[0];
  105621. }
  105622. /* harmony default export */ __webpack_exports__["default"] = (isLaziable);
  105623. /***/ }),
  105624. /***/ "./node_modules/lodash-es/_isMaskable.js":
  105625. /*!***********************************************!*\
  105626. !*** ./node_modules/lodash-es/_isMaskable.js ***!
  105627. \***********************************************/
  105628. /*! exports provided: default */
  105629. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  105630. "use strict";
  105631. __webpack_require__.r(__webpack_exports__);
  105632. /* harmony import */ var _coreJsData_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_coreJsData.js */ "./node_modules/lodash-es/_coreJsData.js");
  105633. /* harmony import */ var _isFunction_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isFunction.js */ "./node_modules/lodash-es/isFunction.js");
  105634. /* harmony import */ var _stubFalse_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./stubFalse.js */ "./node_modules/lodash-es/stubFalse.js");
  105635. /**
  105636. * Checks if `func` is capable of being masked.
  105637. *
  105638. * @private
  105639. * @param {*} value The value to check.
  105640. * @returns {boolean} Returns `true` if `func` is maskable, else `false`.
  105641. */
  105642. var isMaskable = _coreJsData_js__WEBPACK_IMPORTED_MODULE_0__["default"] ? _isFunction_js__WEBPACK_IMPORTED_MODULE_1__["default"] : _stubFalse_js__WEBPACK_IMPORTED_MODULE_2__["default"];
  105643. /* harmony default export */ __webpack_exports__["default"] = (isMaskable);
  105644. /***/ }),
  105645. /***/ "./node_modules/lodash-es/_isMasked.js":
  105646. /*!*********************************************!*\
  105647. !*** ./node_modules/lodash-es/_isMasked.js ***!
  105648. \*********************************************/
  105649. /*! exports provided: default */
  105650. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  105651. "use strict";
  105652. __webpack_require__.r(__webpack_exports__);
  105653. /* harmony import */ var _coreJsData_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_coreJsData.js */ "./node_modules/lodash-es/_coreJsData.js");
  105654. /** Used to detect methods masquerading as native. */
  105655. var maskSrcKey = (function() {
  105656. 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 || '');
  105657. return uid ? ('Symbol(src)_1.' + uid) : '';
  105658. }());
  105659. /**
  105660. * Checks if `func` has its source masked.
  105661. *
  105662. * @private
  105663. * @param {Function} func The function to check.
  105664. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  105665. */
  105666. function isMasked(func) {
  105667. return !!maskSrcKey && (maskSrcKey in func);
  105668. }
  105669. /* harmony default export */ __webpack_exports__["default"] = (isMasked);
  105670. /***/ }),
  105671. /***/ "./node_modules/lodash-es/_isPrototype.js":
  105672. /*!************************************************!*\
  105673. !*** ./node_modules/lodash-es/_isPrototype.js ***!
  105674. \************************************************/
  105675. /*! exports provided: default */
  105676. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  105677. "use strict";
  105678. __webpack_require__.r(__webpack_exports__);
  105679. /** Used for built-in method references. */
  105680. var objectProto = Object.prototype;
  105681. /**
  105682. * Checks if `value` is likely a prototype object.
  105683. *
  105684. * @private
  105685. * @param {*} value The value to check.
  105686. * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
  105687. */
  105688. function isPrototype(value) {
  105689. var Ctor = value && value.constructor,
  105690. proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;
  105691. return value === proto;
  105692. }
  105693. /* harmony default export */ __webpack_exports__["default"] = (isPrototype);
  105694. /***/ }),
  105695. /***/ "./node_modules/lodash-es/_isStrictComparable.js":
  105696. /*!*******************************************************!*\
  105697. !*** ./node_modules/lodash-es/_isStrictComparable.js ***!
  105698. \*******************************************************/
  105699. /*! exports provided: default */
  105700. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  105701. "use strict";
  105702. __webpack_require__.r(__webpack_exports__);
  105703. /* harmony import */ var _isObject_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isObject.js */ "./node_modules/lodash-es/isObject.js");
  105704. /**
  105705. * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.
  105706. *
  105707. * @private
  105708. * @param {*} value The value to check.
  105709. * @returns {boolean} Returns `true` if `value` if suitable for strict
  105710. * equality comparisons, else `false`.
  105711. */
  105712. function isStrictComparable(value) {
  105713. return value === value && !Object(_isObject_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value);
  105714. }
  105715. /* harmony default export */ __webpack_exports__["default"] = (isStrictComparable);
  105716. /***/ }),
  105717. /***/ "./node_modules/lodash-es/_iteratorToArray.js":
  105718. /*!****************************************************!*\
  105719. !*** ./node_modules/lodash-es/_iteratorToArray.js ***!
  105720. \****************************************************/
  105721. /*! exports provided: default */
  105722. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  105723. "use strict";
  105724. __webpack_require__.r(__webpack_exports__);
  105725. /**
  105726. * Converts `iterator` to an array.
  105727. *
  105728. * @private
  105729. * @param {Object} iterator The iterator to convert.
  105730. * @returns {Array} Returns the converted array.
  105731. */
  105732. function iteratorToArray(iterator) {
  105733. var data,
  105734. result = [];
  105735. while (!(data = iterator.next()).done) {
  105736. result.push(data.value);
  105737. }
  105738. return result;
  105739. }
  105740. /* harmony default export */ __webpack_exports__["default"] = (iteratorToArray);
  105741. /***/ }),
  105742. /***/ "./node_modules/lodash-es/_lazyClone.js":
  105743. /*!**********************************************!*\
  105744. !*** ./node_modules/lodash-es/_lazyClone.js ***!
  105745. \**********************************************/
  105746. /*! exports provided: default */
  105747. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  105748. "use strict";
  105749. __webpack_require__.r(__webpack_exports__);
  105750. /* harmony import */ var _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_LazyWrapper.js */ "./node_modules/lodash-es/_LazyWrapper.js");
  105751. /* harmony import */ var _copyArray_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_copyArray.js */ "./node_modules/lodash-es/_copyArray.js");
  105752. /**
  105753. * Creates a clone of the lazy wrapper object.
  105754. *
  105755. * @private
  105756. * @name clone
  105757. * @memberOf LazyWrapper
  105758. * @returns {Object} Returns the cloned `LazyWrapper` object.
  105759. */
  105760. function lazyClone() {
  105761. var result = new _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_0__["default"](this.__wrapped__);
  105762. result.__actions__ = Object(_copyArray_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this.__actions__);
  105763. result.__dir__ = this.__dir__;
  105764. result.__filtered__ = this.__filtered__;
  105765. result.__iteratees__ = Object(_copyArray_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this.__iteratees__);
  105766. result.__takeCount__ = this.__takeCount__;
  105767. result.__views__ = Object(_copyArray_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this.__views__);
  105768. return result;
  105769. }
  105770. /* harmony default export */ __webpack_exports__["default"] = (lazyClone);
  105771. /***/ }),
  105772. /***/ "./node_modules/lodash-es/_lazyReverse.js":
  105773. /*!************************************************!*\
  105774. !*** ./node_modules/lodash-es/_lazyReverse.js ***!
  105775. \************************************************/
  105776. /*! exports provided: default */
  105777. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  105778. "use strict";
  105779. __webpack_require__.r(__webpack_exports__);
  105780. /* harmony import */ var _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_LazyWrapper.js */ "./node_modules/lodash-es/_LazyWrapper.js");
  105781. /**
  105782. * Reverses the direction of lazy iteration.
  105783. *
  105784. * @private
  105785. * @name reverse
  105786. * @memberOf LazyWrapper
  105787. * @returns {Object} Returns the new reversed `LazyWrapper` object.
  105788. */
  105789. function lazyReverse() {
  105790. if (this.__filtered__) {
  105791. var result = new _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_0__["default"](this);
  105792. result.__dir__ = -1;
  105793. result.__filtered__ = true;
  105794. } else {
  105795. result = this.clone();
  105796. result.__dir__ *= -1;
  105797. }
  105798. return result;
  105799. }
  105800. /* harmony default export */ __webpack_exports__["default"] = (lazyReverse);
  105801. /***/ }),
  105802. /***/ "./node_modules/lodash-es/_lazyValue.js":
  105803. /*!**********************************************!*\
  105804. !*** ./node_modules/lodash-es/_lazyValue.js ***!
  105805. \**********************************************/
  105806. /*! exports provided: default */
  105807. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  105808. "use strict";
  105809. __webpack_require__.r(__webpack_exports__);
  105810. /* harmony import */ var _baseWrapperValue_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseWrapperValue.js */ "./node_modules/lodash-es/_baseWrapperValue.js");
  105811. /* harmony import */ var _getView_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_getView.js */ "./node_modules/lodash-es/_getView.js");
  105812. /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
  105813. /** Used to indicate the type of lazy iteratees. */
  105814. var LAZY_FILTER_FLAG = 1,
  105815. LAZY_MAP_FLAG = 2;
  105816. /* Built-in method references for those with the same name as other `lodash` methods. */
  105817. var nativeMin = Math.min;
  105818. /**
  105819. * Extracts the unwrapped value from its lazy wrapper.
  105820. *
  105821. * @private
  105822. * @name value
  105823. * @memberOf LazyWrapper
  105824. * @returns {*} Returns the unwrapped value.
  105825. */
  105826. function lazyValue() {
  105827. var array = this.__wrapped__.value(),
  105828. dir = this.__dir__,
  105829. isArr = Object(_isArray_js__WEBPACK_IMPORTED_MODULE_2__["default"])(array),
  105830. isRight = dir < 0,
  105831. arrLength = isArr ? array.length : 0,
  105832. view = Object(_getView_js__WEBPACK_IMPORTED_MODULE_1__["default"])(0, arrLength, this.__views__),
  105833. start = view.start,
  105834. end = view.end,
  105835. length = end - start,
  105836. index = isRight ? end : (start - 1),
  105837. iteratees = this.__iteratees__,
  105838. iterLength = iteratees.length,
  105839. resIndex = 0,
  105840. takeCount = nativeMin(length, this.__takeCount__);
  105841. if (!isArr || (!isRight && arrLength == length && takeCount == length)) {
  105842. return Object(_baseWrapperValue_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, this.__actions__);
  105843. }
  105844. var result = [];
  105845. outer:
  105846. while (length-- && resIndex < takeCount) {
  105847. index += dir;
  105848. var iterIndex = -1,
  105849. value = array[index];
  105850. while (++iterIndex < iterLength) {
  105851. var data = iteratees[iterIndex],
  105852. iteratee = data.iteratee,
  105853. type = data.type,
  105854. computed = iteratee(value);
  105855. if (type == LAZY_MAP_FLAG) {
  105856. value = computed;
  105857. } else if (!computed) {
  105858. if (type == LAZY_FILTER_FLAG) {
  105859. continue outer;
  105860. } else {
  105861. break outer;
  105862. }
  105863. }
  105864. }
  105865. result[resIndex++] = value;
  105866. }
  105867. return result;
  105868. }
  105869. /* harmony default export */ __webpack_exports__["default"] = (lazyValue);
  105870. /***/ }),
  105871. /***/ "./node_modules/lodash-es/_listCacheClear.js":
  105872. /*!***************************************************!*\
  105873. !*** ./node_modules/lodash-es/_listCacheClear.js ***!
  105874. \***************************************************/
  105875. /*! exports provided: default */
  105876. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  105877. "use strict";
  105878. __webpack_require__.r(__webpack_exports__);
  105879. /**
  105880. * Removes all key-value entries from the list cache.
  105881. *
  105882. * @private
  105883. * @name clear
  105884. * @memberOf ListCache
  105885. */
  105886. function listCacheClear() {
  105887. this.__data__ = [];
  105888. this.size = 0;
  105889. }
  105890. /* harmony default export */ __webpack_exports__["default"] = (listCacheClear);
  105891. /***/ }),
  105892. /***/ "./node_modules/lodash-es/_listCacheDelete.js":
  105893. /*!****************************************************!*\
  105894. !*** ./node_modules/lodash-es/_listCacheDelete.js ***!
  105895. \****************************************************/
  105896. /*! exports provided: default */
  105897. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  105898. "use strict";
  105899. __webpack_require__.r(__webpack_exports__);
  105900. /* harmony import */ var _assocIndexOf_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_assocIndexOf.js */ "./node_modules/lodash-es/_assocIndexOf.js");
  105901. /** Used for built-in method references. */
  105902. var arrayProto = Array.prototype;
  105903. /** Built-in value references. */
  105904. var splice = arrayProto.splice;
  105905. /**
  105906. * Removes `key` and its value from the list cache.
  105907. *
  105908. * @private
  105909. * @name delete
  105910. * @memberOf ListCache
  105911. * @param {string} key The key of the value to remove.
  105912. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  105913. */
  105914. function listCacheDelete(key) {
  105915. var data = this.__data__,
  105916. index = Object(_assocIndexOf_js__WEBPACK_IMPORTED_MODULE_0__["default"])(data, key);
  105917. if (index < 0) {
  105918. return false;
  105919. }
  105920. var lastIndex = data.length - 1;
  105921. if (index == lastIndex) {
  105922. data.pop();
  105923. } else {
  105924. splice.call(data, index, 1);
  105925. }
  105926. --this.size;
  105927. return true;
  105928. }
  105929. /* harmony default export */ __webpack_exports__["default"] = (listCacheDelete);
  105930. /***/ }),
  105931. /***/ "./node_modules/lodash-es/_listCacheGet.js":
  105932. /*!*************************************************!*\
  105933. !*** ./node_modules/lodash-es/_listCacheGet.js ***!
  105934. \*************************************************/
  105935. /*! exports provided: default */
  105936. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  105937. "use strict";
  105938. __webpack_require__.r(__webpack_exports__);
  105939. /* harmony import */ var _assocIndexOf_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_assocIndexOf.js */ "./node_modules/lodash-es/_assocIndexOf.js");
  105940. /**
  105941. * Gets the list cache value for `key`.
  105942. *
  105943. * @private
  105944. * @name get
  105945. * @memberOf ListCache
  105946. * @param {string} key The key of the value to get.
  105947. * @returns {*} Returns the entry value.
  105948. */
  105949. function listCacheGet(key) {
  105950. var data = this.__data__,
  105951. index = Object(_assocIndexOf_js__WEBPACK_IMPORTED_MODULE_0__["default"])(data, key);
  105952. return index < 0 ? undefined : data[index][1];
  105953. }
  105954. /* harmony default export */ __webpack_exports__["default"] = (listCacheGet);
  105955. /***/ }),
  105956. /***/ "./node_modules/lodash-es/_listCacheHas.js":
  105957. /*!*************************************************!*\
  105958. !*** ./node_modules/lodash-es/_listCacheHas.js ***!
  105959. \*************************************************/
  105960. /*! exports provided: default */
  105961. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  105962. "use strict";
  105963. __webpack_require__.r(__webpack_exports__);
  105964. /* harmony import */ var _assocIndexOf_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_assocIndexOf.js */ "./node_modules/lodash-es/_assocIndexOf.js");
  105965. /**
  105966. * Checks if a list cache value for `key` exists.
  105967. *
  105968. * @private
  105969. * @name has
  105970. * @memberOf ListCache
  105971. * @param {string} key The key of the entry to check.
  105972. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  105973. */
  105974. function listCacheHas(key) {
  105975. return Object(_assocIndexOf_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this.__data__, key) > -1;
  105976. }
  105977. /* harmony default export */ __webpack_exports__["default"] = (listCacheHas);
  105978. /***/ }),
  105979. /***/ "./node_modules/lodash-es/_listCacheSet.js":
  105980. /*!*************************************************!*\
  105981. !*** ./node_modules/lodash-es/_listCacheSet.js ***!
  105982. \*************************************************/
  105983. /*! exports provided: default */
  105984. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  105985. "use strict";
  105986. __webpack_require__.r(__webpack_exports__);
  105987. /* harmony import */ var _assocIndexOf_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_assocIndexOf.js */ "./node_modules/lodash-es/_assocIndexOf.js");
  105988. /**
  105989. * Sets the list cache `key` to `value`.
  105990. *
  105991. * @private
  105992. * @name set
  105993. * @memberOf ListCache
  105994. * @param {string} key The key of the value to set.
  105995. * @param {*} value The value to set.
  105996. * @returns {Object} Returns the list cache instance.
  105997. */
  105998. function listCacheSet(key, value) {
  105999. var data = this.__data__,
  106000. index = Object(_assocIndexOf_js__WEBPACK_IMPORTED_MODULE_0__["default"])(data, key);
  106001. if (index < 0) {
  106002. ++this.size;
  106003. data.push([key, value]);
  106004. } else {
  106005. data[index][1] = value;
  106006. }
  106007. return this;
  106008. }
  106009. /* harmony default export */ __webpack_exports__["default"] = (listCacheSet);
  106010. /***/ }),
  106011. /***/ "./node_modules/lodash-es/_mapCacheClear.js":
  106012. /*!**************************************************!*\
  106013. !*** ./node_modules/lodash-es/_mapCacheClear.js ***!
  106014. \**************************************************/
  106015. /*! exports provided: default */
  106016. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  106017. "use strict";
  106018. __webpack_require__.r(__webpack_exports__);
  106019. /* harmony import */ var _Hash_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_Hash.js */ "./node_modules/lodash-es/_Hash.js");
  106020. /* harmony import */ var _ListCache_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_ListCache.js */ "./node_modules/lodash-es/_ListCache.js");
  106021. /* harmony import */ var _Map_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_Map.js */ "./node_modules/lodash-es/_Map.js");
  106022. /**
  106023. * Removes all key-value entries from the map.
  106024. *
  106025. * @private
  106026. * @name clear
  106027. * @memberOf MapCache
  106028. */
  106029. function mapCacheClear() {
  106030. this.size = 0;
  106031. this.__data__ = {
  106032. 'hash': new _Hash_js__WEBPACK_IMPORTED_MODULE_0__["default"],
  106033. 'map': new (_Map_js__WEBPACK_IMPORTED_MODULE_2__["default"] || _ListCache_js__WEBPACK_IMPORTED_MODULE_1__["default"]),
  106034. 'string': new _Hash_js__WEBPACK_IMPORTED_MODULE_0__["default"]
  106035. };
  106036. }
  106037. /* harmony default export */ __webpack_exports__["default"] = (mapCacheClear);
  106038. /***/ }),
  106039. /***/ "./node_modules/lodash-es/_mapCacheDelete.js":
  106040. /*!***************************************************!*\
  106041. !*** ./node_modules/lodash-es/_mapCacheDelete.js ***!
  106042. \***************************************************/
  106043. /*! exports provided: default */
  106044. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  106045. "use strict";
  106046. __webpack_require__.r(__webpack_exports__);
  106047. /* harmony import */ var _getMapData_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_getMapData.js */ "./node_modules/lodash-es/_getMapData.js");
  106048. /**
  106049. * Removes `key` and its value from the map.
  106050. *
  106051. * @private
  106052. * @name delete
  106053. * @memberOf MapCache
  106054. * @param {string} key The key of the value to remove.
  106055. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  106056. */
  106057. function mapCacheDelete(key) {
  106058. var result = Object(_getMapData_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, key)['delete'](key);
  106059. this.size -= result ? 1 : 0;
  106060. return result;
  106061. }
  106062. /* harmony default export */ __webpack_exports__["default"] = (mapCacheDelete);
  106063. /***/ }),
  106064. /***/ "./node_modules/lodash-es/_mapCacheGet.js":
  106065. /*!************************************************!*\
  106066. !*** ./node_modules/lodash-es/_mapCacheGet.js ***!
  106067. \************************************************/
  106068. /*! exports provided: default */
  106069. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  106070. "use strict";
  106071. __webpack_require__.r(__webpack_exports__);
  106072. /* harmony import */ var _getMapData_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_getMapData.js */ "./node_modules/lodash-es/_getMapData.js");
  106073. /**
  106074. * Gets the map value for `key`.
  106075. *
  106076. * @private
  106077. * @name get
  106078. * @memberOf MapCache
  106079. * @param {string} key The key of the value to get.
  106080. * @returns {*} Returns the entry value.
  106081. */
  106082. function mapCacheGet(key) {
  106083. return Object(_getMapData_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, key).get(key);
  106084. }
  106085. /* harmony default export */ __webpack_exports__["default"] = (mapCacheGet);
  106086. /***/ }),
  106087. /***/ "./node_modules/lodash-es/_mapCacheHas.js":
  106088. /*!************************************************!*\
  106089. !*** ./node_modules/lodash-es/_mapCacheHas.js ***!
  106090. \************************************************/
  106091. /*! exports provided: default */
  106092. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  106093. "use strict";
  106094. __webpack_require__.r(__webpack_exports__);
  106095. /* harmony import */ var _getMapData_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_getMapData.js */ "./node_modules/lodash-es/_getMapData.js");
  106096. /**
  106097. * Checks if a map value for `key` exists.
  106098. *
  106099. * @private
  106100. * @name has
  106101. * @memberOf MapCache
  106102. * @param {string} key The key of the entry to check.
  106103. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  106104. */
  106105. function mapCacheHas(key) {
  106106. return Object(_getMapData_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, key).has(key);
  106107. }
  106108. /* harmony default export */ __webpack_exports__["default"] = (mapCacheHas);
  106109. /***/ }),
  106110. /***/ "./node_modules/lodash-es/_mapCacheSet.js":
  106111. /*!************************************************!*\
  106112. !*** ./node_modules/lodash-es/_mapCacheSet.js ***!
  106113. \************************************************/
  106114. /*! exports provided: default */
  106115. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  106116. "use strict";
  106117. __webpack_require__.r(__webpack_exports__);
  106118. /* harmony import */ var _getMapData_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_getMapData.js */ "./node_modules/lodash-es/_getMapData.js");
  106119. /**
  106120. * Sets the map `key` to `value`.
  106121. *
  106122. * @private
  106123. * @name set
  106124. * @memberOf MapCache
  106125. * @param {string} key The key of the value to set.
  106126. * @param {*} value The value to set.
  106127. * @returns {Object} Returns the map cache instance.
  106128. */
  106129. function mapCacheSet(key, value) {
  106130. var data = Object(_getMapData_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, key),
  106131. size = data.size;
  106132. data.set(key, value);
  106133. this.size += data.size == size ? 0 : 1;
  106134. return this;
  106135. }
  106136. /* harmony default export */ __webpack_exports__["default"] = (mapCacheSet);
  106137. /***/ }),
  106138. /***/ "./node_modules/lodash-es/_mapToArray.js":
  106139. /*!***********************************************!*\
  106140. !*** ./node_modules/lodash-es/_mapToArray.js ***!
  106141. \***********************************************/
  106142. /*! exports provided: default */
  106143. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  106144. "use strict";
  106145. __webpack_require__.r(__webpack_exports__);
  106146. /**
  106147. * Converts `map` to its key-value pairs.
  106148. *
  106149. * @private
  106150. * @param {Object} map The map to convert.
  106151. * @returns {Array} Returns the key-value pairs.
  106152. */
  106153. function mapToArray(map) {
  106154. var index = -1,
  106155. result = Array(map.size);
  106156. map.forEach(function(value, key) {
  106157. result[++index] = [key, value];
  106158. });
  106159. return result;
  106160. }
  106161. /* harmony default export */ __webpack_exports__["default"] = (mapToArray);
  106162. /***/ }),
  106163. /***/ "./node_modules/lodash-es/_matchesStrictComparable.js":
  106164. /*!************************************************************!*\
  106165. !*** ./node_modules/lodash-es/_matchesStrictComparable.js ***!
  106166. \************************************************************/
  106167. /*! exports provided: default */
  106168. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  106169. "use strict";
  106170. __webpack_require__.r(__webpack_exports__);
  106171. /**
  106172. * A specialized version of `matchesProperty` for source values suitable
  106173. * for strict equality comparisons, i.e. `===`.
  106174. *
  106175. * @private
  106176. * @param {string} key The key of the property to get.
  106177. * @param {*} srcValue The value to match.
  106178. * @returns {Function} Returns the new spec function.
  106179. */
  106180. function matchesStrictComparable(key, srcValue) {
  106181. return function(object) {
  106182. if (object == null) {
  106183. return false;
  106184. }
  106185. return object[key] === srcValue &&
  106186. (srcValue !== undefined || (key in Object(object)));
  106187. };
  106188. }
  106189. /* harmony default export */ __webpack_exports__["default"] = (matchesStrictComparable);
  106190. /***/ }),
  106191. /***/ "./node_modules/lodash-es/_memoizeCapped.js":
  106192. /*!**************************************************!*\
  106193. !*** ./node_modules/lodash-es/_memoizeCapped.js ***!
  106194. \**************************************************/
  106195. /*! exports provided: default */
  106196. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  106197. "use strict";
  106198. __webpack_require__.r(__webpack_exports__);
  106199. /* harmony import */ var _memoize_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./memoize.js */ "./node_modules/lodash-es/memoize.js");
  106200. /** Used as the maximum memoize cache size. */
  106201. var MAX_MEMOIZE_SIZE = 500;
  106202. /**
  106203. * A specialized version of `_.memoize` which clears the memoized function's
  106204. * cache when it exceeds `MAX_MEMOIZE_SIZE`.
  106205. *
  106206. * @private
  106207. * @param {Function} func The function to have its output memoized.
  106208. * @returns {Function} Returns the new memoized function.
  106209. */
  106210. function memoizeCapped(func) {
  106211. var result = Object(_memoize_js__WEBPACK_IMPORTED_MODULE_0__["default"])(func, function(key) {
  106212. if (cache.size === MAX_MEMOIZE_SIZE) {
  106213. cache.clear();
  106214. }
  106215. return key;
  106216. });
  106217. var cache = result.cache;
  106218. return result;
  106219. }
  106220. /* harmony default export */ __webpack_exports__["default"] = (memoizeCapped);
  106221. /***/ }),
  106222. /***/ "./node_modules/lodash-es/_mergeData.js":
  106223. /*!**********************************************!*\
  106224. !*** ./node_modules/lodash-es/_mergeData.js ***!
  106225. \**********************************************/
  106226. /*! exports provided: default */
  106227. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  106228. "use strict";
  106229. __webpack_require__.r(__webpack_exports__);
  106230. /* harmony import */ var _composeArgs_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_composeArgs.js */ "./node_modules/lodash-es/_composeArgs.js");
  106231. /* harmony import */ var _composeArgsRight_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_composeArgsRight.js */ "./node_modules/lodash-es/_composeArgsRight.js");
  106232. /* harmony import */ var _replaceHolders_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_replaceHolders.js */ "./node_modules/lodash-es/_replaceHolders.js");
  106233. /** Used as the internal argument placeholder. */
  106234. var PLACEHOLDER = '__lodash_placeholder__';
  106235. /** Used to compose bitmasks for function metadata. */
  106236. var WRAP_BIND_FLAG = 1,
  106237. WRAP_BIND_KEY_FLAG = 2,
  106238. WRAP_CURRY_BOUND_FLAG = 4,
  106239. WRAP_CURRY_FLAG = 8,
  106240. WRAP_ARY_FLAG = 128,
  106241. WRAP_REARG_FLAG = 256;
  106242. /* Built-in method references for those with the same name as other `lodash` methods. */
  106243. var nativeMin = Math.min;
  106244. /**
  106245. * Merges the function metadata of `source` into `data`.
  106246. *
  106247. * Merging metadata reduces the number of wrappers used to invoke a function.
  106248. * This is possible because methods like `_.bind`, `_.curry`, and `_.partial`
  106249. * may be applied regardless of execution order. Methods like `_.ary` and
  106250. * `_.rearg` modify function arguments, making the order in which they are
  106251. * executed important, preventing the merging of metadata. However, we make
  106252. * an exception for a safe combined case where curried functions have `_.ary`
  106253. * and or `_.rearg` applied.
  106254. *
  106255. * @private
  106256. * @param {Array} data The destination metadata.
  106257. * @param {Array} source The source metadata.
  106258. * @returns {Array} Returns `data`.
  106259. */
  106260. function mergeData(data, source) {
  106261. var bitmask = data[1],
  106262. srcBitmask = source[1],
  106263. newBitmask = bitmask | srcBitmask,
  106264. isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG);
  106265. var isCombo =
  106266. ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) ||
  106267. ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) ||
  106268. ((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG));
  106269. // Exit early if metadata can't be merged.
  106270. if (!(isCommon || isCombo)) {
  106271. return data;
  106272. }
  106273. // Use source `thisArg` if available.
  106274. if (srcBitmask & WRAP_BIND_FLAG) {
  106275. data[2] = source[2];
  106276. // Set when currying a bound function.
  106277. newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG;
  106278. }
  106279. // Compose partial arguments.
  106280. var value = source[3];
  106281. if (value) {
  106282. var partials = data[3];
  106283. data[3] = partials ? Object(_composeArgs_js__WEBPACK_IMPORTED_MODULE_0__["default"])(partials, value, source[4]) : value;
  106284. data[4] = partials ? Object(_replaceHolders_js__WEBPACK_IMPORTED_MODULE_2__["default"])(data[3], PLACEHOLDER) : source[4];
  106285. }
  106286. // Compose partial right arguments.
  106287. value = source[5];
  106288. if (value) {
  106289. partials = data[5];
  106290. data[5] = partials ? Object(_composeArgsRight_js__WEBPACK_IMPORTED_MODULE_1__["default"])(partials, value, source[6]) : value;
  106291. data[6] = partials ? Object(_replaceHolders_js__WEBPACK_IMPORTED_MODULE_2__["default"])(data[5], PLACEHOLDER) : source[6];
  106292. }
  106293. // Use source `argPos` if available.
  106294. value = source[7];
  106295. if (value) {
  106296. data[7] = value;
  106297. }
  106298. // Use source `ary` if it's smaller.
  106299. if (srcBitmask & WRAP_ARY_FLAG) {
  106300. data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);
  106301. }
  106302. // Use source `arity` if one is not provided.
  106303. if (data[9] == null) {
  106304. data[9] = source[9];
  106305. }
  106306. // Use source `func` and merge bitmasks.
  106307. data[0] = source[0];
  106308. data[1] = newBitmask;
  106309. return data;
  106310. }
  106311. /* harmony default export */ __webpack_exports__["default"] = (mergeData);
  106312. /***/ }),
  106313. /***/ "./node_modules/lodash-es/_metaMap.js":
  106314. /*!********************************************!*\
  106315. !*** ./node_modules/lodash-es/_metaMap.js ***!
  106316. \********************************************/
  106317. /*! exports provided: default */
  106318. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  106319. "use strict";
  106320. __webpack_require__.r(__webpack_exports__);
  106321. /* harmony import */ var _WeakMap_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_WeakMap.js */ "./node_modules/lodash-es/_WeakMap.js");
  106322. /** Used to store function metadata. */
  106323. var metaMap = _WeakMap_js__WEBPACK_IMPORTED_MODULE_0__["default"] && new _WeakMap_js__WEBPACK_IMPORTED_MODULE_0__["default"];
  106324. /* harmony default export */ __webpack_exports__["default"] = (metaMap);
  106325. /***/ }),
  106326. /***/ "./node_modules/lodash-es/_nativeCreate.js":
  106327. /*!*************************************************!*\
  106328. !*** ./node_modules/lodash-es/_nativeCreate.js ***!
  106329. \*************************************************/
  106330. /*! exports provided: default */
  106331. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  106332. "use strict";
  106333. __webpack_require__.r(__webpack_exports__);
  106334. /* harmony import */ var _getNative_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_getNative.js */ "./node_modules/lodash-es/_getNative.js");
  106335. /* Built-in method references that are verified to be native. */
  106336. var nativeCreate = Object(_getNative_js__WEBPACK_IMPORTED_MODULE_0__["default"])(Object, 'create');
  106337. /* harmony default export */ __webpack_exports__["default"] = (nativeCreate);
  106338. /***/ }),
  106339. /***/ "./node_modules/lodash-es/_nativeKeys.js":
  106340. /*!***********************************************!*\
  106341. !*** ./node_modules/lodash-es/_nativeKeys.js ***!
  106342. \***********************************************/
  106343. /*! exports provided: default */
  106344. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  106345. "use strict";
  106346. __webpack_require__.r(__webpack_exports__);
  106347. /* harmony import */ var _overArg_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_overArg.js */ "./node_modules/lodash-es/_overArg.js");
  106348. /* Built-in method references for those with the same name as other `lodash` methods. */
  106349. var nativeKeys = Object(_overArg_js__WEBPACK_IMPORTED_MODULE_0__["default"])(Object.keys, Object);
  106350. /* harmony default export */ __webpack_exports__["default"] = (nativeKeys);
  106351. /***/ }),
  106352. /***/ "./node_modules/lodash-es/_nativeKeysIn.js":
  106353. /*!*************************************************!*\
  106354. !*** ./node_modules/lodash-es/_nativeKeysIn.js ***!
  106355. \*************************************************/
  106356. /*! exports provided: default */
  106357. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  106358. "use strict";
  106359. __webpack_require__.r(__webpack_exports__);
  106360. /**
  106361. * This function is like
  106362. * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  106363. * except that it includes inherited enumerable properties.
  106364. *
  106365. * @private
  106366. * @param {Object} object The object to query.
  106367. * @returns {Array} Returns the array of property names.
  106368. */
  106369. function nativeKeysIn(object) {
  106370. var result = [];
  106371. if (object != null) {
  106372. for (var key in Object(object)) {
  106373. result.push(key);
  106374. }
  106375. }
  106376. return result;
  106377. }
  106378. /* harmony default export */ __webpack_exports__["default"] = (nativeKeysIn);
  106379. /***/ }),
  106380. /***/ "./node_modules/lodash-es/_nodeUtil.js":
  106381. /*!*********************************************!*\
  106382. !*** ./node_modules/lodash-es/_nodeUtil.js ***!
  106383. \*********************************************/
  106384. /*! exports provided: default */
  106385. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  106386. "use strict";
  106387. __webpack_require__.r(__webpack_exports__);
  106388. /* WEBPACK VAR INJECTION */(function(module) {/* harmony import */ var _freeGlobal_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_freeGlobal.js */ "./node_modules/lodash-es/_freeGlobal.js");
  106389. /** Detect free variable `exports`. */
  106390. var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;
  106391. /** Detect free variable `module`. */
  106392. var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;
  106393. /** Detect the popular CommonJS extension `module.exports`. */
  106394. var moduleExports = freeModule && freeModule.exports === freeExports;
  106395. /** Detect free variable `process` from Node.js. */
  106396. var freeProcess = moduleExports && _freeGlobal_js__WEBPACK_IMPORTED_MODULE_0__["default"].process;
  106397. /** Used to access faster Node.js helpers. */
  106398. var nodeUtil = (function() {
  106399. try {
  106400. // Use `util.types` for Node.js 10+.
  106401. var types = freeModule && freeModule.require && freeModule.require('util').types;
  106402. if (types) {
  106403. return types;
  106404. }
  106405. // Legacy `process.binding('util')` for Node.js < 10.
  106406. return freeProcess && freeProcess.binding && freeProcess.binding('util');
  106407. } catch (e) {}
  106408. }());
  106409. /* harmony default export */ __webpack_exports__["default"] = (nodeUtil);
  106410. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/harmony-module.js */ "./node_modules/webpack/buildin/harmony-module.js")(module)))
  106411. /***/ }),
  106412. /***/ "./node_modules/lodash-es/_objectToString.js":
  106413. /*!***************************************************!*\
  106414. !*** ./node_modules/lodash-es/_objectToString.js ***!
  106415. \***************************************************/
  106416. /*! exports provided: default */
  106417. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  106418. "use strict";
  106419. __webpack_require__.r(__webpack_exports__);
  106420. /** Used for built-in method references. */
  106421. var objectProto = Object.prototype;
  106422. /**
  106423. * Used to resolve the
  106424. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  106425. * of values.
  106426. */
  106427. var nativeObjectToString = objectProto.toString;
  106428. /**
  106429. * Converts `value` to a string using `Object.prototype.toString`.
  106430. *
  106431. * @private
  106432. * @param {*} value The value to convert.
  106433. * @returns {string} Returns the converted string.
  106434. */
  106435. function objectToString(value) {
  106436. return nativeObjectToString.call(value);
  106437. }
  106438. /* harmony default export */ __webpack_exports__["default"] = (objectToString);
  106439. /***/ }),
  106440. /***/ "./node_modules/lodash-es/_overArg.js":
  106441. /*!********************************************!*\
  106442. !*** ./node_modules/lodash-es/_overArg.js ***!
  106443. \********************************************/
  106444. /*! exports provided: default */
  106445. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  106446. "use strict";
  106447. __webpack_require__.r(__webpack_exports__);
  106448. /**
  106449. * Creates a unary function that invokes `func` with its argument transformed.
  106450. *
  106451. * @private
  106452. * @param {Function} func The function to wrap.
  106453. * @param {Function} transform The argument transform.
  106454. * @returns {Function} Returns the new function.
  106455. */
  106456. function overArg(func, transform) {
  106457. return function(arg) {
  106458. return func(transform(arg));
  106459. };
  106460. }
  106461. /* harmony default export */ __webpack_exports__["default"] = (overArg);
  106462. /***/ }),
  106463. /***/ "./node_modules/lodash-es/_overRest.js":
  106464. /*!*********************************************!*\
  106465. !*** ./node_modules/lodash-es/_overRest.js ***!
  106466. \*********************************************/
  106467. /*! exports provided: default */
  106468. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  106469. "use strict";
  106470. __webpack_require__.r(__webpack_exports__);
  106471. /* harmony import */ var _apply_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_apply.js */ "./node_modules/lodash-es/_apply.js");
  106472. /* Built-in method references for those with the same name as other `lodash` methods. */
  106473. var nativeMax = Math.max;
  106474. /**
  106475. * A specialized version of `baseRest` which transforms the rest array.
  106476. *
  106477. * @private
  106478. * @param {Function} func The function to apply a rest parameter to.
  106479. * @param {number} [start=func.length-1] The start position of the rest parameter.
  106480. * @param {Function} transform The rest array transform.
  106481. * @returns {Function} Returns the new function.
  106482. */
  106483. function overRest(func, start, transform) {
  106484. start = nativeMax(start === undefined ? (func.length - 1) : start, 0);
  106485. return function() {
  106486. var args = arguments,
  106487. index = -1,
  106488. length = nativeMax(args.length - start, 0),
  106489. array = Array(length);
  106490. while (++index < length) {
  106491. array[index] = args[start + index];
  106492. }
  106493. index = -1;
  106494. var otherArgs = Array(start + 1);
  106495. while (++index < start) {
  106496. otherArgs[index] = args[index];
  106497. }
  106498. otherArgs[start] = transform(array);
  106499. return Object(_apply_js__WEBPACK_IMPORTED_MODULE_0__["default"])(func, this, otherArgs);
  106500. };
  106501. }
  106502. /* harmony default export */ __webpack_exports__["default"] = (overRest);
  106503. /***/ }),
  106504. /***/ "./node_modules/lodash-es/_parent.js":
  106505. /*!*******************************************!*\
  106506. !*** ./node_modules/lodash-es/_parent.js ***!
  106507. \*******************************************/
  106508. /*! exports provided: default */
  106509. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  106510. "use strict";
  106511. __webpack_require__.r(__webpack_exports__);
  106512. /* harmony import */ var _baseGet_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseGet.js */ "./node_modules/lodash-es/_baseGet.js");
  106513. /* harmony import */ var _baseSlice_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseSlice.js */ "./node_modules/lodash-es/_baseSlice.js");
  106514. /**
  106515. * Gets the parent value at `path` of `object`.
  106516. *
  106517. * @private
  106518. * @param {Object} object The object to query.
  106519. * @param {Array} path The path to get the parent value of.
  106520. * @returns {*} Returns the parent value.
  106521. */
  106522. function parent(object, path) {
  106523. 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));
  106524. }
  106525. /* harmony default export */ __webpack_exports__["default"] = (parent);
  106526. /***/ }),
  106527. /***/ "./node_modules/lodash-es/_reEscape.js":
  106528. /*!*********************************************!*\
  106529. !*** ./node_modules/lodash-es/_reEscape.js ***!
  106530. \*********************************************/
  106531. /*! exports provided: default */
  106532. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  106533. "use strict";
  106534. __webpack_require__.r(__webpack_exports__);
  106535. /** Used to match template delimiters. */
  106536. var reEscape = /<%-([\s\S]+?)%>/g;
  106537. /* harmony default export */ __webpack_exports__["default"] = (reEscape);
  106538. /***/ }),
  106539. /***/ "./node_modules/lodash-es/_reEvaluate.js":
  106540. /*!***********************************************!*\
  106541. !*** ./node_modules/lodash-es/_reEvaluate.js ***!
  106542. \***********************************************/
  106543. /*! exports provided: default */
  106544. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  106545. "use strict";
  106546. __webpack_require__.r(__webpack_exports__);
  106547. /** Used to match template delimiters. */
  106548. var reEvaluate = /<%([\s\S]+?)%>/g;
  106549. /* harmony default export */ __webpack_exports__["default"] = (reEvaluate);
  106550. /***/ }),
  106551. /***/ "./node_modules/lodash-es/_reInterpolate.js":
  106552. /*!**************************************************!*\
  106553. !*** ./node_modules/lodash-es/_reInterpolate.js ***!
  106554. \**************************************************/
  106555. /*! exports provided: default */
  106556. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  106557. "use strict";
  106558. __webpack_require__.r(__webpack_exports__);
  106559. /** Used to match template delimiters. */
  106560. var reInterpolate = /<%=([\s\S]+?)%>/g;
  106561. /* harmony default export */ __webpack_exports__["default"] = (reInterpolate);
  106562. /***/ }),
  106563. /***/ "./node_modules/lodash-es/_realNames.js":
  106564. /*!**********************************************!*\
  106565. !*** ./node_modules/lodash-es/_realNames.js ***!
  106566. \**********************************************/
  106567. /*! exports provided: default */
  106568. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  106569. "use strict";
  106570. __webpack_require__.r(__webpack_exports__);
  106571. /** Used to lookup unminified function names. */
  106572. var realNames = {};
  106573. /* harmony default export */ __webpack_exports__["default"] = (realNames);
  106574. /***/ }),
  106575. /***/ "./node_modules/lodash-es/_reorder.js":
  106576. /*!********************************************!*\
  106577. !*** ./node_modules/lodash-es/_reorder.js ***!
  106578. \********************************************/
  106579. /*! exports provided: default */
  106580. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  106581. "use strict";
  106582. __webpack_require__.r(__webpack_exports__);
  106583. /* harmony import */ var _copyArray_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_copyArray.js */ "./node_modules/lodash-es/_copyArray.js");
  106584. /* harmony import */ var _isIndex_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_isIndex.js */ "./node_modules/lodash-es/_isIndex.js");
  106585. /* Built-in method references for those with the same name as other `lodash` methods. */
  106586. var nativeMin = Math.min;
  106587. /**
  106588. * Reorder `array` according to the specified indexes where the element at
  106589. * the first index is assigned as the first element, the element at
  106590. * the second index is assigned as the second element, and so on.
  106591. *
  106592. * @private
  106593. * @param {Array} array The array to reorder.
  106594. * @param {Array} indexes The arranged array indexes.
  106595. * @returns {Array} Returns `array`.
  106596. */
  106597. function reorder(array, indexes) {
  106598. var arrLength = array.length,
  106599. length = nativeMin(indexes.length, arrLength),
  106600. oldArray = Object(_copyArray_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array);
  106601. while (length--) {
  106602. var index = indexes[length];
  106603. array[length] = Object(_isIndex_js__WEBPACK_IMPORTED_MODULE_1__["default"])(index, arrLength) ? oldArray[index] : undefined;
  106604. }
  106605. return array;
  106606. }
  106607. /* harmony default export */ __webpack_exports__["default"] = (reorder);
  106608. /***/ }),
  106609. /***/ "./node_modules/lodash-es/_replaceHolders.js":
  106610. /*!***************************************************!*\
  106611. !*** ./node_modules/lodash-es/_replaceHolders.js ***!
  106612. \***************************************************/
  106613. /*! exports provided: default */
  106614. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  106615. "use strict";
  106616. __webpack_require__.r(__webpack_exports__);
  106617. /** Used as the internal argument placeholder. */
  106618. var PLACEHOLDER = '__lodash_placeholder__';
  106619. /**
  106620. * Replaces all `placeholder` elements in `array` with an internal placeholder
  106621. * and returns an array of their indexes.
  106622. *
  106623. * @private
  106624. * @param {Array} array The array to modify.
  106625. * @param {*} placeholder The placeholder to replace.
  106626. * @returns {Array} Returns the new array of placeholder indexes.
  106627. */
  106628. function replaceHolders(array, placeholder) {
  106629. var index = -1,
  106630. length = array.length,
  106631. resIndex = 0,
  106632. result = [];
  106633. while (++index < length) {
  106634. var value = array[index];
  106635. if (value === placeholder || value === PLACEHOLDER) {
  106636. array[index] = PLACEHOLDER;
  106637. result[resIndex++] = index;
  106638. }
  106639. }
  106640. return result;
  106641. }
  106642. /* harmony default export */ __webpack_exports__["default"] = (replaceHolders);
  106643. /***/ }),
  106644. /***/ "./node_modules/lodash-es/_root.js":
  106645. /*!*****************************************!*\
  106646. !*** ./node_modules/lodash-es/_root.js ***!
  106647. \*****************************************/
  106648. /*! exports provided: default */
  106649. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  106650. "use strict";
  106651. __webpack_require__.r(__webpack_exports__);
  106652. /* harmony import */ var _freeGlobal_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_freeGlobal.js */ "./node_modules/lodash-es/_freeGlobal.js");
  106653. /** Detect free variable `self`. */
  106654. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  106655. /** Used as a reference to the global object. */
  106656. var root = _freeGlobal_js__WEBPACK_IMPORTED_MODULE_0__["default"] || freeSelf || Function('return this')();
  106657. /* harmony default export */ __webpack_exports__["default"] = (root);
  106658. /***/ }),
  106659. /***/ "./node_modules/lodash-es/_safeGet.js":
  106660. /*!********************************************!*\
  106661. !*** ./node_modules/lodash-es/_safeGet.js ***!
  106662. \********************************************/
  106663. /*! exports provided: default */
  106664. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  106665. "use strict";
  106666. __webpack_require__.r(__webpack_exports__);
  106667. /**
  106668. * Gets the value at `key`, unless `key` is "__proto__" or "constructor".
  106669. *
  106670. * @private
  106671. * @param {Object} object The object to query.
  106672. * @param {string} key The key of the property to get.
  106673. * @returns {*} Returns the property value.
  106674. */
  106675. function safeGet(object, key) {
  106676. if (key === 'constructor' && typeof object[key] === 'function') {
  106677. return;
  106678. }
  106679. if (key == '__proto__') {
  106680. return;
  106681. }
  106682. return object[key];
  106683. }
  106684. /* harmony default export */ __webpack_exports__["default"] = (safeGet);
  106685. /***/ }),
  106686. /***/ "./node_modules/lodash-es/_setCacheAdd.js":
  106687. /*!************************************************!*\
  106688. !*** ./node_modules/lodash-es/_setCacheAdd.js ***!
  106689. \************************************************/
  106690. /*! exports provided: default */
  106691. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  106692. "use strict";
  106693. __webpack_require__.r(__webpack_exports__);
  106694. /** Used to stand-in for `undefined` hash values. */
  106695. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  106696. /**
  106697. * Adds `value` to the array cache.
  106698. *
  106699. * @private
  106700. * @name add
  106701. * @memberOf SetCache
  106702. * @alias push
  106703. * @param {*} value The value to cache.
  106704. * @returns {Object} Returns the cache instance.
  106705. */
  106706. function setCacheAdd(value) {
  106707. this.__data__.set(value, HASH_UNDEFINED);
  106708. return this;
  106709. }
  106710. /* harmony default export */ __webpack_exports__["default"] = (setCacheAdd);
  106711. /***/ }),
  106712. /***/ "./node_modules/lodash-es/_setCacheHas.js":
  106713. /*!************************************************!*\
  106714. !*** ./node_modules/lodash-es/_setCacheHas.js ***!
  106715. \************************************************/
  106716. /*! exports provided: default */
  106717. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  106718. "use strict";
  106719. __webpack_require__.r(__webpack_exports__);
  106720. /**
  106721. * Checks if `value` is in the array cache.
  106722. *
  106723. * @private
  106724. * @name has
  106725. * @memberOf SetCache
  106726. * @param {*} value The value to search for.
  106727. * @returns {number} Returns `true` if `value` is found, else `false`.
  106728. */
  106729. function setCacheHas(value) {
  106730. return this.__data__.has(value);
  106731. }
  106732. /* harmony default export */ __webpack_exports__["default"] = (setCacheHas);
  106733. /***/ }),
  106734. /***/ "./node_modules/lodash-es/_setData.js":
  106735. /*!********************************************!*\
  106736. !*** ./node_modules/lodash-es/_setData.js ***!
  106737. \********************************************/
  106738. /*! exports provided: default */
  106739. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  106740. "use strict";
  106741. __webpack_require__.r(__webpack_exports__);
  106742. /* harmony import */ var _baseSetData_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseSetData.js */ "./node_modules/lodash-es/_baseSetData.js");
  106743. /* harmony import */ var _shortOut_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_shortOut.js */ "./node_modules/lodash-es/_shortOut.js");
  106744. /**
  106745. * Sets metadata for `func`.
  106746. *
  106747. * **Note:** If this function becomes hot, i.e. is invoked a lot in a short
  106748. * period of time, it will trip its breaker and transition to an identity
  106749. * function to avoid garbage collection pauses in V8. See
  106750. * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070)
  106751. * for more details.
  106752. *
  106753. * @private
  106754. * @param {Function} func The function to associate metadata with.
  106755. * @param {*} data The metadata.
  106756. * @returns {Function} Returns `func`.
  106757. */
  106758. var setData = Object(_shortOut_js__WEBPACK_IMPORTED_MODULE_1__["default"])(_baseSetData_js__WEBPACK_IMPORTED_MODULE_0__["default"]);
  106759. /* harmony default export */ __webpack_exports__["default"] = (setData);
  106760. /***/ }),
  106761. /***/ "./node_modules/lodash-es/_setToArray.js":
  106762. /*!***********************************************!*\
  106763. !*** ./node_modules/lodash-es/_setToArray.js ***!
  106764. \***********************************************/
  106765. /*! exports provided: default */
  106766. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  106767. "use strict";
  106768. __webpack_require__.r(__webpack_exports__);
  106769. /**
  106770. * Converts `set` to an array of its values.
  106771. *
  106772. * @private
  106773. * @param {Object} set The set to convert.
  106774. * @returns {Array} Returns the values.
  106775. */
  106776. function setToArray(set) {
  106777. var index = -1,
  106778. result = Array(set.size);
  106779. set.forEach(function(value) {
  106780. result[++index] = value;
  106781. });
  106782. return result;
  106783. }
  106784. /* harmony default export */ __webpack_exports__["default"] = (setToArray);
  106785. /***/ }),
  106786. /***/ "./node_modules/lodash-es/_setToPairs.js":
  106787. /*!***********************************************!*\
  106788. !*** ./node_modules/lodash-es/_setToPairs.js ***!
  106789. \***********************************************/
  106790. /*! exports provided: default */
  106791. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  106792. "use strict";
  106793. __webpack_require__.r(__webpack_exports__);
  106794. /**
  106795. * Converts `set` to its value-value pairs.
  106796. *
  106797. * @private
  106798. * @param {Object} set The set to convert.
  106799. * @returns {Array} Returns the value-value pairs.
  106800. */
  106801. function setToPairs(set) {
  106802. var index = -1,
  106803. result = Array(set.size);
  106804. set.forEach(function(value) {
  106805. result[++index] = [value, value];
  106806. });
  106807. return result;
  106808. }
  106809. /* harmony default export */ __webpack_exports__["default"] = (setToPairs);
  106810. /***/ }),
  106811. /***/ "./node_modules/lodash-es/_setToString.js":
  106812. /*!************************************************!*\
  106813. !*** ./node_modules/lodash-es/_setToString.js ***!
  106814. \************************************************/
  106815. /*! exports provided: default */
  106816. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  106817. "use strict";
  106818. __webpack_require__.r(__webpack_exports__);
  106819. /* harmony import */ var _baseSetToString_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseSetToString.js */ "./node_modules/lodash-es/_baseSetToString.js");
  106820. /* harmony import */ var _shortOut_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_shortOut.js */ "./node_modules/lodash-es/_shortOut.js");
  106821. /**
  106822. * Sets the `toString` method of `func` to return `string`.
  106823. *
  106824. * @private
  106825. * @param {Function} func The function to modify.
  106826. * @param {Function} string The `toString` result.
  106827. * @returns {Function} Returns `func`.
  106828. */
  106829. var setToString = Object(_shortOut_js__WEBPACK_IMPORTED_MODULE_1__["default"])(_baseSetToString_js__WEBPACK_IMPORTED_MODULE_0__["default"]);
  106830. /* harmony default export */ __webpack_exports__["default"] = (setToString);
  106831. /***/ }),
  106832. /***/ "./node_modules/lodash-es/_setWrapToString.js":
  106833. /*!****************************************************!*\
  106834. !*** ./node_modules/lodash-es/_setWrapToString.js ***!
  106835. \****************************************************/
  106836. /*! exports provided: default */
  106837. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  106838. "use strict";
  106839. __webpack_require__.r(__webpack_exports__);
  106840. /* harmony import */ var _getWrapDetails_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_getWrapDetails.js */ "./node_modules/lodash-es/_getWrapDetails.js");
  106841. /* harmony import */ var _insertWrapDetails_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_insertWrapDetails.js */ "./node_modules/lodash-es/_insertWrapDetails.js");
  106842. /* harmony import */ var _setToString_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_setToString.js */ "./node_modules/lodash-es/_setToString.js");
  106843. /* harmony import */ var _updateWrapDetails_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_updateWrapDetails.js */ "./node_modules/lodash-es/_updateWrapDetails.js");
  106844. /**
  106845. * Sets the `toString` method of `wrapper` to mimic the source of `reference`
  106846. * with wrapper details in a comment at the top of the source body.
  106847. *
  106848. * @private
  106849. * @param {Function} wrapper The function to modify.
  106850. * @param {Function} reference The reference function.
  106851. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  106852. * @returns {Function} Returns `wrapper`.
  106853. */
  106854. function setWrapToString(wrapper, reference, bitmask) {
  106855. var source = (reference + '');
  106856. 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)));
  106857. }
  106858. /* harmony default export */ __webpack_exports__["default"] = (setWrapToString);
  106859. /***/ }),
  106860. /***/ "./node_modules/lodash-es/_shortOut.js":
  106861. /*!*********************************************!*\
  106862. !*** ./node_modules/lodash-es/_shortOut.js ***!
  106863. \*********************************************/
  106864. /*! exports provided: default */
  106865. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  106866. "use strict";
  106867. __webpack_require__.r(__webpack_exports__);
  106868. /** Used to detect hot functions by number of calls within a span of milliseconds. */
  106869. var HOT_COUNT = 800,
  106870. HOT_SPAN = 16;
  106871. /* Built-in method references for those with the same name as other `lodash` methods. */
  106872. var nativeNow = Date.now;
  106873. /**
  106874. * Creates a function that'll short out and invoke `identity` instead
  106875. * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`
  106876. * milliseconds.
  106877. *
  106878. * @private
  106879. * @param {Function} func The function to restrict.
  106880. * @returns {Function} Returns the new shortable function.
  106881. */
  106882. function shortOut(func) {
  106883. var count = 0,
  106884. lastCalled = 0;
  106885. return function() {
  106886. var stamp = nativeNow(),
  106887. remaining = HOT_SPAN - (stamp - lastCalled);
  106888. lastCalled = stamp;
  106889. if (remaining > 0) {
  106890. if (++count >= HOT_COUNT) {
  106891. return arguments[0];
  106892. }
  106893. } else {
  106894. count = 0;
  106895. }
  106896. return func.apply(undefined, arguments);
  106897. };
  106898. }
  106899. /* harmony default export */ __webpack_exports__["default"] = (shortOut);
  106900. /***/ }),
  106901. /***/ "./node_modules/lodash-es/_shuffleSelf.js":
  106902. /*!************************************************!*\
  106903. !*** ./node_modules/lodash-es/_shuffleSelf.js ***!
  106904. \************************************************/
  106905. /*! exports provided: default */
  106906. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  106907. "use strict";
  106908. __webpack_require__.r(__webpack_exports__);
  106909. /* harmony import */ var _baseRandom_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseRandom.js */ "./node_modules/lodash-es/_baseRandom.js");
  106910. /**
  106911. * A specialized version of `_.shuffle` which mutates and sets the size of `array`.
  106912. *
  106913. * @private
  106914. * @param {Array} array The array to shuffle.
  106915. * @param {number} [size=array.length] The size of `array`.
  106916. * @returns {Array} Returns `array`.
  106917. */
  106918. function shuffleSelf(array, size) {
  106919. var index = -1,
  106920. length = array.length,
  106921. lastIndex = length - 1;
  106922. size = size === undefined ? length : size;
  106923. while (++index < size) {
  106924. var rand = Object(_baseRandom_js__WEBPACK_IMPORTED_MODULE_0__["default"])(index, lastIndex),
  106925. value = array[rand];
  106926. array[rand] = array[index];
  106927. array[index] = value;
  106928. }
  106929. array.length = size;
  106930. return array;
  106931. }
  106932. /* harmony default export */ __webpack_exports__["default"] = (shuffleSelf);
  106933. /***/ }),
  106934. /***/ "./node_modules/lodash-es/_stackClear.js":
  106935. /*!***********************************************!*\
  106936. !*** ./node_modules/lodash-es/_stackClear.js ***!
  106937. \***********************************************/
  106938. /*! exports provided: default */
  106939. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  106940. "use strict";
  106941. __webpack_require__.r(__webpack_exports__);
  106942. /* harmony import */ var _ListCache_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_ListCache.js */ "./node_modules/lodash-es/_ListCache.js");
  106943. /**
  106944. * Removes all key-value entries from the stack.
  106945. *
  106946. * @private
  106947. * @name clear
  106948. * @memberOf Stack
  106949. */
  106950. function stackClear() {
  106951. this.__data__ = new _ListCache_js__WEBPACK_IMPORTED_MODULE_0__["default"];
  106952. this.size = 0;
  106953. }
  106954. /* harmony default export */ __webpack_exports__["default"] = (stackClear);
  106955. /***/ }),
  106956. /***/ "./node_modules/lodash-es/_stackDelete.js":
  106957. /*!************************************************!*\
  106958. !*** ./node_modules/lodash-es/_stackDelete.js ***!
  106959. \************************************************/
  106960. /*! exports provided: default */
  106961. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  106962. "use strict";
  106963. __webpack_require__.r(__webpack_exports__);
  106964. /**
  106965. * Removes `key` and its value from the stack.
  106966. *
  106967. * @private
  106968. * @name delete
  106969. * @memberOf Stack
  106970. * @param {string} key The key of the value to remove.
  106971. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  106972. */
  106973. function stackDelete(key) {
  106974. var data = this.__data__,
  106975. result = data['delete'](key);
  106976. this.size = data.size;
  106977. return result;
  106978. }
  106979. /* harmony default export */ __webpack_exports__["default"] = (stackDelete);
  106980. /***/ }),
  106981. /***/ "./node_modules/lodash-es/_stackGet.js":
  106982. /*!*********************************************!*\
  106983. !*** ./node_modules/lodash-es/_stackGet.js ***!
  106984. \*********************************************/
  106985. /*! exports provided: default */
  106986. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  106987. "use strict";
  106988. __webpack_require__.r(__webpack_exports__);
  106989. /**
  106990. * Gets the stack value for `key`.
  106991. *
  106992. * @private
  106993. * @name get
  106994. * @memberOf Stack
  106995. * @param {string} key The key of the value to get.
  106996. * @returns {*} Returns the entry value.
  106997. */
  106998. function stackGet(key) {
  106999. return this.__data__.get(key);
  107000. }
  107001. /* harmony default export */ __webpack_exports__["default"] = (stackGet);
  107002. /***/ }),
  107003. /***/ "./node_modules/lodash-es/_stackHas.js":
  107004. /*!*********************************************!*\
  107005. !*** ./node_modules/lodash-es/_stackHas.js ***!
  107006. \*********************************************/
  107007. /*! exports provided: default */
  107008. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  107009. "use strict";
  107010. __webpack_require__.r(__webpack_exports__);
  107011. /**
  107012. * Checks if a stack value for `key` exists.
  107013. *
  107014. * @private
  107015. * @name has
  107016. * @memberOf Stack
  107017. * @param {string} key The key of the entry to check.
  107018. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  107019. */
  107020. function stackHas(key) {
  107021. return this.__data__.has(key);
  107022. }
  107023. /* harmony default export */ __webpack_exports__["default"] = (stackHas);
  107024. /***/ }),
  107025. /***/ "./node_modules/lodash-es/_stackSet.js":
  107026. /*!*********************************************!*\
  107027. !*** ./node_modules/lodash-es/_stackSet.js ***!
  107028. \*********************************************/
  107029. /*! exports provided: default */
  107030. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  107031. "use strict";
  107032. __webpack_require__.r(__webpack_exports__);
  107033. /* harmony import */ var _ListCache_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_ListCache.js */ "./node_modules/lodash-es/_ListCache.js");
  107034. /* harmony import */ var _Map_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_Map.js */ "./node_modules/lodash-es/_Map.js");
  107035. /* harmony import */ var _MapCache_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_MapCache.js */ "./node_modules/lodash-es/_MapCache.js");
  107036. /** Used as the size to enable large array optimizations. */
  107037. var LARGE_ARRAY_SIZE = 200;
  107038. /**
  107039. * Sets the stack `key` to `value`.
  107040. *
  107041. * @private
  107042. * @name set
  107043. * @memberOf Stack
  107044. * @param {string} key The key of the value to set.
  107045. * @param {*} value The value to set.
  107046. * @returns {Object} Returns the stack cache instance.
  107047. */
  107048. function stackSet(key, value) {
  107049. var data = this.__data__;
  107050. if (data instanceof _ListCache_js__WEBPACK_IMPORTED_MODULE_0__["default"]) {
  107051. var pairs = data.__data__;
  107052. if (!_Map_js__WEBPACK_IMPORTED_MODULE_1__["default"] || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
  107053. pairs.push([key, value]);
  107054. this.size = ++data.size;
  107055. return this;
  107056. }
  107057. data = this.__data__ = new _MapCache_js__WEBPACK_IMPORTED_MODULE_2__["default"](pairs);
  107058. }
  107059. data.set(key, value);
  107060. this.size = data.size;
  107061. return this;
  107062. }
  107063. /* harmony default export */ __webpack_exports__["default"] = (stackSet);
  107064. /***/ }),
  107065. /***/ "./node_modules/lodash-es/_strictIndexOf.js":
  107066. /*!**************************************************!*\
  107067. !*** ./node_modules/lodash-es/_strictIndexOf.js ***!
  107068. \**************************************************/
  107069. /*! exports provided: default */
  107070. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  107071. "use strict";
  107072. __webpack_require__.r(__webpack_exports__);
  107073. /**
  107074. * A specialized version of `_.indexOf` which performs strict equality
  107075. * comparisons of values, i.e. `===`.
  107076. *
  107077. * @private
  107078. * @param {Array} array The array to inspect.
  107079. * @param {*} value The value to search for.
  107080. * @param {number} fromIndex The index to search from.
  107081. * @returns {number} Returns the index of the matched value, else `-1`.
  107082. */
  107083. function strictIndexOf(array, value, fromIndex) {
  107084. var index = fromIndex - 1,
  107085. length = array.length;
  107086. while (++index < length) {
  107087. if (array[index] === value) {
  107088. return index;
  107089. }
  107090. }
  107091. return -1;
  107092. }
  107093. /* harmony default export */ __webpack_exports__["default"] = (strictIndexOf);
  107094. /***/ }),
  107095. /***/ "./node_modules/lodash-es/_strictLastIndexOf.js":
  107096. /*!******************************************************!*\
  107097. !*** ./node_modules/lodash-es/_strictLastIndexOf.js ***!
  107098. \******************************************************/
  107099. /*! exports provided: default */
  107100. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  107101. "use strict";
  107102. __webpack_require__.r(__webpack_exports__);
  107103. /**
  107104. * A specialized version of `_.lastIndexOf` which performs strict equality
  107105. * comparisons of values, i.e. `===`.
  107106. *
  107107. * @private
  107108. * @param {Array} array The array to inspect.
  107109. * @param {*} value The value to search for.
  107110. * @param {number} fromIndex The index to search from.
  107111. * @returns {number} Returns the index of the matched value, else `-1`.
  107112. */
  107113. function strictLastIndexOf(array, value, fromIndex) {
  107114. var index = fromIndex + 1;
  107115. while (index--) {
  107116. if (array[index] === value) {
  107117. return index;
  107118. }
  107119. }
  107120. return index;
  107121. }
  107122. /* harmony default export */ __webpack_exports__["default"] = (strictLastIndexOf);
  107123. /***/ }),
  107124. /***/ "./node_modules/lodash-es/_stringSize.js":
  107125. /*!***********************************************!*\
  107126. !*** ./node_modules/lodash-es/_stringSize.js ***!
  107127. \***********************************************/
  107128. /*! exports provided: default */
  107129. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  107130. "use strict";
  107131. __webpack_require__.r(__webpack_exports__);
  107132. /* harmony import */ var _asciiSize_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_asciiSize.js */ "./node_modules/lodash-es/_asciiSize.js");
  107133. /* harmony import */ var _hasUnicode_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_hasUnicode.js */ "./node_modules/lodash-es/_hasUnicode.js");
  107134. /* harmony import */ var _unicodeSize_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_unicodeSize.js */ "./node_modules/lodash-es/_unicodeSize.js");
  107135. /**
  107136. * Gets the number of symbols in `string`.
  107137. *
  107138. * @private
  107139. * @param {string} string The string to inspect.
  107140. * @returns {number} Returns the string size.
  107141. */
  107142. function stringSize(string) {
  107143. return Object(_hasUnicode_js__WEBPACK_IMPORTED_MODULE_1__["default"])(string)
  107144. ? Object(_unicodeSize_js__WEBPACK_IMPORTED_MODULE_2__["default"])(string)
  107145. : Object(_asciiSize_js__WEBPACK_IMPORTED_MODULE_0__["default"])(string);
  107146. }
  107147. /* harmony default export */ __webpack_exports__["default"] = (stringSize);
  107148. /***/ }),
  107149. /***/ "./node_modules/lodash-es/_stringToArray.js":
  107150. /*!**************************************************!*\
  107151. !*** ./node_modules/lodash-es/_stringToArray.js ***!
  107152. \**************************************************/
  107153. /*! exports provided: default */
  107154. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  107155. "use strict";
  107156. __webpack_require__.r(__webpack_exports__);
  107157. /* harmony import */ var _asciiToArray_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_asciiToArray.js */ "./node_modules/lodash-es/_asciiToArray.js");
  107158. /* harmony import */ var _hasUnicode_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_hasUnicode.js */ "./node_modules/lodash-es/_hasUnicode.js");
  107159. /* harmony import */ var _unicodeToArray_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_unicodeToArray.js */ "./node_modules/lodash-es/_unicodeToArray.js");
  107160. /**
  107161. * Converts `string` to an array.
  107162. *
  107163. * @private
  107164. * @param {string} string The string to convert.
  107165. * @returns {Array} Returns the converted array.
  107166. */
  107167. function stringToArray(string) {
  107168. return Object(_hasUnicode_js__WEBPACK_IMPORTED_MODULE_1__["default"])(string)
  107169. ? Object(_unicodeToArray_js__WEBPACK_IMPORTED_MODULE_2__["default"])(string)
  107170. : Object(_asciiToArray_js__WEBPACK_IMPORTED_MODULE_0__["default"])(string);
  107171. }
  107172. /* harmony default export */ __webpack_exports__["default"] = (stringToArray);
  107173. /***/ }),
  107174. /***/ "./node_modules/lodash-es/_stringToPath.js":
  107175. /*!*************************************************!*\
  107176. !*** ./node_modules/lodash-es/_stringToPath.js ***!
  107177. \*************************************************/
  107178. /*! exports provided: default */
  107179. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  107180. "use strict";
  107181. __webpack_require__.r(__webpack_exports__);
  107182. /* harmony import */ var _memoizeCapped_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_memoizeCapped.js */ "./node_modules/lodash-es/_memoizeCapped.js");
  107183. /** Used to match property names within property paths. */
  107184. var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
  107185. /** Used to match backslashes in property paths. */
  107186. var reEscapeChar = /\\(\\)?/g;
  107187. /**
  107188. * Converts `string` to a property path array.
  107189. *
  107190. * @private
  107191. * @param {string} string The string to convert.
  107192. * @returns {Array} Returns the property path array.
  107193. */
  107194. var stringToPath = Object(_memoizeCapped_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function(string) {
  107195. var result = [];
  107196. if (string.charCodeAt(0) === 46 /* . */) {
  107197. result.push('');
  107198. }
  107199. string.replace(rePropName, function(match, number, quote, subString) {
  107200. result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));
  107201. });
  107202. return result;
  107203. });
  107204. /* harmony default export */ __webpack_exports__["default"] = (stringToPath);
  107205. /***/ }),
  107206. /***/ "./node_modules/lodash-es/_toKey.js":
  107207. /*!******************************************!*\
  107208. !*** ./node_modules/lodash-es/_toKey.js ***!
  107209. \******************************************/
  107210. /*! exports provided: default */
  107211. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  107212. "use strict";
  107213. __webpack_require__.r(__webpack_exports__);
  107214. /* harmony import */ var _isSymbol_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isSymbol.js */ "./node_modules/lodash-es/isSymbol.js");
  107215. /** Used as references for various `Number` constants. */
  107216. var INFINITY = 1 / 0;
  107217. /**
  107218. * Converts `value` to a string key if it's not a string or symbol.
  107219. *
  107220. * @private
  107221. * @param {*} value The value to inspect.
  107222. * @returns {string|symbol} Returns the key.
  107223. */
  107224. function toKey(value) {
  107225. if (typeof value == 'string' || Object(_isSymbol_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value)) {
  107226. return value;
  107227. }
  107228. var result = (value + '');
  107229. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  107230. }
  107231. /* harmony default export */ __webpack_exports__["default"] = (toKey);
  107232. /***/ }),
  107233. /***/ "./node_modules/lodash-es/_toSource.js":
  107234. /*!*********************************************!*\
  107235. !*** ./node_modules/lodash-es/_toSource.js ***!
  107236. \*********************************************/
  107237. /*! exports provided: default */
  107238. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  107239. "use strict";
  107240. __webpack_require__.r(__webpack_exports__);
  107241. /** Used for built-in method references. */
  107242. var funcProto = Function.prototype;
  107243. /** Used to resolve the decompiled source of functions. */
  107244. var funcToString = funcProto.toString;
  107245. /**
  107246. * Converts `func` to its source code.
  107247. *
  107248. * @private
  107249. * @param {Function} func The function to convert.
  107250. * @returns {string} Returns the source code.
  107251. */
  107252. function toSource(func) {
  107253. if (func != null) {
  107254. try {
  107255. return funcToString.call(func);
  107256. } catch (e) {}
  107257. try {
  107258. return (func + '');
  107259. } catch (e) {}
  107260. }
  107261. return '';
  107262. }
  107263. /* harmony default export */ __webpack_exports__["default"] = (toSource);
  107264. /***/ }),
  107265. /***/ "./node_modules/lodash-es/_trimmedEndIndex.js":
  107266. /*!****************************************************!*\
  107267. !*** ./node_modules/lodash-es/_trimmedEndIndex.js ***!
  107268. \****************************************************/
  107269. /*! exports provided: default */
  107270. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  107271. "use strict";
  107272. __webpack_require__.r(__webpack_exports__);
  107273. /** Used to match a single whitespace character. */
  107274. var reWhitespace = /\s/;
  107275. /**
  107276. * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace
  107277. * character of `string`.
  107278. *
  107279. * @private
  107280. * @param {string} string The string to inspect.
  107281. * @returns {number} Returns the index of the last non-whitespace character.
  107282. */
  107283. function trimmedEndIndex(string) {
  107284. var index = string.length;
  107285. while (index-- && reWhitespace.test(string.charAt(index))) {}
  107286. return index;
  107287. }
  107288. /* harmony default export */ __webpack_exports__["default"] = (trimmedEndIndex);
  107289. /***/ }),
  107290. /***/ "./node_modules/lodash-es/_unescapeHtmlChar.js":
  107291. /*!*****************************************************!*\
  107292. !*** ./node_modules/lodash-es/_unescapeHtmlChar.js ***!
  107293. \*****************************************************/
  107294. /*! exports provided: default */
  107295. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  107296. "use strict";
  107297. __webpack_require__.r(__webpack_exports__);
  107298. /* harmony import */ var _basePropertyOf_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_basePropertyOf.js */ "./node_modules/lodash-es/_basePropertyOf.js");
  107299. /** Used to map HTML entities to characters. */
  107300. var htmlUnescapes = {
  107301. '&amp;': '&',
  107302. '&lt;': '<',
  107303. '&gt;': '>',
  107304. '&quot;': '"',
  107305. '&#39;': "'"
  107306. };
  107307. /**
  107308. * Used by `_.unescape` to convert HTML entities to characters.
  107309. *
  107310. * @private
  107311. * @param {string} chr The matched character to unescape.
  107312. * @returns {string} Returns the unescaped character.
  107313. */
  107314. var unescapeHtmlChar = Object(_basePropertyOf_js__WEBPACK_IMPORTED_MODULE_0__["default"])(htmlUnescapes);
  107315. /* harmony default export */ __webpack_exports__["default"] = (unescapeHtmlChar);
  107316. /***/ }),
  107317. /***/ "./node_modules/lodash-es/_unicodeSize.js":
  107318. /*!************************************************!*\
  107319. !*** ./node_modules/lodash-es/_unicodeSize.js ***!
  107320. \************************************************/
  107321. /*! exports provided: default */
  107322. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  107323. "use strict";
  107324. __webpack_require__.r(__webpack_exports__);
  107325. /** Used to compose unicode character classes. */
  107326. var rsAstralRange = '\\ud800-\\udfff',
  107327. rsComboMarksRange = '\\u0300-\\u036f',
  107328. reComboHalfMarksRange = '\\ufe20-\\ufe2f',
  107329. rsComboSymbolsRange = '\\u20d0-\\u20ff',
  107330. rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,
  107331. rsVarRange = '\\ufe0e\\ufe0f';
  107332. /** Used to compose unicode capture groups. */
  107333. var rsAstral = '[' + rsAstralRange + ']',
  107334. rsCombo = '[' + rsComboRange + ']',
  107335. rsFitz = '\\ud83c[\\udffb-\\udfff]',
  107336. rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',
  107337. rsNonAstral = '[^' + rsAstralRange + ']',
  107338. rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}',
  107339. rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]',
  107340. rsZWJ = '\\u200d';
  107341. /** Used to compose unicode regexes. */
  107342. var reOptMod = rsModifier + '?',
  107343. rsOptVar = '[' + rsVarRange + ']?',
  107344. rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',
  107345. rsSeq = rsOptVar + reOptMod + rsOptJoin,
  107346. rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';
  107347. /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */
  107348. var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');
  107349. /**
  107350. * Gets the size of a Unicode `string`.
  107351. *
  107352. * @private
  107353. * @param {string} string The string inspect.
  107354. * @returns {number} Returns the string size.
  107355. */
  107356. function unicodeSize(string) {
  107357. var result = reUnicode.lastIndex = 0;
  107358. while (reUnicode.test(string)) {
  107359. ++result;
  107360. }
  107361. return result;
  107362. }
  107363. /* harmony default export */ __webpack_exports__["default"] = (unicodeSize);
  107364. /***/ }),
  107365. /***/ "./node_modules/lodash-es/_unicodeToArray.js":
  107366. /*!***************************************************!*\
  107367. !*** ./node_modules/lodash-es/_unicodeToArray.js ***!
  107368. \***************************************************/
  107369. /*! exports provided: default */
  107370. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  107371. "use strict";
  107372. __webpack_require__.r(__webpack_exports__);
  107373. /** Used to compose unicode character classes. */
  107374. var rsAstralRange = '\\ud800-\\udfff',
  107375. rsComboMarksRange = '\\u0300-\\u036f',
  107376. reComboHalfMarksRange = '\\ufe20-\\ufe2f',
  107377. rsComboSymbolsRange = '\\u20d0-\\u20ff',
  107378. rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,
  107379. rsVarRange = '\\ufe0e\\ufe0f';
  107380. /** Used to compose unicode capture groups. */
  107381. var rsAstral = '[' + rsAstralRange + ']',
  107382. rsCombo = '[' + rsComboRange + ']',
  107383. rsFitz = '\\ud83c[\\udffb-\\udfff]',
  107384. rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',
  107385. rsNonAstral = '[^' + rsAstralRange + ']',
  107386. rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}',
  107387. rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]',
  107388. rsZWJ = '\\u200d';
  107389. /** Used to compose unicode regexes. */
  107390. var reOptMod = rsModifier + '?',
  107391. rsOptVar = '[' + rsVarRange + ']?',
  107392. rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',
  107393. rsSeq = rsOptVar + reOptMod + rsOptJoin,
  107394. rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';
  107395. /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */
  107396. var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');
  107397. /**
  107398. * Converts a Unicode `string` to an array.
  107399. *
  107400. * @private
  107401. * @param {string} string The string to convert.
  107402. * @returns {Array} Returns the converted array.
  107403. */
  107404. function unicodeToArray(string) {
  107405. return string.match(reUnicode) || [];
  107406. }
  107407. /* harmony default export */ __webpack_exports__["default"] = (unicodeToArray);
  107408. /***/ }),
  107409. /***/ "./node_modules/lodash-es/_unicodeWords.js":
  107410. /*!*************************************************!*\
  107411. !*** ./node_modules/lodash-es/_unicodeWords.js ***!
  107412. \*************************************************/
  107413. /*! exports provided: default */
  107414. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  107415. "use strict";
  107416. __webpack_require__.r(__webpack_exports__);
  107417. /** Used to compose unicode character classes. */
  107418. var rsAstralRange = '\\ud800-\\udfff',
  107419. rsComboMarksRange = '\\u0300-\\u036f',
  107420. reComboHalfMarksRange = '\\ufe20-\\ufe2f',
  107421. rsComboSymbolsRange = '\\u20d0-\\u20ff',
  107422. rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,
  107423. rsDingbatRange = '\\u2700-\\u27bf',
  107424. rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff',
  107425. rsMathOpRange = '\\xac\\xb1\\xd7\\xf7',
  107426. rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf',
  107427. rsPunctuationRange = '\\u2000-\\u206f',
  107428. 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',
  107429. rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde',
  107430. rsVarRange = '\\ufe0e\\ufe0f',
  107431. rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;
  107432. /** Used to compose unicode capture groups. */
  107433. var rsApos = "['\u2019]",
  107434. rsBreak = '[' + rsBreakRange + ']',
  107435. rsCombo = '[' + rsComboRange + ']',
  107436. rsDigits = '\\d+',
  107437. rsDingbat = '[' + rsDingbatRange + ']',
  107438. rsLower = '[' + rsLowerRange + ']',
  107439. rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']',
  107440. rsFitz = '\\ud83c[\\udffb-\\udfff]',
  107441. rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',
  107442. rsNonAstral = '[^' + rsAstralRange + ']',
  107443. rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}',
  107444. rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]',
  107445. rsUpper = '[' + rsUpperRange + ']',
  107446. rsZWJ = '\\u200d';
  107447. /** Used to compose unicode regexes. */
  107448. var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')',
  107449. rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')',
  107450. rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?',
  107451. rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?',
  107452. reOptMod = rsModifier + '?',
  107453. rsOptVar = '[' + rsVarRange + ']?',
  107454. rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',
  107455. rsOrdLower = '\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])',
  107456. rsOrdUpper = '\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])',
  107457. rsSeq = rsOptVar + reOptMod + rsOptJoin,
  107458. rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq;
  107459. /** Used to match complex or compound words. */
  107460. var reUnicodeWord = RegExp([
  107461. rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')',
  107462. rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')',
  107463. rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower,
  107464. rsUpper + '+' + rsOptContrUpper,
  107465. rsOrdUpper,
  107466. rsOrdLower,
  107467. rsDigits,
  107468. rsEmoji
  107469. ].join('|'), 'g');
  107470. /**
  107471. * Splits a Unicode `string` into an array of its words.
  107472. *
  107473. * @private
  107474. * @param {string} The string to inspect.
  107475. * @returns {Array} Returns the words of `string`.
  107476. */
  107477. function unicodeWords(string) {
  107478. return string.match(reUnicodeWord) || [];
  107479. }
  107480. /* harmony default export */ __webpack_exports__["default"] = (unicodeWords);
  107481. /***/ }),
  107482. /***/ "./node_modules/lodash-es/_updateWrapDetails.js":
  107483. /*!******************************************************!*\
  107484. !*** ./node_modules/lodash-es/_updateWrapDetails.js ***!
  107485. \******************************************************/
  107486. /*! exports provided: default */
  107487. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  107488. "use strict";
  107489. __webpack_require__.r(__webpack_exports__);
  107490. /* harmony import */ var _arrayEach_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayEach.js */ "./node_modules/lodash-es/_arrayEach.js");
  107491. /* harmony import */ var _arrayIncludes_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_arrayIncludes.js */ "./node_modules/lodash-es/_arrayIncludes.js");
  107492. /** Used to compose bitmasks for function metadata. */
  107493. var WRAP_BIND_FLAG = 1,
  107494. WRAP_BIND_KEY_FLAG = 2,
  107495. WRAP_CURRY_FLAG = 8,
  107496. WRAP_CURRY_RIGHT_FLAG = 16,
  107497. WRAP_PARTIAL_FLAG = 32,
  107498. WRAP_PARTIAL_RIGHT_FLAG = 64,
  107499. WRAP_ARY_FLAG = 128,
  107500. WRAP_REARG_FLAG = 256,
  107501. WRAP_FLIP_FLAG = 512;
  107502. /** Used to associate wrap methods with their bit flags. */
  107503. var wrapFlags = [
  107504. ['ary', WRAP_ARY_FLAG],
  107505. ['bind', WRAP_BIND_FLAG],
  107506. ['bindKey', WRAP_BIND_KEY_FLAG],
  107507. ['curry', WRAP_CURRY_FLAG],
  107508. ['curryRight', WRAP_CURRY_RIGHT_FLAG],
  107509. ['flip', WRAP_FLIP_FLAG],
  107510. ['partial', WRAP_PARTIAL_FLAG],
  107511. ['partialRight', WRAP_PARTIAL_RIGHT_FLAG],
  107512. ['rearg', WRAP_REARG_FLAG]
  107513. ];
  107514. /**
  107515. * Updates wrapper `details` based on `bitmask` flags.
  107516. *
  107517. * @private
  107518. * @returns {Array} details The details to modify.
  107519. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  107520. * @returns {Array} Returns `details`.
  107521. */
  107522. function updateWrapDetails(details, bitmask) {
  107523. Object(_arrayEach_js__WEBPACK_IMPORTED_MODULE_0__["default"])(wrapFlags, function(pair) {
  107524. var value = '_.' + pair[0];
  107525. if ((bitmask & pair[1]) && !Object(_arrayIncludes_js__WEBPACK_IMPORTED_MODULE_1__["default"])(details, value)) {
  107526. details.push(value);
  107527. }
  107528. });
  107529. return details.sort();
  107530. }
  107531. /* harmony default export */ __webpack_exports__["default"] = (updateWrapDetails);
  107532. /***/ }),
  107533. /***/ "./node_modules/lodash-es/_wrapperClone.js":
  107534. /*!*************************************************!*\
  107535. !*** ./node_modules/lodash-es/_wrapperClone.js ***!
  107536. \*************************************************/
  107537. /*! exports provided: default */
  107538. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  107539. "use strict";
  107540. __webpack_require__.r(__webpack_exports__);
  107541. /* harmony import */ var _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_LazyWrapper.js */ "./node_modules/lodash-es/_LazyWrapper.js");
  107542. /* harmony import */ var _LodashWrapper_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_LodashWrapper.js */ "./node_modules/lodash-es/_LodashWrapper.js");
  107543. /* harmony import */ var _copyArray_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_copyArray.js */ "./node_modules/lodash-es/_copyArray.js");
  107544. /**
  107545. * Creates a clone of `wrapper`.
  107546. *
  107547. * @private
  107548. * @param {Object} wrapper The wrapper to clone.
  107549. * @returns {Object} Returns the cloned wrapper.
  107550. */
  107551. function wrapperClone(wrapper) {
  107552. if (wrapper instanceof _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_0__["default"]) {
  107553. return wrapper.clone();
  107554. }
  107555. var result = new _LodashWrapper_js__WEBPACK_IMPORTED_MODULE_1__["default"](wrapper.__wrapped__, wrapper.__chain__);
  107556. result.__actions__ = Object(_copyArray_js__WEBPACK_IMPORTED_MODULE_2__["default"])(wrapper.__actions__);
  107557. result.__index__ = wrapper.__index__;
  107558. result.__values__ = wrapper.__values__;
  107559. return result;
  107560. }
  107561. /* harmony default export */ __webpack_exports__["default"] = (wrapperClone);
  107562. /***/ }),
  107563. /***/ "./node_modules/lodash-es/add.js":
  107564. /*!***************************************!*\
  107565. !*** ./node_modules/lodash-es/add.js ***!
  107566. \***************************************/
  107567. /*! exports provided: default */
  107568. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  107569. "use strict";
  107570. __webpack_require__.r(__webpack_exports__);
  107571. /* harmony import */ var _createMathOperation_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createMathOperation.js */ "./node_modules/lodash-es/_createMathOperation.js");
  107572. /**
  107573. * Adds two numbers.
  107574. *
  107575. * @static
  107576. * @memberOf _
  107577. * @since 3.4.0
  107578. * @category Math
  107579. * @param {number} augend The first number in an addition.
  107580. * @param {number} addend The second number in an addition.
  107581. * @returns {number} Returns the total.
  107582. * @example
  107583. *
  107584. * _.add(6, 4);
  107585. * // => 10
  107586. */
  107587. var add = Object(_createMathOperation_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function(augend, addend) {
  107588. return augend + addend;
  107589. }, 0);
  107590. /* harmony default export */ __webpack_exports__["default"] = (add);
  107591. /***/ }),
  107592. /***/ "./node_modules/lodash-es/after.js":
  107593. /*!*****************************************!*\
  107594. !*** ./node_modules/lodash-es/after.js ***!
  107595. \*****************************************/
  107596. /*! exports provided: default */
  107597. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  107598. "use strict";
  107599. __webpack_require__.r(__webpack_exports__);
  107600. /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
  107601. /** Error message constants. */
  107602. var FUNC_ERROR_TEXT = 'Expected a function';
  107603. /**
  107604. * The opposite of `_.before`; this method creates a function that invokes
  107605. * `func` once it's called `n` or more times.
  107606. *
  107607. * @static
  107608. * @memberOf _
  107609. * @since 0.1.0
  107610. * @category Function
  107611. * @param {number} n The number of calls before `func` is invoked.
  107612. * @param {Function} func The function to restrict.
  107613. * @returns {Function} Returns the new restricted function.
  107614. * @example
  107615. *
  107616. * var saves = ['profile', 'settings'];
  107617. *
  107618. * var done = _.after(saves.length, function() {
  107619. * console.log('done saving!');
  107620. * });
  107621. *
  107622. * _.forEach(saves, function(type) {
  107623. * asyncSave({ 'type': type, 'complete': done });
  107624. * });
  107625. * // => Logs 'done saving!' after the two async saves have completed.
  107626. */
  107627. function after(n, func) {
  107628. if (typeof func != 'function') {
  107629. throw new TypeError(FUNC_ERROR_TEXT);
  107630. }
  107631. n = Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_0__["default"])(n);
  107632. return function() {
  107633. if (--n < 1) {
  107634. return func.apply(this, arguments);
  107635. }
  107636. };
  107637. }
  107638. /* harmony default export */ __webpack_exports__["default"] = (after);
  107639. /***/ }),
  107640. /***/ "./node_modules/lodash-es/array.default.js":
  107641. /*!*************************************************!*\
  107642. !*** ./node_modules/lodash-es/array.default.js ***!
  107643. \*************************************************/
  107644. /*! exports provided: default */
  107645. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  107646. "use strict";
  107647. __webpack_require__.r(__webpack_exports__);
  107648. /* harmony import */ var _chunk_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./chunk.js */ "./node_modules/lodash-es/chunk.js");
  107649. /* harmony import */ var _compact_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./compact.js */ "./node_modules/lodash-es/compact.js");
  107650. /* harmony import */ var _concat_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./concat.js */ "./node_modules/lodash-es/concat.js");
  107651. /* harmony import */ var _difference_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./difference.js */ "./node_modules/lodash-es/difference.js");
  107652. /* harmony import */ var _differenceBy_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./differenceBy.js */ "./node_modules/lodash-es/differenceBy.js");
  107653. /* harmony import */ var _differenceWith_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./differenceWith.js */ "./node_modules/lodash-es/differenceWith.js");
  107654. /* harmony import */ var _drop_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./drop.js */ "./node_modules/lodash-es/drop.js");
  107655. /* harmony import */ var _dropRight_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./dropRight.js */ "./node_modules/lodash-es/dropRight.js");
  107656. /* harmony import */ var _dropRightWhile_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./dropRightWhile.js */ "./node_modules/lodash-es/dropRightWhile.js");
  107657. /* harmony import */ var _dropWhile_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./dropWhile.js */ "./node_modules/lodash-es/dropWhile.js");
  107658. /* harmony import */ var _fill_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./fill.js */ "./node_modules/lodash-es/fill.js");
  107659. /* harmony import */ var _findIndex_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./findIndex.js */ "./node_modules/lodash-es/findIndex.js");
  107660. /* harmony import */ var _findLastIndex_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./findLastIndex.js */ "./node_modules/lodash-es/findLastIndex.js");
  107661. /* harmony import */ var _first_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./first.js */ "./node_modules/lodash-es/first.js");
  107662. /* harmony import */ var _flatten_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./flatten.js */ "./node_modules/lodash-es/flatten.js");
  107663. /* harmony import */ var _flattenDeep_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./flattenDeep.js */ "./node_modules/lodash-es/flattenDeep.js");
  107664. /* harmony import */ var _flattenDepth_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./flattenDepth.js */ "./node_modules/lodash-es/flattenDepth.js");
  107665. /* harmony import */ var _fromPairs_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./fromPairs.js */ "./node_modules/lodash-es/fromPairs.js");
  107666. /* harmony import */ var _head_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./head.js */ "./node_modules/lodash-es/head.js");
  107667. /* harmony import */ var _indexOf_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./indexOf.js */ "./node_modules/lodash-es/indexOf.js");
  107668. /* harmony import */ var _initial_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./initial.js */ "./node_modules/lodash-es/initial.js");
  107669. /* harmony import */ var _intersection_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./intersection.js */ "./node_modules/lodash-es/intersection.js");
  107670. /* harmony import */ var _intersectionBy_js__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./intersectionBy.js */ "./node_modules/lodash-es/intersectionBy.js");
  107671. /* harmony import */ var _intersectionWith_js__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./intersectionWith.js */ "./node_modules/lodash-es/intersectionWith.js");
  107672. /* harmony import */ var _join_js__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./join.js */ "./node_modules/lodash-es/join.js");
  107673. /* harmony import */ var _last_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./last.js */ "./node_modules/lodash-es/last.js");
  107674. /* harmony import */ var _lastIndexOf_js__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./lastIndexOf.js */ "./node_modules/lodash-es/lastIndexOf.js");
  107675. /* harmony import */ var _nth_js__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./nth.js */ "./node_modules/lodash-es/nth.js");
  107676. /* harmony import */ var _pull_js__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./pull.js */ "./node_modules/lodash-es/pull.js");
  107677. /* harmony import */ var _pullAll_js__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./pullAll.js */ "./node_modules/lodash-es/pullAll.js");
  107678. /* harmony import */ var _pullAllBy_js__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./pullAllBy.js */ "./node_modules/lodash-es/pullAllBy.js");
  107679. /* harmony import */ var _pullAllWith_js__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ./pullAllWith.js */ "./node_modules/lodash-es/pullAllWith.js");
  107680. /* harmony import */ var _pullAt_js__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ./pullAt.js */ "./node_modules/lodash-es/pullAt.js");
  107681. /* harmony import */ var _remove_js__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ./remove.js */ "./node_modules/lodash-es/remove.js");
  107682. /* harmony import */ var _reverse_js__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ./reverse.js */ "./node_modules/lodash-es/reverse.js");
  107683. /* harmony import */ var _slice_js__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ./slice.js */ "./node_modules/lodash-es/slice.js");
  107684. /* harmony import */ var _sortedIndex_js__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! ./sortedIndex.js */ "./node_modules/lodash-es/sortedIndex.js");
  107685. /* harmony import */ var _sortedIndexBy_js__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(/*! ./sortedIndexBy.js */ "./node_modules/lodash-es/sortedIndexBy.js");
  107686. /* harmony import */ var _sortedIndexOf_js__WEBPACK_IMPORTED_MODULE_38__ = __webpack_require__(/*! ./sortedIndexOf.js */ "./node_modules/lodash-es/sortedIndexOf.js");
  107687. /* harmony import */ var _sortedLastIndex_js__WEBPACK_IMPORTED_MODULE_39__ = __webpack_require__(/*! ./sortedLastIndex.js */ "./node_modules/lodash-es/sortedLastIndex.js");
  107688. /* harmony import */ var _sortedLastIndexBy_js__WEBPACK_IMPORTED_MODULE_40__ = __webpack_require__(/*! ./sortedLastIndexBy.js */ "./node_modules/lodash-es/sortedLastIndexBy.js");
  107689. /* harmony import */ var _sortedLastIndexOf_js__WEBPACK_IMPORTED_MODULE_41__ = __webpack_require__(/*! ./sortedLastIndexOf.js */ "./node_modules/lodash-es/sortedLastIndexOf.js");
  107690. /* harmony import */ var _sortedUniq_js__WEBPACK_IMPORTED_MODULE_42__ = __webpack_require__(/*! ./sortedUniq.js */ "./node_modules/lodash-es/sortedUniq.js");
  107691. /* harmony import */ var _sortedUniqBy_js__WEBPACK_IMPORTED_MODULE_43__ = __webpack_require__(/*! ./sortedUniqBy.js */ "./node_modules/lodash-es/sortedUniqBy.js");
  107692. /* harmony import */ var _tail_js__WEBPACK_IMPORTED_MODULE_44__ = __webpack_require__(/*! ./tail.js */ "./node_modules/lodash-es/tail.js");
  107693. /* harmony import */ var _take_js__WEBPACK_IMPORTED_MODULE_45__ = __webpack_require__(/*! ./take.js */ "./node_modules/lodash-es/take.js");
  107694. /* harmony import */ var _takeRight_js__WEBPACK_IMPORTED_MODULE_46__ = __webpack_require__(/*! ./takeRight.js */ "./node_modules/lodash-es/takeRight.js");
  107695. /* harmony import */ var _takeRightWhile_js__WEBPACK_IMPORTED_MODULE_47__ = __webpack_require__(/*! ./takeRightWhile.js */ "./node_modules/lodash-es/takeRightWhile.js");
  107696. /* harmony import */ var _takeWhile_js__WEBPACK_IMPORTED_MODULE_48__ = __webpack_require__(/*! ./takeWhile.js */ "./node_modules/lodash-es/takeWhile.js");
  107697. /* harmony import */ var _union_js__WEBPACK_IMPORTED_MODULE_49__ = __webpack_require__(/*! ./union.js */ "./node_modules/lodash-es/union.js");
  107698. /* harmony import */ var _unionBy_js__WEBPACK_IMPORTED_MODULE_50__ = __webpack_require__(/*! ./unionBy.js */ "./node_modules/lodash-es/unionBy.js");
  107699. /* harmony import */ var _unionWith_js__WEBPACK_IMPORTED_MODULE_51__ = __webpack_require__(/*! ./unionWith.js */ "./node_modules/lodash-es/unionWith.js");
  107700. /* harmony import */ var _uniq_js__WEBPACK_IMPORTED_MODULE_52__ = __webpack_require__(/*! ./uniq.js */ "./node_modules/lodash-es/uniq.js");
  107701. /* harmony import */ var _uniqBy_js__WEBPACK_IMPORTED_MODULE_53__ = __webpack_require__(/*! ./uniqBy.js */ "./node_modules/lodash-es/uniqBy.js");
  107702. /* harmony import */ var _uniqWith_js__WEBPACK_IMPORTED_MODULE_54__ = __webpack_require__(/*! ./uniqWith.js */ "./node_modules/lodash-es/uniqWith.js");
  107703. /* harmony import */ var _unzip_js__WEBPACK_IMPORTED_MODULE_55__ = __webpack_require__(/*! ./unzip.js */ "./node_modules/lodash-es/unzip.js");
  107704. /* harmony import */ var _unzipWith_js__WEBPACK_IMPORTED_MODULE_56__ = __webpack_require__(/*! ./unzipWith.js */ "./node_modules/lodash-es/unzipWith.js");
  107705. /* harmony import */ var _without_js__WEBPACK_IMPORTED_MODULE_57__ = __webpack_require__(/*! ./without.js */ "./node_modules/lodash-es/without.js");
  107706. /* harmony import */ var _xor_js__WEBPACK_IMPORTED_MODULE_58__ = __webpack_require__(/*! ./xor.js */ "./node_modules/lodash-es/xor.js");
  107707. /* harmony import */ var _xorBy_js__WEBPACK_IMPORTED_MODULE_59__ = __webpack_require__(/*! ./xorBy.js */ "./node_modules/lodash-es/xorBy.js");
  107708. /* harmony import */ var _xorWith_js__WEBPACK_IMPORTED_MODULE_60__ = __webpack_require__(/*! ./xorWith.js */ "./node_modules/lodash-es/xorWith.js");
  107709. /* harmony import */ var _zip_js__WEBPACK_IMPORTED_MODULE_61__ = __webpack_require__(/*! ./zip.js */ "./node_modules/lodash-es/zip.js");
  107710. /* harmony import */ var _zipObject_js__WEBPACK_IMPORTED_MODULE_62__ = __webpack_require__(/*! ./zipObject.js */ "./node_modules/lodash-es/zipObject.js");
  107711. /* harmony import */ var _zipObjectDeep_js__WEBPACK_IMPORTED_MODULE_63__ = __webpack_require__(/*! ./zipObjectDeep.js */ "./node_modules/lodash-es/zipObjectDeep.js");
  107712. /* harmony import */ var _zipWith_js__WEBPACK_IMPORTED_MODULE_64__ = __webpack_require__(/*! ./zipWith.js */ "./node_modules/lodash-es/zipWith.js");
  107713. /* harmony default export */ __webpack_exports__["default"] = ({
  107714. 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"],
  107715. 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"],
  107716. 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"],
  107717. 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"],
  107718. 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"],
  107719. 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"],
  107720. 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"],
  107721. 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"],
  107722. 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"],
  107723. 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"],
  107724. 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"],
  107725. 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"],
  107726. 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"]
  107727. });
  107728. /***/ }),
  107729. /***/ "./node_modules/lodash-es/array.js":
  107730. /*!*****************************************!*\
  107731. !*** ./node_modules/lodash-es/array.js ***!
  107732. \*****************************************/
  107733. /*! 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 */
  107734. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  107735. "use strict";
  107736. __webpack_require__.r(__webpack_exports__);
  107737. /* harmony import */ var _chunk_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./chunk.js */ "./node_modules/lodash-es/chunk.js");
  107738. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "chunk", function() { return _chunk_js__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  107739. /* harmony import */ var _compact_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./compact.js */ "./node_modules/lodash-es/compact.js");
  107740. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "compact", function() { return _compact_js__WEBPACK_IMPORTED_MODULE_1__["default"]; });
  107741. /* harmony import */ var _concat_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./concat.js */ "./node_modules/lodash-es/concat.js");
  107742. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "concat", function() { return _concat_js__WEBPACK_IMPORTED_MODULE_2__["default"]; });
  107743. /* harmony import */ var _difference_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./difference.js */ "./node_modules/lodash-es/difference.js");
  107744. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "difference", function() { return _difference_js__WEBPACK_IMPORTED_MODULE_3__["default"]; });
  107745. /* harmony import */ var _differenceBy_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./differenceBy.js */ "./node_modules/lodash-es/differenceBy.js");
  107746. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "differenceBy", function() { return _differenceBy_js__WEBPACK_IMPORTED_MODULE_4__["default"]; });
  107747. /* harmony import */ var _differenceWith_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./differenceWith.js */ "./node_modules/lodash-es/differenceWith.js");
  107748. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "differenceWith", function() { return _differenceWith_js__WEBPACK_IMPORTED_MODULE_5__["default"]; });
  107749. /* harmony import */ var _drop_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./drop.js */ "./node_modules/lodash-es/drop.js");
  107750. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "drop", function() { return _drop_js__WEBPACK_IMPORTED_MODULE_6__["default"]; });
  107751. /* harmony import */ var _dropRight_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./dropRight.js */ "./node_modules/lodash-es/dropRight.js");
  107752. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "dropRight", function() { return _dropRight_js__WEBPACK_IMPORTED_MODULE_7__["default"]; });
  107753. /* harmony import */ var _dropRightWhile_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./dropRightWhile.js */ "./node_modules/lodash-es/dropRightWhile.js");
  107754. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "dropRightWhile", function() { return _dropRightWhile_js__WEBPACK_IMPORTED_MODULE_8__["default"]; });
  107755. /* harmony import */ var _dropWhile_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./dropWhile.js */ "./node_modules/lodash-es/dropWhile.js");
  107756. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "dropWhile", function() { return _dropWhile_js__WEBPACK_IMPORTED_MODULE_9__["default"]; });
  107757. /* harmony import */ var _fill_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./fill.js */ "./node_modules/lodash-es/fill.js");
  107758. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "fill", function() { return _fill_js__WEBPACK_IMPORTED_MODULE_10__["default"]; });
  107759. /* harmony import */ var _findIndex_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./findIndex.js */ "./node_modules/lodash-es/findIndex.js");
  107760. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "findIndex", function() { return _findIndex_js__WEBPACK_IMPORTED_MODULE_11__["default"]; });
  107761. /* harmony import */ var _findLastIndex_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./findLastIndex.js */ "./node_modules/lodash-es/findLastIndex.js");
  107762. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "findLastIndex", function() { return _findLastIndex_js__WEBPACK_IMPORTED_MODULE_12__["default"]; });
  107763. /* harmony import */ var _first_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./first.js */ "./node_modules/lodash-es/first.js");
  107764. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "first", function() { return _first_js__WEBPACK_IMPORTED_MODULE_13__["default"]; });
  107765. /* harmony import */ var _flatten_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./flatten.js */ "./node_modules/lodash-es/flatten.js");
  107766. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "flatten", function() { return _flatten_js__WEBPACK_IMPORTED_MODULE_14__["default"]; });
  107767. /* harmony import */ var _flattenDeep_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./flattenDeep.js */ "./node_modules/lodash-es/flattenDeep.js");
  107768. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "flattenDeep", function() { return _flattenDeep_js__WEBPACK_IMPORTED_MODULE_15__["default"]; });
  107769. /* harmony import */ var _flattenDepth_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./flattenDepth.js */ "./node_modules/lodash-es/flattenDepth.js");
  107770. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "flattenDepth", function() { return _flattenDepth_js__WEBPACK_IMPORTED_MODULE_16__["default"]; });
  107771. /* harmony import */ var _fromPairs_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./fromPairs.js */ "./node_modules/lodash-es/fromPairs.js");
  107772. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "fromPairs", function() { return _fromPairs_js__WEBPACK_IMPORTED_MODULE_17__["default"]; });
  107773. /* harmony import */ var _head_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./head.js */ "./node_modules/lodash-es/head.js");
  107774. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "head", function() { return _head_js__WEBPACK_IMPORTED_MODULE_18__["default"]; });
  107775. /* harmony import */ var _indexOf_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./indexOf.js */ "./node_modules/lodash-es/indexOf.js");
  107776. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "indexOf", function() { return _indexOf_js__WEBPACK_IMPORTED_MODULE_19__["default"]; });
  107777. /* harmony import */ var _initial_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./initial.js */ "./node_modules/lodash-es/initial.js");
  107778. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "initial", function() { return _initial_js__WEBPACK_IMPORTED_MODULE_20__["default"]; });
  107779. /* harmony import */ var _intersection_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./intersection.js */ "./node_modules/lodash-es/intersection.js");
  107780. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "intersection", function() { return _intersection_js__WEBPACK_IMPORTED_MODULE_21__["default"]; });
  107781. /* harmony import */ var _intersectionBy_js__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./intersectionBy.js */ "./node_modules/lodash-es/intersectionBy.js");
  107782. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "intersectionBy", function() { return _intersectionBy_js__WEBPACK_IMPORTED_MODULE_22__["default"]; });
  107783. /* harmony import */ var _intersectionWith_js__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./intersectionWith.js */ "./node_modules/lodash-es/intersectionWith.js");
  107784. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "intersectionWith", function() { return _intersectionWith_js__WEBPACK_IMPORTED_MODULE_23__["default"]; });
  107785. /* harmony import */ var _join_js__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./join.js */ "./node_modules/lodash-es/join.js");
  107786. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "join", function() { return _join_js__WEBPACK_IMPORTED_MODULE_24__["default"]; });
  107787. /* harmony import */ var _last_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./last.js */ "./node_modules/lodash-es/last.js");
  107788. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "last", function() { return _last_js__WEBPACK_IMPORTED_MODULE_25__["default"]; });
  107789. /* harmony import */ var _lastIndexOf_js__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./lastIndexOf.js */ "./node_modules/lodash-es/lastIndexOf.js");
  107790. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "lastIndexOf", function() { return _lastIndexOf_js__WEBPACK_IMPORTED_MODULE_26__["default"]; });
  107791. /* harmony import */ var _nth_js__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./nth.js */ "./node_modules/lodash-es/nth.js");
  107792. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "nth", function() { return _nth_js__WEBPACK_IMPORTED_MODULE_27__["default"]; });
  107793. /* harmony import */ var _pull_js__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./pull.js */ "./node_modules/lodash-es/pull.js");
  107794. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "pull", function() { return _pull_js__WEBPACK_IMPORTED_MODULE_28__["default"]; });
  107795. /* harmony import */ var _pullAll_js__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./pullAll.js */ "./node_modules/lodash-es/pullAll.js");
  107796. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "pullAll", function() { return _pullAll_js__WEBPACK_IMPORTED_MODULE_29__["default"]; });
  107797. /* harmony import */ var _pullAllBy_js__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./pullAllBy.js */ "./node_modules/lodash-es/pullAllBy.js");
  107798. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "pullAllBy", function() { return _pullAllBy_js__WEBPACK_IMPORTED_MODULE_30__["default"]; });
  107799. /* harmony import */ var _pullAllWith_js__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ./pullAllWith.js */ "./node_modules/lodash-es/pullAllWith.js");
  107800. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "pullAllWith", function() { return _pullAllWith_js__WEBPACK_IMPORTED_MODULE_31__["default"]; });
  107801. /* harmony import */ var _pullAt_js__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ./pullAt.js */ "./node_modules/lodash-es/pullAt.js");
  107802. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "pullAt", function() { return _pullAt_js__WEBPACK_IMPORTED_MODULE_32__["default"]; });
  107803. /* harmony import */ var _remove_js__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ./remove.js */ "./node_modules/lodash-es/remove.js");
  107804. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "remove", function() { return _remove_js__WEBPACK_IMPORTED_MODULE_33__["default"]; });
  107805. /* harmony import */ var _reverse_js__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ./reverse.js */ "./node_modules/lodash-es/reverse.js");
  107806. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "reverse", function() { return _reverse_js__WEBPACK_IMPORTED_MODULE_34__["default"]; });
  107807. /* harmony import */ var _slice_js__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ./slice.js */ "./node_modules/lodash-es/slice.js");
  107808. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "slice", function() { return _slice_js__WEBPACK_IMPORTED_MODULE_35__["default"]; });
  107809. /* harmony import */ var _sortedIndex_js__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! ./sortedIndex.js */ "./node_modules/lodash-es/sortedIndex.js");
  107810. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "sortedIndex", function() { return _sortedIndex_js__WEBPACK_IMPORTED_MODULE_36__["default"]; });
  107811. /* harmony import */ var _sortedIndexBy_js__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(/*! ./sortedIndexBy.js */ "./node_modules/lodash-es/sortedIndexBy.js");
  107812. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "sortedIndexBy", function() { return _sortedIndexBy_js__WEBPACK_IMPORTED_MODULE_37__["default"]; });
  107813. /* harmony import */ var _sortedIndexOf_js__WEBPACK_IMPORTED_MODULE_38__ = __webpack_require__(/*! ./sortedIndexOf.js */ "./node_modules/lodash-es/sortedIndexOf.js");
  107814. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "sortedIndexOf", function() { return _sortedIndexOf_js__WEBPACK_IMPORTED_MODULE_38__["default"]; });
  107815. /* harmony import */ var _sortedLastIndex_js__WEBPACK_IMPORTED_MODULE_39__ = __webpack_require__(/*! ./sortedLastIndex.js */ "./node_modules/lodash-es/sortedLastIndex.js");
  107816. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "sortedLastIndex", function() { return _sortedLastIndex_js__WEBPACK_IMPORTED_MODULE_39__["default"]; });
  107817. /* harmony import */ var _sortedLastIndexBy_js__WEBPACK_IMPORTED_MODULE_40__ = __webpack_require__(/*! ./sortedLastIndexBy.js */ "./node_modules/lodash-es/sortedLastIndexBy.js");
  107818. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "sortedLastIndexBy", function() { return _sortedLastIndexBy_js__WEBPACK_IMPORTED_MODULE_40__["default"]; });
  107819. /* harmony import */ var _sortedLastIndexOf_js__WEBPACK_IMPORTED_MODULE_41__ = __webpack_require__(/*! ./sortedLastIndexOf.js */ "./node_modules/lodash-es/sortedLastIndexOf.js");
  107820. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "sortedLastIndexOf", function() { return _sortedLastIndexOf_js__WEBPACK_IMPORTED_MODULE_41__["default"]; });
  107821. /* harmony import */ var _sortedUniq_js__WEBPACK_IMPORTED_MODULE_42__ = __webpack_require__(/*! ./sortedUniq.js */ "./node_modules/lodash-es/sortedUniq.js");
  107822. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "sortedUniq", function() { return _sortedUniq_js__WEBPACK_IMPORTED_MODULE_42__["default"]; });
  107823. /* harmony import */ var _sortedUniqBy_js__WEBPACK_IMPORTED_MODULE_43__ = __webpack_require__(/*! ./sortedUniqBy.js */ "./node_modules/lodash-es/sortedUniqBy.js");
  107824. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "sortedUniqBy", function() { return _sortedUniqBy_js__WEBPACK_IMPORTED_MODULE_43__["default"]; });
  107825. /* harmony import */ var _tail_js__WEBPACK_IMPORTED_MODULE_44__ = __webpack_require__(/*! ./tail.js */ "./node_modules/lodash-es/tail.js");
  107826. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "tail", function() { return _tail_js__WEBPACK_IMPORTED_MODULE_44__["default"]; });
  107827. /* harmony import */ var _take_js__WEBPACK_IMPORTED_MODULE_45__ = __webpack_require__(/*! ./take.js */ "./node_modules/lodash-es/take.js");
  107828. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "take", function() { return _take_js__WEBPACK_IMPORTED_MODULE_45__["default"]; });
  107829. /* harmony import */ var _takeRight_js__WEBPACK_IMPORTED_MODULE_46__ = __webpack_require__(/*! ./takeRight.js */ "./node_modules/lodash-es/takeRight.js");
  107830. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "takeRight", function() { return _takeRight_js__WEBPACK_IMPORTED_MODULE_46__["default"]; });
  107831. /* harmony import */ var _takeRightWhile_js__WEBPACK_IMPORTED_MODULE_47__ = __webpack_require__(/*! ./takeRightWhile.js */ "./node_modules/lodash-es/takeRightWhile.js");
  107832. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "takeRightWhile", function() { return _takeRightWhile_js__WEBPACK_IMPORTED_MODULE_47__["default"]; });
  107833. /* harmony import */ var _takeWhile_js__WEBPACK_IMPORTED_MODULE_48__ = __webpack_require__(/*! ./takeWhile.js */ "./node_modules/lodash-es/takeWhile.js");
  107834. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "takeWhile", function() { return _takeWhile_js__WEBPACK_IMPORTED_MODULE_48__["default"]; });
  107835. /* harmony import */ var _union_js__WEBPACK_IMPORTED_MODULE_49__ = __webpack_require__(/*! ./union.js */ "./node_modules/lodash-es/union.js");
  107836. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "union", function() { return _union_js__WEBPACK_IMPORTED_MODULE_49__["default"]; });
  107837. /* harmony import */ var _unionBy_js__WEBPACK_IMPORTED_MODULE_50__ = __webpack_require__(/*! ./unionBy.js */ "./node_modules/lodash-es/unionBy.js");
  107838. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "unionBy", function() { return _unionBy_js__WEBPACK_IMPORTED_MODULE_50__["default"]; });
  107839. /* harmony import */ var _unionWith_js__WEBPACK_IMPORTED_MODULE_51__ = __webpack_require__(/*! ./unionWith.js */ "./node_modules/lodash-es/unionWith.js");
  107840. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "unionWith", function() { return _unionWith_js__WEBPACK_IMPORTED_MODULE_51__["default"]; });
  107841. /* harmony import */ var _uniq_js__WEBPACK_IMPORTED_MODULE_52__ = __webpack_require__(/*! ./uniq.js */ "./node_modules/lodash-es/uniq.js");
  107842. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "uniq", function() { return _uniq_js__WEBPACK_IMPORTED_MODULE_52__["default"]; });
  107843. /* harmony import */ var _uniqBy_js__WEBPACK_IMPORTED_MODULE_53__ = __webpack_require__(/*! ./uniqBy.js */ "./node_modules/lodash-es/uniqBy.js");
  107844. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "uniqBy", function() { return _uniqBy_js__WEBPACK_IMPORTED_MODULE_53__["default"]; });
  107845. /* harmony import */ var _uniqWith_js__WEBPACK_IMPORTED_MODULE_54__ = __webpack_require__(/*! ./uniqWith.js */ "./node_modules/lodash-es/uniqWith.js");
  107846. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "uniqWith", function() { return _uniqWith_js__WEBPACK_IMPORTED_MODULE_54__["default"]; });
  107847. /* harmony import */ var _unzip_js__WEBPACK_IMPORTED_MODULE_55__ = __webpack_require__(/*! ./unzip.js */ "./node_modules/lodash-es/unzip.js");
  107848. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "unzip", function() { return _unzip_js__WEBPACK_IMPORTED_MODULE_55__["default"]; });
  107849. /* harmony import */ var _unzipWith_js__WEBPACK_IMPORTED_MODULE_56__ = __webpack_require__(/*! ./unzipWith.js */ "./node_modules/lodash-es/unzipWith.js");
  107850. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "unzipWith", function() { return _unzipWith_js__WEBPACK_IMPORTED_MODULE_56__["default"]; });
  107851. /* harmony import */ var _without_js__WEBPACK_IMPORTED_MODULE_57__ = __webpack_require__(/*! ./without.js */ "./node_modules/lodash-es/without.js");
  107852. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "without", function() { return _without_js__WEBPACK_IMPORTED_MODULE_57__["default"]; });
  107853. /* harmony import */ var _xor_js__WEBPACK_IMPORTED_MODULE_58__ = __webpack_require__(/*! ./xor.js */ "./node_modules/lodash-es/xor.js");
  107854. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "xor", function() { return _xor_js__WEBPACK_IMPORTED_MODULE_58__["default"]; });
  107855. /* harmony import */ var _xorBy_js__WEBPACK_IMPORTED_MODULE_59__ = __webpack_require__(/*! ./xorBy.js */ "./node_modules/lodash-es/xorBy.js");
  107856. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "xorBy", function() { return _xorBy_js__WEBPACK_IMPORTED_MODULE_59__["default"]; });
  107857. /* harmony import */ var _xorWith_js__WEBPACK_IMPORTED_MODULE_60__ = __webpack_require__(/*! ./xorWith.js */ "./node_modules/lodash-es/xorWith.js");
  107858. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "xorWith", function() { return _xorWith_js__WEBPACK_IMPORTED_MODULE_60__["default"]; });
  107859. /* harmony import */ var _zip_js__WEBPACK_IMPORTED_MODULE_61__ = __webpack_require__(/*! ./zip.js */ "./node_modules/lodash-es/zip.js");
  107860. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "zip", function() { return _zip_js__WEBPACK_IMPORTED_MODULE_61__["default"]; });
  107861. /* harmony import */ var _zipObject_js__WEBPACK_IMPORTED_MODULE_62__ = __webpack_require__(/*! ./zipObject.js */ "./node_modules/lodash-es/zipObject.js");
  107862. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "zipObject", function() { return _zipObject_js__WEBPACK_IMPORTED_MODULE_62__["default"]; });
  107863. /* harmony import */ var _zipObjectDeep_js__WEBPACK_IMPORTED_MODULE_63__ = __webpack_require__(/*! ./zipObjectDeep.js */ "./node_modules/lodash-es/zipObjectDeep.js");
  107864. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "zipObjectDeep", function() { return _zipObjectDeep_js__WEBPACK_IMPORTED_MODULE_63__["default"]; });
  107865. /* harmony import */ var _zipWith_js__WEBPACK_IMPORTED_MODULE_64__ = __webpack_require__(/*! ./zipWith.js */ "./node_modules/lodash-es/zipWith.js");
  107866. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "zipWith", function() { return _zipWith_js__WEBPACK_IMPORTED_MODULE_64__["default"]; });
  107867. /* harmony import */ var _array_default_js__WEBPACK_IMPORTED_MODULE_65__ = __webpack_require__(/*! ./array.default.js */ "./node_modules/lodash-es/array.default.js");
  107868. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _array_default_js__WEBPACK_IMPORTED_MODULE_65__["default"]; });
  107869. /***/ }),
  107870. /***/ "./node_modules/lodash-es/ary.js":
  107871. /*!***************************************!*\
  107872. !*** ./node_modules/lodash-es/ary.js ***!
  107873. \***************************************/
  107874. /*! exports provided: default */
  107875. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  107876. "use strict";
  107877. __webpack_require__.r(__webpack_exports__);
  107878. /* harmony import */ var _createWrap_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createWrap.js */ "./node_modules/lodash-es/_createWrap.js");
  107879. /** Used to compose bitmasks for function metadata. */
  107880. var WRAP_ARY_FLAG = 128;
  107881. /**
  107882. * Creates a function that invokes `func`, with up to `n` arguments,
  107883. * ignoring any additional arguments.
  107884. *
  107885. * @static
  107886. * @memberOf _
  107887. * @since 3.0.0
  107888. * @category Function
  107889. * @param {Function} func The function to cap arguments for.
  107890. * @param {number} [n=func.length] The arity cap.
  107891. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  107892. * @returns {Function} Returns the new capped function.
  107893. * @example
  107894. *
  107895. * _.map(['6', '8', '10'], _.ary(parseInt, 1));
  107896. * // => [6, 8, 10]
  107897. */
  107898. function ary(func, n, guard) {
  107899. n = guard ? undefined : n;
  107900. n = (func && n == null) ? func.length : n;
  107901. return Object(_createWrap_js__WEBPACK_IMPORTED_MODULE_0__["default"])(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n);
  107902. }
  107903. /* harmony default export */ __webpack_exports__["default"] = (ary);
  107904. /***/ }),
  107905. /***/ "./node_modules/lodash-es/assign.js":
  107906. /*!******************************************!*\
  107907. !*** ./node_modules/lodash-es/assign.js ***!
  107908. \******************************************/
  107909. /*! exports provided: default */
  107910. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  107911. "use strict";
  107912. __webpack_require__.r(__webpack_exports__);
  107913. /* harmony import */ var _assignValue_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_assignValue.js */ "./node_modules/lodash-es/_assignValue.js");
  107914. /* harmony import */ var _copyObject_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_copyObject.js */ "./node_modules/lodash-es/_copyObject.js");
  107915. /* harmony import */ var _createAssigner_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_createAssigner.js */ "./node_modules/lodash-es/_createAssigner.js");
  107916. /* harmony import */ var _isArrayLike_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./isArrayLike.js */ "./node_modules/lodash-es/isArrayLike.js");
  107917. /* harmony import */ var _isPrototype_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_isPrototype.js */ "./node_modules/lodash-es/_isPrototype.js");
  107918. /* harmony import */ var _keys_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./keys.js */ "./node_modules/lodash-es/keys.js");
  107919. /** Used for built-in method references. */
  107920. var objectProto = Object.prototype;
  107921. /** Used to check objects for own properties. */
  107922. var hasOwnProperty = objectProto.hasOwnProperty;
  107923. /**
  107924. * Assigns own enumerable string keyed properties of source objects to the
  107925. * destination object. Source objects are applied from left to right.
  107926. * Subsequent sources overwrite property assignments of previous sources.
  107927. *
  107928. * **Note:** This method mutates `object` and is loosely based on
  107929. * [`Object.assign`](https://mdn.io/Object/assign).
  107930. *
  107931. * @static
  107932. * @memberOf _
  107933. * @since 0.10.0
  107934. * @category Object
  107935. * @param {Object} object The destination object.
  107936. * @param {...Object} [sources] The source objects.
  107937. * @returns {Object} Returns `object`.
  107938. * @see _.assignIn
  107939. * @example
  107940. *
  107941. * function Foo() {
  107942. * this.a = 1;
  107943. * }
  107944. *
  107945. * function Bar() {
  107946. * this.c = 3;
  107947. * }
  107948. *
  107949. * Foo.prototype.b = 2;
  107950. * Bar.prototype.d = 4;
  107951. *
  107952. * _.assign({ 'a': 0 }, new Foo, new Bar);
  107953. * // => { 'a': 1, 'c': 3 }
  107954. */
  107955. var assign = Object(_createAssigner_js__WEBPACK_IMPORTED_MODULE_2__["default"])(function(object, source) {
  107956. if (Object(_isPrototype_js__WEBPACK_IMPORTED_MODULE_4__["default"])(source) || Object(_isArrayLike_js__WEBPACK_IMPORTED_MODULE_3__["default"])(source)) {
  107957. Object(_copyObject_js__WEBPACK_IMPORTED_MODULE_1__["default"])(source, Object(_keys_js__WEBPACK_IMPORTED_MODULE_5__["default"])(source), object);
  107958. return;
  107959. }
  107960. for (var key in source) {
  107961. if (hasOwnProperty.call(source, key)) {
  107962. Object(_assignValue_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, key, source[key]);
  107963. }
  107964. }
  107965. });
  107966. /* harmony default export */ __webpack_exports__["default"] = (assign);
  107967. /***/ }),
  107968. /***/ "./node_modules/lodash-es/assignIn.js":
  107969. /*!********************************************!*\
  107970. !*** ./node_modules/lodash-es/assignIn.js ***!
  107971. \********************************************/
  107972. /*! exports provided: default */
  107973. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  107974. "use strict";
  107975. __webpack_require__.r(__webpack_exports__);
  107976. /* harmony import */ var _copyObject_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_copyObject.js */ "./node_modules/lodash-es/_copyObject.js");
  107977. /* harmony import */ var _createAssigner_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_createAssigner.js */ "./node_modules/lodash-es/_createAssigner.js");
  107978. /* harmony import */ var _keysIn_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./keysIn.js */ "./node_modules/lodash-es/keysIn.js");
  107979. /**
  107980. * This method is like `_.assign` except that it iterates over own and
  107981. * inherited source properties.
  107982. *
  107983. * **Note:** This method mutates `object`.
  107984. *
  107985. * @static
  107986. * @memberOf _
  107987. * @since 4.0.0
  107988. * @alias extend
  107989. * @category Object
  107990. * @param {Object} object The destination object.
  107991. * @param {...Object} [sources] The source objects.
  107992. * @returns {Object} Returns `object`.
  107993. * @see _.assign
  107994. * @example
  107995. *
  107996. * function Foo() {
  107997. * this.a = 1;
  107998. * }
  107999. *
  108000. * function Bar() {
  108001. * this.c = 3;
  108002. * }
  108003. *
  108004. * Foo.prototype.b = 2;
  108005. * Bar.prototype.d = 4;
  108006. *
  108007. * _.assignIn({ 'a': 0 }, new Foo, new Bar);
  108008. * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 }
  108009. */
  108010. var assignIn = Object(_createAssigner_js__WEBPACK_IMPORTED_MODULE_1__["default"])(function(object, source) {
  108011. Object(_copyObject_js__WEBPACK_IMPORTED_MODULE_0__["default"])(source, Object(_keysIn_js__WEBPACK_IMPORTED_MODULE_2__["default"])(source), object);
  108012. });
  108013. /* harmony default export */ __webpack_exports__["default"] = (assignIn);
  108014. /***/ }),
  108015. /***/ "./node_modules/lodash-es/assignInWith.js":
  108016. /*!************************************************!*\
  108017. !*** ./node_modules/lodash-es/assignInWith.js ***!
  108018. \************************************************/
  108019. /*! exports provided: default */
  108020. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  108021. "use strict";
  108022. __webpack_require__.r(__webpack_exports__);
  108023. /* harmony import */ var _copyObject_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_copyObject.js */ "./node_modules/lodash-es/_copyObject.js");
  108024. /* harmony import */ var _createAssigner_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_createAssigner.js */ "./node_modules/lodash-es/_createAssigner.js");
  108025. /* harmony import */ var _keysIn_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./keysIn.js */ "./node_modules/lodash-es/keysIn.js");
  108026. /**
  108027. * This method is like `_.assignIn` except that it accepts `customizer`
  108028. * which is invoked to produce the assigned values. If `customizer` returns
  108029. * `undefined`, assignment is handled by the method instead. The `customizer`
  108030. * is invoked with five arguments: (objValue, srcValue, key, object, source).
  108031. *
  108032. * **Note:** This method mutates `object`.
  108033. *
  108034. * @static
  108035. * @memberOf _
  108036. * @since 4.0.0
  108037. * @alias extendWith
  108038. * @category Object
  108039. * @param {Object} object The destination object.
  108040. * @param {...Object} sources The source objects.
  108041. * @param {Function} [customizer] The function to customize assigned values.
  108042. * @returns {Object} Returns `object`.
  108043. * @see _.assignWith
  108044. * @example
  108045. *
  108046. * function customizer(objValue, srcValue) {
  108047. * return _.isUndefined(objValue) ? srcValue : objValue;
  108048. * }
  108049. *
  108050. * var defaults = _.partialRight(_.assignInWith, customizer);
  108051. *
  108052. * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  108053. * // => { 'a': 1, 'b': 2 }
  108054. */
  108055. var assignInWith = Object(_createAssigner_js__WEBPACK_IMPORTED_MODULE_1__["default"])(function(object, source, srcIndex, customizer) {
  108056. Object(_copyObject_js__WEBPACK_IMPORTED_MODULE_0__["default"])(source, Object(_keysIn_js__WEBPACK_IMPORTED_MODULE_2__["default"])(source), object, customizer);
  108057. });
  108058. /* harmony default export */ __webpack_exports__["default"] = (assignInWith);
  108059. /***/ }),
  108060. /***/ "./node_modules/lodash-es/assignWith.js":
  108061. /*!**********************************************!*\
  108062. !*** ./node_modules/lodash-es/assignWith.js ***!
  108063. \**********************************************/
  108064. /*! exports provided: default */
  108065. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  108066. "use strict";
  108067. __webpack_require__.r(__webpack_exports__);
  108068. /* harmony import */ var _copyObject_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_copyObject.js */ "./node_modules/lodash-es/_copyObject.js");
  108069. /* harmony import */ var _createAssigner_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_createAssigner.js */ "./node_modules/lodash-es/_createAssigner.js");
  108070. /* harmony import */ var _keys_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./keys.js */ "./node_modules/lodash-es/keys.js");
  108071. /**
  108072. * This method is like `_.assign` except that it accepts `customizer`
  108073. * which is invoked to produce the assigned values. If `customizer` returns
  108074. * `undefined`, assignment is handled by the method instead. The `customizer`
  108075. * is invoked with five arguments: (objValue, srcValue, key, object, source).
  108076. *
  108077. * **Note:** This method mutates `object`.
  108078. *
  108079. * @static
  108080. * @memberOf _
  108081. * @since 4.0.0
  108082. * @category Object
  108083. * @param {Object} object The destination object.
  108084. * @param {...Object} sources The source objects.
  108085. * @param {Function} [customizer] The function to customize assigned values.
  108086. * @returns {Object} Returns `object`.
  108087. * @see _.assignInWith
  108088. * @example
  108089. *
  108090. * function customizer(objValue, srcValue) {
  108091. * return _.isUndefined(objValue) ? srcValue : objValue;
  108092. * }
  108093. *
  108094. * var defaults = _.partialRight(_.assignWith, customizer);
  108095. *
  108096. * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  108097. * // => { 'a': 1, 'b': 2 }
  108098. */
  108099. var assignWith = Object(_createAssigner_js__WEBPACK_IMPORTED_MODULE_1__["default"])(function(object, source, srcIndex, customizer) {
  108100. Object(_copyObject_js__WEBPACK_IMPORTED_MODULE_0__["default"])(source, Object(_keys_js__WEBPACK_IMPORTED_MODULE_2__["default"])(source), object, customizer);
  108101. });
  108102. /* harmony default export */ __webpack_exports__["default"] = (assignWith);
  108103. /***/ }),
  108104. /***/ "./node_modules/lodash-es/at.js":
  108105. /*!**************************************!*\
  108106. !*** ./node_modules/lodash-es/at.js ***!
  108107. \**************************************/
  108108. /*! exports provided: default */
  108109. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  108110. "use strict";
  108111. __webpack_require__.r(__webpack_exports__);
  108112. /* harmony import */ var _baseAt_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseAt.js */ "./node_modules/lodash-es/_baseAt.js");
  108113. /* harmony import */ var _flatRest_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_flatRest.js */ "./node_modules/lodash-es/_flatRest.js");
  108114. /**
  108115. * Creates an array of values corresponding to `paths` of `object`.
  108116. *
  108117. * @static
  108118. * @memberOf _
  108119. * @since 1.0.0
  108120. * @category Object
  108121. * @param {Object} object The object to iterate over.
  108122. * @param {...(string|string[])} [paths] The property paths to pick.
  108123. * @returns {Array} Returns the picked values.
  108124. * @example
  108125. *
  108126. * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
  108127. *
  108128. * _.at(object, ['a[0].b.c', 'a[1]']);
  108129. * // => [3, 4]
  108130. */
  108131. var at = Object(_flatRest_js__WEBPACK_IMPORTED_MODULE_1__["default"])(_baseAt_js__WEBPACK_IMPORTED_MODULE_0__["default"]);
  108132. /* harmony default export */ __webpack_exports__["default"] = (at);
  108133. /***/ }),
  108134. /***/ "./node_modules/lodash-es/attempt.js":
  108135. /*!*******************************************!*\
  108136. !*** ./node_modules/lodash-es/attempt.js ***!
  108137. \*******************************************/
  108138. /*! exports provided: default */
  108139. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  108140. "use strict";
  108141. __webpack_require__.r(__webpack_exports__);
  108142. /* harmony import */ var _apply_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_apply.js */ "./node_modules/lodash-es/_apply.js");
  108143. /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
  108144. /* harmony import */ var _isError_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./isError.js */ "./node_modules/lodash-es/isError.js");
  108145. /**
  108146. * Attempts to invoke `func`, returning either the result or the caught error
  108147. * object. Any additional arguments are provided to `func` when it's invoked.
  108148. *
  108149. * @static
  108150. * @memberOf _
  108151. * @since 3.0.0
  108152. * @category Util
  108153. * @param {Function} func The function to attempt.
  108154. * @param {...*} [args] The arguments to invoke `func` with.
  108155. * @returns {*} Returns the `func` result or error object.
  108156. * @example
  108157. *
  108158. * // Avoid throwing errors for invalid selectors.
  108159. * var elements = _.attempt(function(selector) {
  108160. * return document.querySelectorAll(selector);
  108161. * }, '>_>');
  108162. *
  108163. * if (_.isError(elements)) {
  108164. * elements = [];
  108165. * }
  108166. */
  108167. var attempt = Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_1__["default"])(function(func, args) {
  108168. try {
  108169. return Object(_apply_js__WEBPACK_IMPORTED_MODULE_0__["default"])(func, undefined, args);
  108170. } catch (e) {
  108171. return Object(_isError_js__WEBPACK_IMPORTED_MODULE_2__["default"])(e) ? e : new Error(e);
  108172. }
  108173. });
  108174. /* harmony default export */ __webpack_exports__["default"] = (attempt);
  108175. /***/ }),
  108176. /***/ "./node_modules/lodash-es/before.js":
  108177. /*!******************************************!*\
  108178. !*** ./node_modules/lodash-es/before.js ***!
  108179. \******************************************/
  108180. /*! exports provided: default */
  108181. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  108182. "use strict";
  108183. __webpack_require__.r(__webpack_exports__);
  108184. /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
  108185. /** Error message constants. */
  108186. var FUNC_ERROR_TEXT = 'Expected a function';
  108187. /**
  108188. * Creates a function that invokes `func`, with the `this` binding and arguments
  108189. * of the created function, while it's called less than `n` times. Subsequent
  108190. * calls to the created function return the result of the last `func` invocation.
  108191. *
  108192. * @static
  108193. * @memberOf _
  108194. * @since 3.0.0
  108195. * @category Function
  108196. * @param {number} n The number of calls at which `func` is no longer invoked.
  108197. * @param {Function} func The function to restrict.
  108198. * @returns {Function} Returns the new restricted function.
  108199. * @example
  108200. *
  108201. * jQuery(element).on('click', _.before(5, addContactToList));
  108202. * // => Allows adding up to 4 contacts to the list.
  108203. */
  108204. function before(n, func) {
  108205. var result;
  108206. if (typeof func != 'function') {
  108207. throw new TypeError(FUNC_ERROR_TEXT);
  108208. }
  108209. n = Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_0__["default"])(n);
  108210. return function() {
  108211. if (--n > 0) {
  108212. result = func.apply(this, arguments);
  108213. }
  108214. if (n <= 1) {
  108215. func = undefined;
  108216. }
  108217. return result;
  108218. };
  108219. }
  108220. /* harmony default export */ __webpack_exports__["default"] = (before);
  108221. /***/ }),
  108222. /***/ "./node_modules/lodash-es/bind.js":
  108223. /*!****************************************!*\
  108224. !*** ./node_modules/lodash-es/bind.js ***!
  108225. \****************************************/
  108226. /*! exports provided: default */
  108227. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  108228. "use strict";
  108229. __webpack_require__.r(__webpack_exports__);
  108230. /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
  108231. /* harmony import */ var _createWrap_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_createWrap.js */ "./node_modules/lodash-es/_createWrap.js");
  108232. /* harmony import */ var _getHolder_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_getHolder.js */ "./node_modules/lodash-es/_getHolder.js");
  108233. /* harmony import */ var _replaceHolders_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_replaceHolders.js */ "./node_modules/lodash-es/_replaceHolders.js");
  108234. /** Used to compose bitmasks for function metadata. */
  108235. var WRAP_BIND_FLAG = 1,
  108236. WRAP_PARTIAL_FLAG = 32;
  108237. /**
  108238. * Creates a function that invokes `func` with the `this` binding of `thisArg`
  108239. * and `partials` prepended to the arguments it receives.
  108240. *
  108241. * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds,
  108242. * may be used as a placeholder for partially applied arguments.
  108243. *
  108244. * **Note:** Unlike native `Function#bind`, this method doesn't set the "length"
  108245. * property of bound functions.
  108246. *
  108247. * @static
  108248. * @memberOf _
  108249. * @since 0.1.0
  108250. * @category Function
  108251. * @param {Function} func The function to bind.
  108252. * @param {*} thisArg The `this` binding of `func`.
  108253. * @param {...*} [partials] The arguments to be partially applied.
  108254. * @returns {Function} Returns the new bound function.
  108255. * @example
  108256. *
  108257. * function greet(greeting, punctuation) {
  108258. * return greeting + ' ' + this.user + punctuation;
  108259. * }
  108260. *
  108261. * var object = { 'user': 'fred' };
  108262. *
  108263. * var bound = _.bind(greet, object, 'hi');
  108264. * bound('!');
  108265. * // => 'hi fred!'
  108266. *
  108267. * // Bound with placeholders.
  108268. * var bound = _.bind(greet, object, _, '!');
  108269. * bound('hi');
  108270. * // => 'hi fred!'
  108271. */
  108272. var bind = Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function(func, thisArg, partials) {
  108273. var bitmask = WRAP_BIND_FLAG;
  108274. if (partials.length) {
  108275. var holders = Object(_replaceHolders_js__WEBPACK_IMPORTED_MODULE_3__["default"])(partials, Object(_getHolder_js__WEBPACK_IMPORTED_MODULE_2__["default"])(bind));
  108276. bitmask |= WRAP_PARTIAL_FLAG;
  108277. }
  108278. return Object(_createWrap_js__WEBPACK_IMPORTED_MODULE_1__["default"])(func, bitmask, thisArg, partials, holders);
  108279. });
  108280. // Assign default placeholders.
  108281. bind.placeholder = {};
  108282. /* harmony default export */ __webpack_exports__["default"] = (bind);
  108283. /***/ }),
  108284. /***/ "./node_modules/lodash-es/bindAll.js":
  108285. /*!*******************************************!*\
  108286. !*** ./node_modules/lodash-es/bindAll.js ***!
  108287. \*******************************************/
  108288. /*! exports provided: default */
  108289. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  108290. "use strict";
  108291. __webpack_require__.r(__webpack_exports__);
  108292. /* harmony import */ var _arrayEach_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayEach.js */ "./node_modules/lodash-es/_arrayEach.js");
  108293. /* harmony import */ var _baseAssignValue_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseAssignValue.js */ "./node_modules/lodash-es/_baseAssignValue.js");
  108294. /* harmony import */ var _bind_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./bind.js */ "./node_modules/lodash-es/bind.js");
  108295. /* harmony import */ var _flatRest_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_flatRest.js */ "./node_modules/lodash-es/_flatRest.js");
  108296. /* harmony import */ var _toKey_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_toKey.js */ "./node_modules/lodash-es/_toKey.js");
  108297. /**
  108298. * Binds methods of an object to the object itself, overwriting the existing
  108299. * method.
  108300. *
  108301. * **Note:** This method doesn't set the "length" property of bound functions.
  108302. *
  108303. * @static
  108304. * @since 0.1.0
  108305. * @memberOf _
  108306. * @category Util
  108307. * @param {Object} object The object to bind and assign the bound methods to.
  108308. * @param {...(string|string[])} methodNames The object method names to bind.
  108309. * @returns {Object} Returns `object`.
  108310. * @example
  108311. *
  108312. * var view = {
  108313. * 'label': 'docs',
  108314. * 'click': function() {
  108315. * console.log('clicked ' + this.label);
  108316. * }
  108317. * };
  108318. *
  108319. * _.bindAll(view, ['click']);
  108320. * jQuery(element).on('click', view.click);
  108321. * // => Logs 'clicked docs' when clicked.
  108322. */
  108323. var bindAll = Object(_flatRest_js__WEBPACK_IMPORTED_MODULE_3__["default"])(function(object, methodNames) {
  108324. Object(_arrayEach_js__WEBPACK_IMPORTED_MODULE_0__["default"])(methodNames, function(key) {
  108325. key = Object(_toKey_js__WEBPACK_IMPORTED_MODULE_4__["default"])(key);
  108326. Object(_baseAssignValue_js__WEBPACK_IMPORTED_MODULE_1__["default"])(object, key, Object(_bind_js__WEBPACK_IMPORTED_MODULE_2__["default"])(object[key], object));
  108327. });
  108328. return object;
  108329. });
  108330. /* harmony default export */ __webpack_exports__["default"] = (bindAll);
  108331. /***/ }),
  108332. /***/ "./node_modules/lodash-es/bindKey.js":
  108333. /*!*******************************************!*\
  108334. !*** ./node_modules/lodash-es/bindKey.js ***!
  108335. \*******************************************/
  108336. /*! exports provided: default */
  108337. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  108338. "use strict";
  108339. __webpack_require__.r(__webpack_exports__);
  108340. /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
  108341. /* harmony import */ var _createWrap_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_createWrap.js */ "./node_modules/lodash-es/_createWrap.js");
  108342. /* harmony import */ var _getHolder_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_getHolder.js */ "./node_modules/lodash-es/_getHolder.js");
  108343. /* harmony import */ var _replaceHolders_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_replaceHolders.js */ "./node_modules/lodash-es/_replaceHolders.js");
  108344. /** Used to compose bitmasks for function metadata. */
  108345. var WRAP_BIND_FLAG = 1,
  108346. WRAP_BIND_KEY_FLAG = 2,
  108347. WRAP_PARTIAL_FLAG = 32;
  108348. /**
  108349. * Creates a function that invokes the method at `object[key]` with `partials`
  108350. * prepended to the arguments it receives.
  108351. *
  108352. * This method differs from `_.bind` by allowing bound functions to reference
  108353. * methods that may be redefined or don't yet exist. See
  108354. * [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern)
  108355. * for more details.
  108356. *
  108357. * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic
  108358. * builds, may be used as a placeholder for partially applied arguments.
  108359. *
  108360. * @static
  108361. * @memberOf _
  108362. * @since 0.10.0
  108363. * @category Function
  108364. * @param {Object} object The object to invoke the method on.
  108365. * @param {string} key The key of the method.
  108366. * @param {...*} [partials] The arguments to be partially applied.
  108367. * @returns {Function} Returns the new bound function.
  108368. * @example
  108369. *
  108370. * var object = {
  108371. * 'user': 'fred',
  108372. * 'greet': function(greeting, punctuation) {
  108373. * return greeting + ' ' + this.user + punctuation;
  108374. * }
  108375. * };
  108376. *
  108377. * var bound = _.bindKey(object, 'greet', 'hi');
  108378. * bound('!');
  108379. * // => 'hi fred!'
  108380. *
  108381. * object.greet = function(greeting, punctuation) {
  108382. * return greeting + 'ya ' + this.user + punctuation;
  108383. * };
  108384. *
  108385. * bound('!');
  108386. * // => 'hiya fred!'
  108387. *
  108388. * // Bound with placeholders.
  108389. * var bound = _.bindKey(object, 'greet', _, '!');
  108390. * bound('hi');
  108391. * // => 'hiya fred!'
  108392. */
  108393. var bindKey = Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function(object, key, partials) {
  108394. var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG;
  108395. if (partials.length) {
  108396. var holders = Object(_replaceHolders_js__WEBPACK_IMPORTED_MODULE_3__["default"])(partials, Object(_getHolder_js__WEBPACK_IMPORTED_MODULE_2__["default"])(bindKey));
  108397. bitmask |= WRAP_PARTIAL_FLAG;
  108398. }
  108399. return Object(_createWrap_js__WEBPACK_IMPORTED_MODULE_1__["default"])(key, bitmask, object, partials, holders);
  108400. });
  108401. // Assign default placeholders.
  108402. bindKey.placeholder = {};
  108403. /* harmony default export */ __webpack_exports__["default"] = (bindKey);
  108404. /***/ }),
  108405. /***/ "./node_modules/lodash-es/camelCase.js":
  108406. /*!*********************************************!*\
  108407. !*** ./node_modules/lodash-es/camelCase.js ***!
  108408. \*********************************************/
  108409. /*! exports provided: default */
  108410. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  108411. "use strict";
  108412. __webpack_require__.r(__webpack_exports__);
  108413. /* harmony import */ var _capitalize_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./capitalize.js */ "./node_modules/lodash-es/capitalize.js");
  108414. /* harmony import */ var _createCompounder_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_createCompounder.js */ "./node_modules/lodash-es/_createCompounder.js");
  108415. /**
  108416. * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase).
  108417. *
  108418. * @static
  108419. * @memberOf _
  108420. * @since 3.0.0
  108421. * @category String
  108422. * @param {string} [string=''] The string to convert.
  108423. * @returns {string} Returns the camel cased string.
  108424. * @example
  108425. *
  108426. * _.camelCase('Foo Bar');
  108427. * // => 'fooBar'
  108428. *
  108429. * _.camelCase('--foo-bar--');
  108430. * // => 'fooBar'
  108431. *
  108432. * _.camelCase('__FOO_BAR__');
  108433. * // => 'fooBar'
  108434. */
  108435. var camelCase = Object(_createCompounder_js__WEBPACK_IMPORTED_MODULE_1__["default"])(function(result, word, index) {
  108436. word = word.toLowerCase();
  108437. return result + (index ? Object(_capitalize_js__WEBPACK_IMPORTED_MODULE_0__["default"])(word) : word);
  108438. });
  108439. /* harmony default export */ __webpack_exports__["default"] = (camelCase);
  108440. /***/ }),
  108441. /***/ "./node_modules/lodash-es/capitalize.js":
  108442. /*!**********************************************!*\
  108443. !*** ./node_modules/lodash-es/capitalize.js ***!
  108444. \**********************************************/
  108445. /*! exports provided: default */
  108446. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  108447. "use strict";
  108448. __webpack_require__.r(__webpack_exports__);
  108449. /* harmony import */ var _toString_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./toString.js */ "./node_modules/lodash-es/toString.js");
  108450. /* harmony import */ var _upperFirst_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./upperFirst.js */ "./node_modules/lodash-es/upperFirst.js");
  108451. /**
  108452. * Converts the first character of `string` to upper case and the remaining
  108453. * to lower case.
  108454. *
  108455. * @static
  108456. * @memberOf _
  108457. * @since 3.0.0
  108458. * @category String
  108459. * @param {string} [string=''] The string to capitalize.
  108460. * @returns {string} Returns the capitalized string.
  108461. * @example
  108462. *
  108463. * _.capitalize('FRED');
  108464. * // => 'Fred'
  108465. */
  108466. function capitalize(string) {
  108467. return Object(_upperFirst_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Object(_toString_js__WEBPACK_IMPORTED_MODULE_0__["default"])(string).toLowerCase());
  108468. }
  108469. /* harmony default export */ __webpack_exports__["default"] = (capitalize);
  108470. /***/ }),
  108471. /***/ "./node_modules/lodash-es/castArray.js":
  108472. /*!*********************************************!*\
  108473. !*** ./node_modules/lodash-es/castArray.js ***!
  108474. \*********************************************/
  108475. /*! exports provided: default */
  108476. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  108477. "use strict";
  108478. __webpack_require__.r(__webpack_exports__);
  108479. /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
  108480. /**
  108481. * Casts `value` as an array if it's not one.
  108482. *
  108483. * @static
  108484. * @memberOf _
  108485. * @since 4.4.0
  108486. * @category Lang
  108487. * @param {*} value The value to inspect.
  108488. * @returns {Array} Returns the cast array.
  108489. * @example
  108490. *
  108491. * _.castArray(1);
  108492. * // => [1]
  108493. *
  108494. * _.castArray({ 'a': 1 });
  108495. * // => [{ 'a': 1 }]
  108496. *
  108497. * _.castArray('abc');
  108498. * // => ['abc']
  108499. *
  108500. * _.castArray(null);
  108501. * // => [null]
  108502. *
  108503. * _.castArray(undefined);
  108504. * // => [undefined]
  108505. *
  108506. * _.castArray();
  108507. * // => []
  108508. *
  108509. * var array = [1, 2, 3];
  108510. * console.log(_.castArray(array) === array);
  108511. * // => true
  108512. */
  108513. function castArray() {
  108514. if (!arguments.length) {
  108515. return [];
  108516. }
  108517. var value = arguments[0];
  108518. return Object(_isArray_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value) ? value : [value];
  108519. }
  108520. /* harmony default export */ __webpack_exports__["default"] = (castArray);
  108521. /***/ }),
  108522. /***/ "./node_modules/lodash-es/ceil.js":
  108523. /*!****************************************!*\
  108524. !*** ./node_modules/lodash-es/ceil.js ***!
  108525. \****************************************/
  108526. /*! exports provided: default */
  108527. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  108528. "use strict";
  108529. __webpack_require__.r(__webpack_exports__);
  108530. /* harmony import */ var _createRound_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createRound.js */ "./node_modules/lodash-es/_createRound.js");
  108531. /**
  108532. * Computes `number` rounded up to `precision`.
  108533. *
  108534. * @static
  108535. * @memberOf _
  108536. * @since 3.10.0
  108537. * @category Math
  108538. * @param {number} number The number to round up.
  108539. * @param {number} [precision=0] The precision to round up to.
  108540. * @returns {number} Returns the rounded up number.
  108541. * @example
  108542. *
  108543. * _.ceil(4.006);
  108544. * // => 5
  108545. *
  108546. * _.ceil(6.004, 2);
  108547. * // => 6.01
  108548. *
  108549. * _.ceil(6040, -2);
  108550. * // => 6100
  108551. */
  108552. var ceil = Object(_createRound_js__WEBPACK_IMPORTED_MODULE_0__["default"])('ceil');
  108553. /* harmony default export */ __webpack_exports__["default"] = (ceil);
  108554. /***/ }),
  108555. /***/ "./node_modules/lodash-es/chain.js":
  108556. /*!*****************************************!*\
  108557. !*** ./node_modules/lodash-es/chain.js ***!
  108558. \*****************************************/
  108559. /*! exports provided: default */
  108560. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  108561. "use strict";
  108562. __webpack_require__.r(__webpack_exports__);
  108563. /* harmony import */ var _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./wrapperLodash.js */ "./node_modules/lodash-es/wrapperLodash.js");
  108564. /**
  108565. * Creates a `lodash` wrapper instance that wraps `value` with explicit method
  108566. * chain sequences enabled. The result of such sequences must be unwrapped
  108567. * with `_#value`.
  108568. *
  108569. * @static
  108570. * @memberOf _
  108571. * @since 1.3.0
  108572. * @category Seq
  108573. * @param {*} value The value to wrap.
  108574. * @returns {Object} Returns the new `lodash` wrapper instance.
  108575. * @example
  108576. *
  108577. * var users = [
  108578. * { 'user': 'barney', 'age': 36 },
  108579. * { 'user': 'fred', 'age': 40 },
  108580. * { 'user': 'pebbles', 'age': 1 }
  108581. * ];
  108582. *
  108583. * var youngest = _
  108584. * .chain(users)
  108585. * .sortBy('age')
  108586. * .map(function(o) {
  108587. * return o.user + ' is ' + o.age;
  108588. * })
  108589. * .head()
  108590. * .value();
  108591. * // => 'pebbles is 1'
  108592. */
  108593. function chain(value) {
  108594. var result = Object(_wrapperLodash_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value);
  108595. result.__chain__ = true;
  108596. return result;
  108597. }
  108598. /* harmony default export */ __webpack_exports__["default"] = (chain);
  108599. /***/ }),
  108600. /***/ "./node_modules/lodash-es/chunk.js":
  108601. /*!*****************************************!*\
  108602. !*** ./node_modules/lodash-es/chunk.js ***!
  108603. \*****************************************/
  108604. /*! exports provided: default */
  108605. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  108606. "use strict";
  108607. __webpack_require__.r(__webpack_exports__);
  108608. /* harmony import */ var _baseSlice_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseSlice.js */ "./node_modules/lodash-es/_baseSlice.js");
  108609. /* harmony import */ var _isIterateeCall_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_isIterateeCall.js */ "./node_modules/lodash-es/_isIterateeCall.js");
  108610. /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
  108611. /* Built-in method references for those with the same name as other `lodash` methods. */
  108612. var nativeCeil = Math.ceil,
  108613. nativeMax = Math.max;
  108614. /**
  108615. * Creates an array of elements split into groups the length of `size`.
  108616. * If `array` can't be split evenly, the final chunk will be the remaining
  108617. * elements.
  108618. *
  108619. * @static
  108620. * @memberOf _
  108621. * @since 3.0.0
  108622. * @category Array
  108623. * @param {Array} array The array to process.
  108624. * @param {number} [size=1] The length of each chunk
  108625. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  108626. * @returns {Array} Returns the new array of chunks.
  108627. * @example
  108628. *
  108629. * _.chunk(['a', 'b', 'c', 'd'], 2);
  108630. * // => [['a', 'b'], ['c', 'd']]
  108631. *
  108632. * _.chunk(['a', 'b', 'c', 'd'], 3);
  108633. * // => [['a', 'b', 'c'], ['d']]
  108634. */
  108635. function chunk(array, size, guard) {
  108636. if ((guard ? Object(_isIterateeCall_js__WEBPACK_IMPORTED_MODULE_1__["default"])(array, size, guard) : size === undefined)) {
  108637. size = 1;
  108638. } else {
  108639. size = nativeMax(Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_2__["default"])(size), 0);
  108640. }
  108641. var length = array == null ? 0 : array.length;
  108642. if (!length || size < 1) {
  108643. return [];
  108644. }
  108645. var index = 0,
  108646. resIndex = 0,
  108647. result = Array(nativeCeil(length / size));
  108648. while (index < length) {
  108649. result[resIndex++] = Object(_baseSlice_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, index, (index += size));
  108650. }
  108651. return result;
  108652. }
  108653. /* harmony default export */ __webpack_exports__["default"] = (chunk);
  108654. /***/ }),
  108655. /***/ "./node_modules/lodash-es/clamp.js":
  108656. /*!*****************************************!*\
  108657. !*** ./node_modules/lodash-es/clamp.js ***!
  108658. \*****************************************/
  108659. /*! exports provided: default */
  108660. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  108661. "use strict";
  108662. __webpack_require__.r(__webpack_exports__);
  108663. /* harmony import */ var _baseClamp_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseClamp.js */ "./node_modules/lodash-es/_baseClamp.js");
  108664. /* harmony import */ var _toNumber_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./toNumber.js */ "./node_modules/lodash-es/toNumber.js");
  108665. /**
  108666. * Clamps `number` within the inclusive `lower` and `upper` bounds.
  108667. *
  108668. * @static
  108669. * @memberOf _
  108670. * @since 4.0.0
  108671. * @category Number
  108672. * @param {number} number The number to clamp.
  108673. * @param {number} [lower] The lower bound.
  108674. * @param {number} upper The upper bound.
  108675. * @returns {number} Returns the clamped number.
  108676. * @example
  108677. *
  108678. * _.clamp(-10, -5, 5);
  108679. * // => -5
  108680. *
  108681. * _.clamp(10, -5, 5);
  108682. * // => 5
  108683. */
  108684. function clamp(number, lower, upper) {
  108685. if (upper === undefined) {
  108686. upper = lower;
  108687. lower = undefined;
  108688. }
  108689. if (upper !== undefined) {
  108690. upper = Object(_toNumber_js__WEBPACK_IMPORTED_MODULE_1__["default"])(upper);
  108691. upper = upper === upper ? upper : 0;
  108692. }
  108693. if (lower !== undefined) {
  108694. lower = Object(_toNumber_js__WEBPACK_IMPORTED_MODULE_1__["default"])(lower);
  108695. lower = lower === lower ? lower : 0;
  108696. }
  108697. return Object(_baseClamp_js__WEBPACK_IMPORTED_MODULE_0__["default"])(Object(_toNumber_js__WEBPACK_IMPORTED_MODULE_1__["default"])(number), lower, upper);
  108698. }
  108699. /* harmony default export */ __webpack_exports__["default"] = (clamp);
  108700. /***/ }),
  108701. /***/ "./node_modules/lodash-es/clone.js":
  108702. /*!*****************************************!*\
  108703. !*** ./node_modules/lodash-es/clone.js ***!
  108704. \*****************************************/
  108705. /*! exports provided: default */
  108706. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  108707. "use strict";
  108708. __webpack_require__.r(__webpack_exports__);
  108709. /* harmony import */ var _baseClone_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseClone.js */ "./node_modules/lodash-es/_baseClone.js");
  108710. /** Used to compose bitmasks for cloning. */
  108711. var CLONE_SYMBOLS_FLAG = 4;
  108712. /**
  108713. * Creates a shallow clone of `value`.
  108714. *
  108715. * **Note:** This method is loosely based on the
  108716. * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)
  108717. * and supports cloning arrays, array buffers, booleans, date objects, maps,
  108718. * numbers, `Object` objects, regexes, sets, strings, symbols, and typed
  108719. * arrays. The own enumerable properties of `arguments` objects are cloned
  108720. * as plain objects. An empty object is returned for uncloneable values such
  108721. * as error objects, functions, DOM nodes, and WeakMaps.
  108722. *
  108723. * @static
  108724. * @memberOf _
  108725. * @since 0.1.0
  108726. * @category Lang
  108727. * @param {*} value The value to clone.
  108728. * @returns {*} Returns the cloned value.
  108729. * @see _.cloneDeep
  108730. * @example
  108731. *
  108732. * var objects = [{ 'a': 1 }, { 'b': 2 }];
  108733. *
  108734. * var shallow = _.clone(objects);
  108735. * console.log(shallow[0] === objects[0]);
  108736. * // => true
  108737. */
  108738. function clone(value) {
  108739. return Object(_baseClone_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value, CLONE_SYMBOLS_FLAG);
  108740. }
  108741. /* harmony default export */ __webpack_exports__["default"] = (clone);
  108742. /***/ }),
  108743. /***/ "./node_modules/lodash-es/cloneDeep.js":
  108744. /*!*********************************************!*\
  108745. !*** ./node_modules/lodash-es/cloneDeep.js ***!
  108746. \*********************************************/
  108747. /*! exports provided: default */
  108748. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  108749. "use strict";
  108750. __webpack_require__.r(__webpack_exports__);
  108751. /* harmony import */ var _baseClone_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseClone.js */ "./node_modules/lodash-es/_baseClone.js");
  108752. /** Used to compose bitmasks for cloning. */
  108753. var CLONE_DEEP_FLAG = 1,
  108754. CLONE_SYMBOLS_FLAG = 4;
  108755. /**
  108756. * This method is like `_.clone` except that it recursively clones `value`.
  108757. *
  108758. * @static
  108759. * @memberOf _
  108760. * @since 1.0.0
  108761. * @category Lang
  108762. * @param {*} value The value to recursively clone.
  108763. * @returns {*} Returns the deep cloned value.
  108764. * @see _.clone
  108765. * @example
  108766. *
  108767. * var objects = [{ 'a': 1 }, { 'b': 2 }];
  108768. *
  108769. * var deep = _.cloneDeep(objects);
  108770. * console.log(deep[0] === objects[0]);
  108771. * // => false
  108772. */
  108773. function cloneDeep(value) {
  108774. return Object(_baseClone_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);
  108775. }
  108776. /* harmony default export */ __webpack_exports__["default"] = (cloneDeep);
  108777. /***/ }),
  108778. /***/ "./node_modules/lodash-es/cloneDeepWith.js":
  108779. /*!*************************************************!*\
  108780. !*** ./node_modules/lodash-es/cloneDeepWith.js ***!
  108781. \*************************************************/
  108782. /*! exports provided: default */
  108783. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  108784. "use strict";
  108785. __webpack_require__.r(__webpack_exports__);
  108786. /* harmony import */ var _baseClone_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseClone.js */ "./node_modules/lodash-es/_baseClone.js");
  108787. /** Used to compose bitmasks for cloning. */
  108788. var CLONE_DEEP_FLAG = 1,
  108789. CLONE_SYMBOLS_FLAG = 4;
  108790. /**
  108791. * This method is like `_.cloneWith` except that it recursively clones `value`.
  108792. *
  108793. * @static
  108794. * @memberOf _
  108795. * @since 4.0.0
  108796. * @category Lang
  108797. * @param {*} value The value to recursively clone.
  108798. * @param {Function} [customizer] The function to customize cloning.
  108799. * @returns {*} Returns the deep cloned value.
  108800. * @see _.cloneWith
  108801. * @example
  108802. *
  108803. * function customizer(value) {
  108804. * if (_.isElement(value)) {
  108805. * return value.cloneNode(true);
  108806. * }
  108807. * }
  108808. *
  108809. * var el = _.cloneDeepWith(document.body, customizer);
  108810. *
  108811. * console.log(el === document.body);
  108812. * // => false
  108813. * console.log(el.nodeName);
  108814. * // => 'BODY'
  108815. * console.log(el.childNodes.length);
  108816. * // => 20
  108817. */
  108818. function cloneDeepWith(value, customizer) {
  108819. customizer = typeof customizer == 'function' ? customizer : undefined;
  108820. return Object(_baseClone_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer);
  108821. }
  108822. /* harmony default export */ __webpack_exports__["default"] = (cloneDeepWith);
  108823. /***/ }),
  108824. /***/ "./node_modules/lodash-es/cloneWith.js":
  108825. /*!*********************************************!*\
  108826. !*** ./node_modules/lodash-es/cloneWith.js ***!
  108827. \*********************************************/
  108828. /*! exports provided: default */
  108829. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  108830. "use strict";
  108831. __webpack_require__.r(__webpack_exports__);
  108832. /* harmony import */ var _baseClone_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseClone.js */ "./node_modules/lodash-es/_baseClone.js");
  108833. /** Used to compose bitmasks for cloning. */
  108834. var CLONE_SYMBOLS_FLAG = 4;
  108835. /**
  108836. * This method is like `_.clone` except that it accepts `customizer` which
  108837. * is invoked to produce the cloned value. If `customizer` returns `undefined`,
  108838. * cloning is handled by the method instead. The `customizer` is invoked with
  108839. * up to four arguments; (value [, index|key, object, stack]).
  108840. *
  108841. * @static
  108842. * @memberOf _
  108843. * @since 4.0.0
  108844. * @category Lang
  108845. * @param {*} value The value to clone.
  108846. * @param {Function} [customizer] The function to customize cloning.
  108847. * @returns {*} Returns the cloned value.
  108848. * @see _.cloneDeepWith
  108849. * @example
  108850. *
  108851. * function customizer(value) {
  108852. * if (_.isElement(value)) {
  108853. * return value.cloneNode(false);
  108854. * }
  108855. * }
  108856. *
  108857. * var el = _.cloneWith(document.body, customizer);
  108858. *
  108859. * console.log(el === document.body);
  108860. * // => false
  108861. * console.log(el.nodeName);
  108862. * // => 'BODY'
  108863. * console.log(el.childNodes.length);
  108864. * // => 0
  108865. */
  108866. function cloneWith(value, customizer) {
  108867. customizer = typeof customizer == 'function' ? customizer : undefined;
  108868. return Object(_baseClone_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value, CLONE_SYMBOLS_FLAG, customizer);
  108869. }
  108870. /* harmony default export */ __webpack_exports__["default"] = (cloneWith);
  108871. /***/ }),
  108872. /***/ "./node_modules/lodash-es/collection.default.js":
  108873. /*!******************************************************!*\
  108874. !*** ./node_modules/lodash-es/collection.default.js ***!
  108875. \******************************************************/
  108876. /*! exports provided: default */
  108877. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  108878. "use strict";
  108879. __webpack_require__.r(__webpack_exports__);
  108880. /* harmony import */ var _countBy_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./countBy.js */ "./node_modules/lodash-es/countBy.js");
  108881. /* harmony import */ var _each_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./each.js */ "./node_modules/lodash-es/each.js");
  108882. /* harmony import */ var _eachRight_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./eachRight.js */ "./node_modules/lodash-es/eachRight.js");
  108883. /* harmony import */ var _every_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./every.js */ "./node_modules/lodash-es/every.js");
  108884. /* harmony import */ var _filter_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./filter.js */ "./node_modules/lodash-es/filter.js");
  108885. /* harmony import */ var _find_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./find.js */ "./node_modules/lodash-es/find.js");
  108886. /* harmony import */ var _findLast_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./findLast.js */ "./node_modules/lodash-es/findLast.js");
  108887. /* harmony import */ var _flatMap_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./flatMap.js */ "./node_modules/lodash-es/flatMap.js");
  108888. /* harmony import */ var _flatMapDeep_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./flatMapDeep.js */ "./node_modules/lodash-es/flatMapDeep.js");
  108889. /* harmony import */ var _flatMapDepth_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./flatMapDepth.js */ "./node_modules/lodash-es/flatMapDepth.js");
  108890. /* harmony import */ var _forEach_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./forEach.js */ "./node_modules/lodash-es/forEach.js");
  108891. /* harmony import */ var _forEachRight_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./forEachRight.js */ "./node_modules/lodash-es/forEachRight.js");
  108892. /* harmony import */ var _groupBy_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./groupBy.js */ "./node_modules/lodash-es/groupBy.js");
  108893. /* harmony import */ var _includes_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./includes.js */ "./node_modules/lodash-es/includes.js");
  108894. /* harmony import */ var _invokeMap_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./invokeMap.js */ "./node_modules/lodash-es/invokeMap.js");
  108895. /* harmony import */ var _keyBy_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./keyBy.js */ "./node_modules/lodash-es/keyBy.js");
  108896. /* harmony import */ var _map_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./map.js */ "./node_modules/lodash-es/map.js");
  108897. /* harmony import */ var _orderBy_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./orderBy.js */ "./node_modules/lodash-es/orderBy.js");
  108898. /* harmony import */ var _partition_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./partition.js */ "./node_modules/lodash-es/partition.js");
  108899. /* harmony import */ var _reduce_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./reduce.js */ "./node_modules/lodash-es/reduce.js");
  108900. /* harmony import */ var _reduceRight_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./reduceRight.js */ "./node_modules/lodash-es/reduceRight.js");
  108901. /* harmony import */ var _reject_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./reject.js */ "./node_modules/lodash-es/reject.js");
  108902. /* harmony import */ var _sample_js__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./sample.js */ "./node_modules/lodash-es/sample.js");
  108903. /* harmony import */ var _sampleSize_js__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./sampleSize.js */ "./node_modules/lodash-es/sampleSize.js");
  108904. /* harmony import */ var _shuffle_js__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./shuffle.js */ "./node_modules/lodash-es/shuffle.js");
  108905. /* harmony import */ var _size_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./size.js */ "./node_modules/lodash-es/size.js");
  108906. /* harmony import */ var _some_js__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./some.js */ "./node_modules/lodash-es/some.js");
  108907. /* harmony import */ var _sortBy_js__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./sortBy.js */ "./node_modules/lodash-es/sortBy.js");
  108908. /* harmony default export */ __webpack_exports__["default"] = ({
  108909. 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"],
  108910. 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"],
  108911. 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"],
  108912. 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"],
  108913. 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"],
  108914. size: _size_js__WEBPACK_IMPORTED_MODULE_25__["default"], some: _some_js__WEBPACK_IMPORTED_MODULE_26__["default"], sortBy: _sortBy_js__WEBPACK_IMPORTED_MODULE_27__["default"]
  108915. });
  108916. /***/ }),
  108917. /***/ "./node_modules/lodash-es/collection.js":
  108918. /*!**********************************************!*\
  108919. !*** ./node_modules/lodash-es/collection.js ***!
  108920. \**********************************************/
  108921. /*! 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 */
  108922. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  108923. "use strict";
  108924. __webpack_require__.r(__webpack_exports__);
  108925. /* harmony import */ var _countBy_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./countBy.js */ "./node_modules/lodash-es/countBy.js");
  108926. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "countBy", function() { return _countBy_js__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  108927. /* harmony import */ var _each_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./each.js */ "./node_modules/lodash-es/each.js");
  108928. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "each", function() { return _each_js__WEBPACK_IMPORTED_MODULE_1__["default"]; });
  108929. /* harmony import */ var _eachRight_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./eachRight.js */ "./node_modules/lodash-es/eachRight.js");
  108930. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "eachRight", function() { return _eachRight_js__WEBPACK_IMPORTED_MODULE_2__["default"]; });
  108931. /* harmony import */ var _every_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./every.js */ "./node_modules/lodash-es/every.js");
  108932. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "every", function() { return _every_js__WEBPACK_IMPORTED_MODULE_3__["default"]; });
  108933. /* harmony import */ var _filter_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./filter.js */ "./node_modules/lodash-es/filter.js");
  108934. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "filter", function() { return _filter_js__WEBPACK_IMPORTED_MODULE_4__["default"]; });
  108935. /* harmony import */ var _find_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./find.js */ "./node_modules/lodash-es/find.js");
  108936. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "find", function() { return _find_js__WEBPACK_IMPORTED_MODULE_5__["default"]; });
  108937. /* harmony import */ var _findLast_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./findLast.js */ "./node_modules/lodash-es/findLast.js");
  108938. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "findLast", function() { return _findLast_js__WEBPACK_IMPORTED_MODULE_6__["default"]; });
  108939. /* harmony import */ var _flatMap_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./flatMap.js */ "./node_modules/lodash-es/flatMap.js");
  108940. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "flatMap", function() { return _flatMap_js__WEBPACK_IMPORTED_MODULE_7__["default"]; });
  108941. /* harmony import */ var _flatMapDeep_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./flatMapDeep.js */ "./node_modules/lodash-es/flatMapDeep.js");
  108942. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "flatMapDeep", function() { return _flatMapDeep_js__WEBPACK_IMPORTED_MODULE_8__["default"]; });
  108943. /* harmony import */ var _flatMapDepth_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./flatMapDepth.js */ "./node_modules/lodash-es/flatMapDepth.js");
  108944. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "flatMapDepth", function() { return _flatMapDepth_js__WEBPACK_IMPORTED_MODULE_9__["default"]; });
  108945. /* harmony import */ var _forEach_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./forEach.js */ "./node_modules/lodash-es/forEach.js");
  108946. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "forEach", function() { return _forEach_js__WEBPACK_IMPORTED_MODULE_10__["default"]; });
  108947. /* harmony import */ var _forEachRight_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./forEachRight.js */ "./node_modules/lodash-es/forEachRight.js");
  108948. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "forEachRight", function() { return _forEachRight_js__WEBPACK_IMPORTED_MODULE_11__["default"]; });
  108949. /* harmony import */ var _groupBy_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./groupBy.js */ "./node_modules/lodash-es/groupBy.js");
  108950. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "groupBy", function() { return _groupBy_js__WEBPACK_IMPORTED_MODULE_12__["default"]; });
  108951. /* harmony import */ var _includes_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./includes.js */ "./node_modules/lodash-es/includes.js");
  108952. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "includes", function() { return _includes_js__WEBPACK_IMPORTED_MODULE_13__["default"]; });
  108953. /* harmony import */ var _invokeMap_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./invokeMap.js */ "./node_modules/lodash-es/invokeMap.js");
  108954. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "invokeMap", function() { return _invokeMap_js__WEBPACK_IMPORTED_MODULE_14__["default"]; });
  108955. /* harmony import */ var _keyBy_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./keyBy.js */ "./node_modules/lodash-es/keyBy.js");
  108956. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "keyBy", function() { return _keyBy_js__WEBPACK_IMPORTED_MODULE_15__["default"]; });
  108957. /* harmony import */ var _map_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./map.js */ "./node_modules/lodash-es/map.js");
  108958. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "map", function() { return _map_js__WEBPACK_IMPORTED_MODULE_16__["default"]; });
  108959. /* harmony import */ var _orderBy_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./orderBy.js */ "./node_modules/lodash-es/orderBy.js");
  108960. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "orderBy", function() { return _orderBy_js__WEBPACK_IMPORTED_MODULE_17__["default"]; });
  108961. /* harmony import */ var _partition_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./partition.js */ "./node_modules/lodash-es/partition.js");
  108962. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "partition", function() { return _partition_js__WEBPACK_IMPORTED_MODULE_18__["default"]; });
  108963. /* harmony import */ var _reduce_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./reduce.js */ "./node_modules/lodash-es/reduce.js");
  108964. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "reduce", function() { return _reduce_js__WEBPACK_IMPORTED_MODULE_19__["default"]; });
  108965. /* harmony import */ var _reduceRight_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./reduceRight.js */ "./node_modules/lodash-es/reduceRight.js");
  108966. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "reduceRight", function() { return _reduceRight_js__WEBPACK_IMPORTED_MODULE_20__["default"]; });
  108967. /* harmony import */ var _reject_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./reject.js */ "./node_modules/lodash-es/reject.js");
  108968. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "reject", function() { return _reject_js__WEBPACK_IMPORTED_MODULE_21__["default"]; });
  108969. /* harmony import */ var _sample_js__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./sample.js */ "./node_modules/lodash-es/sample.js");
  108970. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "sample", function() { return _sample_js__WEBPACK_IMPORTED_MODULE_22__["default"]; });
  108971. /* harmony import */ var _sampleSize_js__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./sampleSize.js */ "./node_modules/lodash-es/sampleSize.js");
  108972. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "sampleSize", function() { return _sampleSize_js__WEBPACK_IMPORTED_MODULE_23__["default"]; });
  108973. /* harmony import */ var _shuffle_js__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./shuffle.js */ "./node_modules/lodash-es/shuffle.js");
  108974. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "shuffle", function() { return _shuffle_js__WEBPACK_IMPORTED_MODULE_24__["default"]; });
  108975. /* harmony import */ var _size_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./size.js */ "./node_modules/lodash-es/size.js");
  108976. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "size", function() { return _size_js__WEBPACK_IMPORTED_MODULE_25__["default"]; });
  108977. /* harmony import */ var _some_js__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./some.js */ "./node_modules/lodash-es/some.js");
  108978. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "some", function() { return _some_js__WEBPACK_IMPORTED_MODULE_26__["default"]; });
  108979. /* harmony import */ var _sortBy_js__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./sortBy.js */ "./node_modules/lodash-es/sortBy.js");
  108980. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "sortBy", function() { return _sortBy_js__WEBPACK_IMPORTED_MODULE_27__["default"]; });
  108981. /* harmony import */ var _collection_default_js__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./collection.default.js */ "./node_modules/lodash-es/collection.default.js");
  108982. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _collection_default_js__WEBPACK_IMPORTED_MODULE_28__["default"]; });
  108983. /***/ }),
  108984. /***/ "./node_modules/lodash-es/commit.js":
  108985. /*!******************************************!*\
  108986. !*** ./node_modules/lodash-es/commit.js ***!
  108987. \******************************************/
  108988. /*! exports provided: default */
  108989. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  108990. "use strict";
  108991. __webpack_require__.r(__webpack_exports__);
  108992. /* harmony import */ var _LodashWrapper_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_LodashWrapper.js */ "./node_modules/lodash-es/_LodashWrapper.js");
  108993. /**
  108994. * Executes the chain sequence and returns the wrapped result.
  108995. *
  108996. * @name commit
  108997. * @memberOf _
  108998. * @since 3.2.0
  108999. * @category Seq
  109000. * @returns {Object} Returns the new `lodash` wrapper instance.
  109001. * @example
  109002. *
  109003. * var array = [1, 2];
  109004. * var wrapped = _(array).push(3);
  109005. *
  109006. * console.log(array);
  109007. * // => [1, 2]
  109008. *
  109009. * wrapped = wrapped.commit();
  109010. * console.log(array);
  109011. * // => [1, 2, 3]
  109012. *
  109013. * wrapped.last();
  109014. * // => 3
  109015. *
  109016. * console.log(array);
  109017. * // => [1, 2, 3]
  109018. */
  109019. function wrapperCommit() {
  109020. return new _LodashWrapper_js__WEBPACK_IMPORTED_MODULE_0__["default"](this.value(), this.__chain__);
  109021. }
  109022. /* harmony default export */ __webpack_exports__["default"] = (wrapperCommit);
  109023. /***/ }),
  109024. /***/ "./node_modules/lodash-es/compact.js":
  109025. /*!*******************************************!*\
  109026. !*** ./node_modules/lodash-es/compact.js ***!
  109027. \*******************************************/
  109028. /*! exports provided: default */
  109029. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  109030. "use strict";
  109031. __webpack_require__.r(__webpack_exports__);
  109032. /**
  109033. * Creates an array with all falsey values removed. The values `false`, `null`,
  109034. * `0`, `""`, `undefined`, and `NaN` are falsey.
  109035. *
  109036. * @static
  109037. * @memberOf _
  109038. * @since 0.1.0
  109039. * @category Array
  109040. * @param {Array} array The array to compact.
  109041. * @returns {Array} Returns the new array of filtered values.
  109042. * @example
  109043. *
  109044. * _.compact([0, 1, false, 2, '', 3]);
  109045. * // => [1, 2, 3]
  109046. */
  109047. function compact(array) {
  109048. var index = -1,
  109049. length = array == null ? 0 : array.length,
  109050. resIndex = 0,
  109051. result = [];
  109052. while (++index < length) {
  109053. var value = array[index];
  109054. if (value) {
  109055. result[resIndex++] = value;
  109056. }
  109057. }
  109058. return result;
  109059. }
  109060. /* harmony default export */ __webpack_exports__["default"] = (compact);
  109061. /***/ }),
  109062. /***/ "./node_modules/lodash-es/concat.js":
  109063. /*!******************************************!*\
  109064. !*** ./node_modules/lodash-es/concat.js ***!
  109065. \******************************************/
  109066. /*! exports provided: default */
  109067. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  109068. "use strict";
  109069. __webpack_require__.r(__webpack_exports__);
  109070. /* harmony import */ var _arrayPush_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayPush.js */ "./node_modules/lodash-es/_arrayPush.js");
  109071. /* harmony import */ var _baseFlatten_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseFlatten.js */ "./node_modules/lodash-es/_baseFlatten.js");
  109072. /* harmony import */ var _copyArray_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_copyArray.js */ "./node_modules/lodash-es/_copyArray.js");
  109073. /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
  109074. /**
  109075. * Creates a new array concatenating `array` with any additional arrays
  109076. * and/or values.
  109077. *
  109078. * @static
  109079. * @memberOf _
  109080. * @since 4.0.0
  109081. * @category Array
  109082. * @param {Array} array The array to concatenate.
  109083. * @param {...*} [values] The values to concatenate.
  109084. * @returns {Array} Returns the new concatenated array.
  109085. * @example
  109086. *
  109087. * var array = [1];
  109088. * var other = _.concat(array, 2, [3], [[4]]);
  109089. *
  109090. * console.log(other);
  109091. * // => [1, 2, 3, [4]]
  109092. *
  109093. * console.log(array);
  109094. * // => [1]
  109095. */
  109096. function concat() {
  109097. var length = arguments.length;
  109098. if (!length) {
  109099. return [];
  109100. }
  109101. var args = Array(length - 1),
  109102. array = arguments[0],
  109103. index = length;
  109104. while (index--) {
  109105. args[index - 1] = arguments[index];
  109106. }
  109107. 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));
  109108. }
  109109. /* harmony default export */ __webpack_exports__["default"] = (concat);
  109110. /***/ }),
  109111. /***/ "./node_modules/lodash-es/cond.js":
  109112. /*!****************************************!*\
  109113. !*** ./node_modules/lodash-es/cond.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 _apply_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_apply.js */ "./node_modules/lodash-es/_apply.js");
  109120. /* harmony import */ var _arrayMap_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_arrayMap.js */ "./node_modules/lodash-es/_arrayMap.js");
  109121. /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
  109122. /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
  109123. /** Error message constants. */
  109124. var FUNC_ERROR_TEXT = 'Expected a function';
  109125. /**
  109126. * Creates a function that iterates over `pairs` and invokes the corresponding
  109127. * function of the first predicate to return truthy. The predicate-function
  109128. * pairs are invoked with the `this` binding and arguments of the created
  109129. * function.
  109130. *
  109131. * @static
  109132. * @memberOf _
  109133. * @since 4.0.0
  109134. * @category Util
  109135. * @param {Array} pairs The predicate-function pairs.
  109136. * @returns {Function} Returns the new composite function.
  109137. * @example
  109138. *
  109139. * var func = _.cond([
  109140. * [_.matches({ 'a': 1 }), _.constant('matches A')],
  109141. * [_.conforms({ 'b': _.isNumber }), _.constant('matches B')],
  109142. * [_.stubTrue, _.constant('no match')]
  109143. * ]);
  109144. *
  109145. * func({ 'a': 1, 'b': 2 });
  109146. * // => 'matches A'
  109147. *
  109148. * func({ 'a': 0, 'b': 1 });
  109149. * // => 'matches B'
  109150. *
  109151. * func({ 'a': '1', 'b': '2' });
  109152. * // => 'no match'
  109153. */
  109154. function cond(pairs) {
  109155. var length = pairs == null ? 0 : pairs.length,
  109156. toIteratee = _baseIteratee_js__WEBPACK_IMPORTED_MODULE_2__["default"];
  109157. pairs = !length ? [] : Object(_arrayMap_js__WEBPACK_IMPORTED_MODULE_1__["default"])(pairs, function(pair) {
  109158. if (typeof pair[1] != 'function') {
  109159. throw new TypeError(FUNC_ERROR_TEXT);
  109160. }
  109161. return [toIteratee(pair[0]), pair[1]];
  109162. });
  109163. return Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_3__["default"])(function(args) {
  109164. var index = -1;
  109165. while (++index < length) {
  109166. var pair = pairs[index];
  109167. if (Object(_apply_js__WEBPACK_IMPORTED_MODULE_0__["default"])(pair[0], this, args)) {
  109168. return Object(_apply_js__WEBPACK_IMPORTED_MODULE_0__["default"])(pair[1], this, args);
  109169. }
  109170. }
  109171. });
  109172. }
  109173. /* harmony default export */ __webpack_exports__["default"] = (cond);
  109174. /***/ }),
  109175. /***/ "./node_modules/lodash-es/conforms.js":
  109176. /*!********************************************!*\
  109177. !*** ./node_modules/lodash-es/conforms.js ***!
  109178. \********************************************/
  109179. /*! exports provided: default */
  109180. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  109181. "use strict";
  109182. __webpack_require__.r(__webpack_exports__);
  109183. /* harmony import */ var _baseClone_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseClone.js */ "./node_modules/lodash-es/_baseClone.js");
  109184. /* harmony import */ var _baseConforms_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseConforms.js */ "./node_modules/lodash-es/_baseConforms.js");
  109185. /** Used to compose bitmasks for cloning. */
  109186. var CLONE_DEEP_FLAG = 1;
  109187. /**
  109188. * Creates a function that invokes the predicate properties of `source` with
  109189. * the corresponding property values of a given object, returning `true` if
  109190. * all predicates return truthy, else `false`.
  109191. *
  109192. * **Note:** The created function is equivalent to `_.conformsTo` with
  109193. * `source` partially applied.
  109194. *
  109195. * @static
  109196. * @memberOf _
  109197. * @since 4.0.0
  109198. * @category Util
  109199. * @param {Object} source The object of property predicates to conform to.
  109200. * @returns {Function} Returns the new spec function.
  109201. * @example
  109202. *
  109203. * var objects = [
  109204. * { 'a': 2, 'b': 1 },
  109205. * { 'a': 1, 'b': 2 }
  109206. * ];
  109207. *
  109208. * _.filter(objects, _.conforms({ 'b': function(n) { return n > 1; } }));
  109209. * // => [{ 'a': 1, 'b': 2 }]
  109210. */
  109211. function conforms(source) {
  109212. return Object(_baseConforms_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Object(_baseClone_js__WEBPACK_IMPORTED_MODULE_0__["default"])(source, CLONE_DEEP_FLAG));
  109213. }
  109214. /* harmony default export */ __webpack_exports__["default"] = (conforms);
  109215. /***/ }),
  109216. /***/ "./node_modules/lodash-es/conformsTo.js":
  109217. /*!**********************************************!*\
  109218. !*** ./node_modules/lodash-es/conformsTo.js ***!
  109219. \**********************************************/
  109220. /*! exports provided: default */
  109221. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  109222. "use strict";
  109223. __webpack_require__.r(__webpack_exports__);
  109224. /* harmony import */ var _baseConformsTo_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseConformsTo.js */ "./node_modules/lodash-es/_baseConformsTo.js");
  109225. /* harmony import */ var _keys_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./keys.js */ "./node_modules/lodash-es/keys.js");
  109226. /**
  109227. * Checks if `object` conforms to `source` by invoking the predicate
  109228. * properties of `source` with the corresponding property values of `object`.
  109229. *
  109230. * **Note:** This method is equivalent to `_.conforms` when `source` is
  109231. * partially applied.
  109232. *
  109233. * @static
  109234. * @memberOf _
  109235. * @since 4.14.0
  109236. * @category Lang
  109237. * @param {Object} object The object to inspect.
  109238. * @param {Object} source The object of property predicates to conform to.
  109239. * @returns {boolean} Returns `true` if `object` conforms, else `false`.
  109240. * @example
  109241. *
  109242. * var object = { 'a': 1, 'b': 2 };
  109243. *
  109244. * _.conformsTo(object, { 'b': function(n) { return n > 1; } });
  109245. * // => true
  109246. *
  109247. * _.conformsTo(object, { 'b': function(n) { return n > 2; } });
  109248. * // => false
  109249. */
  109250. function conformsTo(object, source) {
  109251. return source == null || Object(_baseConformsTo_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, source, Object(_keys_js__WEBPACK_IMPORTED_MODULE_1__["default"])(source));
  109252. }
  109253. /* harmony default export */ __webpack_exports__["default"] = (conformsTo);
  109254. /***/ }),
  109255. /***/ "./node_modules/lodash-es/constant.js":
  109256. /*!********************************************!*\
  109257. !*** ./node_modules/lodash-es/constant.js ***!
  109258. \********************************************/
  109259. /*! exports provided: default */
  109260. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  109261. "use strict";
  109262. __webpack_require__.r(__webpack_exports__);
  109263. /**
  109264. * Creates a function that returns `value`.
  109265. *
  109266. * @static
  109267. * @memberOf _
  109268. * @since 2.4.0
  109269. * @category Util
  109270. * @param {*} value The value to return from the new function.
  109271. * @returns {Function} Returns the new constant function.
  109272. * @example
  109273. *
  109274. * var objects = _.times(2, _.constant({ 'a': 1 }));
  109275. *
  109276. * console.log(objects);
  109277. * // => [{ 'a': 1 }, { 'a': 1 }]
  109278. *
  109279. * console.log(objects[0] === objects[1]);
  109280. * // => true
  109281. */
  109282. function constant(value) {
  109283. return function() {
  109284. return value;
  109285. };
  109286. }
  109287. /* harmony default export */ __webpack_exports__["default"] = (constant);
  109288. /***/ }),
  109289. /***/ "./node_modules/lodash-es/countBy.js":
  109290. /*!*******************************************!*\
  109291. !*** ./node_modules/lodash-es/countBy.js ***!
  109292. \*******************************************/
  109293. /*! exports provided: default */
  109294. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  109295. "use strict";
  109296. __webpack_require__.r(__webpack_exports__);
  109297. /* harmony import */ var _baseAssignValue_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseAssignValue.js */ "./node_modules/lodash-es/_baseAssignValue.js");
  109298. /* harmony import */ var _createAggregator_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_createAggregator.js */ "./node_modules/lodash-es/_createAggregator.js");
  109299. /** Used for built-in method references. */
  109300. var objectProto = Object.prototype;
  109301. /** Used to check objects for own properties. */
  109302. var hasOwnProperty = objectProto.hasOwnProperty;
  109303. /**
  109304. * Creates an object composed of keys generated from the results of running
  109305. * each element of `collection` thru `iteratee`. The corresponding value of
  109306. * each key is the number of times the key was returned by `iteratee`. The
  109307. * iteratee is invoked with one argument: (value).
  109308. *
  109309. * @static
  109310. * @memberOf _
  109311. * @since 0.5.0
  109312. * @category Collection
  109313. * @param {Array|Object} collection The collection to iterate over.
  109314. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  109315. * @returns {Object} Returns the composed aggregate object.
  109316. * @example
  109317. *
  109318. * _.countBy([6.1, 4.2, 6.3], Math.floor);
  109319. * // => { '4': 1, '6': 2 }
  109320. *
  109321. * // The `_.property` iteratee shorthand.
  109322. * _.countBy(['one', 'two', 'three'], 'length');
  109323. * // => { '3': 2, '5': 1 }
  109324. */
  109325. var countBy = Object(_createAggregator_js__WEBPACK_IMPORTED_MODULE_1__["default"])(function(result, value, key) {
  109326. if (hasOwnProperty.call(result, key)) {
  109327. ++result[key];
  109328. } else {
  109329. Object(_baseAssignValue_js__WEBPACK_IMPORTED_MODULE_0__["default"])(result, key, 1);
  109330. }
  109331. });
  109332. /* harmony default export */ __webpack_exports__["default"] = (countBy);
  109333. /***/ }),
  109334. /***/ "./node_modules/lodash-es/create.js":
  109335. /*!******************************************!*\
  109336. !*** ./node_modules/lodash-es/create.js ***!
  109337. \******************************************/
  109338. /*! exports provided: default */
  109339. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  109340. "use strict";
  109341. __webpack_require__.r(__webpack_exports__);
  109342. /* harmony import */ var _baseAssign_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseAssign.js */ "./node_modules/lodash-es/_baseAssign.js");
  109343. /* harmony import */ var _baseCreate_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseCreate.js */ "./node_modules/lodash-es/_baseCreate.js");
  109344. /**
  109345. * Creates an object that inherits from the `prototype` object. If a
  109346. * `properties` object is given, its own enumerable string keyed properties
  109347. * are assigned to the created object.
  109348. *
  109349. * @static
  109350. * @memberOf _
  109351. * @since 2.3.0
  109352. * @category Object
  109353. * @param {Object} prototype The object to inherit from.
  109354. * @param {Object} [properties] The properties to assign to the object.
  109355. * @returns {Object} Returns the new object.
  109356. * @example
  109357. *
  109358. * function Shape() {
  109359. * this.x = 0;
  109360. * this.y = 0;
  109361. * }
  109362. *
  109363. * function Circle() {
  109364. * Shape.call(this);
  109365. * }
  109366. *
  109367. * Circle.prototype = _.create(Shape.prototype, {
  109368. * 'constructor': Circle
  109369. * });
  109370. *
  109371. * var circle = new Circle;
  109372. * circle instanceof Circle;
  109373. * // => true
  109374. *
  109375. * circle instanceof Shape;
  109376. * // => true
  109377. */
  109378. function create(prototype, properties) {
  109379. var result = Object(_baseCreate_js__WEBPACK_IMPORTED_MODULE_1__["default"])(prototype);
  109380. return properties == null ? result : Object(_baseAssign_js__WEBPACK_IMPORTED_MODULE_0__["default"])(result, properties);
  109381. }
  109382. /* harmony default export */ __webpack_exports__["default"] = (create);
  109383. /***/ }),
  109384. /***/ "./node_modules/lodash-es/curry.js":
  109385. /*!*****************************************!*\
  109386. !*** ./node_modules/lodash-es/curry.js ***!
  109387. \*****************************************/
  109388. /*! exports provided: default */
  109389. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  109390. "use strict";
  109391. __webpack_require__.r(__webpack_exports__);
  109392. /* harmony import */ var _createWrap_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createWrap.js */ "./node_modules/lodash-es/_createWrap.js");
  109393. /** Used to compose bitmasks for function metadata. */
  109394. var WRAP_CURRY_FLAG = 8;
  109395. /**
  109396. * Creates a function that accepts arguments of `func` and either invokes
  109397. * `func` returning its result, if at least `arity` number of arguments have
  109398. * been provided, or returns a function that accepts the remaining `func`
  109399. * arguments, and so on. The arity of `func` may be specified if `func.length`
  109400. * is not sufficient.
  109401. *
  109402. * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds,
  109403. * may be used as a placeholder for provided arguments.
  109404. *
  109405. * **Note:** This method doesn't set the "length" property of curried functions.
  109406. *
  109407. * @static
  109408. * @memberOf _
  109409. * @since 2.0.0
  109410. * @category Function
  109411. * @param {Function} func The function to curry.
  109412. * @param {number} [arity=func.length] The arity of `func`.
  109413. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  109414. * @returns {Function} Returns the new curried function.
  109415. * @example
  109416. *
  109417. * var abc = function(a, b, c) {
  109418. * return [a, b, c];
  109419. * };
  109420. *
  109421. * var curried = _.curry(abc);
  109422. *
  109423. * curried(1)(2)(3);
  109424. * // => [1, 2, 3]
  109425. *
  109426. * curried(1, 2)(3);
  109427. * // => [1, 2, 3]
  109428. *
  109429. * curried(1, 2, 3);
  109430. * // => [1, 2, 3]
  109431. *
  109432. * // Curried with placeholders.
  109433. * curried(1)(_, 3)(2);
  109434. * // => [1, 2, 3]
  109435. */
  109436. function curry(func, arity, guard) {
  109437. arity = guard ? undefined : arity;
  109438. var result = Object(_createWrap_js__WEBPACK_IMPORTED_MODULE_0__["default"])(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
  109439. result.placeholder = curry.placeholder;
  109440. return result;
  109441. }
  109442. // Assign default placeholders.
  109443. curry.placeholder = {};
  109444. /* harmony default export */ __webpack_exports__["default"] = (curry);
  109445. /***/ }),
  109446. /***/ "./node_modules/lodash-es/curryRight.js":
  109447. /*!**********************************************!*\
  109448. !*** ./node_modules/lodash-es/curryRight.js ***!
  109449. \**********************************************/
  109450. /*! exports provided: default */
  109451. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  109452. "use strict";
  109453. __webpack_require__.r(__webpack_exports__);
  109454. /* harmony import */ var _createWrap_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createWrap.js */ "./node_modules/lodash-es/_createWrap.js");
  109455. /** Used to compose bitmasks for function metadata. */
  109456. var WRAP_CURRY_RIGHT_FLAG = 16;
  109457. /**
  109458. * This method is like `_.curry` except that arguments are applied to `func`
  109459. * in the manner of `_.partialRight` instead of `_.partial`.
  109460. *
  109461. * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic
  109462. * builds, may be used as a placeholder for provided arguments.
  109463. *
  109464. * **Note:** This method doesn't set the "length" property of curried functions.
  109465. *
  109466. * @static
  109467. * @memberOf _
  109468. * @since 3.0.0
  109469. * @category Function
  109470. * @param {Function} func The function to curry.
  109471. * @param {number} [arity=func.length] The arity of `func`.
  109472. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  109473. * @returns {Function} Returns the new curried function.
  109474. * @example
  109475. *
  109476. * var abc = function(a, b, c) {
  109477. * return [a, b, c];
  109478. * };
  109479. *
  109480. * var curried = _.curryRight(abc);
  109481. *
  109482. * curried(3)(2)(1);
  109483. * // => [1, 2, 3]
  109484. *
  109485. * curried(2, 3)(1);
  109486. * // => [1, 2, 3]
  109487. *
  109488. * curried(1, 2, 3);
  109489. * // => [1, 2, 3]
  109490. *
  109491. * // Curried with placeholders.
  109492. * curried(3)(1, _)(2);
  109493. * // => [1, 2, 3]
  109494. */
  109495. function curryRight(func, arity, guard) {
  109496. arity = guard ? undefined : arity;
  109497. var result = Object(_createWrap_js__WEBPACK_IMPORTED_MODULE_0__["default"])(func, WRAP_CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
  109498. result.placeholder = curryRight.placeholder;
  109499. return result;
  109500. }
  109501. // Assign default placeholders.
  109502. curryRight.placeholder = {};
  109503. /* harmony default export */ __webpack_exports__["default"] = (curryRight);
  109504. /***/ }),
  109505. /***/ "./node_modules/lodash-es/date.default.js":
  109506. /*!************************************************!*\
  109507. !*** ./node_modules/lodash-es/date.default.js ***!
  109508. \************************************************/
  109509. /*! exports provided: default */
  109510. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  109511. "use strict";
  109512. __webpack_require__.r(__webpack_exports__);
  109513. /* harmony import */ var _now_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./now.js */ "./node_modules/lodash-es/now.js");
  109514. /* harmony default export */ __webpack_exports__["default"] = ({
  109515. now: _now_js__WEBPACK_IMPORTED_MODULE_0__["default"]
  109516. });
  109517. /***/ }),
  109518. /***/ "./node_modules/lodash-es/date.js":
  109519. /*!****************************************!*\
  109520. !*** ./node_modules/lodash-es/date.js ***!
  109521. \****************************************/
  109522. /*! exports provided: now, default */
  109523. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  109524. "use strict";
  109525. __webpack_require__.r(__webpack_exports__);
  109526. /* harmony import */ var _now_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./now.js */ "./node_modules/lodash-es/now.js");
  109527. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "now", function() { return _now_js__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  109528. /* harmony import */ var _date_default_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./date.default.js */ "./node_modules/lodash-es/date.default.js");
  109529. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _date_default_js__WEBPACK_IMPORTED_MODULE_1__["default"]; });
  109530. /***/ }),
  109531. /***/ "./node_modules/lodash-es/debounce.js":
  109532. /*!********************************************!*\
  109533. !*** ./node_modules/lodash-es/debounce.js ***!
  109534. \********************************************/
  109535. /*! exports provided: default */
  109536. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  109537. "use strict";
  109538. __webpack_require__.r(__webpack_exports__);
  109539. /* harmony import */ var _isObject_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isObject.js */ "./node_modules/lodash-es/isObject.js");
  109540. /* harmony import */ var _now_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./now.js */ "./node_modules/lodash-es/now.js");
  109541. /* harmony import */ var _toNumber_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./toNumber.js */ "./node_modules/lodash-es/toNumber.js");
  109542. /** Error message constants. */
  109543. var FUNC_ERROR_TEXT = 'Expected a function';
  109544. /* Built-in method references for those with the same name as other `lodash` methods. */
  109545. var nativeMax = Math.max,
  109546. nativeMin = Math.min;
  109547. /**
  109548. * Creates a debounced function that delays invoking `func` until after `wait`
  109549. * milliseconds have elapsed since the last time the debounced function was
  109550. * invoked. The debounced function comes with a `cancel` method to cancel
  109551. * delayed `func` invocations and a `flush` method to immediately invoke them.
  109552. * Provide `options` to indicate whether `func` should be invoked on the
  109553. * leading and/or trailing edge of the `wait` timeout. The `func` is invoked
  109554. * with the last arguments provided to the debounced function. Subsequent
  109555. * calls to the debounced function return the result of the last `func`
  109556. * invocation.
  109557. *
  109558. * **Note:** If `leading` and `trailing` options are `true`, `func` is
  109559. * invoked on the trailing edge of the timeout only if the debounced function
  109560. * is invoked more than once during the `wait` timeout.
  109561. *
  109562. * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
  109563. * until to the next tick, similar to `setTimeout` with a timeout of `0`.
  109564. *
  109565. * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
  109566. * for details over the differences between `_.debounce` and `_.throttle`.
  109567. *
  109568. * @static
  109569. * @memberOf _
  109570. * @since 0.1.0
  109571. * @category Function
  109572. * @param {Function} func The function to debounce.
  109573. * @param {number} [wait=0] The number of milliseconds to delay.
  109574. * @param {Object} [options={}] The options object.
  109575. * @param {boolean} [options.leading=false]
  109576. * Specify invoking on the leading edge of the timeout.
  109577. * @param {number} [options.maxWait]
  109578. * The maximum time `func` is allowed to be delayed before it's invoked.
  109579. * @param {boolean} [options.trailing=true]
  109580. * Specify invoking on the trailing edge of the timeout.
  109581. * @returns {Function} Returns the new debounced function.
  109582. * @example
  109583. *
  109584. * // Avoid costly calculations while the window size is in flux.
  109585. * jQuery(window).on('resize', _.debounce(calculateLayout, 150));
  109586. *
  109587. * // Invoke `sendMail` when clicked, debouncing subsequent calls.
  109588. * jQuery(element).on('click', _.debounce(sendMail, 300, {
  109589. * 'leading': true,
  109590. * 'trailing': false
  109591. * }));
  109592. *
  109593. * // Ensure `batchLog` is invoked once after 1 second of debounced calls.
  109594. * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
  109595. * var source = new EventSource('/stream');
  109596. * jQuery(source).on('message', debounced);
  109597. *
  109598. * // Cancel the trailing debounced invocation.
  109599. * jQuery(window).on('popstate', debounced.cancel);
  109600. */
  109601. function debounce(func, wait, options) {
  109602. var lastArgs,
  109603. lastThis,
  109604. maxWait,
  109605. result,
  109606. timerId,
  109607. lastCallTime,
  109608. lastInvokeTime = 0,
  109609. leading = false,
  109610. maxing = false,
  109611. trailing = true;
  109612. if (typeof func != 'function') {
  109613. throw new TypeError(FUNC_ERROR_TEXT);
  109614. }
  109615. wait = Object(_toNumber_js__WEBPACK_IMPORTED_MODULE_2__["default"])(wait) || 0;
  109616. if (Object(_isObject_js__WEBPACK_IMPORTED_MODULE_0__["default"])(options)) {
  109617. leading = !!options.leading;
  109618. maxing = 'maxWait' in options;
  109619. maxWait = maxing ? nativeMax(Object(_toNumber_js__WEBPACK_IMPORTED_MODULE_2__["default"])(options.maxWait) || 0, wait) : maxWait;
  109620. trailing = 'trailing' in options ? !!options.trailing : trailing;
  109621. }
  109622. function invokeFunc(time) {
  109623. var args = lastArgs,
  109624. thisArg = lastThis;
  109625. lastArgs = lastThis = undefined;
  109626. lastInvokeTime = time;
  109627. result = func.apply(thisArg, args);
  109628. return result;
  109629. }
  109630. function leadingEdge(time) {
  109631. // Reset any `maxWait` timer.
  109632. lastInvokeTime = time;
  109633. // Start the timer for the trailing edge.
  109634. timerId = setTimeout(timerExpired, wait);
  109635. // Invoke the leading edge.
  109636. return leading ? invokeFunc(time) : result;
  109637. }
  109638. function remainingWait(time) {
  109639. var timeSinceLastCall = time - lastCallTime,
  109640. timeSinceLastInvoke = time - lastInvokeTime,
  109641. timeWaiting = wait - timeSinceLastCall;
  109642. return maxing
  109643. ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)
  109644. : timeWaiting;
  109645. }
  109646. function shouldInvoke(time) {
  109647. var timeSinceLastCall = time - lastCallTime,
  109648. timeSinceLastInvoke = time - lastInvokeTime;
  109649. // Either this is the first call, activity has stopped and we're at the
  109650. // trailing edge, the system time has gone backwards and we're treating
  109651. // it as the trailing edge, or we've hit the `maxWait` limit.
  109652. return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||
  109653. (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));
  109654. }
  109655. function timerExpired() {
  109656. var time = Object(_now_js__WEBPACK_IMPORTED_MODULE_1__["default"])();
  109657. if (shouldInvoke(time)) {
  109658. return trailingEdge(time);
  109659. }
  109660. // Restart the timer.
  109661. timerId = setTimeout(timerExpired, remainingWait(time));
  109662. }
  109663. function trailingEdge(time) {
  109664. timerId = undefined;
  109665. // Only invoke if we have `lastArgs` which means `func` has been
  109666. // debounced at least once.
  109667. if (trailing && lastArgs) {
  109668. return invokeFunc(time);
  109669. }
  109670. lastArgs = lastThis = undefined;
  109671. return result;
  109672. }
  109673. function cancel() {
  109674. if (timerId !== undefined) {
  109675. clearTimeout(timerId);
  109676. }
  109677. lastInvokeTime = 0;
  109678. lastArgs = lastCallTime = lastThis = timerId = undefined;
  109679. }
  109680. function flush() {
  109681. return timerId === undefined ? result : trailingEdge(Object(_now_js__WEBPACK_IMPORTED_MODULE_1__["default"])());
  109682. }
  109683. function debounced() {
  109684. var time = Object(_now_js__WEBPACK_IMPORTED_MODULE_1__["default"])(),
  109685. isInvoking = shouldInvoke(time);
  109686. lastArgs = arguments;
  109687. lastThis = this;
  109688. lastCallTime = time;
  109689. if (isInvoking) {
  109690. if (timerId === undefined) {
  109691. return leadingEdge(lastCallTime);
  109692. }
  109693. if (maxing) {
  109694. // Handle invocations in a tight loop.
  109695. clearTimeout(timerId);
  109696. timerId = setTimeout(timerExpired, wait);
  109697. return invokeFunc(lastCallTime);
  109698. }
  109699. }
  109700. if (timerId === undefined) {
  109701. timerId = setTimeout(timerExpired, wait);
  109702. }
  109703. return result;
  109704. }
  109705. debounced.cancel = cancel;
  109706. debounced.flush = flush;
  109707. return debounced;
  109708. }
  109709. /* harmony default export */ __webpack_exports__["default"] = (debounce);
  109710. /***/ }),
  109711. /***/ "./node_modules/lodash-es/deburr.js":
  109712. /*!******************************************!*\
  109713. !*** ./node_modules/lodash-es/deburr.js ***!
  109714. \******************************************/
  109715. /*! exports provided: default */
  109716. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  109717. "use strict";
  109718. __webpack_require__.r(__webpack_exports__);
  109719. /* harmony import */ var _deburrLetter_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_deburrLetter.js */ "./node_modules/lodash-es/_deburrLetter.js");
  109720. /* harmony import */ var _toString_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./toString.js */ "./node_modules/lodash-es/toString.js");
  109721. /** Used to match Latin Unicode letters (excluding mathematical operators). */
  109722. var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;
  109723. /** Used to compose unicode character classes. */
  109724. var rsComboMarksRange = '\\u0300-\\u036f',
  109725. reComboHalfMarksRange = '\\ufe20-\\ufe2f',
  109726. rsComboSymbolsRange = '\\u20d0-\\u20ff',
  109727. rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange;
  109728. /** Used to compose unicode capture groups. */
  109729. var rsCombo = '[' + rsComboRange + ']';
  109730. /**
  109731. * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and
  109732. * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols).
  109733. */
  109734. var reComboMark = RegExp(rsCombo, 'g');
  109735. /**
  109736. * Deburrs `string` by converting
  109737. * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)
  109738. * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A)
  109739. * letters to basic Latin letters and removing
  109740. * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).
  109741. *
  109742. * @static
  109743. * @memberOf _
  109744. * @since 3.0.0
  109745. * @category String
  109746. * @param {string} [string=''] The string to deburr.
  109747. * @returns {string} Returns the deburred string.
  109748. * @example
  109749. *
  109750. * _.deburr('déjà vu');
  109751. * // => 'deja vu'
  109752. */
  109753. function deburr(string) {
  109754. string = Object(_toString_js__WEBPACK_IMPORTED_MODULE_1__["default"])(string);
  109755. return string && string.replace(reLatin, _deburrLetter_js__WEBPACK_IMPORTED_MODULE_0__["default"]).replace(reComboMark, '');
  109756. }
  109757. /* harmony default export */ __webpack_exports__["default"] = (deburr);
  109758. /***/ }),
  109759. /***/ "./node_modules/lodash-es/defaultTo.js":
  109760. /*!*********************************************!*\
  109761. !*** ./node_modules/lodash-es/defaultTo.js ***!
  109762. \*********************************************/
  109763. /*! exports provided: default */
  109764. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  109765. "use strict";
  109766. __webpack_require__.r(__webpack_exports__);
  109767. /**
  109768. * Checks `value` to determine whether a default value should be returned in
  109769. * its place. The `defaultValue` is returned if `value` is `NaN`, `null`,
  109770. * or `undefined`.
  109771. *
  109772. * @static
  109773. * @memberOf _
  109774. * @since 4.14.0
  109775. * @category Util
  109776. * @param {*} value The value to check.
  109777. * @param {*} defaultValue The default value.
  109778. * @returns {*} Returns the resolved value.
  109779. * @example
  109780. *
  109781. * _.defaultTo(1, 10);
  109782. * // => 1
  109783. *
  109784. * _.defaultTo(undefined, 10);
  109785. * // => 10
  109786. */
  109787. function defaultTo(value, defaultValue) {
  109788. return (value == null || value !== value) ? defaultValue : value;
  109789. }
  109790. /* harmony default export */ __webpack_exports__["default"] = (defaultTo);
  109791. /***/ }),
  109792. /***/ "./node_modules/lodash-es/defaults.js":
  109793. /*!********************************************!*\
  109794. !*** ./node_modules/lodash-es/defaults.js ***!
  109795. \********************************************/
  109796. /*! exports provided: default */
  109797. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  109798. "use strict";
  109799. __webpack_require__.r(__webpack_exports__);
  109800. /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
  109801. /* harmony import */ var _eq_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./eq.js */ "./node_modules/lodash-es/eq.js");
  109802. /* harmony import */ var _isIterateeCall_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_isIterateeCall.js */ "./node_modules/lodash-es/_isIterateeCall.js");
  109803. /* harmony import */ var _keysIn_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./keysIn.js */ "./node_modules/lodash-es/keysIn.js");
  109804. /** Used for built-in method references. */
  109805. var objectProto = Object.prototype;
  109806. /** Used to check objects for own properties. */
  109807. var hasOwnProperty = objectProto.hasOwnProperty;
  109808. /**
  109809. * Assigns own and inherited enumerable string keyed properties of source
  109810. * objects to the destination object for all destination properties that
  109811. * resolve to `undefined`. Source objects are applied from left to right.
  109812. * Once a property is set, additional values of the same property are ignored.
  109813. *
  109814. * **Note:** This method mutates `object`.
  109815. *
  109816. * @static
  109817. * @since 0.1.0
  109818. * @memberOf _
  109819. * @category Object
  109820. * @param {Object} object The destination object.
  109821. * @param {...Object} [sources] The source objects.
  109822. * @returns {Object} Returns `object`.
  109823. * @see _.defaultsDeep
  109824. * @example
  109825. *
  109826. * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  109827. * // => { 'a': 1, 'b': 2 }
  109828. */
  109829. var defaults = Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function(object, sources) {
  109830. object = Object(object);
  109831. var index = -1;
  109832. var length = sources.length;
  109833. var guard = length > 2 ? sources[2] : undefined;
  109834. if (guard && Object(_isIterateeCall_js__WEBPACK_IMPORTED_MODULE_2__["default"])(sources[0], sources[1], guard)) {
  109835. length = 1;
  109836. }
  109837. while (++index < length) {
  109838. var source = sources[index];
  109839. var props = Object(_keysIn_js__WEBPACK_IMPORTED_MODULE_3__["default"])(source);
  109840. var propsIndex = -1;
  109841. var propsLength = props.length;
  109842. while (++propsIndex < propsLength) {
  109843. var key = props[propsIndex];
  109844. var value = object[key];
  109845. if (value === undefined ||
  109846. (Object(_eq_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value, objectProto[key]) && !hasOwnProperty.call(object, key))) {
  109847. object[key] = source[key];
  109848. }
  109849. }
  109850. }
  109851. return object;
  109852. });
  109853. /* harmony default export */ __webpack_exports__["default"] = (defaults);
  109854. /***/ }),
  109855. /***/ "./node_modules/lodash-es/defaultsDeep.js":
  109856. /*!************************************************!*\
  109857. !*** ./node_modules/lodash-es/defaultsDeep.js ***!
  109858. \************************************************/
  109859. /*! exports provided: default */
  109860. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  109861. "use strict";
  109862. __webpack_require__.r(__webpack_exports__);
  109863. /* harmony import */ var _apply_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_apply.js */ "./node_modules/lodash-es/_apply.js");
  109864. /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
  109865. /* harmony import */ var _customDefaultsMerge_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_customDefaultsMerge.js */ "./node_modules/lodash-es/_customDefaultsMerge.js");
  109866. /* harmony import */ var _mergeWith_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./mergeWith.js */ "./node_modules/lodash-es/mergeWith.js");
  109867. /**
  109868. * This method is like `_.defaults` except that it recursively assigns
  109869. * default properties.
  109870. *
  109871. * **Note:** This method mutates `object`.
  109872. *
  109873. * @static
  109874. * @memberOf _
  109875. * @since 3.10.0
  109876. * @category Object
  109877. * @param {Object} object The destination object.
  109878. * @param {...Object} [sources] The source objects.
  109879. * @returns {Object} Returns `object`.
  109880. * @see _.defaults
  109881. * @example
  109882. *
  109883. * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } });
  109884. * // => { 'a': { 'b': 2, 'c': 3 } }
  109885. */
  109886. var defaultsDeep = Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_1__["default"])(function(args) {
  109887. args.push(undefined, _customDefaultsMerge_js__WEBPACK_IMPORTED_MODULE_2__["default"]);
  109888. return Object(_apply_js__WEBPACK_IMPORTED_MODULE_0__["default"])(_mergeWith_js__WEBPACK_IMPORTED_MODULE_3__["default"], undefined, args);
  109889. });
  109890. /* harmony default export */ __webpack_exports__["default"] = (defaultsDeep);
  109891. /***/ }),
  109892. /***/ "./node_modules/lodash-es/defer.js":
  109893. /*!*****************************************!*\
  109894. !*** ./node_modules/lodash-es/defer.js ***!
  109895. \*****************************************/
  109896. /*! exports provided: default */
  109897. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  109898. "use strict";
  109899. __webpack_require__.r(__webpack_exports__);
  109900. /* harmony import */ var _baseDelay_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseDelay.js */ "./node_modules/lodash-es/_baseDelay.js");
  109901. /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
  109902. /**
  109903. * Defers invoking the `func` until the current call stack has cleared. Any
  109904. * additional arguments are provided to `func` when it's invoked.
  109905. *
  109906. * @static
  109907. * @memberOf _
  109908. * @since 0.1.0
  109909. * @category Function
  109910. * @param {Function} func The function to defer.
  109911. * @param {...*} [args] The arguments to invoke `func` with.
  109912. * @returns {number} Returns the timer id.
  109913. * @example
  109914. *
  109915. * _.defer(function(text) {
  109916. * console.log(text);
  109917. * }, 'deferred');
  109918. * // => Logs 'deferred' after one millisecond.
  109919. */
  109920. var defer = Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_1__["default"])(function(func, args) {
  109921. return Object(_baseDelay_js__WEBPACK_IMPORTED_MODULE_0__["default"])(func, 1, args);
  109922. });
  109923. /* harmony default export */ __webpack_exports__["default"] = (defer);
  109924. /***/ }),
  109925. /***/ "./node_modules/lodash-es/delay.js":
  109926. /*!*****************************************!*\
  109927. !*** ./node_modules/lodash-es/delay.js ***!
  109928. \*****************************************/
  109929. /*! exports provided: default */
  109930. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  109931. "use strict";
  109932. __webpack_require__.r(__webpack_exports__);
  109933. /* harmony import */ var _baseDelay_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseDelay.js */ "./node_modules/lodash-es/_baseDelay.js");
  109934. /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
  109935. /* harmony import */ var _toNumber_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./toNumber.js */ "./node_modules/lodash-es/toNumber.js");
  109936. /**
  109937. * Invokes `func` after `wait` milliseconds. Any additional arguments are
  109938. * provided to `func` when it's invoked.
  109939. *
  109940. * @static
  109941. * @memberOf _
  109942. * @since 0.1.0
  109943. * @category Function
  109944. * @param {Function} func The function to delay.
  109945. * @param {number} wait The number of milliseconds to delay invocation.
  109946. * @param {...*} [args] The arguments to invoke `func` with.
  109947. * @returns {number} Returns the timer id.
  109948. * @example
  109949. *
  109950. * _.delay(function(text) {
  109951. * console.log(text);
  109952. * }, 1000, 'later');
  109953. * // => Logs 'later' after one second.
  109954. */
  109955. var delay = Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_1__["default"])(function(func, wait, args) {
  109956. return Object(_baseDelay_js__WEBPACK_IMPORTED_MODULE_0__["default"])(func, Object(_toNumber_js__WEBPACK_IMPORTED_MODULE_2__["default"])(wait) || 0, args);
  109957. });
  109958. /* harmony default export */ __webpack_exports__["default"] = (delay);
  109959. /***/ }),
  109960. /***/ "./node_modules/lodash-es/difference.js":
  109961. /*!**********************************************!*\
  109962. !*** ./node_modules/lodash-es/difference.js ***!
  109963. \**********************************************/
  109964. /*! exports provided: default */
  109965. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  109966. "use strict";
  109967. __webpack_require__.r(__webpack_exports__);
  109968. /* harmony import */ var _baseDifference_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseDifference.js */ "./node_modules/lodash-es/_baseDifference.js");
  109969. /* harmony import */ var _baseFlatten_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseFlatten.js */ "./node_modules/lodash-es/_baseFlatten.js");
  109970. /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
  109971. /* harmony import */ var _isArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./isArrayLikeObject.js */ "./node_modules/lodash-es/isArrayLikeObject.js");
  109972. /**
  109973. * Creates an array of `array` values not included in the other given arrays
  109974. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  109975. * for equality comparisons. The order and references of result values are
  109976. * determined by the first array.
  109977. *
  109978. * **Note:** Unlike `_.pullAll`, this method returns a new array.
  109979. *
  109980. * @static
  109981. * @memberOf _
  109982. * @since 0.1.0
  109983. * @category Array
  109984. * @param {Array} array The array to inspect.
  109985. * @param {...Array} [values] The values to exclude.
  109986. * @returns {Array} Returns the new array of filtered values.
  109987. * @see _.without, _.xor
  109988. * @example
  109989. *
  109990. * _.difference([2, 1], [2, 3]);
  109991. * // => [1]
  109992. */
  109993. var difference = Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_2__["default"])(function(array, values) {
  109994. return Object(_isArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_3__["default"])(array)
  109995. ? 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))
  109996. : [];
  109997. });
  109998. /* harmony default export */ __webpack_exports__["default"] = (difference);
  109999. /***/ }),
  110000. /***/ "./node_modules/lodash-es/differenceBy.js":
  110001. /*!************************************************!*\
  110002. !*** ./node_modules/lodash-es/differenceBy.js ***!
  110003. \************************************************/
  110004. /*! exports provided: default */
  110005. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  110006. "use strict";
  110007. __webpack_require__.r(__webpack_exports__);
  110008. /* harmony import */ var _baseDifference_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseDifference.js */ "./node_modules/lodash-es/_baseDifference.js");
  110009. /* harmony import */ var _baseFlatten_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseFlatten.js */ "./node_modules/lodash-es/_baseFlatten.js");
  110010. /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
  110011. /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
  110012. /* harmony import */ var _isArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./isArrayLikeObject.js */ "./node_modules/lodash-es/isArrayLikeObject.js");
  110013. /* harmony import */ var _last_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./last.js */ "./node_modules/lodash-es/last.js");
  110014. /**
  110015. * This method is like `_.difference` except that it accepts `iteratee` which
  110016. * is invoked for each element of `array` and `values` to generate the criterion
  110017. * by which they're compared. The order and references of result values are
  110018. * determined by the first array. The iteratee is invoked with one argument:
  110019. * (value).
  110020. *
  110021. * **Note:** Unlike `_.pullAllBy`, this method returns a new array.
  110022. *
  110023. * @static
  110024. * @memberOf _
  110025. * @since 4.0.0
  110026. * @category Array
  110027. * @param {Array} array The array to inspect.
  110028. * @param {...Array} [values] The values to exclude.
  110029. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  110030. * @returns {Array} Returns the new array of filtered values.
  110031. * @example
  110032. *
  110033. * _.differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  110034. * // => [1.2]
  110035. *
  110036. * // The `_.property` iteratee shorthand.
  110037. * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x');
  110038. * // => [{ 'x': 2 }]
  110039. */
  110040. var differenceBy = Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_3__["default"])(function(array, values) {
  110041. var iteratee = Object(_last_js__WEBPACK_IMPORTED_MODULE_5__["default"])(values);
  110042. if (Object(_isArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_4__["default"])(iteratee)) {
  110043. iteratee = undefined;
  110044. }
  110045. return Object(_isArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_4__["default"])(array)
  110046. ? 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))
  110047. : [];
  110048. });
  110049. /* harmony default export */ __webpack_exports__["default"] = (differenceBy);
  110050. /***/ }),
  110051. /***/ "./node_modules/lodash-es/differenceWith.js":
  110052. /*!**************************************************!*\
  110053. !*** ./node_modules/lodash-es/differenceWith.js ***!
  110054. \**************************************************/
  110055. /*! exports provided: default */
  110056. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  110057. "use strict";
  110058. __webpack_require__.r(__webpack_exports__);
  110059. /* harmony import */ var _baseDifference_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseDifference.js */ "./node_modules/lodash-es/_baseDifference.js");
  110060. /* harmony import */ var _baseFlatten_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseFlatten.js */ "./node_modules/lodash-es/_baseFlatten.js");
  110061. /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
  110062. /* harmony import */ var _isArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./isArrayLikeObject.js */ "./node_modules/lodash-es/isArrayLikeObject.js");
  110063. /* harmony import */ var _last_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./last.js */ "./node_modules/lodash-es/last.js");
  110064. /**
  110065. * This method is like `_.difference` except that it accepts `comparator`
  110066. * which is invoked to compare elements of `array` to `values`. The order and
  110067. * references of result values are determined by the first array. The comparator
  110068. * is invoked with two arguments: (arrVal, othVal).
  110069. *
  110070. * **Note:** Unlike `_.pullAllWith`, this method returns a new array.
  110071. *
  110072. * @static
  110073. * @memberOf _
  110074. * @since 4.0.0
  110075. * @category Array
  110076. * @param {Array} array The array to inspect.
  110077. * @param {...Array} [values] The values to exclude.
  110078. * @param {Function} [comparator] The comparator invoked per element.
  110079. * @returns {Array} Returns the new array of filtered values.
  110080. * @example
  110081. *
  110082. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  110083. *
  110084. * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual);
  110085. * // => [{ 'x': 2, 'y': 1 }]
  110086. */
  110087. var differenceWith = Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_2__["default"])(function(array, values) {
  110088. var comparator = Object(_last_js__WEBPACK_IMPORTED_MODULE_4__["default"])(values);
  110089. if (Object(_isArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_3__["default"])(comparator)) {
  110090. comparator = undefined;
  110091. }
  110092. return Object(_isArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_3__["default"])(array)
  110093. ? 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)
  110094. : [];
  110095. });
  110096. /* harmony default export */ __webpack_exports__["default"] = (differenceWith);
  110097. /***/ }),
  110098. /***/ "./node_modules/lodash-es/divide.js":
  110099. /*!******************************************!*\
  110100. !*** ./node_modules/lodash-es/divide.js ***!
  110101. \******************************************/
  110102. /*! exports provided: default */
  110103. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  110104. "use strict";
  110105. __webpack_require__.r(__webpack_exports__);
  110106. /* harmony import */ var _createMathOperation_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createMathOperation.js */ "./node_modules/lodash-es/_createMathOperation.js");
  110107. /**
  110108. * Divide two numbers.
  110109. *
  110110. * @static
  110111. * @memberOf _
  110112. * @since 4.7.0
  110113. * @category Math
  110114. * @param {number} dividend The first number in a division.
  110115. * @param {number} divisor The second number in a division.
  110116. * @returns {number} Returns the quotient.
  110117. * @example
  110118. *
  110119. * _.divide(6, 4);
  110120. * // => 1.5
  110121. */
  110122. var divide = Object(_createMathOperation_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function(dividend, divisor) {
  110123. return dividend / divisor;
  110124. }, 1);
  110125. /* harmony default export */ __webpack_exports__["default"] = (divide);
  110126. /***/ }),
  110127. /***/ "./node_modules/lodash-es/drop.js":
  110128. /*!****************************************!*\
  110129. !*** ./node_modules/lodash-es/drop.js ***!
  110130. \****************************************/
  110131. /*! exports provided: default */
  110132. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  110133. "use strict";
  110134. __webpack_require__.r(__webpack_exports__);
  110135. /* harmony import */ var _baseSlice_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseSlice.js */ "./node_modules/lodash-es/_baseSlice.js");
  110136. /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
  110137. /**
  110138. * Creates a slice of `array` with `n` elements dropped from the beginning.
  110139. *
  110140. * @static
  110141. * @memberOf _
  110142. * @since 0.5.0
  110143. * @category Array
  110144. * @param {Array} array The array to query.
  110145. * @param {number} [n=1] The number of elements to drop.
  110146. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  110147. * @returns {Array} Returns the slice of `array`.
  110148. * @example
  110149. *
  110150. * _.drop([1, 2, 3]);
  110151. * // => [2, 3]
  110152. *
  110153. * _.drop([1, 2, 3], 2);
  110154. * // => [3]
  110155. *
  110156. * _.drop([1, 2, 3], 5);
  110157. * // => []
  110158. *
  110159. * _.drop([1, 2, 3], 0);
  110160. * // => [1, 2, 3]
  110161. */
  110162. function drop(array, n, guard) {
  110163. var length = array == null ? 0 : array.length;
  110164. if (!length) {
  110165. return [];
  110166. }
  110167. n = (guard || n === undefined) ? 1 : Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_1__["default"])(n);
  110168. return Object(_baseSlice_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, n < 0 ? 0 : n, length);
  110169. }
  110170. /* harmony default export */ __webpack_exports__["default"] = (drop);
  110171. /***/ }),
  110172. /***/ "./node_modules/lodash-es/dropRight.js":
  110173. /*!*********************************************!*\
  110174. !*** ./node_modules/lodash-es/dropRight.js ***!
  110175. \*********************************************/
  110176. /*! exports provided: default */
  110177. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  110178. "use strict";
  110179. __webpack_require__.r(__webpack_exports__);
  110180. /* harmony import */ var _baseSlice_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseSlice.js */ "./node_modules/lodash-es/_baseSlice.js");
  110181. /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
  110182. /**
  110183. * Creates a slice of `array` with `n` elements dropped from the end.
  110184. *
  110185. * @static
  110186. * @memberOf _
  110187. * @since 3.0.0
  110188. * @category Array
  110189. * @param {Array} array The array to query.
  110190. * @param {number} [n=1] The number of elements to drop.
  110191. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  110192. * @returns {Array} Returns the slice of `array`.
  110193. * @example
  110194. *
  110195. * _.dropRight([1, 2, 3]);
  110196. * // => [1, 2]
  110197. *
  110198. * _.dropRight([1, 2, 3], 2);
  110199. * // => [1]
  110200. *
  110201. * _.dropRight([1, 2, 3], 5);
  110202. * // => []
  110203. *
  110204. * _.dropRight([1, 2, 3], 0);
  110205. * // => [1, 2, 3]
  110206. */
  110207. function dropRight(array, n, guard) {
  110208. var length = array == null ? 0 : array.length;
  110209. if (!length) {
  110210. return [];
  110211. }
  110212. n = (guard || n === undefined) ? 1 : Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_1__["default"])(n);
  110213. n = length - n;
  110214. return Object(_baseSlice_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, 0, n < 0 ? 0 : n);
  110215. }
  110216. /* harmony default export */ __webpack_exports__["default"] = (dropRight);
  110217. /***/ }),
  110218. /***/ "./node_modules/lodash-es/dropRightWhile.js":
  110219. /*!**************************************************!*\
  110220. !*** ./node_modules/lodash-es/dropRightWhile.js ***!
  110221. \**************************************************/
  110222. /*! exports provided: default */
  110223. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  110224. "use strict";
  110225. __webpack_require__.r(__webpack_exports__);
  110226. /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
  110227. /* harmony import */ var _baseWhile_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseWhile.js */ "./node_modules/lodash-es/_baseWhile.js");
  110228. /**
  110229. * Creates a slice of `array` excluding elements dropped from the end.
  110230. * Elements are dropped until `predicate` returns falsey. The predicate is
  110231. * invoked with three arguments: (value, index, array).
  110232. *
  110233. * @static
  110234. * @memberOf _
  110235. * @since 3.0.0
  110236. * @category Array
  110237. * @param {Array} array The array to query.
  110238. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  110239. * @returns {Array} Returns the slice of `array`.
  110240. * @example
  110241. *
  110242. * var users = [
  110243. * { 'user': 'barney', 'active': true },
  110244. * { 'user': 'fred', 'active': false },
  110245. * { 'user': 'pebbles', 'active': false }
  110246. * ];
  110247. *
  110248. * _.dropRightWhile(users, function(o) { return !o.active; });
  110249. * // => objects for ['barney']
  110250. *
  110251. * // The `_.matches` iteratee shorthand.
  110252. * _.dropRightWhile(users, { 'user': 'pebbles', 'active': false });
  110253. * // => objects for ['barney', 'fred']
  110254. *
  110255. * // The `_.matchesProperty` iteratee shorthand.
  110256. * _.dropRightWhile(users, ['active', false]);
  110257. * // => objects for ['barney']
  110258. *
  110259. * // The `_.property` iteratee shorthand.
  110260. * _.dropRightWhile(users, 'active');
  110261. * // => objects for ['barney', 'fred', 'pebbles']
  110262. */
  110263. function dropRightWhile(array, predicate) {
  110264. return (array && array.length)
  110265. ? Object(_baseWhile_js__WEBPACK_IMPORTED_MODULE_1__["default"])(array, Object(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_0__["default"])(predicate, 3), true, true)
  110266. : [];
  110267. }
  110268. /* harmony default export */ __webpack_exports__["default"] = (dropRightWhile);
  110269. /***/ }),
  110270. /***/ "./node_modules/lodash-es/dropWhile.js":
  110271. /*!*********************************************!*\
  110272. !*** ./node_modules/lodash-es/dropWhile.js ***!
  110273. \*********************************************/
  110274. /*! exports provided: default */
  110275. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  110276. "use strict";
  110277. __webpack_require__.r(__webpack_exports__);
  110278. /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
  110279. /* harmony import */ var _baseWhile_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseWhile.js */ "./node_modules/lodash-es/_baseWhile.js");
  110280. /**
  110281. * Creates a slice of `array` excluding elements dropped from the beginning.
  110282. * Elements are dropped until `predicate` returns falsey. The predicate is
  110283. * invoked with three arguments: (value, index, array).
  110284. *
  110285. * @static
  110286. * @memberOf _
  110287. * @since 3.0.0
  110288. * @category Array
  110289. * @param {Array} array The array to query.
  110290. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  110291. * @returns {Array} Returns the slice of `array`.
  110292. * @example
  110293. *
  110294. * var users = [
  110295. * { 'user': 'barney', 'active': false },
  110296. * { 'user': 'fred', 'active': false },
  110297. * { 'user': 'pebbles', 'active': true }
  110298. * ];
  110299. *
  110300. * _.dropWhile(users, function(o) { return !o.active; });
  110301. * // => objects for ['pebbles']
  110302. *
  110303. * // The `_.matches` iteratee shorthand.
  110304. * _.dropWhile(users, { 'user': 'barney', 'active': false });
  110305. * // => objects for ['fred', 'pebbles']
  110306. *
  110307. * // The `_.matchesProperty` iteratee shorthand.
  110308. * _.dropWhile(users, ['active', false]);
  110309. * // => objects for ['pebbles']
  110310. *
  110311. * // The `_.property` iteratee shorthand.
  110312. * _.dropWhile(users, 'active');
  110313. * // => objects for ['barney', 'fred', 'pebbles']
  110314. */
  110315. function dropWhile(array, predicate) {
  110316. return (array && array.length)
  110317. ? Object(_baseWhile_js__WEBPACK_IMPORTED_MODULE_1__["default"])(array, Object(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_0__["default"])(predicate, 3), true)
  110318. : [];
  110319. }
  110320. /* harmony default export */ __webpack_exports__["default"] = (dropWhile);
  110321. /***/ }),
  110322. /***/ "./node_modules/lodash-es/each.js":
  110323. /*!****************************************!*\
  110324. !*** ./node_modules/lodash-es/each.js ***!
  110325. \****************************************/
  110326. /*! exports provided: default */
  110327. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  110328. "use strict";
  110329. __webpack_require__.r(__webpack_exports__);
  110330. /* harmony import */ var _forEach_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./forEach.js */ "./node_modules/lodash-es/forEach.js");
  110331. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _forEach_js__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  110332. /***/ }),
  110333. /***/ "./node_modules/lodash-es/eachRight.js":
  110334. /*!*********************************************!*\
  110335. !*** ./node_modules/lodash-es/eachRight.js ***!
  110336. \*********************************************/
  110337. /*! exports provided: default */
  110338. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  110339. "use strict";
  110340. __webpack_require__.r(__webpack_exports__);
  110341. /* harmony import */ var _forEachRight_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./forEachRight.js */ "./node_modules/lodash-es/forEachRight.js");
  110342. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _forEachRight_js__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  110343. /***/ }),
  110344. /***/ "./node_modules/lodash-es/endsWith.js":
  110345. /*!********************************************!*\
  110346. !*** ./node_modules/lodash-es/endsWith.js ***!
  110347. \********************************************/
  110348. /*! exports provided: default */
  110349. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  110350. "use strict";
  110351. __webpack_require__.r(__webpack_exports__);
  110352. /* harmony import */ var _baseClamp_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseClamp.js */ "./node_modules/lodash-es/_baseClamp.js");
  110353. /* harmony import */ var _baseToString_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseToString.js */ "./node_modules/lodash-es/_baseToString.js");
  110354. /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
  110355. /* harmony import */ var _toString_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./toString.js */ "./node_modules/lodash-es/toString.js");
  110356. /**
  110357. * Checks if `string` ends with the given target string.
  110358. *
  110359. * @static
  110360. * @memberOf _
  110361. * @since 3.0.0
  110362. * @category String
  110363. * @param {string} [string=''] The string to inspect.
  110364. * @param {string} [target] The string to search for.
  110365. * @param {number} [position=string.length] The position to search up to.
  110366. * @returns {boolean} Returns `true` if `string` ends with `target`,
  110367. * else `false`.
  110368. * @example
  110369. *
  110370. * _.endsWith('abc', 'c');
  110371. * // => true
  110372. *
  110373. * _.endsWith('abc', 'b');
  110374. * // => false
  110375. *
  110376. * _.endsWith('abc', 'b', 2);
  110377. * // => true
  110378. */
  110379. function endsWith(string, target, position) {
  110380. string = Object(_toString_js__WEBPACK_IMPORTED_MODULE_3__["default"])(string);
  110381. target = Object(_baseToString_js__WEBPACK_IMPORTED_MODULE_1__["default"])(target);
  110382. var length = string.length;
  110383. position = position === undefined
  110384. ? length
  110385. : Object(_baseClamp_js__WEBPACK_IMPORTED_MODULE_0__["default"])(Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_2__["default"])(position), 0, length);
  110386. var end = position;
  110387. position -= target.length;
  110388. return position >= 0 && string.slice(position, end) == target;
  110389. }
  110390. /* harmony default export */ __webpack_exports__["default"] = (endsWith);
  110391. /***/ }),
  110392. /***/ "./node_modules/lodash-es/entries.js":
  110393. /*!*******************************************!*\
  110394. !*** ./node_modules/lodash-es/entries.js ***!
  110395. \*******************************************/
  110396. /*! exports provided: default */
  110397. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  110398. "use strict";
  110399. __webpack_require__.r(__webpack_exports__);
  110400. /* harmony import */ var _toPairs_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./toPairs.js */ "./node_modules/lodash-es/toPairs.js");
  110401. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _toPairs_js__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  110402. /***/ }),
  110403. /***/ "./node_modules/lodash-es/entriesIn.js":
  110404. /*!*********************************************!*\
  110405. !*** ./node_modules/lodash-es/entriesIn.js ***!
  110406. \*********************************************/
  110407. /*! exports provided: default */
  110408. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  110409. "use strict";
  110410. __webpack_require__.r(__webpack_exports__);
  110411. /* harmony import */ var _toPairsIn_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./toPairsIn.js */ "./node_modules/lodash-es/toPairsIn.js");
  110412. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _toPairsIn_js__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  110413. /***/ }),
  110414. /***/ "./node_modules/lodash-es/eq.js":
  110415. /*!**************************************!*\
  110416. !*** ./node_modules/lodash-es/eq.js ***!
  110417. \**************************************/
  110418. /*! exports provided: default */
  110419. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  110420. "use strict";
  110421. __webpack_require__.r(__webpack_exports__);
  110422. /**
  110423. * Performs a
  110424. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  110425. * comparison between two values to determine if they are equivalent.
  110426. *
  110427. * @static
  110428. * @memberOf _
  110429. * @since 4.0.0
  110430. * @category Lang
  110431. * @param {*} value The value to compare.
  110432. * @param {*} other The other value to compare.
  110433. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  110434. * @example
  110435. *
  110436. * var object = { 'a': 1 };
  110437. * var other = { 'a': 1 };
  110438. *
  110439. * _.eq(object, object);
  110440. * // => true
  110441. *
  110442. * _.eq(object, other);
  110443. * // => false
  110444. *
  110445. * _.eq('a', 'a');
  110446. * // => true
  110447. *
  110448. * _.eq('a', Object('a'));
  110449. * // => false
  110450. *
  110451. * _.eq(NaN, NaN);
  110452. * // => true
  110453. */
  110454. function eq(value, other) {
  110455. return value === other || (value !== value && other !== other);
  110456. }
  110457. /* harmony default export */ __webpack_exports__["default"] = (eq);
  110458. /***/ }),
  110459. /***/ "./node_modules/lodash-es/escape.js":
  110460. /*!******************************************!*\
  110461. !*** ./node_modules/lodash-es/escape.js ***!
  110462. \******************************************/
  110463. /*! exports provided: default */
  110464. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  110465. "use strict";
  110466. __webpack_require__.r(__webpack_exports__);
  110467. /* harmony import */ var _escapeHtmlChar_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_escapeHtmlChar.js */ "./node_modules/lodash-es/_escapeHtmlChar.js");
  110468. /* harmony import */ var _toString_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./toString.js */ "./node_modules/lodash-es/toString.js");
  110469. /** Used to match HTML entities and HTML characters. */
  110470. var reUnescapedHtml = /[&<>"']/g,
  110471. reHasUnescapedHtml = RegExp(reUnescapedHtml.source);
  110472. /**
  110473. * Converts the characters "&", "<", ">", '"', and "'" in `string` to their
  110474. * corresponding HTML entities.
  110475. *
  110476. * **Note:** No other characters are escaped. To escape additional
  110477. * characters use a third-party library like [_he_](https://mths.be/he).
  110478. *
  110479. * Though the ">" character is escaped for symmetry, characters like
  110480. * ">" and "/" don't need escaping in HTML and have no special meaning
  110481. * unless they're part of a tag or unquoted attribute value. See
  110482. * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands)
  110483. * (under "semi-related fun fact") for more details.
  110484. *
  110485. * When working with HTML you should always
  110486. * [quote attribute values](http://wonko.com/post/html-escaping) to reduce
  110487. * XSS vectors.
  110488. *
  110489. * @static
  110490. * @since 0.1.0
  110491. * @memberOf _
  110492. * @category String
  110493. * @param {string} [string=''] The string to escape.
  110494. * @returns {string} Returns the escaped string.
  110495. * @example
  110496. *
  110497. * _.escape('fred, barney, & pebbles');
  110498. * // => 'fred, barney, &amp; pebbles'
  110499. */
  110500. function escape(string) {
  110501. string = Object(_toString_js__WEBPACK_IMPORTED_MODULE_1__["default"])(string);
  110502. return (string && reHasUnescapedHtml.test(string))
  110503. ? string.replace(reUnescapedHtml, _escapeHtmlChar_js__WEBPACK_IMPORTED_MODULE_0__["default"])
  110504. : string;
  110505. }
  110506. /* harmony default export */ __webpack_exports__["default"] = (escape);
  110507. /***/ }),
  110508. /***/ "./node_modules/lodash-es/escapeRegExp.js":
  110509. /*!************************************************!*\
  110510. !*** ./node_modules/lodash-es/escapeRegExp.js ***!
  110511. \************************************************/
  110512. /*! exports provided: default */
  110513. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  110514. "use strict";
  110515. __webpack_require__.r(__webpack_exports__);
  110516. /* harmony import */ var _toString_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./toString.js */ "./node_modules/lodash-es/toString.js");
  110517. /**
  110518. * Used to match `RegExp`
  110519. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  110520. */
  110521. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g,
  110522. reHasRegExpChar = RegExp(reRegExpChar.source);
  110523. /**
  110524. * Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+",
  110525. * "?", "(", ")", "[", "]", "{", "}", and "|" in `string`.
  110526. *
  110527. * @static
  110528. * @memberOf _
  110529. * @since 3.0.0
  110530. * @category String
  110531. * @param {string} [string=''] The string to escape.
  110532. * @returns {string} Returns the escaped string.
  110533. * @example
  110534. *
  110535. * _.escapeRegExp('[lodash](https://lodash.com/)');
  110536. * // => '\[lodash\]\(https://lodash\.com/\)'
  110537. */
  110538. function escapeRegExp(string) {
  110539. string = Object(_toString_js__WEBPACK_IMPORTED_MODULE_0__["default"])(string);
  110540. return (string && reHasRegExpChar.test(string))
  110541. ? string.replace(reRegExpChar, '\\$&')
  110542. : string;
  110543. }
  110544. /* harmony default export */ __webpack_exports__["default"] = (escapeRegExp);
  110545. /***/ }),
  110546. /***/ "./node_modules/lodash-es/every.js":
  110547. /*!*****************************************!*\
  110548. !*** ./node_modules/lodash-es/every.js ***!
  110549. \*****************************************/
  110550. /*! exports provided: default */
  110551. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  110552. "use strict";
  110553. __webpack_require__.r(__webpack_exports__);
  110554. /* harmony import */ var _arrayEvery_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayEvery.js */ "./node_modules/lodash-es/_arrayEvery.js");
  110555. /* harmony import */ var _baseEvery_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseEvery.js */ "./node_modules/lodash-es/_baseEvery.js");
  110556. /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
  110557. /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
  110558. /* harmony import */ var _isIterateeCall_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_isIterateeCall.js */ "./node_modules/lodash-es/_isIterateeCall.js");
  110559. /**
  110560. * Checks if `predicate` returns truthy for **all** elements of `collection`.
  110561. * Iteration is stopped once `predicate` returns falsey. The predicate is
  110562. * invoked with three arguments: (value, index|key, collection).
  110563. *
  110564. * **Note:** This method returns `true` for
  110565. * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because
  110566. * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of
  110567. * elements of empty collections.
  110568. *
  110569. * @static
  110570. * @memberOf _
  110571. * @since 0.1.0
  110572. * @category Collection
  110573. * @param {Array|Object} collection The collection to iterate over.
  110574. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  110575. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  110576. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  110577. * else `false`.
  110578. * @example
  110579. *
  110580. * _.every([true, 1, null, 'yes'], Boolean);
  110581. * // => false
  110582. *
  110583. * var users = [
  110584. * { 'user': 'barney', 'age': 36, 'active': false },
  110585. * { 'user': 'fred', 'age': 40, 'active': false }
  110586. * ];
  110587. *
  110588. * // The `_.matches` iteratee shorthand.
  110589. * _.every(users, { 'user': 'barney', 'active': false });
  110590. * // => false
  110591. *
  110592. * // The `_.matchesProperty` iteratee shorthand.
  110593. * _.every(users, ['active', false]);
  110594. * // => true
  110595. *
  110596. * // The `_.property` iteratee shorthand.
  110597. * _.every(users, 'active');
  110598. * // => false
  110599. */
  110600. function every(collection, predicate, guard) {
  110601. 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"];
  110602. if (guard && Object(_isIterateeCall_js__WEBPACK_IMPORTED_MODULE_4__["default"])(collection, predicate, guard)) {
  110603. predicate = undefined;
  110604. }
  110605. return func(collection, Object(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_2__["default"])(predicate, 3));
  110606. }
  110607. /* harmony default export */ __webpack_exports__["default"] = (every);
  110608. /***/ }),
  110609. /***/ "./node_modules/lodash-es/extend.js":
  110610. /*!******************************************!*\
  110611. !*** ./node_modules/lodash-es/extend.js ***!
  110612. \******************************************/
  110613. /*! exports provided: default */
  110614. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  110615. "use strict";
  110616. __webpack_require__.r(__webpack_exports__);
  110617. /* harmony import */ var _assignIn_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./assignIn.js */ "./node_modules/lodash-es/assignIn.js");
  110618. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _assignIn_js__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  110619. /***/ }),
  110620. /***/ "./node_modules/lodash-es/extendWith.js":
  110621. /*!**********************************************!*\
  110622. !*** ./node_modules/lodash-es/extendWith.js ***!
  110623. \**********************************************/
  110624. /*! exports provided: default */
  110625. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  110626. "use strict";
  110627. __webpack_require__.r(__webpack_exports__);
  110628. /* harmony import */ var _assignInWith_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./assignInWith.js */ "./node_modules/lodash-es/assignInWith.js");
  110629. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _assignInWith_js__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  110630. /***/ }),
  110631. /***/ "./node_modules/lodash-es/fill.js":
  110632. /*!****************************************!*\
  110633. !*** ./node_modules/lodash-es/fill.js ***!
  110634. \****************************************/
  110635. /*! exports provided: default */
  110636. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  110637. "use strict";
  110638. __webpack_require__.r(__webpack_exports__);
  110639. /* harmony import */ var _baseFill_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseFill.js */ "./node_modules/lodash-es/_baseFill.js");
  110640. /* harmony import */ var _isIterateeCall_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_isIterateeCall.js */ "./node_modules/lodash-es/_isIterateeCall.js");
  110641. /**
  110642. * Fills elements of `array` with `value` from `start` up to, but not
  110643. * including, `end`.
  110644. *
  110645. * **Note:** This method mutates `array`.
  110646. *
  110647. * @static
  110648. * @memberOf _
  110649. * @since 3.2.0
  110650. * @category Array
  110651. * @param {Array} array The array to fill.
  110652. * @param {*} value The value to fill `array` with.
  110653. * @param {number} [start=0] The start position.
  110654. * @param {number} [end=array.length] The end position.
  110655. * @returns {Array} Returns `array`.
  110656. * @example
  110657. *
  110658. * var array = [1, 2, 3];
  110659. *
  110660. * _.fill(array, 'a');
  110661. * console.log(array);
  110662. * // => ['a', 'a', 'a']
  110663. *
  110664. * _.fill(Array(3), 2);
  110665. * // => [2, 2, 2]
  110666. *
  110667. * _.fill([4, 6, 8, 10], '*', 1, 3);
  110668. * // => [4, '*', '*', 10]
  110669. */
  110670. function fill(array, value, start, end) {
  110671. var length = array == null ? 0 : array.length;
  110672. if (!length) {
  110673. return [];
  110674. }
  110675. if (start && typeof start != 'number' && Object(_isIterateeCall_js__WEBPACK_IMPORTED_MODULE_1__["default"])(array, value, start)) {
  110676. start = 0;
  110677. end = length;
  110678. }
  110679. return Object(_baseFill_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, value, start, end);
  110680. }
  110681. /* harmony default export */ __webpack_exports__["default"] = (fill);
  110682. /***/ }),
  110683. /***/ "./node_modules/lodash-es/filter.js":
  110684. /*!******************************************!*\
  110685. !*** ./node_modules/lodash-es/filter.js ***!
  110686. \******************************************/
  110687. /*! exports provided: default */
  110688. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  110689. "use strict";
  110690. __webpack_require__.r(__webpack_exports__);
  110691. /* harmony import */ var _arrayFilter_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayFilter.js */ "./node_modules/lodash-es/_arrayFilter.js");
  110692. /* harmony import */ var _baseFilter_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseFilter.js */ "./node_modules/lodash-es/_baseFilter.js");
  110693. /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
  110694. /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
  110695. /**
  110696. * Iterates over elements of `collection`, returning an array of all elements
  110697. * `predicate` returns truthy for. The predicate is invoked with three
  110698. * arguments: (value, index|key, collection).
  110699. *
  110700. * **Note:** Unlike `_.remove`, this method returns a new array.
  110701. *
  110702. * @static
  110703. * @memberOf _
  110704. * @since 0.1.0
  110705. * @category Collection
  110706. * @param {Array|Object} collection The collection to iterate over.
  110707. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  110708. * @returns {Array} Returns the new filtered array.
  110709. * @see _.reject
  110710. * @example
  110711. *
  110712. * var users = [
  110713. * { 'user': 'barney', 'age': 36, 'active': true },
  110714. * { 'user': 'fred', 'age': 40, 'active': false }
  110715. * ];
  110716. *
  110717. * _.filter(users, function(o) { return !o.active; });
  110718. * // => objects for ['fred']
  110719. *
  110720. * // The `_.matches` iteratee shorthand.
  110721. * _.filter(users, { 'age': 36, 'active': true });
  110722. * // => objects for ['barney']
  110723. *
  110724. * // The `_.matchesProperty` iteratee shorthand.
  110725. * _.filter(users, ['active', false]);
  110726. * // => objects for ['fred']
  110727. *
  110728. * // The `_.property` iteratee shorthand.
  110729. * _.filter(users, 'active');
  110730. * // => objects for ['barney']
  110731. *
  110732. * // Combining several predicates using `_.overEvery` or `_.overSome`.
  110733. * _.filter(users, _.overSome([{ 'age': 36 }, ['age', 40]]));
  110734. * // => objects for ['fred', 'barney']
  110735. */
  110736. function filter(collection, predicate) {
  110737. 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"];
  110738. return func(collection, Object(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_2__["default"])(predicate, 3));
  110739. }
  110740. /* harmony default export */ __webpack_exports__["default"] = (filter);
  110741. /***/ }),
  110742. /***/ "./node_modules/lodash-es/find.js":
  110743. /*!****************************************!*\
  110744. !*** ./node_modules/lodash-es/find.js ***!
  110745. \****************************************/
  110746. /*! exports provided: default */
  110747. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  110748. "use strict";
  110749. __webpack_require__.r(__webpack_exports__);
  110750. /* harmony import */ var _createFind_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createFind.js */ "./node_modules/lodash-es/_createFind.js");
  110751. /* harmony import */ var _findIndex_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./findIndex.js */ "./node_modules/lodash-es/findIndex.js");
  110752. /**
  110753. * Iterates over elements of `collection`, returning the first element
  110754. * `predicate` returns truthy for. The predicate is invoked with three
  110755. * arguments: (value, index|key, collection).
  110756. *
  110757. * @static
  110758. * @memberOf _
  110759. * @since 0.1.0
  110760. * @category Collection
  110761. * @param {Array|Object} collection The collection to inspect.
  110762. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  110763. * @param {number} [fromIndex=0] The index to search from.
  110764. * @returns {*} Returns the matched element, else `undefined`.
  110765. * @example
  110766. *
  110767. * var users = [
  110768. * { 'user': 'barney', 'age': 36, 'active': true },
  110769. * { 'user': 'fred', 'age': 40, 'active': false },
  110770. * { 'user': 'pebbles', 'age': 1, 'active': true }
  110771. * ];
  110772. *
  110773. * _.find(users, function(o) { return o.age < 40; });
  110774. * // => object for 'barney'
  110775. *
  110776. * // The `_.matches` iteratee shorthand.
  110777. * _.find(users, { 'age': 1, 'active': true });
  110778. * // => object for 'pebbles'
  110779. *
  110780. * // The `_.matchesProperty` iteratee shorthand.
  110781. * _.find(users, ['active', false]);
  110782. * // => object for 'fred'
  110783. *
  110784. * // The `_.property` iteratee shorthand.
  110785. * _.find(users, 'active');
  110786. * // => object for 'barney'
  110787. */
  110788. var find = Object(_createFind_js__WEBPACK_IMPORTED_MODULE_0__["default"])(_findIndex_js__WEBPACK_IMPORTED_MODULE_1__["default"]);
  110789. /* harmony default export */ __webpack_exports__["default"] = (find);
  110790. /***/ }),
  110791. /***/ "./node_modules/lodash-es/findIndex.js":
  110792. /*!*********************************************!*\
  110793. !*** ./node_modules/lodash-es/findIndex.js ***!
  110794. \*********************************************/
  110795. /*! exports provided: default */
  110796. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  110797. "use strict";
  110798. __webpack_require__.r(__webpack_exports__);
  110799. /* harmony import */ var _baseFindIndex_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseFindIndex.js */ "./node_modules/lodash-es/_baseFindIndex.js");
  110800. /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
  110801. /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
  110802. /* Built-in method references for those with the same name as other `lodash` methods. */
  110803. var nativeMax = Math.max;
  110804. /**
  110805. * This method is like `_.find` except that it returns the index of the first
  110806. * element `predicate` returns truthy for instead of the element itself.
  110807. *
  110808. * @static
  110809. * @memberOf _
  110810. * @since 1.1.0
  110811. * @category Array
  110812. * @param {Array} array The array to inspect.
  110813. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  110814. * @param {number} [fromIndex=0] The index to search from.
  110815. * @returns {number} Returns the index of the found element, else `-1`.
  110816. * @example
  110817. *
  110818. * var users = [
  110819. * { 'user': 'barney', 'active': false },
  110820. * { 'user': 'fred', 'active': false },
  110821. * { 'user': 'pebbles', 'active': true }
  110822. * ];
  110823. *
  110824. * _.findIndex(users, function(o) { return o.user == 'barney'; });
  110825. * // => 0
  110826. *
  110827. * // The `_.matches` iteratee shorthand.
  110828. * _.findIndex(users, { 'user': 'fred', 'active': false });
  110829. * // => 1
  110830. *
  110831. * // The `_.matchesProperty` iteratee shorthand.
  110832. * _.findIndex(users, ['active', false]);
  110833. * // => 0
  110834. *
  110835. * // The `_.property` iteratee shorthand.
  110836. * _.findIndex(users, 'active');
  110837. * // => 2
  110838. */
  110839. function findIndex(array, predicate, fromIndex) {
  110840. var length = array == null ? 0 : array.length;
  110841. if (!length) {
  110842. return -1;
  110843. }
  110844. var index = fromIndex == null ? 0 : Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_2__["default"])(fromIndex);
  110845. if (index < 0) {
  110846. index = nativeMax(length + index, 0);
  110847. }
  110848. return Object(_baseFindIndex_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, Object(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_1__["default"])(predicate, 3), index);
  110849. }
  110850. /* harmony default export */ __webpack_exports__["default"] = (findIndex);
  110851. /***/ }),
  110852. /***/ "./node_modules/lodash-es/findKey.js":
  110853. /*!*******************************************!*\
  110854. !*** ./node_modules/lodash-es/findKey.js ***!
  110855. \*******************************************/
  110856. /*! exports provided: default */
  110857. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  110858. "use strict";
  110859. __webpack_require__.r(__webpack_exports__);
  110860. /* harmony import */ var _baseFindKey_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseFindKey.js */ "./node_modules/lodash-es/_baseFindKey.js");
  110861. /* harmony import */ var _baseForOwn_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseForOwn.js */ "./node_modules/lodash-es/_baseForOwn.js");
  110862. /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
  110863. /**
  110864. * This method is like `_.find` except that it returns the key of the first
  110865. * element `predicate` returns truthy for instead of the element itself.
  110866. *
  110867. * @static
  110868. * @memberOf _
  110869. * @since 1.1.0
  110870. * @category Object
  110871. * @param {Object} object The object to inspect.
  110872. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  110873. * @returns {string|undefined} Returns the key of the matched element,
  110874. * else `undefined`.
  110875. * @example
  110876. *
  110877. * var users = {
  110878. * 'barney': { 'age': 36, 'active': true },
  110879. * 'fred': { 'age': 40, 'active': false },
  110880. * 'pebbles': { 'age': 1, 'active': true }
  110881. * };
  110882. *
  110883. * _.findKey(users, function(o) { return o.age < 40; });
  110884. * // => 'barney' (iteration order is not guaranteed)
  110885. *
  110886. * // The `_.matches` iteratee shorthand.
  110887. * _.findKey(users, { 'age': 1, 'active': true });
  110888. * // => 'pebbles'
  110889. *
  110890. * // The `_.matchesProperty` iteratee shorthand.
  110891. * _.findKey(users, ['active', false]);
  110892. * // => 'fred'
  110893. *
  110894. * // The `_.property` iteratee shorthand.
  110895. * _.findKey(users, 'active');
  110896. * // => 'barney'
  110897. */
  110898. function findKey(object, predicate) {
  110899. 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"]);
  110900. }
  110901. /* harmony default export */ __webpack_exports__["default"] = (findKey);
  110902. /***/ }),
  110903. /***/ "./node_modules/lodash-es/findLast.js":
  110904. /*!********************************************!*\
  110905. !*** ./node_modules/lodash-es/findLast.js ***!
  110906. \********************************************/
  110907. /*! exports provided: default */
  110908. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  110909. "use strict";
  110910. __webpack_require__.r(__webpack_exports__);
  110911. /* harmony import */ var _createFind_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createFind.js */ "./node_modules/lodash-es/_createFind.js");
  110912. /* harmony import */ var _findLastIndex_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./findLastIndex.js */ "./node_modules/lodash-es/findLastIndex.js");
  110913. /**
  110914. * This method is like `_.find` except that it iterates over elements of
  110915. * `collection` from right to left.
  110916. *
  110917. * @static
  110918. * @memberOf _
  110919. * @since 2.0.0
  110920. * @category Collection
  110921. * @param {Array|Object} collection The collection to inspect.
  110922. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  110923. * @param {number} [fromIndex=collection.length-1] The index to search from.
  110924. * @returns {*} Returns the matched element, else `undefined`.
  110925. * @example
  110926. *
  110927. * _.findLast([1, 2, 3, 4], function(n) {
  110928. * return n % 2 == 1;
  110929. * });
  110930. * // => 3
  110931. */
  110932. var findLast = Object(_createFind_js__WEBPACK_IMPORTED_MODULE_0__["default"])(_findLastIndex_js__WEBPACK_IMPORTED_MODULE_1__["default"]);
  110933. /* harmony default export */ __webpack_exports__["default"] = (findLast);
  110934. /***/ }),
  110935. /***/ "./node_modules/lodash-es/findLastIndex.js":
  110936. /*!*************************************************!*\
  110937. !*** ./node_modules/lodash-es/findLastIndex.js ***!
  110938. \*************************************************/
  110939. /*! exports provided: default */
  110940. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  110941. "use strict";
  110942. __webpack_require__.r(__webpack_exports__);
  110943. /* harmony import */ var _baseFindIndex_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseFindIndex.js */ "./node_modules/lodash-es/_baseFindIndex.js");
  110944. /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
  110945. /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
  110946. /* Built-in method references for those with the same name as other `lodash` methods. */
  110947. var nativeMax = Math.max,
  110948. nativeMin = Math.min;
  110949. /**
  110950. * This method is like `_.findIndex` except that it iterates over elements
  110951. * of `collection` from right to left.
  110952. *
  110953. * @static
  110954. * @memberOf _
  110955. * @since 2.0.0
  110956. * @category Array
  110957. * @param {Array} array The array to inspect.
  110958. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  110959. * @param {number} [fromIndex=array.length-1] The index to search from.
  110960. * @returns {number} Returns the index of the found element, else `-1`.
  110961. * @example
  110962. *
  110963. * var users = [
  110964. * { 'user': 'barney', 'active': true },
  110965. * { 'user': 'fred', 'active': false },
  110966. * { 'user': 'pebbles', 'active': false }
  110967. * ];
  110968. *
  110969. * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; });
  110970. * // => 2
  110971. *
  110972. * // The `_.matches` iteratee shorthand.
  110973. * _.findLastIndex(users, { 'user': 'barney', 'active': true });
  110974. * // => 0
  110975. *
  110976. * // The `_.matchesProperty` iteratee shorthand.
  110977. * _.findLastIndex(users, ['active', false]);
  110978. * // => 2
  110979. *
  110980. * // The `_.property` iteratee shorthand.
  110981. * _.findLastIndex(users, 'active');
  110982. * // => 0
  110983. */
  110984. function findLastIndex(array, predicate, fromIndex) {
  110985. var length = array == null ? 0 : array.length;
  110986. if (!length) {
  110987. return -1;
  110988. }
  110989. var index = length - 1;
  110990. if (fromIndex !== undefined) {
  110991. index = Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_2__["default"])(fromIndex);
  110992. index = fromIndex < 0
  110993. ? nativeMax(length + index, 0)
  110994. : nativeMin(index, length - 1);
  110995. }
  110996. return Object(_baseFindIndex_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, Object(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_1__["default"])(predicate, 3), index, true);
  110997. }
  110998. /* harmony default export */ __webpack_exports__["default"] = (findLastIndex);
  110999. /***/ }),
  111000. /***/ "./node_modules/lodash-es/findLastKey.js":
  111001. /*!***********************************************!*\
  111002. !*** ./node_modules/lodash-es/findLastKey.js ***!
  111003. \***********************************************/
  111004. /*! exports provided: default */
  111005. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  111006. "use strict";
  111007. __webpack_require__.r(__webpack_exports__);
  111008. /* harmony import */ var _baseFindKey_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseFindKey.js */ "./node_modules/lodash-es/_baseFindKey.js");
  111009. /* harmony import */ var _baseForOwnRight_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseForOwnRight.js */ "./node_modules/lodash-es/_baseForOwnRight.js");
  111010. /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
  111011. /**
  111012. * This method is like `_.findKey` except that it iterates over elements of
  111013. * a collection in the opposite order.
  111014. *
  111015. * @static
  111016. * @memberOf _
  111017. * @since 2.0.0
  111018. * @category Object
  111019. * @param {Object} object The object to inspect.
  111020. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  111021. * @returns {string|undefined} Returns the key of the matched element,
  111022. * else `undefined`.
  111023. * @example
  111024. *
  111025. * var users = {
  111026. * 'barney': { 'age': 36, 'active': true },
  111027. * 'fred': { 'age': 40, 'active': false },
  111028. * 'pebbles': { 'age': 1, 'active': true }
  111029. * };
  111030. *
  111031. * _.findLastKey(users, function(o) { return o.age < 40; });
  111032. * // => returns 'pebbles' assuming `_.findKey` returns 'barney'
  111033. *
  111034. * // The `_.matches` iteratee shorthand.
  111035. * _.findLastKey(users, { 'age': 36, 'active': true });
  111036. * // => 'barney'
  111037. *
  111038. * // The `_.matchesProperty` iteratee shorthand.
  111039. * _.findLastKey(users, ['active', false]);
  111040. * // => 'fred'
  111041. *
  111042. * // The `_.property` iteratee shorthand.
  111043. * _.findLastKey(users, 'active');
  111044. * // => 'pebbles'
  111045. */
  111046. function findLastKey(object, predicate) {
  111047. 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"]);
  111048. }
  111049. /* harmony default export */ __webpack_exports__["default"] = (findLastKey);
  111050. /***/ }),
  111051. /***/ "./node_modules/lodash-es/first.js":
  111052. /*!*****************************************!*\
  111053. !*** ./node_modules/lodash-es/first.js ***!
  111054. \*****************************************/
  111055. /*! exports provided: default */
  111056. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  111057. "use strict";
  111058. __webpack_require__.r(__webpack_exports__);
  111059. /* harmony import */ var _head_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./head.js */ "./node_modules/lodash-es/head.js");
  111060. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _head_js__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  111061. /***/ }),
  111062. /***/ "./node_modules/lodash-es/flatMap.js":
  111063. /*!*******************************************!*\
  111064. !*** ./node_modules/lodash-es/flatMap.js ***!
  111065. \*******************************************/
  111066. /*! exports provided: default */
  111067. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  111068. "use strict";
  111069. __webpack_require__.r(__webpack_exports__);
  111070. /* harmony import */ var _baseFlatten_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseFlatten.js */ "./node_modules/lodash-es/_baseFlatten.js");
  111071. /* harmony import */ var _map_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./map.js */ "./node_modules/lodash-es/map.js");
  111072. /**
  111073. * Creates a flattened array of values by running each element in `collection`
  111074. * thru `iteratee` and flattening the mapped results. The iteratee is invoked
  111075. * with three arguments: (value, index|key, collection).
  111076. *
  111077. * @static
  111078. * @memberOf _
  111079. * @since 4.0.0
  111080. * @category Collection
  111081. * @param {Array|Object} collection The collection to iterate over.
  111082. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  111083. * @returns {Array} Returns the new flattened array.
  111084. * @example
  111085. *
  111086. * function duplicate(n) {
  111087. * return [n, n];
  111088. * }
  111089. *
  111090. * _.flatMap([1, 2], duplicate);
  111091. * // => [1, 1, 2, 2]
  111092. */
  111093. function flatMap(collection, iteratee) {
  111094. return Object(_baseFlatten_js__WEBPACK_IMPORTED_MODULE_0__["default"])(Object(_map_js__WEBPACK_IMPORTED_MODULE_1__["default"])(collection, iteratee), 1);
  111095. }
  111096. /* harmony default export */ __webpack_exports__["default"] = (flatMap);
  111097. /***/ }),
  111098. /***/ "./node_modules/lodash-es/flatMapDeep.js":
  111099. /*!***********************************************!*\
  111100. !*** ./node_modules/lodash-es/flatMapDeep.js ***!
  111101. \***********************************************/
  111102. /*! exports provided: default */
  111103. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  111104. "use strict";
  111105. __webpack_require__.r(__webpack_exports__);
  111106. /* harmony import */ var _baseFlatten_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseFlatten.js */ "./node_modules/lodash-es/_baseFlatten.js");
  111107. /* harmony import */ var _map_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./map.js */ "./node_modules/lodash-es/map.js");
  111108. /** Used as references for various `Number` constants. */
  111109. var INFINITY = 1 / 0;
  111110. /**
  111111. * This method is like `_.flatMap` except that it recursively flattens the
  111112. * mapped results.
  111113. *
  111114. * @static
  111115. * @memberOf _
  111116. * @since 4.7.0
  111117. * @category Collection
  111118. * @param {Array|Object} collection The collection to iterate over.
  111119. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  111120. * @returns {Array} Returns the new flattened array.
  111121. * @example
  111122. *
  111123. * function duplicate(n) {
  111124. * return [[[n, n]]];
  111125. * }
  111126. *
  111127. * _.flatMapDeep([1, 2], duplicate);
  111128. * // => [1, 1, 2, 2]
  111129. */
  111130. function flatMapDeep(collection, iteratee) {
  111131. return Object(_baseFlatten_js__WEBPACK_IMPORTED_MODULE_0__["default"])(Object(_map_js__WEBPACK_IMPORTED_MODULE_1__["default"])(collection, iteratee), INFINITY);
  111132. }
  111133. /* harmony default export */ __webpack_exports__["default"] = (flatMapDeep);
  111134. /***/ }),
  111135. /***/ "./node_modules/lodash-es/flatMapDepth.js":
  111136. /*!************************************************!*\
  111137. !*** ./node_modules/lodash-es/flatMapDepth.js ***!
  111138. \************************************************/
  111139. /*! exports provided: default */
  111140. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  111141. "use strict";
  111142. __webpack_require__.r(__webpack_exports__);
  111143. /* harmony import */ var _baseFlatten_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseFlatten.js */ "./node_modules/lodash-es/_baseFlatten.js");
  111144. /* harmony import */ var _map_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./map.js */ "./node_modules/lodash-es/map.js");
  111145. /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
  111146. /**
  111147. * This method is like `_.flatMap` except that it recursively flattens the
  111148. * mapped results up to `depth` times.
  111149. *
  111150. * @static
  111151. * @memberOf _
  111152. * @since 4.7.0
  111153. * @category Collection
  111154. * @param {Array|Object} collection The collection to iterate over.
  111155. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  111156. * @param {number} [depth=1] The maximum recursion depth.
  111157. * @returns {Array} Returns the new flattened array.
  111158. * @example
  111159. *
  111160. * function duplicate(n) {
  111161. * return [[[n, n]]];
  111162. * }
  111163. *
  111164. * _.flatMapDepth([1, 2], duplicate, 2);
  111165. * // => [[1, 1], [2, 2]]
  111166. */
  111167. function flatMapDepth(collection, iteratee, depth) {
  111168. depth = depth === undefined ? 1 : Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_2__["default"])(depth);
  111169. return Object(_baseFlatten_js__WEBPACK_IMPORTED_MODULE_0__["default"])(Object(_map_js__WEBPACK_IMPORTED_MODULE_1__["default"])(collection, iteratee), depth);
  111170. }
  111171. /* harmony default export */ __webpack_exports__["default"] = (flatMapDepth);
  111172. /***/ }),
  111173. /***/ "./node_modules/lodash-es/flatten.js":
  111174. /*!*******************************************!*\
  111175. !*** ./node_modules/lodash-es/flatten.js ***!
  111176. \*******************************************/
  111177. /*! exports provided: default */
  111178. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  111179. "use strict";
  111180. __webpack_require__.r(__webpack_exports__);
  111181. /* harmony import */ var _baseFlatten_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseFlatten.js */ "./node_modules/lodash-es/_baseFlatten.js");
  111182. /**
  111183. * Flattens `array` a single level deep.
  111184. *
  111185. * @static
  111186. * @memberOf _
  111187. * @since 0.1.0
  111188. * @category Array
  111189. * @param {Array} array The array to flatten.
  111190. * @returns {Array} Returns the new flattened array.
  111191. * @example
  111192. *
  111193. * _.flatten([1, [2, [3, [4]], 5]]);
  111194. * // => [1, 2, [3, [4]], 5]
  111195. */
  111196. function flatten(array) {
  111197. var length = array == null ? 0 : array.length;
  111198. return length ? Object(_baseFlatten_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, 1) : [];
  111199. }
  111200. /* harmony default export */ __webpack_exports__["default"] = (flatten);
  111201. /***/ }),
  111202. /***/ "./node_modules/lodash-es/flattenDeep.js":
  111203. /*!***********************************************!*\
  111204. !*** ./node_modules/lodash-es/flattenDeep.js ***!
  111205. \***********************************************/
  111206. /*! exports provided: default */
  111207. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  111208. "use strict";
  111209. __webpack_require__.r(__webpack_exports__);
  111210. /* harmony import */ var _baseFlatten_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseFlatten.js */ "./node_modules/lodash-es/_baseFlatten.js");
  111211. /** Used as references for various `Number` constants. */
  111212. var INFINITY = 1 / 0;
  111213. /**
  111214. * Recursively flattens `array`.
  111215. *
  111216. * @static
  111217. * @memberOf _
  111218. * @since 3.0.0
  111219. * @category Array
  111220. * @param {Array} array The array to flatten.
  111221. * @returns {Array} Returns the new flattened array.
  111222. * @example
  111223. *
  111224. * _.flattenDeep([1, [2, [3, [4]], 5]]);
  111225. * // => [1, 2, 3, 4, 5]
  111226. */
  111227. function flattenDeep(array) {
  111228. var length = array == null ? 0 : array.length;
  111229. return length ? Object(_baseFlatten_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, INFINITY) : [];
  111230. }
  111231. /* harmony default export */ __webpack_exports__["default"] = (flattenDeep);
  111232. /***/ }),
  111233. /***/ "./node_modules/lodash-es/flattenDepth.js":
  111234. /*!************************************************!*\
  111235. !*** ./node_modules/lodash-es/flattenDepth.js ***!
  111236. \************************************************/
  111237. /*! exports provided: default */
  111238. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  111239. "use strict";
  111240. __webpack_require__.r(__webpack_exports__);
  111241. /* harmony import */ var _baseFlatten_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseFlatten.js */ "./node_modules/lodash-es/_baseFlatten.js");
  111242. /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
  111243. /**
  111244. * Recursively flatten `array` up to `depth` times.
  111245. *
  111246. * @static
  111247. * @memberOf _
  111248. * @since 4.4.0
  111249. * @category Array
  111250. * @param {Array} array The array to flatten.
  111251. * @param {number} [depth=1] The maximum recursion depth.
  111252. * @returns {Array} Returns the new flattened array.
  111253. * @example
  111254. *
  111255. * var array = [1, [2, [3, [4]], 5]];
  111256. *
  111257. * _.flattenDepth(array, 1);
  111258. * // => [1, 2, [3, [4]], 5]
  111259. *
  111260. * _.flattenDepth(array, 2);
  111261. * // => [1, 2, 3, [4], 5]
  111262. */
  111263. function flattenDepth(array, depth) {
  111264. var length = array == null ? 0 : array.length;
  111265. if (!length) {
  111266. return [];
  111267. }
  111268. depth = depth === undefined ? 1 : Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_1__["default"])(depth);
  111269. return Object(_baseFlatten_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, depth);
  111270. }
  111271. /* harmony default export */ __webpack_exports__["default"] = (flattenDepth);
  111272. /***/ }),
  111273. /***/ "./node_modules/lodash-es/flip.js":
  111274. /*!****************************************!*\
  111275. !*** ./node_modules/lodash-es/flip.js ***!
  111276. \****************************************/
  111277. /*! exports provided: default */
  111278. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  111279. "use strict";
  111280. __webpack_require__.r(__webpack_exports__);
  111281. /* harmony import */ var _createWrap_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createWrap.js */ "./node_modules/lodash-es/_createWrap.js");
  111282. /** Used to compose bitmasks for function metadata. */
  111283. var WRAP_FLIP_FLAG = 512;
  111284. /**
  111285. * Creates a function that invokes `func` with arguments reversed.
  111286. *
  111287. * @static
  111288. * @memberOf _
  111289. * @since 4.0.0
  111290. * @category Function
  111291. * @param {Function} func The function to flip arguments for.
  111292. * @returns {Function} Returns the new flipped function.
  111293. * @example
  111294. *
  111295. * var flipped = _.flip(function() {
  111296. * return _.toArray(arguments);
  111297. * });
  111298. *
  111299. * flipped('a', 'b', 'c', 'd');
  111300. * // => ['d', 'c', 'b', 'a']
  111301. */
  111302. function flip(func) {
  111303. return Object(_createWrap_js__WEBPACK_IMPORTED_MODULE_0__["default"])(func, WRAP_FLIP_FLAG);
  111304. }
  111305. /* harmony default export */ __webpack_exports__["default"] = (flip);
  111306. /***/ }),
  111307. /***/ "./node_modules/lodash-es/floor.js":
  111308. /*!*****************************************!*\
  111309. !*** ./node_modules/lodash-es/floor.js ***!
  111310. \*****************************************/
  111311. /*! exports provided: default */
  111312. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  111313. "use strict";
  111314. __webpack_require__.r(__webpack_exports__);
  111315. /* harmony import */ var _createRound_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createRound.js */ "./node_modules/lodash-es/_createRound.js");
  111316. /**
  111317. * Computes `number` rounded down to `precision`.
  111318. *
  111319. * @static
  111320. * @memberOf _
  111321. * @since 3.10.0
  111322. * @category Math
  111323. * @param {number} number The number to round down.
  111324. * @param {number} [precision=0] The precision to round down to.
  111325. * @returns {number} Returns the rounded down number.
  111326. * @example
  111327. *
  111328. * _.floor(4.006);
  111329. * // => 4
  111330. *
  111331. * _.floor(0.046, 2);
  111332. * // => 0.04
  111333. *
  111334. * _.floor(4060, -2);
  111335. * // => 4000
  111336. */
  111337. var floor = Object(_createRound_js__WEBPACK_IMPORTED_MODULE_0__["default"])('floor');
  111338. /* harmony default export */ __webpack_exports__["default"] = (floor);
  111339. /***/ }),
  111340. /***/ "./node_modules/lodash-es/flow.js":
  111341. /*!****************************************!*\
  111342. !*** ./node_modules/lodash-es/flow.js ***!
  111343. \****************************************/
  111344. /*! exports provided: default */
  111345. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  111346. "use strict";
  111347. __webpack_require__.r(__webpack_exports__);
  111348. /* harmony import */ var _createFlow_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createFlow.js */ "./node_modules/lodash-es/_createFlow.js");
  111349. /**
  111350. * Creates a function that returns the result of invoking the given functions
  111351. * with the `this` binding of the created function, where each successive
  111352. * invocation is supplied the return value of the previous.
  111353. *
  111354. * @static
  111355. * @memberOf _
  111356. * @since 3.0.0
  111357. * @category Util
  111358. * @param {...(Function|Function[])} [funcs] The functions to invoke.
  111359. * @returns {Function} Returns the new composite function.
  111360. * @see _.flowRight
  111361. * @example
  111362. *
  111363. * function square(n) {
  111364. * return n * n;
  111365. * }
  111366. *
  111367. * var addSquare = _.flow([_.add, square]);
  111368. * addSquare(1, 2);
  111369. * // => 9
  111370. */
  111371. var flow = Object(_createFlow_js__WEBPACK_IMPORTED_MODULE_0__["default"])();
  111372. /* harmony default export */ __webpack_exports__["default"] = (flow);
  111373. /***/ }),
  111374. /***/ "./node_modules/lodash-es/flowRight.js":
  111375. /*!*********************************************!*\
  111376. !*** ./node_modules/lodash-es/flowRight.js ***!
  111377. \*********************************************/
  111378. /*! exports provided: default */
  111379. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  111380. "use strict";
  111381. __webpack_require__.r(__webpack_exports__);
  111382. /* harmony import */ var _createFlow_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createFlow.js */ "./node_modules/lodash-es/_createFlow.js");
  111383. /**
  111384. * This method is like `_.flow` except that it creates a function that
  111385. * invokes the given functions from right to left.
  111386. *
  111387. * @static
  111388. * @since 3.0.0
  111389. * @memberOf _
  111390. * @category Util
  111391. * @param {...(Function|Function[])} [funcs] The functions to invoke.
  111392. * @returns {Function} Returns the new composite function.
  111393. * @see _.flow
  111394. * @example
  111395. *
  111396. * function square(n) {
  111397. * return n * n;
  111398. * }
  111399. *
  111400. * var addSquare = _.flowRight([square, _.add]);
  111401. * addSquare(1, 2);
  111402. * // => 9
  111403. */
  111404. var flowRight = Object(_createFlow_js__WEBPACK_IMPORTED_MODULE_0__["default"])(true);
  111405. /* harmony default export */ __webpack_exports__["default"] = (flowRight);
  111406. /***/ }),
  111407. /***/ "./node_modules/lodash-es/forEach.js":
  111408. /*!*******************************************!*\
  111409. !*** ./node_modules/lodash-es/forEach.js ***!
  111410. \*******************************************/
  111411. /*! exports provided: default */
  111412. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  111413. "use strict";
  111414. __webpack_require__.r(__webpack_exports__);
  111415. /* harmony import */ var _arrayEach_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayEach.js */ "./node_modules/lodash-es/_arrayEach.js");
  111416. /* harmony import */ var _baseEach_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseEach.js */ "./node_modules/lodash-es/_baseEach.js");
  111417. /* harmony import */ var _castFunction_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_castFunction.js */ "./node_modules/lodash-es/_castFunction.js");
  111418. /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
  111419. /**
  111420. * Iterates over elements of `collection` and invokes `iteratee` for each element.
  111421. * The iteratee is invoked with three arguments: (value, index|key, collection).
  111422. * Iteratee functions may exit iteration early by explicitly returning `false`.
  111423. *
  111424. * **Note:** As with other "Collections" methods, objects with a "length"
  111425. * property are iterated like arrays. To avoid this behavior use `_.forIn`
  111426. * or `_.forOwn` for object iteration.
  111427. *
  111428. * @static
  111429. * @memberOf _
  111430. * @since 0.1.0
  111431. * @alias each
  111432. * @category Collection
  111433. * @param {Array|Object} collection The collection to iterate over.
  111434. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  111435. * @returns {Array|Object} Returns `collection`.
  111436. * @see _.forEachRight
  111437. * @example
  111438. *
  111439. * _.forEach([1, 2], function(value) {
  111440. * console.log(value);
  111441. * });
  111442. * // => Logs `1` then `2`.
  111443. *
  111444. * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) {
  111445. * console.log(key);
  111446. * });
  111447. * // => Logs 'a' then 'b' (iteration order is not guaranteed).
  111448. */
  111449. function forEach(collection, iteratee) {
  111450. 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"];
  111451. return func(collection, Object(_castFunction_js__WEBPACK_IMPORTED_MODULE_2__["default"])(iteratee));
  111452. }
  111453. /* harmony default export */ __webpack_exports__["default"] = (forEach);
  111454. /***/ }),
  111455. /***/ "./node_modules/lodash-es/forEachRight.js":
  111456. /*!************************************************!*\
  111457. !*** ./node_modules/lodash-es/forEachRight.js ***!
  111458. \************************************************/
  111459. /*! exports provided: default */
  111460. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  111461. "use strict";
  111462. __webpack_require__.r(__webpack_exports__);
  111463. /* harmony import */ var _arrayEachRight_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayEachRight.js */ "./node_modules/lodash-es/_arrayEachRight.js");
  111464. /* harmony import */ var _baseEachRight_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseEachRight.js */ "./node_modules/lodash-es/_baseEachRight.js");
  111465. /* harmony import */ var _castFunction_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_castFunction.js */ "./node_modules/lodash-es/_castFunction.js");
  111466. /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
  111467. /**
  111468. * This method is like `_.forEach` except that it iterates over elements of
  111469. * `collection` from right to left.
  111470. *
  111471. * @static
  111472. * @memberOf _
  111473. * @since 2.0.0
  111474. * @alias eachRight
  111475. * @category Collection
  111476. * @param {Array|Object} collection The collection to iterate over.
  111477. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  111478. * @returns {Array|Object} Returns `collection`.
  111479. * @see _.forEach
  111480. * @example
  111481. *
  111482. * _.forEachRight([1, 2], function(value) {
  111483. * console.log(value);
  111484. * });
  111485. * // => Logs `2` then `1`.
  111486. */
  111487. function forEachRight(collection, iteratee) {
  111488. 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"];
  111489. return func(collection, Object(_castFunction_js__WEBPACK_IMPORTED_MODULE_2__["default"])(iteratee));
  111490. }
  111491. /* harmony default export */ __webpack_exports__["default"] = (forEachRight);
  111492. /***/ }),
  111493. /***/ "./node_modules/lodash-es/forIn.js":
  111494. /*!*****************************************!*\
  111495. !*** ./node_modules/lodash-es/forIn.js ***!
  111496. \*****************************************/
  111497. /*! exports provided: default */
  111498. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  111499. "use strict";
  111500. __webpack_require__.r(__webpack_exports__);
  111501. /* harmony import */ var _baseFor_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseFor.js */ "./node_modules/lodash-es/_baseFor.js");
  111502. /* harmony import */ var _castFunction_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_castFunction.js */ "./node_modules/lodash-es/_castFunction.js");
  111503. /* harmony import */ var _keysIn_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./keysIn.js */ "./node_modules/lodash-es/keysIn.js");
  111504. /**
  111505. * Iterates over own and inherited enumerable string keyed properties of an
  111506. * object and invokes `iteratee` for each property. The iteratee is invoked
  111507. * with three arguments: (value, key, object). Iteratee functions may exit
  111508. * iteration early by explicitly returning `false`.
  111509. *
  111510. * @static
  111511. * @memberOf _
  111512. * @since 0.3.0
  111513. * @category Object
  111514. * @param {Object} object The object to iterate over.
  111515. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  111516. * @returns {Object} Returns `object`.
  111517. * @see _.forInRight
  111518. * @example
  111519. *
  111520. * function Foo() {
  111521. * this.a = 1;
  111522. * this.b = 2;
  111523. * }
  111524. *
  111525. * Foo.prototype.c = 3;
  111526. *
  111527. * _.forIn(new Foo, function(value, key) {
  111528. * console.log(key);
  111529. * });
  111530. * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed).
  111531. */
  111532. function forIn(object, iteratee) {
  111533. return object == null
  111534. ? object
  111535. : 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"]);
  111536. }
  111537. /* harmony default export */ __webpack_exports__["default"] = (forIn);
  111538. /***/ }),
  111539. /***/ "./node_modules/lodash-es/forInRight.js":
  111540. /*!**********************************************!*\
  111541. !*** ./node_modules/lodash-es/forInRight.js ***!
  111542. \**********************************************/
  111543. /*! exports provided: default */
  111544. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  111545. "use strict";
  111546. __webpack_require__.r(__webpack_exports__);
  111547. /* harmony import */ var _baseForRight_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseForRight.js */ "./node_modules/lodash-es/_baseForRight.js");
  111548. /* harmony import */ var _castFunction_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_castFunction.js */ "./node_modules/lodash-es/_castFunction.js");
  111549. /* harmony import */ var _keysIn_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./keysIn.js */ "./node_modules/lodash-es/keysIn.js");
  111550. /**
  111551. * This method is like `_.forIn` except that it iterates over properties of
  111552. * `object` in the opposite order.
  111553. *
  111554. * @static
  111555. * @memberOf _
  111556. * @since 2.0.0
  111557. * @category Object
  111558. * @param {Object} object The object to iterate over.
  111559. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  111560. * @returns {Object} Returns `object`.
  111561. * @see _.forIn
  111562. * @example
  111563. *
  111564. * function Foo() {
  111565. * this.a = 1;
  111566. * this.b = 2;
  111567. * }
  111568. *
  111569. * Foo.prototype.c = 3;
  111570. *
  111571. * _.forInRight(new Foo, function(value, key) {
  111572. * console.log(key);
  111573. * });
  111574. * // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'.
  111575. */
  111576. function forInRight(object, iteratee) {
  111577. return object == null
  111578. ? object
  111579. : 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"]);
  111580. }
  111581. /* harmony default export */ __webpack_exports__["default"] = (forInRight);
  111582. /***/ }),
  111583. /***/ "./node_modules/lodash-es/forOwn.js":
  111584. /*!******************************************!*\
  111585. !*** ./node_modules/lodash-es/forOwn.js ***!
  111586. \******************************************/
  111587. /*! exports provided: default */
  111588. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  111589. "use strict";
  111590. __webpack_require__.r(__webpack_exports__);
  111591. /* harmony import */ var _baseForOwn_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseForOwn.js */ "./node_modules/lodash-es/_baseForOwn.js");
  111592. /* harmony import */ var _castFunction_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_castFunction.js */ "./node_modules/lodash-es/_castFunction.js");
  111593. /**
  111594. * Iterates over own enumerable string keyed properties of an object and
  111595. * invokes `iteratee` for each property. The iteratee is invoked with three
  111596. * arguments: (value, key, object). Iteratee functions may exit iteration
  111597. * early by explicitly returning `false`.
  111598. *
  111599. * @static
  111600. * @memberOf _
  111601. * @since 0.3.0
  111602. * @category Object
  111603. * @param {Object} object The object to iterate over.
  111604. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  111605. * @returns {Object} Returns `object`.
  111606. * @see _.forOwnRight
  111607. * @example
  111608. *
  111609. * function Foo() {
  111610. * this.a = 1;
  111611. * this.b = 2;
  111612. * }
  111613. *
  111614. * Foo.prototype.c = 3;
  111615. *
  111616. * _.forOwn(new Foo, function(value, key) {
  111617. * console.log(key);
  111618. * });
  111619. * // => Logs 'a' then 'b' (iteration order is not guaranteed).
  111620. */
  111621. function forOwn(object, iteratee) {
  111622. return object && Object(_baseForOwn_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, Object(_castFunction_js__WEBPACK_IMPORTED_MODULE_1__["default"])(iteratee));
  111623. }
  111624. /* harmony default export */ __webpack_exports__["default"] = (forOwn);
  111625. /***/ }),
  111626. /***/ "./node_modules/lodash-es/forOwnRight.js":
  111627. /*!***********************************************!*\
  111628. !*** ./node_modules/lodash-es/forOwnRight.js ***!
  111629. \***********************************************/
  111630. /*! exports provided: default */
  111631. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  111632. "use strict";
  111633. __webpack_require__.r(__webpack_exports__);
  111634. /* harmony import */ var _baseForOwnRight_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseForOwnRight.js */ "./node_modules/lodash-es/_baseForOwnRight.js");
  111635. /* harmony import */ var _castFunction_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_castFunction.js */ "./node_modules/lodash-es/_castFunction.js");
  111636. /**
  111637. * This method is like `_.forOwn` except that it iterates over properties of
  111638. * `object` in the opposite order.
  111639. *
  111640. * @static
  111641. * @memberOf _
  111642. * @since 2.0.0
  111643. * @category Object
  111644. * @param {Object} object The object to iterate over.
  111645. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  111646. * @returns {Object} Returns `object`.
  111647. * @see _.forOwn
  111648. * @example
  111649. *
  111650. * function Foo() {
  111651. * this.a = 1;
  111652. * this.b = 2;
  111653. * }
  111654. *
  111655. * Foo.prototype.c = 3;
  111656. *
  111657. * _.forOwnRight(new Foo, function(value, key) {
  111658. * console.log(key);
  111659. * });
  111660. * // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'.
  111661. */
  111662. function forOwnRight(object, iteratee) {
  111663. return object && Object(_baseForOwnRight_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, Object(_castFunction_js__WEBPACK_IMPORTED_MODULE_1__["default"])(iteratee));
  111664. }
  111665. /* harmony default export */ __webpack_exports__["default"] = (forOwnRight);
  111666. /***/ }),
  111667. /***/ "./node_modules/lodash-es/fromPairs.js":
  111668. /*!*********************************************!*\
  111669. !*** ./node_modules/lodash-es/fromPairs.js ***!
  111670. \*********************************************/
  111671. /*! exports provided: default */
  111672. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  111673. "use strict";
  111674. __webpack_require__.r(__webpack_exports__);
  111675. /**
  111676. * The inverse of `_.toPairs`; this method returns an object composed
  111677. * from key-value `pairs`.
  111678. *
  111679. * @static
  111680. * @memberOf _
  111681. * @since 4.0.0
  111682. * @category Array
  111683. * @param {Array} pairs The key-value pairs.
  111684. * @returns {Object} Returns the new object.
  111685. * @example
  111686. *
  111687. * _.fromPairs([['a', 1], ['b', 2]]);
  111688. * // => { 'a': 1, 'b': 2 }
  111689. */
  111690. function fromPairs(pairs) {
  111691. var index = -1,
  111692. length = pairs == null ? 0 : pairs.length,
  111693. result = {};
  111694. while (++index < length) {
  111695. var pair = pairs[index];
  111696. result[pair[0]] = pair[1];
  111697. }
  111698. return result;
  111699. }
  111700. /* harmony default export */ __webpack_exports__["default"] = (fromPairs);
  111701. /***/ }),
  111702. /***/ "./node_modules/lodash-es/function.default.js":
  111703. /*!****************************************************!*\
  111704. !*** ./node_modules/lodash-es/function.default.js ***!
  111705. \****************************************************/
  111706. /*! exports provided: default */
  111707. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  111708. "use strict";
  111709. __webpack_require__.r(__webpack_exports__);
  111710. /* harmony import */ var _after_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./after.js */ "./node_modules/lodash-es/after.js");
  111711. /* harmony import */ var _ary_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ary.js */ "./node_modules/lodash-es/ary.js");
  111712. /* harmony import */ var _before_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./before.js */ "./node_modules/lodash-es/before.js");
  111713. /* harmony import */ var _bind_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./bind.js */ "./node_modules/lodash-es/bind.js");
  111714. /* harmony import */ var _bindKey_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./bindKey.js */ "./node_modules/lodash-es/bindKey.js");
  111715. /* harmony import */ var _curry_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./curry.js */ "./node_modules/lodash-es/curry.js");
  111716. /* harmony import */ var _curryRight_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./curryRight.js */ "./node_modules/lodash-es/curryRight.js");
  111717. /* harmony import */ var _debounce_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./debounce.js */ "./node_modules/lodash-es/debounce.js");
  111718. /* harmony import */ var _defer_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./defer.js */ "./node_modules/lodash-es/defer.js");
  111719. /* harmony import */ var _delay_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./delay.js */ "./node_modules/lodash-es/delay.js");
  111720. /* harmony import */ var _flip_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./flip.js */ "./node_modules/lodash-es/flip.js");
  111721. /* harmony import */ var _memoize_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./memoize.js */ "./node_modules/lodash-es/memoize.js");
  111722. /* harmony import */ var _negate_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./negate.js */ "./node_modules/lodash-es/negate.js");
  111723. /* harmony import */ var _once_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./once.js */ "./node_modules/lodash-es/once.js");
  111724. /* harmony import */ var _overArgs_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./overArgs.js */ "./node_modules/lodash-es/overArgs.js");
  111725. /* harmony import */ var _partial_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./partial.js */ "./node_modules/lodash-es/partial.js");
  111726. /* harmony import */ var _partialRight_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./partialRight.js */ "./node_modules/lodash-es/partialRight.js");
  111727. /* harmony import */ var _rearg_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./rearg.js */ "./node_modules/lodash-es/rearg.js");
  111728. /* harmony import */ var _rest_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./rest.js */ "./node_modules/lodash-es/rest.js");
  111729. /* harmony import */ var _spread_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./spread.js */ "./node_modules/lodash-es/spread.js");
  111730. /* harmony import */ var _throttle_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./throttle.js */ "./node_modules/lodash-es/throttle.js");
  111731. /* harmony import */ var _unary_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./unary.js */ "./node_modules/lodash-es/unary.js");
  111732. /* harmony import */ var _wrap_js__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./wrap.js */ "./node_modules/lodash-es/wrap.js");
  111733. /* harmony default export */ __webpack_exports__["default"] = ({
  111734. 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"],
  111735. 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"],
  111736. 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"],
  111737. 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"],
  111738. throttle: _throttle_js__WEBPACK_IMPORTED_MODULE_20__["default"], unary: _unary_js__WEBPACK_IMPORTED_MODULE_21__["default"], wrap: _wrap_js__WEBPACK_IMPORTED_MODULE_22__["default"]
  111739. });
  111740. /***/ }),
  111741. /***/ "./node_modules/lodash-es/function.js":
  111742. /*!********************************************!*\
  111743. !*** ./node_modules/lodash-es/function.js ***!
  111744. \********************************************/
  111745. /*! 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 */
  111746. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  111747. "use strict";
  111748. __webpack_require__.r(__webpack_exports__);
  111749. /* harmony import */ var _after_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./after.js */ "./node_modules/lodash-es/after.js");
  111750. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "after", function() { return _after_js__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  111751. /* harmony import */ var _ary_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ary.js */ "./node_modules/lodash-es/ary.js");
  111752. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ary", function() { return _ary_js__WEBPACK_IMPORTED_MODULE_1__["default"]; });
  111753. /* harmony import */ var _before_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./before.js */ "./node_modules/lodash-es/before.js");
  111754. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "before", function() { return _before_js__WEBPACK_IMPORTED_MODULE_2__["default"]; });
  111755. /* harmony import */ var _bind_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./bind.js */ "./node_modules/lodash-es/bind.js");
  111756. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "bind", function() { return _bind_js__WEBPACK_IMPORTED_MODULE_3__["default"]; });
  111757. /* harmony import */ var _bindKey_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./bindKey.js */ "./node_modules/lodash-es/bindKey.js");
  111758. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "bindKey", function() { return _bindKey_js__WEBPACK_IMPORTED_MODULE_4__["default"]; });
  111759. /* harmony import */ var _curry_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./curry.js */ "./node_modules/lodash-es/curry.js");
  111760. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "curry", function() { return _curry_js__WEBPACK_IMPORTED_MODULE_5__["default"]; });
  111761. /* harmony import */ var _curryRight_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./curryRight.js */ "./node_modules/lodash-es/curryRight.js");
  111762. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "curryRight", function() { return _curryRight_js__WEBPACK_IMPORTED_MODULE_6__["default"]; });
  111763. /* harmony import */ var _debounce_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./debounce.js */ "./node_modules/lodash-es/debounce.js");
  111764. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "debounce", function() { return _debounce_js__WEBPACK_IMPORTED_MODULE_7__["default"]; });
  111765. /* harmony import */ var _defer_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./defer.js */ "./node_modules/lodash-es/defer.js");
  111766. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "defer", function() { return _defer_js__WEBPACK_IMPORTED_MODULE_8__["default"]; });
  111767. /* harmony import */ var _delay_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./delay.js */ "./node_modules/lodash-es/delay.js");
  111768. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "delay", function() { return _delay_js__WEBPACK_IMPORTED_MODULE_9__["default"]; });
  111769. /* harmony import */ var _flip_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./flip.js */ "./node_modules/lodash-es/flip.js");
  111770. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "flip", function() { return _flip_js__WEBPACK_IMPORTED_MODULE_10__["default"]; });
  111771. /* harmony import */ var _memoize_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./memoize.js */ "./node_modules/lodash-es/memoize.js");
  111772. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "memoize", function() { return _memoize_js__WEBPACK_IMPORTED_MODULE_11__["default"]; });
  111773. /* harmony import */ var _negate_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./negate.js */ "./node_modules/lodash-es/negate.js");
  111774. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "negate", function() { return _negate_js__WEBPACK_IMPORTED_MODULE_12__["default"]; });
  111775. /* harmony import */ var _once_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./once.js */ "./node_modules/lodash-es/once.js");
  111776. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "once", function() { return _once_js__WEBPACK_IMPORTED_MODULE_13__["default"]; });
  111777. /* harmony import */ var _overArgs_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./overArgs.js */ "./node_modules/lodash-es/overArgs.js");
  111778. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "overArgs", function() { return _overArgs_js__WEBPACK_IMPORTED_MODULE_14__["default"]; });
  111779. /* harmony import */ var _partial_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./partial.js */ "./node_modules/lodash-es/partial.js");
  111780. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "partial", function() { return _partial_js__WEBPACK_IMPORTED_MODULE_15__["default"]; });
  111781. /* harmony import */ var _partialRight_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./partialRight.js */ "./node_modules/lodash-es/partialRight.js");
  111782. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "partialRight", function() { return _partialRight_js__WEBPACK_IMPORTED_MODULE_16__["default"]; });
  111783. /* harmony import */ var _rearg_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./rearg.js */ "./node_modules/lodash-es/rearg.js");
  111784. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "rearg", function() { return _rearg_js__WEBPACK_IMPORTED_MODULE_17__["default"]; });
  111785. /* harmony import */ var _rest_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./rest.js */ "./node_modules/lodash-es/rest.js");
  111786. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "rest", function() { return _rest_js__WEBPACK_IMPORTED_MODULE_18__["default"]; });
  111787. /* harmony import */ var _spread_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./spread.js */ "./node_modules/lodash-es/spread.js");
  111788. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "spread", function() { return _spread_js__WEBPACK_IMPORTED_MODULE_19__["default"]; });
  111789. /* harmony import */ var _throttle_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./throttle.js */ "./node_modules/lodash-es/throttle.js");
  111790. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "throttle", function() { return _throttle_js__WEBPACK_IMPORTED_MODULE_20__["default"]; });
  111791. /* harmony import */ var _unary_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./unary.js */ "./node_modules/lodash-es/unary.js");
  111792. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "unary", function() { return _unary_js__WEBPACK_IMPORTED_MODULE_21__["default"]; });
  111793. /* harmony import */ var _wrap_js__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./wrap.js */ "./node_modules/lodash-es/wrap.js");
  111794. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "wrap", function() { return _wrap_js__WEBPACK_IMPORTED_MODULE_22__["default"]; });
  111795. /* harmony import */ var _function_default_js__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./function.default.js */ "./node_modules/lodash-es/function.default.js");
  111796. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _function_default_js__WEBPACK_IMPORTED_MODULE_23__["default"]; });
  111797. /***/ }),
  111798. /***/ "./node_modules/lodash-es/functions.js":
  111799. /*!*********************************************!*\
  111800. !*** ./node_modules/lodash-es/functions.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 _baseFunctions_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseFunctions.js */ "./node_modules/lodash-es/_baseFunctions.js");
  111807. /* harmony import */ var _keys_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./keys.js */ "./node_modules/lodash-es/keys.js");
  111808. /**
  111809. * Creates an array of function property names from own enumerable properties
  111810. * of `object`.
  111811. *
  111812. * @static
  111813. * @since 0.1.0
  111814. * @memberOf _
  111815. * @category Object
  111816. * @param {Object} object The object to inspect.
  111817. * @returns {Array} Returns the function names.
  111818. * @see _.functionsIn
  111819. * @example
  111820. *
  111821. * function Foo() {
  111822. * this.a = _.constant('a');
  111823. * this.b = _.constant('b');
  111824. * }
  111825. *
  111826. * Foo.prototype.c = _.constant('c');
  111827. *
  111828. * _.functions(new Foo);
  111829. * // => ['a', 'b']
  111830. */
  111831. function functions(object) {
  111832. return object == null ? [] : Object(_baseFunctions_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, Object(_keys_js__WEBPACK_IMPORTED_MODULE_1__["default"])(object));
  111833. }
  111834. /* harmony default export */ __webpack_exports__["default"] = (functions);
  111835. /***/ }),
  111836. /***/ "./node_modules/lodash-es/functionsIn.js":
  111837. /*!***********************************************!*\
  111838. !*** ./node_modules/lodash-es/functionsIn.js ***!
  111839. \***********************************************/
  111840. /*! exports provided: default */
  111841. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  111842. "use strict";
  111843. __webpack_require__.r(__webpack_exports__);
  111844. /* harmony import */ var _baseFunctions_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseFunctions.js */ "./node_modules/lodash-es/_baseFunctions.js");
  111845. /* harmony import */ var _keysIn_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./keysIn.js */ "./node_modules/lodash-es/keysIn.js");
  111846. /**
  111847. * Creates an array of function property names from own and inherited
  111848. * enumerable properties of `object`.
  111849. *
  111850. * @static
  111851. * @memberOf _
  111852. * @since 4.0.0
  111853. * @category Object
  111854. * @param {Object} object The object to inspect.
  111855. * @returns {Array} Returns the function names.
  111856. * @see _.functions
  111857. * @example
  111858. *
  111859. * function Foo() {
  111860. * this.a = _.constant('a');
  111861. * this.b = _.constant('b');
  111862. * }
  111863. *
  111864. * Foo.prototype.c = _.constant('c');
  111865. *
  111866. * _.functionsIn(new Foo);
  111867. * // => ['a', 'b', 'c']
  111868. */
  111869. function functionsIn(object) {
  111870. return object == null ? [] : Object(_baseFunctions_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, Object(_keysIn_js__WEBPACK_IMPORTED_MODULE_1__["default"])(object));
  111871. }
  111872. /* harmony default export */ __webpack_exports__["default"] = (functionsIn);
  111873. /***/ }),
  111874. /***/ "./node_modules/lodash-es/get.js":
  111875. /*!***************************************!*\
  111876. !*** ./node_modules/lodash-es/get.js ***!
  111877. \***************************************/
  111878. /*! exports provided: default */
  111879. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  111880. "use strict";
  111881. __webpack_require__.r(__webpack_exports__);
  111882. /* harmony import */ var _baseGet_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseGet.js */ "./node_modules/lodash-es/_baseGet.js");
  111883. /**
  111884. * Gets the value at `path` of `object`. If the resolved value is
  111885. * `undefined`, the `defaultValue` is returned in its place.
  111886. *
  111887. * @static
  111888. * @memberOf _
  111889. * @since 3.7.0
  111890. * @category Object
  111891. * @param {Object} object The object to query.
  111892. * @param {Array|string} path The path of the property to get.
  111893. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  111894. * @returns {*} Returns the resolved value.
  111895. * @example
  111896. *
  111897. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  111898. *
  111899. * _.get(object, 'a[0].b.c');
  111900. * // => 3
  111901. *
  111902. * _.get(object, ['a', '0', 'b', 'c']);
  111903. * // => 3
  111904. *
  111905. * _.get(object, 'a.b.c', 'default');
  111906. * // => 'default'
  111907. */
  111908. function get(object, path, defaultValue) {
  111909. var result = object == null ? undefined : Object(_baseGet_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, path);
  111910. return result === undefined ? defaultValue : result;
  111911. }
  111912. /* harmony default export */ __webpack_exports__["default"] = (get);
  111913. /***/ }),
  111914. /***/ "./node_modules/lodash-es/groupBy.js":
  111915. /*!*******************************************!*\
  111916. !*** ./node_modules/lodash-es/groupBy.js ***!
  111917. \*******************************************/
  111918. /*! exports provided: default */
  111919. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  111920. "use strict";
  111921. __webpack_require__.r(__webpack_exports__);
  111922. /* harmony import */ var _baseAssignValue_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseAssignValue.js */ "./node_modules/lodash-es/_baseAssignValue.js");
  111923. /* harmony import */ var _createAggregator_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_createAggregator.js */ "./node_modules/lodash-es/_createAggregator.js");
  111924. /** Used for built-in method references. */
  111925. var objectProto = Object.prototype;
  111926. /** Used to check objects for own properties. */
  111927. var hasOwnProperty = objectProto.hasOwnProperty;
  111928. /**
  111929. * Creates an object composed of keys generated from the results of running
  111930. * each element of `collection` thru `iteratee`. The order of grouped values
  111931. * is determined by the order they occur in `collection`. The corresponding
  111932. * value of each key is an array of elements responsible for generating the
  111933. * key. The iteratee is invoked with one argument: (value).
  111934. *
  111935. * @static
  111936. * @memberOf _
  111937. * @since 0.1.0
  111938. * @category Collection
  111939. * @param {Array|Object} collection The collection to iterate over.
  111940. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  111941. * @returns {Object} Returns the composed aggregate object.
  111942. * @example
  111943. *
  111944. * _.groupBy([6.1, 4.2, 6.3], Math.floor);
  111945. * // => { '4': [4.2], '6': [6.1, 6.3] }
  111946. *
  111947. * // The `_.property` iteratee shorthand.
  111948. * _.groupBy(['one', 'two', 'three'], 'length');
  111949. * // => { '3': ['one', 'two'], '5': ['three'] }
  111950. */
  111951. var groupBy = Object(_createAggregator_js__WEBPACK_IMPORTED_MODULE_1__["default"])(function(result, value, key) {
  111952. if (hasOwnProperty.call(result, key)) {
  111953. result[key].push(value);
  111954. } else {
  111955. Object(_baseAssignValue_js__WEBPACK_IMPORTED_MODULE_0__["default"])(result, key, [value]);
  111956. }
  111957. });
  111958. /* harmony default export */ __webpack_exports__["default"] = (groupBy);
  111959. /***/ }),
  111960. /***/ "./node_modules/lodash-es/gt.js":
  111961. /*!**************************************!*\
  111962. !*** ./node_modules/lodash-es/gt.js ***!
  111963. \**************************************/
  111964. /*! exports provided: default */
  111965. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  111966. "use strict";
  111967. __webpack_require__.r(__webpack_exports__);
  111968. /* harmony import */ var _baseGt_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseGt.js */ "./node_modules/lodash-es/_baseGt.js");
  111969. /* harmony import */ var _createRelationalOperation_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_createRelationalOperation.js */ "./node_modules/lodash-es/_createRelationalOperation.js");
  111970. /**
  111971. * Checks if `value` is greater than `other`.
  111972. *
  111973. * @static
  111974. * @memberOf _
  111975. * @since 3.9.0
  111976. * @category Lang
  111977. * @param {*} value The value to compare.
  111978. * @param {*} other The other value to compare.
  111979. * @returns {boolean} Returns `true` if `value` is greater than `other`,
  111980. * else `false`.
  111981. * @see _.lt
  111982. * @example
  111983. *
  111984. * _.gt(3, 1);
  111985. * // => true
  111986. *
  111987. * _.gt(3, 3);
  111988. * // => false
  111989. *
  111990. * _.gt(1, 3);
  111991. * // => false
  111992. */
  111993. var gt = Object(_createRelationalOperation_js__WEBPACK_IMPORTED_MODULE_1__["default"])(_baseGt_js__WEBPACK_IMPORTED_MODULE_0__["default"]);
  111994. /* harmony default export */ __webpack_exports__["default"] = (gt);
  111995. /***/ }),
  111996. /***/ "./node_modules/lodash-es/gte.js":
  111997. /*!***************************************!*\
  111998. !*** ./node_modules/lodash-es/gte.js ***!
  111999. \***************************************/
  112000. /*! exports provided: default */
  112001. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  112002. "use strict";
  112003. __webpack_require__.r(__webpack_exports__);
  112004. /* harmony import */ var _createRelationalOperation_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createRelationalOperation.js */ "./node_modules/lodash-es/_createRelationalOperation.js");
  112005. /**
  112006. * Checks if `value` is greater than or equal to `other`.
  112007. *
  112008. * @static
  112009. * @memberOf _
  112010. * @since 3.9.0
  112011. * @category Lang
  112012. * @param {*} value The value to compare.
  112013. * @param {*} other The other value to compare.
  112014. * @returns {boolean} Returns `true` if `value` is greater than or equal to
  112015. * `other`, else `false`.
  112016. * @see _.lte
  112017. * @example
  112018. *
  112019. * _.gte(3, 1);
  112020. * // => true
  112021. *
  112022. * _.gte(3, 3);
  112023. * // => true
  112024. *
  112025. * _.gte(1, 3);
  112026. * // => false
  112027. */
  112028. var gte = Object(_createRelationalOperation_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function(value, other) {
  112029. return value >= other;
  112030. });
  112031. /* harmony default export */ __webpack_exports__["default"] = (gte);
  112032. /***/ }),
  112033. /***/ "./node_modules/lodash-es/has.js":
  112034. /*!***************************************!*\
  112035. !*** ./node_modules/lodash-es/has.js ***!
  112036. \***************************************/
  112037. /*! exports provided: default */
  112038. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  112039. "use strict";
  112040. __webpack_require__.r(__webpack_exports__);
  112041. /* harmony import */ var _baseHas_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseHas.js */ "./node_modules/lodash-es/_baseHas.js");
  112042. /* harmony import */ var _hasPath_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_hasPath.js */ "./node_modules/lodash-es/_hasPath.js");
  112043. /**
  112044. * Checks if `path` is a direct property of `object`.
  112045. *
  112046. * @static
  112047. * @since 0.1.0
  112048. * @memberOf _
  112049. * @category Object
  112050. * @param {Object} object The object to query.
  112051. * @param {Array|string} path The path to check.
  112052. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  112053. * @example
  112054. *
  112055. * var object = { 'a': { 'b': 2 } };
  112056. * var other = _.create({ 'a': _.create({ 'b': 2 }) });
  112057. *
  112058. * _.has(object, 'a');
  112059. * // => true
  112060. *
  112061. * _.has(object, 'a.b');
  112062. * // => true
  112063. *
  112064. * _.has(object, ['a', 'b']);
  112065. * // => true
  112066. *
  112067. * _.has(other, 'a');
  112068. * // => false
  112069. */
  112070. function has(object, path) {
  112071. return object != null && Object(_hasPath_js__WEBPACK_IMPORTED_MODULE_1__["default"])(object, path, _baseHas_js__WEBPACK_IMPORTED_MODULE_0__["default"]);
  112072. }
  112073. /* harmony default export */ __webpack_exports__["default"] = (has);
  112074. /***/ }),
  112075. /***/ "./node_modules/lodash-es/hasIn.js":
  112076. /*!*****************************************!*\
  112077. !*** ./node_modules/lodash-es/hasIn.js ***!
  112078. \*****************************************/
  112079. /*! exports provided: default */
  112080. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  112081. "use strict";
  112082. __webpack_require__.r(__webpack_exports__);
  112083. /* harmony import */ var _baseHasIn_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseHasIn.js */ "./node_modules/lodash-es/_baseHasIn.js");
  112084. /* harmony import */ var _hasPath_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_hasPath.js */ "./node_modules/lodash-es/_hasPath.js");
  112085. /**
  112086. * Checks if `path` is a direct or inherited property of `object`.
  112087. *
  112088. * @static
  112089. * @memberOf _
  112090. * @since 4.0.0
  112091. * @category Object
  112092. * @param {Object} object The object to query.
  112093. * @param {Array|string} path The path to check.
  112094. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  112095. * @example
  112096. *
  112097. * var object = _.create({ 'a': _.create({ 'b': 2 }) });
  112098. *
  112099. * _.hasIn(object, 'a');
  112100. * // => true
  112101. *
  112102. * _.hasIn(object, 'a.b');
  112103. * // => true
  112104. *
  112105. * _.hasIn(object, ['a', 'b']);
  112106. * // => true
  112107. *
  112108. * _.hasIn(object, 'b');
  112109. * // => false
  112110. */
  112111. function hasIn(object, path) {
  112112. return object != null && Object(_hasPath_js__WEBPACK_IMPORTED_MODULE_1__["default"])(object, path, _baseHasIn_js__WEBPACK_IMPORTED_MODULE_0__["default"]);
  112113. }
  112114. /* harmony default export */ __webpack_exports__["default"] = (hasIn);
  112115. /***/ }),
  112116. /***/ "./node_modules/lodash-es/head.js":
  112117. /*!****************************************!*\
  112118. !*** ./node_modules/lodash-es/head.js ***!
  112119. \****************************************/
  112120. /*! exports provided: default */
  112121. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  112122. "use strict";
  112123. __webpack_require__.r(__webpack_exports__);
  112124. /**
  112125. * Gets the first element of `array`.
  112126. *
  112127. * @static
  112128. * @memberOf _
  112129. * @since 0.1.0
  112130. * @alias first
  112131. * @category Array
  112132. * @param {Array} array The array to query.
  112133. * @returns {*} Returns the first element of `array`.
  112134. * @example
  112135. *
  112136. * _.head([1, 2, 3]);
  112137. * // => 1
  112138. *
  112139. * _.head([]);
  112140. * // => undefined
  112141. */
  112142. function head(array) {
  112143. return (array && array.length) ? array[0] : undefined;
  112144. }
  112145. /* harmony default export */ __webpack_exports__["default"] = (head);
  112146. /***/ }),
  112147. /***/ "./node_modules/lodash-es/identity.js":
  112148. /*!********************************************!*\
  112149. !*** ./node_modules/lodash-es/identity.js ***!
  112150. \********************************************/
  112151. /*! exports provided: default */
  112152. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  112153. "use strict";
  112154. __webpack_require__.r(__webpack_exports__);
  112155. /**
  112156. * This method returns the first argument it receives.
  112157. *
  112158. * @static
  112159. * @since 0.1.0
  112160. * @memberOf _
  112161. * @category Util
  112162. * @param {*} value Any value.
  112163. * @returns {*} Returns `value`.
  112164. * @example
  112165. *
  112166. * var object = { 'a': 1 };
  112167. *
  112168. * console.log(_.identity(object) === object);
  112169. * // => true
  112170. */
  112171. function identity(value) {
  112172. return value;
  112173. }
  112174. /* harmony default export */ __webpack_exports__["default"] = (identity);
  112175. /***/ }),
  112176. /***/ "./node_modules/lodash-es/inRange.js":
  112177. /*!*******************************************!*\
  112178. !*** ./node_modules/lodash-es/inRange.js ***!
  112179. \*******************************************/
  112180. /*! exports provided: default */
  112181. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  112182. "use strict";
  112183. __webpack_require__.r(__webpack_exports__);
  112184. /* harmony import */ var _baseInRange_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseInRange.js */ "./node_modules/lodash-es/_baseInRange.js");
  112185. /* harmony import */ var _toFinite_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./toFinite.js */ "./node_modules/lodash-es/toFinite.js");
  112186. /* harmony import */ var _toNumber_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./toNumber.js */ "./node_modules/lodash-es/toNumber.js");
  112187. /**
  112188. * Checks if `n` is between `start` and up to, but not including, `end`. If
  112189. * `end` is not specified, it's set to `start` with `start` then set to `0`.
  112190. * If `start` is greater than `end` the params are swapped to support
  112191. * negative ranges.
  112192. *
  112193. * @static
  112194. * @memberOf _
  112195. * @since 3.3.0
  112196. * @category Number
  112197. * @param {number} number The number to check.
  112198. * @param {number} [start=0] The start of the range.
  112199. * @param {number} end The end of the range.
  112200. * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
  112201. * @see _.range, _.rangeRight
  112202. * @example
  112203. *
  112204. * _.inRange(3, 2, 4);
  112205. * // => true
  112206. *
  112207. * _.inRange(4, 8);
  112208. * // => true
  112209. *
  112210. * _.inRange(4, 2);
  112211. * // => false
  112212. *
  112213. * _.inRange(2, 2);
  112214. * // => false
  112215. *
  112216. * _.inRange(1.2, 2);
  112217. * // => true
  112218. *
  112219. * _.inRange(5.2, 4);
  112220. * // => false
  112221. *
  112222. * _.inRange(-3, -2, -6);
  112223. * // => true
  112224. */
  112225. function inRange(number, start, end) {
  112226. start = Object(_toFinite_js__WEBPACK_IMPORTED_MODULE_1__["default"])(start);
  112227. if (end === undefined) {
  112228. end = start;
  112229. start = 0;
  112230. } else {
  112231. end = Object(_toFinite_js__WEBPACK_IMPORTED_MODULE_1__["default"])(end);
  112232. }
  112233. number = Object(_toNumber_js__WEBPACK_IMPORTED_MODULE_2__["default"])(number);
  112234. return Object(_baseInRange_js__WEBPACK_IMPORTED_MODULE_0__["default"])(number, start, end);
  112235. }
  112236. /* harmony default export */ __webpack_exports__["default"] = (inRange);
  112237. /***/ }),
  112238. /***/ "./node_modules/lodash-es/includes.js":
  112239. /*!********************************************!*\
  112240. !*** ./node_modules/lodash-es/includes.js ***!
  112241. \********************************************/
  112242. /*! exports provided: default */
  112243. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  112244. "use strict";
  112245. __webpack_require__.r(__webpack_exports__);
  112246. /* harmony import */ var _baseIndexOf_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseIndexOf.js */ "./node_modules/lodash-es/_baseIndexOf.js");
  112247. /* harmony import */ var _isArrayLike_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isArrayLike.js */ "./node_modules/lodash-es/isArrayLike.js");
  112248. /* harmony import */ var _isString_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./isString.js */ "./node_modules/lodash-es/isString.js");
  112249. /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
  112250. /* harmony import */ var _values_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./values.js */ "./node_modules/lodash-es/values.js");
  112251. /* Built-in method references for those with the same name as other `lodash` methods. */
  112252. var nativeMax = Math.max;
  112253. /**
  112254. * Checks if `value` is in `collection`. If `collection` is a string, it's
  112255. * checked for a substring of `value`, otherwise
  112256. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  112257. * is used for equality comparisons. If `fromIndex` is negative, it's used as
  112258. * the offset from the end of `collection`.
  112259. *
  112260. * @static
  112261. * @memberOf _
  112262. * @since 0.1.0
  112263. * @category Collection
  112264. * @param {Array|Object|string} collection The collection to inspect.
  112265. * @param {*} value The value to search for.
  112266. * @param {number} [fromIndex=0] The index to search from.
  112267. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
  112268. * @returns {boolean} Returns `true` if `value` is found, else `false`.
  112269. * @example
  112270. *
  112271. * _.includes([1, 2, 3], 1);
  112272. * // => true
  112273. *
  112274. * _.includes([1, 2, 3], 1, 2);
  112275. * // => false
  112276. *
  112277. * _.includes({ 'a': 1, 'b': 2 }, 1);
  112278. * // => true
  112279. *
  112280. * _.includes('abcd', 'bc');
  112281. * // => true
  112282. */
  112283. function includes(collection, value, fromIndex, guard) {
  112284. collection = Object(_isArrayLike_js__WEBPACK_IMPORTED_MODULE_1__["default"])(collection) ? collection : Object(_values_js__WEBPACK_IMPORTED_MODULE_4__["default"])(collection);
  112285. fromIndex = (fromIndex && !guard) ? Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_3__["default"])(fromIndex) : 0;
  112286. var length = collection.length;
  112287. if (fromIndex < 0) {
  112288. fromIndex = nativeMax(length + fromIndex, 0);
  112289. }
  112290. return Object(_isString_js__WEBPACK_IMPORTED_MODULE_2__["default"])(collection)
  112291. ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1)
  112292. : (!!length && Object(_baseIndexOf_js__WEBPACK_IMPORTED_MODULE_0__["default"])(collection, value, fromIndex) > -1);
  112293. }
  112294. /* harmony default export */ __webpack_exports__["default"] = (includes);
  112295. /***/ }),
  112296. /***/ "./node_modules/lodash-es/indexOf.js":
  112297. /*!*******************************************!*\
  112298. !*** ./node_modules/lodash-es/indexOf.js ***!
  112299. \*******************************************/
  112300. /*! exports provided: default */
  112301. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  112302. "use strict";
  112303. __webpack_require__.r(__webpack_exports__);
  112304. /* harmony import */ var _baseIndexOf_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseIndexOf.js */ "./node_modules/lodash-es/_baseIndexOf.js");
  112305. /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
  112306. /* Built-in method references for those with the same name as other `lodash` methods. */
  112307. var nativeMax = Math.max;
  112308. /**
  112309. * Gets the index at which the first occurrence of `value` is found in `array`
  112310. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  112311. * for equality comparisons. If `fromIndex` is negative, it's used as the
  112312. * offset from the end of `array`.
  112313. *
  112314. * @static
  112315. * @memberOf _
  112316. * @since 0.1.0
  112317. * @category Array
  112318. * @param {Array} array The array to inspect.
  112319. * @param {*} value The value to search for.
  112320. * @param {number} [fromIndex=0] The index to search from.
  112321. * @returns {number} Returns the index of the matched value, else `-1`.
  112322. * @example
  112323. *
  112324. * _.indexOf([1, 2, 1, 2], 2);
  112325. * // => 1
  112326. *
  112327. * // Search from the `fromIndex`.
  112328. * _.indexOf([1, 2, 1, 2], 2, 2);
  112329. * // => 3
  112330. */
  112331. function indexOf(array, value, fromIndex) {
  112332. var length = array == null ? 0 : array.length;
  112333. if (!length) {
  112334. return -1;
  112335. }
  112336. var index = fromIndex == null ? 0 : Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_1__["default"])(fromIndex);
  112337. if (index < 0) {
  112338. index = nativeMax(length + index, 0);
  112339. }
  112340. return Object(_baseIndexOf_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, value, index);
  112341. }
  112342. /* harmony default export */ __webpack_exports__["default"] = (indexOf);
  112343. /***/ }),
  112344. /***/ "./node_modules/lodash-es/initial.js":
  112345. /*!*******************************************!*\
  112346. !*** ./node_modules/lodash-es/initial.js ***!
  112347. \*******************************************/
  112348. /*! exports provided: default */
  112349. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  112350. "use strict";
  112351. __webpack_require__.r(__webpack_exports__);
  112352. /* harmony import */ var _baseSlice_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseSlice.js */ "./node_modules/lodash-es/_baseSlice.js");
  112353. /**
  112354. * Gets all but the last element of `array`.
  112355. *
  112356. * @static
  112357. * @memberOf _
  112358. * @since 0.1.0
  112359. * @category Array
  112360. * @param {Array} array The array to query.
  112361. * @returns {Array} Returns the slice of `array`.
  112362. * @example
  112363. *
  112364. * _.initial([1, 2, 3]);
  112365. * // => [1, 2]
  112366. */
  112367. function initial(array) {
  112368. var length = array == null ? 0 : array.length;
  112369. return length ? Object(_baseSlice_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, 0, -1) : [];
  112370. }
  112371. /* harmony default export */ __webpack_exports__["default"] = (initial);
  112372. /***/ }),
  112373. /***/ "./node_modules/lodash-es/intersection.js":
  112374. /*!************************************************!*\
  112375. !*** ./node_modules/lodash-es/intersection.js ***!
  112376. \************************************************/
  112377. /*! exports provided: default */
  112378. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  112379. "use strict";
  112380. __webpack_require__.r(__webpack_exports__);
  112381. /* harmony import */ var _arrayMap_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayMap.js */ "./node_modules/lodash-es/_arrayMap.js");
  112382. /* harmony import */ var _baseIntersection_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseIntersection.js */ "./node_modules/lodash-es/_baseIntersection.js");
  112383. /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
  112384. /* harmony import */ var _castArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_castArrayLikeObject.js */ "./node_modules/lodash-es/_castArrayLikeObject.js");
  112385. /**
  112386. * Creates an array of unique values that are included in all given arrays
  112387. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  112388. * for equality comparisons. The order and references of result values are
  112389. * determined by the first array.
  112390. *
  112391. * @static
  112392. * @memberOf _
  112393. * @since 0.1.0
  112394. * @category Array
  112395. * @param {...Array} [arrays] The arrays to inspect.
  112396. * @returns {Array} Returns the new array of intersecting values.
  112397. * @example
  112398. *
  112399. * _.intersection([2, 1], [2, 3]);
  112400. * // => [2]
  112401. */
  112402. var intersection = Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_2__["default"])(function(arrays) {
  112403. var mapped = Object(_arrayMap_js__WEBPACK_IMPORTED_MODULE_0__["default"])(arrays, _castArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_3__["default"]);
  112404. return (mapped.length && mapped[0] === arrays[0])
  112405. ? Object(_baseIntersection_js__WEBPACK_IMPORTED_MODULE_1__["default"])(mapped)
  112406. : [];
  112407. });
  112408. /* harmony default export */ __webpack_exports__["default"] = (intersection);
  112409. /***/ }),
  112410. /***/ "./node_modules/lodash-es/intersectionBy.js":
  112411. /*!**************************************************!*\
  112412. !*** ./node_modules/lodash-es/intersectionBy.js ***!
  112413. \**************************************************/
  112414. /*! exports provided: default */
  112415. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  112416. "use strict";
  112417. __webpack_require__.r(__webpack_exports__);
  112418. /* harmony import */ var _arrayMap_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayMap.js */ "./node_modules/lodash-es/_arrayMap.js");
  112419. /* harmony import */ var _baseIntersection_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseIntersection.js */ "./node_modules/lodash-es/_baseIntersection.js");
  112420. /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
  112421. /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
  112422. /* harmony import */ var _castArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_castArrayLikeObject.js */ "./node_modules/lodash-es/_castArrayLikeObject.js");
  112423. /* harmony import */ var _last_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./last.js */ "./node_modules/lodash-es/last.js");
  112424. /**
  112425. * This method is like `_.intersection` except that it accepts `iteratee`
  112426. * which is invoked for each element of each `arrays` to generate the criterion
  112427. * by which they're compared. The order and references of result values are
  112428. * determined by the first array. The iteratee is invoked with one argument:
  112429. * (value).
  112430. *
  112431. * @static
  112432. * @memberOf _
  112433. * @since 4.0.0
  112434. * @category Array
  112435. * @param {...Array} [arrays] The arrays to inspect.
  112436. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  112437. * @returns {Array} Returns the new array of intersecting values.
  112438. * @example
  112439. *
  112440. * _.intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  112441. * // => [2.1]
  112442. *
  112443. * // The `_.property` iteratee shorthand.
  112444. * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  112445. * // => [{ 'x': 1 }]
  112446. */
  112447. var intersectionBy = Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_3__["default"])(function(arrays) {
  112448. var iteratee = Object(_last_js__WEBPACK_IMPORTED_MODULE_5__["default"])(arrays),
  112449. mapped = Object(_arrayMap_js__WEBPACK_IMPORTED_MODULE_0__["default"])(arrays, _castArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_4__["default"]);
  112450. if (iteratee === Object(_last_js__WEBPACK_IMPORTED_MODULE_5__["default"])(mapped)) {
  112451. iteratee = undefined;
  112452. } else {
  112453. mapped.pop();
  112454. }
  112455. return (mapped.length && mapped[0] === arrays[0])
  112456. ? Object(_baseIntersection_js__WEBPACK_IMPORTED_MODULE_1__["default"])(mapped, Object(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_2__["default"])(iteratee, 2))
  112457. : [];
  112458. });
  112459. /* harmony default export */ __webpack_exports__["default"] = (intersectionBy);
  112460. /***/ }),
  112461. /***/ "./node_modules/lodash-es/intersectionWith.js":
  112462. /*!****************************************************!*\
  112463. !*** ./node_modules/lodash-es/intersectionWith.js ***!
  112464. \****************************************************/
  112465. /*! exports provided: default */
  112466. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  112467. "use strict";
  112468. __webpack_require__.r(__webpack_exports__);
  112469. /* harmony import */ var _arrayMap_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayMap.js */ "./node_modules/lodash-es/_arrayMap.js");
  112470. /* harmony import */ var _baseIntersection_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseIntersection.js */ "./node_modules/lodash-es/_baseIntersection.js");
  112471. /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
  112472. /* harmony import */ var _castArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_castArrayLikeObject.js */ "./node_modules/lodash-es/_castArrayLikeObject.js");
  112473. /* harmony import */ var _last_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./last.js */ "./node_modules/lodash-es/last.js");
  112474. /**
  112475. * This method is like `_.intersection` except that it accepts `comparator`
  112476. * which is invoked to compare elements of `arrays`. The order and references
  112477. * of result values are determined by the first array. The comparator is
  112478. * invoked with two arguments: (arrVal, othVal).
  112479. *
  112480. * @static
  112481. * @memberOf _
  112482. * @since 4.0.0
  112483. * @category Array
  112484. * @param {...Array} [arrays] The arrays to inspect.
  112485. * @param {Function} [comparator] The comparator invoked per element.
  112486. * @returns {Array} Returns the new array of intersecting values.
  112487. * @example
  112488. *
  112489. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  112490. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  112491. *
  112492. * _.intersectionWith(objects, others, _.isEqual);
  112493. * // => [{ 'x': 1, 'y': 2 }]
  112494. */
  112495. var intersectionWith = Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_2__["default"])(function(arrays) {
  112496. var comparator = Object(_last_js__WEBPACK_IMPORTED_MODULE_4__["default"])(arrays),
  112497. mapped = Object(_arrayMap_js__WEBPACK_IMPORTED_MODULE_0__["default"])(arrays, _castArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_3__["default"]);
  112498. comparator = typeof comparator == 'function' ? comparator : undefined;
  112499. if (comparator) {
  112500. mapped.pop();
  112501. }
  112502. return (mapped.length && mapped[0] === arrays[0])
  112503. ? Object(_baseIntersection_js__WEBPACK_IMPORTED_MODULE_1__["default"])(mapped, undefined, comparator)
  112504. : [];
  112505. });
  112506. /* harmony default export */ __webpack_exports__["default"] = (intersectionWith);
  112507. /***/ }),
  112508. /***/ "./node_modules/lodash-es/invert.js":
  112509. /*!******************************************!*\
  112510. !*** ./node_modules/lodash-es/invert.js ***!
  112511. \******************************************/
  112512. /*! exports provided: default */
  112513. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  112514. "use strict";
  112515. __webpack_require__.r(__webpack_exports__);
  112516. /* harmony import */ var _constant_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./constant.js */ "./node_modules/lodash-es/constant.js");
  112517. /* harmony import */ var _createInverter_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_createInverter.js */ "./node_modules/lodash-es/_createInverter.js");
  112518. /* harmony import */ var _identity_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./identity.js */ "./node_modules/lodash-es/identity.js");
  112519. /** Used for built-in method references. */
  112520. var objectProto = Object.prototype;
  112521. /**
  112522. * Used to resolve the
  112523. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  112524. * of values.
  112525. */
  112526. var nativeObjectToString = objectProto.toString;
  112527. /**
  112528. * Creates an object composed of the inverted keys and values of `object`.
  112529. * If `object` contains duplicate values, subsequent values overwrite
  112530. * property assignments of previous values.
  112531. *
  112532. * @static
  112533. * @memberOf _
  112534. * @since 0.7.0
  112535. * @category Object
  112536. * @param {Object} object The object to invert.
  112537. * @returns {Object} Returns the new inverted object.
  112538. * @example
  112539. *
  112540. * var object = { 'a': 1, 'b': 2, 'c': 1 };
  112541. *
  112542. * _.invert(object);
  112543. * // => { '1': 'c', '2': 'b' }
  112544. */
  112545. var invert = Object(_createInverter_js__WEBPACK_IMPORTED_MODULE_1__["default"])(function(result, value, key) {
  112546. if (value != null &&
  112547. typeof value.toString != 'function') {
  112548. value = nativeObjectToString.call(value);
  112549. }
  112550. result[value] = key;
  112551. }, Object(_constant_js__WEBPACK_IMPORTED_MODULE_0__["default"])(_identity_js__WEBPACK_IMPORTED_MODULE_2__["default"]));
  112552. /* harmony default export */ __webpack_exports__["default"] = (invert);
  112553. /***/ }),
  112554. /***/ "./node_modules/lodash-es/invertBy.js":
  112555. /*!********************************************!*\
  112556. !*** ./node_modules/lodash-es/invertBy.js ***!
  112557. \********************************************/
  112558. /*! exports provided: default */
  112559. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  112560. "use strict";
  112561. __webpack_require__.r(__webpack_exports__);
  112562. /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
  112563. /* harmony import */ var _createInverter_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_createInverter.js */ "./node_modules/lodash-es/_createInverter.js");
  112564. /** Used for built-in method references. */
  112565. var objectProto = Object.prototype;
  112566. /** Used to check objects for own properties. */
  112567. var hasOwnProperty = objectProto.hasOwnProperty;
  112568. /**
  112569. * Used to resolve the
  112570. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  112571. * of values.
  112572. */
  112573. var nativeObjectToString = objectProto.toString;
  112574. /**
  112575. * This method is like `_.invert` except that the inverted object is generated
  112576. * from the results of running each element of `object` thru `iteratee`. The
  112577. * corresponding inverted value of each inverted key is an array of keys
  112578. * responsible for generating the inverted value. The iteratee is invoked
  112579. * with one argument: (value).
  112580. *
  112581. * @static
  112582. * @memberOf _
  112583. * @since 4.1.0
  112584. * @category Object
  112585. * @param {Object} object The object to invert.
  112586. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  112587. * @returns {Object} Returns the new inverted object.
  112588. * @example
  112589. *
  112590. * var object = { 'a': 1, 'b': 2, 'c': 1 };
  112591. *
  112592. * _.invertBy(object);
  112593. * // => { '1': ['a', 'c'], '2': ['b'] }
  112594. *
  112595. * _.invertBy(object, function(value) {
  112596. * return 'group' + value;
  112597. * });
  112598. * // => { 'group1': ['a', 'c'], 'group2': ['b'] }
  112599. */
  112600. var invertBy = Object(_createInverter_js__WEBPACK_IMPORTED_MODULE_1__["default"])(function(result, value, key) {
  112601. if (value != null &&
  112602. typeof value.toString != 'function') {
  112603. value = nativeObjectToString.call(value);
  112604. }
  112605. if (hasOwnProperty.call(result, value)) {
  112606. result[value].push(key);
  112607. } else {
  112608. result[value] = [key];
  112609. }
  112610. }, _baseIteratee_js__WEBPACK_IMPORTED_MODULE_0__["default"]);
  112611. /* harmony default export */ __webpack_exports__["default"] = (invertBy);
  112612. /***/ }),
  112613. /***/ "./node_modules/lodash-es/invoke.js":
  112614. /*!******************************************!*\
  112615. !*** ./node_modules/lodash-es/invoke.js ***!
  112616. \******************************************/
  112617. /*! exports provided: default */
  112618. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  112619. "use strict";
  112620. __webpack_require__.r(__webpack_exports__);
  112621. /* harmony import */ var _baseInvoke_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseInvoke.js */ "./node_modules/lodash-es/_baseInvoke.js");
  112622. /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
  112623. /**
  112624. * Invokes the method at `path` of `object`.
  112625. *
  112626. * @static
  112627. * @memberOf _
  112628. * @since 4.0.0
  112629. * @category Object
  112630. * @param {Object} object The object to query.
  112631. * @param {Array|string} path The path of the method to invoke.
  112632. * @param {...*} [args] The arguments to invoke the method with.
  112633. * @returns {*} Returns the result of the invoked method.
  112634. * @example
  112635. *
  112636. * var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] };
  112637. *
  112638. * _.invoke(object, 'a[0].b.c.slice', 1, 3);
  112639. * // => [2, 3]
  112640. */
  112641. var invoke = Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_1__["default"])(_baseInvoke_js__WEBPACK_IMPORTED_MODULE_0__["default"]);
  112642. /* harmony default export */ __webpack_exports__["default"] = (invoke);
  112643. /***/ }),
  112644. /***/ "./node_modules/lodash-es/invokeMap.js":
  112645. /*!*********************************************!*\
  112646. !*** ./node_modules/lodash-es/invokeMap.js ***!
  112647. \*********************************************/
  112648. /*! exports provided: default */
  112649. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  112650. "use strict";
  112651. __webpack_require__.r(__webpack_exports__);
  112652. /* harmony import */ var _apply_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_apply.js */ "./node_modules/lodash-es/_apply.js");
  112653. /* harmony import */ var _baseEach_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseEach.js */ "./node_modules/lodash-es/_baseEach.js");
  112654. /* harmony import */ var _baseInvoke_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseInvoke.js */ "./node_modules/lodash-es/_baseInvoke.js");
  112655. /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
  112656. /* harmony import */ var _isArrayLike_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./isArrayLike.js */ "./node_modules/lodash-es/isArrayLike.js");
  112657. /**
  112658. * Invokes the method at `path` of each element in `collection`, returning
  112659. * an array of the results of each invoked method. Any additional arguments
  112660. * are provided to each invoked method. If `path` is a function, it's invoked
  112661. * for, and `this` bound to, each element in `collection`.
  112662. *
  112663. * @static
  112664. * @memberOf _
  112665. * @since 4.0.0
  112666. * @category Collection
  112667. * @param {Array|Object} collection The collection to iterate over.
  112668. * @param {Array|Function|string} path The path of the method to invoke or
  112669. * the function invoked per iteration.
  112670. * @param {...*} [args] The arguments to invoke each method with.
  112671. * @returns {Array} Returns the array of results.
  112672. * @example
  112673. *
  112674. * _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort');
  112675. * // => [[1, 5, 7], [1, 2, 3]]
  112676. *
  112677. * _.invokeMap([123, 456], String.prototype.split, '');
  112678. * // => [['1', '2', '3'], ['4', '5', '6']]
  112679. */
  112680. var invokeMap = Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_3__["default"])(function(collection, path, args) {
  112681. var index = -1,
  112682. isFunc = typeof path == 'function',
  112683. result = Object(_isArrayLike_js__WEBPACK_IMPORTED_MODULE_4__["default"])(collection) ? Array(collection.length) : [];
  112684. Object(_baseEach_js__WEBPACK_IMPORTED_MODULE_1__["default"])(collection, function(value) {
  112685. 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);
  112686. });
  112687. return result;
  112688. });
  112689. /* harmony default export */ __webpack_exports__["default"] = (invokeMap);
  112690. /***/ }),
  112691. /***/ "./node_modules/lodash-es/isArguments.js":
  112692. /*!***********************************************!*\
  112693. !*** ./node_modules/lodash-es/isArguments.js ***!
  112694. \***********************************************/
  112695. /*! exports provided: default */
  112696. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  112697. "use strict";
  112698. __webpack_require__.r(__webpack_exports__);
  112699. /* harmony import */ var _baseIsArguments_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseIsArguments.js */ "./node_modules/lodash-es/_baseIsArguments.js");
  112700. /* harmony import */ var _isObjectLike_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isObjectLike.js */ "./node_modules/lodash-es/isObjectLike.js");
  112701. /** Used for built-in method references. */
  112702. var objectProto = Object.prototype;
  112703. /** Used to check objects for own properties. */
  112704. var hasOwnProperty = objectProto.hasOwnProperty;
  112705. /** Built-in value references. */
  112706. var propertyIsEnumerable = objectProto.propertyIsEnumerable;
  112707. /**
  112708. * Checks if `value` is likely an `arguments` object.
  112709. *
  112710. * @static
  112711. * @memberOf _
  112712. * @since 0.1.0
  112713. * @category Lang
  112714. * @param {*} value The value to check.
  112715. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  112716. * else `false`.
  112717. * @example
  112718. *
  112719. * _.isArguments(function() { return arguments; }());
  112720. * // => true
  112721. *
  112722. * _.isArguments([1, 2, 3]);
  112723. * // => false
  112724. */
  112725. var isArguments = Object(_baseIsArguments_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function() { return arguments; }()) ? _baseIsArguments_js__WEBPACK_IMPORTED_MODULE_0__["default"] : function(value) {
  112726. return Object(_isObjectLike_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value) && hasOwnProperty.call(value, 'callee') &&
  112727. !propertyIsEnumerable.call(value, 'callee');
  112728. };
  112729. /* harmony default export */ __webpack_exports__["default"] = (isArguments);
  112730. /***/ }),
  112731. /***/ "./node_modules/lodash-es/isArray.js":
  112732. /*!*******************************************!*\
  112733. !*** ./node_modules/lodash-es/isArray.js ***!
  112734. \*******************************************/
  112735. /*! exports provided: default */
  112736. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  112737. "use strict";
  112738. __webpack_require__.r(__webpack_exports__);
  112739. /**
  112740. * Checks if `value` is classified as an `Array` object.
  112741. *
  112742. * @static
  112743. * @memberOf _
  112744. * @since 0.1.0
  112745. * @category Lang
  112746. * @param {*} value The value to check.
  112747. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  112748. * @example
  112749. *
  112750. * _.isArray([1, 2, 3]);
  112751. * // => true
  112752. *
  112753. * _.isArray(document.body.children);
  112754. * // => false
  112755. *
  112756. * _.isArray('abc');
  112757. * // => false
  112758. *
  112759. * _.isArray(_.noop);
  112760. * // => false
  112761. */
  112762. var isArray = Array.isArray;
  112763. /* harmony default export */ __webpack_exports__["default"] = (isArray);
  112764. /***/ }),
  112765. /***/ "./node_modules/lodash-es/isArrayBuffer.js":
  112766. /*!*************************************************!*\
  112767. !*** ./node_modules/lodash-es/isArrayBuffer.js ***!
  112768. \*************************************************/
  112769. /*! exports provided: default */
  112770. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  112771. "use strict";
  112772. __webpack_require__.r(__webpack_exports__);
  112773. /* harmony import */ var _baseIsArrayBuffer_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseIsArrayBuffer.js */ "./node_modules/lodash-es/_baseIsArrayBuffer.js");
  112774. /* harmony import */ var _baseUnary_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseUnary.js */ "./node_modules/lodash-es/_baseUnary.js");
  112775. /* harmony import */ var _nodeUtil_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_nodeUtil.js */ "./node_modules/lodash-es/_nodeUtil.js");
  112776. /* Node.js helper references. */
  112777. var nodeIsArrayBuffer = _nodeUtil_js__WEBPACK_IMPORTED_MODULE_2__["default"] && _nodeUtil_js__WEBPACK_IMPORTED_MODULE_2__["default"].isArrayBuffer;
  112778. /**
  112779. * Checks if `value` is classified as an `ArrayBuffer` object.
  112780. *
  112781. * @static
  112782. * @memberOf _
  112783. * @since 4.3.0
  112784. * @category Lang
  112785. * @param {*} value The value to check.
  112786. * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
  112787. * @example
  112788. *
  112789. * _.isArrayBuffer(new ArrayBuffer(2));
  112790. * // => true
  112791. *
  112792. * _.isArrayBuffer(new Array(2));
  112793. * // => false
  112794. */
  112795. var isArrayBuffer = nodeIsArrayBuffer ? Object(_baseUnary_js__WEBPACK_IMPORTED_MODULE_1__["default"])(nodeIsArrayBuffer) : _baseIsArrayBuffer_js__WEBPACK_IMPORTED_MODULE_0__["default"];
  112796. /* harmony default export */ __webpack_exports__["default"] = (isArrayBuffer);
  112797. /***/ }),
  112798. /***/ "./node_modules/lodash-es/isArrayLike.js":
  112799. /*!***********************************************!*\
  112800. !*** ./node_modules/lodash-es/isArrayLike.js ***!
  112801. \***********************************************/
  112802. /*! exports provided: default */
  112803. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  112804. "use strict";
  112805. __webpack_require__.r(__webpack_exports__);
  112806. /* harmony import */ var _isFunction_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isFunction.js */ "./node_modules/lodash-es/isFunction.js");
  112807. /* harmony import */ var _isLength_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isLength.js */ "./node_modules/lodash-es/isLength.js");
  112808. /**
  112809. * Checks if `value` is array-like. A value is considered array-like if it's
  112810. * not a function and has a `value.length` that's an integer greater than or
  112811. * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
  112812. *
  112813. * @static
  112814. * @memberOf _
  112815. * @since 4.0.0
  112816. * @category Lang
  112817. * @param {*} value The value to check.
  112818. * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
  112819. * @example
  112820. *
  112821. * _.isArrayLike([1, 2, 3]);
  112822. * // => true
  112823. *
  112824. * _.isArrayLike(document.body.children);
  112825. * // => true
  112826. *
  112827. * _.isArrayLike('abc');
  112828. * // => true
  112829. *
  112830. * _.isArrayLike(_.noop);
  112831. * // => false
  112832. */
  112833. function isArrayLike(value) {
  112834. return value != null && Object(_isLength_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value.length) && !Object(_isFunction_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value);
  112835. }
  112836. /* harmony default export */ __webpack_exports__["default"] = (isArrayLike);
  112837. /***/ }),
  112838. /***/ "./node_modules/lodash-es/isArrayLikeObject.js":
  112839. /*!*****************************************************!*\
  112840. !*** ./node_modules/lodash-es/isArrayLikeObject.js ***!
  112841. \*****************************************************/
  112842. /*! exports provided: default */
  112843. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  112844. "use strict";
  112845. __webpack_require__.r(__webpack_exports__);
  112846. /* harmony import */ var _isArrayLike_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isArrayLike.js */ "./node_modules/lodash-es/isArrayLike.js");
  112847. /* harmony import */ var _isObjectLike_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isObjectLike.js */ "./node_modules/lodash-es/isObjectLike.js");
  112848. /**
  112849. * This method is like `_.isArrayLike` except that it also checks if `value`
  112850. * is an object.
  112851. *
  112852. * @static
  112853. * @memberOf _
  112854. * @since 4.0.0
  112855. * @category Lang
  112856. * @param {*} value The value to check.
  112857. * @returns {boolean} Returns `true` if `value` is an array-like object,
  112858. * else `false`.
  112859. * @example
  112860. *
  112861. * _.isArrayLikeObject([1, 2, 3]);
  112862. * // => true
  112863. *
  112864. * _.isArrayLikeObject(document.body.children);
  112865. * // => true
  112866. *
  112867. * _.isArrayLikeObject('abc');
  112868. * // => false
  112869. *
  112870. * _.isArrayLikeObject(_.noop);
  112871. * // => false
  112872. */
  112873. function isArrayLikeObject(value) {
  112874. return Object(_isObjectLike_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value) && Object(_isArrayLike_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value);
  112875. }
  112876. /* harmony default export */ __webpack_exports__["default"] = (isArrayLikeObject);
  112877. /***/ }),
  112878. /***/ "./node_modules/lodash-es/isBoolean.js":
  112879. /*!*********************************************!*\
  112880. !*** ./node_modules/lodash-es/isBoolean.js ***!
  112881. \*********************************************/
  112882. /*! exports provided: default */
  112883. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  112884. "use strict";
  112885. __webpack_require__.r(__webpack_exports__);
  112886. /* harmony import */ var _baseGetTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseGetTag.js */ "./node_modules/lodash-es/_baseGetTag.js");
  112887. /* harmony import */ var _isObjectLike_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isObjectLike.js */ "./node_modules/lodash-es/isObjectLike.js");
  112888. /** `Object#toString` result references. */
  112889. var boolTag = '[object Boolean]';
  112890. /**
  112891. * Checks if `value` is classified as a boolean primitive or object.
  112892. *
  112893. * @static
  112894. * @memberOf _
  112895. * @since 0.1.0
  112896. * @category Lang
  112897. * @param {*} value The value to check.
  112898. * @returns {boolean} Returns `true` if `value` is a boolean, else `false`.
  112899. * @example
  112900. *
  112901. * _.isBoolean(false);
  112902. * // => true
  112903. *
  112904. * _.isBoolean(null);
  112905. * // => false
  112906. */
  112907. function isBoolean(value) {
  112908. return value === true || value === false ||
  112909. (Object(_isObjectLike_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value) && Object(_baseGetTag_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value) == boolTag);
  112910. }
  112911. /* harmony default export */ __webpack_exports__["default"] = (isBoolean);
  112912. /***/ }),
  112913. /***/ "./node_modules/lodash-es/isBuffer.js":
  112914. /*!********************************************!*\
  112915. !*** ./node_modules/lodash-es/isBuffer.js ***!
  112916. \********************************************/
  112917. /*! exports provided: default */
  112918. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  112919. "use strict";
  112920. __webpack_require__.r(__webpack_exports__);
  112921. /* WEBPACK VAR INJECTION */(function(module) {/* harmony import */ var _root_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_root.js */ "./node_modules/lodash-es/_root.js");
  112922. /* harmony import */ var _stubFalse_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./stubFalse.js */ "./node_modules/lodash-es/stubFalse.js");
  112923. /** Detect free variable `exports`. */
  112924. var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;
  112925. /** Detect free variable `module`. */
  112926. var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;
  112927. /** Detect the popular CommonJS extension `module.exports`. */
  112928. var moduleExports = freeModule && freeModule.exports === freeExports;
  112929. /** Built-in value references. */
  112930. var Buffer = moduleExports ? _root_js__WEBPACK_IMPORTED_MODULE_0__["default"].Buffer : undefined;
  112931. /* Built-in method references for those with the same name as other `lodash` methods. */
  112932. var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;
  112933. /**
  112934. * Checks if `value` is a buffer.
  112935. *
  112936. * @static
  112937. * @memberOf _
  112938. * @since 4.3.0
  112939. * @category Lang
  112940. * @param {*} value The value to check.
  112941. * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
  112942. * @example
  112943. *
  112944. * _.isBuffer(new Buffer(2));
  112945. * // => true
  112946. *
  112947. * _.isBuffer(new Uint8Array(2));
  112948. * // => false
  112949. */
  112950. var isBuffer = nativeIsBuffer || _stubFalse_js__WEBPACK_IMPORTED_MODULE_1__["default"];
  112951. /* harmony default export */ __webpack_exports__["default"] = (isBuffer);
  112952. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/harmony-module.js */ "./node_modules/webpack/buildin/harmony-module.js")(module)))
  112953. /***/ }),
  112954. /***/ "./node_modules/lodash-es/isDate.js":
  112955. /*!******************************************!*\
  112956. !*** ./node_modules/lodash-es/isDate.js ***!
  112957. \******************************************/
  112958. /*! exports provided: default */
  112959. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  112960. "use strict";
  112961. __webpack_require__.r(__webpack_exports__);
  112962. /* harmony import */ var _baseIsDate_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseIsDate.js */ "./node_modules/lodash-es/_baseIsDate.js");
  112963. /* harmony import */ var _baseUnary_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseUnary.js */ "./node_modules/lodash-es/_baseUnary.js");
  112964. /* harmony import */ var _nodeUtil_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_nodeUtil.js */ "./node_modules/lodash-es/_nodeUtil.js");
  112965. /* Node.js helper references. */
  112966. var nodeIsDate = _nodeUtil_js__WEBPACK_IMPORTED_MODULE_2__["default"] && _nodeUtil_js__WEBPACK_IMPORTED_MODULE_2__["default"].isDate;
  112967. /**
  112968. * Checks if `value` is classified as a `Date` object.
  112969. *
  112970. * @static
  112971. * @memberOf _
  112972. * @since 0.1.0
  112973. * @category Lang
  112974. * @param {*} value The value to check.
  112975. * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
  112976. * @example
  112977. *
  112978. * _.isDate(new Date);
  112979. * // => true
  112980. *
  112981. * _.isDate('Mon April 23 2012');
  112982. * // => false
  112983. */
  112984. var isDate = nodeIsDate ? Object(_baseUnary_js__WEBPACK_IMPORTED_MODULE_1__["default"])(nodeIsDate) : _baseIsDate_js__WEBPACK_IMPORTED_MODULE_0__["default"];
  112985. /* harmony default export */ __webpack_exports__["default"] = (isDate);
  112986. /***/ }),
  112987. /***/ "./node_modules/lodash-es/isElement.js":
  112988. /*!*********************************************!*\
  112989. !*** ./node_modules/lodash-es/isElement.js ***!
  112990. \*********************************************/
  112991. /*! exports provided: default */
  112992. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  112993. "use strict";
  112994. __webpack_require__.r(__webpack_exports__);
  112995. /* harmony import */ var _isObjectLike_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isObjectLike.js */ "./node_modules/lodash-es/isObjectLike.js");
  112996. /* harmony import */ var _isPlainObject_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isPlainObject.js */ "./node_modules/lodash-es/isPlainObject.js");
  112997. /**
  112998. * Checks if `value` is likely a DOM element.
  112999. *
  113000. * @static
  113001. * @memberOf _
  113002. * @since 0.1.0
  113003. * @category Lang
  113004. * @param {*} value The value to check.
  113005. * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`.
  113006. * @example
  113007. *
  113008. * _.isElement(document.body);
  113009. * // => true
  113010. *
  113011. * _.isElement('<body>');
  113012. * // => false
  113013. */
  113014. function isElement(value) {
  113015. return Object(_isObjectLike_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value) && value.nodeType === 1 && !Object(_isPlainObject_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value);
  113016. }
  113017. /* harmony default export */ __webpack_exports__["default"] = (isElement);
  113018. /***/ }),
  113019. /***/ "./node_modules/lodash-es/isEmpty.js":
  113020. /*!*******************************************!*\
  113021. !*** ./node_modules/lodash-es/isEmpty.js ***!
  113022. \*******************************************/
  113023. /*! exports provided: default */
  113024. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  113025. "use strict";
  113026. __webpack_require__.r(__webpack_exports__);
  113027. /* harmony import */ var _baseKeys_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseKeys.js */ "./node_modules/lodash-es/_baseKeys.js");
  113028. /* harmony import */ var _getTag_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_getTag.js */ "./node_modules/lodash-es/_getTag.js");
  113029. /* harmony import */ var _isArguments_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./isArguments.js */ "./node_modules/lodash-es/isArguments.js");
  113030. /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
  113031. /* harmony import */ var _isArrayLike_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./isArrayLike.js */ "./node_modules/lodash-es/isArrayLike.js");
  113032. /* harmony import */ var _isBuffer_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./isBuffer.js */ "./node_modules/lodash-es/isBuffer.js");
  113033. /* harmony import */ var _isPrototype_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./_isPrototype.js */ "./node_modules/lodash-es/_isPrototype.js");
  113034. /* harmony import */ var _isTypedArray_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./isTypedArray.js */ "./node_modules/lodash-es/isTypedArray.js");
  113035. /** `Object#toString` result references. */
  113036. var mapTag = '[object Map]',
  113037. setTag = '[object Set]';
  113038. /** Used for built-in method references. */
  113039. var objectProto = Object.prototype;
  113040. /** Used to check objects for own properties. */
  113041. var hasOwnProperty = objectProto.hasOwnProperty;
  113042. /**
  113043. * Checks if `value` is an empty object, collection, map, or set.
  113044. *
  113045. * Objects are considered empty if they have no own enumerable string keyed
  113046. * properties.
  113047. *
  113048. * Array-like values such as `arguments` objects, arrays, buffers, strings, or
  113049. * jQuery-like collections are considered empty if they have a `length` of `0`.
  113050. * Similarly, maps and sets are considered empty if they have a `size` of `0`.
  113051. *
  113052. * @static
  113053. * @memberOf _
  113054. * @since 0.1.0
  113055. * @category Lang
  113056. * @param {*} value The value to check.
  113057. * @returns {boolean} Returns `true` if `value` is empty, else `false`.
  113058. * @example
  113059. *
  113060. * _.isEmpty(null);
  113061. * // => true
  113062. *
  113063. * _.isEmpty(true);
  113064. * // => true
  113065. *
  113066. * _.isEmpty(1);
  113067. * // => true
  113068. *
  113069. * _.isEmpty([1, 2, 3]);
  113070. * // => false
  113071. *
  113072. * _.isEmpty({ 'a': 1 });
  113073. * // => false
  113074. */
  113075. function isEmpty(value) {
  113076. if (value == null) {
  113077. return true;
  113078. }
  113079. if (Object(_isArrayLike_js__WEBPACK_IMPORTED_MODULE_4__["default"])(value) &&
  113080. (Object(_isArray_js__WEBPACK_IMPORTED_MODULE_3__["default"])(value) || typeof value == 'string' || typeof value.splice == 'function' ||
  113081. 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))) {
  113082. return !value.length;
  113083. }
  113084. var tag = Object(_getTag_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value);
  113085. if (tag == mapTag || tag == setTag) {
  113086. return !value.size;
  113087. }
  113088. if (Object(_isPrototype_js__WEBPACK_IMPORTED_MODULE_6__["default"])(value)) {
  113089. return !Object(_baseKeys_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value).length;
  113090. }
  113091. for (var key in value) {
  113092. if (hasOwnProperty.call(value, key)) {
  113093. return false;
  113094. }
  113095. }
  113096. return true;
  113097. }
  113098. /* harmony default export */ __webpack_exports__["default"] = (isEmpty);
  113099. /***/ }),
  113100. /***/ "./node_modules/lodash-es/isEqual.js":
  113101. /*!*******************************************!*\
  113102. !*** ./node_modules/lodash-es/isEqual.js ***!
  113103. \*******************************************/
  113104. /*! exports provided: default */
  113105. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  113106. "use strict";
  113107. __webpack_require__.r(__webpack_exports__);
  113108. /* harmony import */ var _baseIsEqual_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseIsEqual.js */ "./node_modules/lodash-es/_baseIsEqual.js");
  113109. /**
  113110. * Performs a deep comparison between two values to determine if they are
  113111. * equivalent.
  113112. *
  113113. * **Note:** This method supports comparing arrays, array buffers, booleans,
  113114. * date objects, error objects, maps, numbers, `Object` objects, regexes,
  113115. * sets, strings, symbols, and typed arrays. `Object` objects are compared
  113116. * by their own, not inherited, enumerable properties. Functions and DOM
  113117. * nodes are compared by strict equality, i.e. `===`.
  113118. *
  113119. * @static
  113120. * @memberOf _
  113121. * @since 0.1.0
  113122. * @category Lang
  113123. * @param {*} value The value to compare.
  113124. * @param {*} other The other value to compare.
  113125. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  113126. * @example
  113127. *
  113128. * var object = { 'a': 1 };
  113129. * var other = { 'a': 1 };
  113130. *
  113131. * _.isEqual(object, other);
  113132. * // => true
  113133. *
  113134. * object === other;
  113135. * // => false
  113136. */
  113137. function isEqual(value, other) {
  113138. return Object(_baseIsEqual_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value, other);
  113139. }
  113140. /* harmony default export */ __webpack_exports__["default"] = (isEqual);
  113141. /***/ }),
  113142. /***/ "./node_modules/lodash-es/isEqualWith.js":
  113143. /*!***********************************************!*\
  113144. !*** ./node_modules/lodash-es/isEqualWith.js ***!
  113145. \***********************************************/
  113146. /*! exports provided: default */
  113147. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  113148. "use strict";
  113149. __webpack_require__.r(__webpack_exports__);
  113150. /* harmony import */ var _baseIsEqual_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseIsEqual.js */ "./node_modules/lodash-es/_baseIsEqual.js");
  113151. /**
  113152. * This method is like `_.isEqual` except that it accepts `customizer` which
  113153. * is invoked to compare values. If `customizer` returns `undefined`, comparisons
  113154. * are handled by the method instead. The `customizer` is invoked with up to
  113155. * six arguments: (objValue, othValue [, index|key, object, other, stack]).
  113156. *
  113157. * @static
  113158. * @memberOf _
  113159. * @since 4.0.0
  113160. * @category Lang
  113161. * @param {*} value The value to compare.
  113162. * @param {*} other The other value to compare.
  113163. * @param {Function} [customizer] The function to customize comparisons.
  113164. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  113165. * @example
  113166. *
  113167. * function isGreeting(value) {
  113168. * return /^h(?:i|ello)$/.test(value);
  113169. * }
  113170. *
  113171. * function customizer(objValue, othValue) {
  113172. * if (isGreeting(objValue) && isGreeting(othValue)) {
  113173. * return true;
  113174. * }
  113175. * }
  113176. *
  113177. * var array = ['hello', 'goodbye'];
  113178. * var other = ['hi', 'goodbye'];
  113179. *
  113180. * _.isEqualWith(array, other, customizer);
  113181. * // => true
  113182. */
  113183. function isEqualWith(value, other, customizer) {
  113184. customizer = typeof customizer == 'function' ? customizer : undefined;
  113185. var result = customizer ? customizer(value, other) : undefined;
  113186. return result === undefined ? Object(_baseIsEqual_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value, other, undefined, customizer) : !!result;
  113187. }
  113188. /* harmony default export */ __webpack_exports__["default"] = (isEqualWith);
  113189. /***/ }),
  113190. /***/ "./node_modules/lodash-es/isError.js":
  113191. /*!*******************************************!*\
  113192. !*** ./node_modules/lodash-es/isError.js ***!
  113193. \*******************************************/
  113194. /*! exports provided: default */
  113195. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  113196. "use strict";
  113197. __webpack_require__.r(__webpack_exports__);
  113198. /* harmony import */ var _baseGetTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseGetTag.js */ "./node_modules/lodash-es/_baseGetTag.js");
  113199. /* harmony import */ var _isObjectLike_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isObjectLike.js */ "./node_modules/lodash-es/isObjectLike.js");
  113200. /* harmony import */ var _isPlainObject_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./isPlainObject.js */ "./node_modules/lodash-es/isPlainObject.js");
  113201. /** `Object#toString` result references. */
  113202. var domExcTag = '[object DOMException]',
  113203. errorTag = '[object Error]';
  113204. /**
  113205. * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`,
  113206. * `SyntaxError`, `TypeError`, or `URIError` object.
  113207. *
  113208. * @static
  113209. * @memberOf _
  113210. * @since 3.0.0
  113211. * @category Lang
  113212. * @param {*} value The value to check.
  113213. * @returns {boolean} Returns `true` if `value` is an error object, else `false`.
  113214. * @example
  113215. *
  113216. * _.isError(new Error);
  113217. * // => true
  113218. *
  113219. * _.isError(Error);
  113220. * // => false
  113221. */
  113222. function isError(value) {
  113223. if (!Object(_isObjectLike_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value)) {
  113224. return false;
  113225. }
  113226. var tag = Object(_baseGetTag_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value);
  113227. return tag == errorTag || tag == domExcTag ||
  113228. (typeof value.message == 'string' && typeof value.name == 'string' && !Object(_isPlainObject_js__WEBPACK_IMPORTED_MODULE_2__["default"])(value));
  113229. }
  113230. /* harmony default export */ __webpack_exports__["default"] = (isError);
  113231. /***/ }),
  113232. /***/ "./node_modules/lodash-es/isFinite.js":
  113233. /*!********************************************!*\
  113234. !*** ./node_modules/lodash-es/isFinite.js ***!
  113235. \********************************************/
  113236. /*! exports provided: default */
  113237. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  113238. "use strict";
  113239. __webpack_require__.r(__webpack_exports__);
  113240. /* harmony import */ var _root_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_root.js */ "./node_modules/lodash-es/_root.js");
  113241. /* Built-in method references for those with the same name as other `lodash` methods. */
  113242. var nativeIsFinite = _root_js__WEBPACK_IMPORTED_MODULE_0__["default"].isFinite;
  113243. /**
  113244. * Checks if `value` is a finite primitive number.
  113245. *
  113246. * **Note:** This method is based on
  113247. * [`Number.isFinite`](https://mdn.io/Number/isFinite).
  113248. *
  113249. * @static
  113250. * @memberOf _
  113251. * @since 0.1.0
  113252. * @category Lang
  113253. * @param {*} value The value to check.
  113254. * @returns {boolean} Returns `true` if `value` is a finite number, else `false`.
  113255. * @example
  113256. *
  113257. * _.isFinite(3);
  113258. * // => true
  113259. *
  113260. * _.isFinite(Number.MIN_VALUE);
  113261. * // => true
  113262. *
  113263. * _.isFinite(Infinity);
  113264. * // => false
  113265. *
  113266. * _.isFinite('3');
  113267. * // => false
  113268. */
  113269. function isFinite(value) {
  113270. return typeof value == 'number' && nativeIsFinite(value);
  113271. }
  113272. /* harmony default export */ __webpack_exports__["default"] = (isFinite);
  113273. /***/ }),
  113274. /***/ "./node_modules/lodash-es/isFunction.js":
  113275. /*!**********************************************!*\
  113276. !*** ./node_modules/lodash-es/isFunction.js ***!
  113277. \**********************************************/
  113278. /*! exports provided: default */
  113279. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  113280. "use strict";
  113281. __webpack_require__.r(__webpack_exports__);
  113282. /* harmony import */ var _baseGetTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseGetTag.js */ "./node_modules/lodash-es/_baseGetTag.js");
  113283. /* harmony import */ var _isObject_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isObject.js */ "./node_modules/lodash-es/isObject.js");
  113284. /** `Object#toString` result references. */
  113285. var asyncTag = '[object AsyncFunction]',
  113286. funcTag = '[object Function]',
  113287. genTag = '[object GeneratorFunction]',
  113288. proxyTag = '[object Proxy]';
  113289. /**
  113290. * Checks if `value` is classified as a `Function` object.
  113291. *
  113292. * @static
  113293. * @memberOf _
  113294. * @since 0.1.0
  113295. * @category Lang
  113296. * @param {*} value The value to check.
  113297. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  113298. * @example
  113299. *
  113300. * _.isFunction(_);
  113301. * // => true
  113302. *
  113303. * _.isFunction(/abc/);
  113304. * // => false
  113305. */
  113306. function isFunction(value) {
  113307. if (!Object(_isObject_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value)) {
  113308. return false;
  113309. }
  113310. // The use of `Object#toString` avoids issues with the `typeof` operator
  113311. // in Safari 9 which returns 'object' for typed arrays and other constructors.
  113312. var tag = Object(_baseGetTag_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value);
  113313. return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
  113314. }
  113315. /* harmony default export */ __webpack_exports__["default"] = (isFunction);
  113316. /***/ }),
  113317. /***/ "./node_modules/lodash-es/isInteger.js":
  113318. /*!*********************************************!*\
  113319. !*** ./node_modules/lodash-es/isInteger.js ***!
  113320. \*********************************************/
  113321. /*! exports provided: default */
  113322. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  113323. "use strict";
  113324. __webpack_require__.r(__webpack_exports__);
  113325. /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
  113326. /**
  113327. * Checks if `value` is an integer.
  113328. *
  113329. * **Note:** This method is based on
  113330. * [`Number.isInteger`](https://mdn.io/Number/isInteger).
  113331. *
  113332. * @static
  113333. * @memberOf _
  113334. * @since 4.0.0
  113335. * @category Lang
  113336. * @param {*} value The value to check.
  113337. * @returns {boolean} Returns `true` if `value` is an integer, else `false`.
  113338. * @example
  113339. *
  113340. * _.isInteger(3);
  113341. * // => true
  113342. *
  113343. * _.isInteger(Number.MIN_VALUE);
  113344. * // => false
  113345. *
  113346. * _.isInteger(Infinity);
  113347. * // => false
  113348. *
  113349. * _.isInteger('3');
  113350. * // => false
  113351. */
  113352. function isInteger(value) {
  113353. return typeof value == 'number' && value == Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value);
  113354. }
  113355. /* harmony default export */ __webpack_exports__["default"] = (isInteger);
  113356. /***/ }),
  113357. /***/ "./node_modules/lodash-es/isLength.js":
  113358. /*!********************************************!*\
  113359. !*** ./node_modules/lodash-es/isLength.js ***!
  113360. \********************************************/
  113361. /*! exports provided: default */
  113362. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  113363. "use strict";
  113364. __webpack_require__.r(__webpack_exports__);
  113365. /** Used as references for various `Number` constants. */
  113366. var MAX_SAFE_INTEGER = 9007199254740991;
  113367. /**
  113368. * Checks if `value` is a valid array-like length.
  113369. *
  113370. * **Note:** This method is loosely based on
  113371. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  113372. *
  113373. * @static
  113374. * @memberOf _
  113375. * @since 4.0.0
  113376. * @category Lang
  113377. * @param {*} value The value to check.
  113378. * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
  113379. * @example
  113380. *
  113381. * _.isLength(3);
  113382. * // => true
  113383. *
  113384. * _.isLength(Number.MIN_VALUE);
  113385. * // => false
  113386. *
  113387. * _.isLength(Infinity);
  113388. * // => false
  113389. *
  113390. * _.isLength('3');
  113391. * // => false
  113392. */
  113393. function isLength(value) {
  113394. return typeof value == 'number' &&
  113395. value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
  113396. }
  113397. /* harmony default export */ __webpack_exports__["default"] = (isLength);
  113398. /***/ }),
  113399. /***/ "./node_modules/lodash-es/isMap.js":
  113400. /*!*****************************************!*\
  113401. !*** ./node_modules/lodash-es/isMap.js ***!
  113402. \*****************************************/
  113403. /*! exports provided: default */
  113404. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  113405. "use strict";
  113406. __webpack_require__.r(__webpack_exports__);
  113407. /* harmony import */ var _baseIsMap_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseIsMap.js */ "./node_modules/lodash-es/_baseIsMap.js");
  113408. /* harmony import */ var _baseUnary_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseUnary.js */ "./node_modules/lodash-es/_baseUnary.js");
  113409. /* harmony import */ var _nodeUtil_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_nodeUtil.js */ "./node_modules/lodash-es/_nodeUtil.js");
  113410. /* Node.js helper references. */
  113411. var nodeIsMap = _nodeUtil_js__WEBPACK_IMPORTED_MODULE_2__["default"] && _nodeUtil_js__WEBPACK_IMPORTED_MODULE_2__["default"].isMap;
  113412. /**
  113413. * Checks if `value` is classified as a `Map` object.
  113414. *
  113415. * @static
  113416. * @memberOf _
  113417. * @since 4.3.0
  113418. * @category Lang
  113419. * @param {*} value The value to check.
  113420. * @returns {boolean} Returns `true` if `value` is a map, else `false`.
  113421. * @example
  113422. *
  113423. * _.isMap(new Map);
  113424. * // => true
  113425. *
  113426. * _.isMap(new WeakMap);
  113427. * // => false
  113428. */
  113429. var isMap = nodeIsMap ? Object(_baseUnary_js__WEBPACK_IMPORTED_MODULE_1__["default"])(nodeIsMap) : _baseIsMap_js__WEBPACK_IMPORTED_MODULE_0__["default"];
  113430. /* harmony default export */ __webpack_exports__["default"] = (isMap);
  113431. /***/ }),
  113432. /***/ "./node_modules/lodash-es/isMatch.js":
  113433. /*!*******************************************!*\
  113434. !*** ./node_modules/lodash-es/isMatch.js ***!
  113435. \*******************************************/
  113436. /*! exports provided: default */
  113437. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  113438. "use strict";
  113439. __webpack_require__.r(__webpack_exports__);
  113440. /* harmony import */ var _baseIsMatch_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseIsMatch.js */ "./node_modules/lodash-es/_baseIsMatch.js");
  113441. /* harmony import */ var _getMatchData_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_getMatchData.js */ "./node_modules/lodash-es/_getMatchData.js");
  113442. /**
  113443. * Performs a partial deep comparison between `object` and `source` to
  113444. * determine if `object` contains equivalent property values.
  113445. *
  113446. * **Note:** This method is equivalent to `_.matches` when `source` is
  113447. * partially applied.
  113448. *
  113449. * Partial comparisons will match empty array and empty object `source`
  113450. * values against any array or object value, respectively. See `_.isEqual`
  113451. * for a list of supported value comparisons.
  113452. *
  113453. * @static
  113454. * @memberOf _
  113455. * @since 3.0.0
  113456. * @category Lang
  113457. * @param {Object} object The object to inspect.
  113458. * @param {Object} source The object of property values to match.
  113459. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  113460. * @example
  113461. *
  113462. * var object = { 'a': 1, 'b': 2 };
  113463. *
  113464. * _.isMatch(object, { 'b': 2 });
  113465. * // => true
  113466. *
  113467. * _.isMatch(object, { 'b': 1 });
  113468. * // => false
  113469. */
  113470. function isMatch(object, source) {
  113471. return object === source || Object(_baseIsMatch_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, source, Object(_getMatchData_js__WEBPACK_IMPORTED_MODULE_1__["default"])(source));
  113472. }
  113473. /* harmony default export */ __webpack_exports__["default"] = (isMatch);
  113474. /***/ }),
  113475. /***/ "./node_modules/lodash-es/isMatchWith.js":
  113476. /*!***********************************************!*\
  113477. !*** ./node_modules/lodash-es/isMatchWith.js ***!
  113478. \***********************************************/
  113479. /*! exports provided: default */
  113480. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  113481. "use strict";
  113482. __webpack_require__.r(__webpack_exports__);
  113483. /* harmony import */ var _baseIsMatch_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseIsMatch.js */ "./node_modules/lodash-es/_baseIsMatch.js");
  113484. /* harmony import */ var _getMatchData_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_getMatchData.js */ "./node_modules/lodash-es/_getMatchData.js");
  113485. /**
  113486. * This method is like `_.isMatch` except that it accepts `customizer` which
  113487. * is invoked to compare values. If `customizer` returns `undefined`, comparisons
  113488. * are handled by the method instead. The `customizer` is invoked with five
  113489. * arguments: (objValue, srcValue, index|key, object, source).
  113490. *
  113491. * @static
  113492. * @memberOf _
  113493. * @since 4.0.0
  113494. * @category Lang
  113495. * @param {Object} object The object to inspect.
  113496. * @param {Object} source The object of property values to match.
  113497. * @param {Function} [customizer] The function to customize comparisons.
  113498. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  113499. * @example
  113500. *
  113501. * function isGreeting(value) {
  113502. * return /^h(?:i|ello)$/.test(value);
  113503. * }
  113504. *
  113505. * function customizer(objValue, srcValue) {
  113506. * if (isGreeting(objValue) && isGreeting(srcValue)) {
  113507. * return true;
  113508. * }
  113509. * }
  113510. *
  113511. * var object = { 'greeting': 'hello' };
  113512. * var source = { 'greeting': 'hi' };
  113513. *
  113514. * _.isMatchWith(object, source, customizer);
  113515. * // => true
  113516. */
  113517. function isMatchWith(object, source, customizer) {
  113518. customizer = typeof customizer == 'function' ? customizer : undefined;
  113519. return Object(_baseIsMatch_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, source, Object(_getMatchData_js__WEBPACK_IMPORTED_MODULE_1__["default"])(source), customizer);
  113520. }
  113521. /* harmony default export */ __webpack_exports__["default"] = (isMatchWith);
  113522. /***/ }),
  113523. /***/ "./node_modules/lodash-es/isNaN.js":
  113524. /*!*****************************************!*\
  113525. !*** ./node_modules/lodash-es/isNaN.js ***!
  113526. \*****************************************/
  113527. /*! exports provided: default */
  113528. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  113529. "use strict";
  113530. __webpack_require__.r(__webpack_exports__);
  113531. /* harmony import */ var _isNumber_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isNumber.js */ "./node_modules/lodash-es/isNumber.js");
  113532. /**
  113533. * Checks if `value` is `NaN`.
  113534. *
  113535. * **Note:** This method is based on
  113536. * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as
  113537. * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for
  113538. * `undefined` and other non-number values.
  113539. *
  113540. * @static
  113541. * @memberOf _
  113542. * @since 0.1.0
  113543. * @category Lang
  113544. * @param {*} value The value to check.
  113545. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  113546. * @example
  113547. *
  113548. * _.isNaN(NaN);
  113549. * // => true
  113550. *
  113551. * _.isNaN(new Number(NaN));
  113552. * // => true
  113553. *
  113554. * isNaN(undefined);
  113555. * // => true
  113556. *
  113557. * _.isNaN(undefined);
  113558. * // => false
  113559. */
  113560. function isNaN(value) {
  113561. // An `NaN` primitive is the only value that is not equal to itself.
  113562. // Perform the `toStringTag` check first to avoid errors with some
  113563. // ActiveX objects in IE.
  113564. return Object(_isNumber_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value) && value != +value;
  113565. }
  113566. /* harmony default export */ __webpack_exports__["default"] = (isNaN);
  113567. /***/ }),
  113568. /***/ "./node_modules/lodash-es/isNative.js":
  113569. /*!********************************************!*\
  113570. !*** ./node_modules/lodash-es/isNative.js ***!
  113571. \********************************************/
  113572. /*! exports provided: default */
  113573. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  113574. "use strict";
  113575. __webpack_require__.r(__webpack_exports__);
  113576. /* harmony import */ var _baseIsNative_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseIsNative.js */ "./node_modules/lodash-es/_baseIsNative.js");
  113577. /* harmony import */ var _isMaskable_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_isMaskable.js */ "./node_modules/lodash-es/_isMaskable.js");
  113578. /** Error message constants. */
  113579. var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.';
  113580. /**
  113581. * Checks if `value` is a pristine native function.
  113582. *
  113583. * **Note:** This method can't reliably detect native functions in the presence
  113584. * of the core-js package because core-js circumvents this kind of detection.
  113585. * Despite multiple requests, the core-js maintainer has made it clear: any
  113586. * attempt to fix the detection will be obstructed. As a result, we're left
  113587. * with little choice but to throw an error. Unfortunately, this also affects
  113588. * packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill),
  113589. * which rely on core-js.
  113590. *
  113591. * @static
  113592. * @memberOf _
  113593. * @since 3.0.0
  113594. * @category Lang
  113595. * @param {*} value The value to check.
  113596. * @returns {boolean} Returns `true` if `value` is a native function,
  113597. * else `false`.
  113598. * @example
  113599. *
  113600. * _.isNative(Array.prototype.push);
  113601. * // => true
  113602. *
  113603. * _.isNative(_);
  113604. * // => false
  113605. */
  113606. function isNative(value) {
  113607. if (Object(_isMaskable_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value)) {
  113608. throw new Error(CORE_ERROR_TEXT);
  113609. }
  113610. return Object(_baseIsNative_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value);
  113611. }
  113612. /* harmony default export */ __webpack_exports__["default"] = (isNative);
  113613. /***/ }),
  113614. /***/ "./node_modules/lodash-es/isNil.js":
  113615. /*!*****************************************!*\
  113616. !*** ./node_modules/lodash-es/isNil.js ***!
  113617. \*****************************************/
  113618. /*! exports provided: default */
  113619. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  113620. "use strict";
  113621. __webpack_require__.r(__webpack_exports__);
  113622. /**
  113623. * Checks if `value` is `null` or `undefined`.
  113624. *
  113625. * @static
  113626. * @memberOf _
  113627. * @since 4.0.0
  113628. * @category Lang
  113629. * @param {*} value The value to check.
  113630. * @returns {boolean} Returns `true` if `value` is nullish, else `false`.
  113631. * @example
  113632. *
  113633. * _.isNil(null);
  113634. * // => true
  113635. *
  113636. * _.isNil(void 0);
  113637. * // => true
  113638. *
  113639. * _.isNil(NaN);
  113640. * // => false
  113641. */
  113642. function isNil(value) {
  113643. return value == null;
  113644. }
  113645. /* harmony default export */ __webpack_exports__["default"] = (isNil);
  113646. /***/ }),
  113647. /***/ "./node_modules/lodash-es/isNull.js":
  113648. /*!******************************************!*\
  113649. !*** ./node_modules/lodash-es/isNull.js ***!
  113650. \******************************************/
  113651. /*! exports provided: default */
  113652. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  113653. "use strict";
  113654. __webpack_require__.r(__webpack_exports__);
  113655. /**
  113656. * Checks if `value` is `null`.
  113657. *
  113658. * @static
  113659. * @memberOf _
  113660. * @since 0.1.0
  113661. * @category Lang
  113662. * @param {*} value The value to check.
  113663. * @returns {boolean} Returns `true` if `value` is `null`, else `false`.
  113664. * @example
  113665. *
  113666. * _.isNull(null);
  113667. * // => true
  113668. *
  113669. * _.isNull(void 0);
  113670. * // => false
  113671. */
  113672. function isNull(value) {
  113673. return value === null;
  113674. }
  113675. /* harmony default export */ __webpack_exports__["default"] = (isNull);
  113676. /***/ }),
  113677. /***/ "./node_modules/lodash-es/isNumber.js":
  113678. /*!********************************************!*\
  113679. !*** ./node_modules/lodash-es/isNumber.js ***!
  113680. \********************************************/
  113681. /*! exports provided: default */
  113682. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  113683. "use strict";
  113684. __webpack_require__.r(__webpack_exports__);
  113685. /* harmony import */ var _baseGetTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseGetTag.js */ "./node_modules/lodash-es/_baseGetTag.js");
  113686. /* harmony import */ var _isObjectLike_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isObjectLike.js */ "./node_modules/lodash-es/isObjectLike.js");
  113687. /** `Object#toString` result references. */
  113688. var numberTag = '[object Number]';
  113689. /**
  113690. * Checks if `value` is classified as a `Number` primitive or object.
  113691. *
  113692. * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are
  113693. * classified as numbers, use the `_.isFinite` method.
  113694. *
  113695. * @static
  113696. * @memberOf _
  113697. * @since 0.1.0
  113698. * @category Lang
  113699. * @param {*} value The value to check.
  113700. * @returns {boolean} Returns `true` if `value` is a number, else `false`.
  113701. * @example
  113702. *
  113703. * _.isNumber(3);
  113704. * // => true
  113705. *
  113706. * _.isNumber(Number.MIN_VALUE);
  113707. * // => true
  113708. *
  113709. * _.isNumber(Infinity);
  113710. * // => true
  113711. *
  113712. * _.isNumber('3');
  113713. * // => false
  113714. */
  113715. function isNumber(value) {
  113716. return typeof value == 'number' ||
  113717. (Object(_isObjectLike_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value) && Object(_baseGetTag_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value) == numberTag);
  113718. }
  113719. /* harmony default export */ __webpack_exports__["default"] = (isNumber);
  113720. /***/ }),
  113721. /***/ "./node_modules/lodash-es/isObject.js":
  113722. /*!********************************************!*\
  113723. !*** ./node_modules/lodash-es/isObject.js ***!
  113724. \********************************************/
  113725. /*! exports provided: default */
  113726. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  113727. "use strict";
  113728. __webpack_require__.r(__webpack_exports__);
  113729. /**
  113730. * Checks if `value` is the
  113731. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  113732. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  113733. *
  113734. * @static
  113735. * @memberOf _
  113736. * @since 0.1.0
  113737. * @category Lang
  113738. * @param {*} value The value to check.
  113739. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  113740. * @example
  113741. *
  113742. * _.isObject({});
  113743. * // => true
  113744. *
  113745. * _.isObject([1, 2, 3]);
  113746. * // => true
  113747. *
  113748. * _.isObject(_.noop);
  113749. * // => true
  113750. *
  113751. * _.isObject(null);
  113752. * // => false
  113753. */
  113754. function isObject(value) {
  113755. var type = typeof value;
  113756. return value != null && (type == 'object' || type == 'function');
  113757. }
  113758. /* harmony default export */ __webpack_exports__["default"] = (isObject);
  113759. /***/ }),
  113760. /***/ "./node_modules/lodash-es/isObjectLike.js":
  113761. /*!************************************************!*\
  113762. !*** ./node_modules/lodash-es/isObjectLike.js ***!
  113763. \************************************************/
  113764. /*! exports provided: default */
  113765. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  113766. "use strict";
  113767. __webpack_require__.r(__webpack_exports__);
  113768. /**
  113769. * Checks if `value` is object-like. A value is object-like if it's not `null`
  113770. * and has a `typeof` result of "object".
  113771. *
  113772. * @static
  113773. * @memberOf _
  113774. * @since 4.0.0
  113775. * @category Lang
  113776. * @param {*} value The value to check.
  113777. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  113778. * @example
  113779. *
  113780. * _.isObjectLike({});
  113781. * // => true
  113782. *
  113783. * _.isObjectLike([1, 2, 3]);
  113784. * // => true
  113785. *
  113786. * _.isObjectLike(_.noop);
  113787. * // => false
  113788. *
  113789. * _.isObjectLike(null);
  113790. * // => false
  113791. */
  113792. function isObjectLike(value) {
  113793. return value != null && typeof value == 'object';
  113794. }
  113795. /* harmony default export */ __webpack_exports__["default"] = (isObjectLike);
  113796. /***/ }),
  113797. /***/ "./node_modules/lodash-es/isPlainObject.js":
  113798. /*!*************************************************!*\
  113799. !*** ./node_modules/lodash-es/isPlainObject.js ***!
  113800. \*************************************************/
  113801. /*! exports provided: default */
  113802. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  113803. "use strict";
  113804. __webpack_require__.r(__webpack_exports__);
  113805. /* harmony import */ var _baseGetTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseGetTag.js */ "./node_modules/lodash-es/_baseGetTag.js");
  113806. /* harmony import */ var _getPrototype_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_getPrototype.js */ "./node_modules/lodash-es/_getPrototype.js");
  113807. /* harmony import */ var _isObjectLike_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./isObjectLike.js */ "./node_modules/lodash-es/isObjectLike.js");
  113808. /** `Object#toString` result references. */
  113809. var objectTag = '[object Object]';
  113810. /** Used for built-in method references. */
  113811. var funcProto = Function.prototype,
  113812. objectProto = Object.prototype;
  113813. /** Used to resolve the decompiled source of functions. */
  113814. var funcToString = funcProto.toString;
  113815. /** Used to check objects for own properties. */
  113816. var hasOwnProperty = objectProto.hasOwnProperty;
  113817. /** Used to infer the `Object` constructor. */
  113818. var objectCtorString = funcToString.call(Object);
  113819. /**
  113820. * Checks if `value` is a plain object, that is, an object created by the
  113821. * `Object` constructor or one with a `[[Prototype]]` of `null`.
  113822. *
  113823. * @static
  113824. * @memberOf _
  113825. * @since 0.8.0
  113826. * @category Lang
  113827. * @param {*} value The value to check.
  113828. * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
  113829. * @example
  113830. *
  113831. * function Foo() {
  113832. * this.a = 1;
  113833. * }
  113834. *
  113835. * _.isPlainObject(new Foo);
  113836. * // => false
  113837. *
  113838. * _.isPlainObject([1, 2, 3]);
  113839. * // => false
  113840. *
  113841. * _.isPlainObject({ 'x': 0, 'y': 0 });
  113842. * // => true
  113843. *
  113844. * _.isPlainObject(Object.create(null));
  113845. * // => true
  113846. */
  113847. function isPlainObject(value) {
  113848. if (!Object(_isObjectLike_js__WEBPACK_IMPORTED_MODULE_2__["default"])(value) || Object(_baseGetTag_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value) != objectTag) {
  113849. return false;
  113850. }
  113851. var proto = Object(_getPrototype_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value);
  113852. if (proto === null) {
  113853. return true;
  113854. }
  113855. var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;
  113856. return typeof Ctor == 'function' && Ctor instanceof Ctor &&
  113857. funcToString.call(Ctor) == objectCtorString;
  113858. }
  113859. /* harmony default export */ __webpack_exports__["default"] = (isPlainObject);
  113860. /***/ }),
  113861. /***/ "./node_modules/lodash-es/isRegExp.js":
  113862. /*!********************************************!*\
  113863. !*** ./node_modules/lodash-es/isRegExp.js ***!
  113864. \********************************************/
  113865. /*! exports provided: default */
  113866. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  113867. "use strict";
  113868. __webpack_require__.r(__webpack_exports__);
  113869. /* harmony import */ var _baseIsRegExp_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseIsRegExp.js */ "./node_modules/lodash-es/_baseIsRegExp.js");
  113870. /* harmony import */ var _baseUnary_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseUnary.js */ "./node_modules/lodash-es/_baseUnary.js");
  113871. /* harmony import */ var _nodeUtil_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_nodeUtil.js */ "./node_modules/lodash-es/_nodeUtil.js");
  113872. /* Node.js helper references. */
  113873. var nodeIsRegExp = _nodeUtil_js__WEBPACK_IMPORTED_MODULE_2__["default"] && _nodeUtil_js__WEBPACK_IMPORTED_MODULE_2__["default"].isRegExp;
  113874. /**
  113875. * Checks if `value` is classified as a `RegExp` object.
  113876. *
  113877. * @static
  113878. * @memberOf _
  113879. * @since 0.1.0
  113880. * @category Lang
  113881. * @param {*} value The value to check.
  113882. * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
  113883. * @example
  113884. *
  113885. * _.isRegExp(/abc/);
  113886. * // => true
  113887. *
  113888. * _.isRegExp('/abc/');
  113889. * // => false
  113890. */
  113891. var isRegExp = nodeIsRegExp ? Object(_baseUnary_js__WEBPACK_IMPORTED_MODULE_1__["default"])(nodeIsRegExp) : _baseIsRegExp_js__WEBPACK_IMPORTED_MODULE_0__["default"];
  113892. /* harmony default export */ __webpack_exports__["default"] = (isRegExp);
  113893. /***/ }),
  113894. /***/ "./node_modules/lodash-es/isSafeInteger.js":
  113895. /*!*************************************************!*\
  113896. !*** ./node_modules/lodash-es/isSafeInteger.js ***!
  113897. \*************************************************/
  113898. /*! exports provided: default */
  113899. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  113900. "use strict";
  113901. __webpack_require__.r(__webpack_exports__);
  113902. /* harmony import */ var _isInteger_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isInteger.js */ "./node_modules/lodash-es/isInteger.js");
  113903. /** Used as references for various `Number` constants. */
  113904. var MAX_SAFE_INTEGER = 9007199254740991;
  113905. /**
  113906. * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754
  113907. * double precision number which isn't the result of a rounded unsafe integer.
  113908. *
  113909. * **Note:** This method is based on
  113910. * [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger).
  113911. *
  113912. * @static
  113913. * @memberOf _
  113914. * @since 4.0.0
  113915. * @category Lang
  113916. * @param {*} value The value to check.
  113917. * @returns {boolean} Returns `true` if `value` is a safe integer, else `false`.
  113918. * @example
  113919. *
  113920. * _.isSafeInteger(3);
  113921. * // => true
  113922. *
  113923. * _.isSafeInteger(Number.MIN_VALUE);
  113924. * // => false
  113925. *
  113926. * _.isSafeInteger(Infinity);
  113927. * // => false
  113928. *
  113929. * _.isSafeInteger('3');
  113930. * // => false
  113931. */
  113932. function isSafeInteger(value) {
  113933. return Object(_isInteger_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER;
  113934. }
  113935. /* harmony default export */ __webpack_exports__["default"] = (isSafeInteger);
  113936. /***/ }),
  113937. /***/ "./node_modules/lodash-es/isSet.js":
  113938. /*!*****************************************!*\
  113939. !*** ./node_modules/lodash-es/isSet.js ***!
  113940. \*****************************************/
  113941. /*! exports provided: default */
  113942. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  113943. "use strict";
  113944. __webpack_require__.r(__webpack_exports__);
  113945. /* harmony import */ var _baseIsSet_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseIsSet.js */ "./node_modules/lodash-es/_baseIsSet.js");
  113946. /* harmony import */ var _baseUnary_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseUnary.js */ "./node_modules/lodash-es/_baseUnary.js");
  113947. /* harmony import */ var _nodeUtil_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_nodeUtil.js */ "./node_modules/lodash-es/_nodeUtil.js");
  113948. /* Node.js helper references. */
  113949. var nodeIsSet = _nodeUtil_js__WEBPACK_IMPORTED_MODULE_2__["default"] && _nodeUtil_js__WEBPACK_IMPORTED_MODULE_2__["default"].isSet;
  113950. /**
  113951. * Checks if `value` is classified as a `Set` object.
  113952. *
  113953. * @static
  113954. * @memberOf _
  113955. * @since 4.3.0
  113956. * @category Lang
  113957. * @param {*} value The value to check.
  113958. * @returns {boolean} Returns `true` if `value` is a set, else `false`.
  113959. * @example
  113960. *
  113961. * _.isSet(new Set);
  113962. * // => true
  113963. *
  113964. * _.isSet(new WeakSet);
  113965. * // => false
  113966. */
  113967. var isSet = nodeIsSet ? Object(_baseUnary_js__WEBPACK_IMPORTED_MODULE_1__["default"])(nodeIsSet) : _baseIsSet_js__WEBPACK_IMPORTED_MODULE_0__["default"];
  113968. /* harmony default export */ __webpack_exports__["default"] = (isSet);
  113969. /***/ }),
  113970. /***/ "./node_modules/lodash-es/isString.js":
  113971. /*!********************************************!*\
  113972. !*** ./node_modules/lodash-es/isString.js ***!
  113973. \********************************************/
  113974. /*! exports provided: default */
  113975. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  113976. "use strict";
  113977. __webpack_require__.r(__webpack_exports__);
  113978. /* harmony import */ var _baseGetTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseGetTag.js */ "./node_modules/lodash-es/_baseGetTag.js");
  113979. /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
  113980. /* harmony import */ var _isObjectLike_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./isObjectLike.js */ "./node_modules/lodash-es/isObjectLike.js");
  113981. /** `Object#toString` result references. */
  113982. var stringTag = '[object String]';
  113983. /**
  113984. * Checks if `value` is classified as a `String` primitive or object.
  113985. *
  113986. * @static
  113987. * @since 0.1.0
  113988. * @memberOf _
  113989. * @category Lang
  113990. * @param {*} value The value to check.
  113991. * @returns {boolean} Returns `true` if `value` is a string, else `false`.
  113992. * @example
  113993. *
  113994. * _.isString('abc');
  113995. * // => true
  113996. *
  113997. * _.isString(1);
  113998. * // => false
  113999. */
  114000. function isString(value) {
  114001. return typeof value == 'string' ||
  114002. (!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);
  114003. }
  114004. /* harmony default export */ __webpack_exports__["default"] = (isString);
  114005. /***/ }),
  114006. /***/ "./node_modules/lodash-es/isSymbol.js":
  114007. /*!********************************************!*\
  114008. !*** ./node_modules/lodash-es/isSymbol.js ***!
  114009. \********************************************/
  114010. /*! exports provided: default */
  114011. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  114012. "use strict";
  114013. __webpack_require__.r(__webpack_exports__);
  114014. /* harmony import */ var _baseGetTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseGetTag.js */ "./node_modules/lodash-es/_baseGetTag.js");
  114015. /* harmony import */ var _isObjectLike_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isObjectLike.js */ "./node_modules/lodash-es/isObjectLike.js");
  114016. /** `Object#toString` result references. */
  114017. var symbolTag = '[object Symbol]';
  114018. /**
  114019. * Checks if `value` is classified as a `Symbol` primitive or object.
  114020. *
  114021. * @static
  114022. * @memberOf _
  114023. * @since 4.0.0
  114024. * @category Lang
  114025. * @param {*} value The value to check.
  114026. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  114027. * @example
  114028. *
  114029. * _.isSymbol(Symbol.iterator);
  114030. * // => true
  114031. *
  114032. * _.isSymbol('abc');
  114033. * // => false
  114034. */
  114035. function isSymbol(value) {
  114036. return typeof value == 'symbol' ||
  114037. (Object(_isObjectLike_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value) && Object(_baseGetTag_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value) == symbolTag);
  114038. }
  114039. /* harmony default export */ __webpack_exports__["default"] = (isSymbol);
  114040. /***/ }),
  114041. /***/ "./node_modules/lodash-es/isTypedArray.js":
  114042. /*!************************************************!*\
  114043. !*** ./node_modules/lodash-es/isTypedArray.js ***!
  114044. \************************************************/
  114045. /*! exports provided: default */
  114046. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  114047. "use strict";
  114048. __webpack_require__.r(__webpack_exports__);
  114049. /* harmony import */ var _baseIsTypedArray_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseIsTypedArray.js */ "./node_modules/lodash-es/_baseIsTypedArray.js");
  114050. /* harmony import */ var _baseUnary_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseUnary.js */ "./node_modules/lodash-es/_baseUnary.js");
  114051. /* harmony import */ var _nodeUtil_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_nodeUtil.js */ "./node_modules/lodash-es/_nodeUtil.js");
  114052. /* Node.js helper references. */
  114053. var nodeIsTypedArray = _nodeUtil_js__WEBPACK_IMPORTED_MODULE_2__["default"] && _nodeUtil_js__WEBPACK_IMPORTED_MODULE_2__["default"].isTypedArray;
  114054. /**
  114055. * Checks if `value` is classified as a typed array.
  114056. *
  114057. * @static
  114058. * @memberOf _
  114059. * @since 3.0.0
  114060. * @category Lang
  114061. * @param {*} value The value to check.
  114062. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  114063. * @example
  114064. *
  114065. * _.isTypedArray(new Uint8Array);
  114066. * // => true
  114067. *
  114068. * _.isTypedArray([]);
  114069. * // => false
  114070. */
  114071. var isTypedArray = nodeIsTypedArray ? Object(_baseUnary_js__WEBPACK_IMPORTED_MODULE_1__["default"])(nodeIsTypedArray) : _baseIsTypedArray_js__WEBPACK_IMPORTED_MODULE_0__["default"];
  114072. /* harmony default export */ __webpack_exports__["default"] = (isTypedArray);
  114073. /***/ }),
  114074. /***/ "./node_modules/lodash-es/isUndefined.js":
  114075. /*!***********************************************!*\
  114076. !*** ./node_modules/lodash-es/isUndefined.js ***!
  114077. \***********************************************/
  114078. /*! exports provided: default */
  114079. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  114080. "use strict";
  114081. __webpack_require__.r(__webpack_exports__);
  114082. /**
  114083. * Checks if `value` is `undefined`.
  114084. *
  114085. * @static
  114086. * @since 0.1.0
  114087. * @memberOf _
  114088. * @category Lang
  114089. * @param {*} value The value to check.
  114090. * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.
  114091. * @example
  114092. *
  114093. * _.isUndefined(void 0);
  114094. * // => true
  114095. *
  114096. * _.isUndefined(null);
  114097. * // => false
  114098. */
  114099. function isUndefined(value) {
  114100. return value === undefined;
  114101. }
  114102. /* harmony default export */ __webpack_exports__["default"] = (isUndefined);
  114103. /***/ }),
  114104. /***/ "./node_modules/lodash-es/isWeakMap.js":
  114105. /*!*********************************************!*\
  114106. !*** ./node_modules/lodash-es/isWeakMap.js ***!
  114107. \*********************************************/
  114108. /*! exports provided: default */
  114109. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  114110. "use strict";
  114111. __webpack_require__.r(__webpack_exports__);
  114112. /* harmony import */ var _getTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_getTag.js */ "./node_modules/lodash-es/_getTag.js");
  114113. /* harmony import */ var _isObjectLike_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isObjectLike.js */ "./node_modules/lodash-es/isObjectLike.js");
  114114. /** `Object#toString` result references. */
  114115. var weakMapTag = '[object WeakMap]';
  114116. /**
  114117. * Checks if `value` is classified as a `WeakMap` object.
  114118. *
  114119. * @static
  114120. * @memberOf _
  114121. * @since 4.3.0
  114122. * @category Lang
  114123. * @param {*} value The value to check.
  114124. * @returns {boolean} Returns `true` if `value` is a weak map, else `false`.
  114125. * @example
  114126. *
  114127. * _.isWeakMap(new WeakMap);
  114128. * // => true
  114129. *
  114130. * _.isWeakMap(new Map);
  114131. * // => false
  114132. */
  114133. function isWeakMap(value) {
  114134. return Object(_isObjectLike_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value) && Object(_getTag_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value) == weakMapTag;
  114135. }
  114136. /* harmony default export */ __webpack_exports__["default"] = (isWeakMap);
  114137. /***/ }),
  114138. /***/ "./node_modules/lodash-es/isWeakSet.js":
  114139. /*!*********************************************!*\
  114140. !*** ./node_modules/lodash-es/isWeakSet.js ***!
  114141. \*********************************************/
  114142. /*! exports provided: default */
  114143. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  114144. "use strict";
  114145. __webpack_require__.r(__webpack_exports__);
  114146. /* harmony import */ var _baseGetTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseGetTag.js */ "./node_modules/lodash-es/_baseGetTag.js");
  114147. /* harmony import */ var _isObjectLike_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isObjectLike.js */ "./node_modules/lodash-es/isObjectLike.js");
  114148. /** `Object#toString` result references. */
  114149. var weakSetTag = '[object WeakSet]';
  114150. /**
  114151. * Checks if `value` is classified as a `WeakSet` object.
  114152. *
  114153. * @static
  114154. * @memberOf _
  114155. * @since 4.3.0
  114156. * @category Lang
  114157. * @param {*} value The value to check.
  114158. * @returns {boolean} Returns `true` if `value` is a weak set, else `false`.
  114159. * @example
  114160. *
  114161. * _.isWeakSet(new WeakSet);
  114162. * // => true
  114163. *
  114164. * _.isWeakSet(new Set);
  114165. * // => false
  114166. */
  114167. function isWeakSet(value) {
  114168. return Object(_isObjectLike_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value) && Object(_baseGetTag_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value) == weakSetTag;
  114169. }
  114170. /* harmony default export */ __webpack_exports__["default"] = (isWeakSet);
  114171. /***/ }),
  114172. /***/ "./node_modules/lodash-es/iteratee.js":
  114173. /*!********************************************!*\
  114174. !*** ./node_modules/lodash-es/iteratee.js ***!
  114175. \********************************************/
  114176. /*! exports provided: default */
  114177. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  114178. "use strict";
  114179. __webpack_require__.r(__webpack_exports__);
  114180. /* harmony import */ var _baseClone_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseClone.js */ "./node_modules/lodash-es/_baseClone.js");
  114181. /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
  114182. /** Used to compose bitmasks for cloning. */
  114183. var CLONE_DEEP_FLAG = 1;
  114184. /**
  114185. * Creates a function that invokes `func` with the arguments of the created
  114186. * function. If `func` is a property name, the created function returns the
  114187. * property value for a given element. If `func` is an array or object, the
  114188. * created function returns `true` for elements that contain the equivalent
  114189. * source properties, otherwise it returns `false`.
  114190. *
  114191. * @static
  114192. * @since 4.0.0
  114193. * @memberOf _
  114194. * @category Util
  114195. * @param {*} [func=_.identity] The value to convert to a callback.
  114196. * @returns {Function} Returns the callback.
  114197. * @example
  114198. *
  114199. * var users = [
  114200. * { 'user': 'barney', 'age': 36, 'active': true },
  114201. * { 'user': 'fred', 'age': 40, 'active': false }
  114202. * ];
  114203. *
  114204. * // The `_.matches` iteratee shorthand.
  114205. * _.filter(users, _.iteratee({ 'user': 'barney', 'active': true }));
  114206. * // => [{ 'user': 'barney', 'age': 36, 'active': true }]
  114207. *
  114208. * // The `_.matchesProperty` iteratee shorthand.
  114209. * _.filter(users, _.iteratee(['user', 'fred']));
  114210. * // => [{ 'user': 'fred', 'age': 40 }]
  114211. *
  114212. * // The `_.property` iteratee shorthand.
  114213. * _.map(users, _.iteratee('user'));
  114214. * // => ['barney', 'fred']
  114215. *
  114216. * // Create custom iteratee shorthands.
  114217. * _.iteratee = _.wrap(_.iteratee, function(iteratee, func) {
  114218. * return !_.isRegExp(func) ? iteratee(func) : function(string) {
  114219. * return func.test(string);
  114220. * };
  114221. * });
  114222. *
  114223. * _.filter(['abc', 'def'], /ef/);
  114224. * // => ['def']
  114225. */
  114226. function iteratee(func) {
  114227. 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));
  114228. }
  114229. /* harmony default export */ __webpack_exports__["default"] = (iteratee);
  114230. /***/ }),
  114231. /***/ "./node_modules/lodash-es/join.js":
  114232. /*!****************************************!*\
  114233. !*** ./node_modules/lodash-es/join.js ***!
  114234. \****************************************/
  114235. /*! exports provided: default */
  114236. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  114237. "use strict";
  114238. __webpack_require__.r(__webpack_exports__);
  114239. /** Used for built-in method references. */
  114240. var arrayProto = Array.prototype;
  114241. /* Built-in method references for those with the same name as other `lodash` methods. */
  114242. var nativeJoin = arrayProto.join;
  114243. /**
  114244. * Converts all elements in `array` into a string separated by `separator`.
  114245. *
  114246. * @static
  114247. * @memberOf _
  114248. * @since 4.0.0
  114249. * @category Array
  114250. * @param {Array} array The array to convert.
  114251. * @param {string} [separator=','] The element separator.
  114252. * @returns {string} Returns the joined string.
  114253. * @example
  114254. *
  114255. * _.join(['a', 'b', 'c'], '~');
  114256. * // => 'a~b~c'
  114257. */
  114258. function join(array, separator) {
  114259. return array == null ? '' : nativeJoin.call(array, separator);
  114260. }
  114261. /* harmony default export */ __webpack_exports__["default"] = (join);
  114262. /***/ }),
  114263. /***/ "./node_modules/lodash-es/kebabCase.js":
  114264. /*!*********************************************!*\
  114265. !*** ./node_modules/lodash-es/kebabCase.js ***!
  114266. \*********************************************/
  114267. /*! exports provided: default */
  114268. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  114269. "use strict";
  114270. __webpack_require__.r(__webpack_exports__);
  114271. /* harmony import */ var _createCompounder_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createCompounder.js */ "./node_modules/lodash-es/_createCompounder.js");
  114272. /**
  114273. * Converts `string` to
  114274. * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles).
  114275. *
  114276. * @static
  114277. * @memberOf _
  114278. * @since 3.0.0
  114279. * @category String
  114280. * @param {string} [string=''] The string to convert.
  114281. * @returns {string} Returns the kebab cased string.
  114282. * @example
  114283. *
  114284. * _.kebabCase('Foo Bar');
  114285. * // => 'foo-bar'
  114286. *
  114287. * _.kebabCase('fooBar');
  114288. * // => 'foo-bar'
  114289. *
  114290. * _.kebabCase('__FOO_BAR__');
  114291. * // => 'foo-bar'
  114292. */
  114293. var kebabCase = Object(_createCompounder_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function(result, word, index) {
  114294. return result + (index ? '-' : '') + word.toLowerCase();
  114295. });
  114296. /* harmony default export */ __webpack_exports__["default"] = (kebabCase);
  114297. /***/ }),
  114298. /***/ "./node_modules/lodash-es/keyBy.js":
  114299. /*!*****************************************!*\
  114300. !*** ./node_modules/lodash-es/keyBy.js ***!
  114301. \*****************************************/
  114302. /*! exports provided: default */
  114303. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  114304. "use strict";
  114305. __webpack_require__.r(__webpack_exports__);
  114306. /* harmony import */ var _baseAssignValue_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseAssignValue.js */ "./node_modules/lodash-es/_baseAssignValue.js");
  114307. /* harmony import */ var _createAggregator_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_createAggregator.js */ "./node_modules/lodash-es/_createAggregator.js");
  114308. /**
  114309. * Creates an object composed of keys generated from the results of running
  114310. * each element of `collection` thru `iteratee`. The corresponding value of
  114311. * each key is the last element responsible for generating the key. The
  114312. * iteratee is invoked with one argument: (value).
  114313. *
  114314. * @static
  114315. * @memberOf _
  114316. * @since 4.0.0
  114317. * @category Collection
  114318. * @param {Array|Object} collection The collection to iterate over.
  114319. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  114320. * @returns {Object} Returns the composed aggregate object.
  114321. * @example
  114322. *
  114323. * var array = [
  114324. * { 'dir': 'left', 'code': 97 },
  114325. * { 'dir': 'right', 'code': 100 }
  114326. * ];
  114327. *
  114328. * _.keyBy(array, function(o) {
  114329. * return String.fromCharCode(o.code);
  114330. * });
  114331. * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }
  114332. *
  114333. * _.keyBy(array, 'dir');
  114334. * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } }
  114335. */
  114336. var keyBy = Object(_createAggregator_js__WEBPACK_IMPORTED_MODULE_1__["default"])(function(result, value, key) {
  114337. Object(_baseAssignValue_js__WEBPACK_IMPORTED_MODULE_0__["default"])(result, key, value);
  114338. });
  114339. /* harmony default export */ __webpack_exports__["default"] = (keyBy);
  114340. /***/ }),
  114341. /***/ "./node_modules/lodash-es/keys.js":
  114342. /*!****************************************!*\
  114343. !*** ./node_modules/lodash-es/keys.js ***!
  114344. \****************************************/
  114345. /*! exports provided: default */
  114346. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  114347. "use strict";
  114348. __webpack_require__.r(__webpack_exports__);
  114349. /* harmony import */ var _arrayLikeKeys_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayLikeKeys.js */ "./node_modules/lodash-es/_arrayLikeKeys.js");
  114350. /* harmony import */ var _baseKeys_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseKeys.js */ "./node_modules/lodash-es/_baseKeys.js");
  114351. /* harmony import */ var _isArrayLike_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./isArrayLike.js */ "./node_modules/lodash-es/isArrayLike.js");
  114352. /**
  114353. * Creates an array of the own enumerable property names of `object`.
  114354. *
  114355. * **Note:** Non-object values are coerced to objects. See the
  114356. * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  114357. * for more details.
  114358. *
  114359. * @static
  114360. * @since 0.1.0
  114361. * @memberOf _
  114362. * @category Object
  114363. * @param {Object} object The object to query.
  114364. * @returns {Array} Returns the array of property names.
  114365. * @example
  114366. *
  114367. * function Foo() {
  114368. * this.a = 1;
  114369. * this.b = 2;
  114370. * }
  114371. *
  114372. * Foo.prototype.c = 3;
  114373. *
  114374. * _.keys(new Foo);
  114375. * // => ['a', 'b'] (iteration order is not guaranteed)
  114376. *
  114377. * _.keys('hi');
  114378. * // => ['0', '1']
  114379. */
  114380. function keys(object) {
  114381. 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);
  114382. }
  114383. /* harmony default export */ __webpack_exports__["default"] = (keys);
  114384. /***/ }),
  114385. /***/ "./node_modules/lodash-es/keysIn.js":
  114386. /*!******************************************!*\
  114387. !*** ./node_modules/lodash-es/keysIn.js ***!
  114388. \******************************************/
  114389. /*! exports provided: default */
  114390. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  114391. "use strict";
  114392. __webpack_require__.r(__webpack_exports__);
  114393. /* harmony import */ var _arrayLikeKeys_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayLikeKeys.js */ "./node_modules/lodash-es/_arrayLikeKeys.js");
  114394. /* harmony import */ var _baseKeysIn_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseKeysIn.js */ "./node_modules/lodash-es/_baseKeysIn.js");
  114395. /* harmony import */ var _isArrayLike_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./isArrayLike.js */ "./node_modules/lodash-es/isArrayLike.js");
  114396. /**
  114397. * Creates an array of the own and inherited enumerable property names of `object`.
  114398. *
  114399. * **Note:** Non-object values are coerced to objects.
  114400. *
  114401. * @static
  114402. * @memberOf _
  114403. * @since 3.0.0
  114404. * @category Object
  114405. * @param {Object} object The object to query.
  114406. * @returns {Array} Returns the array of property names.
  114407. * @example
  114408. *
  114409. * function Foo() {
  114410. * this.a = 1;
  114411. * this.b = 2;
  114412. * }
  114413. *
  114414. * Foo.prototype.c = 3;
  114415. *
  114416. * _.keysIn(new Foo);
  114417. * // => ['a', 'b', 'c'] (iteration order is not guaranteed)
  114418. */
  114419. function keysIn(object) {
  114420. 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);
  114421. }
  114422. /* harmony default export */ __webpack_exports__["default"] = (keysIn);
  114423. /***/ }),
  114424. /***/ "./node_modules/lodash-es/lang.default.js":
  114425. /*!************************************************!*\
  114426. !*** ./node_modules/lodash-es/lang.default.js ***!
  114427. \************************************************/
  114428. /*! exports provided: default */
  114429. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  114430. "use strict";
  114431. __webpack_require__.r(__webpack_exports__);
  114432. /* harmony import */ var _castArray_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./castArray.js */ "./node_modules/lodash-es/castArray.js");
  114433. /* harmony import */ var _clone_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./clone.js */ "./node_modules/lodash-es/clone.js");
  114434. /* harmony import */ var _cloneDeep_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./cloneDeep.js */ "./node_modules/lodash-es/cloneDeep.js");
  114435. /* harmony import */ var _cloneDeepWith_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./cloneDeepWith.js */ "./node_modules/lodash-es/cloneDeepWith.js");
  114436. /* harmony import */ var _cloneWith_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./cloneWith.js */ "./node_modules/lodash-es/cloneWith.js");
  114437. /* harmony import */ var _conformsTo_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./conformsTo.js */ "./node_modules/lodash-es/conformsTo.js");
  114438. /* harmony import */ var _eq_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./eq.js */ "./node_modules/lodash-es/eq.js");
  114439. /* harmony import */ var _gt_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./gt.js */ "./node_modules/lodash-es/gt.js");
  114440. /* harmony import */ var _gte_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./gte.js */ "./node_modules/lodash-es/gte.js");
  114441. /* harmony import */ var _isArguments_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./isArguments.js */ "./node_modules/lodash-es/isArguments.js");
  114442. /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
  114443. /* harmony import */ var _isArrayBuffer_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./isArrayBuffer.js */ "./node_modules/lodash-es/isArrayBuffer.js");
  114444. /* harmony import */ var _isArrayLike_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./isArrayLike.js */ "./node_modules/lodash-es/isArrayLike.js");
  114445. /* harmony import */ var _isArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./isArrayLikeObject.js */ "./node_modules/lodash-es/isArrayLikeObject.js");
  114446. /* harmony import */ var _isBoolean_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./isBoolean.js */ "./node_modules/lodash-es/isBoolean.js");
  114447. /* harmony import */ var _isBuffer_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./isBuffer.js */ "./node_modules/lodash-es/isBuffer.js");
  114448. /* harmony import */ var _isDate_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./isDate.js */ "./node_modules/lodash-es/isDate.js");
  114449. /* harmony import */ var _isElement_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./isElement.js */ "./node_modules/lodash-es/isElement.js");
  114450. /* harmony import */ var _isEmpty_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./isEmpty.js */ "./node_modules/lodash-es/isEmpty.js");
  114451. /* harmony import */ var _isEqual_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./isEqual.js */ "./node_modules/lodash-es/isEqual.js");
  114452. /* harmony import */ var _isEqualWith_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./isEqualWith.js */ "./node_modules/lodash-es/isEqualWith.js");
  114453. /* harmony import */ var _isError_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./isError.js */ "./node_modules/lodash-es/isError.js");
  114454. /* harmony import */ var _isFinite_js__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./isFinite.js */ "./node_modules/lodash-es/isFinite.js");
  114455. /* harmony import */ var _isFunction_js__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./isFunction.js */ "./node_modules/lodash-es/isFunction.js");
  114456. /* harmony import */ var _isInteger_js__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./isInteger.js */ "./node_modules/lodash-es/isInteger.js");
  114457. /* harmony import */ var _isLength_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./isLength.js */ "./node_modules/lodash-es/isLength.js");
  114458. /* harmony import */ var _isMap_js__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./isMap.js */ "./node_modules/lodash-es/isMap.js");
  114459. /* harmony import */ var _isMatch_js__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./isMatch.js */ "./node_modules/lodash-es/isMatch.js");
  114460. /* harmony import */ var _isMatchWith_js__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./isMatchWith.js */ "./node_modules/lodash-es/isMatchWith.js");
  114461. /* harmony import */ var _isNaN_js__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./isNaN.js */ "./node_modules/lodash-es/isNaN.js");
  114462. /* harmony import */ var _isNative_js__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./isNative.js */ "./node_modules/lodash-es/isNative.js");
  114463. /* harmony import */ var _isNil_js__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ./isNil.js */ "./node_modules/lodash-es/isNil.js");
  114464. /* harmony import */ var _isNull_js__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ./isNull.js */ "./node_modules/lodash-es/isNull.js");
  114465. /* harmony import */ var _isNumber_js__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ./isNumber.js */ "./node_modules/lodash-es/isNumber.js");
  114466. /* harmony import */ var _isObject_js__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ./isObject.js */ "./node_modules/lodash-es/isObject.js");
  114467. /* harmony import */ var _isObjectLike_js__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ./isObjectLike.js */ "./node_modules/lodash-es/isObjectLike.js");
  114468. /* harmony import */ var _isPlainObject_js__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! ./isPlainObject.js */ "./node_modules/lodash-es/isPlainObject.js");
  114469. /* harmony import */ var _isRegExp_js__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(/*! ./isRegExp.js */ "./node_modules/lodash-es/isRegExp.js");
  114470. /* harmony import */ var _isSafeInteger_js__WEBPACK_IMPORTED_MODULE_38__ = __webpack_require__(/*! ./isSafeInteger.js */ "./node_modules/lodash-es/isSafeInteger.js");
  114471. /* harmony import */ var _isSet_js__WEBPACK_IMPORTED_MODULE_39__ = __webpack_require__(/*! ./isSet.js */ "./node_modules/lodash-es/isSet.js");
  114472. /* harmony import */ var _isString_js__WEBPACK_IMPORTED_MODULE_40__ = __webpack_require__(/*! ./isString.js */ "./node_modules/lodash-es/isString.js");
  114473. /* harmony import */ var _isSymbol_js__WEBPACK_IMPORTED_MODULE_41__ = __webpack_require__(/*! ./isSymbol.js */ "./node_modules/lodash-es/isSymbol.js");
  114474. /* harmony import */ var _isTypedArray_js__WEBPACK_IMPORTED_MODULE_42__ = __webpack_require__(/*! ./isTypedArray.js */ "./node_modules/lodash-es/isTypedArray.js");
  114475. /* harmony import */ var _isUndefined_js__WEBPACK_IMPORTED_MODULE_43__ = __webpack_require__(/*! ./isUndefined.js */ "./node_modules/lodash-es/isUndefined.js");
  114476. /* harmony import */ var _isWeakMap_js__WEBPACK_IMPORTED_MODULE_44__ = __webpack_require__(/*! ./isWeakMap.js */ "./node_modules/lodash-es/isWeakMap.js");
  114477. /* harmony import */ var _isWeakSet_js__WEBPACK_IMPORTED_MODULE_45__ = __webpack_require__(/*! ./isWeakSet.js */ "./node_modules/lodash-es/isWeakSet.js");
  114478. /* harmony import */ var _lt_js__WEBPACK_IMPORTED_MODULE_46__ = __webpack_require__(/*! ./lt.js */ "./node_modules/lodash-es/lt.js");
  114479. /* harmony import */ var _lte_js__WEBPACK_IMPORTED_MODULE_47__ = __webpack_require__(/*! ./lte.js */ "./node_modules/lodash-es/lte.js");
  114480. /* harmony import */ var _toArray_js__WEBPACK_IMPORTED_MODULE_48__ = __webpack_require__(/*! ./toArray.js */ "./node_modules/lodash-es/toArray.js");
  114481. /* harmony import */ var _toFinite_js__WEBPACK_IMPORTED_MODULE_49__ = __webpack_require__(/*! ./toFinite.js */ "./node_modules/lodash-es/toFinite.js");
  114482. /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_50__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
  114483. /* harmony import */ var _toLength_js__WEBPACK_IMPORTED_MODULE_51__ = __webpack_require__(/*! ./toLength.js */ "./node_modules/lodash-es/toLength.js");
  114484. /* harmony import */ var _toNumber_js__WEBPACK_IMPORTED_MODULE_52__ = __webpack_require__(/*! ./toNumber.js */ "./node_modules/lodash-es/toNumber.js");
  114485. /* harmony import */ var _toPlainObject_js__WEBPACK_IMPORTED_MODULE_53__ = __webpack_require__(/*! ./toPlainObject.js */ "./node_modules/lodash-es/toPlainObject.js");
  114486. /* harmony import */ var _toSafeInteger_js__WEBPACK_IMPORTED_MODULE_54__ = __webpack_require__(/*! ./toSafeInteger.js */ "./node_modules/lodash-es/toSafeInteger.js");
  114487. /* harmony import */ var _toString_js__WEBPACK_IMPORTED_MODULE_55__ = __webpack_require__(/*! ./toString.js */ "./node_modules/lodash-es/toString.js");
  114488. /* harmony default export */ __webpack_exports__["default"] = ({
  114489. 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"],
  114490. 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"],
  114491. 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"],
  114492. 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"],
  114493. 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"],
  114494. 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"],
  114495. 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"],
  114496. 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"],
  114497. 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"],
  114498. 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"],
  114499. 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"],
  114500. toString: _toString_js__WEBPACK_IMPORTED_MODULE_55__["default"]
  114501. });
  114502. /***/ }),
  114503. /***/ "./node_modules/lodash-es/lang.js":
  114504. /*!****************************************!*\
  114505. !*** ./node_modules/lodash-es/lang.js ***!
  114506. \****************************************/
  114507. /*! 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 */
  114508. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  114509. "use strict";
  114510. __webpack_require__.r(__webpack_exports__);
  114511. /* harmony import */ var _castArray_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./castArray.js */ "./node_modules/lodash-es/castArray.js");
  114512. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "castArray", function() { return _castArray_js__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  114513. /* harmony import */ var _clone_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./clone.js */ "./node_modules/lodash-es/clone.js");
  114514. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "clone", function() { return _clone_js__WEBPACK_IMPORTED_MODULE_1__["default"]; });
  114515. /* harmony import */ var _cloneDeep_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./cloneDeep.js */ "./node_modules/lodash-es/cloneDeep.js");
  114516. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "cloneDeep", function() { return _cloneDeep_js__WEBPACK_IMPORTED_MODULE_2__["default"]; });
  114517. /* harmony import */ var _cloneDeepWith_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./cloneDeepWith.js */ "./node_modules/lodash-es/cloneDeepWith.js");
  114518. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "cloneDeepWith", function() { return _cloneDeepWith_js__WEBPACK_IMPORTED_MODULE_3__["default"]; });
  114519. /* harmony import */ var _cloneWith_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./cloneWith.js */ "./node_modules/lodash-es/cloneWith.js");
  114520. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "cloneWith", function() { return _cloneWith_js__WEBPACK_IMPORTED_MODULE_4__["default"]; });
  114521. /* harmony import */ var _conformsTo_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./conformsTo.js */ "./node_modules/lodash-es/conformsTo.js");
  114522. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "conformsTo", function() { return _conformsTo_js__WEBPACK_IMPORTED_MODULE_5__["default"]; });
  114523. /* harmony import */ var _eq_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./eq.js */ "./node_modules/lodash-es/eq.js");
  114524. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "eq", function() { return _eq_js__WEBPACK_IMPORTED_MODULE_6__["default"]; });
  114525. /* harmony import */ var _gt_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./gt.js */ "./node_modules/lodash-es/gt.js");
  114526. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "gt", function() { return _gt_js__WEBPACK_IMPORTED_MODULE_7__["default"]; });
  114527. /* harmony import */ var _gte_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./gte.js */ "./node_modules/lodash-es/gte.js");
  114528. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "gte", function() { return _gte_js__WEBPACK_IMPORTED_MODULE_8__["default"]; });
  114529. /* harmony import */ var _isArguments_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./isArguments.js */ "./node_modules/lodash-es/isArguments.js");
  114530. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isArguments", function() { return _isArguments_js__WEBPACK_IMPORTED_MODULE_9__["default"]; });
  114531. /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
  114532. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isArray", function() { return _isArray_js__WEBPACK_IMPORTED_MODULE_10__["default"]; });
  114533. /* harmony import */ var _isArrayBuffer_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./isArrayBuffer.js */ "./node_modules/lodash-es/isArrayBuffer.js");
  114534. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isArrayBuffer", function() { return _isArrayBuffer_js__WEBPACK_IMPORTED_MODULE_11__["default"]; });
  114535. /* harmony import */ var _isArrayLike_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./isArrayLike.js */ "./node_modules/lodash-es/isArrayLike.js");
  114536. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isArrayLike", function() { return _isArrayLike_js__WEBPACK_IMPORTED_MODULE_12__["default"]; });
  114537. /* harmony import */ var _isArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./isArrayLikeObject.js */ "./node_modules/lodash-es/isArrayLikeObject.js");
  114538. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isArrayLikeObject", function() { return _isArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_13__["default"]; });
  114539. /* harmony import */ var _isBoolean_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./isBoolean.js */ "./node_modules/lodash-es/isBoolean.js");
  114540. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isBoolean", function() { return _isBoolean_js__WEBPACK_IMPORTED_MODULE_14__["default"]; });
  114541. /* harmony import */ var _isBuffer_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./isBuffer.js */ "./node_modules/lodash-es/isBuffer.js");
  114542. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isBuffer", function() { return _isBuffer_js__WEBPACK_IMPORTED_MODULE_15__["default"]; });
  114543. /* harmony import */ var _isDate_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./isDate.js */ "./node_modules/lodash-es/isDate.js");
  114544. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isDate", function() { return _isDate_js__WEBPACK_IMPORTED_MODULE_16__["default"]; });
  114545. /* harmony import */ var _isElement_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./isElement.js */ "./node_modules/lodash-es/isElement.js");
  114546. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isElement", function() { return _isElement_js__WEBPACK_IMPORTED_MODULE_17__["default"]; });
  114547. /* harmony import */ var _isEmpty_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./isEmpty.js */ "./node_modules/lodash-es/isEmpty.js");
  114548. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isEmpty", function() { return _isEmpty_js__WEBPACK_IMPORTED_MODULE_18__["default"]; });
  114549. /* harmony import */ var _isEqual_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./isEqual.js */ "./node_modules/lodash-es/isEqual.js");
  114550. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isEqual", function() { return _isEqual_js__WEBPACK_IMPORTED_MODULE_19__["default"]; });
  114551. /* harmony import */ var _isEqualWith_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./isEqualWith.js */ "./node_modules/lodash-es/isEqualWith.js");
  114552. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isEqualWith", function() { return _isEqualWith_js__WEBPACK_IMPORTED_MODULE_20__["default"]; });
  114553. /* harmony import */ var _isError_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./isError.js */ "./node_modules/lodash-es/isError.js");
  114554. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isError", function() { return _isError_js__WEBPACK_IMPORTED_MODULE_21__["default"]; });
  114555. /* harmony import */ var _isFinite_js__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./isFinite.js */ "./node_modules/lodash-es/isFinite.js");
  114556. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isFinite", function() { return _isFinite_js__WEBPACK_IMPORTED_MODULE_22__["default"]; });
  114557. /* harmony import */ var _isFunction_js__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./isFunction.js */ "./node_modules/lodash-es/isFunction.js");
  114558. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isFunction", function() { return _isFunction_js__WEBPACK_IMPORTED_MODULE_23__["default"]; });
  114559. /* harmony import */ var _isInteger_js__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./isInteger.js */ "./node_modules/lodash-es/isInteger.js");
  114560. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isInteger", function() { return _isInteger_js__WEBPACK_IMPORTED_MODULE_24__["default"]; });
  114561. /* harmony import */ var _isLength_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./isLength.js */ "./node_modules/lodash-es/isLength.js");
  114562. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isLength", function() { return _isLength_js__WEBPACK_IMPORTED_MODULE_25__["default"]; });
  114563. /* harmony import */ var _isMap_js__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./isMap.js */ "./node_modules/lodash-es/isMap.js");
  114564. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isMap", function() { return _isMap_js__WEBPACK_IMPORTED_MODULE_26__["default"]; });
  114565. /* harmony import */ var _isMatch_js__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./isMatch.js */ "./node_modules/lodash-es/isMatch.js");
  114566. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isMatch", function() { return _isMatch_js__WEBPACK_IMPORTED_MODULE_27__["default"]; });
  114567. /* harmony import */ var _isMatchWith_js__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./isMatchWith.js */ "./node_modules/lodash-es/isMatchWith.js");
  114568. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isMatchWith", function() { return _isMatchWith_js__WEBPACK_IMPORTED_MODULE_28__["default"]; });
  114569. /* harmony import */ var _isNaN_js__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./isNaN.js */ "./node_modules/lodash-es/isNaN.js");
  114570. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isNaN", function() { return _isNaN_js__WEBPACK_IMPORTED_MODULE_29__["default"]; });
  114571. /* harmony import */ var _isNative_js__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./isNative.js */ "./node_modules/lodash-es/isNative.js");
  114572. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isNative", function() { return _isNative_js__WEBPACK_IMPORTED_MODULE_30__["default"]; });
  114573. /* harmony import */ var _isNil_js__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ./isNil.js */ "./node_modules/lodash-es/isNil.js");
  114574. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isNil", function() { return _isNil_js__WEBPACK_IMPORTED_MODULE_31__["default"]; });
  114575. /* harmony import */ var _isNull_js__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ./isNull.js */ "./node_modules/lodash-es/isNull.js");
  114576. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isNull", function() { return _isNull_js__WEBPACK_IMPORTED_MODULE_32__["default"]; });
  114577. /* harmony import */ var _isNumber_js__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ./isNumber.js */ "./node_modules/lodash-es/isNumber.js");
  114578. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isNumber", function() { return _isNumber_js__WEBPACK_IMPORTED_MODULE_33__["default"]; });
  114579. /* harmony import */ var _isObject_js__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ./isObject.js */ "./node_modules/lodash-es/isObject.js");
  114580. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isObject", function() { return _isObject_js__WEBPACK_IMPORTED_MODULE_34__["default"]; });
  114581. /* harmony import */ var _isObjectLike_js__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ./isObjectLike.js */ "./node_modules/lodash-es/isObjectLike.js");
  114582. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isObjectLike", function() { return _isObjectLike_js__WEBPACK_IMPORTED_MODULE_35__["default"]; });
  114583. /* harmony import */ var _isPlainObject_js__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! ./isPlainObject.js */ "./node_modules/lodash-es/isPlainObject.js");
  114584. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isPlainObject", function() { return _isPlainObject_js__WEBPACK_IMPORTED_MODULE_36__["default"]; });
  114585. /* harmony import */ var _isRegExp_js__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(/*! ./isRegExp.js */ "./node_modules/lodash-es/isRegExp.js");
  114586. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isRegExp", function() { return _isRegExp_js__WEBPACK_IMPORTED_MODULE_37__["default"]; });
  114587. /* harmony import */ var _isSafeInteger_js__WEBPACK_IMPORTED_MODULE_38__ = __webpack_require__(/*! ./isSafeInteger.js */ "./node_modules/lodash-es/isSafeInteger.js");
  114588. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isSafeInteger", function() { return _isSafeInteger_js__WEBPACK_IMPORTED_MODULE_38__["default"]; });
  114589. /* harmony import */ var _isSet_js__WEBPACK_IMPORTED_MODULE_39__ = __webpack_require__(/*! ./isSet.js */ "./node_modules/lodash-es/isSet.js");
  114590. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isSet", function() { return _isSet_js__WEBPACK_IMPORTED_MODULE_39__["default"]; });
  114591. /* harmony import */ var _isString_js__WEBPACK_IMPORTED_MODULE_40__ = __webpack_require__(/*! ./isString.js */ "./node_modules/lodash-es/isString.js");
  114592. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isString", function() { return _isString_js__WEBPACK_IMPORTED_MODULE_40__["default"]; });
  114593. /* harmony import */ var _isSymbol_js__WEBPACK_IMPORTED_MODULE_41__ = __webpack_require__(/*! ./isSymbol.js */ "./node_modules/lodash-es/isSymbol.js");
  114594. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isSymbol", function() { return _isSymbol_js__WEBPACK_IMPORTED_MODULE_41__["default"]; });
  114595. /* harmony import */ var _isTypedArray_js__WEBPACK_IMPORTED_MODULE_42__ = __webpack_require__(/*! ./isTypedArray.js */ "./node_modules/lodash-es/isTypedArray.js");
  114596. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isTypedArray", function() { return _isTypedArray_js__WEBPACK_IMPORTED_MODULE_42__["default"]; });
  114597. /* harmony import */ var _isUndefined_js__WEBPACK_IMPORTED_MODULE_43__ = __webpack_require__(/*! ./isUndefined.js */ "./node_modules/lodash-es/isUndefined.js");
  114598. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isUndefined", function() { return _isUndefined_js__WEBPACK_IMPORTED_MODULE_43__["default"]; });
  114599. /* harmony import */ var _isWeakMap_js__WEBPACK_IMPORTED_MODULE_44__ = __webpack_require__(/*! ./isWeakMap.js */ "./node_modules/lodash-es/isWeakMap.js");
  114600. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isWeakMap", function() { return _isWeakMap_js__WEBPACK_IMPORTED_MODULE_44__["default"]; });
  114601. /* harmony import */ var _isWeakSet_js__WEBPACK_IMPORTED_MODULE_45__ = __webpack_require__(/*! ./isWeakSet.js */ "./node_modules/lodash-es/isWeakSet.js");
  114602. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isWeakSet", function() { return _isWeakSet_js__WEBPACK_IMPORTED_MODULE_45__["default"]; });
  114603. /* harmony import */ var _lt_js__WEBPACK_IMPORTED_MODULE_46__ = __webpack_require__(/*! ./lt.js */ "./node_modules/lodash-es/lt.js");
  114604. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "lt", function() { return _lt_js__WEBPACK_IMPORTED_MODULE_46__["default"]; });
  114605. /* harmony import */ var _lte_js__WEBPACK_IMPORTED_MODULE_47__ = __webpack_require__(/*! ./lte.js */ "./node_modules/lodash-es/lte.js");
  114606. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "lte", function() { return _lte_js__WEBPACK_IMPORTED_MODULE_47__["default"]; });
  114607. /* harmony import */ var _toArray_js__WEBPACK_IMPORTED_MODULE_48__ = __webpack_require__(/*! ./toArray.js */ "./node_modules/lodash-es/toArray.js");
  114608. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toArray", function() { return _toArray_js__WEBPACK_IMPORTED_MODULE_48__["default"]; });
  114609. /* harmony import */ var _toFinite_js__WEBPACK_IMPORTED_MODULE_49__ = __webpack_require__(/*! ./toFinite.js */ "./node_modules/lodash-es/toFinite.js");
  114610. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toFinite", function() { return _toFinite_js__WEBPACK_IMPORTED_MODULE_49__["default"]; });
  114611. /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_50__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
  114612. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toInteger", function() { return _toInteger_js__WEBPACK_IMPORTED_MODULE_50__["default"]; });
  114613. /* harmony import */ var _toLength_js__WEBPACK_IMPORTED_MODULE_51__ = __webpack_require__(/*! ./toLength.js */ "./node_modules/lodash-es/toLength.js");
  114614. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toLength", function() { return _toLength_js__WEBPACK_IMPORTED_MODULE_51__["default"]; });
  114615. /* harmony import */ var _toNumber_js__WEBPACK_IMPORTED_MODULE_52__ = __webpack_require__(/*! ./toNumber.js */ "./node_modules/lodash-es/toNumber.js");
  114616. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toNumber", function() { return _toNumber_js__WEBPACK_IMPORTED_MODULE_52__["default"]; });
  114617. /* harmony import */ var _toPlainObject_js__WEBPACK_IMPORTED_MODULE_53__ = __webpack_require__(/*! ./toPlainObject.js */ "./node_modules/lodash-es/toPlainObject.js");
  114618. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toPlainObject", function() { return _toPlainObject_js__WEBPACK_IMPORTED_MODULE_53__["default"]; });
  114619. /* harmony import */ var _toSafeInteger_js__WEBPACK_IMPORTED_MODULE_54__ = __webpack_require__(/*! ./toSafeInteger.js */ "./node_modules/lodash-es/toSafeInteger.js");
  114620. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toSafeInteger", function() { return _toSafeInteger_js__WEBPACK_IMPORTED_MODULE_54__["default"]; });
  114621. /* harmony import */ var _toString_js__WEBPACK_IMPORTED_MODULE_55__ = __webpack_require__(/*! ./toString.js */ "./node_modules/lodash-es/toString.js");
  114622. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toString", function() { return _toString_js__WEBPACK_IMPORTED_MODULE_55__["default"]; });
  114623. /* harmony import */ var _lang_default_js__WEBPACK_IMPORTED_MODULE_56__ = __webpack_require__(/*! ./lang.default.js */ "./node_modules/lodash-es/lang.default.js");
  114624. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _lang_default_js__WEBPACK_IMPORTED_MODULE_56__["default"]; });
  114625. /***/ }),
  114626. /***/ "./node_modules/lodash-es/last.js":
  114627. /*!****************************************!*\
  114628. !*** ./node_modules/lodash-es/last.js ***!
  114629. \****************************************/
  114630. /*! exports provided: default */
  114631. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  114632. "use strict";
  114633. __webpack_require__.r(__webpack_exports__);
  114634. /**
  114635. * Gets the last element of `array`.
  114636. *
  114637. * @static
  114638. * @memberOf _
  114639. * @since 0.1.0
  114640. * @category Array
  114641. * @param {Array} array The array to query.
  114642. * @returns {*} Returns the last element of `array`.
  114643. * @example
  114644. *
  114645. * _.last([1, 2, 3]);
  114646. * // => 3
  114647. */
  114648. function last(array) {
  114649. var length = array == null ? 0 : array.length;
  114650. return length ? array[length - 1] : undefined;
  114651. }
  114652. /* harmony default export */ __webpack_exports__["default"] = (last);
  114653. /***/ }),
  114654. /***/ "./node_modules/lodash-es/lastIndexOf.js":
  114655. /*!***********************************************!*\
  114656. !*** ./node_modules/lodash-es/lastIndexOf.js ***!
  114657. \***********************************************/
  114658. /*! exports provided: default */
  114659. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  114660. "use strict";
  114661. __webpack_require__.r(__webpack_exports__);
  114662. /* harmony import */ var _baseFindIndex_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseFindIndex.js */ "./node_modules/lodash-es/_baseFindIndex.js");
  114663. /* harmony import */ var _baseIsNaN_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseIsNaN.js */ "./node_modules/lodash-es/_baseIsNaN.js");
  114664. /* harmony import */ var _strictLastIndexOf_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_strictLastIndexOf.js */ "./node_modules/lodash-es/_strictLastIndexOf.js");
  114665. /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
  114666. /* Built-in method references for those with the same name as other `lodash` methods. */
  114667. var nativeMax = Math.max,
  114668. nativeMin = Math.min;
  114669. /**
  114670. * This method is like `_.indexOf` except that it iterates over elements of
  114671. * `array` from right to left.
  114672. *
  114673. * @static
  114674. * @memberOf _
  114675. * @since 0.1.0
  114676. * @category Array
  114677. * @param {Array} array The array to inspect.
  114678. * @param {*} value The value to search for.
  114679. * @param {number} [fromIndex=array.length-1] The index to search from.
  114680. * @returns {number} Returns the index of the matched value, else `-1`.
  114681. * @example
  114682. *
  114683. * _.lastIndexOf([1, 2, 1, 2], 2);
  114684. * // => 3
  114685. *
  114686. * // Search from the `fromIndex`.
  114687. * _.lastIndexOf([1, 2, 1, 2], 2, 2);
  114688. * // => 1
  114689. */
  114690. function lastIndexOf(array, value, fromIndex) {
  114691. var length = array == null ? 0 : array.length;
  114692. if (!length) {
  114693. return -1;
  114694. }
  114695. var index = length;
  114696. if (fromIndex !== undefined) {
  114697. index = Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_3__["default"])(fromIndex);
  114698. index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1);
  114699. }
  114700. return value === value
  114701. ? Object(_strictLastIndexOf_js__WEBPACK_IMPORTED_MODULE_2__["default"])(array, value, index)
  114702. : Object(_baseFindIndex_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, _baseIsNaN_js__WEBPACK_IMPORTED_MODULE_1__["default"], index, true);
  114703. }
  114704. /* harmony default export */ __webpack_exports__["default"] = (lastIndexOf);
  114705. /***/ }),
  114706. /***/ "./node_modules/lodash-es/lodash.default.js":
  114707. /*!**************************************************!*\
  114708. !*** ./node_modules/lodash-es/lodash.default.js ***!
  114709. \**************************************************/
  114710. /*! exports provided: default */
  114711. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  114712. "use strict";
  114713. __webpack_require__.r(__webpack_exports__);
  114714. /* harmony import */ var _array_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./array.js */ "./node_modules/lodash-es/array.js");
  114715. /* harmony import */ var _collection_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./collection.js */ "./node_modules/lodash-es/collection.js");
  114716. /* harmony import */ var _date_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./date.js */ "./node_modules/lodash-es/date.js");
  114717. /* harmony import */ var _function_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./function.js */ "./node_modules/lodash-es/function.js");
  114718. /* harmony import */ var _lang_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./lang.js */ "./node_modules/lodash-es/lang.js");
  114719. /* harmony import */ var _math_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./math.js */ "./node_modules/lodash-es/math.js");
  114720. /* harmony import */ var _number_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./number.js */ "./node_modules/lodash-es/number.js");
  114721. /* harmony import */ var _object_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./object.js */ "./node_modules/lodash-es/object.js");
  114722. /* harmony import */ var _seq_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./seq.js */ "./node_modules/lodash-es/seq.js");
  114723. /* harmony import */ var _string_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./string.js */ "./node_modules/lodash-es/string.js");
  114724. /* harmony import */ var _util_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./util.js */ "./node_modules/lodash-es/util.js");
  114725. /* harmony import */ var _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./_LazyWrapper.js */ "./node_modules/lodash-es/_LazyWrapper.js");
  114726. /* harmony import */ var _LodashWrapper_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./_LodashWrapper.js */ "./node_modules/lodash-es/_LodashWrapper.js");
  114727. /* harmony import */ var _Symbol_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./_Symbol.js */ "./node_modules/lodash-es/_Symbol.js");
  114728. /* harmony import */ var _arrayEach_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./_arrayEach.js */ "./node_modules/lodash-es/_arrayEach.js");
  114729. /* harmony import */ var _arrayPush_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./_arrayPush.js */ "./node_modules/lodash-es/_arrayPush.js");
  114730. /* harmony import */ var _baseForOwn_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./_baseForOwn.js */ "./node_modules/lodash-es/_baseForOwn.js");
  114731. /* harmony import */ var _baseFunctions_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./_baseFunctions.js */ "./node_modules/lodash-es/_baseFunctions.js");
  114732. /* harmony import */ var _baseInvoke_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./_baseInvoke.js */ "./node_modules/lodash-es/_baseInvoke.js");
  114733. /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
  114734. /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
  114735. /* harmony import */ var _createHybrid_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./_createHybrid.js */ "./node_modules/lodash-es/_createHybrid.js");
  114736. /* harmony import */ var _identity_js__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./identity.js */ "./node_modules/lodash-es/identity.js");
  114737. /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
  114738. /* harmony import */ var _isObject_js__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./isObject.js */ "./node_modules/lodash-es/isObject.js");
  114739. /* harmony import */ var _keys_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./keys.js */ "./node_modules/lodash-es/keys.js");
  114740. /* harmony import */ var _last_js__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./last.js */ "./node_modules/lodash-es/last.js");
  114741. /* harmony import */ var _lazyClone_js__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./_lazyClone.js */ "./node_modules/lodash-es/_lazyClone.js");
  114742. /* harmony import */ var _lazyReverse_js__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./_lazyReverse.js */ "./node_modules/lodash-es/_lazyReverse.js");
  114743. /* harmony import */ var _lazyValue_js__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./_lazyValue.js */ "./node_modules/lodash-es/_lazyValue.js");
  114744. /* harmony import */ var _mixin_js__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./mixin.js */ "./node_modules/lodash-es/mixin.js");
  114745. /* harmony import */ var _negate_js__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ./negate.js */ "./node_modules/lodash-es/negate.js");
  114746. /* harmony import */ var _realNames_js__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ./_realNames.js */ "./node_modules/lodash-es/_realNames.js");
  114747. /* harmony import */ var _thru_js__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ./thru.js */ "./node_modules/lodash-es/thru.js");
  114748. /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
  114749. /* harmony import */ var _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ./wrapperLodash.js */ "./node_modules/lodash-es/wrapperLodash.js");
  114750. /**
  114751. * @license
  114752. * Lodash (Custom Build) <https://lodash.com/>
  114753. * Build: `lodash modularize exports="es" -o ./`
  114754. * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
  114755. * Released under MIT license <https://lodash.com/license>
  114756. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  114757. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  114758. */
  114759. /** Used as the semantic version number. */
  114760. var VERSION = '4.17.21';
  114761. /** Used to compose bitmasks for function metadata. */
  114762. var WRAP_BIND_KEY_FLAG = 2;
  114763. /** Used to indicate the type of lazy iteratees. */
  114764. var LAZY_FILTER_FLAG = 1,
  114765. LAZY_WHILE_FLAG = 3;
  114766. /** Used as references for the maximum length and index of an array. */
  114767. var MAX_ARRAY_LENGTH = 4294967295;
  114768. /** Used for built-in method references. */
  114769. var arrayProto = Array.prototype,
  114770. objectProto = Object.prototype;
  114771. /** Used to check objects for own properties. */
  114772. var hasOwnProperty = objectProto.hasOwnProperty;
  114773. /** Built-in value references. */
  114774. var symIterator = _Symbol_js__WEBPACK_IMPORTED_MODULE_13__["default"] ? _Symbol_js__WEBPACK_IMPORTED_MODULE_13__["default"].iterator : undefined;
  114775. /* Built-in method references for those with the same name as other `lodash` methods. */
  114776. var nativeMax = Math.max,
  114777. nativeMin = Math.min;
  114778. // wrap `_.mixin` so it works when provided only one argument
  114779. var mixin = (function(func) {
  114780. return function(object, source, options) {
  114781. if (options == null) {
  114782. var isObj = Object(_isObject_js__WEBPACK_IMPORTED_MODULE_24__["default"])(source),
  114783. props = isObj && Object(_keys_js__WEBPACK_IMPORTED_MODULE_25__["default"])(source),
  114784. methodNames = props && props.length && Object(_baseFunctions_js__WEBPACK_IMPORTED_MODULE_17__["default"])(source, props);
  114785. if (!(methodNames ? methodNames.length : isObj)) {
  114786. options = source;
  114787. source = object;
  114788. object = this;
  114789. }
  114790. }
  114791. return func(object, source, options);
  114792. };
  114793. }(_mixin_js__WEBPACK_IMPORTED_MODULE_30__["default"]));
  114794. // Add methods that return wrapped values in chain sequences.
  114795. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].after = _function_js__WEBPACK_IMPORTED_MODULE_3__["default"].after;
  114796. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].ary = _function_js__WEBPACK_IMPORTED_MODULE_3__["default"].ary;
  114797. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].assign = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].assign;
  114798. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].assignIn = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].assignIn;
  114799. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].assignInWith = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].assignInWith;
  114800. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].assignWith = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].assignWith;
  114801. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].at = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].at;
  114802. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].before = _function_js__WEBPACK_IMPORTED_MODULE_3__["default"].before;
  114803. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].bind = _function_js__WEBPACK_IMPORTED_MODULE_3__["default"].bind;
  114804. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].bindAll = _util_js__WEBPACK_IMPORTED_MODULE_10__["default"].bindAll;
  114805. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].bindKey = _function_js__WEBPACK_IMPORTED_MODULE_3__["default"].bindKey;
  114806. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].castArray = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].castArray;
  114807. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].chain = _seq_js__WEBPACK_IMPORTED_MODULE_8__["default"].chain;
  114808. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].chunk = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].chunk;
  114809. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].compact = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].compact;
  114810. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].concat = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].concat;
  114811. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].cond = _util_js__WEBPACK_IMPORTED_MODULE_10__["default"].cond;
  114812. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].conforms = _util_js__WEBPACK_IMPORTED_MODULE_10__["default"].conforms;
  114813. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].constant = _util_js__WEBPACK_IMPORTED_MODULE_10__["default"].constant;
  114814. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].countBy = _collection_js__WEBPACK_IMPORTED_MODULE_1__["default"].countBy;
  114815. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].create = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].create;
  114816. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].curry = _function_js__WEBPACK_IMPORTED_MODULE_3__["default"].curry;
  114817. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].curryRight = _function_js__WEBPACK_IMPORTED_MODULE_3__["default"].curryRight;
  114818. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].debounce = _function_js__WEBPACK_IMPORTED_MODULE_3__["default"].debounce;
  114819. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].defaults = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].defaults;
  114820. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].defaultsDeep = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].defaultsDeep;
  114821. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].defer = _function_js__WEBPACK_IMPORTED_MODULE_3__["default"].defer;
  114822. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].delay = _function_js__WEBPACK_IMPORTED_MODULE_3__["default"].delay;
  114823. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].difference = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].difference;
  114824. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].differenceBy = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].differenceBy;
  114825. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].differenceWith = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].differenceWith;
  114826. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].drop = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].drop;
  114827. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].dropRight = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].dropRight;
  114828. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].dropRightWhile = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].dropRightWhile;
  114829. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].dropWhile = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].dropWhile;
  114830. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].fill = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].fill;
  114831. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].filter = _collection_js__WEBPACK_IMPORTED_MODULE_1__["default"].filter;
  114832. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].flatMap = _collection_js__WEBPACK_IMPORTED_MODULE_1__["default"].flatMap;
  114833. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].flatMapDeep = _collection_js__WEBPACK_IMPORTED_MODULE_1__["default"].flatMapDeep;
  114834. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].flatMapDepth = _collection_js__WEBPACK_IMPORTED_MODULE_1__["default"].flatMapDepth;
  114835. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].flatten = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].flatten;
  114836. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].flattenDeep = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].flattenDeep;
  114837. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].flattenDepth = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].flattenDepth;
  114838. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].flip = _function_js__WEBPACK_IMPORTED_MODULE_3__["default"].flip;
  114839. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].flow = _util_js__WEBPACK_IMPORTED_MODULE_10__["default"].flow;
  114840. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].flowRight = _util_js__WEBPACK_IMPORTED_MODULE_10__["default"].flowRight;
  114841. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].fromPairs = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].fromPairs;
  114842. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].functions = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].functions;
  114843. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].functionsIn = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].functionsIn;
  114844. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].groupBy = _collection_js__WEBPACK_IMPORTED_MODULE_1__["default"].groupBy;
  114845. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].initial = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].initial;
  114846. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].intersection = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].intersection;
  114847. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].intersectionBy = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].intersectionBy;
  114848. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].intersectionWith = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].intersectionWith;
  114849. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].invert = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].invert;
  114850. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].invertBy = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].invertBy;
  114851. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].invokeMap = _collection_js__WEBPACK_IMPORTED_MODULE_1__["default"].invokeMap;
  114852. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].iteratee = _util_js__WEBPACK_IMPORTED_MODULE_10__["default"].iteratee;
  114853. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].keyBy = _collection_js__WEBPACK_IMPORTED_MODULE_1__["default"].keyBy;
  114854. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].keys = _keys_js__WEBPACK_IMPORTED_MODULE_25__["default"];
  114855. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].keysIn = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].keysIn;
  114856. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].map = _collection_js__WEBPACK_IMPORTED_MODULE_1__["default"].map;
  114857. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].mapKeys = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].mapKeys;
  114858. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].mapValues = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].mapValues;
  114859. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].matches = _util_js__WEBPACK_IMPORTED_MODULE_10__["default"].matches;
  114860. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].matchesProperty = _util_js__WEBPACK_IMPORTED_MODULE_10__["default"].matchesProperty;
  114861. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].memoize = _function_js__WEBPACK_IMPORTED_MODULE_3__["default"].memoize;
  114862. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].merge = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].merge;
  114863. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].mergeWith = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].mergeWith;
  114864. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].method = _util_js__WEBPACK_IMPORTED_MODULE_10__["default"].method;
  114865. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].methodOf = _util_js__WEBPACK_IMPORTED_MODULE_10__["default"].methodOf;
  114866. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].mixin = mixin;
  114867. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].negate = _negate_js__WEBPACK_IMPORTED_MODULE_31__["default"];
  114868. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].nthArg = _util_js__WEBPACK_IMPORTED_MODULE_10__["default"].nthArg;
  114869. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].omit = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].omit;
  114870. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].omitBy = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].omitBy;
  114871. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].once = _function_js__WEBPACK_IMPORTED_MODULE_3__["default"].once;
  114872. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].orderBy = _collection_js__WEBPACK_IMPORTED_MODULE_1__["default"].orderBy;
  114873. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].over = _util_js__WEBPACK_IMPORTED_MODULE_10__["default"].over;
  114874. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].overArgs = _function_js__WEBPACK_IMPORTED_MODULE_3__["default"].overArgs;
  114875. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].overEvery = _util_js__WEBPACK_IMPORTED_MODULE_10__["default"].overEvery;
  114876. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].overSome = _util_js__WEBPACK_IMPORTED_MODULE_10__["default"].overSome;
  114877. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].partial = _function_js__WEBPACK_IMPORTED_MODULE_3__["default"].partial;
  114878. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].partialRight = _function_js__WEBPACK_IMPORTED_MODULE_3__["default"].partialRight;
  114879. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].partition = _collection_js__WEBPACK_IMPORTED_MODULE_1__["default"].partition;
  114880. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].pick = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].pick;
  114881. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].pickBy = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].pickBy;
  114882. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].property = _util_js__WEBPACK_IMPORTED_MODULE_10__["default"].property;
  114883. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].propertyOf = _util_js__WEBPACK_IMPORTED_MODULE_10__["default"].propertyOf;
  114884. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].pull = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].pull;
  114885. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].pullAll = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].pullAll;
  114886. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].pullAllBy = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].pullAllBy;
  114887. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].pullAllWith = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].pullAllWith;
  114888. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].pullAt = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].pullAt;
  114889. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].range = _util_js__WEBPACK_IMPORTED_MODULE_10__["default"].range;
  114890. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].rangeRight = _util_js__WEBPACK_IMPORTED_MODULE_10__["default"].rangeRight;
  114891. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].rearg = _function_js__WEBPACK_IMPORTED_MODULE_3__["default"].rearg;
  114892. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].reject = _collection_js__WEBPACK_IMPORTED_MODULE_1__["default"].reject;
  114893. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].remove = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].remove;
  114894. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].rest = _function_js__WEBPACK_IMPORTED_MODULE_3__["default"].rest;
  114895. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].reverse = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].reverse;
  114896. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].sampleSize = _collection_js__WEBPACK_IMPORTED_MODULE_1__["default"].sampleSize;
  114897. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].set = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].set;
  114898. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].setWith = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].setWith;
  114899. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].shuffle = _collection_js__WEBPACK_IMPORTED_MODULE_1__["default"].shuffle;
  114900. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].slice = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].slice;
  114901. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].sortBy = _collection_js__WEBPACK_IMPORTED_MODULE_1__["default"].sortBy;
  114902. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].sortedUniq = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].sortedUniq;
  114903. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].sortedUniqBy = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].sortedUniqBy;
  114904. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].split = _string_js__WEBPACK_IMPORTED_MODULE_9__["default"].split;
  114905. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].spread = _function_js__WEBPACK_IMPORTED_MODULE_3__["default"].spread;
  114906. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].tail = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].tail;
  114907. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].take = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].take;
  114908. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].takeRight = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].takeRight;
  114909. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].takeRightWhile = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].takeRightWhile;
  114910. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].takeWhile = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].takeWhile;
  114911. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].tap = _seq_js__WEBPACK_IMPORTED_MODULE_8__["default"].tap;
  114912. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].throttle = _function_js__WEBPACK_IMPORTED_MODULE_3__["default"].throttle;
  114913. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].thru = _thru_js__WEBPACK_IMPORTED_MODULE_33__["default"];
  114914. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].toArray = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].toArray;
  114915. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].toPairs = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].toPairs;
  114916. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].toPairsIn = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].toPairsIn;
  114917. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].toPath = _util_js__WEBPACK_IMPORTED_MODULE_10__["default"].toPath;
  114918. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].toPlainObject = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].toPlainObject;
  114919. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].transform = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].transform;
  114920. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].unary = _function_js__WEBPACK_IMPORTED_MODULE_3__["default"].unary;
  114921. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].union = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].union;
  114922. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].unionBy = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].unionBy;
  114923. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].unionWith = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].unionWith;
  114924. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].uniq = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].uniq;
  114925. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].uniqBy = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].uniqBy;
  114926. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].uniqWith = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].uniqWith;
  114927. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].unset = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].unset;
  114928. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].unzip = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].unzip;
  114929. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].unzipWith = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].unzipWith;
  114930. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].update = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].update;
  114931. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].updateWith = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].updateWith;
  114932. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].values = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].values;
  114933. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].valuesIn = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].valuesIn;
  114934. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].without = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].without;
  114935. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].words = _string_js__WEBPACK_IMPORTED_MODULE_9__["default"].words;
  114936. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].wrap = _function_js__WEBPACK_IMPORTED_MODULE_3__["default"].wrap;
  114937. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].xor = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].xor;
  114938. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].xorBy = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].xorBy;
  114939. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].xorWith = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].xorWith;
  114940. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].zip = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].zip;
  114941. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].zipObject = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].zipObject;
  114942. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].zipObjectDeep = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].zipObjectDeep;
  114943. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].zipWith = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].zipWith;
  114944. // Add aliases.
  114945. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].entries = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].toPairs;
  114946. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].entriesIn = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].toPairsIn;
  114947. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].extend = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].assignIn;
  114948. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].extendWith = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].assignInWith;
  114949. // Add methods to `lodash.prototype`.
  114950. mixin(_wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"], _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"]);
  114951. // Add methods that return unwrapped values in chain sequences.
  114952. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].add = _math_js__WEBPACK_IMPORTED_MODULE_5__["default"].add;
  114953. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].attempt = _util_js__WEBPACK_IMPORTED_MODULE_10__["default"].attempt;
  114954. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].camelCase = _string_js__WEBPACK_IMPORTED_MODULE_9__["default"].camelCase;
  114955. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].capitalize = _string_js__WEBPACK_IMPORTED_MODULE_9__["default"].capitalize;
  114956. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].ceil = _math_js__WEBPACK_IMPORTED_MODULE_5__["default"].ceil;
  114957. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].clamp = _number_js__WEBPACK_IMPORTED_MODULE_6__["default"].clamp;
  114958. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].clone = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].clone;
  114959. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].cloneDeep = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].cloneDeep;
  114960. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].cloneDeepWith = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].cloneDeepWith;
  114961. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].cloneWith = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].cloneWith;
  114962. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].conformsTo = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].conformsTo;
  114963. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].deburr = _string_js__WEBPACK_IMPORTED_MODULE_9__["default"].deburr;
  114964. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].defaultTo = _util_js__WEBPACK_IMPORTED_MODULE_10__["default"].defaultTo;
  114965. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].divide = _math_js__WEBPACK_IMPORTED_MODULE_5__["default"].divide;
  114966. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].endsWith = _string_js__WEBPACK_IMPORTED_MODULE_9__["default"].endsWith;
  114967. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].eq = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].eq;
  114968. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].escape = _string_js__WEBPACK_IMPORTED_MODULE_9__["default"].escape;
  114969. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].escapeRegExp = _string_js__WEBPACK_IMPORTED_MODULE_9__["default"].escapeRegExp;
  114970. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].every = _collection_js__WEBPACK_IMPORTED_MODULE_1__["default"].every;
  114971. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].find = _collection_js__WEBPACK_IMPORTED_MODULE_1__["default"].find;
  114972. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].findIndex = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].findIndex;
  114973. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].findKey = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].findKey;
  114974. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].findLast = _collection_js__WEBPACK_IMPORTED_MODULE_1__["default"].findLast;
  114975. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].findLastIndex = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].findLastIndex;
  114976. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].findLastKey = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].findLastKey;
  114977. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].floor = _math_js__WEBPACK_IMPORTED_MODULE_5__["default"].floor;
  114978. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].forEach = _collection_js__WEBPACK_IMPORTED_MODULE_1__["default"].forEach;
  114979. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].forEachRight = _collection_js__WEBPACK_IMPORTED_MODULE_1__["default"].forEachRight;
  114980. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].forIn = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].forIn;
  114981. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].forInRight = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].forInRight;
  114982. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].forOwn = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].forOwn;
  114983. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].forOwnRight = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].forOwnRight;
  114984. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].get = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].get;
  114985. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].gt = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].gt;
  114986. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].gte = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].gte;
  114987. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].has = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].has;
  114988. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].hasIn = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].hasIn;
  114989. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].head = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].head;
  114990. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].identity = _identity_js__WEBPACK_IMPORTED_MODULE_22__["default"];
  114991. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].includes = _collection_js__WEBPACK_IMPORTED_MODULE_1__["default"].includes;
  114992. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].indexOf = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].indexOf;
  114993. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].inRange = _number_js__WEBPACK_IMPORTED_MODULE_6__["default"].inRange;
  114994. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].invoke = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].invoke;
  114995. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].isArguments = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].isArguments;
  114996. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].isArray = _isArray_js__WEBPACK_IMPORTED_MODULE_23__["default"];
  114997. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].isArrayBuffer = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].isArrayBuffer;
  114998. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].isArrayLike = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].isArrayLike;
  114999. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].isArrayLikeObject = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].isArrayLikeObject;
  115000. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].isBoolean = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].isBoolean;
  115001. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].isBuffer = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].isBuffer;
  115002. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].isDate = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].isDate;
  115003. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].isElement = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].isElement;
  115004. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].isEmpty = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].isEmpty;
  115005. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].isEqual = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].isEqual;
  115006. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].isEqualWith = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].isEqualWith;
  115007. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].isError = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].isError;
  115008. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].isFinite = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].isFinite;
  115009. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].isFunction = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].isFunction;
  115010. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].isInteger = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].isInteger;
  115011. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].isLength = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].isLength;
  115012. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].isMap = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].isMap;
  115013. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].isMatch = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].isMatch;
  115014. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].isMatchWith = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].isMatchWith;
  115015. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].isNaN = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].isNaN;
  115016. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].isNative = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].isNative;
  115017. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].isNil = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].isNil;
  115018. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].isNull = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].isNull;
  115019. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].isNumber = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].isNumber;
  115020. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].isObject = _isObject_js__WEBPACK_IMPORTED_MODULE_24__["default"];
  115021. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].isObjectLike = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].isObjectLike;
  115022. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].isPlainObject = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].isPlainObject;
  115023. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].isRegExp = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].isRegExp;
  115024. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].isSafeInteger = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].isSafeInteger;
  115025. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].isSet = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].isSet;
  115026. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].isString = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].isString;
  115027. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].isSymbol = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].isSymbol;
  115028. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].isTypedArray = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].isTypedArray;
  115029. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].isUndefined = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].isUndefined;
  115030. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].isWeakMap = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].isWeakMap;
  115031. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].isWeakSet = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].isWeakSet;
  115032. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].join = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].join;
  115033. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].kebabCase = _string_js__WEBPACK_IMPORTED_MODULE_9__["default"].kebabCase;
  115034. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].last = _last_js__WEBPACK_IMPORTED_MODULE_26__["default"];
  115035. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].lastIndexOf = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].lastIndexOf;
  115036. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].lowerCase = _string_js__WEBPACK_IMPORTED_MODULE_9__["default"].lowerCase;
  115037. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].lowerFirst = _string_js__WEBPACK_IMPORTED_MODULE_9__["default"].lowerFirst;
  115038. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].lt = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].lt;
  115039. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].lte = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].lte;
  115040. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].max = _math_js__WEBPACK_IMPORTED_MODULE_5__["default"].max;
  115041. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].maxBy = _math_js__WEBPACK_IMPORTED_MODULE_5__["default"].maxBy;
  115042. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].mean = _math_js__WEBPACK_IMPORTED_MODULE_5__["default"].mean;
  115043. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].meanBy = _math_js__WEBPACK_IMPORTED_MODULE_5__["default"].meanBy;
  115044. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].min = _math_js__WEBPACK_IMPORTED_MODULE_5__["default"].min;
  115045. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].minBy = _math_js__WEBPACK_IMPORTED_MODULE_5__["default"].minBy;
  115046. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].stubArray = _util_js__WEBPACK_IMPORTED_MODULE_10__["default"].stubArray;
  115047. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].stubFalse = _util_js__WEBPACK_IMPORTED_MODULE_10__["default"].stubFalse;
  115048. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].stubObject = _util_js__WEBPACK_IMPORTED_MODULE_10__["default"].stubObject;
  115049. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].stubString = _util_js__WEBPACK_IMPORTED_MODULE_10__["default"].stubString;
  115050. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].stubTrue = _util_js__WEBPACK_IMPORTED_MODULE_10__["default"].stubTrue;
  115051. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].multiply = _math_js__WEBPACK_IMPORTED_MODULE_5__["default"].multiply;
  115052. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].nth = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].nth;
  115053. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].noop = _util_js__WEBPACK_IMPORTED_MODULE_10__["default"].noop;
  115054. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].now = _date_js__WEBPACK_IMPORTED_MODULE_2__["default"].now;
  115055. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].pad = _string_js__WEBPACK_IMPORTED_MODULE_9__["default"].pad;
  115056. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].padEnd = _string_js__WEBPACK_IMPORTED_MODULE_9__["default"].padEnd;
  115057. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].padStart = _string_js__WEBPACK_IMPORTED_MODULE_9__["default"].padStart;
  115058. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].parseInt = _string_js__WEBPACK_IMPORTED_MODULE_9__["default"].parseInt;
  115059. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].random = _number_js__WEBPACK_IMPORTED_MODULE_6__["default"].random;
  115060. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].reduce = _collection_js__WEBPACK_IMPORTED_MODULE_1__["default"].reduce;
  115061. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].reduceRight = _collection_js__WEBPACK_IMPORTED_MODULE_1__["default"].reduceRight;
  115062. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].repeat = _string_js__WEBPACK_IMPORTED_MODULE_9__["default"].repeat;
  115063. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].replace = _string_js__WEBPACK_IMPORTED_MODULE_9__["default"].replace;
  115064. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].result = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].result;
  115065. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].round = _math_js__WEBPACK_IMPORTED_MODULE_5__["default"].round;
  115066. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].sample = _collection_js__WEBPACK_IMPORTED_MODULE_1__["default"].sample;
  115067. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].size = _collection_js__WEBPACK_IMPORTED_MODULE_1__["default"].size;
  115068. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].snakeCase = _string_js__WEBPACK_IMPORTED_MODULE_9__["default"].snakeCase;
  115069. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].some = _collection_js__WEBPACK_IMPORTED_MODULE_1__["default"].some;
  115070. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].sortedIndex = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].sortedIndex;
  115071. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].sortedIndexBy = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].sortedIndexBy;
  115072. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].sortedIndexOf = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].sortedIndexOf;
  115073. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].sortedLastIndex = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].sortedLastIndex;
  115074. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].sortedLastIndexBy = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].sortedLastIndexBy;
  115075. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].sortedLastIndexOf = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].sortedLastIndexOf;
  115076. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].startCase = _string_js__WEBPACK_IMPORTED_MODULE_9__["default"].startCase;
  115077. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].startsWith = _string_js__WEBPACK_IMPORTED_MODULE_9__["default"].startsWith;
  115078. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].subtract = _math_js__WEBPACK_IMPORTED_MODULE_5__["default"].subtract;
  115079. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].sum = _math_js__WEBPACK_IMPORTED_MODULE_5__["default"].sum;
  115080. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].sumBy = _math_js__WEBPACK_IMPORTED_MODULE_5__["default"].sumBy;
  115081. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].template = _string_js__WEBPACK_IMPORTED_MODULE_9__["default"].template;
  115082. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].times = _util_js__WEBPACK_IMPORTED_MODULE_10__["default"].times;
  115083. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].toFinite = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].toFinite;
  115084. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].toInteger = _toInteger_js__WEBPACK_IMPORTED_MODULE_34__["default"];
  115085. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].toLength = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].toLength;
  115086. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].toLower = _string_js__WEBPACK_IMPORTED_MODULE_9__["default"].toLower;
  115087. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].toNumber = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].toNumber;
  115088. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].toSafeInteger = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].toSafeInteger;
  115089. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].toString = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].toString;
  115090. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].toUpper = _string_js__WEBPACK_IMPORTED_MODULE_9__["default"].toUpper;
  115091. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].trim = _string_js__WEBPACK_IMPORTED_MODULE_9__["default"].trim;
  115092. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].trimEnd = _string_js__WEBPACK_IMPORTED_MODULE_9__["default"].trimEnd;
  115093. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].trimStart = _string_js__WEBPACK_IMPORTED_MODULE_9__["default"].trimStart;
  115094. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].truncate = _string_js__WEBPACK_IMPORTED_MODULE_9__["default"].truncate;
  115095. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].unescape = _string_js__WEBPACK_IMPORTED_MODULE_9__["default"].unescape;
  115096. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].uniqueId = _util_js__WEBPACK_IMPORTED_MODULE_10__["default"].uniqueId;
  115097. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].upperCase = _string_js__WEBPACK_IMPORTED_MODULE_9__["default"].upperCase;
  115098. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].upperFirst = _string_js__WEBPACK_IMPORTED_MODULE_9__["default"].upperFirst;
  115099. // Add aliases.
  115100. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].each = _collection_js__WEBPACK_IMPORTED_MODULE_1__["default"].forEach;
  115101. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].eachRight = _collection_js__WEBPACK_IMPORTED_MODULE_1__["default"].forEachRight;
  115102. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].first = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].head;
  115103. mixin(_wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"], (function() {
  115104. var source = {};
  115105. Object(_baseForOwn_js__WEBPACK_IMPORTED_MODULE_16__["default"])(_wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"], function(func, methodName) {
  115106. if (!hasOwnProperty.call(_wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].prototype, methodName)) {
  115107. source[methodName] = func;
  115108. }
  115109. });
  115110. return source;
  115111. }()), { 'chain': false });
  115112. /**
  115113. * The semantic version number.
  115114. *
  115115. * @static
  115116. * @memberOf _
  115117. * @type {string}
  115118. */
  115119. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].VERSION = VERSION;
  115120. (_wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].templateSettings = _string_js__WEBPACK_IMPORTED_MODULE_9__["default"].templateSettings).imports._ = _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"];
  115121. // Assign default placeholders.
  115122. Object(_arrayEach_js__WEBPACK_IMPORTED_MODULE_14__["default"])(['bind', 'bindKey', 'curry', 'curryRight', 'partial', 'partialRight'], function(methodName) {
  115123. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"][methodName].placeholder = _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"];
  115124. });
  115125. // Add `LazyWrapper` methods for `_.drop` and `_.take` variants.
  115126. Object(_arrayEach_js__WEBPACK_IMPORTED_MODULE_14__["default"])(['drop', 'take'], function(methodName, index) {
  115127. _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_11__["default"].prototype[methodName] = function(n) {
  115128. n = n === undefined ? 1 : nativeMax(Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_34__["default"])(n), 0);
  115129. var result = (this.__filtered__ && !index)
  115130. ? new _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_11__["default"](this)
  115131. : this.clone();
  115132. if (result.__filtered__) {
  115133. result.__takeCount__ = nativeMin(n, result.__takeCount__);
  115134. } else {
  115135. result.__views__.push({
  115136. 'size': nativeMin(n, MAX_ARRAY_LENGTH),
  115137. 'type': methodName + (result.__dir__ < 0 ? 'Right' : '')
  115138. });
  115139. }
  115140. return result;
  115141. };
  115142. _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_11__["default"].prototype[methodName + 'Right'] = function(n) {
  115143. return this.reverse()[methodName](n).reverse();
  115144. };
  115145. });
  115146. // Add `LazyWrapper` methods that accept an `iteratee` value.
  115147. Object(_arrayEach_js__WEBPACK_IMPORTED_MODULE_14__["default"])(['filter', 'map', 'takeWhile'], function(methodName, index) {
  115148. var type = index + 1,
  115149. isFilter = type == LAZY_FILTER_FLAG || type == LAZY_WHILE_FLAG;
  115150. _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_11__["default"].prototype[methodName] = function(iteratee) {
  115151. var result = this.clone();
  115152. result.__iteratees__.push({
  115153. 'iteratee': Object(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_19__["default"])(iteratee, 3),
  115154. 'type': type
  115155. });
  115156. result.__filtered__ = result.__filtered__ || isFilter;
  115157. return result;
  115158. };
  115159. });
  115160. // Add `LazyWrapper` methods for `_.head` and `_.last`.
  115161. Object(_arrayEach_js__WEBPACK_IMPORTED_MODULE_14__["default"])(['head', 'last'], function(methodName, index) {
  115162. var takeName = 'take' + (index ? 'Right' : '');
  115163. _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_11__["default"].prototype[methodName] = function() {
  115164. return this[takeName](1).value()[0];
  115165. };
  115166. });
  115167. // Add `LazyWrapper` methods for `_.initial` and `_.tail`.
  115168. Object(_arrayEach_js__WEBPACK_IMPORTED_MODULE_14__["default"])(['initial', 'tail'], function(methodName, index) {
  115169. var dropName = 'drop' + (index ? '' : 'Right');
  115170. _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_11__["default"].prototype[methodName] = function() {
  115171. return this.__filtered__ ? new _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_11__["default"](this) : this[dropName](1);
  115172. };
  115173. });
  115174. _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_11__["default"].prototype.compact = function() {
  115175. return this.filter(_identity_js__WEBPACK_IMPORTED_MODULE_22__["default"]);
  115176. };
  115177. _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_11__["default"].prototype.find = function(predicate) {
  115178. return this.filter(predicate).head();
  115179. };
  115180. _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_11__["default"].prototype.findLast = function(predicate) {
  115181. return this.reverse().find(predicate);
  115182. };
  115183. _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_11__["default"].prototype.invokeMap = Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_20__["default"])(function(path, args) {
  115184. if (typeof path == 'function') {
  115185. return new _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_11__["default"](this);
  115186. }
  115187. return this.map(function(value) {
  115188. return Object(_baseInvoke_js__WEBPACK_IMPORTED_MODULE_18__["default"])(value, path, args);
  115189. });
  115190. });
  115191. _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_11__["default"].prototype.reject = function(predicate) {
  115192. return this.filter(Object(_negate_js__WEBPACK_IMPORTED_MODULE_31__["default"])(Object(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_19__["default"])(predicate)));
  115193. };
  115194. _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_11__["default"].prototype.slice = function(start, end) {
  115195. start = Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_34__["default"])(start);
  115196. var result = this;
  115197. if (result.__filtered__ && (start > 0 || end < 0)) {
  115198. return new _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_11__["default"](result);
  115199. }
  115200. if (start < 0) {
  115201. result = result.takeRight(-start);
  115202. } else if (start) {
  115203. result = result.drop(start);
  115204. }
  115205. if (end !== undefined) {
  115206. end = Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_34__["default"])(end);
  115207. result = end < 0 ? result.dropRight(-end) : result.take(end - start);
  115208. }
  115209. return result;
  115210. };
  115211. _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_11__["default"].prototype.takeRightWhile = function(predicate) {
  115212. return this.reverse().takeWhile(predicate).reverse();
  115213. };
  115214. _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_11__["default"].prototype.toArray = function() {
  115215. return this.take(MAX_ARRAY_LENGTH);
  115216. };
  115217. // Add `LazyWrapper` methods to `lodash.prototype`.
  115218. Object(_baseForOwn_js__WEBPACK_IMPORTED_MODULE_16__["default"])(_LazyWrapper_js__WEBPACK_IMPORTED_MODULE_11__["default"].prototype, function(func, methodName) {
  115219. var checkIteratee = /^(?:filter|find|map|reject)|While$/.test(methodName),
  115220. isTaker = /^(?:head|last)$/.test(methodName),
  115221. lodashFunc = _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"][isTaker ? ('take' + (methodName == 'last' ? 'Right' : '')) : methodName],
  115222. retUnwrapped = isTaker || /^find/.test(methodName);
  115223. if (!lodashFunc) {
  115224. return;
  115225. }
  115226. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].prototype[methodName] = function() {
  115227. var value = this.__wrapped__,
  115228. args = isTaker ? [1] : arguments,
  115229. isLazy = value instanceof _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_11__["default"],
  115230. iteratee = args[0],
  115231. useLazy = isLazy || Object(_isArray_js__WEBPACK_IMPORTED_MODULE_23__["default"])(value);
  115232. var interceptor = function(value) {
  115233. var result = lodashFunc.apply(_wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"], Object(_arrayPush_js__WEBPACK_IMPORTED_MODULE_15__["default"])([value], args));
  115234. return (isTaker && chainAll) ? result[0] : result;
  115235. };
  115236. if (useLazy && checkIteratee && typeof iteratee == 'function' && iteratee.length != 1) {
  115237. // Avoid lazy use if the iteratee has a "length" value other than `1`.
  115238. isLazy = useLazy = false;
  115239. }
  115240. var chainAll = this.__chain__,
  115241. isHybrid = !!this.__actions__.length,
  115242. isUnwrapped = retUnwrapped && !chainAll,
  115243. onlyLazy = isLazy && !isHybrid;
  115244. if (!retUnwrapped && useLazy) {
  115245. value = onlyLazy ? value : new _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_11__["default"](this);
  115246. var result = func.apply(value, args);
  115247. result.__actions__.push({ 'func': _thru_js__WEBPACK_IMPORTED_MODULE_33__["default"], 'args': [interceptor], 'thisArg': undefined });
  115248. return new _LodashWrapper_js__WEBPACK_IMPORTED_MODULE_12__["default"](result, chainAll);
  115249. }
  115250. if (isUnwrapped && onlyLazy) {
  115251. return func.apply(this, args);
  115252. }
  115253. result = this.thru(interceptor);
  115254. return isUnwrapped ? (isTaker ? result.value()[0] : result.value()) : result;
  115255. };
  115256. });
  115257. // Add `Array` methods to `lodash.prototype`.
  115258. Object(_arrayEach_js__WEBPACK_IMPORTED_MODULE_14__["default"])(['pop', 'push', 'shift', 'sort', 'splice', 'unshift'], function(methodName) {
  115259. var func = arrayProto[methodName],
  115260. chainName = /^(?:push|sort|unshift)$/.test(methodName) ? 'tap' : 'thru',
  115261. retUnwrapped = /^(?:pop|shift)$/.test(methodName);
  115262. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].prototype[methodName] = function() {
  115263. var args = arguments;
  115264. if (retUnwrapped && !this.__chain__) {
  115265. var value = this.value();
  115266. return func.apply(Object(_isArray_js__WEBPACK_IMPORTED_MODULE_23__["default"])(value) ? value : [], args);
  115267. }
  115268. return this[chainName](function(value) {
  115269. return func.apply(Object(_isArray_js__WEBPACK_IMPORTED_MODULE_23__["default"])(value) ? value : [], args);
  115270. });
  115271. };
  115272. });
  115273. // Map minified method names to their real names.
  115274. Object(_baseForOwn_js__WEBPACK_IMPORTED_MODULE_16__["default"])(_LazyWrapper_js__WEBPACK_IMPORTED_MODULE_11__["default"].prototype, function(func, methodName) {
  115275. var lodashFunc = _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"][methodName];
  115276. if (lodashFunc) {
  115277. var key = lodashFunc.name + '';
  115278. if (!hasOwnProperty.call(_realNames_js__WEBPACK_IMPORTED_MODULE_32__["default"], key)) {
  115279. _realNames_js__WEBPACK_IMPORTED_MODULE_32__["default"][key] = [];
  115280. }
  115281. _realNames_js__WEBPACK_IMPORTED_MODULE_32__["default"][key].push({ 'name': methodName, 'func': lodashFunc });
  115282. }
  115283. });
  115284. _realNames_js__WEBPACK_IMPORTED_MODULE_32__["default"][Object(_createHybrid_js__WEBPACK_IMPORTED_MODULE_21__["default"])(undefined, WRAP_BIND_KEY_FLAG).name] = [{
  115285. 'name': 'wrapper',
  115286. 'func': undefined
  115287. }];
  115288. // Add methods to `LazyWrapper`.
  115289. _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_11__["default"].prototype.clone = _lazyClone_js__WEBPACK_IMPORTED_MODULE_27__["default"];
  115290. _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_11__["default"].prototype.reverse = _lazyReverse_js__WEBPACK_IMPORTED_MODULE_28__["default"];
  115291. _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_11__["default"].prototype.value = _lazyValue_js__WEBPACK_IMPORTED_MODULE_29__["default"];
  115292. // Add chain sequence methods to the `lodash` wrapper.
  115293. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].prototype.at = _seq_js__WEBPACK_IMPORTED_MODULE_8__["default"].at;
  115294. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].prototype.chain = _seq_js__WEBPACK_IMPORTED_MODULE_8__["default"].wrapperChain;
  115295. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].prototype.commit = _seq_js__WEBPACK_IMPORTED_MODULE_8__["default"].commit;
  115296. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].prototype.next = _seq_js__WEBPACK_IMPORTED_MODULE_8__["default"].next;
  115297. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].prototype.plant = _seq_js__WEBPACK_IMPORTED_MODULE_8__["default"].plant;
  115298. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].prototype.reverse = _seq_js__WEBPACK_IMPORTED_MODULE_8__["default"].reverse;
  115299. _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;
  115300. // Add lazy aliases.
  115301. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].prototype.first = _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].prototype.head;
  115302. if (symIterator) {
  115303. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].prototype[symIterator] = _seq_js__WEBPACK_IMPORTED_MODULE_8__["default"].toIterator;
  115304. }
  115305. /* harmony default export */ __webpack_exports__["default"] = (_wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"]);
  115306. /***/ }),
  115307. /***/ "./node_modules/lodash-es/lodash.js":
  115308. /*!******************************************!*\
  115309. !*** ./node_modules/lodash-es/lodash.js ***!
  115310. \******************************************/
  115311. /*! 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 */
  115312. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  115313. "use strict";
  115314. __webpack_require__.r(__webpack_exports__);
  115315. /* harmony import */ var _add_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./add.js */ "./node_modules/lodash-es/add.js");
  115316. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "add", function() { return _add_js__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  115317. /* harmony import */ var _after_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./after.js */ "./node_modules/lodash-es/after.js");
  115318. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "after", function() { return _after_js__WEBPACK_IMPORTED_MODULE_1__["default"]; });
  115319. /* harmony import */ var _ary_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./ary.js */ "./node_modules/lodash-es/ary.js");
  115320. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ary", function() { return _ary_js__WEBPACK_IMPORTED_MODULE_2__["default"]; });
  115321. /* harmony import */ var _assign_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./assign.js */ "./node_modules/lodash-es/assign.js");
  115322. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "assign", function() { return _assign_js__WEBPACK_IMPORTED_MODULE_3__["default"]; });
  115323. /* harmony import */ var _assignIn_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./assignIn.js */ "./node_modules/lodash-es/assignIn.js");
  115324. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "assignIn", function() { return _assignIn_js__WEBPACK_IMPORTED_MODULE_4__["default"]; });
  115325. /* harmony import */ var _assignInWith_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./assignInWith.js */ "./node_modules/lodash-es/assignInWith.js");
  115326. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "assignInWith", function() { return _assignInWith_js__WEBPACK_IMPORTED_MODULE_5__["default"]; });
  115327. /* harmony import */ var _assignWith_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./assignWith.js */ "./node_modules/lodash-es/assignWith.js");
  115328. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "assignWith", function() { return _assignWith_js__WEBPACK_IMPORTED_MODULE_6__["default"]; });
  115329. /* harmony import */ var _at_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./at.js */ "./node_modules/lodash-es/at.js");
  115330. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "at", function() { return _at_js__WEBPACK_IMPORTED_MODULE_7__["default"]; });
  115331. /* harmony import */ var _attempt_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./attempt.js */ "./node_modules/lodash-es/attempt.js");
  115332. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "attempt", function() { return _attempt_js__WEBPACK_IMPORTED_MODULE_8__["default"]; });
  115333. /* harmony import */ var _before_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./before.js */ "./node_modules/lodash-es/before.js");
  115334. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "before", function() { return _before_js__WEBPACK_IMPORTED_MODULE_9__["default"]; });
  115335. /* harmony import */ var _bind_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./bind.js */ "./node_modules/lodash-es/bind.js");
  115336. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "bind", function() { return _bind_js__WEBPACK_IMPORTED_MODULE_10__["default"]; });
  115337. /* harmony import */ var _bindAll_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./bindAll.js */ "./node_modules/lodash-es/bindAll.js");
  115338. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "bindAll", function() { return _bindAll_js__WEBPACK_IMPORTED_MODULE_11__["default"]; });
  115339. /* harmony import */ var _bindKey_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./bindKey.js */ "./node_modules/lodash-es/bindKey.js");
  115340. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "bindKey", function() { return _bindKey_js__WEBPACK_IMPORTED_MODULE_12__["default"]; });
  115341. /* harmony import */ var _camelCase_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./camelCase.js */ "./node_modules/lodash-es/camelCase.js");
  115342. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "camelCase", function() { return _camelCase_js__WEBPACK_IMPORTED_MODULE_13__["default"]; });
  115343. /* harmony import */ var _capitalize_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./capitalize.js */ "./node_modules/lodash-es/capitalize.js");
  115344. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "capitalize", function() { return _capitalize_js__WEBPACK_IMPORTED_MODULE_14__["default"]; });
  115345. /* harmony import */ var _castArray_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./castArray.js */ "./node_modules/lodash-es/castArray.js");
  115346. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "castArray", function() { return _castArray_js__WEBPACK_IMPORTED_MODULE_15__["default"]; });
  115347. /* harmony import */ var _ceil_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./ceil.js */ "./node_modules/lodash-es/ceil.js");
  115348. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ceil", function() { return _ceil_js__WEBPACK_IMPORTED_MODULE_16__["default"]; });
  115349. /* harmony import */ var _chain_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./chain.js */ "./node_modules/lodash-es/chain.js");
  115350. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "chain", function() { return _chain_js__WEBPACK_IMPORTED_MODULE_17__["default"]; });
  115351. /* harmony import */ var _chunk_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./chunk.js */ "./node_modules/lodash-es/chunk.js");
  115352. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "chunk", function() { return _chunk_js__WEBPACK_IMPORTED_MODULE_18__["default"]; });
  115353. /* harmony import */ var _clamp_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./clamp.js */ "./node_modules/lodash-es/clamp.js");
  115354. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "clamp", function() { return _clamp_js__WEBPACK_IMPORTED_MODULE_19__["default"]; });
  115355. /* harmony import */ var _clone_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./clone.js */ "./node_modules/lodash-es/clone.js");
  115356. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "clone", function() { return _clone_js__WEBPACK_IMPORTED_MODULE_20__["default"]; });
  115357. /* harmony import */ var _cloneDeep_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./cloneDeep.js */ "./node_modules/lodash-es/cloneDeep.js");
  115358. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "cloneDeep", function() { return _cloneDeep_js__WEBPACK_IMPORTED_MODULE_21__["default"]; });
  115359. /* harmony import */ var _cloneDeepWith_js__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./cloneDeepWith.js */ "./node_modules/lodash-es/cloneDeepWith.js");
  115360. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "cloneDeepWith", function() { return _cloneDeepWith_js__WEBPACK_IMPORTED_MODULE_22__["default"]; });
  115361. /* harmony import */ var _cloneWith_js__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./cloneWith.js */ "./node_modules/lodash-es/cloneWith.js");
  115362. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "cloneWith", function() { return _cloneWith_js__WEBPACK_IMPORTED_MODULE_23__["default"]; });
  115363. /* harmony import */ var _commit_js__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./commit.js */ "./node_modules/lodash-es/commit.js");
  115364. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "commit", function() { return _commit_js__WEBPACK_IMPORTED_MODULE_24__["default"]; });
  115365. /* harmony import */ var _compact_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./compact.js */ "./node_modules/lodash-es/compact.js");
  115366. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "compact", function() { return _compact_js__WEBPACK_IMPORTED_MODULE_25__["default"]; });
  115367. /* harmony import */ var _concat_js__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./concat.js */ "./node_modules/lodash-es/concat.js");
  115368. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "concat", function() { return _concat_js__WEBPACK_IMPORTED_MODULE_26__["default"]; });
  115369. /* harmony import */ var _cond_js__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./cond.js */ "./node_modules/lodash-es/cond.js");
  115370. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "cond", function() { return _cond_js__WEBPACK_IMPORTED_MODULE_27__["default"]; });
  115371. /* harmony import */ var _conforms_js__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./conforms.js */ "./node_modules/lodash-es/conforms.js");
  115372. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "conforms", function() { return _conforms_js__WEBPACK_IMPORTED_MODULE_28__["default"]; });
  115373. /* harmony import */ var _conformsTo_js__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./conformsTo.js */ "./node_modules/lodash-es/conformsTo.js");
  115374. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "conformsTo", function() { return _conformsTo_js__WEBPACK_IMPORTED_MODULE_29__["default"]; });
  115375. /* harmony import */ var _constant_js__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./constant.js */ "./node_modules/lodash-es/constant.js");
  115376. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "constant", function() { return _constant_js__WEBPACK_IMPORTED_MODULE_30__["default"]; });
  115377. /* harmony import */ var _countBy_js__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ./countBy.js */ "./node_modules/lodash-es/countBy.js");
  115378. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "countBy", function() { return _countBy_js__WEBPACK_IMPORTED_MODULE_31__["default"]; });
  115379. /* harmony import */ var _create_js__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ./create.js */ "./node_modules/lodash-es/create.js");
  115380. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "create", function() { return _create_js__WEBPACK_IMPORTED_MODULE_32__["default"]; });
  115381. /* harmony import */ var _curry_js__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ./curry.js */ "./node_modules/lodash-es/curry.js");
  115382. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "curry", function() { return _curry_js__WEBPACK_IMPORTED_MODULE_33__["default"]; });
  115383. /* harmony import */ var _curryRight_js__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ./curryRight.js */ "./node_modules/lodash-es/curryRight.js");
  115384. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "curryRight", function() { return _curryRight_js__WEBPACK_IMPORTED_MODULE_34__["default"]; });
  115385. /* harmony import */ var _debounce_js__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ./debounce.js */ "./node_modules/lodash-es/debounce.js");
  115386. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "debounce", function() { return _debounce_js__WEBPACK_IMPORTED_MODULE_35__["default"]; });
  115387. /* harmony import */ var _deburr_js__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! ./deburr.js */ "./node_modules/lodash-es/deburr.js");
  115388. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "deburr", function() { return _deburr_js__WEBPACK_IMPORTED_MODULE_36__["default"]; });
  115389. /* harmony import */ var _defaultTo_js__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(/*! ./defaultTo.js */ "./node_modules/lodash-es/defaultTo.js");
  115390. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "defaultTo", function() { return _defaultTo_js__WEBPACK_IMPORTED_MODULE_37__["default"]; });
  115391. /* harmony import */ var _defaults_js__WEBPACK_IMPORTED_MODULE_38__ = __webpack_require__(/*! ./defaults.js */ "./node_modules/lodash-es/defaults.js");
  115392. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "defaults", function() { return _defaults_js__WEBPACK_IMPORTED_MODULE_38__["default"]; });
  115393. /* harmony import */ var _defaultsDeep_js__WEBPACK_IMPORTED_MODULE_39__ = __webpack_require__(/*! ./defaultsDeep.js */ "./node_modules/lodash-es/defaultsDeep.js");
  115394. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "defaultsDeep", function() { return _defaultsDeep_js__WEBPACK_IMPORTED_MODULE_39__["default"]; });
  115395. /* harmony import */ var _defer_js__WEBPACK_IMPORTED_MODULE_40__ = __webpack_require__(/*! ./defer.js */ "./node_modules/lodash-es/defer.js");
  115396. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "defer", function() { return _defer_js__WEBPACK_IMPORTED_MODULE_40__["default"]; });
  115397. /* harmony import */ var _delay_js__WEBPACK_IMPORTED_MODULE_41__ = __webpack_require__(/*! ./delay.js */ "./node_modules/lodash-es/delay.js");
  115398. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "delay", function() { return _delay_js__WEBPACK_IMPORTED_MODULE_41__["default"]; });
  115399. /* harmony import */ var _difference_js__WEBPACK_IMPORTED_MODULE_42__ = __webpack_require__(/*! ./difference.js */ "./node_modules/lodash-es/difference.js");
  115400. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "difference", function() { return _difference_js__WEBPACK_IMPORTED_MODULE_42__["default"]; });
  115401. /* harmony import */ var _differenceBy_js__WEBPACK_IMPORTED_MODULE_43__ = __webpack_require__(/*! ./differenceBy.js */ "./node_modules/lodash-es/differenceBy.js");
  115402. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "differenceBy", function() { return _differenceBy_js__WEBPACK_IMPORTED_MODULE_43__["default"]; });
  115403. /* harmony import */ var _differenceWith_js__WEBPACK_IMPORTED_MODULE_44__ = __webpack_require__(/*! ./differenceWith.js */ "./node_modules/lodash-es/differenceWith.js");
  115404. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "differenceWith", function() { return _differenceWith_js__WEBPACK_IMPORTED_MODULE_44__["default"]; });
  115405. /* harmony import */ var _divide_js__WEBPACK_IMPORTED_MODULE_45__ = __webpack_require__(/*! ./divide.js */ "./node_modules/lodash-es/divide.js");
  115406. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "divide", function() { return _divide_js__WEBPACK_IMPORTED_MODULE_45__["default"]; });
  115407. /* harmony import */ var _drop_js__WEBPACK_IMPORTED_MODULE_46__ = __webpack_require__(/*! ./drop.js */ "./node_modules/lodash-es/drop.js");
  115408. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "drop", function() { return _drop_js__WEBPACK_IMPORTED_MODULE_46__["default"]; });
  115409. /* harmony import */ var _dropRight_js__WEBPACK_IMPORTED_MODULE_47__ = __webpack_require__(/*! ./dropRight.js */ "./node_modules/lodash-es/dropRight.js");
  115410. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "dropRight", function() { return _dropRight_js__WEBPACK_IMPORTED_MODULE_47__["default"]; });
  115411. /* harmony import */ var _dropRightWhile_js__WEBPACK_IMPORTED_MODULE_48__ = __webpack_require__(/*! ./dropRightWhile.js */ "./node_modules/lodash-es/dropRightWhile.js");
  115412. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "dropRightWhile", function() { return _dropRightWhile_js__WEBPACK_IMPORTED_MODULE_48__["default"]; });
  115413. /* harmony import */ var _dropWhile_js__WEBPACK_IMPORTED_MODULE_49__ = __webpack_require__(/*! ./dropWhile.js */ "./node_modules/lodash-es/dropWhile.js");
  115414. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "dropWhile", function() { return _dropWhile_js__WEBPACK_IMPORTED_MODULE_49__["default"]; });
  115415. /* harmony import */ var _each_js__WEBPACK_IMPORTED_MODULE_50__ = __webpack_require__(/*! ./each.js */ "./node_modules/lodash-es/each.js");
  115416. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "each", function() { return _each_js__WEBPACK_IMPORTED_MODULE_50__["default"]; });
  115417. /* harmony import */ var _eachRight_js__WEBPACK_IMPORTED_MODULE_51__ = __webpack_require__(/*! ./eachRight.js */ "./node_modules/lodash-es/eachRight.js");
  115418. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "eachRight", function() { return _eachRight_js__WEBPACK_IMPORTED_MODULE_51__["default"]; });
  115419. /* harmony import */ var _endsWith_js__WEBPACK_IMPORTED_MODULE_52__ = __webpack_require__(/*! ./endsWith.js */ "./node_modules/lodash-es/endsWith.js");
  115420. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "endsWith", function() { return _endsWith_js__WEBPACK_IMPORTED_MODULE_52__["default"]; });
  115421. /* harmony import */ var _entries_js__WEBPACK_IMPORTED_MODULE_53__ = __webpack_require__(/*! ./entries.js */ "./node_modules/lodash-es/entries.js");
  115422. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "entries", function() { return _entries_js__WEBPACK_IMPORTED_MODULE_53__["default"]; });
  115423. /* harmony import */ var _entriesIn_js__WEBPACK_IMPORTED_MODULE_54__ = __webpack_require__(/*! ./entriesIn.js */ "./node_modules/lodash-es/entriesIn.js");
  115424. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "entriesIn", function() { return _entriesIn_js__WEBPACK_IMPORTED_MODULE_54__["default"]; });
  115425. /* harmony import */ var _eq_js__WEBPACK_IMPORTED_MODULE_55__ = __webpack_require__(/*! ./eq.js */ "./node_modules/lodash-es/eq.js");
  115426. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "eq", function() { return _eq_js__WEBPACK_IMPORTED_MODULE_55__["default"]; });
  115427. /* harmony import */ var _escape_js__WEBPACK_IMPORTED_MODULE_56__ = __webpack_require__(/*! ./escape.js */ "./node_modules/lodash-es/escape.js");
  115428. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "escape", function() { return _escape_js__WEBPACK_IMPORTED_MODULE_56__["default"]; });
  115429. /* harmony import */ var _escapeRegExp_js__WEBPACK_IMPORTED_MODULE_57__ = __webpack_require__(/*! ./escapeRegExp.js */ "./node_modules/lodash-es/escapeRegExp.js");
  115430. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "escapeRegExp", function() { return _escapeRegExp_js__WEBPACK_IMPORTED_MODULE_57__["default"]; });
  115431. /* harmony import */ var _every_js__WEBPACK_IMPORTED_MODULE_58__ = __webpack_require__(/*! ./every.js */ "./node_modules/lodash-es/every.js");
  115432. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "every", function() { return _every_js__WEBPACK_IMPORTED_MODULE_58__["default"]; });
  115433. /* harmony import */ var _extend_js__WEBPACK_IMPORTED_MODULE_59__ = __webpack_require__(/*! ./extend.js */ "./node_modules/lodash-es/extend.js");
  115434. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "extend", function() { return _extend_js__WEBPACK_IMPORTED_MODULE_59__["default"]; });
  115435. /* harmony import */ var _extendWith_js__WEBPACK_IMPORTED_MODULE_60__ = __webpack_require__(/*! ./extendWith.js */ "./node_modules/lodash-es/extendWith.js");
  115436. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "extendWith", function() { return _extendWith_js__WEBPACK_IMPORTED_MODULE_60__["default"]; });
  115437. /* harmony import */ var _fill_js__WEBPACK_IMPORTED_MODULE_61__ = __webpack_require__(/*! ./fill.js */ "./node_modules/lodash-es/fill.js");
  115438. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "fill", function() { return _fill_js__WEBPACK_IMPORTED_MODULE_61__["default"]; });
  115439. /* harmony import */ var _filter_js__WEBPACK_IMPORTED_MODULE_62__ = __webpack_require__(/*! ./filter.js */ "./node_modules/lodash-es/filter.js");
  115440. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "filter", function() { return _filter_js__WEBPACK_IMPORTED_MODULE_62__["default"]; });
  115441. /* harmony import */ var _find_js__WEBPACK_IMPORTED_MODULE_63__ = __webpack_require__(/*! ./find.js */ "./node_modules/lodash-es/find.js");
  115442. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "find", function() { return _find_js__WEBPACK_IMPORTED_MODULE_63__["default"]; });
  115443. /* harmony import */ var _findIndex_js__WEBPACK_IMPORTED_MODULE_64__ = __webpack_require__(/*! ./findIndex.js */ "./node_modules/lodash-es/findIndex.js");
  115444. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "findIndex", function() { return _findIndex_js__WEBPACK_IMPORTED_MODULE_64__["default"]; });
  115445. /* harmony import */ var _findKey_js__WEBPACK_IMPORTED_MODULE_65__ = __webpack_require__(/*! ./findKey.js */ "./node_modules/lodash-es/findKey.js");
  115446. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "findKey", function() { return _findKey_js__WEBPACK_IMPORTED_MODULE_65__["default"]; });
  115447. /* harmony import */ var _findLast_js__WEBPACK_IMPORTED_MODULE_66__ = __webpack_require__(/*! ./findLast.js */ "./node_modules/lodash-es/findLast.js");
  115448. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "findLast", function() { return _findLast_js__WEBPACK_IMPORTED_MODULE_66__["default"]; });
  115449. /* harmony import */ var _findLastIndex_js__WEBPACK_IMPORTED_MODULE_67__ = __webpack_require__(/*! ./findLastIndex.js */ "./node_modules/lodash-es/findLastIndex.js");
  115450. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "findLastIndex", function() { return _findLastIndex_js__WEBPACK_IMPORTED_MODULE_67__["default"]; });
  115451. /* harmony import */ var _findLastKey_js__WEBPACK_IMPORTED_MODULE_68__ = __webpack_require__(/*! ./findLastKey.js */ "./node_modules/lodash-es/findLastKey.js");
  115452. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "findLastKey", function() { return _findLastKey_js__WEBPACK_IMPORTED_MODULE_68__["default"]; });
  115453. /* harmony import */ var _first_js__WEBPACK_IMPORTED_MODULE_69__ = __webpack_require__(/*! ./first.js */ "./node_modules/lodash-es/first.js");
  115454. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "first", function() { return _first_js__WEBPACK_IMPORTED_MODULE_69__["default"]; });
  115455. /* harmony import */ var _flatMap_js__WEBPACK_IMPORTED_MODULE_70__ = __webpack_require__(/*! ./flatMap.js */ "./node_modules/lodash-es/flatMap.js");
  115456. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "flatMap", function() { return _flatMap_js__WEBPACK_IMPORTED_MODULE_70__["default"]; });
  115457. /* harmony import */ var _flatMapDeep_js__WEBPACK_IMPORTED_MODULE_71__ = __webpack_require__(/*! ./flatMapDeep.js */ "./node_modules/lodash-es/flatMapDeep.js");
  115458. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "flatMapDeep", function() { return _flatMapDeep_js__WEBPACK_IMPORTED_MODULE_71__["default"]; });
  115459. /* harmony import */ var _flatMapDepth_js__WEBPACK_IMPORTED_MODULE_72__ = __webpack_require__(/*! ./flatMapDepth.js */ "./node_modules/lodash-es/flatMapDepth.js");
  115460. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "flatMapDepth", function() { return _flatMapDepth_js__WEBPACK_IMPORTED_MODULE_72__["default"]; });
  115461. /* harmony import */ var _flatten_js__WEBPACK_IMPORTED_MODULE_73__ = __webpack_require__(/*! ./flatten.js */ "./node_modules/lodash-es/flatten.js");
  115462. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "flatten", function() { return _flatten_js__WEBPACK_IMPORTED_MODULE_73__["default"]; });
  115463. /* harmony import */ var _flattenDeep_js__WEBPACK_IMPORTED_MODULE_74__ = __webpack_require__(/*! ./flattenDeep.js */ "./node_modules/lodash-es/flattenDeep.js");
  115464. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "flattenDeep", function() { return _flattenDeep_js__WEBPACK_IMPORTED_MODULE_74__["default"]; });
  115465. /* harmony import */ var _flattenDepth_js__WEBPACK_IMPORTED_MODULE_75__ = __webpack_require__(/*! ./flattenDepth.js */ "./node_modules/lodash-es/flattenDepth.js");
  115466. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "flattenDepth", function() { return _flattenDepth_js__WEBPACK_IMPORTED_MODULE_75__["default"]; });
  115467. /* harmony import */ var _flip_js__WEBPACK_IMPORTED_MODULE_76__ = __webpack_require__(/*! ./flip.js */ "./node_modules/lodash-es/flip.js");
  115468. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "flip", function() { return _flip_js__WEBPACK_IMPORTED_MODULE_76__["default"]; });
  115469. /* harmony import */ var _floor_js__WEBPACK_IMPORTED_MODULE_77__ = __webpack_require__(/*! ./floor.js */ "./node_modules/lodash-es/floor.js");
  115470. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "floor", function() { return _floor_js__WEBPACK_IMPORTED_MODULE_77__["default"]; });
  115471. /* harmony import */ var _flow_js__WEBPACK_IMPORTED_MODULE_78__ = __webpack_require__(/*! ./flow.js */ "./node_modules/lodash-es/flow.js");
  115472. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "flow", function() { return _flow_js__WEBPACK_IMPORTED_MODULE_78__["default"]; });
  115473. /* harmony import */ var _flowRight_js__WEBPACK_IMPORTED_MODULE_79__ = __webpack_require__(/*! ./flowRight.js */ "./node_modules/lodash-es/flowRight.js");
  115474. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "flowRight", function() { return _flowRight_js__WEBPACK_IMPORTED_MODULE_79__["default"]; });
  115475. /* harmony import */ var _forEach_js__WEBPACK_IMPORTED_MODULE_80__ = __webpack_require__(/*! ./forEach.js */ "./node_modules/lodash-es/forEach.js");
  115476. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "forEach", function() { return _forEach_js__WEBPACK_IMPORTED_MODULE_80__["default"]; });
  115477. /* harmony import */ var _forEachRight_js__WEBPACK_IMPORTED_MODULE_81__ = __webpack_require__(/*! ./forEachRight.js */ "./node_modules/lodash-es/forEachRight.js");
  115478. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "forEachRight", function() { return _forEachRight_js__WEBPACK_IMPORTED_MODULE_81__["default"]; });
  115479. /* harmony import */ var _forIn_js__WEBPACK_IMPORTED_MODULE_82__ = __webpack_require__(/*! ./forIn.js */ "./node_modules/lodash-es/forIn.js");
  115480. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "forIn", function() { return _forIn_js__WEBPACK_IMPORTED_MODULE_82__["default"]; });
  115481. /* harmony import */ var _forInRight_js__WEBPACK_IMPORTED_MODULE_83__ = __webpack_require__(/*! ./forInRight.js */ "./node_modules/lodash-es/forInRight.js");
  115482. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "forInRight", function() { return _forInRight_js__WEBPACK_IMPORTED_MODULE_83__["default"]; });
  115483. /* harmony import */ var _forOwn_js__WEBPACK_IMPORTED_MODULE_84__ = __webpack_require__(/*! ./forOwn.js */ "./node_modules/lodash-es/forOwn.js");
  115484. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "forOwn", function() { return _forOwn_js__WEBPACK_IMPORTED_MODULE_84__["default"]; });
  115485. /* harmony import */ var _forOwnRight_js__WEBPACK_IMPORTED_MODULE_85__ = __webpack_require__(/*! ./forOwnRight.js */ "./node_modules/lodash-es/forOwnRight.js");
  115486. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "forOwnRight", function() { return _forOwnRight_js__WEBPACK_IMPORTED_MODULE_85__["default"]; });
  115487. /* harmony import */ var _fromPairs_js__WEBPACK_IMPORTED_MODULE_86__ = __webpack_require__(/*! ./fromPairs.js */ "./node_modules/lodash-es/fromPairs.js");
  115488. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "fromPairs", function() { return _fromPairs_js__WEBPACK_IMPORTED_MODULE_86__["default"]; });
  115489. /* harmony import */ var _functions_js__WEBPACK_IMPORTED_MODULE_87__ = __webpack_require__(/*! ./functions.js */ "./node_modules/lodash-es/functions.js");
  115490. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "functions", function() { return _functions_js__WEBPACK_IMPORTED_MODULE_87__["default"]; });
  115491. /* harmony import */ var _functionsIn_js__WEBPACK_IMPORTED_MODULE_88__ = __webpack_require__(/*! ./functionsIn.js */ "./node_modules/lodash-es/functionsIn.js");
  115492. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "functionsIn", function() { return _functionsIn_js__WEBPACK_IMPORTED_MODULE_88__["default"]; });
  115493. /* harmony import */ var _get_js__WEBPACK_IMPORTED_MODULE_89__ = __webpack_require__(/*! ./get.js */ "./node_modules/lodash-es/get.js");
  115494. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "get", function() { return _get_js__WEBPACK_IMPORTED_MODULE_89__["default"]; });
  115495. /* harmony import */ var _groupBy_js__WEBPACK_IMPORTED_MODULE_90__ = __webpack_require__(/*! ./groupBy.js */ "./node_modules/lodash-es/groupBy.js");
  115496. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "groupBy", function() { return _groupBy_js__WEBPACK_IMPORTED_MODULE_90__["default"]; });
  115497. /* harmony import */ var _gt_js__WEBPACK_IMPORTED_MODULE_91__ = __webpack_require__(/*! ./gt.js */ "./node_modules/lodash-es/gt.js");
  115498. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "gt", function() { return _gt_js__WEBPACK_IMPORTED_MODULE_91__["default"]; });
  115499. /* harmony import */ var _gte_js__WEBPACK_IMPORTED_MODULE_92__ = __webpack_require__(/*! ./gte.js */ "./node_modules/lodash-es/gte.js");
  115500. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "gte", function() { return _gte_js__WEBPACK_IMPORTED_MODULE_92__["default"]; });
  115501. /* harmony import */ var _has_js__WEBPACK_IMPORTED_MODULE_93__ = __webpack_require__(/*! ./has.js */ "./node_modules/lodash-es/has.js");
  115502. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "has", function() { return _has_js__WEBPACK_IMPORTED_MODULE_93__["default"]; });
  115503. /* harmony import */ var _hasIn_js__WEBPACK_IMPORTED_MODULE_94__ = __webpack_require__(/*! ./hasIn.js */ "./node_modules/lodash-es/hasIn.js");
  115504. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "hasIn", function() { return _hasIn_js__WEBPACK_IMPORTED_MODULE_94__["default"]; });
  115505. /* harmony import */ var _head_js__WEBPACK_IMPORTED_MODULE_95__ = __webpack_require__(/*! ./head.js */ "./node_modules/lodash-es/head.js");
  115506. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "head", function() { return _head_js__WEBPACK_IMPORTED_MODULE_95__["default"]; });
  115507. /* harmony import */ var _identity_js__WEBPACK_IMPORTED_MODULE_96__ = __webpack_require__(/*! ./identity.js */ "./node_modules/lodash-es/identity.js");
  115508. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "identity", function() { return _identity_js__WEBPACK_IMPORTED_MODULE_96__["default"]; });
  115509. /* harmony import */ var _inRange_js__WEBPACK_IMPORTED_MODULE_97__ = __webpack_require__(/*! ./inRange.js */ "./node_modules/lodash-es/inRange.js");
  115510. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "inRange", function() { return _inRange_js__WEBPACK_IMPORTED_MODULE_97__["default"]; });
  115511. /* harmony import */ var _includes_js__WEBPACK_IMPORTED_MODULE_98__ = __webpack_require__(/*! ./includes.js */ "./node_modules/lodash-es/includes.js");
  115512. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "includes", function() { return _includes_js__WEBPACK_IMPORTED_MODULE_98__["default"]; });
  115513. /* harmony import */ var _indexOf_js__WEBPACK_IMPORTED_MODULE_99__ = __webpack_require__(/*! ./indexOf.js */ "./node_modules/lodash-es/indexOf.js");
  115514. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "indexOf", function() { return _indexOf_js__WEBPACK_IMPORTED_MODULE_99__["default"]; });
  115515. /* harmony import */ var _initial_js__WEBPACK_IMPORTED_MODULE_100__ = __webpack_require__(/*! ./initial.js */ "./node_modules/lodash-es/initial.js");
  115516. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "initial", function() { return _initial_js__WEBPACK_IMPORTED_MODULE_100__["default"]; });
  115517. /* harmony import */ var _intersection_js__WEBPACK_IMPORTED_MODULE_101__ = __webpack_require__(/*! ./intersection.js */ "./node_modules/lodash-es/intersection.js");
  115518. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "intersection", function() { return _intersection_js__WEBPACK_IMPORTED_MODULE_101__["default"]; });
  115519. /* harmony import */ var _intersectionBy_js__WEBPACK_IMPORTED_MODULE_102__ = __webpack_require__(/*! ./intersectionBy.js */ "./node_modules/lodash-es/intersectionBy.js");
  115520. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "intersectionBy", function() { return _intersectionBy_js__WEBPACK_IMPORTED_MODULE_102__["default"]; });
  115521. /* harmony import */ var _intersectionWith_js__WEBPACK_IMPORTED_MODULE_103__ = __webpack_require__(/*! ./intersectionWith.js */ "./node_modules/lodash-es/intersectionWith.js");
  115522. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "intersectionWith", function() { return _intersectionWith_js__WEBPACK_IMPORTED_MODULE_103__["default"]; });
  115523. /* harmony import */ var _invert_js__WEBPACK_IMPORTED_MODULE_104__ = __webpack_require__(/*! ./invert.js */ "./node_modules/lodash-es/invert.js");
  115524. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "invert", function() { return _invert_js__WEBPACK_IMPORTED_MODULE_104__["default"]; });
  115525. /* harmony import */ var _invertBy_js__WEBPACK_IMPORTED_MODULE_105__ = __webpack_require__(/*! ./invertBy.js */ "./node_modules/lodash-es/invertBy.js");
  115526. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "invertBy", function() { return _invertBy_js__WEBPACK_IMPORTED_MODULE_105__["default"]; });
  115527. /* harmony import */ var _invoke_js__WEBPACK_IMPORTED_MODULE_106__ = __webpack_require__(/*! ./invoke.js */ "./node_modules/lodash-es/invoke.js");
  115528. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "invoke", function() { return _invoke_js__WEBPACK_IMPORTED_MODULE_106__["default"]; });
  115529. /* harmony import */ var _invokeMap_js__WEBPACK_IMPORTED_MODULE_107__ = __webpack_require__(/*! ./invokeMap.js */ "./node_modules/lodash-es/invokeMap.js");
  115530. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "invokeMap", function() { return _invokeMap_js__WEBPACK_IMPORTED_MODULE_107__["default"]; });
  115531. /* harmony import */ var _isArguments_js__WEBPACK_IMPORTED_MODULE_108__ = __webpack_require__(/*! ./isArguments.js */ "./node_modules/lodash-es/isArguments.js");
  115532. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isArguments", function() { return _isArguments_js__WEBPACK_IMPORTED_MODULE_108__["default"]; });
  115533. /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_109__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
  115534. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isArray", function() { return _isArray_js__WEBPACK_IMPORTED_MODULE_109__["default"]; });
  115535. /* harmony import */ var _isArrayBuffer_js__WEBPACK_IMPORTED_MODULE_110__ = __webpack_require__(/*! ./isArrayBuffer.js */ "./node_modules/lodash-es/isArrayBuffer.js");
  115536. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isArrayBuffer", function() { return _isArrayBuffer_js__WEBPACK_IMPORTED_MODULE_110__["default"]; });
  115537. /* harmony import */ var _isArrayLike_js__WEBPACK_IMPORTED_MODULE_111__ = __webpack_require__(/*! ./isArrayLike.js */ "./node_modules/lodash-es/isArrayLike.js");
  115538. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isArrayLike", function() { return _isArrayLike_js__WEBPACK_IMPORTED_MODULE_111__["default"]; });
  115539. /* harmony import */ var _isArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_112__ = __webpack_require__(/*! ./isArrayLikeObject.js */ "./node_modules/lodash-es/isArrayLikeObject.js");
  115540. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isArrayLikeObject", function() { return _isArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_112__["default"]; });
  115541. /* harmony import */ var _isBoolean_js__WEBPACK_IMPORTED_MODULE_113__ = __webpack_require__(/*! ./isBoolean.js */ "./node_modules/lodash-es/isBoolean.js");
  115542. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isBoolean", function() { return _isBoolean_js__WEBPACK_IMPORTED_MODULE_113__["default"]; });
  115543. /* harmony import */ var _isBuffer_js__WEBPACK_IMPORTED_MODULE_114__ = __webpack_require__(/*! ./isBuffer.js */ "./node_modules/lodash-es/isBuffer.js");
  115544. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isBuffer", function() { return _isBuffer_js__WEBPACK_IMPORTED_MODULE_114__["default"]; });
  115545. /* harmony import */ var _isDate_js__WEBPACK_IMPORTED_MODULE_115__ = __webpack_require__(/*! ./isDate.js */ "./node_modules/lodash-es/isDate.js");
  115546. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isDate", function() { return _isDate_js__WEBPACK_IMPORTED_MODULE_115__["default"]; });
  115547. /* harmony import */ var _isElement_js__WEBPACK_IMPORTED_MODULE_116__ = __webpack_require__(/*! ./isElement.js */ "./node_modules/lodash-es/isElement.js");
  115548. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isElement", function() { return _isElement_js__WEBPACK_IMPORTED_MODULE_116__["default"]; });
  115549. /* harmony import */ var _isEmpty_js__WEBPACK_IMPORTED_MODULE_117__ = __webpack_require__(/*! ./isEmpty.js */ "./node_modules/lodash-es/isEmpty.js");
  115550. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isEmpty", function() { return _isEmpty_js__WEBPACK_IMPORTED_MODULE_117__["default"]; });
  115551. /* harmony import */ var _isEqual_js__WEBPACK_IMPORTED_MODULE_118__ = __webpack_require__(/*! ./isEqual.js */ "./node_modules/lodash-es/isEqual.js");
  115552. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isEqual", function() { return _isEqual_js__WEBPACK_IMPORTED_MODULE_118__["default"]; });
  115553. /* harmony import */ var _isEqualWith_js__WEBPACK_IMPORTED_MODULE_119__ = __webpack_require__(/*! ./isEqualWith.js */ "./node_modules/lodash-es/isEqualWith.js");
  115554. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isEqualWith", function() { return _isEqualWith_js__WEBPACK_IMPORTED_MODULE_119__["default"]; });
  115555. /* harmony import */ var _isError_js__WEBPACK_IMPORTED_MODULE_120__ = __webpack_require__(/*! ./isError.js */ "./node_modules/lodash-es/isError.js");
  115556. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isError", function() { return _isError_js__WEBPACK_IMPORTED_MODULE_120__["default"]; });
  115557. /* harmony import */ var _isFinite_js__WEBPACK_IMPORTED_MODULE_121__ = __webpack_require__(/*! ./isFinite.js */ "./node_modules/lodash-es/isFinite.js");
  115558. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isFinite", function() { return _isFinite_js__WEBPACK_IMPORTED_MODULE_121__["default"]; });
  115559. /* harmony import */ var _isFunction_js__WEBPACK_IMPORTED_MODULE_122__ = __webpack_require__(/*! ./isFunction.js */ "./node_modules/lodash-es/isFunction.js");
  115560. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isFunction", function() { return _isFunction_js__WEBPACK_IMPORTED_MODULE_122__["default"]; });
  115561. /* harmony import */ var _isInteger_js__WEBPACK_IMPORTED_MODULE_123__ = __webpack_require__(/*! ./isInteger.js */ "./node_modules/lodash-es/isInteger.js");
  115562. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isInteger", function() { return _isInteger_js__WEBPACK_IMPORTED_MODULE_123__["default"]; });
  115563. /* harmony import */ var _isLength_js__WEBPACK_IMPORTED_MODULE_124__ = __webpack_require__(/*! ./isLength.js */ "./node_modules/lodash-es/isLength.js");
  115564. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isLength", function() { return _isLength_js__WEBPACK_IMPORTED_MODULE_124__["default"]; });
  115565. /* harmony import */ var _isMap_js__WEBPACK_IMPORTED_MODULE_125__ = __webpack_require__(/*! ./isMap.js */ "./node_modules/lodash-es/isMap.js");
  115566. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isMap", function() { return _isMap_js__WEBPACK_IMPORTED_MODULE_125__["default"]; });
  115567. /* harmony import */ var _isMatch_js__WEBPACK_IMPORTED_MODULE_126__ = __webpack_require__(/*! ./isMatch.js */ "./node_modules/lodash-es/isMatch.js");
  115568. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isMatch", function() { return _isMatch_js__WEBPACK_IMPORTED_MODULE_126__["default"]; });
  115569. /* harmony import */ var _isMatchWith_js__WEBPACK_IMPORTED_MODULE_127__ = __webpack_require__(/*! ./isMatchWith.js */ "./node_modules/lodash-es/isMatchWith.js");
  115570. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isMatchWith", function() { return _isMatchWith_js__WEBPACK_IMPORTED_MODULE_127__["default"]; });
  115571. /* harmony import */ var _isNaN_js__WEBPACK_IMPORTED_MODULE_128__ = __webpack_require__(/*! ./isNaN.js */ "./node_modules/lodash-es/isNaN.js");
  115572. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isNaN", function() { return _isNaN_js__WEBPACK_IMPORTED_MODULE_128__["default"]; });
  115573. /* harmony import */ var _isNative_js__WEBPACK_IMPORTED_MODULE_129__ = __webpack_require__(/*! ./isNative.js */ "./node_modules/lodash-es/isNative.js");
  115574. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isNative", function() { return _isNative_js__WEBPACK_IMPORTED_MODULE_129__["default"]; });
  115575. /* harmony import */ var _isNil_js__WEBPACK_IMPORTED_MODULE_130__ = __webpack_require__(/*! ./isNil.js */ "./node_modules/lodash-es/isNil.js");
  115576. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isNil", function() { return _isNil_js__WEBPACK_IMPORTED_MODULE_130__["default"]; });
  115577. /* harmony import */ var _isNull_js__WEBPACK_IMPORTED_MODULE_131__ = __webpack_require__(/*! ./isNull.js */ "./node_modules/lodash-es/isNull.js");
  115578. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isNull", function() { return _isNull_js__WEBPACK_IMPORTED_MODULE_131__["default"]; });
  115579. /* harmony import */ var _isNumber_js__WEBPACK_IMPORTED_MODULE_132__ = __webpack_require__(/*! ./isNumber.js */ "./node_modules/lodash-es/isNumber.js");
  115580. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isNumber", function() { return _isNumber_js__WEBPACK_IMPORTED_MODULE_132__["default"]; });
  115581. /* harmony import */ var _isObject_js__WEBPACK_IMPORTED_MODULE_133__ = __webpack_require__(/*! ./isObject.js */ "./node_modules/lodash-es/isObject.js");
  115582. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isObject", function() { return _isObject_js__WEBPACK_IMPORTED_MODULE_133__["default"]; });
  115583. /* harmony import */ var _isObjectLike_js__WEBPACK_IMPORTED_MODULE_134__ = __webpack_require__(/*! ./isObjectLike.js */ "./node_modules/lodash-es/isObjectLike.js");
  115584. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isObjectLike", function() { return _isObjectLike_js__WEBPACK_IMPORTED_MODULE_134__["default"]; });
  115585. /* harmony import */ var _isPlainObject_js__WEBPACK_IMPORTED_MODULE_135__ = __webpack_require__(/*! ./isPlainObject.js */ "./node_modules/lodash-es/isPlainObject.js");
  115586. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isPlainObject", function() { return _isPlainObject_js__WEBPACK_IMPORTED_MODULE_135__["default"]; });
  115587. /* harmony import */ var _isRegExp_js__WEBPACK_IMPORTED_MODULE_136__ = __webpack_require__(/*! ./isRegExp.js */ "./node_modules/lodash-es/isRegExp.js");
  115588. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isRegExp", function() { return _isRegExp_js__WEBPACK_IMPORTED_MODULE_136__["default"]; });
  115589. /* harmony import */ var _isSafeInteger_js__WEBPACK_IMPORTED_MODULE_137__ = __webpack_require__(/*! ./isSafeInteger.js */ "./node_modules/lodash-es/isSafeInteger.js");
  115590. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isSafeInteger", function() { return _isSafeInteger_js__WEBPACK_IMPORTED_MODULE_137__["default"]; });
  115591. /* harmony import */ var _isSet_js__WEBPACK_IMPORTED_MODULE_138__ = __webpack_require__(/*! ./isSet.js */ "./node_modules/lodash-es/isSet.js");
  115592. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isSet", function() { return _isSet_js__WEBPACK_IMPORTED_MODULE_138__["default"]; });
  115593. /* harmony import */ var _isString_js__WEBPACK_IMPORTED_MODULE_139__ = __webpack_require__(/*! ./isString.js */ "./node_modules/lodash-es/isString.js");
  115594. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isString", function() { return _isString_js__WEBPACK_IMPORTED_MODULE_139__["default"]; });
  115595. /* harmony import */ var _isSymbol_js__WEBPACK_IMPORTED_MODULE_140__ = __webpack_require__(/*! ./isSymbol.js */ "./node_modules/lodash-es/isSymbol.js");
  115596. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isSymbol", function() { return _isSymbol_js__WEBPACK_IMPORTED_MODULE_140__["default"]; });
  115597. /* harmony import */ var _isTypedArray_js__WEBPACK_IMPORTED_MODULE_141__ = __webpack_require__(/*! ./isTypedArray.js */ "./node_modules/lodash-es/isTypedArray.js");
  115598. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isTypedArray", function() { return _isTypedArray_js__WEBPACK_IMPORTED_MODULE_141__["default"]; });
  115599. /* harmony import */ var _isUndefined_js__WEBPACK_IMPORTED_MODULE_142__ = __webpack_require__(/*! ./isUndefined.js */ "./node_modules/lodash-es/isUndefined.js");
  115600. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isUndefined", function() { return _isUndefined_js__WEBPACK_IMPORTED_MODULE_142__["default"]; });
  115601. /* harmony import */ var _isWeakMap_js__WEBPACK_IMPORTED_MODULE_143__ = __webpack_require__(/*! ./isWeakMap.js */ "./node_modules/lodash-es/isWeakMap.js");
  115602. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isWeakMap", function() { return _isWeakMap_js__WEBPACK_IMPORTED_MODULE_143__["default"]; });
  115603. /* harmony import */ var _isWeakSet_js__WEBPACK_IMPORTED_MODULE_144__ = __webpack_require__(/*! ./isWeakSet.js */ "./node_modules/lodash-es/isWeakSet.js");
  115604. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isWeakSet", function() { return _isWeakSet_js__WEBPACK_IMPORTED_MODULE_144__["default"]; });
  115605. /* harmony import */ var _iteratee_js__WEBPACK_IMPORTED_MODULE_145__ = __webpack_require__(/*! ./iteratee.js */ "./node_modules/lodash-es/iteratee.js");
  115606. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "iteratee", function() { return _iteratee_js__WEBPACK_IMPORTED_MODULE_145__["default"]; });
  115607. /* harmony import */ var _join_js__WEBPACK_IMPORTED_MODULE_146__ = __webpack_require__(/*! ./join.js */ "./node_modules/lodash-es/join.js");
  115608. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "join", function() { return _join_js__WEBPACK_IMPORTED_MODULE_146__["default"]; });
  115609. /* harmony import */ var _kebabCase_js__WEBPACK_IMPORTED_MODULE_147__ = __webpack_require__(/*! ./kebabCase.js */ "./node_modules/lodash-es/kebabCase.js");
  115610. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "kebabCase", function() { return _kebabCase_js__WEBPACK_IMPORTED_MODULE_147__["default"]; });
  115611. /* harmony import */ var _keyBy_js__WEBPACK_IMPORTED_MODULE_148__ = __webpack_require__(/*! ./keyBy.js */ "./node_modules/lodash-es/keyBy.js");
  115612. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "keyBy", function() { return _keyBy_js__WEBPACK_IMPORTED_MODULE_148__["default"]; });
  115613. /* harmony import */ var _keys_js__WEBPACK_IMPORTED_MODULE_149__ = __webpack_require__(/*! ./keys.js */ "./node_modules/lodash-es/keys.js");
  115614. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "keys", function() { return _keys_js__WEBPACK_IMPORTED_MODULE_149__["default"]; });
  115615. /* harmony import */ var _keysIn_js__WEBPACK_IMPORTED_MODULE_150__ = __webpack_require__(/*! ./keysIn.js */ "./node_modules/lodash-es/keysIn.js");
  115616. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "keysIn", function() { return _keysIn_js__WEBPACK_IMPORTED_MODULE_150__["default"]; });
  115617. /* harmony import */ var _last_js__WEBPACK_IMPORTED_MODULE_151__ = __webpack_require__(/*! ./last.js */ "./node_modules/lodash-es/last.js");
  115618. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "last", function() { return _last_js__WEBPACK_IMPORTED_MODULE_151__["default"]; });
  115619. /* harmony import */ var _lastIndexOf_js__WEBPACK_IMPORTED_MODULE_152__ = __webpack_require__(/*! ./lastIndexOf.js */ "./node_modules/lodash-es/lastIndexOf.js");
  115620. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "lastIndexOf", function() { return _lastIndexOf_js__WEBPACK_IMPORTED_MODULE_152__["default"]; });
  115621. /* harmony import */ var _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_153__ = __webpack_require__(/*! ./wrapperLodash.js */ "./node_modules/lodash-es/wrapperLodash.js");
  115622. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "lodash", function() { return _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_153__["default"]; });
  115623. /* harmony import */ var _lowerCase_js__WEBPACK_IMPORTED_MODULE_154__ = __webpack_require__(/*! ./lowerCase.js */ "./node_modules/lodash-es/lowerCase.js");
  115624. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "lowerCase", function() { return _lowerCase_js__WEBPACK_IMPORTED_MODULE_154__["default"]; });
  115625. /* harmony import */ var _lowerFirst_js__WEBPACK_IMPORTED_MODULE_155__ = __webpack_require__(/*! ./lowerFirst.js */ "./node_modules/lodash-es/lowerFirst.js");
  115626. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "lowerFirst", function() { return _lowerFirst_js__WEBPACK_IMPORTED_MODULE_155__["default"]; });
  115627. /* harmony import */ var _lt_js__WEBPACK_IMPORTED_MODULE_156__ = __webpack_require__(/*! ./lt.js */ "./node_modules/lodash-es/lt.js");
  115628. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "lt", function() { return _lt_js__WEBPACK_IMPORTED_MODULE_156__["default"]; });
  115629. /* harmony import */ var _lte_js__WEBPACK_IMPORTED_MODULE_157__ = __webpack_require__(/*! ./lte.js */ "./node_modules/lodash-es/lte.js");
  115630. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "lte", function() { return _lte_js__WEBPACK_IMPORTED_MODULE_157__["default"]; });
  115631. /* harmony import */ var _map_js__WEBPACK_IMPORTED_MODULE_158__ = __webpack_require__(/*! ./map.js */ "./node_modules/lodash-es/map.js");
  115632. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "map", function() { return _map_js__WEBPACK_IMPORTED_MODULE_158__["default"]; });
  115633. /* harmony import */ var _mapKeys_js__WEBPACK_IMPORTED_MODULE_159__ = __webpack_require__(/*! ./mapKeys.js */ "./node_modules/lodash-es/mapKeys.js");
  115634. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "mapKeys", function() { return _mapKeys_js__WEBPACK_IMPORTED_MODULE_159__["default"]; });
  115635. /* harmony import */ var _mapValues_js__WEBPACK_IMPORTED_MODULE_160__ = __webpack_require__(/*! ./mapValues.js */ "./node_modules/lodash-es/mapValues.js");
  115636. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "mapValues", function() { return _mapValues_js__WEBPACK_IMPORTED_MODULE_160__["default"]; });
  115637. /* harmony import */ var _matches_js__WEBPACK_IMPORTED_MODULE_161__ = __webpack_require__(/*! ./matches.js */ "./node_modules/lodash-es/matches.js");
  115638. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "matches", function() { return _matches_js__WEBPACK_IMPORTED_MODULE_161__["default"]; });
  115639. /* harmony import */ var _matchesProperty_js__WEBPACK_IMPORTED_MODULE_162__ = __webpack_require__(/*! ./matchesProperty.js */ "./node_modules/lodash-es/matchesProperty.js");
  115640. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "matchesProperty", function() { return _matchesProperty_js__WEBPACK_IMPORTED_MODULE_162__["default"]; });
  115641. /* harmony import */ var _max_js__WEBPACK_IMPORTED_MODULE_163__ = __webpack_require__(/*! ./max.js */ "./node_modules/lodash-es/max.js");
  115642. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "max", function() { return _max_js__WEBPACK_IMPORTED_MODULE_163__["default"]; });
  115643. /* harmony import */ var _maxBy_js__WEBPACK_IMPORTED_MODULE_164__ = __webpack_require__(/*! ./maxBy.js */ "./node_modules/lodash-es/maxBy.js");
  115644. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "maxBy", function() { return _maxBy_js__WEBPACK_IMPORTED_MODULE_164__["default"]; });
  115645. /* harmony import */ var _mean_js__WEBPACK_IMPORTED_MODULE_165__ = __webpack_require__(/*! ./mean.js */ "./node_modules/lodash-es/mean.js");
  115646. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "mean", function() { return _mean_js__WEBPACK_IMPORTED_MODULE_165__["default"]; });
  115647. /* harmony import */ var _meanBy_js__WEBPACK_IMPORTED_MODULE_166__ = __webpack_require__(/*! ./meanBy.js */ "./node_modules/lodash-es/meanBy.js");
  115648. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "meanBy", function() { return _meanBy_js__WEBPACK_IMPORTED_MODULE_166__["default"]; });
  115649. /* harmony import */ var _memoize_js__WEBPACK_IMPORTED_MODULE_167__ = __webpack_require__(/*! ./memoize.js */ "./node_modules/lodash-es/memoize.js");
  115650. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "memoize", function() { return _memoize_js__WEBPACK_IMPORTED_MODULE_167__["default"]; });
  115651. /* harmony import */ var _merge_js__WEBPACK_IMPORTED_MODULE_168__ = __webpack_require__(/*! ./merge.js */ "./node_modules/lodash-es/merge.js");
  115652. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "merge", function() { return _merge_js__WEBPACK_IMPORTED_MODULE_168__["default"]; });
  115653. /* harmony import */ var _mergeWith_js__WEBPACK_IMPORTED_MODULE_169__ = __webpack_require__(/*! ./mergeWith.js */ "./node_modules/lodash-es/mergeWith.js");
  115654. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "mergeWith", function() { return _mergeWith_js__WEBPACK_IMPORTED_MODULE_169__["default"]; });
  115655. /* harmony import */ var _method_js__WEBPACK_IMPORTED_MODULE_170__ = __webpack_require__(/*! ./method.js */ "./node_modules/lodash-es/method.js");
  115656. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "method", function() { return _method_js__WEBPACK_IMPORTED_MODULE_170__["default"]; });
  115657. /* harmony import */ var _methodOf_js__WEBPACK_IMPORTED_MODULE_171__ = __webpack_require__(/*! ./methodOf.js */ "./node_modules/lodash-es/methodOf.js");
  115658. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "methodOf", function() { return _methodOf_js__WEBPACK_IMPORTED_MODULE_171__["default"]; });
  115659. /* harmony import */ var _min_js__WEBPACK_IMPORTED_MODULE_172__ = __webpack_require__(/*! ./min.js */ "./node_modules/lodash-es/min.js");
  115660. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "min", function() { return _min_js__WEBPACK_IMPORTED_MODULE_172__["default"]; });
  115661. /* harmony import */ var _minBy_js__WEBPACK_IMPORTED_MODULE_173__ = __webpack_require__(/*! ./minBy.js */ "./node_modules/lodash-es/minBy.js");
  115662. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "minBy", function() { return _minBy_js__WEBPACK_IMPORTED_MODULE_173__["default"]; });
  115663. /* harmony import */ var _mixin_js__WEBPACK_IMPORTED_MODULE_174__ = __webpack_require__(/*! ./mixin.js */ "./node_modules/lodash-es/mixin.js");
  115664. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "mixin", function() { return _mixin_js__WEBPACK_IMPORTED_MODULE_174__["default"]; });
  115665. /* harmony import */ var _multiply_js__WEBPACK_IMPORTED_MODULE_175__ = __webpack_require__(/*! ./multiply.js */ "./node_modules/lodash-es/multiply.js");
  115666. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "multiply", function() { return _multiply_js__WEBPACK_IMPORTED_MODULE_175__["default"]; });
  115667. /* harmony import */ var _negate_js__WEBPACK_IMPORTED_MODULE_176__ = __webpack_require__(/*! ./negate.js */ "./node_modules/lodash-es/negate.js");
  115668. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "negate", function() { return _negate_js__WEBPACK_IMPORTED_MODULE_176__["default"]; });
  115669. /* harmony import */ var _next_js__WEBPACK_IMPORTED_MODULE_177__ = __webpack_require__(/*! ./next.js */ "./node_modules/lodash-es/next.js");
  115670. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "next", function() { return _next_js__WEBPACK_IMPORTED_MODULE_177__["default"]; });
  115671. /* harmony import */ var _noop_js__WEBPACK_IMPORTED_MODULE_178__ = __webpack_require__(/*! ./noop.js */ "./node_modules/lodash-es/noop.js");
  115672. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "noop", function() { return _noop_js__WEBPACK_IMPORTED_MODULE_178__["default"]; });
  115673. /* harmony import */ var _now_js__WEBPACK_IMPORTED_MODULE_179__ = __webpack_require__(/*! ./now.js */ "./node_modules/lodash-es/now.js");
  115674. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "now", function() { return _now_js__WEBPACK_IMPORTED_MODULE_179__["default"]; });
  115675. /* harmony import */ var _nth_js__WEBPACK_IMPORTED_MODULE_180__ = __webpack_require__(/*! ./nth.js */ "./node_modules/lodash-es/nth.js");
  115676. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "nth", function() { return _nth_js__WEBPACK_IMPORTED_MODULE_180__["default"]; });
  115677. /* harmony import */ var _nthArg_js__WEBPACK_IMPORTED_MODULE_181__ = __webpack_require__(/*! ./nthArg.js */ "./node_modules/lodash-es/nthArg.js");
  115678. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "nthArg", function() { return _nthArg_js__WEBPACK_IMPORTED_MODULE_181__["default"]; });
  115679. /* harmony import */ var _omit_js__WEBPACK_IMPORTED_MODULE_182__ = __webpack_require__(/*! ./omit.js */ "./node_modules/lodash-es/omit.js");
  115680. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "omit", function() { return _omit_js__WEBPACK_IMPORTED_MODULE_182__["default"]; });
  115681. /* harmony import */ var _omitBy_js__WEBPACK_IMPORTED_MODULE_183__ = __webpack_require__(/*! ./omitBy.js */ "./node_modules/lodash-es/omitBy.js");
  115682. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "omitBy", function() { return _omitBy_js__WEBPACK_IMPORTED_MODULE_183__["default"]; });
  115683. /* harmony import */ var _once_js__WEBPACK_IMPORTED_MODULE_184__ = __webpack_require__(/*! ./once.js */ "./node_modules/lodash-es/once.js");
  115684. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "once", function() { return _once_js__WEBPACK_IMPORTED_MODULE_184__["default"]; });
  115685. /* harmony import */ var _orderBy_js__WEBPACK_IMPORTED_MODULE_185__ = __webpack_require__(/*! ./orderBy.js */ "./node_modules/lodash-es/orderBy.js");
  115686. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "orderBy", function() { return _orderBy_js__WEBPACK_IMPORTED_MODULE_185__["default"]; });
  115687. /* harmony import */ var _over_js__WEBPACK_IMPORTED_MODULE_186__ = __webpack_require__(/*! ./over.js */ "./node_modules/lodash-es/over.js");
  115688. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "over", function() { return _over_js__WEBPACK_IMPORTED_MODULE_186__["default"]; });
  115689. /* harmony import */ var _overArgs_js__WEBPACK_IMPORTED_MODULE_187__ = __webpack_require__(/*! ./overArgs.js */ "./node_modules/lodash-es/overArgs.js");
  115690. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "overArgs", function() { return _overArgs_js__WEBPACK_IMPORTED_MODULE_187__["default"]; });
  115691. /* harmony import */ var _overEvery_js__WEBPACK_IMPORTED_MODULE_188__ = __webpack_require__(/*! ./overEvery.js */ "./node_modules/lodash-es/overEvery.js");
  115692. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "overEvery", function() { return _overEvery_js__WEBPACK_IMPORTED_MODULE_188__["default"]; });
  115693. /* harmony import */ var _overSome_js__WEBPACK_IMPORTED_MODULE_189__ = __webpack_require__(/*! ./overSome.js */ "./node_modules/lodash-es/overSome.js");
  115694. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "overSome", function() { return _overSome_js__WEBPACK_IMPORTED_MODULE_189__["default"]; });
  115695. /* harmony import */ var _pad_js__WEBPACK_IMPORTED_MODULE_190__ = __webpack_require__(/*! ./pad.js */ "./node_modules/lodash-es/pad.js");
  115696. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "pad", function() { return _pad_js__WEBPACK_IMPORTED_MODULE_190__["default"]; });
  115697. /* harmony import */ var _padEnd_js__WEBPACK_IMPORTED_MODULE_191__ = __webpack_require__(/*! ./padEnd.js */ "./node_modules/lodash-es/padEnd.js");
  115698. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "padEnd", function() { return _padEnd_js__WEBPACK_IMPORTED_MODULE_191__["default"]; });
  115699. /* harmony import */ var _padStart_js__WEBPACK_IMPORTED_MODULE_192__ = __webpack_require__(/*! ./padStart.js */ "./node_modules/lodash-es/padStart.js");
  115700. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "padStart", function() { return _padStart_js__WEBPACK_IMPORTED_MODULE_192__["default"]; });
  115701. /* harmony import */ var _parseInt_js__WEBPACK_IMPORTED_MODULE_193__ = __webpack_require__(/*! ./parseInt.js */ "./node_modules/lodash-es/parseInt.js");
  115702. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "parseInt", function() { return _parseInt_js__WEBPACK_IMPORTED_MODULE_193__["default"]; });
  115703. /* harmony import */ var _partial_js__WEBPACK_IMPORTED_MODULE_194__ = __webpack_require__(/*! ./partial.js */ "./node_modules/lodash-es/partial.js");
  115704. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "partial", function() { return _partial_js__WEBPACK_IMPORTED_MODULE_194__["default"]; });
  115705. /* harmony import */ var _partialRight_js__WEBPACK_IMPORTED_MODULE_195__ = __webpack_require__(/*! ./partialRight.js */ "./node_modules/lodash-es/partialRight.js");
  115706. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "partialRight", function() { return _partialRight_js__WEBPACK_IMPORTED_MODULE_195__["default"]; });
  115707. /* harmony import */ var _partition_js__WEBPACK_IMPORTED_MODULE_196__ = __webpack_require__(/*! ./partition.js */ "./node_modules/lodash-es/partition.js");
  115708. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "partition", function() { return _partition_js__WEBPACK_IMPORTED_MODULE_196__["default"]; });
  115709. /* harmony import */ var _pick_js__WEBPACK_IMPORTED_MODULE_197__ = __webpack_require__(/*! ./pick.js */ "./node_modules/lodash-es/pick.js");
  115710. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "pick", function() { return _pick_js__WEBPACK_IMPORTED_MODULE_197__["default"]; });
  115711. /* harmony import */ var _pickBy_js__WEBPACK_IMPORTED_MODULE_198__ = __webpack_require__(/*! ./pickBy.js */ "./node_modules/lodash-es/pickBy.js");
  115712. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "pickBy", function() { return _pickBy_js__WEBPACK_IMPORTED_MODULE_198__["default"]; });
  115713. /* harmony import */ var _plant_js__WEBPACK_IMPORTED_MODULE_199__ = __webpack_require__(/*! ./plant.js */ "./node_modules/lodash-es/plant.js");
  115714. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "plant", function() { return _plant_js__WEBPACK_IMPORTED_MODULE_199__["default"]; });
  115715. /* harmony import */ var _property_js__WEBPACK_IMPORTED_MODULE_200__ = __webpack_require__(/*! ./property.js */ "./node_modules/lodash-es/property.js");
  115716. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "property", function() { return _property_js__WEBPACK_IMPORTED_MODULE_200__["default"]; });
  115717. /* harmony import */ var _propertyOf_js__WEBPACK_IMPORTED_MODULE_201__ = __webpack_require__(/*! ./propertyOf.js */ "./node_modules/lodash-es/propertyOf.js");
  115718. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "propertyOf", function() { return _propertyOf_js__WEBPACK_IMPORTED_MODULE_201__["default"]; });
  115719. /* harmony import */ var _pull_js__WEBPACK_IMPORTED_MODULE_202__ = __webpack_require__(/*! ./pull.js */ "./node_modules/lodash-es/pull.js");
  115720. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "pull", function() { return _pull_js__WEBPACK_IMPORTED_MODULE_202__["default"]; });
  115721. /* harmony import */ var _pullAll_js__WEBPACK_IMPORTED_MODULE_203__ = __webpack_require__(/*! ./pullAll.js */ "./node_modules/lodash-es/pullAll.js");
  115722. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "pullAll", function() { return _pullAll_js__WEBPACK_IMPORTED_MODULE_203__["default"]; });
  115723. /* harmony import */ var _pullAllBy_js__WEBPACK_IMPORTED_MODULE_204__ = __webpack_require__(/*! ./pullAllBy.js */ "./node_modules/lodash-es/pullAllBy.js");
  115724. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "pullAllBy", function() { return _pullAllBy_js__WEBPACK_IMPORTED_MODULE_204__["default"]; });
  115725. /* harmony import */ var _pullAllWith_js__WEBPACK_IMPORTED_MODULE_205__ = __webpack_require__(/*! ./pullAllWith.js */ "./node_modules/lodash-es/pullAllWith.js");
  115726. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "pullAllWith", function() { return _pullAllWith_js__WEBPACK_IMPORTED_MODULE_205__["default"]; });
  115727. /* harmony import */ var _pullAt_js__WEBPACK_IMPORTED_MODULE_206__ = __webpack_require__(/*! ./pullAt.js */ "./node_modules/lodash-es/pullAt.js");
  115728. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "pullAt", function() { return _pullAt_js__WEBPACK_IMPORTED_MODULE_206__["default"]; });
  115729. /* harmony import */ var _random_js__WEBPACK_IMPORTED_MODULE_207__ = __webpack_require__(/*! ./random.js */ "./node_modules/lodash-es/random.js");
  115730. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "random", function() { return _random_js__WEBPACK_IMPORTED_MODULE_207__["default"]; });
  115731. /* harmony import */ var _range_js__WEBPACK_IMPORTED_MODULE_208__ = __webpack_require__(/*! ./range.js */ "./node_modules/lodash-es/range.js");
  115732. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "range", function() { return _range_js__WEBPACK_IMPORTED_MODULE_208__["default"]; });
  115733. /* harmony import */ var _rangeRight_js__WEBPACK_IMPORTED_MODULE_209__ = __webpack_require__(/*! ./rangeRight.js */ "./node_modules/lodash-es/rangeRight.js");
  115734. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "rangeRight", function() { return _rangeRight_js__WEBPACK_IMPORTED_MODULE_209__["default"]; });
  115735. /* harmony import */ var _rearg_js__WEBPACK_IMPORTED_MODULE_210__ = __webpack_require__(/*! ./rearg.js */ "./node_modules/lodash-es/rearg.js");
  115736. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "rearg", function() { return _rearg_js__WEBPACK_IMPORTED_MODULE_210__["default"]; });
  115737. /* harmony import */ var _reduce_js__WEBPACK_IMPORTED_MODULE_211__ = __webpack_require__(/*! ./reduce.js */ "./node_modules/lodash-es/reduce.js");
  115738. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "reduce", function() { return _reduce_js__WEBPACK_IMPORTED_MODULE_211__["default"]; });
  115739. /* harmony import */ var _reduceRight_js__WEBPACK_IMPORTED_MODULE_212__ = __webpack_require__(/*! ./reduceRight.js */ "./node_modules/lodash-es/reduceRight.js");
  115740. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "reduceRight", function() { return _reduceRight_js__WEBPACK_IMPORTED_MODULE_212__["default"]; });
  115741. /* harmony import */ var _reject_js__WEBPACK_IMPORTED_MODULE_213__ = __webpack_require__(/*! ./reject.js */ "./node_modules/lodash-es/reject.js");
  115742. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "reject", function() { return _reject_js__WEBPACK_IMPORTED_MODULE_213__["default"]; });
  115743. /* harmony import */ var _remove_js__WEBPACK_IMPORTED_MODULE_214__ = __webpack_require__(/*! ./remove.js */ "./node_modules/lodash-es/remove.js");
  115744. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "remove", function() { return _remove_js__WEBPACK_IMPORTED_MODULE_214__["default"]; });
  115745. /* harmony import */ var _repeat_js__WEBPACK_IMPORTED_MODULE_215__ = __webpack_require__(/*! ./repeat.js */ "./node_modules/lodash-es/repeat.js");
  115746. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "repeat", function() { return _repeat_js__WEBPACK_IMPORTED_MODULE_215__["default"]; });
  115747. /* harmony import */ var _replace_js__WEBPACK_IMPORTED_MODULE_216__ = __webpack_require__(/*! ./replace.js */ "./node_modules/lodash-es/replace.js");
  115748. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "replace", function() { return _replace_js__WEBPACK_IMPORTED_MODULE_216__["default"]; });
  115749. /* harmony import */ var _rest_js__WEBPACK_IMPORTED_MODULE_217__ = __webpack_require__(/*! ./rest.js */ "./node_modules/lodash-es/rest.js");
  115750. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "rest", function() { return _rest_js__WEBPACK_IMPORTED_MODULE_217__["default"]; });
  115751. /* harmony import */ var _result_js__WEBPACK_IMPORTED_MODULE_218__ = __webpack_require__(/*! ./result.js */ "./node_modules/lodash-es/result.js");
  115752. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "result", function() { return _result_js__WEBPACK_IMPORTED_MODULE_218__["default"]; });
  115753. /* harmony import */ var _reverse_js__WEBPACK_IMPORTED_MODULE_219__ = __webpack_require__(/*! ./reverse.js */ "./node_modules/lodash-es/reverse.js");
  115754. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "reverse", function() { return _reverse_js__WEBPACK_IMPORTED_MODULE_219__["default"]; });
  115755. /* harmony import */ var _round_js__WEBPACK_IMPORTED_MODULE_220__ = __webpack_require__(/*! ./round.js */ "./node_modules/lodash-es/round.js");
  115756. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "round", function() { return _round_js__WEBPACK_IMPORTED_MODULE_220__["default"]; });
  115757. /* harmony import */ var _sample_js__WEBPACK_IMPORTED_MODULE_221__ = __webpack_require__(/*! ./sample.js */ "./node_modules/lodash-es/sample.js");
  115758. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "sample", function() { return _sample_js__WEBPACK_IMPORTED_MODULE_221__["default"]; });
  115759. /* harmony import */ var _sampleSize_js__WEBPACK_IMPORTED_MODULE_222__ = __webpack_require__(/*! ./sampleSize.js */ "./node_modules/lodash-es/sampleSize.js");
  115760. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "sampleSize", function() { return _sampleSize_js__WEBPACK_IMPORTED_MODULE_222__["default"]; });
  115761. /* harmony import */ var _set_js__WEBPACK_IMPORTED_MODULE_223__ = __webpack_require__(/*! ./set.js */ "./node_modules/lodash-es/set.js");
  115762. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "set", function() { return _set_js__WEBPACK_IMPORTED_MODULE_223__["default"]; });
  115763. /* harmony import */ var _setWith_js__WEBPACK_IMPORTED_MODULE_224__ = __webpack_require__(/*! ./setWith.js */ "./node_modules/lodash-es/setWith.js");
  115764. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "setWith", function() { return _setWith_js__WEBPACK_IMPORTED_MODULE_224__["default"]; });
  115765. /* harmony import */ var _shuffle_js__WEBPACK_IMPORTED_MODULE_225__ = __webpack_require__(/*! ./shuffle.js */ "./node_modules/lodash-es/shuffle.js");
  115766. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "shuffle", function() { return _shuffle_js__WEBPACK_IMPORTED_MODULE_225__["default"]; });
  115767. /* harmony import */ var _size_js__WEBPACK_IMPORTED_MODULE_226__ = __webpack_require__(/*! ./size.js */ "./node_modules/lodash-es/size.js");
  115768. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "size", function() { return _size_js__WEBPACK_IMPORTED_MODULE_226__["default"]; });
  115769. /* harmony import */ var _slice_js__WEBPACK_IMPORTED_MODULE_227__ = __webpack_require__(/*! ./slice.js */ "./node_modules/lodash-es/slice.js");
  115770. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "slice", function() { return _slice_js__WEBPACK_IMPORTED_MODULE_227__["default"]; });
  115771. /* harmony import */ var _snakeCase_js__WEBPACK_IMPORTED_MODULE_228__ = __webpack_require__(/*! ./snakeCase.js */ "./node_modules/lodash-es/snakeCase.js");
  115772. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "snakeCase", function() { return _snakeCase_js__WEBPACK_IMPORTED_MODULE_228__["default"]; });
  115773. /* harmony import */ var _some_js__WEBPACK_IMPORTED_MODULE_229__ = __webpack_require__(/*! ./some.js */ "./node_modules/lodash-es/some.js");
  115774. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "some", function() { return _some_js__WEBPACK_IMPORTED_MODULE_229__["default"]; });
  115775. /* harmony import */ var _sortBy_js__WEBPACK_IMPORTED_MODULE_230__ = __webpack_require__(/*! ./sortBy.js */ "./node_modules/lodash-es/sortBy.js");
  115776. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "sortBy", function() { return _sortBy_js__WEBPACK_IMPORTED_MODULE_230__["default"]; });
  115777. /* harmony import */ var _sortedIndex_js__WEBPACK_IMPORTED_MODULE_231__ = __webpack_require__(/*! ./sortedIndex.js */ "./node_modules/lodash-es/sortedIndex.js");
  115778. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "sortedIndex", function() { return _sortedIndex_js__WEBPACK_IMPORTED_MODULE_231__["default"]; });
  115779. /* harmony import */ var _sortedIndexBy_js__WEBPACK_IMPORTED_MODULE_232__ = __webpack_require__(/*! ./sortedIndexBy.js */ "./node_modules/lodash-es/sortedIndexBy.js");
  115780. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "sortedIndexBy", function() { return _sortedIndexBy_js__WEBPACK_IMPORTED_MODULE_232__["default"]; });
  115781. /* harmony import */ var _sortedIndexOf_js__WEBPACK_IMPORTED_MODULE_233__ = __webpack_require__(/*! ./sortedIndexOf.js */ "./node_modules/lodash-es/sortedIndexOf.js");
  115782. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "sortedIndexOf", function() { return _sortedIndexOf_js__WEBPACK_IMPORTED_MODULE_233__["default"]; });
  115783. /* harmony import */ var _sortedLastIndex_js__WEBPACK_IMPORTED_MODULE_234__ = __webpack_require__(/*! ./sortedLastIndex.js */ "./node_modules/lodash-es/sortedLastIndex.js");
  115784. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "sortedLastIndex", function() { return _sortedLastIndex_js__WEBPACK_IMPORTED_MODULE_234__["default"]; });
  115785. /* harmony import */ var _sortedLastIndexBy_js__WEBPACK_IMPORTED_MODULE_235__ = __webpack_require__(/*! ./sortedLastIndexBy.js */ "./node_modules/lodash-es/sortedLastIndexBy.js");
  115786. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "sortedLastIndexBy", function() { return _sortedLastIndexBy_js__WEBPACK_IMPORTED_MODULE_235__["default"]; });
  115787. /* harmony import */ var _sortedLastIndexOf_js__WEBPACK_IMPORTED_MODULE_236__ = __webpack_require__(/*! ./sortedLastIndexOf.js */ "./node_modules/lodash-es/sortedLastIndexOf.js");
  115788. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "sortedLastIndexOf", function() { return _sortedLastIndexOf_js__WEBPACK_IMPORTED_MODULE_236__["default"]; });
  115789. /* harmony import */ var _sortedUniq_js__WEBPACK_IMPORTED_MODULE_237__ = __webpack_require__(/*! ./sortedUniq.js */ "./node_modules/lodash-es/sortedUniq.js");
  115790. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "sortedUniq", function() { return _sortedUniq_js__WEBPACK_IMPORTED_MODULE_237__["default"]; });
  115791. /* harmony import */ var _sortedUniqBy_js__WEBPACK_IMPORTED_MODULE_238__ = __webpack_require__(/*! ./sortedUniqBy.js */ "./node_modules/lodash-es/sortedUniqBy.js");
  115792. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "sortedUniqBy", function() { return _sortedUniqBy_js__WEBPACK_IMPORTED_MODULE_238__["default"]; });
  115793. /* harmony import */ var _split_js__WEBPACK_IMPORTED_MODULE_239__ = __webpack_require__(/*! ./split.js */ "./node_modules/lodash-es/split.js");
  115794. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "split", function() { return _split_js__WEBPACK_IMPORTED_MODULE_239__["default"]; });
  115795. /* harmony import */ var _spread_js__WEBPACK_IMPORTED_MODULE_240__ = __webpack_require__(/*! ./spread.js */ "./node_modules/lodash-es/spread.js");
  115796. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "spread", function() { return _spread_js__WEBPACK_IMPORTED_MODULE_240__["default"]; });
  115797. /* harmony import */ var _startCase_js__WEBPACK_IMPORTED_MODULE_241__ = __webpack_require__(/*! ./startCase.js */ "./node_modules/lodash-es/startCase.js");
  115798. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "startCase", function() { return _startCase_js__WEBPACK_IMPORTED_MODULE_241__["default"]; });
  115799. /* harmony import */ var _startsWith_js__WEBPACK_IMPORTED_MODULE_242__ = __webpack_require__(/*! ./startsWith.js */ "./node_modules/lodash-es/startsWith.js");
  115800. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "startsWith", function() { return _startsWith_js__WEBPACK_IMPORTED_MODULE_242__["default"]; });
  115801. /* harmony import */ var _stubArray_js__WEBPACK_IMPORTED_MODULE_243__ = __webpack_require__(/*! ./stubArray.js */ "./node_modules/lodash-es/stubArray.js");
  115802. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "stubArray", function() { return _stubArray_js__WEBPACK_IMPORTED_MODULE_243__["default"]; });
  115803. /* harmony import */ var _stubFalse_js__WEBPACK_IMPORTED_MODULE_244__ = __webpack_require__(/*! ./stubFalse.js */ "./node_modules/lodash-es/stubFalse.js");
  115804. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "stubFalse", function() { return _stubFalse_js__WEBPACK_IMPORTED_MODULE_244__["default"]; });
  115805. /* harmony import */ var _stubObject_js__WEBPACK_IMPORTED_MODULE_245__ = __webpack_require__(/*! ./stubObject.js */ "./node_modules/lodash-es/stubObject.js");
  115806. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "stubObject", function() { return _stubObject_js__WEBPACK_IMPORTED_MODULE_245__["default"]; });
  115807. /* harmony import */ var _stubString_js__WEBPACK_IMPORTED_MODULE_246__ = __webpack_require__(/*! ./stubString.js */ "./node_modules/lodash-es/stubString.js");
  115808. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "stubString", function() { return _stubString_js__WEBPACK_IMPORTED_MODULE_246__["default"]; });
  115809. /* harmony import */ var _stubTrue_js__WEBPACK_IMPORTED_MODULE_247__ = __webpack_require__(/*! ./stubTrue.js */ "./node_modules/lodash-es/stubTrue.js");
  115810. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "stubTrue", function() { return _stubTrue_js__WEBPACK_IMPORTED_MODULE_247__["default"]; });
  115811. /* harmony import */ var _subtract_js__WEBPACK_IMPORTED_MODULE_248__ = __webpack_require__(/*! ./subtract.js */ "./node_modules/lodash-es/subtract.js");
  115812. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "subtract", function() { return _subtract_js__WEBPACK_IMPORTED_MODULE_248__["default"]; });
  115813. /* harmony import */ var _sum_js__WEBPACK_IMPORTED_MODULE_249__ = __webpack_require__(/*! ./sum.js */ "./node_modules/lodash-es/sum.js");
  115814. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "sum", function() { return _sum_js__WEBPACK_IMPORTED_MODULE_249__["default"]; });
  115815. /* harmony import */ var _sumBy_js__WEBPACK_IMPORTED_MODULE_250__ = __webpack_require__(/*! ./sumBy.js */ "./node_modules/lodash-es/sumBy.js");
  115816. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "sumBy", function() { return _sumBy_js__WEBPACK_IMPORTED_MODULE_250__["default"]; });
  115817. /* harmony import */ var _tail_js__WEBPACK_IMPORTED_MODULE_251__ = __webpack_require__(/*! ./tail.js */ "./node_modules/lodash-es/tail.js");
  115818. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "tail", function() { return _tail_js__WEBPACK_IMPORTED_MODULE_251__["default"]; });
  115819. /* harmony import */ var _take_js__WEBPACK_IMPORTED_MODULE_252__ = __webpack_require__(/*! ./take.js */ "./node_modules/lodash-es/take.js");
  115820. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "take", function() { return _take_js__WEBPACK_IMPORTED_MODULE_252__["default"]; });
  115821. /* harmony import */ var _takeRight_js__WEBPACK_IMPORTED_MODULE_253__ = __webpack_require__(/*! ./takeRight.js */ "./node_modules/lodash-es/takeRight.js");
  115822. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "takeRight", function() { return _takeRight_js__WEBPACK_IMPORTED_MODULE_253__["default"]; });
  115823. /* harmony import */ var _takeRightWhile_js__WEBPACK_IMPORTED_MODULE_254__ = __webpack_require__(/*! ./takeRightWhile.js */ "./node_modules/lodash-es/takeRightWhile.js");
  115824. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "takeRightWhile", function() { return _takeRightWhile_js__WEBPACK_IMPORTED_MODULE_254__["default"]; });
  115825. /* harmony import */ var _takeWhile_js__WEBPACK_IMPORTED_MODULE_255__ = __webpack_require__(/*! ./takeWhile.js */ "./node_modules/lodash-es/takeWhile.js");
  115826. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "takeWhile", function() { return _takeWhile_js__WEBPACK_IMPORTED_MODULE_255__["default"]; });
  115827. /* harmony import */ var _tap_js__WEBPACK_IMPORTED_MODULE_256__ = __webpack_require__(/*! ./tap.js */ "./node_modules/lodash-es/tap.js");
  115828. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "tap", function() { return _tap_js__WEBPACK_IMPORTED_MODULE_256__["default"]; });
  115829. /* harmony import */ var _template_js__WEBPACK_IMPORTED_MODULE_257__ = __webpack_require__(/*! ./template.js */ "./node_modules/lodash-es/template.js");
  115830. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "template", function() { return _template_js__WEBPACK_IMPORTED_MODULE_257__["default"]; });
  115831. /* harmony import */ var _templateSettings_js__WEBPACK_IMPORTED_MODULE_258__ = __webpack_require__(/*! ./templateSettings.js */ "./node_modules/lodash-es/templateSettings.js");
  115832. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "templateSettings", function() { return _templateSettings_js__WEBPACK_IMPORTED_MODULE_258__["default"]; });
  115833. /* harmony import */ var _throttle_js__WEBPACK_IMPORTED_MODULE_259__ = __webpack_require__(/*! ./throttle.js */ "./node_modules/lodash-es/throttle.js");
  115834. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "throttle", function() { return _throttle_js__WEBPACK_IMPORTED_MODULE_259__["default"]; });
  115835. /* harmony import */ var _thru_js__WEBPACK_IMPORTED_MODULE_260__ = __webpack_require__(/*! ./thru.js */ "./node_modules/lodash-es/thru.js");
  115836. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "thru", function() { return _thru_js__WEBPACK_IMPORTED_MODULE_260__["default"]; });
  115837. /* harmony import */ var _times_js__WEBPACK_IMPORTED_MODULE_261__ = __webpack_require__(/*! ./times.js */ "./node_modules/lodash-es/times.js");
  115838. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "times", function() { return _times_js__WEBPACK_IMPORTED_MODULE_261__["default"]; });
  115839. /* harmony import */ var _toArray_js__WEBPACK_IMPORTED_MODULE_262__ = __webpack_require__(/*! ./toArray.js */ "./node_modules/lodash-es/toArray.js");
  115840. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toArray", function() { return _toArray_js__WEBPACK_IMPORTED_MODULE_262__["default"]; });
  115841. /* harmony import */ var _toFinite_js__WEBPACK_IMPORTED_MODULE_263__ = __webpack_require__(/*! ./toFinite.js */ "./node_modules/lodash-es/toFinite.js");
  115842. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toFinite", function() { return _toFinite_js__WEBPACK_IMPORTED_MODULE_263__["default"]; });
  115843. /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_264__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
  115844. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toInteger", function() { return _toInteger_js__WEBPACK_IMPORTED_MODULE_264__["default"]; });
  115845. /* harmony import */ var _toIterator_js__WEBPACK_IMPORTED_MODULE_265__ = __webpack_require__(/*! ./toIterator.js */ "./node_modules/lodash-es/toIterator.js");
  115846. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toIterator", function() { return _toIterator_js__WEBPACK_IMPORTED_MODULE_265__["default"]; });
  115847. /* harmony import */ var _toJSON_js__WEBPACK_IMPORTED_MODULE_266__ = __webpack_require__(/*! ./toJSON.js */ "./node_modules/lodash-es/toJSON.js");
  115848. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toJSON", function() { return _toJSON_js__WEBPACK_IMPORTED_MODULE_266__["default"]; });
  115849. /* harmony import */ var _toLength_js__WEBPACK_IMPORTED_MODULE_267__ = __webpack_require__(/*! ./toLength.js */ "./node_modules/lodash-es/toLength.js");
  115850. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toLength", function() { return _toLength_js__WEBPACK_IMPORTED_MODULE_267__["default"]; });
  115851. /* harmony import */ var _toLower_js__WEBPACK_IMPORTED_MODULE_268__ = __webpack_require__(/*! ./toLower.js */ "./node_modules/lodash-es/toLower.js");
  115852. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toLower", function() { return _toLower_js__WEBPACK_IMPORTED_MODULE_268__["default"]; });
  115853. /* harmony import */ var _toNumber_js__WEBPACK_IMPORTED_MODULE_269__ = __webpack_require__(/*! ./toNumber.js */ "./node_modules/lodash-es/toNumber.js");
  115854. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toNumber", function() { return _toNumber_js__WEBPACK_IMPORTED_MODULE_269__["default"]; });
  115855. /* harmony import */ var _toPairs_js__WEBPACK_IMPORTED_MODULE_270__ = __webpack_require__(/*! ./toPairs.js */ "./node_modules/lodash-es/toPairs.js");
  115856. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toPairs", function() { return _toPairs_js__WEBPACK_IMPORTED_MODULE_270__["default"]; });
  115857. /* harmony import */ var _toPairsIn_js__WEBPACK_IMPORTED_MODULE_271__ = __webpack_require__(/*! ./toPairsIn.js */ "./node_modules/lodash-es/toPairsIn.js");
  115858. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toPairsIn", function() { return _toPairsIn_js__WEBPACK_IMPORTED_MODULE_271__["default"]; });
  115859. /* harmony import */ var _toPath_js__WEBPACK_IMPORTED_MODULE_272__ = __webpack_require__(/*! ./toPath.js */ "./node_modules/lodash-es/toPath.js");
  115860. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toPath", function() { return _toPath_js__WEBPACK_IMPORTED_MODULE_272__["default"]; });
  115861. /* harmony import */ var _toPlainObject_js__WEBPACK_IMPORTED_MODULE_273__ = __webpack_require__(/*! ./toPlainObject.js */ "./node_modules/lodash-es/toPlainObject.js");
  115862. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toPlainObject", function() { return _toPlainObject_js__WEBPACK_IMPORTED_MODULE_273__["default"]; });
  115863. /* harmony import */ var _toSafeInteger_js__WEBPACK_IMPORTED_MODULE_274__ = __webpack_require__(/*! ./toSafeInteger.js */ "./node_modules/lodash-es/toSafeInteger.js");
  115864. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toSafeInteger", function() { return _toSafeInteger_js__WEBPACK_IMPORTED_MODULE_274__["default"]; });
  115865. /* harmony import */ var _toString_js__WEBPACK_IMPORTED_MODULE_275__ = __webpack_require__(/*! ./toString.js */ "./node_modules/lodash-es/toString.js");
  115866. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toString", function() { return _toString_js__WEBPACK_IMPORTED_MODULE_275__["default"]; });
  115867. /* harmony import */ var _toUpper_js__WEBPACK_IMPORTED_MODULE_276__ = __webpack_require__(/*! ./toUpper.js */ "./node_modules/lodash-es/toUpper.js");
  115868. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toUpper", function() { return _toUpper_js__WEBPACK_IMPORTED_MODULE_276__["default"]; });
  115869. /* harmony import */ var _transform_js__WEBPACK_IMPORTED_MODULE_277__ = __webpack_require__(/*! ./transform.js */ "./node_modules/lodash-es/transform.js");
  115870. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "transform", function() { return _transform_js__WEBPACK_IMPORTED_MODULE_277__["default"]; });
  115871. /* harmony import */ var _trim_js__WEBPACK_IMPORTED_MODULE_278__ = __webpack_require__(/*! ./trim.js */ "./node_modules/lodash-es/trim.js");
  115872. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "trim", function() { return _trim_js__WEBPACK_IMPORTED_MODULE_278__["default"]; });
  115873. /* harmony import */ var _trimEnd_js__WEBPACK_IMPORTED_MODULE_279__ = __webpack_require__(/*! ./trimEnd.js */ "./node_modules/lodash-es/trimEnd.js");
  115874. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "trimEnd", function() { return _trimEnd_js__WEBPACK_IMPORTED_MODULE_279__["default"]; });
  115875. /* harmony import */ var _trimStart_js__WEBPACK_IMPORTED_MODULE_280__ = __webpack_require__(/*! ./trimStart.js */ "./node_modules/lodash-es/trimStart.js");
  115876. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "trimStart", function() { return _trimStart_js__WEBPACK_IMPORTED_MODULE_280__["default"]; });
  115877. /* harmony import */ var _truncate_js__WEBPACK_IMPORTED_MODULE_281__ = __webpack_require__(/*! ./truncate.js */ "./node_modules/lodash-es/truncate.js");
  115878. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "truncate", function() { return _truncate_js__WEBPACK_IMPORTED_MODULE_281__["default"]; });
  115879. /* harmony import */ var _unary_js__WEBPACK_IMPORTED_MODULE_282__ = __webpack_require__(/*! ./unary.js */ "./node_modules/lodash-es/unary.js");
  115880. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "unary", function() { return _unary_js__WEBPACK_IMPORTED_MODULE_282__["default"]; });
  115881. /* harmony import */ var _unescape_js__WEBPACK_IMPORTED_MODULE_283__ = __webpack_require__(/*! ./unescape.js */ "./node_modules/lodash-es/unescape.js");
  115882. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "unescape", function() { return _unescape_js__WEBPACK_IMPORTED_MODULE_283__["default"]; });
  115883. /* harmony import */ var _union_js__WEBPACK_IMPORTED_MODULE_284__ = __webpack_require__(/*! ./union.js */ "./node_modules/lodash-es/union.js");
  115884. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "union", function() { return _union_js__WEBPACK_IMPORTED_MODULE_284__["default"]; });
  115885. /* harmony import */ var _unionBy_js__WEBPACK_IMPORTED_MODULE_285__ = __webpack_require__(/*! ./unionBy.js */ "./node_modules/lodash-es/unionBy.js");
  115886. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "unionBy", function() { return _unionBy_js__WEBPACK_IMPORTED_MODULE_285__["default"]; });
  115887. /* harmony import */ var _unionWith_js__WEBPACK_IMPORTED_MODULE_286__ = __webpack_require__(/*! ./unionWith.js */ "./node_modules/lodash-es/unionWith.js");
  115888. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "unionWith", function() { return _unionWith_js__WEBPACK_IMPORTED_MODULE_286__["default"]; });
  115889. /* harmony import */ var _uniq_js__WEBPACK_IMPORTED_MODULE_287__ = __webpack_require__(/*! ./uniq.js */ "./node_modules/lodash-es/uniq.js");
  115890. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "uniq", function() { return _uniq_js__WEBPACK_IMPORTED_MODULE_287__["default"]; });
  115891. /* harmony import */ var _uniqBy_js__WEBPACK_IMPORTED_MODULE_288__ = __webpack_require__(/*! ./uniqBy.js */ "./node_modules/lodash-es/uniqBy.js");
  115892. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "uniqBy", function() { return _uniqBy_js__WEBPACK_IMPORTED_MODULE_288__["default"]; });
  115893. /* harmony import */ var _uniqWith_js__WEBPACK_IMPORTED_MODULE_289__ = __webpack_require__(/*! ./uniqWith.js */ "./node_modules/lodash-es/uniqWith.js");
  115894. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "uniqWith", function() { return _uniqWith_js__WEBPACK_IMPORTED_MODULE_289__["default"]; });
  115895. /* harmony import */ var _uniqueId_js__WEBPACK_IMPORTED_MODULE_290__ = __webpack_require__(/*! ./uniqueId.js */ "./node_modules/lodash-es/uniqueId.js");
  115896. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "uniqueId", function() { return _uniqueId_js__WEBPACK_IMPORTED_MODULE_290__["default"]; });
  115897. /* harmony import */ var _unset_js__WEBPACK_IMPORTED_MODULE_291__ = __webpack_require__(/*! ./unset.js */ "./node_modules/lodash-es/unset.js");
  115898. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "unset", function() { return _unset_js__WEBPACK_IMPORTED_MODULE_291__["default"]; });
  115899. /* harmony import */ var _unzip_js__WEBPACK_IMPORTED_MODULE_292__ = __webpack_require__(/*! ./unzip.js */ "./node_modules/lodash-es/unzip.js");
  115900. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "unzip", function() { return _unzip_js__WEBPACK_IMPORTED_MODULE_292__["default"]; });
  115901. /* harmony import */ var _unzipWith_js__WEBPACK_IMPORTED_MODULE_293__ = __webpack_require__(/*! ./unzipWith.js */ "./node_modules/lodash-es/unzipWith.js");
  115902. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "unzipWith", function() { return _unzipWith_js__WEBPACK_IMPORTED_MODULE_293__["default"]; });
  115903. /* harmony import */ var _update_js__WEBPACK_IMPORTED_MODULE_294__ = __webpack_require__(/*! ./update.js */ "./node_modules/lodash-es/update.js");
  115904. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "update", function() { return _update_js__WEBPACK_IMPORTED_MODULE_294__["default"]; });
  115905. /* harmony import */ var _updateWith_js__WEBPACK_IMPORTED_MODULE_295__ = __webpack_require__(/*! ./updateWith.js */ "./node_modules/lodash-es/updateWith.js");
  115906. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "updateWith", function() { return _updateWith_js__WEBPACK_IMPORTED_MODULE_295__["default"]; });
  115907. /* harmony import */ var _upperCase_js__WEBPACK_IMPORTED_MODULE_296__ = __webpack_require__(/*! ./upperCase.js */ "./node_modules/lodash-es/upperCase.js");
  115908. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "upperCase", function() { return _upperCase_js__WEBPACK_IMPORTED_MODULE_296__["default"]; });
  115909. /* harmony import */ var _upperFirst_js__WEBPACK_IMPORTED_MODULE_297__ = __webpack_require__(/*! ./upperFirst.js */ "./node_modules/lodash-es/upperFirst.js");
  115910. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "upperFirst", function() { return _upperFirst_js__WEBPACK_IMPORTED_MODULE_297__["default"]; });
  115911. /* harmony import */ var _value_js__WEBPACK_IMPORTED_MODULE_298__ = __webpack_require__(/*! ./value.js */ "./node_modules/lodash-es/value.js");
  115912. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "value", function() { return _value_js__WEBPACK_IMPORTED_MODULE_298__["default"]; });
  115913. /* harmony import */ var _valueOf_js__WEBPACK_IMPORTED_MODULE_299__ = __webpack_require__(/*! ./valueOf.js */ "./node_modules/lodash-es/valueOf.js");
  115914. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "valueOf", function() { return _valueOf_js__WEBPACK_IMPORTED_MODULE_299__["default"]; });
  115915. /* harmony import */ var _values_js__WEBPACK_IMPORTED_MODULE_300__ = __webpack_require__(/*! ./values.js */ "./node_modules/lodash-es/values.js");
  115916. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "values", function() { return _values_js__WEBPACK_IMPORTED_MODULE_300__["default"]; });
  115917. /* harmony import */ var _valuesIn_js__WEBPACK_IMPORTED_MODULE_301__ = __webpack_require__(/*! ./valuesIn.js */ "./node_modules/lodash-es/valuesIn.js");
  115918. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "valuesIn", function() { return _valuesIn_js__WEBPACK_IMPORTED_MODULE_301__["default"]; });
  115919. /* harmony import */ var _without_js__WEBPACK_IMPORTED_MODULE_302__ = __webpack_require__(/*! ./without.js */ "./node_modules/lodash-es/without.js");
  115920. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "without", function() { return _without_js__WEBPACK_IMPORTED_MODULE_302__["default"]; });
  115921. /* harmony import */ var _words_js__WEBPACK_IMPORTED_MODULE_303__ = __webpack_require__(/*! ./words.js */ "./node_modules/lodash-es/words.js");
  115922. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "words", function() { return _words_js__WEBPACK_IMPORTED_MODULE_303__["default"]; });
  115923. /* harmony import */ var _wrap_js__WEBPACK_IMPORTED_MODULE_304__ = __webpack_require__(/*! ./wrap.js */ "./node_modules/lodash-es/wrap.js");
  115924. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "wrap", function() { return _wrap_js__WEBPACK_IMPORTED_MODULE_304__["default"]; });
  115925. /* harmony import */ var _wrapperAt_js__WEBPACK_IMPORTED_MODULE_305__ = __webpack_require__(/*! ./wrapperAt.js */ "./node_modules/lodash-es/wrapperAt.js");
  115926. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "wrapperAt", function() { return _wrapperAt_js__WEBPACK_IMPORTED_MODULE_305__["default"]; });
  115927. /* harmony import */ var _wrapperChain_js__WEBPACK_IMPORTED_MODULE_306__ = __webpack_require__(/*! ./wrapperChain.js */ "./node_modules/lodash-es/wrapperChain.js");
  115928. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "wrapperChain", function() { return _wrapperChain_js__WEBPACK_IMPORTED_MODULE_306__["default"]; });
  115929. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "wrapperCommit", function() { return _commit_js__WEBPACK_IMPORTED_MODULE_24__["default"]; });
  115930. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "wrapperLodash", function() { return _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_153__["default"]; });
  115931. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "wrapperNext", function() { return _next_js__WEBPACK_IMPORTED_MODULE_177__["default"]; });
  115932. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "wrapperPlant", function() { return _plant_js__WEBPACK_IMPORTED_MODULE_199__["default"]; });
  115933. /* harmony import */ var _wrapperReverse_js__WEBPACK_IMPORTED_MODULE_307__ = __webpack_require__(/*! ./wrapperReverse.js */ "./node_modules/lodash-es/wrapperReverse.js");
  115934. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "wrapperReverse", function() { return _wrapperReverse_js__WEBPACK_IMPORTED_MODULE_307__["default"]; });
  115935. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "wrapperToIterator", function() { return _toIterator_js__WEBPACK_IMPORTED_MODULE_265__["default"]; });
  115936. /* harmony import */ var _wrapperValue_js__WEBPACK_IMPORTED_MODULE_308__ = __webpack_require__(/*! ./wrapperValue.js */ "./node_modules/lodash-es/wrapperValue.js");
  115937. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "wrapperValue", function() { return _wrapperValue_js__WEBPACK_IMPORTED_MODULE_308__["default"]; });
  115938. /* harmony import */ var _xor_js__WEBPACK_IMPORTED_MODULE_309__ = __webpack_require__(/*! ./xor.js */ "./node_modules/lodash-es/xor.js");
  115939. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "xor", function() { return _xor_js__WEBPACK_IMPORTED_MODULE_309__["default"]; });
  115940. /* harmony import */ var _xorBy_js__WEBPACK_IMPORTED_MODULE_310__ = __webpack_require__(/*! ./xorBy.js */ "./node_modules/lodash-es/xorBy.js");
  115941. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "xorBy", function() { return _xorBy_js__WEBPACK_IMPORTED_MODULE_310__["default"]; });
  115942. /* harmony import */ var _xorWith_js__WEBPACK_IMPORTED_MODULE_311__ = __webpack_require__(/*! ./xorWith.js */ "./node_modules/lodash-es/xorWith.js");
  115943. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "xorWith", function() { return _xorWith_js__WEBPACK_IMPORTED_MODULE_311__["default"]; });
  115944. /* harmony import */ var _zip_js__WEBPACK_IMPORTED_MODULE_312__ = __webpack_require__(/*! ./zip.js */ "./node_modules/lodash-es/zip.js");
  115945. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "zip", function() { return _zip_js__WEBPACK_IMPORTED_MODULE_312__["default"]; });
  115946. /* harmony import */ var _zipObject_js__WEBPACK_IMPORTED_MODULE_313__ = __webpack_require__(/*! ./zipObject.js */ "./node_modules/lodash-es/zipObject.js");
  115947. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "zipObject", function() { return _zipObject_js__WEBPACK_IMPORTED_MODULE_313__["default"]; });
  115948. /* harmony import */ var _zipObjectDeep_js__WEBPACK_IMPORTED_MODULE_314__ = __webpack_require__(/*! ./zipObjectDeep.js */ "./node_modules/lodash-es/zipObjectDeep.js");
  115949. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "zipObjectDeep", function() { return _zipObjectDeep_js__WEBPACK_IMPORTED_MODULE_314__["default"]; });
  115950. /* harmony import */ var _zipWith_js__WEBPACK_IMPORTED_MODULE_315__ = __webpack_require__(/*! ./zipWith.js */ "./node_modules/lodash-es/zipWith.js");
  115951. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "zipWith", function() { return _zipWith_js__WEBPACK_IMPORTED_MODULE_315__["default"]; });
  115952. /* harmony import */ var _lodash_default_js__WEBPACK_IMPORTED_MODULE_316__ = __webpack_require__(/*! ./lodash.default.js */ "./node_modules/lodash-es/lodash.default.js");
  115953. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _lodash_default_js__WEBPACK_IMPORTED_MODULE_316__["default"]; });
  115954. /**
  115955. * @license
  115956. * Lodash (Custom Build) <https://lodash.com/>
  115957. * Build: `lodash modularize exports="es" -o ./`
  115958. * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
  115959. * Released under MIT license <https://lodash.com/license>
  115960. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  115961. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  115962. */
  115963. /***/ }),
  115964. /***/ "./node_modules/lodash-es/lowerCase.js":
  115965. /*!*********************************************!*\
  115966. !*** ./node_modules/lodash-es/lowerCase.js ***!
  115967. \*********************************************/
  115968. /*! exports provided: default */
  115969. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  115970. "use strict";
  115971. __webpack_require__.r(__webpack_exports__);
  115972. /* harmony import */ var _createCompounder_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createCompounder.js */ "./node_modules/lodash-es/_createCompounder.js");
  115973. /**
  115974. * Converts `string`, as space separated words, to lower case.
  115975. *
  115976. * @static
  115977. * @memberOf _
  115978. * @since 4.0.0
  115979. * @category String
  115980. * @param {string} [string=''] The string to convert.
  115981. * @returns {string} Returns the lower cased string.
  115982. * @example
  115983. *
  115984. * _.lowerCase('--Foo-Bar--');
  115985. * // => 'foo bar'
  115986. *
  115987. * _.lowerCase('fooBar');
  115988. * // => 'foo bar'
  115989. *
  115990. * _.lowerCase('__FOO_BAR__');
  115991. * // => 'foo bar'
  115992. */
  115993. var lowerCase = Object(_createCompounder_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function(result, word, index) {
  115994. return result + (index ? ' ' : '') + word.toLowerCase();
  115995. });
  115996. /* harmony default export */ __webpack_exports__["default"] = (lowerCase);
  115997. /***/ }),
  115998. /***/ "./node_modules/lodash-es/lowerFirst.js":
  115999. /*!**********************************************!*\
  116000. !*** ./node_modules/lodash-es/lowerFirst.js ***!
  116001. \**********************************************/
  116002. /*! exports provided: default */
  116003. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  116004. "use strict";
  116005. __webpack_require__.r(__webpack_exports__);
  116006. /* harmony import */ var _createCaseFirst_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createCaseFirst.js */ "./node_modules/lodash-es/_createCaseFirst.js");
  116007. /**
  116008. * Converts the first character of `string` to lower case.
  116009. *
  116010. * @static
  116011. * @memberOf _
  116012. * @since 4.0.0
  116013. * @category String
  116014. * @param {string} [string=''] The string to convert.
  116015. * @returns {string} Returns the converted string.
  116016. * @example
  116017. *
  116018. * _.lowerFirst('Fred');
  116019. * // => 'fred'
  116020. *
  116021. * _.lowerFirst('FRED');
  116022. * // => 'fRED'
  116023. */
  116024. var lowerFirst = Object(_createCaseFirst_js__WEBPACK_IMPORTED_MODULE_0__["default"])('toLowerCase');
  116025. /* harmony default export */ __webpack_exports__["default"] = (lowerFirst);
  116026. /***/ }),
  116027. /***/ "./node_modules/lodash-es/lt.js":
  116028. /*!**************************************!*\
  116029. !*** ./node_modules/lodash-es/lt.js ***!
  116030. \**************************************/
  116031. /*! exports provided: default */
  116032. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  116033. "use strict";
  116034. __webpack_require__.r(__webpack_exports__);
  116035. /* harmony import */ var _baseLt_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseLt.js */ "./node_modules/lodash-es/_baseLt.js");
  116036. /* harmony import */ var _createRelationalOperation_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_createRelationalOperation.js */ "./node_modules/lodash-es/_createRelationalOperation.js");
  116037. /**
  116038. * Checks if `value` is less than `other`.
  116039. *
  116040. * @static
  116041. * @memberOf _
  116042. * @since 3.9.0
  116043. * @category Lang
  116044. * @param {*} value The value to compare.
  116045. * @param {*} other The other value to compare.
  116046. * @returns {boolean} Returns `true` if `value` is less than `other`,
  116047. * else `false`.
  116048. * @see _.gt
  116049. * @example
  116050. *
  116051. * _.lt(1, 3);
  116052. * // => true
  116053. *
  116054. * _.lt(3, 3);
  116055. * // => false
  116056. *
  116057. * _.lt(3, 1);
  116058. * // => false
  116059. */
  116060. var lt = Object(_createRelationalOperation_js__WEBPACK_IMPORTED_MODULE_1__["default"])(_baseLt_js__WEBPACK_IMPORTED_MODULE_0__["default"]);
  116061. /* harmony default export */ __webpack_exports__["default"] = (lt);
  116062. /***/ }),
  116063. /***/ "./node_modules/lodash-es/lte.js":
  116064. /*!***************************************!*\
  116065. !*** ./node_modules/lodash-es/lte.js ***!
  116066. \***************************************/
  116067. /*! exports provided: default */
  116068. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  116069. "use strict";
  116070. __webpack_require__.r(__webpack_exports__);
  116071. /* harmony import */ var _createRelationalOperation_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createRelationalOperation.js */ "./node_modules/lodash-es/_createRelationalOperation.js");
  116072. /**
  116073. * Checks if `value` is less than or equal to `other`.
  116074. *
  116075. * @static
  116076. * @memberOf _
  116077. * @since 3.9.0
  116078. * @category Lang
  116079. * @param {*} value The value to compare.
  116080. * @param {*} other The other value to compare.
  116081. * @returns {boolean} Returns `true` if `value` is less than or equal to
  116082. * `other`, else `false`.
  116083. * @see _.gte
  116084. * @example
  116085. *
  116086. * _.lte(1, 3);
  116087. * // => true
  116088. *
  116089. * _.lte(3, 3);
  116090. * // => true
  116091. *
  116092. * _.lte(3, 1);
  116093. * // => false
  116094. */
  116095. var lte = Object(_createRelationalOperation_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function(value, other) {
  116096. return value <= other;
  116097. });
  116098. /* harmony default export */ __webpack_exports__["default"] = (lte);
  116099. /***/ }),
  116100. /***/ "./node_modules/lodash-es/map.js":
  116101. /*!***************************************!*\
  116102. !*** ./node_modules/lodash-es/map.js ***!
  116103. \***************************************/
  116104. /*! exports provided: default */
  116105. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  116106. "use strict";
  116107. __webpack_require__.r(__webpack_exports__);
  116108. /* harmony import */ var _arrayMap_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayMap.js */ "./node_modules/lodash-es/_arrayMap.js");
  116109. /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
  116110. /* harmony import */ var _baseMap_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseMap.js */ "./node_modules/lodash-es/_baseMap.js");
  116111. /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
  116112. /**
  116113. * Creates an array of values by running each element in `collection` thru
  116114. * `iteratee`. The iteratee is invoked with three arguments:
  116115. * (value, index|key, collection).
  116116. *
  116117. * Many lodash methods are guarded to work as iteratees for methods like
  116118. * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.
  116119. *
  116120. * The guarded methods are:
  116121. * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`,
  116122. * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`,
  116123. * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`,
  116124. * `template`, `trim`, `trimEnd`, `trimStart`, and `words`
  116125. *
  116126. * @static
  116127. * @memberOf _
  116128. * @since 0.1.0
  116129. * @category Collection
  116130. * @param {Array|Object} collection The collection to iterate over.
  116131. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  116132. * @returns {Array} Returns the new mapped array.
  116133. * @example
  116134. *
  116135. * function square(n) {
  116136. * return n * n;
  116137. * }
  116138. *
  116139. * _.map([4, 8], square);
  116140. * // => [16, 64]
  116141. *
  116142. * _.map({ 'a': 4, 'b': 8 }, square);
  116143. * // => [16, 64] (iteration order is not guaranteed)
  116144. *
  116145. * var users = [
  116146. * { 'user': 'barney' },
  116147. * { 'user': 'fred' }
  116148. * ];
  116149. *
  116150. * // The `_.property` iteratee shorthand.
  116151. * _.map(users, 'user');
  116152. * // => ['barney', 'fred']
  116153. */
  116154. function map(collection, iteratee) {
  116155. 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"];
  116156. return func(collection, Object(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_1__["default"])(iteratee, 3));
  116157. }
  116158. /* harmony default export */ __webpack_exports__["default"] = (map);
  116159. /***/ }),
  116160. /***/ "./node_modules/lodash-es/mapKeys.js":
  116161. /*!*******************************************!*\
  116162. !*** ./node_modules/lodash-es/mapKeys.js ***!
  116163. \*******************************************/
  116164. /*! exports provided: default */
  116165. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  116166. "use strict";
  116167. __webpack_require__.r(__webpack_exports__);
  116168. /* harmony import */ var _baseAssignValue_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseAssignValue.js */ "./node_modules/lodash-es/_baseAssignValue.js");
  116169. /* harmony import */ var _baseForOwn_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseForOwn.js */ "./node_modules/lodash-es/_baseForOwn.js");
  116170. /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
  116171. /**
  116172. * The opposite of `_.mapValues`; this method creates an object with the
  116173. * same values as `object` and keys generated by running each own enumerable
  116174. * string keyed property of `object` thru `iteratee`. The iteratee is invoked
  116175. * with three arguments: (value, key, object).
  116176. *
  116177. * @static
  116178. * @memberOf _
  116179. * @since 3.8.0
  116180. * @category Object
  116181. * @param {Object} object The object to iterate over.
  116182. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  116183. * @returns {Object} Returns the new mapped object.
  116184. * @see _.mapValues
  116185. * @example
  116186. *
  116187. * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) {
  116188. * return key + value;
  116189. * });
  116190. * // => { 'a1': 1, 'b2': 2 }
  116191. */
  116192. function mapKeys(object, iteratee) {
  116193. var result = {};
  116194. iteratee = Object(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_2__["default"])(iteratee, 3);
  116195. Object(_baseForOwn_js__WEBPACK_IMPORTED_MODULE_1__["default"])(object, function(value, key, object) {
  116196. Object(_baseAssignValue_js__WEBPACK_IMPORTED_MODULE_0__["default"])(result, iteratee(value, key, object), value);
  116197. });
  116198. return result;
  116199. }
  116200. /* harmony default export */ __webpack_exports__["default"] = (mapKeys);
  116201. /***/ }),
  116202. /***/ "./node_modules/lodash-es/mapValues.js":
  116203. /*!*********************************************!*\
  116204. !*** ./node_modules/lodash-es/mapValues.js ***!
  116205. \*********************************************/
  116206. /*! exports provided: default */
  116207. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  116208. "use strict";
  116209. __webpack_require__.r(__webpack_exports__);
  116210. /* harmony import */ var _baseAssignValue_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseAssignValue.js */ "./node_modules/lodash-es/_baseAssignValue.js");
  116211. /* harmony import */ var _baseForOwn_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseForOwn.js */ "./node_modules/lodash-es/_baseForOwn.js");
  116212. /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
  116213. /**
  116214. * Creates an object with the same keys as `object` and values generated
  116215. * by running each own enumerable string keyed property of `object` thru
  116216. * `iteratee`. The iteratee is invoked with three arguments:
  116217. * (value, key, object).
  116218. *
  116219. * @static
  116220. * @memberOf _
  116221. * @since 2.4.0
  116222. * @category Object
  116223. * @param {Object} object The object to iterate over.
  116224. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  116225. * @returns {Object} Returns the new mapped object.
  116226. * @see _.mapKeys
  116227. * @example
  116228. *
  116229. * var users = {
  116230. * 'fred': { 'user': 'fred', 'age': 40 },
  116231. * 'pebbles': { 'user': 'pebbles', 'age': 1 }
  116232. * };
  116233. *
  116234. * _.mapValues(users, function(o) { return o.age; });
  116235. * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
  116236. *
  116237. * // The `_.property` iteratee shorthand.
  116238. * _.mapValues(users, 'age');
  116239. * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
  116240. */
  116241. function mapValues(object, iteratee) {
  116242. var result = {};
  116243. iteratee = Object(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_2__["default"])(iteratee, 3);
  116244. Object(_baseForOwn_js__WEBPACK_IMPORTED_MODULE_1__["default"])(object, function(value, key, object) {
  116245. Object(_baseAssignValue_js__WEBPACK_IMPORTED_MODULE_0__["default"])(result, key, iteratee(value, key, object));
  116246. });
  116247. return result;
  116248. }
  116249. /* harmony default export */ __webpack_exports__["default"] = (mapValues);
  116250. /***/ }),
  116251. /***/ "./node_modules/lodash-es/matches.js":
  116252. /*!*******************************************!*\
  116253. !*** ./node_modules/lodash-es/matches.js ***!
  116254. \*******************************************/
  116255. /*! exports provided: default */
  116256. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  116257. "use strict";
  116258. __webpack_require__.r(__webpack_exports__);
  116259. /* harmony import */ var _baseClone_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseClone.js */ "./node_modules/lodash-es/_baseClone.js");
  116260. /* harmony import */ var _baseMatches_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseMatches.js */ "./node_modules/lodash-es/_baseMatches.js");
  116261. /** Used to compose bitmasks for cloning. */
  116262. var CLONE_DEEP_FLAG = 1;
  116263. /**
  116264. * Creates a function that performs a partial deep comparison between a given
  116265. * object and `source`, returning `true` if the given object has equivalent
  116266. * property values, else `false`.
  116267. *
  116268. * **Note:** The created function is equivalent to `_.isMatch` with `source`
  116269. * partially applied.
  116270. *
  116271. * Partial comparisons will match empty array and empty object `source`
  116272. * values against any array or object value, respectively. See `_.isEqual`
  116273. * for a list of supported value comparisons.
  116274. *
  116275. * **Note:** Multiple values can be checked by combining several matchers
  116276. * using `_.overSome`
  116277. *
  116278. * @static
  116279. * @memberOf _
  116280. * @since 3.0.0
  116281. * @category Util
  116282. * @param {Object} source The object of property values to match.
  116283. * @returns {Function} Returns the new spec function.
  116284. * @example
  116285. *
  116286. * var objects = [
  116287. * { 'a': 1, 'b': 2, 'c': 3 },
  116288. * { 'a': 4, 'b': 5, 'c': 6 }
  116289. * ];
  116290. *
  116291. * _.filter(objects, _.matches({ 'a': 4, 'c': 6 }));
  116292. * // => [{ 'a': 4, 'b': 5, 'c': 6 }]
  116293. *
  116294. * // Checking for several possible values
  116295. * _.filter(objects, _.overSome([_.matches({ 'a': 1 }), _.matches({ 'a': 4 })]));
  116296. * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }]
  116297. */
  116298. function matches(source) {
  116299. return Object(_baseMatches_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Object(_baseClone_js__WEBPACK_IMPORTED_MODULE_0__["default"])(source, CLONE_DEEP_FLAG));
  116300. }
  116301. /* harmony default export */ __webpack_exports__["default"] = (matches);
  116302. /***/ }),
  116303. /***/ "./node_modules/lodash-es/matchesProperty.js":
  116304. /*!***************************************************!*\
  116305. !*** ./node_modules/lodash-es/matchesProperty.js ***!
  116306. \***************************************************/
  116307. /*! exports provided: default */
  116308. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  116309. "use strict";
  116310. __webpack_require__.r(__webpack_exports__);
  116311. /* harmony import */ var _baseClone_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseClone.js */ "./node_modules/lodash-es/_baseClone.js");
  116312. /* harmony import */ var _baseMatchesProperty_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseMatchesProperty.js */ "./node_modules/lodash-es/_baseMatchesProperty.js");
  116313. /** Used to compose bitmasks for cloning. */
  116314. var CLONE_DEEP_FLAG = 1;
  116315. /**
  116316. * Creates a function that performs a partial deep comparison between the
  116317. * value at `path` of a given object to `srcValue`, returning `true` if the
  116318. * object value is equivalent, else `false`.
  116319. *
  116320. * **Note:** Partial comparisons will match empty array and empty object
  116321. * `srcValue` values against any array or object value, respectively. See
  116322. * `_.isEqual` for a list of supported value comparisons.
  116323. *
  116324. * **Note:** Multiple values can be checked by combining several matchers
  116325. * using `_.overSome`
  116326. *
  116327. * @static
  116328. * @memberOf _
  116329. * @since 3.2.0
  116330. * @category Util
  116331. * @param {Array|string} path The path of the property to get.
  116332. * @param {*} srcValue The value to match.
  116333. * @returns {Function} Returns the new spec function.
  116334. * @example
  116335. *
  116336. * var objects = [
  116337. * { 'a': 1, 'b': 2, 'c': 3 },
  116338. * { 'a': 4, 'b': 5, 'c': 6 }
  116339. * ];
  116340. *
  116341. * _.find(objects, _.matchesProperty('a', 4));
  116342. * // => { 'a': 4, 'b': 5, 'c': 6 }
  116343. *
  116344. * // Checking for several possible values
  116345. * _.filter(objects, _.overSome([_.matchesProperty('a', 1), _.matchesProperty('a', 4)]));
  116346. * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }]
  116347. */
  116348. function matchesProperty(path, srcValue) {
  116349. return Object(_baseMatchesProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(path, Object(_baseClone_js__WEBPACK_IMPORTED_MODULE_0__["default"])(srcValue, CLONE_DEEP_FLAG));
  116350. }
  116351. /* harmony default export */ __webpack_exports__["default"] = (matchesProperty);
  116352. /***/ }),
  116353. /***/ "./node_modules/lodash-es/math.default.js":
  116354. /*!************************************************!*\
  116355. !*** ./node_modules/lodash-es/math.default.js ***!
  116356. \************************************************/
  116357. /*! exports provided: default */
  116358. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  116359. "use strict";
  116360. __webpack_require__.r(__webpack_exports__);
  116361. /* harmony import */ var _add_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./add.js */ "./node_modules/lodash-es/add.js");
  116362. /* harmony import */ var _ceil_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ceil.js */ "./node_modules/lodash-es/ceil.js");
  116363. /* harmony import */ var _divide_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./divide.js */ "./node_modules/lodash-es/divide.js");
  116364. /* harmony import */ var _floor_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./floor.js */ "./node_modules/lodash-es/floor.js");
  116365. /* harmony import */ var _max_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./max.js */ "./node_modules/lodash-es/max.js");
  116366. /* harmony import */ var _maxBy_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./maxBy.js */ "./node_modules/lodash-es/maxBy.js");
  116367. /* harmony import */ var _mean_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./mean.js */ "./node_modules/lodash-es/mean.js");
  116368. /* harmony import */ var _meanBy_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./meanBy.js */ "./node_modules/lodash-es/meanBy.js");
  116369. /* harmony import */ var _min_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./min.js */ "./node_modules/lodash-es/min.js");
  116370. /* harmony import */ var _minBy_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./minBy.js */ "./node_modules/lodash-es/minBy.js");
  116371. /* harmony import */ var _multiply_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./multiply.js */ "./node_modules/lodash-es/multiply.js");
  116372. /* harmony import */ var _round_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./round.js */ "./node_modules/lodash-es/round.js");
  116373. /* harmony import */ var _subtract_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./subtract.js */ "./node_modules/lodash-es/subtract.js");
  116374. /* harmony import */ var _sum_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./sum.js */ "./node_modules/lodash-es/sum.js");
  116375. /* harmony import */ var _sumBy_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./sumBy.js */ "./node_modules/lodash-es/sumBy.js");
  116376. /* harmony default export */ __webpack_exports__["default"] = ({
  116377. 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"],
  116378. 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"],
  116379. 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"]
  116380. });
  116381. /***/ }),
  116382. /***/ "./node_modules/lodash-es/math.js":
  116383. /*!****************************************!*\
  116384. !*** ./node_modules/lodash-es/math.js ***!
  116385. \****************************************/
  116386. /*! exports provided: add, ceil, divide, floor, max, maxBy, mean, meanBy, min, minBy, multiply, round, subtract, sum, sumBy, default */
  116387. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  116388. "use strict";
  116389. __webpack_require__.r(__webpack_exports__);
  116390. /* harmony import */ var _add_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./add.js */ "./node_modules/lodash-es/add.js");
  116391. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "add", function() { return _add_js__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  116392. /* harmony import */ var _ceil_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ceil.js */ "./node_modules/lodash-es/ceil.js");
  116393. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ceil", function() { return _ceil_js__WEBPACK_IMPORTED_MODULE_1__["default"]; });
  116394. /* harmony import */ var _divide_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./divide.js */ "./node_modules/lodash-es/divide.js");
  116395. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "divide", function() { return _divide_js__WEBPACK_IMPORTED_MODULE_2__["default"]; });
  116396. /* harmony import */ var _floor_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./floor.js */ "./node_modules/lodash-es/floor.js");
  116397. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "floor", function() { return _floor_js__WEBPACK_IMPORTED_MODULE_3__["default"]; });
  116398. /* harmony import */ var _max_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./max.js */ "./node_modules/lodash-es/max.js");
  116399. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "max", function() { return _max_js__WEBPACK_IMPORTED_MODULE_4__["default"]; });
  116400. /* harmony import */ var _maxBy_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./maxBy.js */ "./node_modules/lodash-es/maxBy.js");
  116401. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "maxBy", function() { return _maxBy_js__WEBPACK_IMPORTED_MODULE_5__["default"]; });
  116402. /* harmony import */ var _mean_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./mean.js */ "./node_modules/lodash-es/mean.js");
  116403. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "mean", function() { return _mean_js__WEBPACK_IMPORTED_MODULE_6__["default"]; });
  116404. /* harmony import */ var _meanBy_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./meanBy.js */ "./node_modules/lodash-es/meanBy.js");
  116405. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "meanBy", function() { return _meanBy_js__WEBPACK_IMPORTED_MODULE_7__["default"]; });
  116406. /* harmony import */ var _min_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./min.js */ "./node_modules/lodash-es/min.js");
  116407. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "min", function() { return _min_js__WEBPACK_IMPORTED_MODULE_8__["default"]; });
  116408. /* harmony import */ var _minBy_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./minBy.js */ "./node_modules/lodash-es/minBy.js");
  116409. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "minBy", function() { return _minBy_js__WEBPACK_IMPORTED_MODULE_9__["default"]; });
  116410. /* harmony import */ var _multiply_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./multiply.js */ "./node_modules/lodash-es/multiply.js");
  116411. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "multiply", function() { return _multiply_js__WEBPACK_IMPORTED_MODULE_10__["default"]; });
  116412. /* harmony import */ var _round_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./round.js */ "./node_modules/lodash-es/round.js");
  116413. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "round", function() { return _round_js__WEBPACK_IMPORTED_MODULE_11__["default"]; });
  116414. /* harmony import */ var _subtract_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./subtract.js */ "./node_modules/lodash-es/subtract.js");
  116415. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "subtract", function() { return _subtract_js__WEBPACK_IMPORTED_MODULE_12__["default"]; });
  116416. /* harmony import */ var _sum_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./sum.js */ "./node_modules/lodash-es/sum.js");
  116417. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "sum", function() { return _sum_js__WEBPACK_IMPORTED_MODULE_13__["default"]; });
  116418. /* harmony import */ var _sumBy_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./sumBy.js */ "./node_modules/lodash-es/sumBy.js");
  116419. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "sumBy", function() { return _sumBy_js__WEBPACK_IMPORTED_MODULE_14__["default"]; });
  116420. /* harmony import */ var _math_default_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./math.default.js */ "./node_modules/lodash-es/math.default.js");
  116421. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _math_default_js__WEBPACK_IMPORTED_MODULE_15__["default"]; });
  116422. /***/ }),
  116423. /***/ "./node_modules/lodash-es/max.js":
  116424. /*!***************************************!*\
  116425. !*** ./node_modules/lodash-es/max.js ***!
  116426. \***************************************/
  116427. /*! exports provided: default */
  116428. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  116429. "use strict";
  116430. __webpack_require__.r(__webpack_exports__);
  116431. /* harmony import */ var _baseExtremum_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseExtremum.js */ "./node_modules/lodash-es/_baseExtremum.js");
  116432. /* harmony import */ var _baseGt_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseGt.js */ "./node_modules/lodash-es/_baseGt.js");
  116433. /* harmony import */ var _identity_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./identity.js */ "./node_modules/lodash-es/identity.js");
  116434. /**
  116435. * Computes the maximum value of `array`. If `array` is empty or falsey,
  116436. * `undefined` is returned.
  116437. *
  116438. * @static
  116439. * @since 0.1.0
  116440. * @memberOf _
  116441. * @category Math
  116442. * @param {Array} array The array to iterate over.
  116443. * @returns {*} Returns the maximum value.
  116444. * @example
  116445. *
  116446. * _.max([4, 2, 8, 6]);
  116447. * // => 8
  116448. *
  116449. * _.max([]);
  116450. * // => undefined
  116451. */
  116452. function max(array) {
  116453. return (array && array.length)
  116454. ? Object(_baseExtremum_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, _identity_js__WEBPACK_IMPORTED_MODULE_2__["default"], _baseGt_js__WEBPACK_IMPORTED_MODULE_1__["default"])
  116455. : undefined;
  116456. }
  116457. /* harmony default export */ __webpack_exports__["default"] = (max);
  116458. /***/ }),
  116459. /***/ "./node_modules/lodash-es/maxBy.js":
  116460. /*!*****************************************!*\
  116461. !*** ./node_modules/lodash-es/maxBy.js ***!
  116462. \*****************************************/
  116463. /*! exports provided: default */
  116464. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  116465. "use strict";
  116466. __webpack_require__.r(__webpack_exports__);
  116467. /* harmony import */ var _baseExtremum_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseExtremum.js */ "./node_modules/lodash-es/_baseExtremum.js");
  116468. /* harmony import */ var _baseGt_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseGt.js */ "./node_modules/lodash-es/_baseGt.js");
  116469. /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
  116470. /**
  116471. * This method is like `_.max` except that it accepts `iteratee` which is
  116472. * invoked for each element in `array` to generate the criterion by which
  116473. * the value is ranked. The iteratee is invoked with one argument: (value).
  116474. *
  116475. * @static
  116476. * @memberOf _
  116477. * @since 4.0.0
  116478. * @category Math
  116479. * @param {Array} array The array to iterate over.
  116480. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  116481. * @returns {*} Returns the maximum value.
  116482. * @example
  116483. *
  116484. * var objects = [{ 'n': 1 }, { 'n': 2 }];
  116485. *
  116486. * _.maxBy(objects, function(o) { return o.n; });
  116487. * // => { 'n': 2 }
  116488. *
  116489. * // The `_.property` iteratee shorthand.
  116490. * _.maxBy(objects, 'n');
  116491. * // => { 'n': 2 }
  116492. */
  116493. function maxBy(array, iteratee) {
  116494. return (array && array.length)
  116495. ? 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"])
  116496. : undefined;
  116497. }
  116498. /* harmony default export */ __webpack_exports__["default"] = (maxBy);
  116499. /***/ }),
  116500. /***/ "./node_modules/lodash-es/mean.js":
  116501. /*!****************************************!*\
  116502. !*** ./node_modules/lodash-es/mean.js ***!
  116503. \****************************************/
  116504. /*! exports provided: default */
  116505. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  116506. "use strict";
  116507. __webpack_require__.r(__webpack_exports__);
  116508. /* harmony import */ var _baseMean_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseMean.js */ "./node_modules/lodash-es/_baseMean.js");
  116509. /* harmony import */ var _identity_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./identity.js */ "./node_modules/lodash-es/identity.js");
  116510. /**
  116511. * Computes the mean of the values in `array`.
  116512. *
  116513. * @static
  116514. * @memberOf _
  116515. * @since 4.0.0
  116516. * @category Math
  116517. * @param {Array} array The array to iterate over.
  116518. * @returns {number} Returns the mean.
  116519. * @example
  116520. *
  116521. * _.mean([4, 2, 8, 6]);
  116522. * // => 5
  116523. */
  116524. function mean(array) {
  116525. return Object(_baseMean_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, _identity_js__WEBPACK_IMPORTED_MODULE_1__["default"]);
  116526. }
  116527. /* harmony default export */ __webpack_exports__["default"] = (mean);
  116528. /***/ }),
  116529. /***/ "./node_modules/lodash-es/meanBy.js":
  116530. /*!******************************************!*\
  116531. !*** ./node_modules/lodash-es/meanBy.js ***!
  116532. \******************************************/
  116533. /*! exports provided: default */
  116534. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  116535. "use strict";
  116536. __webpack_require__.r(__webpack_exports__);
  116537. /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
  116538. /* harmony import */ var _baseMean_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseMean.js */ "./node_modules/lodash-es/_baseMean.js");
  116539. /**
  116540. * This method is like `_.mean` except that it accepts `iteratee` which is
  116541. * invoked for each element in `array` to generate the value to be averaged.
  116542. * The iteratee is invoked with one argument: (value).
  116543. *
  116544. * @static
  116545. * @memberOf _
  116546. * @since 4.7.0
  116547. * @category Math
  116548. * @param {Array} array The array to iterate over.
  116549. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  116550. * @returns {number} Returns the mean.
  116551. * @example
  116552. *
  116553. * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
  116554. *
  116555. * _.meanBy(objects, function(o) { return o.n; });
  116556. * // => 5
  116557. *
  116558. * // The `_.property` iteratee shorthand.
  116559. * _.meanBy(objects, 'n');
  116560. * // => 5
  116561. */
  116562. function meanBy(array, iteratee) {
  116563. return Object(_baseMean_js__WEBPACK_IMPORTED_MODULE_1__["default"])(array, Object(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_0__["default"])(iteratee, 2));
  116564. }
  116565. /* harmony default export */ __webpack_exports__["default"] = (meanBy);
  116566. /***/ }),
  116567. /***/ "./node_modules/lodash-es/memoize.js":
  116568. /*!*******************************************!*\
  116569. !*** ./node_modules/lodash-es/memoize.js ***!
  116570. \*******************************************/
  116571. /*! exports provided: default */
  116572. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  116573. "use strict";
  116574. __webpack_require__.r(__webpack_exports__);
  116575. /* harmony import */ var _MapCache_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_MapCache.js */ "./node_modules/lodash-es/_MapCache.js");
  116576. /** Error message constants. */
  116577. var FUNC_ERROR_TEXT = 'Expected a function';
  116578. /**
  116579. * Creates a function that memoizes the result of `func`. If `resolver` is
  116580. * provided, it determines the cache key for storing the result based on the
  116581. * arguments provided to the memoized function. By default, the first argument
  116582. * provided to the memoized function is used as the map cache key. The `func`
  116583. * is invoked with the `this` binding of the memoized function.
  116584. *
  116585. * **Note:** The cache is exposed as the `cache` property on the memoized
  116586. * function. Its creation may be customized by replacing the `_.memoize.Cache`
  116587. * constructor with one whose instances implement the
  116588. * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
  116589. * method interface of `clear`, `delete`, `get`, `has`, and `set`.
  116590. *
  116591. * @static
  116592. * @memberOf _
  116593. * @since 0.1.0
  116594. * @category Function
  116595. * @param {Function} func The function to have its output memoized.
  116596. * @param {Function} [resolver] The function to resolve the cache key.
  116597. * @returns {Function} Returns the new memoized function.
  116598. * @example
  116599. *
  116600. * var object = { 'a': 1, 'b': 2 };
  116601. * var other = { 'c': 3, 'd': 4 };
  116602. *
  116603. * var values = _.memoize(_.values);
  116604. * values(object);
  116605. * // => [1, 2]
  116606. *
  116607. * values(other);
  116608. * // => [3, 4]
  116609. *
  116610. * object.a = 2;
  116611. * values(object);
  116612. * // => [1, 2]
  116613. *
  116614. * // Modify the result cache.
  116615. * values.cache.set(object, ['a', 'b']);
  116616. * values(object);
  116617. * // => ['a', 'b']
  116618. *
  116619. * // Replace `_.memoize.Cache`.
  116620. * _.memoize.Cache = WeakMap;
  116621. */
  116622. function memoize(func, resolver) {
  116623. if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {
  116624. throw new TypeError(FUNC_ERROR_TEXT);
  116625. }
  116626. var memoized = function() {
  116627. var args = arguments,
  116628. key = resolver ? resolver.apply(this, args) : args[0],
  116629. cache = memoized.cache;
  116630. if (cache.has(key)) {
  116631. return cache.get(key);
  116632. }
  116633. var result = func.apply(this, args);
  116634. memoized.cache = cache.set(key, result) || cache;
  116635. return result;
  116636. };
  116637. memoized.cache = new (memoize.Cache || _MapCache_js__WEBPACK_IMPORTED_MODULE_0__["default"]);
  116638. return memoized;
  116639. }
  116640. // Expose `MapCache`.
  116641. memoize.Cache = _MapCache_js__WEBPACK_IMPORTED_MODULE_0__["default"];
  116642. /* harmony default export */ __webpack_exports__["default"] = (memoize);
  116643. /***/ }),
  116644. /***/ "./node_modules/lodash-es/merge.js":
  116645. /*!*****************************************!*\
  116646. !*** ./node_modules/lodash-es/merge.js ***!
  116647. \*****************************************/
  116648. /*! exports provided: default */
  116649. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  116650. "use strict";
  116651. __webpack_require__.r(__webpack_exports__);
  116652. /* harmony import */ var _baseMerge_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseMerge.js */ "./node_modules/lodash-es/_baseMerge.js");
  116653. /* harmony import */ var _createAssigner_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_createAssigner.js */ "./node_modules/lodash-es/_createAssigner.js");
  116654. /**
  116655. * This method is like `_.assign` except that it recursively merges own and
  116656. * inherited enumerable string keyed properties of source objects into the
  116657. * destination object. Source properties that resolve to `undefined` are
  116658. * skipped if a destination value exists. Array and plain object properties
  116659. * are merged recursively. Other objects and value types are overridden by
  116660. * assignment. Source objects are applied from left to right. Subsequent
  116661. * sources overwrite property assignments of previous sources.
  116662. *
  116663. * **Note:** This method mutates `object`.
  116664. *
  116665. * @static
  116666. * @memberOf _
  116667. * @since 0.5.0
  116668. * @category Object
  116669. * @param {Object} object The destination object.
  116670. * @param {...Object} [sources] The source objects.
  116671. * @returns {Object} Returns `object`.
  116672. * @example
  116673. *
  116674. * var object = {
  116675. * 'a': [{ 'b': 2 }, { 'd': 4 }]
  116676. * };
  116677. *
  116678. * var other = {
  116679. * 'a': [{ 'c': 3 }, { 'e': 5 }]
  116680. * };
  116681. *
  116682. * _.merge(object, other);
  116683. * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }
  116684. */
  116685. var merge = Object(_createAssigner_js__WEBPACK_IMPORTED_MODULE_1__["default"])(function(object, source, srcIndex) {
  116686. Object(_baseMerge_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, source, srcIndex);
  116687. });
  116688. /* harmony default export */ __webpack_exports__["default"] = (merge);
  116689. /***/ }),
  116690. /***/ "./node_modules/lodash-es/mergeWith.js":
  116691. /*!*********************************************!*\
  116692. !*** ./node_modules/lodash-es/mergeWith.js ***!
  116693. \*********************************************/
  116694. /*! exports provided: default */
  116695. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  116696. "use strict";
  116697. __webpack_require__.r(__webpack_exports__);
  116698. /* harmony import */ var _baseMerge_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseMerge.js */ "./node_modules/lodash-es/_baseMerge.js");
  116699. /* harmony import */ var _createAssigner_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_createAssigner.js */ "./node_modules/lodash-es/_createAssigner.js");
  116700. /**
  116701. * This method is like `_.merge` except that it accepts `customizer` which
  116702. * is invoked to produce the merged values of the destination and source
  116703. * properties. If `customizer` returns `undefined`, merging is handled by the
  116704. * method instead. The `customizer` is invoked with six arguments:
  116705. * (objValue, srcValue, key, object, source, stack).
  116706. *
  116707. * **Note:** This method mutates `object`.
  116708. *
  116709. * @static
  116710. * @memberOf _
  116711. * @since 4.0.0
  116712. * @category Object
  116713. * @param {Object} object The destination object.
  116714. * @param {...Object} sources The source objects.
  116715. * @param {Function} customizer The function to customize assigned values.
  116716. * @returns {Object} Returns `object`.
  116717. * @example
  116718. *
  116719. * function customizer(objValue, srcValue) {
  116720. * if (_.isArray(objValue)) {
  116721. * return objValue.concat(srcValue);
  116722. * }
  116723. * }
  116724. *
  116725. * var object = { 'a': [1], 'b': [2] };
  116726. * var other = { 'a': [3], 'b': [4] };
  116727. *
  116728. * _.mergeWith(object, other, customizer);
  116729. * // => { 'a': [1, 3], 'b': [2, 4] }
  116730. */
  116731. var mergeWith = Object(_createAssigner_js__WEBPACK_IMPORTED_MODULE_1__["default"])(function(object, source, srcIndex, customizer) {
  116732. Object(_baseMerge_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, source, srcIndex, customizer);
  116733. });
  116734. /* harmony default export */ __webpack_exports__["default"] = (mergeWith);
  116735. /***/ }),
  116736. /***/ "./node_modules/lodash-es/method.js":
  116737. /*!******************************************!*\
  116738. !*** ./node_modules/lodash-es/method.js ***!
  116739. \******************************************/
  116740. /*! exports provided: default */
  116741. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  116742. "use strict";
  116743. __webpack_require__.r(__webpack_exports__);
  116744. /* harmony import */ var _baseInvoke_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseInvoke.js */ "./node_modules/lodash-es/_baseInvoke.js");
  116745. /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
  116746. /**
  116747. * Creates a function that invokes the method at `path` of a given object.
  116748. * Any additional arguments are provided to the invoked method.
  116749. *
  116750. * @static
  116751. * @memberOf _
  116752. * @since 3.7.0
  116753. * @category Util
  116754. * @param {Array|string} path The path of the method to invoke.
  116755. * @param {...*} [args] The arguments to invoke the method with.
  116756. * @returns {Function} Returns the new invoker function.
  116757. * @example
  116758. *
  116759. * var objects = [
  116760. * { 'a': { 'b': _.constant(2) } },
  116761. * { 'a': { 'b': _.constant(1) } }
  116762. * ];
  116763. *
  116764. * _.map(objects, _.method('a.b'));
  116765. * // => [2, 1]
  116766. *
  116767. * _.map(objects, _.method(['a', 'b']));
  116768. * // => [2, 1]
  116769. */
  116770. var method = Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_1__["default"])(function(path, args) {
  116771. return function(object) {
  116772. return Object(_baseInvoke_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, path, args);
  116773. };
  116774. });
  116775. /* harmony default export */ __webpack_exports__["default"] = (method);
  116776. /***/ }),
  116777. /***/ "./node_modules/lodash-es/methodOf.js":
  116778. /*!********************************************!*\
  116779. !*** ./node_modules/lodash-es/methodOf.js ***!
  116780. \********************************************/
  116781. /*! exports provided: default */
  116782. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  116783. "use strict";
  116784. __webpack_require__.r(__webpack_exports__);
  116785. /* harmony import */ var _baseInvoke_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseInvoke.js */ "./node_modules/lodash-es/_baseInvoke.js");
  116786. /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
  116787. /**
  116788. * The opposite of `_.method`; this method creates a function that invokes
  116789. * the method at a given path of `object`. Any additional arguments are
  116790. * provided to the invoked method.
  116791. *
  116792. * @static
  116793. * @memberOf _
  116794. * @since 3.7.0
  116795. * @category Util
  116796. * @param {Object} object The object to query.
  116797. * @param {...*} [args] The arguments to invoke the method with.
  116798. * @returns {Function} Returns the new invoker function.
  116799. * @example
  116800. *
  116801. * var array = _.times(3, _.constant),
  116802. * object = { 'a': array, 'b': array, 'c': array };
  116803. *
  116804. * _.map(['a[2]', 'c[0]'], _.methodOf(object));
  116805. * // => [2, 0]
  116806. *
  116807. * _.map([['a', '2'], ['c', '0']], _.methodOf(object));
  116808. * // => [2, 0]
  116809. */
  116810. var methodOf = Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_1__["default"])(function(object, args) {
  116811. return function(path) {
  116812. return Object(_baseInvoke_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, path, args);
  116813. };
  116814. });
  116815. /* harmony default export */ __webpack_exports__["default"] = (methodOf);
  116816. /***/ }),
  116817. /***/ "./node_modules/lodash-es/min.js":
  116818. /*!***************************************!*\
  116819. !*** ./node_modules/lodash-es/min.js ***!
  116820. \***************************************/
  116821. /*! exports provided: default */
  116822. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  116823. "use strict";
  116824. __webpack_require__.r(__webpack_exports__);
  116825. /* harmony import */ var _baseExtremum_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseExtremum.js */ "./node_modules/lodash-es/_baseExtremum.js");
  116826. /* harmony import */ var _baseLt_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseLt.js */ "./node_modules/lodash-es/_baseLt.js");
  116827. /* harmony import */ var _identity_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./identity.js */ "./node_modules/lodash-es/identity.js");
  116828. /**
  116829. * Computes the minimum value of `array`. If `array` is empty or falsey,
  116830. * `undefined` is returned.
  116831. *
  116832. * @static
  116833. * @since 0.1.0
  116834. * @memberOf _
  116835. * @category Math
  116836. * @param {Array} array The array to iterate over.
  116837. * @returns {*} Returns the minimum value.
  116838. * @example
  116839. *
  116840. * _.min([4, 2, 8, 6]);
  116841. * // => 2
  116842. *
  116843. * _.min([]);
  116844. * // => undefined
  116845. */
  116846. function min(array) {
  116847. return (array && array.length)
  116848. ? Object(_baseExtremum_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, _identity_js__WEBPACK_IMPORTED_MODULE_2__["default"], _baseLt_js__WEBPACK_IMPORTED_MODULE_1__["default"])
  116849. : undefined;
  116850. }
  116851. /* harmony default export */ __webpack_exports__["default"] = (min);
  116852. /***/ }),
  116853. /***/ "./node_modules/lodash-es/minBy.js":
  116854. /*!*****************************************!*\
  116855. !*** ./node_modules/lodash-es/minBy.js ***!
  116856. \*****************************************/
  116857. /*! exports provided: default */
  116858. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  116859. "use strict";
  116860. __webpack_require__.r(__webpack_exports__);
  116861. /* harmony import */ var _baseExtremum_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseExtremum.js */ "./node_modules/lodash-es/_baseExtremum.js");
  116862. /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
  116863. /* harmony import */ var _baseLt_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseLt.js */ "./node_modules/lodash-es/_baseLt.js");
  116864. /**
  116865. * This method is like `_.min` except that it accepts `iteratee` which is
  116866. * invoked for each element in `array` to generate the criterion by which
  116867. * the value is ranked. The iteratee is invoked with one argument: (value).
  116868. *
  116869. * @static
  116870. * @memberOf _
  116871. * @since 4.0.0
  116872. * @category Math
  116873. * @param {Array} array The array to iterate over.
  116874. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  116875. * @returns {*} Returns the minimum value.
  116876. * @example
  116877. *
  116878. * var objects = [{ 'n': 1 }, { 'n': 2 }];
  116879. *
  116880. * _.minBy(objects, function(o) { return o.n; });
  116881. * // => { 'n': 1 }
  116882. *
  116883. * // The `_.property` iteratee shorthand.
  116884. * _.minBy(objects, 'n');
  116885. * // => { 'n': 1 }
  116886. */
  116887. function minBy(array, iteratee) {
  116888. return (array && array.length)
  116889. ? 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"])
  116890. : undefined;
  116891. }
  116892. /* harmony default export */ __webpack_exports__["default"] = (minBy);
  116893. /***/ }),
  116894. /***/ "./node_modules/lodash-es/mixin.js":
  116895. /*!*****************************************!*\
  116896. !*** ./node_modules/lodash-es/mixin.js ***!
  116897. \*****************************************/
  116898. /*! exports provided: default */
  116899. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  116900. "use strict";
  116901. __webpack_require__.r(__webpack_exports__);
  116902. /* harmony import */ var _arrayEach_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayEach.js */ "./node_modules/lodash-es/_arrayEach.js");
  116903. /* harmony import */ var _arrayPush_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_arrayPush.js */ "./node_modules/lodash-es/_arrayPush.js");
  116904. /* harmony import */ var _baseFunctions_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseFunctions.js */ "./node_modules/lodash-es/_baseFunctions.js");
  116905. /* harmony import */ var _copyArray_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_copyArray.js */ "./node_modules/lodash-es/_copyArray.js");
  116906. /* harmony import */ var _isFunction_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./isFunction.js */ "./node_modules/lodash-es/isFunction.js");
  116907. /* harmony import */ var _isObject_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./isObject.js */ "./node_modules/lodash-es/isObject.js");
  116908. /* harmony import */ var _keys_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./keys.js */ "./node_modules/lodash-es/keys.js");
  116909. /**
  116910. * Adds all own enumerable string keyed function properties of a source
  116911. * object to the destination object. If `object` is a function, then methods
  116912. * are added to its prototype as well.
  116913. *
  116914. * **Note:** Use `_.runInContext` to create a pristine `lodash` function to
  116915. * avoid conflicts caused by modifying the original.
  116916. *
  116917. * @static
  116918. * @since 0.1.0
  116919. * @memberOf _
  116920. * @category Util
  116921. * @param {Function|Object} [object=lodash] The destination object.
  116922. * @param {Object} source The object of functions to add.
  116923. * @param {Object} [options={}] The options object.
  116924. * @param {boolean} [options.chain=true] Specify whether mixins are chainable.
  116925. * @returns {Function|Object} Returns `object`.
  116926. * @example
  116927. *
  116928. * function vowels(string) {
  116929. * return _.filter(string, function(v) {
  116930. * return /[aeiou]/i.test(v);
  116931. * });
  116932. * }
  116933. *
  116934. * _.mixin({ 'vowels': vowels });
  116935. * _.vowels('fred');
  116936. * // => ['e']
  116937. *
  116938. * _('fred').vowels().value();
  116939. * // => ['e']
  116940. *
  116941. * _.mixin({ 'vowels': vowels }, { 'chain': false });
  116942. * _('fred').vowels();
  116943. * // => ['e']
  116944. */
  116945. function mixin(object, source, options) {
  116946. var props = Object(_keys_js__WEBPACK_IMPORTED_MODULE_6__["default"])(source),
  116947. methodNames = Object(_baseFunctions_js__WEBPACK_IMPORTED_MODULE_2__["default"])(source, props);
  116948. var chain = !(Object(_isObject_js__WEBPACK_IMPORTED_MODULE_5__["default"])(options) && 'chain' in options) || !!options.chain,
  116949. isFunc = Object(_isFunction_js__WEBPACK_IMPORTED_MODULE_4__["default"])(object);
  116950. Object(_arrayEach_js__WEBPACK_IMPORTED_MODULE_0__["default"])(methodNames, function(methodName) {
  116951. var func = source[methodName];
  116952. object[methodName] = func;
  116953. if (isFunc) {
  116954. object.prototype[methodName] = function() {
  116955. var chainAll = this.__chain__;
  116956. if (chain || chainAll) {
  116957. var result = object(this.__wrapped__),
  116958. actions = result.__actions__ = Object(_copyArray_js__WEBPACK_IMPORTED_MODULE_3__["default"])(this.__actions__);
  116959. actions.push({ 'func': func, 'args': arguments, 'thisArg': object });
  116960. result.__chain__ = chainAll;
  116961. return result;
  116962. }
  116963. return func.apply(object, Object(_arrayPush_js__WEBPACK_IMPORTED_MODULE_1__["default"])([this.value()], arguments));
  116964. };
  116965. }
  116966. });
  116967. return object;
  116968. }
  116969. /* harmony default export */ __webpack_exports__["default"] = (mixin);
  116970. /***/ }),
  116971. /***/ "./node_modules/lodash-es/multiply.js":
  116972. /*!********************************************!*\
  116973. !*** ./node_modules/lodash-es/multiply.js ***!
  116974. \********************************************/
  116975. /*! exports provided: default */
  116976. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  116977. "use strict";
  116978. __webpack_require__.r(__webpack_exports__);
  116979. /* harmony import */ var _createMathOperation_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createMathOperation.js */ "./node_modules/lodash-es/_createMathOperation.js");
  116980. /**
  116981. * Multiply two numbers.
  116982. *
  116983. * @static
  116984. * @memberOf _
  116985. * @since 4.7.0
  116986. * @category Math
  116987. * @param {number} multiplier The first number in a multiplication.
  116988. * @param {number} multiplicand The second number in a multiplication.
  116989. * @returns {number} Returns the product.
  116990. * @example
  116991. *
  116992. * _.multiply(6, 4);
  116993. * // => 24
  116994. */
  116995. var multiply = Object(_createMathOperation_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function(multiplier, multiplicand) {
  116996. return multiplier * multiplicand;
  116997. }, 1);
  116998. /* harmony default export */ __webpack_exports__["default"] = (multiply);
  116999. /***/ }),
  117000. /***/ "./node_modules/lodash-es/negate.js":
  117001. /*!******************************************!*\
  117002. !*** ./node_modules/lodash-es/negate.js ***!
  117003. \******************************************/
  117004. /*! exports provided: default */
  117005. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  117006. "use strict";
  117007. __webpack_require__.r(__webpack_exports__);
  117008. /** Error message constants. */
  117009. var FUNC_ERROR_TEXT = 'Expected a function';
  117010. /**
  117011. * Creates a function that negates the result of the predicate `func`. The
  117012. * `func` predicate is invoked with the `this` binding and arguments of the
  117013. * created function.
  117014. *
  117015. * @static
  117016. * @memberOf _
  117017. * @since 3.0.0
  117018. * @category Function
  117019. * @param {Function} predicate The predicate to negate.
  117020. * @returns {Function} Returns the new negated function.
  117021. * @example
  117022. *
  117023. * function isEven(n) {
  117024. * return n % 2 == 0;
  117025. * }
  117026. *
  117027. * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven));
  117028. * // => [1, 3, 5]
  117029. */
  117030. function negate(predicate) {
  117031. if (typeof predicate != 'function') {
  117032. throw new TypeError(FUNC_ERROR_TEXT);
  117033. }
  117034. return function() {
  117035. var args = arguments;
  117036. switch (args.length) {
  117037. case 0: return !predicate.call(this);
  117038. case 1: return !predicate.call(this, args[0]);
  117039. case 2: return !predicate.call(this, args[0], args[1]);
  117040. case 3: return !predicate.call(this, args[0], args[1], args[2]);
  117041. }
  117042. return !predicate.apply(this, args);
  117043. };
  117044. }
  117045. /* harmony default export */ __webpack_exports__["default"] = (negate);
  117046. /***/ }),
  117047. /***/ "./node_modules/lodash-es/next.js":
  117048. /*!****************************************!*\
  117049. !*** ./node_modules/lodash-es/next.js ***!
  117050. \****************************************/
  117051. /*! exports provided: default */
  117052. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  117053. "use strict";
  117054. __webpack_require__.r(__webpack_exports__);
  117055. /* harmony import */ var _toArray_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./toArray.js */ "./node_modules/lodash-es/toArray.js");
  117056. /**
  117057. * Gets the next value on a wrapped object following the
  117058. * [iterator protocol](https://mdn.io/iteration_protocols#iterator).
  117059. *
  117060. * @name next
  117061. * @memberOf _
  117062. * @since 4.0.0
  117063. * @category Seq
  117064. * @returns {Object} Returns the next iterator value.
  117065. * @example
  117066. *
  117067. * var wrapped = _([1, 2]);
  117068. *
  117069. * wrapped.next();
  117070. * // => { 'done': false, 'value': 1 }
  117071. *
  117072. * wrapped.next();
  117073. * // => { 'done': false, 'value': 2 }
  117074. *
  117075. * wrapped.next();
  117076. * // => { 'done': true, 'value': undefined }
  117077. */
  117078. function wrapperNext() {
  117079. if (this.__values__ === undefined) {
  117080. this.__values__ = Object(_toArray_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this.value());
  117081. }
  117082. var done = this.__index__ >= this.__values__.length,
  117083. value = done ? undefined : this.__values__[this.__index__++];
  117084. return { 'done': done, 'value': value };
  117085. }
  117086. /* harmony default export */ __webpack_exports__["default"] = (wrapperNext);
  117087. /***/ }),
  117088. /***/ "./node_modules/lodash-es/noop.js":
  117089. /*!****************************************!*\
  117090. !*** ./node_modules/lodash-es/noop.js ***!
  117091. \****************************************/
  117092. /*! exports provided: default */
  117093. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  117094. "use strict";
  117095. __webpack_require__.r(__webpack_exports__);
  117096. /**
  117097. * This method returns `undefined`.
  117098. *
  117099. * @static
  117100. * @memberOf _
  117101. * @since 2.3.0
  117102. * @category Util
  117103. * @example
  117104. *
  117105. * _.times(2, _.noop);
  117106. * // => [undefined, undefined]
  117107. */
  117108. function noop() {
  117109. // No operation performed.
  117110. }
  117111. /* harmony default export */ __webpack_exports__["default"] = (noop);
  117112. /***/ }),
  117113. /***/ "./node_modules/lodash-es/now.js":
  117114. /*!***************************************!*\
  117115. !*** ./node_modules/lodash-es/now.js ***!
  117116. \***************************************/
  117117. /*! exports provided: default */
  117118. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  117119. "use strict";
  117120. __webpack_require__.r(__webpack_exports__);
  117121. /* harmony import */ var _root_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_root.js */ "./node_modules/lodash-es/_root.js");
  117122. /**
  117123. * Gets the timestamp of the number of milliseconds that have elapsed since
  117124. * the Unix epoch (1 January 1970 00:00:00 UTC).
  117125. *
  117126. * @static
  117127. * @memberOf _
  117128. * @since 2.4.0
  117129. * @category Date
  117130. * @returns {number} Returns the timestamp.
  117131. * @example
  117132. *
  117133. * _.defer(function(stamp) {
  117134. * console.log(_.now() - stamp);
  117135. * }, _.now());
  117136. * // => Logs the number of milliseconds it took for the deferred invocation.
  117137. */
  117138. var now = function() {
  117139. return _root_js__WEBPACK_IMPORTED_MODULE_0__["default"].Date.now();
  117140. };
  117141. /* harmony default export */ __webpack_exports__["default"] = (now);
  117142. /***/ }),
  117143. /***/ "./node_modules/lodash-es/nth.js":
  117144. /*!***************************************!*\
  117145. !*** ./node_modules/lodash-es/nth.js ***!
  117146. \***************************************/
  117147. /*! exports provided: default */
  117148. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  117149. "use strict";
  117150. __webpack_require__.r(__webpack_exports__);
  117151. /* harmony import */ var _baseNth_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseNth.js */ "./node_modules/lodash-es/_baseNth.js");
  117152. /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
  117153. /**
  117154. * Gets the element at index `n` of `array`. If `n` is negative, the nth
  117155. * element from the end is returned.
  117156. *
  117157. * @static
  117158. * @memberOf _
  117159. * @since 4.11.0
  117160. * @category Array
  117161. * @param {Array} array The array to query.
  117162. * @param {number} [n=0] The index of the element to return.
  117163. * @returns {*} Returns the nth element of `array`.
  117164. * @example
  117165. *
  117166. * var array = ['a', 'b', 'c', 'd'];
  117167. *
  117168. * _.nth(array, 1);
  117169. * // => 'b'
  117170. *
  117171. * _.nth(array, -2);
  117172. * // => 'c';
  117173. */
  117174. function nth(array, n) {
  117175. return (array && array.length) ? Object(_baseNth_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_1__["default"])(n)) : undefined;
  117176. }
  117177. /* harmony default export */ __webpack_exports__["default"] = (nth);
  117178. /***/ }),
  117179. /***/ "./node_modules/lodash-es/nthArg.js":
  117180. /*!******************************************!*\
  117181. !*** ./node_modules/lodash-es/nthArg.js ***!
  117182. \******************************************/
  117183. /*! exports provided: default */
  117184. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  117185. "use strict";
  117186. __webpack_require__.r(__webpack_exports__);
  117187. /* harmony import */ var _baseNth_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseNth.js */ "./node_modules/lodash-es/_baseNth.js");
  117188. /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
  117189. /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
  117190. /**
  117191. * Creates a function that gets the argument at index `n`. If `n` is negative,
  117192. * the nth argument from the end is returned.
  117193. *
  117194. * @static
  117195. * @memberOf _
  117196. * @since 4.0.0
  117197. * @category Util
  117198. * @param {number} [n=0] The index of the argument to return.
  117199. * @returns {Function} Returns the new pass-thru function.
  117200. * @example
  117201. *
  117202. * var func = _.nthArg(1);
  117203. * func('a', 'b', 'c', 'd');
  117204. * // => 'b'
  117205. *
  117206. * var func = _.nthArg(-2);
  117207. * func('a', 'b', 'c', 'd');
  117208. * // => 'c'
  117209. */
  117210. function nthArg(n) {
  117211. n = Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_2__["default"])(n);
  117212. return Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_1__["default"])(function(args) {
  117213. return Object(_baseNth_js__WEBPACK_IMPORTED_MODULE_0__["default"])(args, n);
  117214. });
  117215. }
  117216. /* harmony default export */ __webpack_exports__["default"] = (nthArg);
  117217. /***/ }),
  117218. /***/ "./node_modules/lodash-es/number.default.js":
  117219. /*!**************************************************!*\
  117220. !*** ./node_modules/lodash-es/number.default.js ***!
  117221. \**************************************************/
  117222. /*! exports provided: default */
  117223. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  117224. "use strict";
  117225. __webpack_require__.r(__webpack_exports__);
  117226. /* harmony import */ var _clamp_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./clamp.js */ "./node_modules/lodash-es/clamp.js");
  117227. /* harmony import */ var _inRange_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./inRange.js */ "./node_modules/lodash-es/inRange.js");
  117228. /* harmony import */ var _random_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./random.js */ "./node_modules/lodash-es/random.js");
  117229. /* harmony default export */ __webpack_exports__["default"] = ({
  117230. clamp: _clamp_js__WEBPACK_IMPORTED_MODULE_0__["default"], inRange: _inRange_js__WEBPACK_IMPORTED_MODULE_1__["default"], random: _random_js__WEBPACK_IMPORTED_MODULE_2__["default"]
  117231. });
  117232. /***/ }),
  117233. /***/ "./node_modules/lodash-es/number.js":
  117234. /*!******************************************!*\
  117235. !*** ./node_modules/lodash-es/number.js ***!
  117236. \******************************************/
  117237. /*! exports provided: clamp, inRange, random, default */
  117238. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  117239. "use strict";
  117240. __webpack_require__.r(__webpack_exports__);
  117241. /* harmony import */ var _clamp_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./clamp.js */ "./node_modules/lodash-es/clamp.js");
  117242. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "clamp", function() { return _clamp_js__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  117243. /* harmony import */ var _inRange_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./inRange.js */ "./node_modules/lodash-es/inRange.js");
  117244. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "inRange", function() { return _inRange_js__WEBPACK_IMPORTED_MODULE_1__["default"]; });
  117245. /* harmony import */ var _random_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./random.js */ "./node_modules/lodash-es/random.js");
  117246. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "random", function() { return _random_js__WEBPACK_IMPORTED_MODULE_2__["default"]; });
  117247. /* harmony import */ var _number_default_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./number.default.js */ "./node_modules/lodash-es/number.default.js");
  117248. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _number_default_js__WEBPACK_IMPORTED_MODULE_3__["default"]; });
  117249. /***/ }),
  117250. /***/ "./node_modules/lodash-es/object.default.js":
  117251. /*!**************************************************!*\
  117252. !*** ./node_modules/lodash-es/object.default.js ***!
  117253. \**************************************************/
  117254. /*! exports provided: default */
  117255. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  117256. "use strict";
  117257. __webpack_require__.r(__webpack_exports__);
  117258. /* harmony import */ var _assign_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./assign.js */ "./node_modules/lodash-es/assign.js");
  117259. /* harmony import */ var _assignIn_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./assignIn.js */ "./node_modules/lodash-es/assignIn.js");
  117260. /* harmony import */ var _assignInWith_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./assignInWith.js */ "./node_modules/lodash-es/assignInWith.js");
  117261. /* harmony import */ var _assignWith_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./assignWith.js */ "./node_modules/lodash-es/assignWith.js");
  117262. /* harmony import */ var _at_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./at.js */ "./node_modules/lodash-es/at.js");
  117263. /* harmony import */ var _create_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./create.js */ "./node_modules/lodash-es/create.js");
  117264. /* harmony import */ var _defaults_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./defaults.js */ "./node_modules/lodash-es/defaults.js");
  117265. /* harmony import */ var _defaultsDeep_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./defaultsDeep.js */ "./node_modules/lodash-es/defaultsDeep.js");
  117266. /* harmony import */ var _entries_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./entries.js */ "./node_modules/lodash-es/entries.js");
  117267. /* harmony import */ var _entriesIn_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./entriesIn.js */ "./node_modules/lodash-es/entriesIn.js");
  117268. /* harmony import */ var _extend_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./extend.js */ "./node_modules/lodash-es/extend.js");
  117269. /* harmony import */ var _extendWith_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./extendWith.js */ "./node_modules/lodash-es/extendWith.js");
  117270. /* harmony import */ var _findKey_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./findKey.js */ "./node_modules/lodash-es/findKey.js");
  117271. /* harmony import */ var _findLastKey_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./findLastKey.js */ "./node_modules/lodash-es/findLastKey.js");
  117272. /* harmony import */ var _forIn_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./forIn.js */ "./node_modules/lodash-es/forIn.js");
  117273. /* harmony import */ var _forInRight_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./forInRight.js */ "./node_modules/lodash-es/forInRight.js");
  117274. /* harmony import */ var _forOwn_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./forOwn.js */ "./node_modules/lodash-es/forOwn.js");
  117275. /* harmony import */ var _forOwnRight_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./forOwnRight.js */ "./node_modules/lodash-es/forOwnRight.js");
  117276. /* harmony import */ var _functions_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./functions.js */ "./node_modules/lodash-es/functions.js");
  117277. /* harmony import */ var _functionsIn_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./functionsIn.js */ "./node_modules/lodash-es/functionsIn.js");
  117278. /* harmony import */ var _get_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./get.js */ "./node_modules/lodash-es/get.js");
  117279. /* harmony import */ var _has_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./has.js */ "./node_modules/lodash-es/has.js");
  117280. /* harmony import */ var _hasIn_js__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./hasIn.js */ "./node_modules/lodash-es/hasIn.js");
  117281. /* harmony import */ var _invert_js__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./invert.js */ "./node_modules/lodash-es/invert.js");
  117282. /* harmony import */ var _invertBy_js__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./invertBy.js */ "./node_modules/lodash-es/invertBy.js");
  117283. /* harmony import */ var _invoke_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./invoke.js */ "./node_modules/lodash-es/invoke.js");
  117284. /* harmony import */ var _keys_js__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./keys.js */ "./node_modules/lodash-es/keys.js");
  117285. /* harmony import */ var _keysIn_js__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./keysIn.js */ "./node_modules/lodash-es/keysIn.js");
  117286. /* harmony import */ var _mapKeys_js__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./mapKeys.js */ "./node_modules/lodash-es/mapKeys.js");
  117287. /* harmony import */ var _mapValues_js__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./mapValues.js */ "./node_modules/lodash-es/mapValues.js");
  117288. /* harmony import */ var _merge_js__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./merge.js */ "./node_modules/lodash-es/merge.js");
  117289. /* harmony import */ var _mergeWith_js__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ./mergeWith.js */ "./node_modules/lodash-es/mergeWith.js");
  117290. /* harmony import */ var _omit_js__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ./omit.js */ "./node_modules/lodash-es/omit.js");
  117291. /* harmony import */ var _omitBy_js__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ./omitBy.js */ "./node_modules/lodash-es/omitBy.js");
  117292. /* harmony import */ var _pick_js__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ./pick.js */ "./node_modules/lodash-es/pick.js");
  117293. /* harmony import */ var _pickBy_js__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ./pickBy.js */ "./node_modules/lodash-es/pickBy.js");
  117294. /* harmony import */ var _result_js__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! ./result.js */ "./node_modules/lodash-es/result.js");
  117295. /* harmony import */ var _set_js__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(/*! ./set.js */ "./node_modules/lodash-es/set.js");
  117296. /* harmony import */ var _setWith_js__WEBPACK_IMPORTED_MODULE_38__ = __webpack_require__(/*! ./setWith.js */ "./node_modules/lodash-es/setWith.js");
  117297. /* harmony import */ var _toPairs_js__WEBPACK_IMPORTED_MODULE_39__ = __webpack_require__(/*! ./toPairs.js */ "./node_modules/lodash-es/toPairs.js");
  117298. /* harmony import */ var _toPairsIn_js__WEBPACK_IMPORTED_MODULE_40__ = __webpack_require__(/*! ./toPairsIn.js */ "./node_modules/lodash-es/toPairsIn.js");
  117299. /* harmony import */ var _transform_js__WEBPACK_IMPORTED_MODULE_41__ = __webpack_require__(/*! ./transform.js */ "./node_modules/lodash-es/transform.js");
  117300. /* harmony import */ var _unset_js__WEBPACK_IMPORTED_MODULE_42__ = __webpack_require__(/*! ./unset.js */ "./node_modules/lodash-es/unset.js");
  117301. /* harmony import */ var _update_js__WEBPACK_IMPORTED_MODULE_43__ = __webpack_require__(/*! ./update.js */ "./node_modules/lodash-es/update.js");
  117302. /* harmony import */ var _updateWith_js__WEBPACK_IMPORTED_MODULE_44__ = __webpack_require__(/*! ./updateWith.js */ "./node_modules/lodash-es/updateWith.js");
  117303. /* harmony import */ var _values_js__WEBPACK_IMPORTED_MODULE_45__ = __webpack_require__(/*! ./values.js */ "./node_modules/lodash-es/values.js");
  117304. /* harmony import */ var _valuesIn_js__WEBPACK_IMPORTED_MODULE_46__ = __webpack_require__(/*! ./valuesIn.js */ "./node_modules/lodash-es/valuesIn.js");
  117305. /* harmony default export */ __webpack_exports__["default"] = ({
  117306. 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"],
  117307. 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"],
  117308. 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"],
  117309. 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"],
  117310. 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"],
  117311. 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"],
  117312. 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"],
  117313. 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"],
  117314. 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"],
  117315. values: _values_js__WEBPACK_IMPORTED_MODULE_45__["default"], valuesIn: _valuesIn_js__WEBPACK_IMPORTED_MODULE_46__["default"]
  117316. });
  117317. /***/ }),
  117318. /***/ "./node_modules/lodash-es/object.js":
  117319. /*!******************************************!*\
  117320. !*** ./node_modules/lodash-es/object.js ***!
  117321. \******************************************/
  117322. /*! 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 */
  117323. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  117324. "use strict";
  117325. __webpack_require__.r(__webpack_exports__);
  117326. /* harmony import */ var _assign_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./assign.js */ "./node_modules/lodash-es/assign.js");
  117327. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "assign", function() { return _assign_js__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  117328. /* harmony import */ var _assignIn_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./assignIn.js */ "./node_modules/lodash-es/assignIn.js");
  117329. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "assignIn", function() { return _assignIn_js__WEBPACK_IMPORTED_MODULE_1__["default"]; });
  117330. /* harmony import */ var _assignInWith_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./assignInWith.js */ "./node_modules/lodash-es/assignInWith.js");
  117331. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "assignInWith", function() { return _assignInWith_js__WEBPACK_IMPORTED_MODULE_2__["default"]; });
  117332. /* harmony import */ var _assignWith_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./assignWith.js */ "./node_modules/lodash-es/assignWith.js");
  117333. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "assignWith", function() { return _assignWith_js__WEBPACK_IMPORTED_MODULE_3__["default"]; });
  117334. /* harmony import */ var _at_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./at.js */ "./node_modules/lodash-es/at.js");
  117335. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "at", function() { return _at_js__WEBPACK_IMPORTED_MODULE_4__["default"]; });
  117336. /* harmony import */ var _create_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./create.js */ "./node_modules/lodash-es/create.js");
  117337. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "create", function() { return _create_js__WEBPACK_IMPORTED_MODULE_5__["default"]; });
  117338. /* harmony import */ var _defaults_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./defaults.js */ "./node_modules/lodash-es/defaults.js");
  117339. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "defaults", function() { return _defaults_js__WEBPACK_IMPORTED_MODULE_6__["default"]; });
  117340. /* harmony import */ var _defaultsDeep_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./defaultsDeep.js */ "./node_modules/lodash-es/defaultsDeep.js");
  117341. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "defaultsDeep", function() { return _defaultsDeep_js__WEBPACK_IMPORTED_MODULE_7__["default"]; });
  117342. /* harmony import */ var _entries_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./entries.js */ "./node_modules/lodash-es/entries.js");
  117343. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "entries", function() { return _entries_js__WEBPACK_IMPORTED_MODULE_8__["default"]; });
  117344. /* harmony import */ var _entriesIn_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./entriesIn.js */ "./node_modules/lodash-es/entriesIn.js");
  117345. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "entriesIn", function() { return _entriesIn_js__WEBPACK_IMPORTED_MODULE_9__["default"]; });
  117346. /* harmony import */ var _extend_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./extend.js */ "./node_modules/lodash-es/extend.js");
  117347. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "extend", function() { return _extend_js__WEBPACK_IMPORTED_MODULE_10__["default"]; });
  117348. /* harmony import */ var _extendWith_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./extendWith.js */ "./node_modules/lodash-es/extendWith.js");
  117349. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "extendWith", function() { return _extendWith_js__WEBPACK_IMPORTED_MODULE_11__["default"]; });
  117350. /* harmony import */ var _findKey_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./findKey.js */ "./node_modules/lodash-es/findKey.js");
  117351. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "findKey", function() { return _findKey_js__WEBPACK_IMPORTED_MODULE_12__["default"]; });
  117352. /* harmony import */ var _findLastKey_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./findLastKey.js */ "./node_modules/lodash-es/findLastKey.js");
  117353. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "findLastKey", function() { return _findLastKey_js__WEBPACK_IMPORTED_MODULE_13__["default"]; });
  117354. /* harmony import */ var _forIn_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./forIn.js */ "./node_modules/lodash-es/forIn.js");
  117355. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "forIn", function() { return _forIn_js__WEBPACK_IMPORTED_MODULE_14__["default"]; });
  117356. /* harmony import */ var _forInRight_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./forInRight.js */ "./node_modules/lodash-es/forInRight.js");
  117357. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "forInRight", function() { return _forInRight_js__WEBPACK_IMPORTED_MODULE_15__["default"]; });
  117358. /* harmony import */ var _forOwn_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./forOwn.js */ "./node_modules/lodash-es/forOwn.js");
  117359. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "forOwn", function() { return _forOwn_js__WEBPACK_IMPORTED_MODULE_16__["default"]; });
  117360. /* harmony import */ var _forOwnRight_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./forOwnRight.js */ "./node_modules/lodash-es/forOwnRight.js");
  117361. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "forOwnRight", function() { return _forOwnRight_js__WEBPACK_IMPORTED_MODULE_17__["default"]; });
  117362. /* harmony import */ var _functions_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./functions.js */ "./node_modules/lodash-es/functions.js");
  117363. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "functions", function() { return _functions_js__WEBPACK_IMPORTED_MODULE_18__["default"]; });
  117364. /* harmony import */ var _functionsIn_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./functionsIn.js */ "./node_modules/lodash-es/functionsIn.js");
  117365. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "functionsIn", function() { return _functionsIn_js__WEBPACK_IMPORTED_MODULE_19__["default"]; });
  117366. /* harmony import */ var _get_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./get.js */ "./node_modules/lodash-es/get.js");
  117367. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "get", function() { return _get_js__WEBPACK_IMPORTED_MODULE_20__["default"]; });
  117368. /* harmony import */ var _has_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./has.js */ "./node_modules/lodash-es/has.js");
  117369. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "has", function() { return _has_js__WEBPACK_IMPORTED_MODULE_21__["default"]; });
  117370. /* harmony import */ var _hasIn_js__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./hasIn.js */ "./node_modules/lodash-es/hasIn.js");
  117371. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "hasIn", function() { return _hasIn_js__WEBPACK_IMPORTED_MODULE_22__["default"]; });
  117372. /* harmony import */ var _invert_js__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./invert.js */ "./node_modules/lodash-es/invert.js");
  117373. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "invert", function() { return _invert_js__WEBPACK_IMPORTED_MODULE_23__["default"]; });
  117374. /* harmony import */ var _invertBy_js__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./invertBy.js */ "./node_modules/lodash-es/invertBy.js");
  117375. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "invertBy", function() { return _invertBy_js__WEBPACK_IMPORTED_MODULE_24__["default"]; });
  117376. /* harmony import */ var _invoke_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./invoke.js */ "./node_modules/lodash-es/invoke.js");
  117377. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "invoke", function() { return _invoke_js__WEBPACK_IMPORTED_MODULE_25__["default"]; });
  117378. /* harmony import */ var _keys_js__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./keys.js */ "./node_modules/lodash-es/keys.js");
  117379. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "keys", function() { return _keys_js__WEBPACK_IMPORTED_MODULE_26__["default"]; });
  117380. /* harmony import */ var _keysIn_js__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./keysIn.js */ "./node_modules/lodash-es/keysIn.js");
  117381. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "keysIn", function() { return _keysIn_js__WEBPACK_IMPORTED_MODULE_27__["default"]; });
  117382. /* harmony import */ var _mapKeys_js__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./mapKeys.js */ "./node_modules/lodash-es/mapKeys.js");
  117383. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "mapKeys", function() { return _mapKeys_js__WEBPACK_IMPORTED_MODULE_28__["default"]; });
  117384. /* harmony import */ var _mapValues_js__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./mapValues.js */ "./node_modules/lodash-es/mapValues.js");
  117385. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "mapValues", function() { return _mapValues_js__WEBPACK_IMPORTED_MODULE_29__["default"]; });
  117386. /* harmony import */ var _merge_js__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./merge.js */ "./node_modules/lodash-es/merge.js");
  117387. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "merge", function() { return _merge_js__WEBPACK_IMPORTED_MODULE_30__["default"]; });
  117388. /* harmony import */ var _mergeWith_js__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ./mergeWith.js */ "./node_modules/lodash-es/mergeWith.js");
  117389. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "mergeWith", function() { return _mergeWith_js__WEBPACK_IMPORTED_MODULE_31__["default"]; });
  117390. /* harmony import */ var _omit_js__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ./omit.js */ "./node_modules/lodash-es/omit.js");
  117391. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "omit", function() { return _omit_js__WEBPACK_IMPORTED_MODULE_32__["default"]; });
  117392. /* harmony import */ var _omitBy_js__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ./omitBy.js */ "./node_modules/lodash-es/omitBy.js");
  117393. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "omitBy", function() { return _omitBy_js__WEBPACK_IMPORTED_MODULE_33__["default"]; });
  117394. /* harmony import */ var _pick_js__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ./pick.js */ "./node_modules/lodash-es/pick.js");
  117395. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "pick", function() { return _pick_js__WEBPACK_IMPORTED_MODULE_34__["default"]; });
  117396. /* harmony import */ var _pickBy_js__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ./pickBy.js */ "./node_modules/lodash-es/pickBy.js");
  117397. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "pickBy", function() { return _pickBy_js__WEBPACK_IMPORTED_MODULE_35__["default"]; });
  117398. /* harmony import */ var _result_js__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! ./result.js */ "./node_modules/lodash-es/result.js");
  117399. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "result", function() { return _result_js__WEBPACK_IMPORTED_MODULE_36__["default"]; });
  117400. /* harmony import */ var _set_js__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(/*! ./set.js */ "./node_modules/lodash-es/set.js");
  117401. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "set", function() { return _set_js__WEBPACK_IMPORTED_MODULE_37__["default"]; });
  117402. /* harmony import */ var _setWith_js__WEBPACK_IMPORTED_MODULE_38__ = __webpack_require__(/*! ./setWith.js */ "./node_modules/lodash-es/setWith.js");
  117403. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "setWith", function() { return _setWith_js__WEBPACK_IMPORTED_MODULE_38__["default"]; });
  117404. /* harmony import */ var _toPairs_js__WEBPACK_IMPORTED_MODULE_39__ = __webpack_require__(/*! ./toPairs.js */ "./node_modules/lodash-es/toPairs.js");
  117405. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toPairs", function() { return _toPairs_js__WEBPACK_IMPORTED_MODULE_39__["default"]; });
  117406. /* harmony import */ var _toPairsIn_js__WEBPACK_IMPORTED_MODULE_40__ = __webpack_require__(/*! ./toPairsIn.js */ "./node_modules/lodash-es/toPairsIn.js");
  117407. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toPairsIn", function() { return _toPairsIn_js__WEBPACK_IMPORTED_MODULE_40__["default"]; });
  117408. /* harmony import */ var _transform_js__WEBPACK_IMPORTED_MODULE_41__ = __webpack_require__(/*! ./transform.js */ "./node_modules/lodash-es/transform.js");
  117409. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "transform", function() { return _transform_js__WEBPACK_IMPORTED_MODULE_41__["default"]; });
  117410. /* harmony import */ var _unset_js__WEBPACK_IMPORTED_MODULE_42__ = __webpack_require__(/*! ./unset.js */ "./node_modules/lodash-es/unset.js");
  117411. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "unset", function() { return _unset_js__WEBPACK_IMPORTED_MODULE_42__["default"]; });
  117412. /* harmony import */ var _update_js__WEBPACK_IMPORTED_MODULE_43__ = __webpack_require__(/*! ./update.js */ "./node_modules/lodash-es/update.js");
  117413. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "update", function() { return _update_js__WEBPACK_IMPORTED_MODULE_43__["default"]; });
  117414. /* harmony import */ var _updateWith_js__WEBPACK_IMPORTED_MODULE_44__ = __webpack_require__(/*! ./updateWith.js */ "./node_modules/lodash-es/updateWith.js");
  117415. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "updateWith", function() { return _updateWith_js__WEBPACK_IMPORTED_MODULE_44__["default"]; });
  117416. /* harmony import */ var _values_js__WEBPACK_IMPORTED_MODULE_45__ = __webpack_require__(/*! ./values.js */ "./node_modules/lodash-es/values.js");
  117417. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "values", function() { return _values_js__WEBPACK_IMPORTED_MODULE_45__["default"]; });
  117418. /* harmony import */ var _valuesIn_js__WEBPACK_IMPORTED_MODULE_46__ = __webpack_require__(/*! ./valuesIn.js */ "./node_modules/lodash-es/valuesIn.js");
  117419. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "valuesIn", function() { return _valuesIn_js__WEBPACK_IMPORTED_MODULE_46__["default"]; });
  117420. /* harmony import */ var _object_default_js__WEBPACK_IMPORTED_MODULE_47__ = __webpack_require__(/*! ./object.default.js */ "./node_modules/lodash-es/object.default.js");
  117421. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _object_default_js__WEBPACK_IMPORTED_MODULE_47__["default"]; });
  117422. /***/ }),
  117423. /***/ "./node_modules/lodash-es/omit.js":
  117424. /*!****************************************!*\
  117425. !*** ./node_modules/lodash-es/omit.js ***!
  117426. \****************************************/
  117427. /*! exports provided: default */
  117428. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  117429. "use strict";
  117430. __webpack_require__.r(__webpack_exports__);
  117431. /* harmony import */ var _arrayMap_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayMap.js */ "./node_modules/lodash-es/_arrayMap.js");
  117432. /* harmony import */ var _baseClone_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseClone.js */ "./node_modules/lodash-es/_baseClone.js");
  117433. /* harmony import */ var _baseUnset_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseUnset.js */ "./node_modules/lodash-es/_baseUnset.js");
  117434. /* harmony import */ var _castPath_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_castPath.js */ "./node_modules/lodash-es/_castPath.js");
  117435. /* harmony import */ var _copyObject_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_copyObject.js */ "./node_modules/lodash-es/_copyObject.js");
  117436. /* harmony import */ var _customOmitClone_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./_customOmitClone.js */ "./node_modules/lodash-es/_customOmitClone.js");
  117437. /* harmony import */ var _flatRest_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./_flatRest.js */ "./node_modules/lodash-es/_flatRest.js");
  117438. /* harmony import */ var _getAllKeysIn_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./_getAllKeysIn.js */ "./node_modules/lodash-es/_getAllKeysIn.js");
  117439. /** Used to compose bitmasks for cloning. */
  117440. var CLONE_DEEP_FLAG = 1,
  117441. CLONE_FLAT_FLAG = 2,
  117442. CLONE_SYMBOLS_FLAG = 4;
  117443. /**
  117444. * The opposite of `_.pick`; this method creates an object composed of the
  117445. * own and inherited enumerable property paths of `object` that are not omitted.
  117446. *
  117447. * **Note:** This method is considerably slower than `_.pick`.
  117448. *
  117449. * @static
  117450. * @since 0.1.0
  117451. * @memberOf _
  117452. * @category Object
  117453. * @param {Object} object The source object.
  117454. * @param {...(string|string[])} [paths] The property paths to omit.
  117455. * @returns {Object} Returns the new object.
  117456. * @example
  117457. *
  117458. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  117459. *
  117460. * _.omit(object, ['a', 'c']);
  117461. * // => { 'b': '2' }
  117462. */
  117463. var omit = Object(_flatRest_js__WEBPACK_IMPORTED_MODULE_6__["default"])(function(object, paths) {
  117464. var result = {};
  117465. if (object == null) {
  117466. return result;
  117467. }
  117468. var isDeep = false;
  117469. paths = Object(_arrayMap_js__WEBPACK_IMPORTED_MODULE_0__["default"])(paths, function(path) {
  117470. path = Object(_castPath_js__WEBPACK_IMPORTED_MODULE_3__["default"])(path, object);
  117471. isDeep || (isDeep = path.length > 1);
  117472. return path;
  117473. });
  117474. Object(_copyObject_js__WEBPACK_IMPORTED_MODULE_4__["default"])(object, Object(_getAllKeysIn_js__WEBPACK_IMPORTED_MODULE_7__["default"])(object), result);
  117475. if (isDeep) {
  117476. 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"]);
  117477. }
  117478. var length = paths.length;
  117479. while (length--) {
  117480. Object(_baseUnset_js__WEBPACK_IMPORTED_MODULE_2__["default"])(result, paths[length]);
  117481. }
  117482. return result;
  117483. });
  117484. /* harmony default export */ __webpack_exports__["default"] = (omit);
  117485. /***/ }),
  117486. /***/ "./node_modules/lodash-es/omitBy.js":
  117487. /*!******************************************!*\
  117488. !*** ./node_modules/lodash-es/omitBy.js ***!
  117489. \******************************************/
  117490. /*! exports provided: default */
  117491. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  117492. "use strict";
  117493. __webpack_require__.r(__webpack_exports__);
  117494. /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
  117495. /* harmony import */ var _negate_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./negate.js */ "./node_modules/lodash-es/negate.js");
  117496. /* harmony import */ var _pickBy_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./pickBy.js */ "./node_modules/lodash-es/pickBy.js");
  117497. /**
  117498. * The opposite of `_.pickBy`; this method creates an object composed of
  117499. * the own and inherited enumerable string keyed properties of `object` that
  117500. * `predicate` doesn't return truthy for. The predicate is invoked with two
  117501. * arguments: (value, key).
  117502. *
  117503. * @static
  117504. * @memberOf _
  117505. * @since 4.0.0
  117506. * @category Object
  117507. * @param {Object} object The source object.
  117508. * @param {Function} [predicate=_.identity] The function invoked per property.
  117509. * @returns {Object} Returns the new object.
  117510. * @example
  117511. *
  117512. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  117513. *
  117514. * _.omitBy(object, _.isNumber);
  117515. * // => { 'b': '2' }
  117516. */
  117517. function omitBy(object, predicate) {
  117518. 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)));
  117519. }
  117520. /* harmony default export */ __webpack_exports__["default"] = (omitBy);
  117521. /***/ }),
  117522. /***/ "./node_modules/lodash-es/once.js":
  117523. /*!****************************************!*\
  117524. !*** ./node_modules/lodash-es/once.js ***!
  117525. \****************************************/
  117526. /*! exports provided: default */
  117527. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  117528. "use strict";
  117529. __webpack_require__.r(__webpack_exports__);
  117530. /* harmony import */ var _before_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./before.js */ "./node_modules/lodash-es/before.js");
  117531. /**
  117532. * Creates a function that is restricted to invoking `func` once. Repeat calls
  117533. * to the function return the value of the first invocation. The `func` is
  117534. * invoked with the `this` binding and arguments of the created function.
  117535. *
  117536. * @static
  117537. * @memberOf _
  117538. * @since 0.1.0
  117539. * @category Function
  117540. * @param {Function} func The function to restrict.
  117541. * @returns {Function} Returns the new restricted function.
  117542. * @example
  117543. *
  117544. * var initialize = _.once(createApplication);
  117545. * initialize();
  117546. * initialize();
  117547. * // => `createApplication` is invoked once
  117548. */
  117549. function once(func) {
  117550. return Object(_before_js__WEBPACK_IMPORTED_MODULE_0__["default"])(2, func);
  117551. }
  117552. /* harmony default export */ __webpack_exports__["default"] = (once);
  117553. /***/ }),
  117554. /***/ "./node_modules/lodash-es/orderBy.js":
  117555. /*!*******************************************!*\
  117556. !*** ./node_modules/lodash-es/orderBy.js ***!
  117557. \*******************************************/
  117558. /*! exports provided: default */
  117559. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  117560. "use strict";
  117561. __webpack_require__.r(__webpack_exports__);
  117562. /* harmony import */ var _baseOrderBy_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseOrderBy.js */ "./node_modules/lodash-es/_baseOrderBy.js");
  117563. /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
  117564. /**
  117565. * This method is like `_.sortBy` except that it allows specifying the sort
  117566. * orders of the iteratees to sort by. If `orders` is unspecified, all values
  117567. * are sorted in ascending order. Otherwise, specify an order of "desc" for
  117568. * descending or "asc" for ascending sort order of corresponding values.
  117569. *
  117570. * @static
  117571. * @memberOf _
  117572. * @since 4.0.0
  117573. * @category Collection
  117574. * @param {Array|Object} collection The collection to iterate over.
  117575. * @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]]
  117576. * The iteratees to sort by.
  117577. * @param {string[]} [orders] The sort orders of `iteratees`.
  117578. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
  117579. * @returns {Array} Returns the new sorted array.
  117580. * @example
  117581. *
  117582. * var users = [
  117583. * { 'user': 'fred', 'age': 48 },
  117584. * { 'user': 'barney', 'age': 34 },
  117585. * { 'user': 'fred', 'age': 40 },
  117586. * { 'user': 'barney', 'age': 36 }
  117587. * ];
  117588. *
  117589. * // Sort by `user` in ascending order and by `age` in descending order.
  117590. * _.orderBy(users, ['user', 'age'], ['asc', 'desc']);
  117591. * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]
  117592. */
  117593. function orderBy(collection, iteratees, orders, guard) {
  117594. if (collection == null) {
  117595. return [];
  117596. }
  117597. if (!Object(_isArray_js__WEBPACK_IMPORTED_MODULE_1__["default"])(iteratees)) {
  117598. iteratees = iteratees == null ? [] : [iteratees];
  117599. }
  117600. orders = guard ? undefined : orders;
  117601. if (!Object(_isArray_js__WEBPACK_IMPORTED_MODULE_1__["default"])(orders)) {
  117602. orders = orders == null ? [] : [orders];
  117603. }
  117604. return Object(_baseOrderBy_js__WEBPACK_IMPORTED_MODULE_0__["default"])(collection, iteratees, orders);
  117605. }
  117606. /* harmony default export */ __webpack_exports__["default"] = (orderBy);
  117607. /***/ }),
  117608. /***/ "./node_modules/lodash-es/over.js":
  117609. /*!****************************************!*\
  117610. !*** ./node_modules/lodash-es/over.js ***!
  117611. \****************************************/
  117612. /*! exports provided: default */
  117613. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  117614. "use strict";
  117615. __webpack_require__.r(__webpack_exports__);
  117616. /* harmony import */ var _arrayMap_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayMap.js */ "./node_modules/lodash-es/_arrayMap.js");
  117617. /* harmony import */ var _createOver_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_createOver.js */ "./node_modules/lodash-es/_createOver.js");
  117618. /**
  117619. * Creates a function that invokes `iteratees` with the arguments it receives
  117620. * and returns their results.
  117621. *
  117622. * @static
  117623. * @memberOf _
  117624. * @since 4.0.0
  117625. * @category Util
  117626. * @param {...(Function|Function[])} [iteratees=[_.identity]]
  117627. * The iteratees to invoke.
  117628. * @returns {Function} Returns the new function.
  117629. * @example
  117630. *
  117631. * var func = _.over([Math.max, Math.min]);
  117632. *
  117633. * func(1, 2, 3, 4);
  117634. * // => [4, 1]
  117635. */
  117636. var over = Object(_createOver_js__WEBPACK_IMPORTED_MODULE_1__["default"])(_arrayMap_js__WEBPACK_IMPORTED_MODULE_0__["default"]);
  117637. /* harmony default export */ __webpack_exports__["default"] = (over);
  117638. /***/ }),
  117639. /***/ "./node_modules/lodash-es/overArgs.js":
  117640. /*!********************************************!*\
  117641. !*** ./node_modules/lodash-es/overArgs.js ***!
  117642. \********************************************/
  117643. /*! exports provided: default */
  117644. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  117645. "use strict";
  117646. __webpack_require__.r(__webpack_exports__);
  117647. /* harmony import */ var _apply_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_apply.js */ "./node_modules/lodash-es/_apply.js");
  117648. /* harmony import */ var _arrayMap_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_arrayMap.js */ "./node_modules/lodash-es/_arrayMap.js");
  117649. /* harmony import */ var _baseFlatten_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseFlatten.js */ "./node_modules/lodash-es/_baseFlatten.js");
  117650. /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
  117651. /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
  117652. /* harmony import */ var _baseUnary_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./_baseUnary.js */ "./node_modules/lodash-es/_baseUnary.js");
  117653. /* harmony import */ var _castRest_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./_castRest.js */ "./node_modules/lodash-es/_castRest.js");
  117654. /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
  117655. /* Built-in method references for those with the same name as other `lodash` methods. */
  117656. var nativeMin = Math.min;
  117657. /**
  117658. * Creates a function that invokes `func` with its arguments transformed.
  117659. *
  117660. * @static
  117661. * @since 4.0.0
  117662. * @memberOf _
  117663. * @category Function
  117664. * @param {Function} func The function to wrap.
  117665. * @param {...(Function|Function[])} [transforms=[_.identity]]
  117666. * The argument transforms.
  117667. * @returns {Function} Returns the new function.
  117668. * @example
  117669. *
  117670. * function doubled(n) {
  117671. * return n * 2;
  117672. * }
  117673. *
  117674. * function square(n) {
  117675. * return n * n;
  117676. * }
  117677. *
  117678. * var func = _.overArgs(function(x, y) {
  117679. * return [x, y];
  117680. * }, [square, doubled]);
  117681. *
  117682. * func(9, 3);
  117683. * // => [81, 6]
  117684. *
  117685. * func(10, 5);
  117686. * // => [100, 10]
  117687. */
  117688. var overArgs = Object(_castRest_js__WEBPACK_IMPORTED_MODULE_6__["default"])(function(func, transforms) {
  117689. transforms = (transforms.length == 1 && Object(_isArray_js__WEBPACK_IMPORTED_MODULE_7__["default"])(transforms[0]))
  117690. ? 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"]))
  117691. : 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"]));
  117692. var funcsLength = transforms.length;
  117693. return Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_4__["default"])(function(args) {
  117694. var index = -1,
  117695. length = nativeMin(args.length, funcsLength);
  117696. while (++index < length) {
  117697. args[index] = transforms[index].call(this, args[index]);
  117698. }
  117699. return Object(_apply_js__WEBPACK_IMPORTED_MODULE_0__["default"])(func, this, args);
  117700. });
  117701. });
  117702. /* harmony default export */ __webpack_exports__["default"] = (overArgs);
  117703. /***/ }),
  117704. /***/ "./node_modules/lodash-es/overEvery.js":
  117705. /*!*********************************************!*\
  117706. !*** ./node_modules/lodash-es/overEvery.js ***!
  117707. \*********************************************/
  117708. /*! exports provided: default */
  117709. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  117710. "use strict";
  117711. __webpack_require__.r(__webpack_exports__);
  117712. /* harmony import */ var _arrayEvery_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayEvery.js */ "./node_modules/lodash-es/_arrayEvery.js");
  117713. /* harmony import */ var _createOver_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_createOver.js */ "./node_modules/lodash-es/_createOver.js");
  117714. /**
  117715. * Creates a function that checks if **all** of the `predicates` return
  117716. * truthy when invoked with the arguments it receives.
  117717. *
  117718. * Following shorthands are possible for providing predicates.
  117719. * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate.
  117720. * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them.
  117721. *
  117722. * @static
  117723. * @memberOf _
  117724. * @since 4.0.0
  117725. * @category Util
  117726. * @param {...(Function|Function[])} [predicates=[_.identity]]
  117727. * The predicates to check.
  117728. * @returns {Function} Returns the new function.
  117729. * @example
  117730. *
  117731. * var func = _.overEvery([Boolean, isFinite]);
  117732. *
  117733. * func('1');
  117734. * // => true
  117735. *
  117736. * func(null);
  117737. * // => false
  117738. *
  117739. * func(NaN);
  117740. * // => false
  117741. */
  117742. var overEvery = Object(_createOver_js__WEBPACK_IMPORTED_MODULE_1__["default"])(_arrayEvery_js__WEBPACK_IMPORTED_MODULE_0__["default"]);
  117743. /* harmony default export */ __webpack_exports__["default"] = (overEvery);
  117744. /***/ }),
  117745. /***/ "./node_modules/lodash-es/overSome.js":
  117746. /*!********************************************!*\
  117747. !*** ./node_modules/lodash-es/overSome.js ***!
  117748. \********************************************/
  117749. /*! exports provided: default */
  117750. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  117751. "use strict";
  117752. __webpack_require__.r(__webpack_exports__);
  117753. /* harmony import */ var _arraySome_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arraySome.js */ "./node_modules/lodash-es/_arraySome.js");
  117754. /* harmony import */ var _createOver_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_createOver.js */ "./node_modules/lodash-es/_createOver.js");
  117755. /**
  117756. * Creates a function that checks if **any** of the `predicates` return
  117757. * truthy when invoked with the arguments it receives.
  117758. *
  117759. * Following shorthands are possible for providing predicates.
  117760. * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate.
  117761. * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them.
  117762. *
  117763. * @static
  117764. * @memberOf _
  117765. * @since 4.0.0
  117766. * @category Util
  117767. * @param {...(Function|Function[])} [predicates=[_.identity]]
  117768. * The predicates to check.
  117769. * @returns {Function} Returns the new function.
  117770. * @example
  117771. *
  117772. * var func = _.overSome([Boolean, isFinite]);
  117773. *
  117774. * func('1');
  117775. * // => true
  117776. *
  117777. * func(null);
  117778. * // => true
  117779. *
  117780. * func(NaN);
  117781. * // => false
  117782. *
  117783. * var matchesFunc = _.overSome([{ 'a': 1 }, { 'a': 2 }])
  117784. * var matchesPropertyFunc = _.overSome([['a', 1], ['a', 2]])
  117785. */
  117786. var overSome = Object(_createOver_js__WEBPACK_IMPORTED_MODULE_1__["default"])(_arraySome_js__WEBPACK_IMPORTED_MODULE_0__["default"]);
  117787. /* harmony default export */ __webpack_exports__["default"] = (overSome);
  117788. /***/ }),
  117789. /***/ "./node_modules/lodash-es/pad.js":
  117790. /*!***************************************!*\
  117791. !*** ./node_modules/lodash-es/pad.js ***!
  117792. \***************************************/
  117793. /*! exports provided: default */
  117794. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  117795. "use strict";
  117796. __webpack_require__.r(__webpack_exports__);
  117797. /* harmony import */ var _createPadding_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createPadding.js */ "./node_modules/lodash-es/_createPadding.js");
  117798. /* harmony import */ var _stringSize_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_stringSize.js */ "./node_modules/lodash-es/_stringSize.js");
  117799. /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
  117800. /* harmony import */ var _toString_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./toString.js */ "./node_modules/lodash-es/toString.js");
  117801. /* Built-in method references for those with the same name as other `lodash` methods. */
  117802. var nativeCeil = Math.ceil,
  117803. nativeFloor = Math.floor;
  117804. /**
  117805. * Pads `string` on the left and right sides if it's shorter than `length`.
  117806. * Padding characters are truncated if they can't be evenly divided by `length`.
  117807. *
  117808. * @static
  117809. * @memberOf _
  117810. * @since 3.0.0
  117811. * @category String
  117812. * @param {string} [string=''] The string to pad.
  117813. * @param {number} [length=0] The padding length.
  117814. * @param {string} [chars=' '] The string used as padding.
  117815. * @returns {string} Returns the padded string.
  117816. * @example
  117817. *
  117818. * _.pad('abc', 8);
  117819. * // => ' abc '
  117820. *
  117821. * _.pad('abc', 8, '_-');
  117822. * // => '_-abc_-_'
  117823. *
  117824. * _.pad('abc', 3);
  117825. * // => 'abc'
  117826. */
  117827. function pad(string, length, chars) {
  117828. string = Object(_toString_js__WEBPACK_IMPORTED_MODULE_3__["default"])(string);
  117829. length = Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_2__["default"])(length);
  117830. var strLength = length ? Object(_stringSize_js__WEBPACK_IMPORTED_MODULE_1__["default"])(string) : 0;
  117831. if (!length || strLength >= length) {
  117832. return string;
  117833. }
  117834. var mid = (length - strLength) / 2;
  117835. return (
  117836. Object(_createPadding_js__WEBPACK_IMPORTED_MODULE_0__["default"])(nativeFloor(mid), chars) +
  117837. string +
  117838. Object(_createPadding_js__WEBPACK_IMPORTED_MODULE_0__["default"])(nativeCeil(mid), chars)
  117839. );
  117840. }
  117841. /* harmony default export */ __webpack_exports__["default"] = (pad);
  117842. /***/ }),
  117843. /***/ "./node_modules/lodash-es/padEnd.js":
  117844. /*!******************************************!*\
  117845. !*** ./node_modules/lodash-es/padEnd.js ***!
  117846. \******************************************/
  117847. /*! exports provided: default */
  117848. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  117849. "use strict";
  117850. __webpack_require__.r(__webpack_exports__);
  117851. /* harmony import */ var _createPadding_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createPadding.js */ "./node_modules/lodash-es/_createPadding.js");
  117852. /* harmony import */ var _stringSize_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_stringSize.js */ "./node_modules/lodash-es/_stringSize.js");
  117853. /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
  117854. /* harmony import */ var _toString_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./toString.js */ "./node_modules/lodash-es/toString.js");
  117855. /**
  117856. * Pads `string` on the right side if it's shorter than `length`. Padding
  117857. * characters are truncated if they exceed `length`.
  117858. *
  117859. * @static
  117860. * @memberOf _
  117861. * @since 4.0.0
  117862. * @category String
  117863. * @param {string} [string=''] The string to pad.
  117864. * @param {number} [length=0] The padding length.
  117865. * @param {string} [chars=' '] The string used as padding.
  117866. * @returns {string} Returns the padded string.
  117867. * @example
  117868. *
  117869. * _.padEnd('abc', 6);
  117870. * // => 'abc '
  117871. *
  117872. * _.padEnd('abc', 6, '_-');
  117873. * // => 'abc_-_'
  117874. *
  117875. * _.padEnd('abc', 3);
  117876. * // => 'abc'
  117877. */
  117878. function padEnd(string, length, chars) {
  117879. string = Object(_toString_js__WEBPACK_IMPORTED_MODULE_3__["default"])(string);
  117880. length = Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_2__["default"])(length);
  117881. var strLength = length ? Object(_stringSize_js__WEBPACK_IMPORTED_MODULE_1__["default"])(string) : 0;
  117882. return (length && strLength < length)
  117883. ? (string + Object(_createPadding_js__WEBPACK_IMPORTED_MODULE_0__["default"])(length - strLength, chars))
  117884. : string;
  117885. }
  117886. /* harmony default export */ __webpack_exports__["default"] = (padEnd);
  117887. /***/ }),
  117888. /***/ "./node_modules/lodash-es/padStart.js":
  117889. /*!********************************************!*\
  117890. !*** ./node_modules/lodash-es/padStart.js ***!
  117891. \********************************************/
  117892. /*! exports provided: default */
  117893. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  117894. "use strict";
  117895. __webpack_require__.r(__webpack_exports__);
  117896. /* harmony import */ var _createPadding_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createPadding.js */ "./node_modules/lodash-es/_createPadding.js");
  117897. /* harmony import */ var _stringSize_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_stringSize.js */ "./node_modules/lodash-es/_stringSize.js");
  117898. /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
  117899. /* harmony import */ var _toString_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./toString.js */ "./node_modules/lodash-es/toString.js");
  117900. /**
  117901. * Pads `string` on the left side if it's shorter than `length`. Padding
  117902. * characters are truncated if they exceed `length`.
  117903. *
  117904. * @static
  117905. * @memberOf _
  117906. * @since 4.0.0
  117907. * @category String
  117908. * @param {string} [string=''] The string to pad.
  117909. * @param {number} [length=0] The padding length.
  117910. * @param {string} [chars=' '] The string used as padding.
  117911. * @returns {string} Returns the padded string.
  117912. * @example
  117913. *
  117914. * _.padStart('abc', 6);
  117915. * // => ' abc'
  117916. *
  117917. * _.padStart('abc', 6, '_-');
  117918. * // => '_-_abc'
  117919. *
  117920. * _.padStart('abc', 3);
  117921. * // => 'abc'
  117922. */
  117923. function padStart(string, length, chars) {
  117924. string = Object(_toString_js__WEBPACK_IMPORTED_MODULE_3__["default"])(string);
  117925. length = Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_2__["default"])(length);
  117926. var strLength = length ? Object(_stringSize_js__WEBPACK_IMPORTED_MODULE_1__["default"])(string) : 0;
  117927. return (length && strLength < length)
  117928. ? (Object(_createPadding_js__WEBPACK_IMPORTED_MODULE_0__["default"])(length - strLength, chars) + string)
  117929. : string;
  117930. }
  117931. /* harmony default export */ __webpack_exports__["default"] = (padStart);
  117932. /***/ }),
  117933. /***/ "./node_modules/lodash-es/parseInt.js":
  117934. /*!********************************************!*\
  117935. !*** ./node_modules/lodash-es/parseInt.js ***!
  117936. \********************************************/
  117937. /*! exports provided: default */
  117938. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  117939. "use strict";
  117940. __webpack_require__.r(__webpack_exports__);
  117941. /* harmony import */ var _root_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_root.js */ "./node_modules/lodash-es/_root.js");
  117942. /* harmony import */ var _toString_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./toString.js */ "./node_modules/lodash-es/toString.js");
  117943. /** Used to match leading whitespace. */
  117944. var reTrimStart = /^\s+/;
  117945. /* Built-in method references for those with the same name as other `lodash` methods. */
  117946. var nativeParseInt = _root_js__WEBPACK_IMPORTED_MODULE_0__["default"].parseInt;
  117947. /**
  117948. * Converts `string` to an integer of the specified radix. If `radix` is
  117949. * `undefined` or `0`, a `radix` of `10` is used unless `value` is a
  117950. * hexadecimal, in which case a `radix` of `16` is used.
  117951. *
  117952. * **Note:** This method aligns with the
  117953. * [ES5 implementation](https://es5.github.io/#x15.1.2.2) of `parseInt`.
  117954. *
  117955. * @static
  117956. * @memberOf _
  117957. * @since 1.1.0
  117958. * @category String
  117959. * @param {string} string The string to convert.
  117960. * @param {number} [radix=10] The radix to interpret `value` by.
  117961. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  117962. * @returns {number} Returns the converted integer.
  117963. * @example
  117964. *
  117965. * _.parseInt('08');
  117966. * // => 8
  117967. *
  117968. * _.map(['6', '08', '10'], _.parseInt);
  117969. * // => [6, 8, 10]
  117970. */
  117971. function parseInt(string, radix, guard) {
  117972. if (guard || radix == null) {
  117973. radix = 0;
  117974. } else if (radix) {
  117975. radix = +radix;
  117976. }
  117977. return nativeParseInt(Object(_toString_js__WEBPACK_IMPORTED_MODULE_1__["default"])(string).replace(reTrimStart, ''), radix || 0);
  117978. }
  117979. /* harmony default export */ __webpack_exports__["default"] = (parseInt);
  117980. /***/ }),
  117981. /***/ "./node_modules/lodash-es/partial.js":
  117982. /*!*******************************************!*\
  117983. !*** ./node_modules/lodash-es/partial.js ***!
  117984. \*******************************************/
  117985. /*! exports provided: default */
  117986. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  117987. "use strict";
  117988. __webpack_require__.r(__webpack_exports__);
  117989. /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
  117990. /* harmony import */ var _createWrap_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_createWrap.js */ "./node_modules/lodash-es/_createWrap.js");
  117991. /* harmony import */ var _getHolder_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_getHolder.js */ "./node_modules/lodash-es/_getHolder.js");
  117992. /* harmony import */ var _replaceHolders_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_replaceHolders.js */ "./node_modules/lodash-es/_replaceHolders.js");
  117993. /** Used to compose bitmasks for function metadata. */
  117994. var WRAP_PARTIAL_FLAG = 32;
  117995. /**
  117996. * Creates a function that invokes `func` with `partials` prepended to the
  117997. * arguments it receives. This method is like `_.bind` except it does **not**
  117998. * alter the `this` binding.
  117999. *
  118000. * The `_.partial.placeholder` value, which defaults to `_` in monolithic
  118001. * builds, may be used as a placeholder for partially applied arguments.
  118002. *
  118003. * **Note:** This method doesn't set the "length" property of partially
  118004. * applied functions.
  118005. *
  118006. * @static
  118007. * @memberOf _
  118008. * @since 0.2.0
  118009. * @category Function
  118010. * @param {Function} func The function to partially apply arguments to.
  118011. * @param {...*} [partials] The arguments to be partially applied.
  118012. * @returns {Function} Returns the new partially applied function.
  118013. * @example
  118014. *
  118015. * function greet(greeting, name) {
  118016. * return greeting + ' ' + name;
  118017. * }
  118018. *
  118019. * var sayHelloTo = _.partial(greet, 'hello');
  118020. * sayHelloTo('fred');
  118021. * // => 'hello fred'
  118022. *
  118023. * // Partially applied with placeholders.
  118024. * var greetFred = _.partial(greet, _, 'fred');
  118025. * greetFred('hi');
  118026. * // => 'hi fred'
  118027. */
  118028. var partial = Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function(func, partials) {
  118029. var holders = Object(_replaceHolders_js__WEBPACK_IMPORTED_MODULE_3__["default"])(partials, Object(_getHolder_js__WEBPACK_IMPORTED_MODULE_2__["default"])(partial));
  118030. return Object(_createWrap_js__WEBPACK_IMPORTED_MODULE_1__["default"])(func, WRAP_PARTIAL_FLAG, undefined, partials, holders);
  118031. });
  118032. // Assign default placeholders.
  118033. partial.placeholder = {};
  118034. /* harmony default export */ __webpack_exports__["default"] = (partial);
  118035. /***/ }),
  118036. /***/ "./node_modules/lodash-es/partialRight.js":
  118037. /*!************************************************!*\
  118038. !*** ./node_modules/lodash-es/partialRight.js ***!
  118039. \************************************************/
  118040. /*! exports provided: default */
  118041. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  118042. "use strict";
  118043. __webpack_require__.r(__webpack_exports__);
  118044. /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
  118045. /* harmony import */ var _createWrap_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_createWrap.js */ "./node_modules/lodash-es/_createWrap.js");
  118046. /* harmony import */ var _getHolder_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_getHolder.js */ "./node_modules/lodash-es/_getHolder.js");
  118047. /* harmony import */ var _replaceHolders_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_replaceHolders.js */ "./node_modules/lodash-es/_replaceHolders.js");
  118048. /** Used to compose bitmasks for function metadata. */
  118049. var WRAP_PARTIAL_RIGHT_FLAG = 64;
  118050. /**
  118051. * This method is like `_.partial` except that partially applied arguments
  118052. * are appended to the arguments it receives.
  118053. *
  118054. * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic
  118055. * builds, may be used as a placeholder for partially applied arguments.
  118056. *
  118057. * **Note:** This method doesn't set the "length" property of partially
  118058. * applied functions.
  118059. *
  118060. * @static
  118061. * @memberOf _
  118062. * @since 1.0.0
  118063. * @category Function
  118064. * @param {Function} func The function to partially apply arguments to.
  118065. * @param {...*} [partials] The arguments to be partially applied.
  118066. * @returns {Function} Returns the new partially applied function.
  118067. * @example
  118068. *
  118069. * function greet(greeting, name) {
  118070. * return greeting + ' ' + name;
  118071. * }
  118072. *
  118073. * var greetFred = _.partialRight(greet, 'fred');
  118074. * greetFred('hi');
  118075. * // => 'hi fred'
  118076. *
  118077. * // Partially applied with placeholders.
  118078. * var sayHelloTo = _.partialRight(greet, 'hello', _);
  118079. * sayHelloTo('fred');
  118080. * // => 'hello fred'
  118081. */
  118082. var partialRight = Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function(func, partials) {
  118083. var holders = Object(_replaceHolders_js__WEBPACK_IMPORTED_MODULE_3__["default"])(partials, Object(_getHolder_js__WEBPACK_IMPORTED_MODULE_2__["default"])(partialRight));
  118084. return Object(_createWrap_js__WEBPACK_IMPORTED_MODULE_1__["default"])(func, WRAP_PARTIAL_RIGHT_FLAG, undefined, partials, holders);
  118085. });
  118086. // Assign default placeholders.
  118087. partialRight.placeholder = {};
  118088. /* harmony default export */ __webpack_exports__["default"] = (partialRight);
  118089. /***/ }),
  118090. /***/ "./node_modules/lodash-es/partition.js":
  118091. /*!*********************************************!*\
  118092. !*** ./node_modules/lodash-es/partition.js ***!
  118093. \*********************************************/
  118094. /*! exports provided: default */
  118095. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  118096. "use strict";
  118097. __webpack_require__.r(__webpack_exports__);
  118098. /* harmony import */ var _createAggregator_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createAggregator.js */ "./node_modules/lodash-es/_createAggregator.js");
  118099. /**
  118100. * Creates an array of elements split into two groups, the first of which
  118101. * contains elements `predicate` returns truthy for, the second of which
  118102. * contains elements `predicate` returns falsey for. The predicate is
  118103. * invoked with one argument: (value).
  118104. *
  118105. * @static
  118106. * @memberOf _
  118107. * @since 3.0.0
  118108. * @category Collection
  118109. * @param {Array|Object} collection The collection to iterate over.
  118110. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  118111. * @returns {Array} Returns the array of grouped elements.
  118112. * @example
  118113. *
  118114. * var users = [
  118115. * { 'user': 'barney', 'age': 36, 'active': false },
  118116. * { 'user': 'fred', 'age': 40, 'active': true },
  118117. * { 'user': 'pebbles', 'age': 1, 'active': false }
  118118. * ];
  118119. *
  118120. * _.partition(users, function(o) { return o.active; });
  118121. * // => objects for [['fred'], ['barney', 'pebbles']]
  118122. *
  118123. * // The `_.matches` iteratee shorthand.
  118124. * _.partition(users, { 'age': 1, 'active': false });
  118125. * // => objects for [['pebbles'], ['barney', 'fred']]
  118126. *
  118127. * // The `_.matchesProperty` iteratee shorthand.
  118128. * _.partition(users, ['active', false]);
  118129. * // => objects for [['barney', 'pebbles'], ['fred']]
  118130. *
  118131. * // The `_.property` iteratee shorthand.
  118132. * _.partition(users, 'active');
  118133. * // => objects for [['fred'], ['barney', 'pebbles']]
  118134. */
  118135. var partition = Object(_createAggregator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function(result, value, key) {
  118136. result[key ? 0 : 1].push(value);
  118137. }, function() { return [[], []]; });
  118138. /* harmony default export */ __webpack_exports__["default"] = (partition);
  118139. /***/ }),
  118140. /***/ "./node_modules/lodash-es/pick.js":
  118141. /*!****************************************!*\
  118142. !*** ./node_modules/lodash-es/pick.js ***!
  118143. \****************************************/
  118144. /*! exports provided: default */
  118145. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  118146. "use strict";
  118147. __webpack_require__.r(__webpack_exports__);
  118148. /* harmony import */ var _basePick_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_basePick.js */ "./node_modules/lodash-es/_basePick.js");
  118149. /* harmony import */ var _flatRest_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_flatRest.js */ "./node_modules/lodash-es/_flatRest.js");
  118150. /**
  118151. * Creates an object composed of the picked `object` properties.
  118152. *
  118153. * @static
  118154. * @since 0.1.0
  118155. * @memberOf _
  118156. * @category Object
  118157. * @param {Object} object The source object.
  118158. * @param {...(string|string[])} [paths] The property paths to pick.
  118159. * @returns {Object} Returns the new object.
  118160. * @example
  118161. *
  118162. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  118163. *
  118164. * _.pick(object, ['a', 'c']);
  118165. * // => { 'a': 1, 'c': 3 }
  118166. */
  118167. var pick = Object(_flatRest_js__WEBPACK_IMPORTED_MODULE_1__["default"])(function(object, paths) {
  118168. return object == null ? {} : Object(_basePick_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, paths);
  118169. });
  118170. /* harmony default export */ __webpack_exports__["default"] = (pick);
  118171. /***/ }),
  118172. /***/ "./node_modules/lodash-es/pickBy.js":
  118173. /*!******************************************!*\
  118174. !*** ./node_modules/lodash-es/pickBy.js ***!
  118175. \******************************************/
  118176. /*! exports provided: default */
  118177. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  118178. "use strict";
  118179. __webpack_require__.r(__webpack_exports__);
  118180. /* harmony import */ var _arrayMap_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayMap.js */ "./node_modules/lodash-es/_arrayMap.js");
  118181. /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
  118182. /* harmony import */ var _basePickBy_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_basePickBy.js */ "./node_modules/lodash-es/_basePickBy.js");
  118183. /* harmony import */ var _getAllKeysIn_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_getAllKeysIn.js */ "./node_modules/lodash-es/_getAllKeysIn.js");
  118184. /**
  118185. * Creates an object composed of the `object` properties `predicate` returns
  118186. * truthy for. The predicate is invoked with two arguments: (value, key).
  118187. *
  118188. * @static
  118189. * @memberOf _
  118190. * @since 4.0.0
  118191. * @category Object
  118192. * @param {Object} object The source object.
  118193. * @param {Function} [predicate=_.identity] The function invoked per property.
  118194. * @returns {Object} Returns the new object.
  118195. * @example
  118196. *
  118197. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  118198. *
  118199. * _.pickBy(object, _.isNumber);
  118200. * // => { 'a': 1, 'c': 3 }
  118201. */
  118202. function pickBy(object, predicate) {
  118203. if (object == null) {
  118204. return {};
  118205. }
  118206. var props = Object(_arrayMap_js__WEBPACK_IMPORTED_MODULE_0__["default"])(Object(_getAllKeysIn_js__WEBPACK_IMPORTED_MODULE_3__["default"])(object), function(prop) {
  118207. return [prop];
  118208. });
  118209. predicate = Object(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_1__["default"])(predicate);
  118210. return Object(_basePickBy_js__WEBPACK_IMPORTED_MODULE_2__["default"])(object, props, function(value, path) {
  118211. return predicate(value, path[0]);
  118212. });
  118213. }
  118214. /* harmony default export */ __webpack_exports__["default"] = (pickBy);
  118215. /***/ }),
  118216. /***/ "./node_modules/lodash-es/plant.js":
  118217. /*!*****************************************!*\
  118218. !*** ./node_modules/lodash-es/plant.js ***!
  118219. \*****************************************/
  118220. /*! exports provided: default */
  118221. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  118222. "use strict";
  118223. __webpack_require__.r(__webpack_exports__);
  118224. /* harmony import */ var _baseLodash_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseLodash.js */ "./node_modules/lodash-es/_baseLodash.js");
  118225. /* harmony import */ var _wrapperClone_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_wrapperClone.js */ "./node_modules/lodash-es/_wrapperClone.js");
  118226. /**
  118227. * Creates a clone of the chain sequence planting `value` as the wrapped value.
  118228. *
  118229. * @name plant
  118230. * @memberOf _
  118231. * @since 3.2.0
  118232. * @category Seq
  118233. * @param {*} value The value to plant.
  118234. * @returns {Object} Returns the new `lodash` wrapper instance.
  118235. * @example
  118236. *
  118237. * function square(n) {
  118238. * return n * n;
  118239. * }
  118240. *
  118241. * var wrapped = _([1, 2]).map(square);
  118242. * var other = wrapped.plant([3, 4]);
  118243. *
  118244. * other.value();
  118245. * // => [9, 16]
  118246. *
  118247. * wrapped.value();
  118248. * // => [1, 4]
  118249. */
  118250. function wrapperPlant(value) {
  118251. var result,
  118252. parent = this;
  118253. while (parent instanceof _baseLodash_js__WEBPACK_IMPORTED_MODULE_0__["default"]) {
  118254. var clone = Object(_wrapperClone_js__WEBPACK_IMPORTED_MODULE_1__["default"])(parent);
  118255. clone.__index__ = 0;
  118256. clone.__values__ = undefined;
  118257. if (result) {
  118258. previous.__wrapped__ = clone;
  118259. } else {
  118260. result = clone;
  118261. }
  118262. var previous = clone;
  118263. parent = parent.__wrapped__;
  118264. }
  118265. previous.__wrapped__ = value;
  118266. return result;
  118267. }
  118268. /* harmony default export */ __webpack_exports__["default"] = (wrapperPlant);
  118269. /***/ }),
  118270. /***/ "./node_modules/lodash-es/property.js":
  118271. /*!********************************************!*\
  118272. !*** ./node_modules/lodash-es/property.js ***!
  118273. \********************************************/
  118274. /*! exports provided: default */
  118275. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  118276. "use strict";
  118277. __webpack_require__.r(__webpack_exports__);
  118278. /* harmony import */ var _baseProperty_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseProperty.js */ "./node_modules/lodash-es/_baseProperty.js");
  118279. /* harmony import */ var _basePropertyDeep_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_basePropertyDeep.js */ "./node_modules/lodash-es/_basePropertyDeep.js");
  118280. /* harmony import */ var _isKey_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_isKey.js */ "./node_modules/lodash-es/_isKey.js");
  118281. /* harmony import */ var _toKey_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_toKey.js */ "./node_modules/lodash-es/_toKey.js");
  118282. /**
  118283. * Creates a function that returns the value at `path` of a given object.
  118284. *
  118285. * @static
  118286. * @memberOf _
  118287. * @since 2.4.0
  118288. * @category Util
  118289. * @param {Array|string} path The path of the property to get.
  118290. * @returns {Function} Returns the new accessor function.
  118291. * @example
  118292. *
  118293. * var objects = [
  118294. * { 'a': { 'b': 2 } },
  118295. * { 'a': { 'b': 1 } }
  118296. * ];
  118297. *
  118298. * _.map(objects, _.property('a.b'));
  118299. * // => [2, 1]
  118300. *
  118301. * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');
  118302. * // => [1, 2]
  118303. */
  118304. function property(path) {
  118305. 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);
  118306. }
  118307. /* harmony default export */ __webpack_exports__["default"] = (property);
  118308. /***/ }),
  118309. /***/ "./node_modules/lodash-es/propertyOf.js":
  118310. /*!**********************************************!*\
  118311. !*** ./node_modules/lodash-es/propertyOf.js ***!
  118312. \**********************************************/
  118313. /*! exports provided: default */
  118314. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  118315. "use strict";
  118316. __webpack_require__.r(__webpack_exports__);
  118317. /* harmony import */ var _baseGet_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseGet.js */ "./node_modules/lodash-es/_baseGet.js");
  118318. /**
  118319. * The opposite of `_.property`; this method creates a function that returns
  118320. * the value at a given path of `object`.
  118321. *
  118322. * @static
  118323. * @memberOf _
  118324. * @since 3.0.0
  118325. * @category Util
  118326. * @param {Object} object The object to query.
  118327. * @returns {Function} Returns the new accessor function.
  118328. * @example
  118329. *
  118330. * var array = [0, 1, 2],
  118331. * object = { 'a': array, 'b': array, 'c': array };
  118332. *
  118333. * _.map(['a[2]', 'c[0]'], _.propertyOf(object));
  118334. * // => [2, 0]
  118335. *
  118336. * _.map([['a', '2'], ['c', '0']], _.propertyOf(object));
  118337. * // => [2, 0]
  118338. */
  118339. function propertyOf(object) {
  118340. return function(path) {
  118341. return object == null ? undefined : Object(_baseGet_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, path);
  118342. };
  118343. }
  118344. /* harmony default export */ __webpack_exports__["default"] = (propertyOf);
  118345. /***/ }),
  118346. /***/ "./node_modules/lodash-es/pull.js":
  118347. /*!****************************************!*\
  118348. !*** ./node_modules/lodash-es/pull.js ***!
  118349. \****************************************/
  118350. /*! exports provided: default */
  118351. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  118352. "use strict";
  118353. __webpack_require__.r(__webpack_exports__);
  118354. /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
  118355. /* harmony import */ var _pullAll_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./pullAll.js */ "./node_modules/lodash-es/pullAll.js");
  118356. /**
  118357. * Removes all given values from `array` using
  118358. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  118359. * for equality comparisons.
  118360. *
  118361. * **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove`
  118362. * to remove elements from an array by predicate.
  118363. *
  118364. * @static
  118365. * @memberOf _
  118366. * @since 2.0.0
  118367. * @category Array
  118368. * @param {Array} array The array to modify.
  118369. * @param {...*} [values] The values to remove.
  118370. * @returns {Array} Returns `array`.
  118371. * @example
  118372. *
  118373. * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
  118374. *
  118375. * _.pull(array, 'a', 'c');
  118376. * console.log(array);
  118377. * // => ['b', 'b']
  118378. */
  118379. var pull = Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_0__["default"])(_pullAll_js__WEBPACK_IMPORTED_MODULE_1__["default"]);
  118380. /* harmony default export */ __webpack_exports__["default"] = (pull);
  118381. /***/ }),
  118382. /***/ "./node_modules/lodash-es/pullAll.js":
  118383. /*!*******************************************!*\
  118384. !*** ./node_modules/lodash-es/pullAll.js ***!
  118385. \*******************************************/
  118386. /*! exports provided: default */
  118387. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  118388. "use strict";
  118389. __webpack_require__.r(__webpack_exports__);
  118390. /* harmony import */ var _basePullAll_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_basePullAll.js */ "./node_modules/lodash-es/_basePullAll.js");
  118391. /**
  118392. * This method is like `_.pull` except that it accepts an array of values to remove.
  118393. *
  118394. * **Note:** Unlike `_.difference`, this method mutates `array`.
  118395. *
  118396. * @static
  118397. * @memberOf _
  118398. * @since 4.0.0
  118399. * @category Array
  118400. * @param {Array} array The array to modify.
  118401. * @param {Array} values The values to remove.
  118402. * @returns {Array} Returns `array`.
  118403. * @example
  118404. *
  118405. * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
  118406. *
  118407. * _.pullAll(array, ['a', 'c']);
  118408. * console.log(array);
  118409. * // => ['b', 'b']
  118410. */
  118411. function pullAll(array, values) {
  118412. return (array && array.length && values && values.length)
  118413. ? Object(_basePullAll_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, values)
  118414. : array;
  118415. }
  118416. /* harmony default export */ __webpack_exports__["default"] = (pullAll);
  118417. /***/ }),
  118418. /***/ "./node_modules/lodash-es/pullAllBy.js":
  118419. /*!*********************************************!*\
  118420. !*** ./node_modules/lodash-es/pullAllBy.js ***!
  118421. \*********************************************/
  118422. /*! exports provided: default */
  118423. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  118424. "use strict";
  118425. __webpack_require__.r(__webpack_exports__);
  118426. /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
  118427. /* harmony import */ var _basePullAll_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_basePullAll.js */ "./node_modules/lodash-es/_basePullAll.js");
  118428. /**
  118429. * This method is like `_.pullAll` except that it accepts `iteratee` which is
  118430. * invoked for each element of `array` and `values` to generate the criterion
  118431. * by which they're compared. The iteratee is invoked with one argument: (value).
  118432. *
  118433. * **Note:** Unlike `_.differenceBy`, this method mutates `array`.
  118434. *
  118435. * @static
  118436. * @memberOf _
  118437. * @since 4.0.0
  118438. * @category Array
  118439. * @param {Array} array The array to modify.
  118440. * @param {Array} values The values to remove.
  118441. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  118442. * @returns {Array} Returns `array`.
  118443. * @example
  118444. *
  118445. * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }];
  118446. *
  118447. * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x');
  118448. * console.log(array);
  118449. * // => [{ 'x': 2 }]
  118450. */
  118451. function pullAllBy(array, values, iteratee) {
  118452. return (array && array.length && values && values.length)
  118453. ? Object(_basePullAll_js__WEBPACK_IMPORTED_MODULE_1__["default"])(array, values, Object(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_0__["default"])(iteratee, 2))
  118454. : array;
  118455. }
  118456. /* harmony default export */ __webpack_exports__["default"] = (pullAllBy);
  118457. /***/ }),
  118458. /***/ "./node_modules/lodash-es/pullAllWith.js":
  118459. /*!***********************************************!*\
  118460. !*** ./node_modules/lodash-es/pullAllWith.js ***!
  118461. \***********************************************/
  118462. /*! exports provided: default */
  118463. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  118464. "use strict";
  118465. __webpack_require__.r(__webpack_exports__);
  118466. /* harmony import */ var _basePullAll_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_basePullAll.js */ "./node_modules/lodash-es/_basePullAll.js");
  118467. /**
  118468. * This method is like `_.pullAll` except that it accepts `comparator` which
  118469. * is invoked to compare elements of `array` to `values`. The comparator is
  118470. * invoked with two arguments: (arrVal, othVal).
  118471. *
  118472. * **Note:** Unlike `_.differenceWith`, this method mutates `array`.
  118473. *
  118474. * @static
  118475. * @memberOf _
  118476. * @since 4.6.0
  118477. * @category Array
  118478. * @param {Array} array The array to modify.
  118479. * @param {Array} values The values to remove.
  118480. * @param {Function} [comparator] The comparator invoked per element.
  118481. * @returns {Array} Returns `array`.
  118482. * @example
  118483. *
  118484. * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }];
  118485. *
  118486. * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual);
  118487. * console.log(array);
  118488. * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }]
  118489. */
  118490. function pullAllWith(array, values, comparator) {
  118491. return (array && array.length && values && values.length)
  118492. ? Object(_basePullAll_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, values, undefined, comparator)
  118493. : array;
  118494. }
  118495. /* harmony default export */ __webpack_exports__["default"] = (pullAllWith);
  118496. /***/ }),
  118497. /***/ "./node_modules/lodash-es/pullAt.js":
  118498. /*!******************************************!*\
  118499. !*** ./node_modules/lodash-es/pullAt.js ***!
  118500. \******************************************/
  118501. /*! exports provided: default */
  118502. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  118503. "use strict";
  118504. __webpack_require__.r(__webpack_exports__);
  118505. /* harmony import */ var _arrayMap_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayMap.js */ "./node_modules/lodash-es/_arrayMap.js");
  118506. /* harmony import */ var _baseAt_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseAt.js */ "./node_modules/lodash-es/_baseAt.js");
  118507. /* harmony import */ var _basePullAt_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_basePullAt.js */ "./node_modules/lodash-es/_basePullAt.js");
  118508. /* harmony import */ var _compareAscending_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_compareAscending.js */ "./node_modules/lodash-es/_compareAscending.js");
  118509. /* harmony import */ var _flatRest_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_flatRest.js */ "./node_modules/lodash-es/_flatRest.js");
  118510. /* harmony import */ var _isIndex_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./_isIndex.js */ "./node_modules/lodash-es/_isIndex.js");
  118511. /**
  118512. * Removes elements from `array` corresponding to `indexes` and returns an
  118513. * array of removed elements.
  118514. *
  118515. * **Note:** Unlike `_.at`, this method mutates `array`.
  118516. *
  118517. * @static
  118518. * @memberOf _
  118519. * @since 3.0.0
  118520. * @category Array
  118521. * @param {Array} array The array to modify.
  118522. * @param {...(number|number[])} [indexes] The indexes of elements to remove.
  118523. * @returns {Array} Returns the new array of removed elements.
  118524. * @example
  118525. *
  118526. * var array = ['a', 'b', 'c', 'd'];
  118527. * var pulled = _.pullAt(array, [1, 3]);
  118528. *
  118529. * console.log(array);
  118530. * // => ['a', 'c']
  118531. *
  118532. * console.log(pulled);
  118533. * // => ['b', 'd']
  118534. */
  118535. var pullAt = Object(_flatRest_js__WEBPACK_IMPORTED_MODULE_4__["default"])(function(array, indexes) {
  118536. var length = array == null ? 0 : array.length,
  118537. result = Object(_baseAt_js__WEBPACK_IMPORTED_MODULE_1__["default"])(array, indexes);
  118538. Object(_basePullAt_js__WEBPACK_IMPORTED_MODULE_2__["default"])(array, Object(_arrayMap_js__WEBPACK_IMPORTED_MODULE_0__["default"])(indexes, function(index) {
  118539. return Object(_isIndex_js__WEBPACK_IMPORTED_MODULE_5__["default"])(index, length) ? +index : index;
  118540. }).sort(_compareAscending_js__WEBPACK_IMPORTED_MODULE_3__["default"]));
  118541. return result;
  118542. });
  118543. /* harmony default export */ __webpack_exports__["default"] = (pullAt);
  118544. /***/ }),
  118545. /***/ "./node_modules/lodash-es/random.js":
  118546. /*!******************************************!*\
  118547. !*** ./node_modules/lodash-es/random.js ***!
  118548. \******************************************/
  118549. /*! exports provided: default */
  118550. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  118551. "use strict";
  118552. __webpack_require__.r(__webpack_exports__);
  118553. /* harmony import */ var _baseRandom_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseRandom.js */ "./node_modules/lodash-es/_baseRandom.js");
  118554. /* harmony import */ var _isIterateeCall_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_isIterateeCall.js */ "./node_modules/lodash-es/_isIterateeCall.js");
  118555. /* harmony import */ var _toFinite_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./toFinite.js */ "./node_modules/lodash-es/toFinite.js");
  118556. /** Built-in method references without a dependency on `root`. */
  118557. var freeParseFloat = parseFloat;
  118558. /* Built-in method references for those with the same name as other `lodash` methods. */
  118559. var nativeMin = Math.min,
  118560. nativeRandom = Math.random;
  118561. /**
  118562. * Produces a random number between the inclusive `lower` and `upper` bounds.
  118563. * If only one argument is provided a number between `0` and the given number
  118564. * is returned. If `floating` is `true`, or either `lower` or `upper` are
  118565. * floats, a floating-point number is returned instead of an integer.
  118566. *
  118567. * **Note:** JavaScript follows the IEEE-754 standard for resolving
  118568. * floating-point values which can produce unexpected results.
  118569. *
  118570. * @static
  118571. * @memberOf _
  118572. * @since 0.7.0
  118573. * @category Number
  118574. * @param {number} [lower=0] The lower bound.
  118575. * @param {number} [upper=1] The upper bound.
  118576. * @param {boolean} [floating] Specify returning a floating-point number.
  118577. * @returns {number} Returns the random number.
  118578. * @example
  118579. *
  118580. * _.random(0, 5);
  118581. * // => an integer between 0 and 5
  118582. *
  118583. * _.random(5);
  118584. * // => also an integer between 0 and 5
  118585. *
  118586. * _.random(5, true);
  118587. * // => a floating-point number between 0 and 5
  118588. *
  118589. * _.random(1.2, 5.2);
  118590. * // => a floating-point number between 1.2 and 5.2
  118591. */
  118592. function random(lower, upper, floating) {
  118593. if (floating && typeof floating != 'boolean' && Object(_isIterateeCall_js__WEBPACK_IMPORTED_MODULE_1__["default"])(lower, upper, floating)) {
  118594. upper = floating = undefined;
  118595. }
  118596. if (floating === undefined) {
  118597. if (typeof upper == 'boolean') {
  118598. floating = upper;
  118599. upper = undefined;
  118600. }
  118601. else if (typeof lower == 'boolean') {
  118602. floating = lower;
  118603. lower = undefined;
  118604. }
  118605. }
  118606. if (lower === undefined && upper === undefined) {
  118607. lower = 0;
  118608. upper = 1;
  118609. }
  118610. else {
  118611. lower = Object(_toFinite_js__WEBPACK_IMPORTED_MODULE_2__["default"])(lower);
  118612. if (upper === undefined) {
  118613. upper = lower;
  118614. lower = 0;
  118615. } else {
  118616. upper = Object(_toFinite_js__WEBPACK_IMPORTED_MODULE_2__["default"])(upper);
  118617. }
  118618. }
  118619. if (lower > upper) {
  118620. var temp = lower;
  118621. lower = upper;
  118622. upper = temp;
  118623. }
  118624. if (floating || lower % 1 || upper % 1) {
  118625. var rand = nativeRandom();
  118626. return nativeMin(lower + (rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1)))), upper);
  118627. }
  118628. return Object(_baseRandom_js__WEBPACK_IMPORTED_MODULE_0__["default"])(lower, upper);
  118629. }
  118630. /* harmony default export */ __webpack_exports__["default"] = (random);
  118631. /***/ }),
  118632. /***/ "./node_modules/lodash-es/range.js":
  118633. /*!*****************************************!*\
  118634. !*** ./node_modules/lodash-es/range.js ***!
  118635. \*****************************************/
  118636. /*! exports provided: default */
  118637. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  118638. "use strict";
  118639. __webpack_require__.r(__webpack_exports__);
  118640. /* harmony import */ var _createRange_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createRange.js */ "./node_modules/lodash-es/_createRange.js");
  118641. /**
  118642. * Creates an array of numbers (positive and/or negative) progressing from
  118643. * `start` up to, but not including, `end`. A step of `-1` is used if a negative
  118644. * `start` is specified without an `end` or `step`. If `end` is not specified,
  118645. * it's set to `start` with `start` then set to `0`.
  118646. *
  118647. * **Note:** JavaScript follows the IEEE-754 standard for resolving
  118648. * floating-point values which can produce unexpected results.
  118649. *
  118650. * @static
  118651. * @since 0.1.0
  118652. * @memberOf _
  118653. * @category Util
  118654. * @param {number} [start=0] The start of the range.
  118655. * @param {number} end The end of the range.
  118656. * @param {number} [step=1] The value to increment or decrement by.
  118657. * @returns {Array} Returns the range of numbers.
  118658. * @see _.inRange, _.rangeRight
  118659. * @example
  118660. *
  118661. * _.range(4);
  118662. * // => [0, 1, 2, 3]
  118663. *
  118664. * _.range(-4);
  118665. * // => [0, -1, -2, -3]
  118666. *
  118667. * _.range(1, 5);
  118668. * // => [1, 2, 3, 4]
  118669. *
  118670. * _.range(0, 20, 5);
  118671. * // => [0, 5, 10, 15]
  118672. *
  118673. * _.range(0, -4, -1);
  118674. * // => [0, -1, -2, -3]
  118675. *
  118676. * _.range(1, 4, 0);
  118677. * // => [1, 1, 1]
  118678. *
  118679. * _.range(0);
  118680. * // => []
  118681. */
  118682. var range = Object(_createRange_js__WEBPACK_IMPORTED_MODULE_0__["default"])();
  118683. /* harmony default export */ __webpack_exports__["default"] = (range);
  118684. /***/ }),
  118685. /***/ "./node_modules/lodash-es/rangeRight.js":
  118686. /*!**********************************************!*\
  118687. !*** ./node_modules/lodash-es/rangeRight.js ***!
  118688. \**********************************************/
  118689. /*! exports provided: default */
  118690. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  118691. "use strict";
  118692. __webpack_require__.r(__webpack_exports__);
  118693. /* harmony import */ var _createRange_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createRange.js */ "./node_modules/lodash-es/_createRange.js");
  118694. /**
  118695. * This method is like `_.range` except that it populates values in
  118696. * descending order.
  118697. *
  118698. * @static
  118699. * @memberOf _
  118700. * @since 4.0.0
  118701. * @category Util
  118702. * @param {number} [start=0] The start of the range.
  118703. * @param {number} end The end of the range.
  118704. * @param {number} [step=1] The value to increment or decrement by.
  118705. * @returns {Array} Returns the range of numbers.
  118706. * @see _.inRange, _.range
  118707. * @example
  118708. *
  118709. * _.rangeRight(4);
  118710. * // => [3, 2, 1, 0]
  118711. *
  118712. * _.rangeRight(-4);
  118713. * // => [-3, -2, -1, 0]
  118714. *
  118715. * _.rangeRight(1, 5);
  118716. * // => [4, 3, 2, 1]
  118717. *
  118718. * _.rangeRight(0, 20, 5);
  118719. * // => [15, 10, 5, 0]
  118720. *
  118721. * _.rangeRight(0, -4, -1);
  118722. * // => [-3, -2, -1, 0]
  118723. *
  118724. * _.rangeRight(1, 4, 0);
  118725. * // => [1, 1, 1]
  118726. *
  118727. * _.rangeRight(0);
  118728. * // => []
  118729. */
  118730. var rangeRight = Object(_createRange_js__WEBPACK_IMPORTED_MODULE_0__["default"])(true);
  118731. /* harmony default export */ __webpack_exports__["default"] = (rangeRight);
  118732. /***/ }),
  118733. /***/ "./node_modules/lodash-es/rearg.js":
  118734. /*!*****************************************!*\
  118735. !*** ./node_modules/lodash-es/rearg.js ***!
  118736. \*****************************************/
  118737. /*! exports provided: default */
  118738. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  118739. "use strict";
  118740. __webpack_require__.r(__webpack_exports__);
  118741. /* harmony import */ var _createWrap_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createWrap.js */ "./node_modules/lodash-es/_createWrap.js");
  118742. /* harmony import */ var _flatRest_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_flatRest.js */ "./node_modules/lodash-es/_flatRest.js");
  118743. /** Used to compose bitmasks for function metadata. */
  118744. var WRAP_REARG_FLAG = 256;
  118745. /**
  118746. * Creates a function that invokes `func` with arguments arranged according
  118747. * to the specified `indexes` where the argument value at the first index is
  118748. * provided as the first argument, the argument value at the second index is
  118749. * provided as the second argument, and so on.
  118750. *
  118751. * @static
  118752. * @memberOf _
  118753. * @since 3.0.0
  118754. * @category Function
  118755. * @param {Function} func The function to rearrange arguments for.
  118756. * @param {...(number|number[])} indexes The arranged argument indexes.
  118757. * @returns {Function} Returns the new function.
  118758. * @example
  118759. *
  118760. * var rearged = _.rearg(function(a, b, c) {
  118761. * return [a, b, c];
  118762. * }, [2, 0, 1]);
  118763. *
  118764. * rearged('b', 'c', 'a')
  118765. * // => ['a', 'b', 'c']
  118766. */
  118767. var rearg = Object(_flatRest_js__WEBPACK_IMPORTED_MODULE_1__["default"])(function(func, indexes) {
  118768. return Object(_createWrap_js__WEBPACK_IMPORTED_MODULE_0__["default"])(func, WRAP_REARG_FLAG, undefined, undefined, undefined, indexes);
  118769. });
  118770. /* harmony default export */ __webpack_exports__["default"] = (rearg);
  118771. /***/ }),
  118772. /***/ "./node_modules/lodash-es/reduce.js":
  118773. /*!******************************************!*\
  118774. !*** ./node_modules/lodash-es/reduce.js ***!
  118775. \******************************************/
  118776. /*! exports provided: default */
  118777. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  118778. "use strict";
  118779. __webpack_require__.r(__webpack_exports__);
  118780. /* harmony import */ var _arrayReduce_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayReduce.js */ "./node_modules/lodash-es/_arrayReduce.js");
  118781. /* harmony import */ var _baseEach_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseEach.js */ "./node_modules/lodash-es/_baseEach.js");
  118782. /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
  118783. /* harmony import */ var _baseReduce_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_baseReduce.js */ "./node_modules/lodash-es/_baseReduce.js");
  118784. /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
  118785. /**
  118786. * Reduces `collection` to a value which is the accumulated result of running
  118787. * each element in `collection` thru `iteratee`, where each successive
  118788. * invocation is supplied the return value of the previous. If `accumulator`
  118789. * is not given, the first element of `collection` is used as the initial
  118790. * value. The iteratee is invoked with four arguments:
  118791. * (accumulator, value, index|key, collection).
  118792. *
  118793. * Many lodash methods are guarded to work as iteratees for methods like
  118794. * `_.reduce`, `_.reduceRight`, and `_.transform`.
  118795. *
  118796. * The guarded methods are:
  118797. * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`,
  118798. * and `sortBy`
  118799. *
  118800. * @static
  118801. * @memberOf _
  118802. * @since 0.1.0
  118803. * @category Collection
  118804. * @param {Array|Object} collection The collection to iterate over.
  118805. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  118806. * @param {*} [accumulator] The initial value.
  118807. * @returns {*} Returns the accumulated value.
  118808. * @see _.reduceRight
  118809. * @example
  118810. *
  118811. * _.reduce([1, 2], function(sum, n) {
  118812. * return sum + n;
  118813. * }, 0);
  118814. * // => 3
  118815. *
  118816. * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
  118817. * (result[value] || (result[value] = [])).push(key);
  118818. * return result;
  118819. * }, {});
  118820. * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed)
  118821. */
  118822. function reduce(collection, iteratee, accumulator) {
  118823. 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"],
  118824. initAccum = arguments.length < 3;
  118825. return func(collection, Object(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_2__["default"])(iteratee, 4), accumulator, initAccum, _baseEach_js__WEBPACK_IMPORTED_MODULE_1__["default"]);
  118826. }
  118827. /* harmony default export */ __webpack_exports__["default"] = (reduce);
  118828. /***/ }),
  118829. /***/ "./node_modules/lodash-es/reduceRight.js":
  118830. /*!***********************************************!*\
  118831. !*** ./node_modules/lodash-es/reduceRight.js ***!
  118832. \***********************************************/
  118833. /*! exports provided: default */
  118834. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  118835. "use strict";
  118836. __webpack_require__.r(__webpack_exports__);
  118837. /* harmony import */ var _arrayReduceRight_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayReduceRight.js */ "./node_modules/lodash-es/_arrayReduceRight.js");
  118838. /* harmony import */ var _baseEachRight_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseEachRight.js */ "./node_modules/lodash-es/_baseEachRight.js");
  118839. /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
  118840. /* harmony import */ var _baseReduce_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_baseReduce.js */ "./node_modules/lodash-es/_baseReduce.js");
  118841. /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
  118842. /**
  118843. * This method is like `_.reduce` except that it iterates over elements of
  118844. * `collection` from right to left.
  118845. *
  118846. * @static
  118847. * @memberOf _
  118848. * @since 0.1.0
  118849. * @category Collection
  118850. * @param {Array|Object} collection The collection to iterate over.
  118851. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  118852. * @param {*} [accumulator] The initial value.
  118853. * @returns {*} Returns the accumulated value.
  118854. * @see _.reduce
  118855. * @example
  118856. *
  118857. * var array = [[0, 1], [2, 3], [4, 5]];
  118858. *
  118859. * _.reduceRight(array, function(flattened, other) {
  118860. * return flattened.concat(other);
  118861. * }, []);
  118862. * // => [4, 5, 2, 3, 0, 1]
  118863. */
  118864. function reduceRight(collection, iteratee, accumulator) {
  118865. 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"],
  118866. initAccum = arguments.length < 3;
  118867. return func(collection, Object(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_2__["default"])(iteratee, 4), accumulator, initAccum, _baseEachRight_js__WEBPACK_IMPORTED_MODULE_1__["default"]);
  118868. }
  118869. /* harmony default export */ __webpack_exports__["default"] = (reduceRight);
  118870. /***/ }),
  118871. /***/ "./node_modules/lodash-es/reject.js":
  118872. /*!******************************************!*\
  118873. !*** ./node_modules/lodash-es/reject.js ***!
  118874. \******************************************/
  118875. /*! exports provided: default */
  118876. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  118877. "use strict";
  118878. __webpack_require__.r(__webpack_exports__);
  118879. /* harmony import */ var _arrayFilter_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayFilter.js */ "./node_modules/lodash-es/_arrayFilter.js");
  118880. /* harmony import */ var _baseFilter_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseFilter.js */ "./node_modules/lodash-es/_baseFilter.js");
  118881. /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
  118882. /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
  118883. /* harmony import */ var _negate_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./negate.js */ "./node_modules/lodash-es/negate.js");
  118884. /**
  118885. * The opposite of `_.filter`; this method returns the elements of `collection`
  118886. * that `predicate` does **not** return truthy for.
  118887. *
  118888. * @static
  118889. * @memberOf _
  118890. * @since 0.1.0
  118891. * @category Collection
  118892. * @param {Array|Object} collection The collection to iterate over.
  118893. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  118894. * @returns {Array} Returns the new filtered array.
  118895. * @see _.filter
  118896. * @example
  118897. *
  118898. * var users = [
  118899. * { 'user': 'barney', 'age': 36, 'active': false },
  118900. * { 'user': 'fred', 'age': 40, 'active': true }
  118901. * ];
  118902. *
  118903. * _.reject(users, function(o) { return !o.active; });
  118904. * // => objects for ['fred']
  118905. *
  118906. * // The `_.matches` iteratee shorthand.
  118907. * _.reject(users, { 'age': 40, 'active': true });
  118908. * // => objects for ['barney']
  118909. *
  118910. * // The `_.matchesProperty` iteratee shorthand.
  118911. * _.reject(users, ['active', false]);
  118912. * // => objects for ['fred']
  118913. *
  118914. * // The `_.property` iteratee shorthand.
  118915. * _.reject(users, 'active');
  118916. * // => objects for ['barney']
  118917. */
  118918. function reject(collection, predicate) {
  118919. 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"];
  118920. return func(collection, Object(_negate_js__WEBPACK_IMPORTED_MODULE_4__["default"])(Object(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_2__["default"])(predicate, 3)));
  118921. }
  118922. /* harmony default export */ __webpack_exports__["default"] = (reject);
  118923. /***/ }),
  118924. /***/ "./node_modules/lodash-es/remove.js":
  118925. /*!******************************************!*\
  118926. !*** ./node_modules/lodash-es/remove.js ***!
  118927. \******************************************/
  118928. /*! exports provided: default */
  118929. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  118930. "use strict";
  118931. __webpack_require__.r(__webpack_exports__);
  118932. /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
  118933. /* harmony import */ var _basePullAt_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_basePullAt.js */ "./node_modules/lodash-es/_basePullAt.js");
  118934. /**
  118935. * Removes all elements from `array` that `predicate` returns truthy for
  118936. * and returns an array of the removed elements. The predicate is invoked
  118937. * with three arguments: (value, index, array).
  118938. *
  118939. * **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull`
  118940. * to pull elements from an array by value.
  118941. *
  118942. * @static
  118943. * @memberOf _
  118944. * @since 2.0.0
  118945. * @category Array
  118946. * @param {Array} array The array to modify.
  118947. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  118948. * @returns {Array} Returns the new array of removed elements.
  118949. * @example
  118950. *
  118951. * var array = [1, 2, 3, 4];
  118952. * var evens = _.remove(array, function(n) {
  118953. * return n % 2 == 0;
  118954. * });
  118955. *
  118956. * console.log(array);
  118957. * // => [1, 3]
  118958. *
  118959. * console.log(evens);
  118960. * // => [2, 4]
  118961. */
  118962. function remove(array, predicate) {
  118963. var result = [];
  118964. if (!(array && array.length)) {
  118965. return result;
  118966. }
  118967. var index = -1,
  118968. indexes = [],
  118969. length = array.length;
  118970. predicate = Object(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_0__["default"])(predicate, 3);
  118971. while (++index < length) {
  118972. var value = array[index];
  118973. if (predicate(value, index, array)) {
  118974. result.push(value);
  118975. indexes.push(index);
  118976. }
  118977. }
  118978. Object(_basePullAt_js__WEBPACK_IMPORTED_MODULE_1__["default"])(array, indexes);
  118979. return result;
  118980. }
  118981. /* harmony default export */ __webpack_exports__["default"] = (remove);
  118982. /***/ }),
  118983. /***/ "./node_modules/lodash-es/repeat.js":
  118984. /*!******************************************!*\
  118985. !*** ./node_modules/lodash-es/repeat.js ***!
  118986. \******************************************/
  118987. /*! exports provided: default */
  118988. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  118989. "use strict";
  118990. __webpack_require__.r(__webpack_exports__);
  118991. /* harmony import */ var _baseRepeat_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseRepeat.js */ "./node_modules/lodash-es/_baseRepeat.js");
  118992. /* harmony import */ var _isIterateeCall_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_isIterateeCall.js */ "./node_modules/lodash-es/_isIterateeCall.js");
  118993. /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
  118994. /* harmony import */ var _toString_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./toString.js */ "./node_modules/lodash-es/toString.js");
  118995. /**
  118996. * Repeats the given string `n` times.
  118997. *
  118998. * @static
  118999. * @memberOf _
  119000. * @since 3.0.0
  119001. * @category String
  119002. * @param {string} [string=''] The string to repeat.
  119003. * @param {number} [n=1] The number of times to repeat the string.
  119004. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  119005. * @returns {string} Returns the repeated string.
  119006. * @example
  119007. *
  119008. * _.repeat('*', 3);
  119009. * // => '***'
  119010. *
  119011. * _.repeat('abc', 2);
  119012. * // => 'abcabc'
  119013. *
  119014. * _.repeat('abc', 0);
  119015. * // => ''
  119016. */
  119017. function repeat(string, n, guard) {
  119018. if ((guard ? Object(_isIterateeCall_js__WEBPACK_IMPORTED_MODULE_1__["default"])(string, n, guard) : n === undefined)) {
  119019. n = 1;
  119020. } else {
  119021. n = Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_2__["default"])(n);
  119022. }
  119023. return Object(_baseRepeat_js__WEBPACK_IMPORTED_MODULE_0__["default"])(Object(_toString_js__WEBPACK_IMPORTED_MODULE_3__["default"])(string), n);
  119024. }
  119025. /* harmony default export */ __webpack_exports__["default"] = (repeat);
  119026. /***/ }),
  119027. /***/ "./node_modules/lodash-es/replace.js":
  119028. /*!*******************************************!*\
  119029. !*** ./node_modules/lodash-es/replace.js ***!
  119030. \*******************************************/
  119031. /*! exports provided: default */
  119032. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  119033. "use strict";
  119034. __webpack_require__.r(__webpack_exports__);
  119035. /* harmony import */ var _toString_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./toString.js */ "./node_modules/lodash-es/toString.js");
  119036. /**
  119037. * Replaces matches for `pattern` in `string` with `replacement`.
  119038. *
  119039. * **Note:** This method is based on
  119040. * [`String#replace`](https://mdn.io/String/replace).
  119041. *
  119042. * @static
  119043. * @memberOf _
  119044. * @since 4.0.0
  119045. * @category String
  119046. * @param {string} [string=''] The string to modify.
  119047. * @param {RegExp|string} pattern The pattern to replace.
  119048. * @param {Function|string} replacement The match replacement.
  119049. * @returns {string} Returns the modified string.
  119050. * @example
  119051. *
  119052. * _.replace('Hi Fred', 'Fred', 'Barney');
  119053. * // => 'Hi Barney'
  119054. */
  119055. function replace() {
  119056. var args = arguments,
  119057. string = Object(_toString_js__WEBPACK_IMPORTED_MODULE_0__["default"])(args[0]);
  119058. return args.length < 3 ? string : string.replace(args[1], args[2]);
  119059. }
  119060. /* harmony default export */ __webpack_exports__["default"] = (replace);
  119061. /***/ }),
  119062. /***/ "./node_modules/lodash-es/rest.js":
  119063. /*!****************************************!*\
  119064. !*** ./node_modules/lodash-es/rest.js ***!
  119065. \****************************************/
  119066. /*! exports provided: default */
  119067. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  119068. "use strict";
  119069. __webpack_require__.r(__webpack_exports__);
  119070. /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
  119071. /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
  119072. /** Error message constants. */
  119073. var FUNC_ERROR_TEXT = 'Expected a function';
  119074. /**
  119075. * Creates a function that invokes `func` with the `this` binding of the
  119076. * created function and arguments from `start` and beyond provided as
  119077. * an array.
  119078. *
  119079. * **Note:** This method is based on the
  119080. * [rest parameter](https://mdn.io/rest_parameters).
  119081. *
  119082. * @static
  119083. * @memberOf _
  119084. * @since 4.0.0
  119085. * @category Function
  119086. * @param {Function} func The function to apply a rest parameter to.
  119087. * @param {number} [start=func.length-1] The start position of the rest parameter.
  119088. * @returns {Function} Returns the new function.
  119089. * @example
  119090. *
  119091. * var say = _.rest(function(what, names) {
  119092. * return what + ' ' + _.initial(names).join(', ') +
  119093. * (_.size(names) > 1 ? ', & ' : '') + _.last(names);
  119094. * });
  119095. *
  119096. * say('hello', 'fred', 'barney', 'pebbles');
  119097. * // => 'hello fred, barney, & pebbles'
  119098. */
  119099. function rest(func, start) {
  119100. if (typeof func != 'function') {
  119101. throw new TypeError(FUNC_ERROR_TEXT);
  119102. }
  119103. start = start === undefined ? start : Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_1__["default"])(start);
  119104. return Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_0__["default"])(func, start);
  119105. }
  119106. /* harmony default export */ __webpack_exports__["default"] = (rest);
  119107. /***/ }),
  119108. /***/ "./node_modules/lodash-es/result.js":
  119109. /*!******************************************!*\
  119110. !*** ./node_modules/lodash-es/result.js ***!
  119111. \******************************************/
  119112. /*! exports provided: default */
  119113. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  119114. "use strict";
  119115. __webpack_require__.r(__webpack_exports__);
  119116. /* harmony import */ var _castPath_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_castPath.js */ "./node_modules/lodash-es/_castPath.js");
  119117. /* harmony import */ var _isFunction_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isFunction.js */ "./node_modules/lodash-es/isFunction.js");
  119118. /* harmony import */ var _toKey_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_toKey.js */ "./node_modules/lodash-es/_toKey.js");
  119119. /**
  119120. * This method is like `_.get` except that if the resolved value is a
  119121. * function it's invoked with the `this` binding of its parent object and
  119122. * its result is returned.
  119123. *
  119124. * @static
  119125. * @since 0.1.0
  119126. * @memberOf _
  119127. * @category Object
  119128. * @param {Object} object The object to query.
  119129. * @param {Array|string} path The path of the property to resolve.
  119130. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  119131. * @returns {*} Returns the resolved value.
  119132. * @example
  119133. *
  119134. * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] };
  119135. *
  119136. * _.result(object, 'a[0].b.c1');
  119137. * // => 3
  119138. *
  119139. * _.result(object, 'a[0].b.c2');
  119140. * // => 4
  119141. *
  119142. * _.result(object, 'a[0].b.c3', 'default');
  119143. * // => 'default'
  119144. *
  119145. * _.result(object, 'a[0].b.c3', _.constant('default'));
  119146. * // => 'default'
  119147. */
  119148. function result(object, path, defaultValue) {
  119149. path = Object(_castPath_js__WEBPACK_IMPORTED_MODULE_0__["default"])(path, object);
  119150. var index = -1,
  119151. length = path.length;
  119152. // Ensure the loop is entered when path is empty.
  119153. if (!length) {
  119154. length = 1;
  119155. object = undefined;
  119156. }
  119157. while (++index < length) {
  119158. var value = object == null ? undefined : object[Object(_toKey_js__WEBPACK_IMPORTED_MODULE_2__["default"])(path[index])];
  119159. if (value === undefined) {
  119160. index = length;
  119161. value = defaultValue;
  119162. }
  119163. object = Object(_isFunction_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value) ? value.call(object) : value;
  119164. }
  119165. return object;
  119166. }
  119167. /* harmony default export */ __webpack_exports__["default"] = (result);
  119168. /***/ }),
  119169. /***/ "./node_modules/lodash-es/reverse.js":
  119170. /*!*******************************************!*\
  119171. !*** ./node_modules/lodash-es/reverse.js ***!
  119172. \*******************************************/
  119173. /*! exports provided: default */
  119174. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  119175. "use strict";
  119176. __webpack_require__.r(__webpack_exports__);
  119177. /** Used for built-in method references. */
  119178. var arrayProto = Array.prototype;
  119179. /* Built-in method references for those with the same name as other `lodash` methods. */
  119180. var nativeReverse = arrayProto.reverse;
  119181. /**
  119182. * Reverses `array` so that the first element becomes the last, the second
  119183. * element becomes the second to last, and so on.
  119184. *
  119185. * **Note:** This method mutates `array` and is based on
  119186. * [`Array#reverse`](https://mdn.io/Array/reverse).
  119187. *
  119188. * @static
  119189. * @memberOf _
  119190. * @since 4.0.0
  119191. * @category Array
  119192. * @param {Array} array The array to modify.
  119193. * @returns {Array} Returns `array`.
  119194. * @example
  119195. *
  119196. * var array = [1, 2, 3];
  119197. *
  119198. * _.reverse(array);
  119199. * // => [3, 2, 1]
  119200. *
  119201. * console.log(array);
  119202. * // => [3, 2, 1]
  119203. */
  119204. function reverse(array) {
  119205. return array == null ? array : nativeReverse.call(array);
  119206. }
  119207. /* harmony default export */ __webpack_exports__["default"] = (reverse);
  119208. /***/ }),
  119209. /***/ "./node_modules/lodash-es/round.js":
  119210. /*!*****************************************!*\
  119211. !*** ./node_modules/lodash-es/round.js ***!
  119212. \*****************************************/
  119213. /*! exports provided: default */
  119214. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  119215. "use strict";
  119216. __webpack_require__.r(__webpack_exports__);
  119217. /* harmony import */ var _createRound_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createRound.js */ "./node_modules/lodash-es/_createRound.js");
  119218. /**
  119219. * Computes `number` rounded to `precision`.
  119220. *
  119221. * @static
  119222. * @memberOf _
  119223. * @since 3.10.0
  119224. * @category Math
  119225. * @param {number} number The number to round.
  119226. * @param {number} [precision=0] The precision to round to.
  119227. * @returns {number} Returns the rounded number.
  119228. * @example
  119229. *
  119230. * _.round(4.006);
  119231. * // => 4
  119232. *
  119233. * _.round(4.006, 2);
  119234. * // => 4.01
  119235. *
  119236. * _.round(4060, -2);
  119237. * // => 4100
  119238. */
  119239. var round = Object(_createRound_js__WEBPACK_IMPORTED_MODULE_0__["default"])('round');
  119240. /* harmony default export */ __webpack_exports__["default"] = (round);
  119241. /***/ }),
  119242. /***/ "./node_modules/lodash-es/sample.js":
  119243. /*!******************************************!*\
  119244. !*** ./node_modules/lodash-es/sample.js ***!
  119245. \******************************************/
  119246. /*! exports provided: default */
  119247. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  119248. "use strict";
  119249. __webpack_require__.r(__webpack_exports__);
  119250. /* harmony import */ var _arraySample_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arraySample.js */ "./node_modules/lodash-es/_arraySample.js");
  119251. /* harmony import */ var _baseSample_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseSample.js */ "./node_modules/lodash-es/_baseSample.js");
  119252. /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
  119253. /**
  119254. * Gets a random element from `collection`.
  119255. *
  119256. * @static
  119257. * @memberOf _
  119258. * @since 2.0.0
  119259. * @category Collection
  119260. * @param {Array|Object} collection The collection to sample.
  119261. * @returns {*} Returns the random element.
  119262. * @example
  119263. *
  119264. * _.sample([1, 2, 3, 4]);
  119265. * // => 2
  119266. */
  119267. function sample(collection) {
  119268. 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"];
  119269. return func(collection);
  119270. }
  119271. /* harmony default export */ __webpack_exports__["default"] = (sample);
  119272. /***/ }),
  119273. /***/ "./node_modules/lodash-es/sampleSize.js":
  119274. /*!**********************************************!*\
  119275. !*** ./node_modules/lodash-es/sampleSize.js ***!
  119276. \**********************************************/
  119277. /*! exports provided: default */
  119278. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  119279. "use strict";
  119280. __webpack_require__.r(__webpack_exports__);
  119281. /* harmony import */ var _arraySampleSize_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arraySampleSize.js */ "./node_modules/lodash-es/_arraySampleSize.js");
  119282. /* harmony import */ var _baseSampleSize_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseSampleSize.js */ "./node_modules/lodash-es/_baseSampleSize.js");
  119283. /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
  119284. /* harmony import */ var _isIterateeCall_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_isIterateeCall.js */ "./node_modules/lodash-es/_isIterateeCall.js");
  119285. /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
  119286. /**
  119287. * Gets `n` random elements at unique keys from `collection` up to the
  119288. * size of `collection`.
  119289. *
  119290. * @static
  119291. * @memberOf _
  119292. * @since 4.0.0
  119293. * @category Collection
  119294. * @param {Array|Object} collection The collection to sample.
  119295. * @param {number} [n=1] The number of elements to sample.
  119296. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  119297. * @returns {Array} Returns the random elements.
  119298. * @example
  119299. *
  119300. * _.sampleSize([1, 2, 3], 2);
  119301. * // => [3, 1]
  119302. *
  119303. * _.sampleSize([1, 2, 3], 4);
  119304. * // => [2, 3, 1]
  119305. */
  119306. function sampleSize(collection, n, guard) {
  119307. if ((guard ? Object(_isIterateeCall_js__WEBPACK_IMPORTED_MODULE_3__["default"])(collection, n, guard) : n === undefined)) {
  119308. n = 1;
  119309. } else {
  119310. n = Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_4__["default"])(n);
  119311. }
  119312. 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"];
  119313. return func(collection, n);
  119314. }
  119315. /* harmony default export */ __webpack_exports__["default"] = (sampleSize);
  119316. /***/ }),
  119317. /***/ "./node_modules/lodash-es/seq.default.js":
  119318. /*!***********************************************!*\
  119319. !*** ./node_modules/lodash-es/seq.default.js ***!
  119320. \***********************************************/
  119321. /*! exports provided: default */
  119322. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  119323. "use strict";
  119324. __webpack_require__.r(__webpack_exports__);
  119325. /* harmony import */ var _wrapperAt_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./wrapperAt.js */ "./node_modules/lodash-es/wrapperAt.js");
  119326. /* harmony import */ var _chain_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./chain.js */ "./node_modules/lodash-es/chain.js");
  119327. /* harmony import */ var _commit_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./commit.js */ "./node_modules/lodash-es/commit.js");
  119328. /* harmony import */ var _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./wrapperLodash.js */ "./node_modules/lodash-es/wrapperLodash.js");
  119329. /* harmony import */ var _next_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./next.js */ "./node_modules/lodash-es/next.js");
  119330. /* harmony import */ var _plant_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./plant.js */ "./node_modules/lodash-es/plant.js");
  119331. /* harmony import */ var _wrapperReverse_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./wrapperReverse.js */ "./node_modules/lodash-es/wrapperReverse.js");
  119332. /* harmony import */ var _tap_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./tap.js */ "./node_modules/lodash-es/tap.js");
  119333. /* harmony import */ var _thru_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./thru.js */ "./node_modules/lodash-es/thru.js");
  119334. /* harmony import */ var _toIterator_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./toIterator.js */ "./node_modules/lodash-es/toIterator.js");
  119335. /* harmony import */ var _toJSON_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./toJSON.js */ "./node_modules/lodash-es/toJSON.js");
  119336. /* harmony import */ var _wrapperValue_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./wrapperValue.js */ "./node_modules/lodash-es/wrapperValue.js");
  119337. /* harmony import */ var _valueOf_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./valueOf.js */ "./node_modules/lodash-es/valueOf.js");
  119338. /* harmony import */ var _wrapperChain_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./wrapperChain.js */ "./node_modules/lodash-es/wrapperChain.js");
  119339. /* harmony default export */ __webpack_exports__["default"] = ({
  119340. 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"],
  119341. 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"],
  119342. 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"]
  119343. });
  119344. /***/ }),
  119345. /***/ "./node_modules/lodash-es/seq.js":
  119346. /*!***************************************!*\
  119347. !*** ./node_modules/lodash-es/seq.js ***!
  119348. \***************************************/
  119349. /*! exports provided: at, chain, commit, lodash, next, plant, reverse, tap, thru, toIterator, toJSON, value, valueOf, wrapperChain, default */
  119350. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  119351. "use strict";
  119352. __webpack_require__.r(__webpack_exports__);
  119353. /* harmony import */ var _wrapperAt_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./wrapperAt.js */ "./node_modules/lodash-es/wrapperAt.js");
  119354. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "at", function() { return _wrapperAt_js__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  119355. /* harmony import */ var _chain_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./chain.js */ "./node_modules/lodash-es/chain.js");
  119356. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "chain", function() { return _chain_js__WEBPACK_IMPORTED_MODULE_1__["default"]; });
  119357. /* harmony import */ var _commit_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./commit.js */ "./node_modules/lodash-es/commit.js");
  119358. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "commit", function() { return _commit_js__WEBPACK_IMPORTED_MODULE_2__["default"]; });
  119359. /* harmony import */ var _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./wrapperLodash.js */ "./node_modules/lodash-es/wrapperLodash.js");
  119360. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "lodash", function() { return _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_3__["default"]; });
  119361. /* harmony import */ var _next_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./next.js */ "./node_modules/lodash-es/next.js");
  119362. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "next", function() { return _next_js__WEBPACK_IMPORTED_MODULE_4__["default"]; });
  119363. /* harmony import */ var _plant_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./plant.js */ "./node_modules/lodash-es/plant.js");
  119364. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "plant", function() { return _plant_js__WEBPACK_IMPORTED_MODULE_5__["default"]; });
  119365. /* harmony import */ var _wrapperReverse_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./wrapperReverse.js */ "./node_modules/lodash-es/wrapperReverse.js");
  119366. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "reverse", function() { return _wrapperReverse_js__WEBPACK_IMPORTED_MODULE_6__["default"]; });
  119367. /* harmony import */ var _tap_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./tap.js */ "./node_modules/lodash-es/tap.js");
  119368. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "tap", function() { return _tap_js__WEBPACK_IMPORTED_MODULE_7__["default"]; });
  119369. /* harmony import */ var _thru_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./thru.js */ "./node_modules/lodash-es/thru.js");
  119370. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "thru", function() { return _thru_js__WEBPACK_IMPORTED_MODULE_8__["default"]; });
  119371. /* harmony import */ var _toIterator_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./toIterator.js */ "./node_modules/lodash-es/toIterator.js");
  119372. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toIterator", function() { return _toIterator_js__WEBPACK_IMPORTED_MODULE_9__["default"]; });
  119373. /* harmony import */ var _toJSON_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./toJSON.js */ "./node_modules/lodash-es/toJSON.js");
  119374. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toJSON", function() { return _toJSON_js__WEBPACK_IMPORTED_MODULE_10__["default"]; });
  119375. /* harmony import */ var _wrapperValue_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./wrapperValue.js */ "./node_modules/lodash-es/wrapperValue.js");
  119376. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "value", function() { return _wrapperValue_js__WEBPACK_IMPORTED_MODULE_11__["default"]; });
  119377. /* harmony import */ var _valueOf_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./valueOf.js */ "./node_modules/lodash-es/valueOf.js");
  119378. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "valueOf", function() { return _valueOf_js__WEBPACK_IMPORTED_MODULE_12__["default"]; });
  119379. /* harmony import */ var _wrapperChain_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./wrapperChain.js */ "./node_modules/lodash-es/wrapperChain.js");
  119380. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "wrapperChain", function() { return _wrapperChain_js__WEBPACK_IMPORTED_MODULE_13__["default"]; });
  119381. /* harmony import */ var _seq_default_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./seq.default.js */ "./node_modules/lodash-es/seq.default.js");
  119382. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _seq_default_js__WEBPACK_IMPORTED_MODULE_14__["default"]; });
  119383. /***/ }),
  119384. /***/ "./node_modules/lodash-es/set.js":
  119385. /*!***************************************!*\
  119386. !*** ./node_modules/lodash-es/set.js ***!
  119387. \***************************************/
  119388. /*! exports provided: default */
  119389. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  119390. "use strict";
  119391. __webpack_require__.r(__webpack_exports__);
  119392. /* harmony import */ var _baseSet_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseSet.js */ "./node_modules/lodash-es/_baseSet.js");
  119393. /**
  119394. * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,
  119395. * it's created. Arrays are created for missing index properties while objects
  119396. * are created for all other missing properties. Use `_.setWith` to customize
  119397. * `path` creation.
  119398. *
  119399. * **Note:** This method mutates `object`.
  119400. *
  119401. * @static
  119402. * @memberOf _
  119403. * @since 3.7.0
  119404. * @category Object
  119405. * @param {Object} object The object to modify.
  119406. * @param {Array|string} path The path of the property to set.
  119407. * @param {*} value The value to set.
  119408. * @returns {Object} Returns `object`.
  119409. * @example
  119410. *
  119411. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  119412. *
  119413. * _.set(object, 'a[0].b.c', 4);
  119414. * console.log(object.a[0].b.c);
  119415. * // => 4
  119416. *
  119417. * _.set(object, ['x', '0', 'y', 'z'], 5);
  119418. * console.log(object.x[0].y.z);
  119419. * // => 5
  119420. */
  119421. function set(object, path, value) {
  119422. return object == null ? object : Object(_baseSet_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, path, value);
  119423. }
  119424. /* harmony default export */ __webpack_exports__["default"] = (set);
  119425. /***/ }),
  119426. /***/ "./node_modules/lodash-es/setWith.js":
  119427. /*!*******************************************!*\
  119428. !*** ./node_modules/lodash-es/setWith.js ***!
  119429. \*******************************************/
  119430. /*! exports provided: default */
  119431. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  119432. "use strict";
  119433. __webpack_require__.r(__webpack_exports__);
  119434. /* harmony import */ var _baseSet_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseSet.js */ "./node_modules/lodash-es/_baseSet.js");
  119435. /**
  119436. * This method is like `_.set` except that it accepts `customizer` which is
  119437. * invoked to produce the objects of `path`. If `customizer` returns `undefined`
  119438. * path creation is handled by the method instead. The `customizer` is invoked
  119439. * with three arguments: (nsValue, key, nsObject).
  119440. *
  119441. * **Note:** This method mutates `object`.
  119442. *
  119443. * @static
  119444. * @memberOf _
  119445. * @since 4.0.0
  119446. * @category Object
  119447. * @param {Object} object The object to modify.
  119448. * @param {Array|string} path The path of the property to set.
  119449. * @param {*} value The value to set.
  119450. * @param {Function} [customizer] The function to customize assigned values.
  119451. * @returns {Object} Returns `object`.
  119452. * @example
  119453. *
  119454. * var object = {};
  119455. *
  119456. * _.setWith(object, '[0][1]', 'a', Object);
  119457. * // => { '0': { '1': 'a' } }
  119458. */
  119459. function setWith(object, path, value, customizer) {
  119460. customizer = typeof customizer == 'function' ? customizer : undefined;
  119461. return object == null ? object : Object(_baseSet_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, path, value, customizer);
  119462. }
  119463. /* harmony default export */ __webpack_exports__["default"] = (setWith);
  119464. /***/ }),
  119465. /***/ "./node_modules/lodash-es/shuffle.js":
  119466. /*!*******************************************!*\
  119467. !*** ./node_modules/lodash-es/shuffle.js ***!
  119468. \*******************************************/
  119469. /*! exports provided: default */
  119470. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  119471. "use strict";
  119472. __webpack_require__.r(__webpack_exports__);
  119473. /* harmony import */ var _arrayShuffle_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayShuffle.js */ "./node_modules/lodash-es/_arrayShuffle.js");
  119474. /* harmony import */ var _baseShuffle_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseShuffle.js */ "./node_modules/lodash-es/_baseShuffle.js");
  119475. /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
  119476. /**
  119477. * Creates an array of shuffled values, using a version of the
  119478. * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle).
  119479. *
  119480. * @static
  119481. * @memberOf _
  119482. * @since 0.1.0
  119483. * @category Collection
  119484. * @param {Array|Object} collection The collection to shuffle.
  119485. * @returns {Array} Returns the new shuffled array.
  119486. * @example
  119487. *
  119488. * _.shuffle([1, 2, 3, 4]);
  119489. * // => [4, 1, 3, 2]
  119490. */
  119491. function shuffle(collection) {
  119492. 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"];
  119493. return func(collection);
  119494. }
  119495. /* harmony default export */ __webpack_exports__["default"] = (shuffle);
  119496. /***/ }),
  119497. /***/ "./node_modules/lodash-es/size.js":
  119498. /*!****************************************!*\
  119499. !*** ./node_modules/lodash-es/size.js ***!
  119500. \****************************************/
  119501. /*! exports provided: default */
  119502. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  119503. "use strict";
  119504. __webpack_require__.r(__webpack_exports__);
  119505. /* harmony import */ var _baseKeys_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseKeys.js */ "./node_modules/lodash-es/_baseKeys.js");
  119506. /* harmony import */ var _getTag_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_getTag.js */ "./node_modules/lodash-es/_getTag.js");
  119507. /* harmony import */ var _isArrayLike_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./isArrayLike.js */ "./node_modules/lodash-es/isArrayLike.js");
  119508. /* harmony import */ var _isString_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./isString.js */ "./node_modules/lodash-es/isString.js");
  119509. /* harmony import */ var _stringSize_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_stringSize.js */ "./node_modules/lodash-es/_stringSize.js");
  119510. /** `Object#toString` result references. */
  119511. var mapTag = '[object Map]',
  119512. setTag = '[object Set]';
  119513. /**
  119514. * Gets the size of `collection` by returning its length for array-like
  119515. * values or the number of own enumerable string keyed properties for objects.
  119516. *
  119517. * @static
  119518. * @memberOf _
  119519. * @since 0.1.0
  119520. * @category Collection
  119521. * @param {Array|Object|string} collection The collection to inspect.
  119522. * @returns {number} Returns the collection size.
  119523. * @example
  119524. *
  119525. * _.size([1, 2, 3]);
  119526. * // => 3
  119527. *
  119528. * _.size({ 'a': 1, 'b': 2 });
  119529. * // => 2
  119530. *
  119531. * _.size('pebbles');
  119532. * // => 7
  119533. */
  119534. function size(collection) {
  119535. if (collection == null) {
  119536. return 0;
  119537. }
  119538. if (Object(_isArrayLike_js__WEBPACK_IMPORTED_MODULE_2__["default"])(collection)) {
  119539. return Object(_isString_js__WEBPACK_IMPORTED_MODULE_3__["default"])(collection) ? Object(_stringSize_js__WEBPACK_IMPORTED_MODULE_4__["default"])(collection) : collection.length;
  119540. }
  119541. var tag = Object(_getTag_js__WEBPACK_IMPORTED_MODULE_1__["default"])(collection);
  119542. if (tag == mapTag || tag == setTag) {
  119543. return collection.size;
  119544. }
  119545. return Object(_baseKeys_js__WEBPACK_IMPORTED_MODULE_0__["default"])(collection).length;
  119546. }
  119547. /* harmony default export */ __webpack_exports__["default"] = (size);
  119548. /***/ }),
  119549. /***/ "./node_modules/lodash-es/slice.js":
  119550. /*!*****************************************!*\
  119551. !*** ./node_modules/lodash-es/slice.js ***!
  119552. \*****************************************/
  119553. /*! exports provided: default */
  119554. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  119555. "use strict";
  119556. __webpack_require__.r(__webpack_exports__);
  119557. /* harmony import */ var _baseSlice_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseSlice.js */ "./node_modules/lodash-es/_baseSlice.js");
  119558. /* harmony import */ var _isIterateeCall_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_isIterateeCall.js */ "./node_modules/lodash-es/_isIterateeCall.js");
  119559. /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
  119560. /**
  119561. * Creates a slice of `array` from `start` up to, but not including, `end`.
  119562. *
  119563. * **Note:** This method is used instead of
  119564. * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are
  119565. * returned.
  119566. *
  119567. * @static
  119568. * @memberOf _
  119569. * @since 3.0.0
  119570. * @category Array
  119571. * @param {Array} array The array to slice.
  119572. * @param {number} [start=0] The start position.
  119573. * @param {number} [end=array.length] The end position.
  119574. * @returns {Array} Returns the slice of `array`.
  119575. */
  119576. function slice(array, start, end) {
  119577. var length = array == null ? 0 : array.length;
  119578. if (!length) {
  119579. return [];
  119580. }
  119581. if (end && typeof end != 'number' && Object(_isIterateeCall_js__WEBPACK_IMPORTED_MODULE_1__["default"])(array, start, end)) {
  119582. start = 0;
  119583. end = length;
  119584. }
  119585. else {
  119586. start = start == null ? 0 : Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_2__["default"])(start);
  119587. end = end === undefined ? length : Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_2__["default"])(end);
  119588. }
  119589. return Object(_baseSlice_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, start, end);
  119590. }
  119591. /* harmony default export */ __webpack_exports__["default"] = (slice);
  119592. /***/ }),
  119593. /***/ "./node_modules/lodash-es/snakeCase.js":
  119594. /*!*********************************************!*\
  119595. !*** ./node_modules/lodash-es/snakeCase.js ***!
  119596. \*********************************************/
  119597. /*! exports provided: default */
  119598. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  119599. "use strict";
  119600. __webpack_require__.r(__webpack_exports__);
  119601. /* harmony import */ var _createCompounder_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createCompounder.js */ "./node_modules/lodash-es/_createCompounder.js");
  119602. /**
  119603. * Converts `string` to
  119604. * [snake case](https://en.wikipedia.org/wiki/Snake_case).
  119605. *
  119606. * @static
  119607. * @memberOf _
  119608. * @since 3.0.0
  119609. * @category String
  119610. * @param {string} [string=''] The string to convert.
  119611. * @returns {string} Returns the snake cased string.
  119612. * @example
  119613. *
  119614. * _.snakeCase('Foo Bar');
  119615. * // => 'foo_bar'
  119616. *
  119617. * _.snakeCase('fooBar');
  119618. * // => 'foo_bar'
  119619. *
  119620. * _.snakeCase('--FOO-BAR--');
  119621. * // => 'foo_bar'
  119622. */
  119623. var snakeCase = Object(_createCompounder_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function(result, word, index) {
  119624. return result + (index ? '_' : '') + word.toLowerCase();
  119625. });
  119626. /* harmony default export */ __webpack_exports__["default"] = (snakeCase);
  119627. /***/ }),
  119628. /***/ "./node_modules/lodash-es/some.js":
  119629. /*!****************************************!*\
  119630. !*** ./node_modules/lodash-es/some.js ***!
  119631. \****************************************/
  119632. /*! exports provided: default */
  119633. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  119634. "use strict";
  119635. __webpack_require__.r(__webpack_exports__);
  119636. /* harmony import */ var _arraySome_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arraySome.js */ "./node_modules/lodash-es/_arraySome.js");
  119637. /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
  119638. /* harmony import */ var _baseSome_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseSome.js */ "./node_modules/lodash-es/_baseSome.js");
  119639. /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
  119640. /* harmony import */ var _isIterateeCall_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_isIterateeCall.js */ "./node_modules/lodash-es/_isIterateeCall.js");
  119641. /**
  119642. * Checks if `predicate` returns truthy for **any** element of `collection`.
  119643. * Iteration is stopped once `predicate` returns truthy. The predicate is
  119644. * invoked with three arguments: (value, index|key, collection).
  119645. *
  119646. * @static
  119647. * @memberOf _
  119648. * @since 0.1.0
  119649. * @category Collection
  119650. * @param {Array|Object} collection The collection to iterate over.
  119651. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  119652. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  119653. * @returns {boolean} Returns `true` if any element passes the predicate check,
  119654. * else `false`.
  119655. * @example
  119656. *
  119657. * _.some([null, 0, 'yes', false], Boolean);
  119658. * // => true
  119659. *
  119660. * var users = [
  119661. * { 'user': 'barney', 'active': true },
  119662. * { 'user': 'fred', 'active': false }
  119663. * ];
  119664. *
  119665. * // The `_.matches` iteratee shorthand.
  119666. * _.some(users, { 'user': 'barney', 'active': false });
  119667. * // => false
  119668. *
  119669. * // The `_.matchesProperty` iteratee shorthand.
  119670. * _.some(users, ['active', false]);
  119671. * // => true
  119672. *
  119673. * // The `_.property` iteratee shorthand.
  119674. * _.some(users, 'active');
  119675. * // => true
  119676. */
  119677. function some(collection, predicate, guard) {
  119678. 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"];
  119679. if (guard && Object(_isIterateeCall_js__WEBPACK_IMPORTED_MODULE_4__["default"])(collection, predicate, guard)) {
  119680. predicate = undefined;
  119681. }
  119682. return func(collection, Object(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_1__["default"])(predicate, 3));
  119683. }
  119684. /* harmony default export */ __webpack_exports__["default"] = (some);
  119685. /***/ }),
  119686. /***/ "./node_modules/lodash-es/sortBy.js":
  119687. /*!******************************************!*\
  119688. !*** ./node_modules/lodash-es/sortBy.js ***!
  119689. \******************************************/
  119690. /*! exports provided: default */
  119691. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  119692. "use strict";
  119693. __webpack_require__.r(__webpack_exports__);
  119694. /* harmony import */ var _baseFlatten_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseFlatten.js */ "./node_modules/lodash-es/_baseFlatten.js");
  119695. /* harmony import */ var _baseOrderBy_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseOrderBy.js */ "./node_modules/lodash-es/_baseOrderBy.js");
  119696. /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
  119697. /* harmony import */ var _isIterateeCall_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_isIterateeCall.js */ "./node_modules/lodash-es/_isIterateeCall.js");
  119698. /**
  119699. * Creates an array of elements, sorted in ascending order by the results of
  119700. * running each element in a collection thru each iteratee. This method
  119701. * performs a stable sort, that is, it preserves the original sort order of
  119702. * equal elements. The iteratees are invoked with one argument: (value).
  119703. *
  119704. * @static
  119705. * @memberOf _
  119706. * @since 0.1.0
  119707. * @category Collection
  119708. * @param {Array|Object} collection The collection to iterate over.
  119709. * @param {...(Function|Function[])} [iteratees=[_.identity]]
  119710. * The iteratees to sort by.
  119711. * @returns {Array} Returns the new sorted array.
  119712. * @example
  119713. *
  119714. * var users = [
  119715. * { 'user': 'fred', 'age': 48 },
  119716. * { 'user': 'barney', 'age': 36 },
  119717. * { 'user': 'fred', 'age': 30 },
  119718. * { 'user': 'barney', 'age': 34 }
  119719. * ];
  119720. *
  119721. * _.sortBy(users, [function(o) { return o.user; }]);
  119722. * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 30]]
  119723. *
  119724. * _.sortBy(users, ['user', 'age']);
  119725. * // => objects for [['barney', 34], ['barney', 36], ['fred', 30], ['fred', 48]]
  119726. */
  119727. var sortBy = Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_2__["default"])(function(collection, iteratees) {
  119728. if (collection == null) {
  119729. return [];
  119730. }
  119731. var length = iteratees.length;
  119732. if (length > 1 && Object(_isIterateeCall_js__WEBPACK_IMPORTED_MODULE_3__["default"])(collection, iteratees[0], iteratees[1])) {
  119733. iteratees = [];
  119734. } else if (length > 2 && Object(_isIterateeCall_js__WEBPACK_IMPORTED_MODULE_3__["default"])(iteratees[0], iteratees[1], iteratees[2])) {
  119735. iteratees = [iteratees[0]];
  119736. }
  119737. return Object(_baseOrderBy_js__WEBPACK_IMPORTED_MODULE_1__["default"])(collection, Object(_baseFlatten_js__WEBPACK_IMPORTED_MODULE_0__["default"])(iteratees, 1), []);
  119738. });
  119739. /* harmony default export */ __webpack_exports__["default"] = (sortBy);
  119740. /***/ }),
  119741. /***/ "./node_modules/lodash-es/sortedIndex.js":
  119742. /*!***********************************************!*\
  119743. !*** ./node_modules/lodash-es/sortedIndex.js ***!
  119744. \***********************************************/
  119745. /*! exports provided: default */
  119746. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  119747. "use strict";
  119748. __webpack_require__.r(__webpack_exports__);
  119749. /* harmony import */ var _baseSortedIndex_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseSortedIndex.js */ "./node_modules/lodash-es/_baseSortedIndex.js");
  119750. /**
  119751. * Uses a binary search to determine the lowest index at which `value`
  119752. * should be inserted into `array` in order to maintain its sort order.
  119753. *
  119754. * @static
  119755. * @memberOf _
  119756. * @since 0.1.0
  119757. * @category Array
  119758. * @param {Array} array The sorted array to inspect.
  119759. * @param {*} value The value to evaluate.
  119760. * @returns {number} Returns the index at which `value` should be inserted
  119761. * into `array`.
  119762. * @example
  119763. *
  119764. * _.sortedIndex([30, 50], 40);
  119765. * // => 1
  119766. */
  119767. function sortedIndex(array, value) {
  119768. return Object(_baseSortedIndex_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, value);
  119769. }
  119770. /* harmony default export */ __webpack_exports__["default"] = (sortedIndex);
  119771. /***/ }),
  119772. /***/ "./node_modules/lodash-es/sortedIndexBy.js":
  119773. /*!*************************************************!*\
  119774. !*** ./node_modules/lodash-es/sortedIndexBy.js ***!
  119775. \*************************************************/
  119776. /*! exports provided: default */
  119777. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  119778. "use strict";
  119779. __webpack_require__.r(__webpack_exports__);
  119780. /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
  119781. /* harmony import */ var _baseSortedIndexBy_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseSortedIndexBy.js */ "./node_modules/lodash-es/_baseSortedIndexBy.js");
  119782. /**
  119783. * This method is like `_.sortedIndex` except that it accepts `iteratee`
  119784. * which is invoked for `value` and each element of `array` to compute their
  119785. * sort ranking. The iteratee is invoked with one argument: (value).
  119786. *
  119787. * @static
  119788. * @memberOf _
  119789. * @since 4.0.0
  119790. * @category Array
  119791. * @param {Array} array The sorted array to inspect.
  119792. * @param {*} value The value to evaluate.
  119793. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  119794. * @returns {number} Returns the index at which `value` should be inserted
  119795. * into `array`.
  119796. * @example
  119797. *
  119798. * var objects = [{ 'x': 4 }, { 'x': 5 }];
  119799. *
  119800. * _.sortedIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
  119801. * // => 0
  119802. *
  119803. * // The `_.property` iteratee shorthand.
  119804. * _.sortedIndexBy(objects, { 'x': 4 }, 'x');
  119805. * // => 0
  119806. */
  119807. function sortedIndexBy(array, value, iteratee) {
  119808. return Object(_baseSortedIndexBy_js__WEBPACK_IMPORTED_MODULE_1__["default"])(array, value, Object(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_0__["default"])(iteratee, 2));
  119809. }
  119810. /* harmony default export */ __webpack_exports__["default"] = (sortedIndexBy);
  119811. /***/ }),
  119812. /***/ "./node_modules/lodash-es/sortedIndexOf.js":
  119813. /*!*************************************************!*\
  119814. !*** ./node_modules/lodash-es/sortedIndexOf.js ***!
  119815. \*************************************************/
  119816. /*! exports provided: default */
  119817. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  119818. "use strict";
  119819. __webpack_require__.r(__webpack_exports__);
  119820. /* harmony import */ var _baseSortedIndex_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseSortedIndex.js */ "./node_modules/lodash-es/_baseSortedIndex.js");
  119821. /* harmony import */ var _eq_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./eq.js */ "./node_modules/lodash-es/eq.js");
  119822. /**
  119823. * This method is like `_.indexOf` except that it performs a binary
  119824. * search on a sorted `array`.
  119825. *
  119826. * @static
  119827. * @memberOf _
  119828. * @since 4.0.0
  119829. * @category Array
  119830. * @param {Array} array The array to inspect.
  119831. * @param {*} value The value to search for.
  119832. * @returns {number} Returns the index of the matched value, else `-1`.
  119833. * @example
  119834. *
  119835. * _.sortedIndexOf([4, 5, 5, 5, 6], 5);
  119836. * // => 1
  119837. */
  119838. function sortedIndexOf(array, value) {
  119839. var length = array == null ? 0 : array.length;
  119840. if (length) {
  119841. var index = Object(_baseSortedIndex_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, value);
  119842. if (index < length && Object(_eq_js__WEBPACK_IMPORTED_MODULE_1__["default"])(array[index], value)) {
  119843. return index;
  119844. }
  119845. }
  119846. return -1;
  119847. }
  119848. /* harmony default export */ __webpack_exports__["default"] = (sortedIndexOf);
  119849. /***/ }),
  119850. /***/ "./node_modules/lodash-es/sortedLastIndex.js":
  119851. /*!***************************************************!*\
  119852. !*** ./node_modules/lodash-es/sortedLastIndex.js ***!
  119853. \***************************************************/
  119854. /*! exports provided: default */
  119855. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  119856. "use strict";
  119857. __webpack_require__.r(__webpack_exports__);
  119858. /* harmony import */ var _baseSortedIndex_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseSortedIndex.js */ "./node_modules/lodash-es/_baseSortedIndex.js");
  119859. /**
  119860. * This method is like `_.sortedIndex` except that it returns the highest
  119861. * index at which `value` should be inserted into `array` in order to
  119862. * maintain its sort order.
  119863. *
  119864. * @static
  119865. * @memberOf _
  119866. * @since 3.0.0
  119867. * @category Array
  119868. * @param {Array} array The sorted array to inspect.
  119869. * @param {*} value The value to evaluate.
  119870. * @returns {number} Returns the index at which `value` should be inserted
  119871. * into `array`.
  119872. * @example
  119873. *
  119874. * _.sortedLastIndex([4, 5, 5, 5, 6], 5);
  119875. * // => 4
  119876. */
  119877. function sortedLastIndex(array, value) {
  119878. return Object(_baseSortedIndex_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, value, true);
  119879. }
  119880. /* harmony default export */ __webpack_exports__["default"] = (sortedLastIndex);
  119881. /***/ }),
  119882. /***/ "./node_modules/lodash-es/sortedLastIndexBy.js":
  119883. /*!*****************************************************!*\
  119884. !*** ./node_modules/lodash-es/sortedLastIndexBy.js ***!
  119885. \*****************************************************/
  119886. /*! exports provided: default */
  119887. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  119888. "use strict";
  119889. __webpack_require__.r(__webpack_exports__);
  119890. /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
  119891. /* harmony import */ var _baseSortedIndexBy_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseSortedIndexBy.js */ "./node_modules/lodash-es/_baseSortedIndexBy.js");
  119892. /**
  119893. * This method is like `_.sortedLastIndex` except that it accepts `iteratee`
  119894. * which is invoked for `value` and each element of `array` to compute their
  119895. * sort ranking. The iteratee is invoked with one argument: (value).
  119896. *
  119897. * @static
  119898. * @memberOf _
  119899. * @since 4.0.0
  119900. * @category Array
  119901. * @param {Array} array The sorted array to inspect.
  119902. * @param {*} value The value to evaluate.
  119903. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  119904. * @returns {number} Returns the index at which `value` should be inserted
  119905. * into `array`.
  119906. * @example
  119907. *
  119908. * var objects = [{ 'x': 4 }, { 'x': 5 }];
  119909. *
  119910. * _.sortedLastIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
  119911. * // => 1
  119912. *
  119913. * // The `_.property` iteratee shorthand.
  119914. * _.sortedLastIndexBy(objects, { 'x': 4 }, 'x');
  119915. * // => 1
  119916. */
  119917. function sortedLastIndexBy(array, value, iteratee) {
  119918. return Object(_baseSortedIndexBy_js__WEBPACK_IMPORTED_MODULE_1__["default"])(array, value, Object(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_0__["default"])(iteratee, 2), true);
  119919. }
  119920. /* harmony default export */ __webpack_exports__["default"] = (sortedLastIndexBy);
  119921. /***/ }),
  119922. /***/ "./node_modules/lodash-es/sortedLastIndexOf.js":
  119923. /*!*****************************************************!*\
  119924. !*** ./node_modules/lodash-es/sortedLastIndexOf.js ***!
  119925. \*****************************************************/
  119926. /*! exports provided: default */
  119927. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  119928. "use strict";
  119929. __webpack_require__.r(__webpack_exports__);
  119930. /* harmony import */ var _baseSortedIndex_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseSortedIndex.js */ "./node_modules/lodash-es/_baseSortedIndex.js");
  119931. /* harmony import */ var _eq_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./eq.js */ "./node_modules/lodash-es/eq.js");
  119932. /**
  119933. * This method is like `_.lastIndexOf` except that it performs a binary
  119934. * search on a sorted `array`.
  119935. *
  119936. * @static
  119937. * @memberOf _
  119938. * @since 4.0.0
  119939. * @category Array
  119940. * @param {Array} array The array to inspect.
  119941. * @param {*} value The value to search for.
  119942. * @returns {number} Returns the index of the matched value, else `-1`.
  119943. * @example
  119944. *
  119945. * _.sortedLastIndexOf([4, 5, 5, 5, 6], 5);
  119946. * // => 3
  119947. */
  119948. function sortedLastIndexOf(array, value) {
  119949. var length = array == null ? 0 : array.length;
  119950. if (length) {
  119951. var index = Object(_baseSortedIndex_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, value, true) - 1;
  119952. if (Object(_eq_js__WEBPACK_IMPORTED_MODULE_1__["default"])(array[index], value)) {
  119953. return index;
  119954. }
  119955. }
  119956. return -1;
  119957. }
  119958. /* harmony default export */ __webpack_exports__["default"] = (sortedLastIndexOf);
  119959. /***/ }),
  119960. /***/ "./node_modules/lodash-es/sortedUniq.js":
  119961. /*!**********************************************!*\
  119962. !*** ./node_modules/lodash-es/sortedUniq.js ***!
  119963. \**********************************************/
  119964. /*! exports provided: default */
  119965. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  119966. "use strict";
  119967. __webpack_require__.r(__webpack_exports__);
  119968. /* harmony import */ var _baseSortedUniq_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseSortedUniq.js */ "./node_modules/lodash-es/_baseSortedUniq.js");
  119969. /**
  119970. * This method is like `_.uniq` except that it's designed and optimized
  119971. * for sorted arrays.
  119972. *
  119973. * @static
  119974. * @memberOf _
  119975. * @since 4.0.0
  119976. * @category Array
  119977. * @param {Array} array The array to inspect.
  119978. * @returns {Array} Returns the new duplicate free array.
  119979. * @example
  119980. *
  119981. * _.sortedUniq([1, 1, 2]);
  119982. * // => [1, 2]
  119983. */
  119984. function sortedUniq(array) {
  119985. return (array && array.length)
  119986. ? Object(_baseSortedUniq_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array)
  119987. : [];
  119988. }
  119989. /* harmony default export */ __webpack_exports__["default"] = (sortedUniq);
  119990. /***/ }),
  119991. /***/ "./node_modules/lodash-es/sortedUniqBy.js":
  119992. /*!************************************************!*\
  119993. !*** ./node_modules/lodash-es/sortedUniqBy.js ***!
  119994. \************************************************/
  119995. /*! exports provided: default */
  119996. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  119997. "use strict";
  119998. __webpack_require__.r(__webpack_exports__);
  119999. /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
  120000. /* harmony import */ var _baseSortedUniq_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseSortedUniq.js */ "./node_modules/lodash-es/_baseSortedUniq.js");
  120001. /**
  120002. * This method is like `_.uniqBy` except that it's designed and optimized
  120003. * for sorted arrays.
  120004. *
  120005. * @static
  120006. * @memberOf _
  120007. * @since 4.0.0
  120008. * @category Array
  120009. * @param {Array} array The array to inspect.
  120010. * @param {Function} [iteratee] The iteratee invoked per element.
  120011. * @returns {Array} Returns the new duplicate free array.
  120012. * @example
  120013. *
  120014. * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor);
  120015. * // => [1.1, 2.3]
  120016. */
  120017. function sortedUniqBy(array, iteratee) {
  120018. return (array && array.length)
  120019. ? Object(_baseSortedUniq_js__WEBPACK_IMPORTED_MODULE_1__["default"])(array, Object(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_0__["default"])(iteratee, 2))
  120020. : [];
  120021. }
  120022. /* harmony default export */ __webpack_exports__["default"] = (sortedUniqBy);
  120023. /***/ }),
  120024. /***/ "./node_modules/lodash-es/split.js":
  120025. /*!*****************************************!*\
  120026. !*** ./node_modules/lodash-es/split.js ***!
  120027. \*****************************************/
  120028. /*! exports provided: default */
  120029. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  120030. "use strict";
  120031. __webpack_require__.r(__webpack_exports__);
  120032. /* harmony import */ var _baseToString_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseToString.js */ "./node_modules/lodash-es/_baseToString.js");
  120033. /* harmony import */ var _castSlice_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_castSlice.js */ "./node_modules/lodash-es/_castSlice.js");
  120034. /* harmony import */ var _hasUnicode_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_hasUnicode.js */ "./node_modules/lodash-es/_hasUnicode.js");
  120035. /* harmony import */ var _isIterateeCall_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_isIterateeCall.js */ "./node_modules/lodash-es/_isIterateeCall.js");
  120036. /* harmony import */ var _isRegExp_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./isRegExp.js */ "./node_modules/lodash-es/isRegExp.js");
  120037. /* harmony import */ var _stringToArray_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./_stringToArray.js */ "./node_modules/lodash-es/_stringToArray.js");
  120038. /* harmony import */ var _toString_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./toString.js */ "./node_modules/lodash-es/toString.js");
  120039. /** Used as references for the maximum length and index of an array. */
  120040. var MAX_ARRAY_LENGTH = 4294967295;
  120041. /**
  120042. * Splits `string` by `separator`.
  120043. *
  120044. * **Note:** This method is based on
  120045. * [`String#split`](https://mdn.io/String/split).
  120046. *
  120047. * @static
  120048. * @memberOf _
  120049. * @since 4.0.0
  120050. * @category String
  120051. * @param {string} [string=''] The string to split.
  120052. * @param {RegExp|string} separator The separator pattern to split by.
  120053. * @param {number} [limit] The length to truncate results to.
  120054. * @returns {Array} Returns the string segments.
  120055. * @example
  120056. *
  120057. * _.split('a-b-c', '-', 2);
  120058. * // => ['a', 'b']
  120059. */
  120060. function split(string, separator, limit) {
  120061. if (limit && typeof limit != 'number' && Object(_isIterateeCall_js__WEBPACK_IMPORTED_MODULE_3__["default"])(string, separator, limit)) {
  120062. separator = limit = undefined;
  120063. }
  120064. limit = limit === undefined ? MAX_ARRAY_LENGTH : limit >>> 0;
  120065. if (!limit) {
  120066. return [];
  120067. }
  120068. string = Object(_toString_js__WEBPACK_IMPORTED_MODULE_6__["default"])(string);
  120069. if (string && (
  120070. typeof separator == 'string' ||
  120071. (separator != null && !Object(_isRegExp_js__WEBPACK_IMPORTED_MODULE_4__["default"])(separator))
  120072. )) {
  120073. separator = Object(_baseToString_js__WEBPACK_IMPORTED_MODULE_0__["default"])(separator);
  120074. if (!separator && Object(_hasUnicode_js__WEBPACK_IMPORTED_MODULE_2__["default"])(string)) {
  120075. return Object(_castSlice_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Object(_stringToArray_js__WEBPACK_IMPORTED_MODULE_5__["default"])(string), 0, limit);
  120076. }
  120077. }
  120078. return string.split(separator, limit);
  120079. }
  120080. /* harmony default export */ __webpack_exports__["default"] = (split);
  120081. /***/ }),
  120082. /***/ "./node_modules/lodash-es/spread.js":
  120083. /*!******************************************!*\
  120084. !*** ./node_modules/lodash-es/spread.js ***!
  120085. \******************************************/
  120086. /*! exports provided: default */
  120087. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  120088. "use strict";
  120089. __webpack_require__.r(__webpack_exports__);
  120090. /* harmony import */ var _apply_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_apply.js */ "./node_modules/lodash-es/_apply.js");
  120091. /* harmony import */ var _arrayPush_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_arrayPush.js */ "./node_modules/lodash-es/_arrayPush.js");
  120092. /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
  120093. /* harmony import */ var _castSlice_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_castSlice.js */ "./node_modules/lodash-es/_castSlice.js");
  120094. /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
  120095. /** Error message constants. */
  120096. var FUNC_ERROR_TEXT = 'Expected a function';
  120097. /* Built-in method references for those with the same name as other `lodash` methods. */
  120098. var nativeMax = Math.max;
  120099. /**
  120100. * Creates a function that invokes `func` with the `this` binding of the
  120101. * create function and an array of arguments much like
  120102. * [`Function#apply`](http://www.ecma-international.org/ecma-262/7.0/#sec-function.prototype.apply).
  120103. *
  120104. * **Note:** This method is based on the
  120105. * [spread operator](https://mdn.io/spread_operator).
  120106. *
  120107. * @static
  120108. * @memberOf _
  120109. * @since 3.2.0
  120110. * @category Function
  120111. * @param {Function} func The function to spread arguments over.
  120112. * @param {number} [start=0] The start position of the spread.
  120113. * @returns {Function} Returns the new function.
  120114. * @example
  120115. *
  120116. * var say = _.spread(function(who, what) {
  120117. * return who + ' says ' + what;
  120118. * });
  120119. *
  120120. * say(['fred', 'hello']);
  120121. * // => 'fred says hello'
  120122. *
  120123. * var numbers = Promise.all([
  120124. * Promise.resolve(40),
  120125. * Promise.resolve(36)
  120126. * ]);
  120127. *
  120128. * numbers.then(_.spread(function(x, y) {
  120129. * return x + y;
  120130. * }));
  120131. * // => a Promise of 76
  120132. */
  120133. function spread(func, start) {
  120134. if (typeof func != 'function') {
  120135. throw new TypeError(FUNC_ERROR_TEXT);
  120136. }
  120137. start = start == null ? 0 : nativeMax(Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_4__["default"])(start), 0);
  120138. return Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_2__["default"])(function(args) {
  120139. var array = args[start],
  120140. otherArgs = Object(_castSlice_js__WEBPACK_IMPORTED_MODULE_3__["default"])(args, 0, start);
  120141. if (array) {
  120142. Object(_arrayPush_js__WEBPACK_IMPORTED_MODULE_1__["default"])(otherArgs, array);
  120143. }
  120144. return Object(_apply_js__WEBPACK_IMPORTED_MODULE_0__["default"])(func, this, otherArgs);
  120145. });
  120146. }
  120147. /* harmony default export */ __webpack_exports__["default"] = (spread);
  120148. /***/ }),
  120149. /***/ "./node_modules/lodash-es/startCase.js":
  120150. /*!*********************************************!*\
  120151. !*** ./node_modules/lodash-es/startCase.js ***!
  120152. \*********************************************/
  120153. /*! exports provided: default */
  120154. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  120155. "use strict";
  120156. __webpack_require__.r(__webpack_exports__);
  120157. /* harmony import */ var _createCompounder_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createCompounder.js */ "./node_modules/lodash-es/_createCompounder.js");
  120158. /* harmony import */ var _upperFirst_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./upperFirst.js */ "./node_modules/lodash-es/upperFirst.js");
  120159. /**
  120160. * Converts `string` to
  120161. * [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage).
  120162. *
  120163. * @static
  120164. * @memberOf _
  120165. * @since 3.1.0
  120166. * @category String
  120167. * @param {string} [string=''] The string to convert.
  120168. * @returns {string} Returns the start cased string.
  120169. * @example
  120170. *
  120171. * _.startCase('--foo-bar--');
  120172. * // => 'Foo Bar'
  120173. *
  120174. * _.startCase('fooBar');
  120175. * // => 'Foo Bar'
  120176. *
  120177. * _.startCase('__FOO_BAR__');
  120178. * // => 'FOO BAR'
  120179. */
  120180. var startCase = Object(_createCompounder_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function(result, word, index) {
  120181. return result + (index ? ' ' : '') + Object(_upperFirst_js__WEBPACK_IMPORTED_MODULE_1__["default"])(word);
  120182. });
  120183. /* harmony default export */ __webpack_exports__["default"] = (startCase);
  120184. /***/ }),
  120185. /***/ "./node_modules/lodash-es/startsWith.js":
  120186. /*!**********************************************!*\
  120187. !*** ./node_modules/lodash-es/startsWith.js ***!
  120188. \**********************************************/
  120189. /*! exports provided: default */
  120190. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  120191. "use strict";
  120192. __webpack_require__.r(__webpack_exports__);
  120193. /* harmony import */ var _baseClamp_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseClamp.js */ "./node_modules/lodash-es/_baseClamp.js");
  120194. /* harmony import */ var _baseToString_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseToString.js */ "./node_modules/lodash-es/_baseToString.js");
  120195. /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
  120196. /* harmony import */ var _toString_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./toString.js */ "./node_modules/lodash-es/toString.js");
  120197. /**
  120198. * Checks if `string` starts with the given target string.
  120199. *
  120200. * @static
  120201. * @memberOf _
  120202. * @since 3.0.0
  120203. * @category String
  120204. * @param {string} [string=''] The string to inspect.
  120205. * @param {string} [target] The string to search for.
  120206. * @param {number} [position=0] The position to search from.
  120207. * @returns {boolean} Returns `true` if `string` starts with `target`,
  120208. * else `false`.
  120209. * @example
  120210. *
  120211. * _.startsWith('abc', 'a');
  120212. * // => true
  120213. *
  120214. * _.startsWith('abc', 'b');
  120215. * // => false
  120216. *
  120217. * _.startsWith('abc', 'b', 1);
  120218. * // => true
  120219. */
  120220. function startsWith(string, target, position) {
  120221. string = Object(_toString_js__WEBPACK_IMPORTED_MODULE_3__["default"])(string);
  120222. position = position == null
  120223. ? 0
  120224. : Object(_baseClamp_js__WEBPACK_IMPORTED_MODULE_0__["default"])(Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_2__["default"])(position), 0, string.length);
  120225. target = Object(_baseToString_js__WEBPACK_IMPORTED_MODULE_1__["default"])(target);
  120226. return string.slice(position, position + target.length) == target;
  120227. }
  120228. /* harmony default export */ __webpack_exports__["default"] = (startsWith);
  120229. /***/ }),
  120230. /***/ "./node_modules/lodash-es/string.default.js":
  120231. /*!**************************************************!*\
  120232. !*** ./node_modules/lodash-es/string.default.js ***!
  120233. \**************************************************/
  120234. /*! exports provided: default */
  120235. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  120236. "use strict";
  120237. __webpack_require__.r(__webpack_exports__);
  120238. /* harmony import */ var _camelCase_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./camelCase.js */ "./node_modules/lodash-es/camelCase.js");
  120239. /* harmony import */ var _capitalize_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./capitalize.js */ "./node_modules/lodash-es/capitalize.js");
  120240. /* harmony import */ var _deburr_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./deburr.js */ "./node_modules/lodash-es/deburr.js");
  120241. /* harmony import */ var _endsWith_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./endsWith.js */ "./node_modules/lodash-es/endsWith.js");
  120242. /* harmony import */ var _escape_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./escape.js */ "./node_modules/lodash-es/escape.js");
  120243. /* harmony import */ var _escapeRegExp_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./escapeRegExp.js */ "./node_modules/lodash-es/escapeRegExp.js");
  120244. /* harmony import */ var _kebabCase_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./kebabCase.js */ "./node_modules/lodash-es/kebabCase.js");
  120245. /* harmony import */ var _lowerCase_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./lowerCase.js */ "./node_modules/lodash-es/lowerCase.js");
  120246. /* harmony import */ var _lowerFirst_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./lowerFirst.js */ "./node_modules/lodash-es/lowerFirst.js");
  120247. /* harmony import */ var _pad_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./pad.js */ "./node_modules/lodash-es/pad.js");
  120248. /* harmony import */ var _padEnd_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./padEnd.js */ "./node_modules/lodash-es/padEnd.js");
  120249. /* harmony import */ var _padStart_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./padStart.js */ "./node_modules/lodash-es/padStart.js");
  120250. /* harmony import */ var _parseInt_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./parseInt.js */ "./node_modules/lodash-es/parseInt.js");
  120251. /* harmony import */ var _repeat_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./repeat.js */ "./node_modules/lodash-es/repeat.js");
  120252. /* harmony import */ var _replace_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./replace.js */ "./node_modules/lodash-es/replace.js");
  120253. /* harmony import */ var _snakeCase_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./snakeCase.js */ "./node_modules/lodash-es/snakeCase.js");
  120254. /* harmony import */ var _split_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./split.js */ "./node_modules/lodash-es/split.js");
  120255. /* harmony import */ var _startCase_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./startCase.js */ "./node_modules/lodash-es/startCase.js");
  120256. /* harmony import */ var _startsWith_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./startsWith.js */ "./node_modules/lodash-es/startsWith.js");
  120257. /* harmony import */ var _template_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./template.js */ "./node_modules/lodash-es/template.js");
  120258. /* harmony import */ var _templateSettings_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./templateSettings.js */ "./node_modules/lodash-es/templateSettings.js");
  120259. /* harmony import */ var _toLower_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./toLower.js */ "./node_modules/lodash-es/toLower.js");
  120260. /* harmony import */ var _toUpper_js__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./toUpper.js */ "./node_modules/lodash-es/toUpper.js");
  120261. /* harmony import */ var _trim_js__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./trim.js */ "./node_modules/lodash-es/trim.js");
  120262. /* harmony import */ var _trimEnd_js__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./trimEnd.js */ "./node_modules/lodash-es/trimEnd.js");
  120263. /* harmony import */ var _trimStart_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./trimStart.js */ "./node_modules/lodash-es/trimStart.js");
  120264. /* harmony import */ var _truncate_js__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./truncate.js */ "./node_modules/lodash-es/truncate.js");
  120265. /* harmony import */ var _unescape_js__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./unescape.js */ "./node_modules/lodash-es/unescape.js");
  120266. /* harmony import */ var _upperCase_js__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./upperCase.js */ "./node_modules/lodash-es/upperCase.js");
  120267. /* harmony import */ var _upperFirst_js__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./upperFirst.js */ "./node_modules/lodash-es/upperFirst.js");
  120268. /* harmony import */ var _words_js__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./words.js */ "./node_modules/lodash-es/words.js");
  120269. /* harmony default export */ __webpack_exports__["default"] = ({
  120270. 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"],
  120271. 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"],
  120272. 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"],
  120273. 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"],
  120274. 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"],
  120275. 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"],
  120276. words: _words_js__WEBPACK_IMPORTED_MODULE_30__["default"]
  120277. });
  120278. /***/ }),
  120279. /***/ "./node_modules/lodash-es/string.js":
  120280. /*!******************************************!*\
  120281. !*** ./node_modules/lodash-es/string.js ***!
  120282. \******************************************/
  120283. /*! 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 */
  120284. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  120285. "use strict";
  120286. __webpack_require__.r(__webpack_exports__);
  120287. /* harmony import */ var _camelCase_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./camelCase.js */ "./node_modules/lodash-es/camelCase.js");
  120288. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "camelCase", function() { return _camelCase_js__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  120289. /* harmony import */ var _capitalize_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./capitalize.js */ "./node_modules/lodash-es/capitalize.js");
  120290. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "capitalize", function() { return _capitalize_js__WEBPACK_IMPORTED_MODULE_1__["default"]; });
  120291. /* harmony import */ var _deburr_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./deburr.js */ "./node_modules/lodash-es/deburr.js");
  120292. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "deburr", function() { return _deburr_js__WEBPACK_IMPORTED_MODULE_2__["default"]; });
  120293. /* harmony import */ var _endsWith_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./endsWith.js */ "./node_modules/lodash-es/endsWith.js");
  120294. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "endsWith", function() { return _endsWith_js__WEBPACK_IMPORTED_MODULE_3__["default"]; });
  120295. /* harmony import */ var _escape_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./escape.js */ "./node_modules/lodash-es/escape.js");
  120296. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "escape", function() { return _escape_js__WEBPACK_IMPORTED_MODULE_4__["default"]; });
  120297. /* harmony import */ var _escapeRegExp_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./escapeRegExp.js */ "./node_modules/lodash-es/escapeRegExp.js");
  120298. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "escapeRegExp", function() { return _escapeRegExp_js__WEBPACK_IMPORTED_MODULE_5__["default"]; });
  120299. /* harmony import */ var _kebabCase_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./kebabCase.js */ "./node_modules/lodash-es/kebabCase.js");
  120300. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "kebabCase", function() { return _kebabCase_js__WEBPACK_IMPORTED_MODULE_6__["default"]; });
  120301. /* harmony import */ var _lowerCase_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./lowerCase.js */ "./node_modules/lodash-es/lowerCase.js");
  120302. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "lowerCase", function() { return _lowerCase_js__WEBPACK_IMPORTED_MODULE_7__["default"]; });
  120303. /* harmony import */ var _lowerFirst_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./lowerFirst.js */ "./node_modules/lodash-es/lowerFirst.js");
  120304. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "lowerFirst", function() { return _lowerFirst_js__WEBPACK_IMPORTED_MODULE_8__["default"]; });
  120305. /* harmony import */ var _pad_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./pad.js */ "./node_modules/lodash-es/pad.js");
  120306. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "pad", function() { return _pad_js__WEBPACK_IMPORTED_MODULE_9__["default"]; });
  120307. /* harmony import */ var _padEnd_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./padEnd.js */ "./node_modules/lodash-es/padEnd.js");
  120308. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "padEnd", function() { return _padEnd_js__WEBPACK_IMPORTED_MODULE_10__["default"]; });
  120309. /* harmony import */ var _padStart_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./padStart.js */ "./node_modules/lodash-es/padStart.js");
  120310. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "padStart", function() { return _padStart_js__WEBPACK_IMPORTED_MODULE_11__["default"]; });
  120311. /* harmony import */ var _parseInt_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./parseInt.js */ "./node_modules/lodash-es/parseInt.js");
  120312. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "parseInt", function() { return _parseInt_js__WEBPACK_IMPORTED_MODULE_12__["default"]; });
  120313. /* harmony import */ var _repeat_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./repeat.js */ "./node_modules/lodash-es/repeat.js");
  120314. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "repeat", function() { return _repeat_js__WEBPACK_IMPORTED_MODULE_13__["default"]; });
  120315. /* harmony import */ var _replace_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./replace.js */ "./node_modules/lodash-es/replace.js");
  120316. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "replace", function() { return _replace_js__WEBPACK_IMPORTED_MODULE_14__["default"]; });
  120317. /* harmony import */ var _snakeCase_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./snakeCase.js */ "./node_modules/lodash-es/snakeCase.js");
  120318. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "snakeCase", function() { return _snakeCase_js__WEBPACK_IMPORTED_MODULE_15__["default"]; });
  120319. /* harmony import */ var _split_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./split.js */ "./node_modules/lodash-es/split.js");
  120320. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "split", function() { return _split_js__WEBPACK_IMPORTED_MODULE_16__["default"]; });
  120321. /* harmony import */ var _startCase_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./startCase.js */ "./node_modules/lodash-es/startCase.js");
  120322. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "startCase", function() { return _startCase_js__WEBPACK_IMPORTED_MODULE_17__["default"]; });
  120323. /* harmony import */ var _startsWith_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./startsWith.js */ "./node_modules/lodash-es/startsWith.js");
  120324. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "startsWith", function() { return _startsWith_js__WEBPACK_IMPORTED_MODULE_18__["default"]; });
  120325. /* harmony import */ var _template_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./template.js */ "./node_modules/lodash-es/template.js");
  120326. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "template", function() { return _template_js__WEBPACK_IMPORTED_MODULE_19__["default"]; });
  120327. /* harmony import */ var _templateSettings_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./templateSettings.js */ "./node_modules/lodash-es/templateSettings.js");
  120328. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "templateSettings", function() { return _templateSettings_js__WEBPACK_IMPORTED_MODULE_20__["default"]; });
  120329. /* harmony import */ var _toLower_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./toLower.js */ "./node_modules/lodash-es/toLower.js");
  120330. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toLower", function() { return _toLower_js__WEBPACK_IMPORTED_MODULE_21__["default"]; });
  120331. /* harmony import */ var _toUpper_js__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./toUpper.js */ "./node_modules/lodash-es/toUpper.js");
  120332. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toUpper", function() { return _toUpper_js__WEBPACK_IMPORTED_MODULE_22__["default"]; });
  120333. /* harmony import */ var _trim_js__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./trim.js */ "./node_modules/lodash-es/trim.js");
  120334. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "trim", function() { return _trim_js__WEBPACK_IMPORTED_MODULE_23__["default"]; });
  120335. /* harmony import */ var _trimEnd_js__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./trimEnd.js */ "./node_modules/lodash-es/trimEnd.js");
  120336. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "trimEnd", function() { return _trimEnd_js__WEBPACK_IMPORTED_MODULE_24__["default"]; });
  120337. /* harmony import */ var _trimStart_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./trimStart.js */ "./node_modules/lodash-es/trimStart.js");
  120338. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "trimStart", function() { return _trimStart_js__WEBPACK_IMPORTED_MODULE_25__["default"]; });
  120339. /* harmony import */ var _truncate_js__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./truncate.js */ "./node_modules/lodash-es/truncate.js");
  120340. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "truncate", function() { return _truncate_js__WEBPACK_IMPORTED_MODULE_26__["default"]; });
  120341. /* harmony import */ var _unescape_js__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./unescape.js */ "./node_modules/lodash-es/unescape.js");
  120342. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "unescape", function() { return _unescape_js__WEBPACK_IMPORTED_MODULE_27__["default"]; });
  120343. /* harmony import */ var _upperCase_js__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./upperCase.js */ "./node_modules/lodash-es/upperCase.js");
  120344. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "upperCase", function() { return _upperCase_js__WEBPACK_IMPORTED_MODULE_28__["default"]; });
  120345. /* harmony import */ var _upperFirst_js__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./upperFirst.js */ "./node_modules/lodash-es/upperFirst.js");
  120346. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "upperFirst", function() { return _upperFirst_js__WEBPACK_IMPORTED_MODULE_29__["default"]; });
  120347. /* harmony import */ var _words_js__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./words.js */ "./node_modules/lodash-es/words.js");
  120348. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "words", function() { return _words_js__WEBPACK_IMPORTED_MODULE_30__["default"]; });
  120349. /* harmony import */ var _string_default_js__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ./string.default.js */ "./node_modules/lodash-es/string.default.js");
  120350. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _string_default_js__WEBPACK_IMPORTED_MODULE_31__["default"]; });
  120351. /***/ }),
  120352. /***/ "./node_modules/lodash-es/stubArray.js":
  120353. /*!*********************************************!*\
  120354. !*** ./node_modules/lodash-es/stubArray.js ***!
  120355. \*********************************************/
  120356. /*! exports provided: default */
  120357. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  120358. "use strict";
  120359. __webpack_require__.r(__webpack_exports__);
  120360. /**
  120361. * This method returns a new empty array.
  120362. *
  120363. * @static
  120364. * @memberOf _
  120365. * @since 4.13.0
  120366. * @category Util
  120367. * @returns {Array} Returns the new empty array.
  120368. * @example
  120369. *
  120370. * var arrays = _.times(2, _.stubArray);
  120371. *
  120372. * console.log(arrays);
  120373. * // => [[], []]
  120374. *
  120375. * console.log(arrays[0] === arrays[1]);
  120376. * // => false
  120377. */
  120378. function stubArray() {
  120379. return [];
  120380. }
  120381. /* harmony default export */ __webpack_exports__["default"] = (stubArray);
  120382. /***/ }),
  120383. /***/ "./node_modules/lodash-es/stubFalse.js":
  120384. /*!*********************************************!*\
  120385. !*** ./node_modules/lodash-es/stubFalse.js ***!
  120386. \*********************************************/
  120387. /*! exports provided: default */
  120388. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  120389. "use strict";
  120390. __webpack_require__.r(__webpack_exports__);
  120391. /**
  120392. * This method returns `false`.
  120393. *
  120394. * @static
  120395. * @memberOf _
  120396. * @since 4.13.0
  120397. * @category Util
  120398. * @returns {boolean} Returns `false`.
  120399. * @example
  120400. *
  120401. * _.times(2, _.stubFalse);
  120402. * // => [false, false]
  120403. */
  120404. function stubFalse() {
  120405. return false;
  120406. }
  120407. /* harmony default export */ __webpack_exports__["default"] = (stubFalse);
  120408. /***/ }),
  120409. /***/ "./node_modules/lodash-es/stubObject.js":
  120410. /*!**********************************************!*\
  120411. !*** ./node_modules/lodash-es/stubObject.js ***!
  120412. \**********************************************/
  120413. /*! exports provided: default */
  120414. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  120415. "use strict";
  120416. __webpack_require__.r(__webpack_exports__);
  120417. /**
  120418. * This method returns a new empty object.
  120419. *
  120420. * @static
  120421. * @memberOf _
  120422. * @since 4.13.0
  120423. * @category Util
  120424. * @returns {Object} Returns the new empty object.
  120425. * @example
  120426. *
  120427. * var objects = _.times(2, _.stubObject);
  120428. *
  120429. * console.log(objects);
  120430. * // => [{}, {}]
  120431. *
  120432. * console.log(objects[0] === objects[1]);
  120433. * // => false
  120434. */
  120435. function stubObject() {
  120436. return {};
  120437. }
  120438. /* harmony default export */ __webpack_exports__["default"] = (stubObject);
  120439. /***/ }),
  120440. /***/ "./node_modules/lodash-es/stubString.js":
  120441. /*!**********************************************!*\
  120442. !*** ./node_modules/lodash-es/stubString.js ***!
  120443. \**********************************************/
  120444. /*! exports provided: default */
  120445. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  120446. "use strict";
  120447. __webpack_require__.r(__webpack_exports__);
  120448. /**
  120449. * This method returns an empty string.
  120450. *
  120451. * @static
  120452. * @memberOf _
  120453. * @since 4.13.0
  120454. * @category Util
  120455. * @returns {string} Returns the empty string.
  120456. * @example
  120457. *
  120458. * _.times(2, _.stubString);
  120459. * // => ['', '']
  120460. */
  120461. function stubString() {
  120462. return '';
  120463. }
  120464. /* harmony default export */ __webpack_exports__["default"] = (stubString);
  120465. /***/ }),
  120466. /***/ "./node_modules/lodash-es/stubTrue.js":
  120467. /*!********************************************!*\
  120468. !*** ./node_modules/lodash-es/stubTrue.js ***!
  120469. \********************************************/
  120470. /*! exports provided: default */
  120471. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  120472. "use strict";
  120473. __webpack_require__.r(__webpack_exports__);
  120474. /**
  120475. * This method returns `true`.
  120476. *
  120477. * @static
  120478. * @memberOf _
  120479. * @since 4.13.0
  120480. * @category Util
  120481. * @returns {boolean} Returns `true`.
  120482. * @example
  120483. *
  120484. * _.times(2, _.stubTrue);
  120485. * // => [true, true]
  120486. */
  120487. function stubTrue() {
  120488. return true;
  120489. }
  120490. /* harmony default export */ __webpack_exports__["default"] = (stubTrue);
  120491. /***/ }),
  120492. /***/ "./node_modules/lodash-es/subtract.js":
  120493. /*!********************************************!*\
  120494. !*** ./node_modules/lodash-es/subtract.js ***!
  120495. \********************************************/
  120496. /*! exports provided: default */
  120497. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  120498. "use strict";
  120499. __webpack_require__.r(__webpack_exports__);
  120500. /* harmony import */ var _createMathOperation_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createMathOperation.js */ "./node_modules/lodash-es/_createMathOperation.js");
  120501. /**
  120502. * Subtract two numbers.
  120503. *
  120504. * @static
  120505. * @memberOf _
  120506. * @since 4.0.0
  120507. * @category Math
  120508. * @param {number} minuend The first number in a subtraction.
  120509. * @param {number} subtrahend The second number in a subtraction.
  120510. * @returns {number} Returns the difference.
  120511. * @example
  120512. *
  120513. * _.subtract(6, 4);
  120514. * // => 2
  120515. */
  120516. var subtract = Object(_createMathOperation_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function(minuend, subtrahend) {
  120517. return minuend - subtrahend;
  120518. }, 0);
  120519. /* harmony default export */ __webpack_exports__["default"] = (subtract);
  120520. /***/ }),
  120521. /***/ "./node_modules/lodash-es/sum.js":
  120522. /*!***************************************!*\
  120523. !*** ./node_modules/lodash-es/sum.js ***!
  120524. \***************************************/
  120525. /*! exports provided: default */
  120526. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  120527. "use strict";
  120528. __webpack_require__.r(__webpack_exports__);
  120529. /* harmony import */ var _baseSum_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseSum.js */ "./node_modules/lodash-es/_baseSum.js");
  120530. /* harmony import */ var _identity_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./identity.js */ "./node_modules/lodash-es/identity.js");
  120531. /**
  120532. * Computes the sum of the values in `array`.
  120533. *
  120534. * @static
  120535. * @memberOf _
  120536. * @since 3.4.0
  120537. * @category Math
  120538. * @param {Array} array The array to iterate over.
  120539. * @returns {number} Returns the sum.
  120540. * @example
  120541. *
  120542. * _.sum([4, 2, 8, 6]);
  120543. * // => 20
  120544. */
  120545. function sum(array) {
  120546. return (array && array.length)
  120547. ? Object(_baseSum_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, _identity_js__WEBPACK_IMPORTED_MODULE_1__["default"])
  120548. : 0;
  120549. }
  120550. /* harmony default export */ __webpack_exports__["default"] = (sum);
  120551. /***/ }),
  120552. /***/ "./node_modules/lodash-es/sumBy.js":
  120553. /*!*****************************************!*\
  120554. !*** ./node_modules/lodash-es/sumBy.js ***!
  120555. \*****************************************/
  120556. /*! exports provided: default */
  120557. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  120558. "use strict";
  120559. __webpack_require__.r(__webpack_exports__);
  120560. /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
  120561. /* harmony import */ var _baseSum_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseSum.js */ "./node_modules/lodash-es/_baseSum.js");
  120562. /**
  120563. * This method is like `_.sum` except that it accepts `iteratee` which is
  120564. * invoked for each element in `array` to generate the value to be summed.
  120565. * The iteratee is invoked with one argument: (value).
  120566. *
  120567. * @static
  120568. * @memberOf _
  120569. * @since 4.0.0
  120570. * @category Math
  120571. * @param {Array} array The array to iterate over.
  120572. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  120573. * @returns {number} Returns the sum.
  120574. * @example
  120575. *
  120576. * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
  120577. *
  120578. * _.sumBy(objects, function(o) { return o.n; });
  120579. * // => 20
  120580. *
  120581. * // The `_.property` iteratee shorthand.
  120582. * _.sumBy(objects, 'n');
  120583. * // => 20
  120584. */
  120585. function sumBy(array, iteratee) {
  120586. return (array && array.length)
  120587. ? Object(_baseSum_js__WEBPACK_IMPORTED_MODULE_1__["default"])(array, Object(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_0__["default"])(iteratee, 2))
  120588. : 0;
  120589. }
  120590. /* harmony default export */ __webpack_exports__["default"] = (sumBy);
  120591. /***/ }),
  120592. /***/ "./node_modules/lodash-es/tail.js":
  120593. /*!****************************************!*\
  120594. !*** ./node_modules/lodash-es/tail.js ***!
  120595. \****************************************/
  120596. /*! exports provided: default */
  120597. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  120598. "use strict";
  120599. __webpack_require__.r(__webpack_exports__);
  120600. /* harmony import */ var _baseSlice_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseSlice.js */ "./node_modules/lodash-es/_baseSlice.js");
  120601. /**
  120602. * Gets all but the first element of `array`.
  120603. *
  120604. * @static
  120605. * @memberOf _
  120606. * @since 4.0.0
  120607. * @category Array
  120608. * @param {Array} array The array to query.
  120609. * @returns {Array} Returns the slice of `array`.
  120610. * @example
  120611. *
  120612. * _.tail([1, 2, 3]);
  120613. * // => [2, 3]
  120614. */
  120615. function tail(array) {
  120616. var length = array == null ? 0 : array.length;
  120617. return length ? Object(_baseSlice_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, 1, length) : [];
  120618. }
  120619. /* harmony default export */ __webpack_exports__["default"] = (tail);
  120620. /***/ }),
  120621. /***/ "./node_modules/lodash-es/take.js":
  120622. /*!****************************************!*\
  120623. !*** ./node_modules/lodash-es/take.js ***!
  120624. \****************************************/
  120625. /*! exports provided: default */
  120626. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  120627. "use strict";
  120628. __webpack_require__.r(__webpack_exports__);
  120629. /* harmony import */ var _baseSlice_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseSlice.js */ "./node_modules/lodash-es/_baseSlice.js");
  120630. /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
  120631. /**
  120632. * Creates a slice of `array` with `n` elements taken from the beginning.
  120633. *
  120634. * @static
  120635. * @memberOf _
  120636. * @since 0.1.0
  120637. * @category Array
  120638. * @param {Array} array The array to query.
  120639. * @param {number} [n=1] The number of elements to take.
  120640. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  120641. * @returns {Array} Returns the slice of `array`.
  120642. * @example
  120643. *
  120644. * _.take([1, 2, 3]);
  120645. * // => [1]
  120646. *
  120647. * _.take([1, 2, 3], 2);
  120648. * // => [1, 2]
  120649. *
  120650. * _.take([1, 2, 3], 5);
  120651. * // => [1, 2, 3]
  120652. *
  120653. * _.take([1, 2, 3], 0);
  120654. * // => []
  120655. */
  120656. function take(array, n, guard) {
  120657. if (!(array && array.length)) {
  120658. return [];
  120659. }
  120660. n = (guard || n === undefined) ? 1 : Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_1__["default"])(n);
  120661. return Object(_baseSlice_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, 0, n < 0 ? 0 : n);
  120662. }
  120663. /* harmony default export */ __webpack_exports__["default"] = (take);
  120664. /***/ }),
  120665. /***/ "./node_modules/lodash-es/takeRight.js":
  120666. /*!*********************************************!*\
  120667. !*** ./node_modules/lodash-es/takeRight.js ***!
  120668. \*********************************************/
  120669. /*! exports provided: default */
  120670. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  120671. "use strict";
  120672. __webpack_require__.r(__webpack_exports__);
  120673. /* harmony import */ var _baseSlice_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseSlice.js */ "./node_modules/lodash-es/_baseSlice.js");
  120674. /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
  120675. /**
  120676. * Creates a slice of `array` with `n` elements taken from the end.
  120677. *
  120678. * @static
  120679. * @memberOf _
  120680. * @since 3.0.0
  120681. * @category Array
  120682. * @param {Array} array The array to query.
  120683. * @param {number} [n=1] The number of elements to take.
  120684. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  120685. * @returns {Array} Returns the slice of `array`.
  120686. * @example
  120687. *
  120688. * _.takeRight([1, 2, 3]);
  120689. * // => [3]
  120690. *
  120691. * _.takeRight([1, 2, 3], 2);
  120692. * // => [2, 3]
  120693. *
  120694. * _.takeRight([1, 2, 3], 5);
  120695. * // => [1, 2, 3]
  120696. *
  120697. * _.takeRight([1, 2, 3], 0);
  120698. * // => []
  120699. */
  120700. function takeRight(array, n, guard) {
  120701. var length = array == null ? 0 : array.length;
  120702. if (!length) {
  120703. return [];
  120704. }
  120705. n = (guard || n === undefined) ? 1 : Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_1__["default"])(n);
  120706. n = length - n;
  120707. return Object(_baseSlice_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, n < 0 ? 0 : n, length);
  120708. }
  120709. /* harmony default export */ __webpack_exports__["default"] = (takeRight);
  120710. /***/ }),
  120711. /***/ "./node_modules/lodash-es/takeRightWhile.js":
  120712. /*!**************************************************!*\
  120713. !*** ./node_modules/lodash-es/takeRightWhile.js ***!
  120714. \**************************************************/
  120715. /*! exports provided: default */
  120716. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  120717. "use strict";
  120718. __webpack_require__.r(__webpack_exports__);
  120719. /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
  120720. /* harmony import */ var _baseWhile_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseWhile.js */ "./node_modules/lodash-es/_baseWhile.js");
  120721. /**
  120722. * Creates a slice of `array` with elements taken from the end. Elements are
  120723. * taken until `predicate` returns falsey. The predicate is invoked with
  120724. * three arguments: (value, index, array).
  120725. *
  120726. * @static
  120727. * @memberOf _
  120728. * @since 3.0.0
  120729. * @category Array
  120730. * @param {Array} array The array to query.
  120731. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  120732. * @returns {Array} Returns the slice of `array`.
  120733. * @example
  120734. *
  120735. * var users = [
  120736. * { 'user': 'barney', 'active': true },
  120737. * { 'user': 'fred', 'active': false },
  120738. * { 'user': 'pebbles', 'active': false }
  120739. * ];
  120740. *
  120741. * _.takeRightWhile(users, function(o) { return !o.active; });
  120742. * // => objects for ['fred', 'pebbles']
  120743. *
  120744. * // The `_.matches` iteratee shorthand.
  120745. * _.takeRightWhile(users, { 'user': 'pebbles', 'active': false });
  120746. * // => objects for ['pebbles']
  120747. *
  120748. * // The `_.matchesProperty` iteratee shorthand.
  120749. * _.takeRightWhile(users, ['active', false]);
  120750. * // => objects for ['fred', 'pebbles']
  120751. *
  120752. * // The `_.property` iteratee shorthand.
  120753. * _.takeRightWhile(users, 'active');
  120754. * // => []
  120755. */
  120756. function takeRightWhile(array, predicate) {
  120757. return (array && array.length)
  120758. ? Object(_baseWhile_js__WEBPACK_IMPORTED_MODULE_1__["default"])(array, Object(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_0__["default"])(predicate, 3), false, true)
  120759. : [];
  120760. }
  120761. /* harmony default export */ __webpack_exports__["default"] = (takeRightWhile);
  120762. /***/ }),
  120763. /***/ "./node_modules/lodash-es/takeWhile.js":
  120764. /*!*********************************************!*\
  120765. !*** ./node_modules/lodash-es/takeWhile.js ***!
  120766. \*********************************************/
  120767. /*! exports provided: default */
  120768. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  120769. "use strict";
  120770. __webpack_require__.r(__webpack_exports__);
  120771. /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
  120772. /* harmony import */ var _baseWhile_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseWhile.js */ "./node_modules/lodash-es/_baseWhile.js");
  120773. /**
  120774. * Creates a slice of `array` with elements taken from the beginning. Elements
  120775. * are taken until `predicate` returns falsey. The predicate is invoked with
  120776. * three arguments: (value, index, array).
  120777. *
  120778. * @static
  120779. * @memberOf _
  120780. * @since 3.0.0
  120781. * @category Array
  120782. * @param {Array} array The array to query.
  120783. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  120784. * @returns {Array} Returns the slice of `array`.
  120785. * @example
  120786. *
  120787. * var users = [
  120788. * { 'user': 'barney', 'active': false },
  120789. * { 'user': 'fred', 'active': false },
  120790. * { 'user': 'pebbles', 'active': true }
  120791. * ];
  120792. *
  120793. * _.takeWhile(users, function(o) { return !o.active; });
  120794. * // => objects for ['barney', 'fred']
  120795. *
  120796. * // The `_.matches` iteratee shorthand.
  120797. * _.takeWhile(users, { 'user': 'barney', 'active': false });
  120798. * // => objects for ['barney']
  120799. *
  120800. * // The `_.matchesProperty` iteratee shorthand.
  120801. * _.takeWhile(users, ['active', false]);
  120802. * // => objects for ['barney', 'fred']
  120803. *
  120804. * // The `_.property` iteratee shorthand.
  120805. * _.takeWhile(users, 'active');
  120806. * // => []
  120807. */
  120808. function takeWhile(array, predicate) {
  120809. return (array && array.length)
  120810. ? Object(_baseWhile_js__WEBPACK_IMPORTED_MODULE_1__["default"])(array, Object(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_0__["default"])(predicate, 3))
  120811. : [];
  120812. }
  120813. /* harmony default export */ __webpack_exports__["default"] = (takeWhile);
  120814. /***/ }),
  120815. /***/ "./node_modules/lodash-es/tap.js":
  120816. /*!***************************************!*\
  120817. !*** ./node_modules/lodash-es/tap.js ***!
  120818. \***************************************/
  120819. /*! exports provided: default */
  120820. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  120821. "use strict";
  120822. __webpack_require__.r(__webpack_exports__);
  120823. /**
  120824. * This method invokes `interceptor` and returns `value`. The interceptor
  120825. * is invoked with one argument; (value). The purpose of this method is to
  120826. * "tap into" a method chain sequence in order to modify intermediate results.
  120827. *
  120828. * @static
  120829. * @memberOf _
  120830. * @since 0.1.0
  120831. * @category Seq
  120832. * @param {*} value The value to provide to `interceptor`.
  120833. * @param {Function} interceptor The function to invoke.
  120834. * @returns {*} Returns `value`.
  120835. * @example
  120836. *
  120837. * _([1, 2, 3])
  120838. * .tap(function(array) {
  120839. * // Mutate input array.
  120840. * array.pop();
  120841. * })
  120842. * .reverse()
  120843. * .value();
  120844. * // => [2, 1]
  120845. */
  120846. function tap(value, interceptor) {
  120847. interceptor(value);
  120848. return value;
  120849. }
  120850. /* harmony default export */ __webpack_exports__["default"] = (tap);
  120851. /***/ }),
  120852. /***/ "./node_modules/lodash-es/template.js":
  120853. /*!********************************************!*\
  120854. !*** ./node_modules/lodash-es/template.js ***!
  120855. \********************************************/
  120856. /*! exports provided: default */
  120857. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  120858. "use strict";
  120859. __webpack_require__.r(__webpack_exports__);
  120860. /* harmony import */ var _assignInWith_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./assignInWith.js */ "./node_modules/lodash-es/assignInWith.js");
  120861. /* harmony import */ var _attempt_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./attempt.js */ "./node_modules/lodash-es/attempt.js");
  120862. /* harmony import */ var _baseValues_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseValues.js */ "./node_modules/lodash-es/_baseValues.js");
  120863. /* harmony import */ var _customDefaultsAssignIn_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_customDefaultsAssignIn.js */ "./node_modules/lodash-es/_customDefaultsAssignIn.js");
  120864. /* harmony import */ var _escapeStringChar_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_escapeStringChar.js */ "./node_modules/lodash-es/_escapeStringChar.js");
  120865. /* harmony import */ var _isError_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./isError.js */ "./node_modules/lodash-es/isError.js");
  120866. /* harmony import */ var _isIterateeCall_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./_isIterateeCall.js */ "./node_modules/lodash-es/_isIterateeCall.js");
  120867. /* harmony import */ var _keys_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./keys.js */ "./node_modules/lodash-es/keys.js");
  120868. /* harmony import */ var _reInterpolate_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./_reInterpolate.js */ "./node_modules/lodash-es/_reInterpolate.js");
  120869. /* harmony import */ var _templateSettings_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./templateSettings.js */ "./node_modules/lodash-es/templateSettings.js");
  120870. /* harmony import */ var _toString_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./toString.js */ "./node_modules/lodash-es/toString.js");
  120871. /** Error message constants. */
  120872. var INVALID_TEMPL_VAR_ERROR_TEXT = 'Invalid `variable` option passed into `_.template`';
  120873. /** Used to match empty string literals in compiled template source. */
  120874. var reEmptyStringLeading = /\b__p \+= '';/g,
  120875. reEmptyStringMiddle = /\b(__p \+=) '' \+/g,
  120876. reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g;
  120877. /**
  120878. * Used to validate the `validate` option in `_.template` variable.
  120879. *
  120880. * Forbids characters which could potentially change the meaning of the function argument definition:
  120881. * - "()," (modification of function parameters)
  120882. * - "=" (default value)
  120883. * - "[]{}" (destructuring of function parameters)
  120884. * - "/" (beginning of a comment)
  120885. * - whitespace
  120886. */
  120887. var reForbiddenIdentifierChars = /[()=,{}\[\]\/\s]/;
  120888. /**
  120889. * Used to match
  120890. * [ES template delimiters](http://ecma-international.org/ecma-262/7.0/#sec-template-literal-lexical-components).
  120891. */
  120892. var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;
  120893. /** Used to ensure capturing order of template delimiters. */
  120894. var reNoMatch = /($^)/;
  120895. /** Used to match unescaped characters in compiled string literals. */
  120896. var reUnescapedString = /['\n\r\u2028\u2029\\]/g;
  120897. /** Used for built-in method references. */
  120898. var objectProto = Object.prototype;
  120899. /** Used to check objects for own properties. */
  120900. var hasOwnProperty = objectProto.hasOwnProperty;
  120901. /**
  120902. * Creates a compiled template function that can interpolate data properties
  120903. * in "interpolate" delimiters, HTML-escape interpolated data properties in
  120904. * "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data
  120905. * properties may be accessed as free variables in the template. If a setting
  120906. * object is given, it takes precedence over `_.templateSettings` values.
  120907. *
  120908. * **Note:** In the development build `_.template` utilizes
  120909. * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl)
  120910. * for easier debugging.
  120911. *
  120912. * For more information on precompiling templates see
  120913. * [lodash's custom builds documentation](https://lodash.com/custom-builds).
  120914. *
  120915. * For more information on Chrome extension sandboxes see
  120916. * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval).
  120917. *
  120918. * @static
  120919. * @since 0.1.0
  120920. * @memberOf _
  120921. * @category String
  120922. * @param {string} [string=''] The template string.
  120923. * @param {Object} [options={}] The options object.
  120924. * @param {RegExp} [options.escape=_.templateSettings.escape]
  120925. * The HTML "escape" delimiter.
  120926. * @param {RegExp} [options.evaluate=_.templateSettings.evaluate]
  120927. * The "evaluate" delimiter.
  120928. * @param {Object} [options.imports=_.templateSettings.imports]
  120929. * An object to import into the template as free variables.
  120930. * @param {RegExp} [options.interpolate=_.templateSettings.interpolate]
  120931. * The "interpolate" delimiter.
  120932. * @param {string} [options.sourceURL='templateSources[n]']
  120933. * The sourceURL of the compiled template.
  120934. * @param {string} [options.variable='obj']
  120935. * The data object variable name.
  120936. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  120937. * @returns {Function} Returns the compiled template function.
  120938. * @example
  120939. *
  120940. * // Use the "interpolate" delimiter to create a compiled template.
  120941. * var compiled = _.template('hello <%= user %>!');
  120942. * compiled({ 'user': 'fred' });
  120943. * // => 'hello fred!'
  120944. *
  120945. * // Use the HTML "escape" delimiter to escape data property values.
  120946. * var compiled = _.template('<b><%- value %></b>');
  120947. * compiled({ 'value': '<script>' });
  120948. * // => '<b>&lt;script&gt;</b>'
  120949. *
  120950. * // Use the "evaluate" delimiter to execute JavaScript and generate HTML.
  120951. * var compiled = _.template('<% _.forEach(users, function(user) { %><li><%- user %></li><% }); %>');
  120952. * compiled({ 'users': ['fred', 'barney'] });
  120953. * // => '<li>fred</li><li>barney</li>'
  120954. *
  120955. * // Use the internal `print` function in "evaluate" delimiters.
  120956. * var compiled = _.template('<% print("hello " + user); %>!');
  120957. * compiled({ 'user': 'barney' });
  120958. * // => 'hello barney!'
  120959. *
  120960. * // Use the ES template literal delimiter as an "interpolate" delimiter.
  120961. * // Disable support by replacing the "interpolate" delimiter.
  120962. * var compiled = _.template('hello ${ user }!');
  120963. * compiled({ 'user': 'pebbles' });
  120964. * // => 'hello pebbles!'
  120965. *
  120966. * // Use backslashes to treat delimiters as plain text.
  120967. * var compiled = _.template('<%= "\\<%- value %\\>" %>');
  120968. * compiled({ 'value': 'ignored' });
  120969. * // => '<%- value %>'
  120970. *
  120971. * // Use the `imports` option to import `jQuery` as `jq`.
  120972. * var text = '<% jq.each(users, function(user) { %><li><%- user %></li><% }); %>';
  120973. * var compiled = _.template(text, { 'imports': { 'jq': jQuery } });
  120974. * compiled({ 'users': ['fred', 'barney'] });
  120975. * // => '<li>fred</li><li>barney</li>'
  120976. *
  120977. * // Use the `sourceURL` option to specify a custom sourceURL for the template.
  120978. * var compiled = _.template('hello <%= user %>!', { 'sourceURL': '/basic/greeting.jst' });
  120979. * compiled(data);
  120980. * // => Find the source of "greeting.jst" under the Sources tab or Resources panel of the web inspector.
  120981. *
  120982. * // Use the `variable` option to ensure a with-statement isn't used in the compiled template.
  120983. * var compiled = _.template('hi <%= data.user %>!', { 'variable': 'data' });
  120984. * compiled.source;
  120985. * // => function(data) {
  120986. * // var __t, __p = '';
  120987. * // __p += 'hi ' + ((__t = ( data.user )) == null ? '' : __t) + '!';
  120988. * // return __p;
  120989. * // }
  120990. *
  120991. * // Use custom template delimiters.
  120992. * _.templateSettings.interpolate = /{{([\s\S]+?)}}/g;
  120993. * var compiled = _.template('hello {{ user }}!');
  120994. * compiled({ 'user': 'mustache' });
  120995. * // => 'hello mustache!'
  120996. *
  120997. * // Use the `source` property to inline compiled templates for meaningful
  120998. * // line numbers in error messages and stack traces.
  120999. * fs.writeFileSync(path.join(process.cwd(), 'jst.js'), '\
  121000. * var JST = {\
  121001. * "main": ' + _.template(mainText).source + '\
  121002. * };\
  121003. * ');
  121004. */
  121005. function template(string, options, guard) {
  121006. // Based on John Resig's `tmpl` implementation
  121007. // (http://ejohn.org/blog/javascript-micro-templating/)
  121008. // and Laura Doktorova's doT.js (https://github.com/olado/doT).
  121009. var settings = _templateSettings_js__WEBPACK_IMPORTED_MODULE_9__["default"].imports._.templateSettings || _templateSettings_js__WEBPACK_IMPORTED_MODULE_9__["default"];
  121010. if (guard && Object(_isIterateeCall_js__WEBPACK_IMPORTED_MODULE_6__["default"])(string, options, guard)) {
  121011. options = undefined;
  121012. }
  121013. string = Object(_toString_js__WEBPACK_IMPORTED_MODULE_10__["default"])(string);
  121014. options = Object(_assignInWith_js__WEBPACK_IMPORTED_MODULE_0__["default"])({}, options, settings, _customDefaultsAssignIn_js__WEBPACK_IMPORTED_MODULE_3__["default"]);
  121015. var imports = Object(_assignInWith_js__WEBPACK_IMPORTED_MODULE_0__["default"])({}, options.imports, settings.imports, _customDefaultsAssignIn_js__WEBPACK_IMPORTED_MODULE_3__["default"]),
  121016. importsKeys = Object(_keys_js__WEBPACK_IMPORTED_MODULE_7__["default"])(imports),
  121017. importsValues = Object(_baseValues_js__WEBPACK_IMPORTED_MODULE_2__["default"])(imports, importsKeys);
  121018. var isEscaping,
  121019. isEvaluating,
  121020. index = 0,
  121021. interpolate = options.interpolate || reNoMatch,
  121022. source = "__p += '";
  121023. // Compile the regexp to match each delimiter.
  121024. var reDelimiters = RegExp(
  121025. (options.escape || reNoMatch).source + '|' +
  121026. interpolate.source + '|' +
  121027. (interpolate === _reInterpolate_js__WEBPACK_IMPORTED_MODULE_8__["default"] ? reEsTemplate : reNoMatch).source + '|' +
  121028. (options.evaluate || reNoMatch).source + '|$'
  121029. , 'g');
  121030. // Use a sourceURL for easier debugging.
  121031. // The sourceURL gets injected into the source that's eval-ed, so be careful
  121032. // to normalize all kinds of whitespace, so e.g. newlines (and unicode versions of it) can't sneak in
  121033. // and escape the comment, thus injecting code that gets evaled.
  121034. var sourceURL = hasOwnProperty.call(options, 'sourceURL')
  121035. ? ('//# sourceURL=' +
  121036. (options.sourceURL + '').replace(/\s/g, ' ') +
  121037. '\n')
  121038. : '';
  121039. string.replace(reDelimiters, function(match, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset) {
  121040. interpolateValue || (interpolateValue = esTemplateValue);
  121041. // Escape characters that can't be included in string literals.
  121042. source += string.slice(index, offset).replace(reUnescapedString, _escapeStringChar_js__WEBPACK_IMPORTED_MODULE_4__["default"]);
  121043. // Replace delimiters with snippets.
  121044. if (escapeValue) {
  121045. isEscaping = true;
  121046. source += "' +\n__e(" + escapeValue + ") +\n'";
  121047. }
  121048. if (evaluateValue) {
  121049. isEvaluating = true;
  121050. source += "';\n" + evaluateValue + ";\n__p += '";
  121051. }
  121052. if (interpolateValue) {
  121053. source += "' +\n((__t = (" + interpolateValue + ")) == null ? '' : __t) +\n'";
  121054. }
  121055. index = offset + match.length;
  121056. // The JS engine embedded in Adobe products needs `match` returned in
  121057. // order to produce the correct `offset` value.
  121058. return match;
  121059. });
  121060. source += "';\n";
  121061. // If `variable` is not specified wrap a with-statement around the generated
  121062. // code to add the data object to the top of the scope chain.
  121063. var variable = hasOwnProperty.call(options, 'variable') && options.variable;
  121064. if (!variable) {
  121065. source = 'with (obj) {\n' + source + '\n}\n';
  121066. }
  121067. // Throw an error if a forbidden character was found in `variable`, to prevent
  121068. // potential command injection attacks.
  121069. else if (reForbiddenIdentifierChars.test(variable)) {
  121070. throw new Error(INVALID_TEMPL_VAR_ERROR_TEXT);
  121071. }
  121072. // Cleanup code by stripping empty strings.
  121073. source = (isEvaluating ? source.replace(reEmptyStringLeading, '') : source)
  121074. .replace(reEmptyStringMiddle, '$1')
  121075. .replace(reEmptyStringTrailing, '$1;');
  121076. // Frame code as the function body.
  121077. source = 'function(' + (variable || 'obj') + ') {\n' +
  121078. (variable
  121079. ? ''
  121080. : 'obj || (obj = {});\n'
  121081. ) +
  121082. "var __t, __p = ''" +
  121083. (isEscaping
  121084. ? ', __e = _.escape'
  121085. : ''
  121086. ) +
  121087. (isEvaluating
  121088. ? ', __j = Array.prototype.join;\n' +
  121089. "function print() { __p += __j.call(arguments, '') }\n"
  121090. : ';\n'
  121091. ) +
  121092. source +
  121093. 'return __p\n}';
  121094. var result = Object(_attempt_js__WEBPACK_IMPORTED_MODULE_1__["default"])(function() {
  121095. return Function(importsKeys, sourceURL + 'return ' + source)
  121096. .apply(undefined, importsValues);
  121097. });
  121098. // Provide the compiled function's source by its `toString` method or
  121099. // the `source` property as a convenience for inlining compiled templates.
  121100. result.source = source;
  121101. if (Object(_isError_js__WEBPACK_IMPORTED_MODULE_5__["default"])(result)) {
  121102. throw result;
  121103. }
  121104. return result;
  121105. }
  121106. /* harmony default export */ __webpack_exports__["default"] = (template);
  121107. /***/ }),
  121108. /***/ "./node_modules/lodash-es/templateSettings.js":
  121109. /*!****************************************************!*\
  121110. !*** ./node_modules/lodash-es/templateSettings.js ***!
  121111. \****************************************************/
  121112. /*! exports provided: default */
  121113. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  121114. "use strict";
  121115. __webpack_require__.r(__webpack_exports__);
  121116. /* harmony import */ var _escape_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./escape.js */ "./node_modules/lodash-es/escape.js");
  121117. /* harmony import */ var _reEscape_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_reEscape.js */ "./node_modules/lodash-es/_reEscape.js");
  121118. /* harmony import */ var _reEvaluate_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_reEvaluate.js */ "./node_modules/lodash-es/_reEvaluate.js");
  121119. /* harmony import */ var _reInterpolate_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_reInterpolate.js */ "./node_modules/lodash-es/_reInterpolate.js");
  121120. /**
  121121. * By default, the template delimiters used by lodash are like those in
  121122. * embedded Ruby (ERB) as well as ES2015 template strings. Change the
  121123. * following template settings to use alternative delimiters.
  121124. *
  121125. * @static
  121126. * @memberOf _
  121127. * @type {Object}
  121128. */
  121129. var templateSettings = {
  121130. /**
  121131. * Used to detect `data` property values to be HTML-escaped.
  121132. *
  121133. * @memberOf _.templateSettings
  121134. * @type {RegExp}
  121135. */
  121136. 'escape': _reEscape_js__WEBPACK_IMPORTED_MODULE_1__["default"],
  121137. /**
  121138. * Used to detect code to be evaluated.
  121139. *
  121140. * @memberOf _.templateSettings
  121141. * @type {RegExp}
  121142. */
  121143. 'evaluate': _reEvaluate_js__WEBPACK_IMPORTED_MODULE_2__["default"],
  121144. /**
  121145. * Used to detect `data` property values to inject.
  121146. *
  121147. * @memberOf _.templateSettings
  121148. * @type {RegExp}
  121149. */
  121150. 'interpolate': _reInterpolate_js__WEBPACK_IMPORTED_MODULE_3__["default"],
  121151. /**
  121152. * Used to reference the data object in the template text.
  121153. *
  121154. * @memberOf _.templateSettings
  121155. * @type {string}
  121156. */
  121157. 'variable': '',
  121158. /**
  121159. * Used to import variables into the compiled template.
  121160. *
  121161. * @memberOf _.templateSettings
  121162. * @type {Object}
  121163. */
  121164. 'imports': {
  121165. /**
  121166. * A reference to the `lodash` function.
  121167. *
  121168. * @memberOf _.templateSettings.imports
  121169. * @type {Function}
  121170. */
  121171. '_': { 'escape': _escape_js__WEBPACK_IMPORTED_MODULE_0__["default"] }
  121172. }
  121173. };
  121174. /* harmony default export */ __webpack_exports__["default"] = (templateSettings);
  121175. /***/ }),
  121176. /***/ "./node_modules/lodash-es/throttle.js":
  121177. /*!********************************************!*\
  121178. !*** ./node_modules/lodash-es/throttle.js ***!
  121179. \********************************************/
  121180. /*! exports provided: default */
  121181. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  121182. "use strict";
  121183. __webpack_require__.r(__webpack_exports__);
  121184. /* harmony import */ var _debounce_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./debounce.js */ "./node_modules/lodash-es/debounce.js");
  121185. /* harmony import */ var _isObject_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isObject.js */ "./node_modules/lodash-es/isObject.js");
  121186. /** Error message constants. */
  121187. var FUNC_ERROR_TEXT = 'Expected a function';
  121188. /**
  121189. * Creates a throttled function that only invokes `func` at most once per
  121190. * every `wait` milliseconds. The throttled function comes with a `cancel`
  121191. * method to cancel delayed `func` invocations and a `flush` method to
  121192. * immediately invoke them. Provide `options` to indicate whether `func`
  121193. * should be invoked on the leading and/or trailing edge of the `wait`
  121194. * timeout. The `func` is invoked with the last arguments provided to the
  121195. * throttled function. Subsequent calls to the throttled function return the
  121196. * result of the last `func` invocation.
  121197. *
  121198. * **Note:** If `leading` and `trailing` options are `true`, `func` is
  121199. * invoked on the trailing edge of the timeout only if the throttled function
  121200. * is invoked more than once during the `wait` timeout.
  121201. *
  121202. * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
  121203. * until to the next tick, similar to `setTimeout` with a timeout of `0`.
  121204. *
  121205. * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
  121206. * for details over the differences between `_.throttle` and `_.debounce`.
  121207. *
  121208. * @static
  121209. * @memberOf _
  121210. * @since 0.1.0
  121211. * @category Function
  121212. * @param {Function} func The function to throttle.
  121213. * @param {number} [wait=0] The number of milliseconds to throttle invocations to.
  121214. * @param {Object} [options={}] The options object.
  121215. * @param {boolean} [options.leading=true]
  121216. * Specify invoking on the leading edge of the timeout.
  121217. * @param {boolean} [options.trailing=true]
  121218. * Specify invoking on the trailing edge of the timeout.
  121219. * @returns {Function} Returns the new throttled function.
  121220. * @example
  121221. *
  121222. * // Avoid excessively updating the position while scrolling.
  121223. * jQuery(window).on('scroll', _.throttle(updatePosition, 100));
  121224. *
  121225. * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.
  121226. * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });
  121227. * jQuery(element).on('click', throttled);
  121228. *
  121229. * // Cancel the trailing throttled invocation.
  121230. * jQuery(window).on('popstate', throttled.cancel);
  121231. */
  121232. function throttle(func, wait, options) {
  121233. var leading = true,
  121234. trailing = true;
  121235. if (typeof func != 'function') {
  121236. throw new TypeError(FUNC_ERROR_TEXT);
  121237. }
  121238. if (Object(_isObject_js__WEBPACK_IMPORTED_MODULE_1__["default"])(options)) {
  121239. leading = 'leading' in options ? !!options.leading : leading;
  121240. trailing = 'trailing' in options ? !!options.trailing : trailing;
  121241. }
  121242. return Object(_debounce_js__WEBPACK_IMPORTED_MODULE_0__["default"])(func, wait, {
  121243. 'leading': leading,
  121244. 'maxWait': wait,
  121245. 'trailing': trailing
  121246. });
  121247. }
  121248. /* harmony default export */ __webpack_exports__["default"] = (throttle);
  121249. /***/ }),
  121250. /***/ "./node_modules/lodash-es/thru.js":
  121251. /*!****************************************!*\
  121252. !*** ./node_modules/lodash-es/thru.js ***!
  121253. \****************************************/
  121254. /*! exports provided: default */
  121255. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  121256. "use strict";
  121257. __webpack_require__.r(__webpack_exports__);
  121258. /**
  121259. * This method is like `_.tap` except that it returns the result of `interceptor`.
  121260. * The purpose of this method is to "pass thru" values replacing intermediate
  121261. * results in a method chain sequence.
  121262. *
  121263. * @static
  121264. * @memberOf _
  121265. * @since 3.0.0
  121266. * @category Seq
  121267. * @param {*} value The value to provide to `interceptor`.
  121268. * @param {Function} interceptor The function to invoke.
  121269. * @returns {*} Returns the result of `interceptor`.
  121270. * @example
  121271. *
  121272. * _(' abc ')
  121273. * .chain()
  121274. * .trim()
  121275. * .thru(function(value) {
  121276. * return [value];
  121277. * })
  121278. * .value();
  121279. * // => ['abc']
  121280. */
  121281. function thru(value, interceptor) {
  121282. return interceptor(value);
  121283. }
  121284. /* harmony default export */ __webpack_exports__["default"] = (thru);
  121285. /***/ }),
  121286. /***/ "./node_modules/lodash-es/times.js":
  121287. /*!*****************************************!*\
  121288. !*** ./node_modules/lodash-es/times.js ***!
  121289. \*****************************************/
  121290. /*! exports provided: default */
  121291. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  121292. "use strict";
  121293. __webpack_require__.r(__webpack_exports__);
  121294. /* harmony import */ var _baseTimes_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseTimes.js */ "./node_modules/lodash-es/_baseTimes.js");
  121295. /* harmony import */ var _castFunction_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_castFunction.js */ "./node_modules/lodash-es/_castFunction.js");
  121296. /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
  121297. /** Used as references for various `Number` constants. */
  121298. var MAX_SAFE_INTEGER = 9007199254740991;
  121299. /** Used as references for the maximum length and index of an array. */
  121300. var MAX_ARRAY_LENGTH = 4294967295;
  121301. /* Built-in method references for those with the same name as other `lodash` methods. */
  121302. var nativeMin = Math.min;
  121303. /**
  121304. * Invokes the iteratee `n` times, returning an array of the results of
  121305. * each invocation. The iteratee is invoked with one argument; (index).
  121306. *
  121307. * @static
  121308. * @since 0.1.0
  121309. * @memberOf _
  121310. * @category Util
  121311. * @param {number} n The number of times to invoke `iteratee`.
  121312. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  121313. * @returns {Array} Returns the array of results.
  121314. * @example
  121315. *
  121316. * _.times(3, String);
  121317. * // => ['0', '1', '2']
  121318. *
  121319. * _.times(4, _.constant(0));
  121320. * // => [0, 0, 0, 0]
  121321. */
  121322. function times(n, iteratee) {
  121323. n = Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_2__["default"])(n);
  121324. if (n < 1 || n > MAX_SAFE_INTEGER) {
  121325. return [];
  121326. }
  121327. var index = MAX_ARRAY_LENGTH,
  121328. length = nativeMin(n, MAX_ARRAY_LENGTH);
  121329. iteratee = Object(_castFunction_js__WEBPACK_IMPORTED_MODULE_1__["default"])(iteratee);
  121330. n -= MAX_ARRAY_LENGTH;
  121331. var result = Object(_baseTimes_js__WEBPACK_IMPORTED_MODULE_0__["default"])(length, iteratee);
  121332. while (++index < n) {
  121333. iteratee(index);
  121334. }
  121335. return result;
  121336. }
  121337. /* harmony default export */ __webpack_exports__["default"] = (times);
  121338. /***/ }),
  121339. /***/ "./node_modules/lodash-es/toArray.js":
  121340. /*!*******************************************!*\
  121341. !*** ./node_modules/lodash-es/toArray.js ***!
  121342. \*******************************************/
  121343. /*! exports provided: default */
  121344. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  121345. "use strict";
  121346. __webpack_require__.r(__webpack_exports__);
  121347. /* harmony import */ var _Symbol_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_Symbol.js */ "./node_modules/lodash-es/_Symbol.js");
  121348. /* harmony import */ var _copyArray_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_copyArray.js */ "./node_modules/lodash-es/_copyArray.js");
  121349. /* harmony import */ var _getTag_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_getTag.js */ "./node_modules/lodash-es/_getTag.js");
  121350. /* harmony import */ var _isArrayLike_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./isArrayLike.js */ "./node_modules/lodash-es/isArrayLike.js");
  121351. /* harmony import */ var _isString_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./isString.js */ "./node_modules/lodash-es/isString.js");
  121352. /* harmony import */ var _iteratorToArray_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./_iteratorToArray.js */ "./node_modules/lodash-es/_iteratorToArray.js");
  121353. /* harmony import */ var _mapToArray_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./_mapToArray.js */ "./node_modules/lodash-es/_mapToArray.js");
  121354. /* harmony import */ var _setToArray_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./_setToArray.js */ "./node_modules/lodash-es/_setToArray.js");
  121355. /* harmony import */ var _stringToArray_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./_stringToArray.js */ "./node_modules/lodash-es/_stringToArray.js");
  121356. /* harmony import */ var _values_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./values.js */ "./node_modules/lodash-es/values.js");
  121357. /** `Object#toString` result references. */
  121358. var mapTag = '[object Map]',
  121359. setTag = '[object Set]';
  121360. /** Built-in value references. */
  121361. var symIterator = _Symbol_js__WEBPACK_IMPORTED_MODULE_0__["default"] ? _Symbol_js__WEBPACK_IMPORTED_MODULE_0__["default"].iterator : undefined;
  121362. /**
  121363. * Converts `value` to an array.
  121364. *
  121365. * @static
  121366. * @since 0.1.0
  121367. * @memberOf _
  121368. * @category Lang
  121369. * @param {*} value The value to convert.
  121370. * @returns {Array} Returns the converted array.
  121371. * @example
  121372. *
  121373. * _.toArray({ 'a': 1, 'b': 2 });
  121374. * // => [1, 2]
  121375. *
  121376. * _.toArray('abc');
  121377. * // => ['a', 'b', 'c']
  121378. *
  121379. * _.toArray(1);
  121380. * // => []
  121381. *
  121382. * _.toArray(null);
  121383. * // => []
  121384. */
  121385. function toArray(value) {
  121386. if (!value) {
  121387. return [];
  121388. }
  121389. if (Object(_isArrayLike_js__WEBPACK_IMPORTED_MODULE_3__["default"])(value)) {
  121390. 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);
  121391. }
  121392. if (symIterator && value[symIterator]) {
  121393. return Object(_iteratorToArray_js__WEBPACK_IMPORTED_MODULE_5__["default"])(value[symIterator]());
  121394. }
  121395. var tag = Object(_getTag_js__WEBPACK_IMPORTED_MODULE_2__["default"])(value),
  121396. 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"]);
  121397. return func(value);
  121398. }
  121399. /* harmony default export */ __webpack_exports__["default"] = (toArray);
  121400. /***/ }),
  121401. /***/ "./node_modules/lodash-es/toFinite.js":
  121402. /*!********************************************!*\
  121403. !*** ./node_modules/lodash-es/toFinite.js ***!
  121404. \********************************************/
  121405. /*! exports provided: default */
  121406. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  121407. "use strict";
  121408. __webpack_require__.r(__webpack_exports__);
  121409. /* harmony import */ var _toNumber_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./toNumber.js */ "./node_modules/lodash-es/toNumber.js");
  121410. /** Used as references for various `Number` constants. */
  121411. var INFINITY = 1 / 0,
  121412. MAX_INTEGER = 1.7976931348623157e+308;
  121413. /**
  121414. * Converts `value` to a finite number.
  121415. *
  121416. * @static
  121417. * @memberOf _
  121418. * @since 4.12.0
  121419. * @category Lang
  121420. * @param {*} value The value to convert.
  121421. * @returns {number} Returns the converted number.
  121422. * @example
  121423. *
  121424. * _.toFinite(3.2);
  121425. * // => 3.2
  121426. *
  121427. * _.toFinite(Number.MIN_VALUE);
  121428. * // => 5e-324
  121429. *
  121430. * _.toFinite(Infinity);
  121431. * // => 1.7976931348623157e+308
  121432. *
  121433. * _.toFinite('3.2');
  121434. * // => 3.2
  121435. */
  121436. function toFinite(value) {
  121437. if (!value) {
  121438. return value === 0 ? value : 0;
  121439. }
  121440. value = Object(_toNumber_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value);
  121441. if (value === INFINITY || value === -INFINITY) {
  121442. var sign = (value < 0 ? -1 : 1);
  121443. return sign * MAX_INTEGER;
  121444. }
  121445. return value === value ? value : 0;
  121446. }
  121447. /* harmony default export */ __webpack_exports__["default"] = (toFinite);
  121448. /***/ }),
  121449. /***/ "./node_modules/lodash-es/toInteger.js":
  121450. /*!*********************************************!*\
  121451. !*** ./node_modules/lodash-es/toInteger.js ***!
  121452. \*********************************************/
  121453. /*! exports provided: default */
  121454. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  121455. "use strict";
  121456. __webpack_require__.r(__webpack_exports__);
  121457. /* harmony import */ var _toFinite_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./toFinite.js */ "./node_modules/lodash-es/toFinite.js");
  121458. /**
  121459. * Converts `value` to an integer.
  121460. *
  121461. * **Note:** This method is loosely based on
  121462. * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).
  121463. *
  121464. * @static
  121465. * @memberOf _
  121466. * @since 4.0.0
  121467. * @category Lang
  121468. * @param {*} value The value to convert.
  121469. * @returns {number} Returns the converted integer.
  121470. * @example
  121471. *
  121472. * _.toInteger(3.2);
  121473. * // => 3
  121474. *
  121475. * _.toInteger(Number.MIN_VALUE);
  121476. * // => 0
  121477. *
  121478. * _.toInteger(Infinity);
  121479. * // => 1.7976931348623157e+308
  121480. *
  121481. * _.toInteger('3.2');
  121482. * // => 3
  121483. */
  121484. function toInteger(value) {
  121485. var result = Object(_toFinite_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value),
  121486. remainder = result % 1;
  121487. return result === result ? (remainder ? result - remainder : result) : 0;
  121488. }
  121489. /* harmony default export */ __webpack_exports__["default"] = (toInteger);
  121490. /***/ }),
  121491. /***/ "./node_modules/lodash-es/toIterator.js":
  121492. /*!**********************************************!*\
  121493. !*** ./node_modules/lodash-es/toIterator.js ***!
  121494. \**********************************************/
  121495. /*! exports provided: default */
  121496. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  121497. "use strict";
  121498. __webpack_require__.r(__webpack_exports__);
  121499. /**
  121500. * Enables the wrapper to be iterable.
  121501. *
  121502. * @name Symbol.iterator
  121503. * @memberOf _
  121504. * @since 4.0.0
  121505. * @category Seq
  121506. * @returns {Object} Returns the wrapper object.
  121507. * @example
  121508. *
  121509. * var wrapped = _([1, 2]);
  121510. *
  121511. * wrapped[Symbol.iterator]() === wrapped;
  121512. * // => true
  121513. *
  121514. * Array.from(wrapped);
  121515. * // => [1, 2]
  121516. */
  121517. function wrapperToIterator() {
  121518. return this;
  121519. }
  121520. /* harmony default export */ __webpack_exports__["default"] = (wrapperToIterator);
  121521. /***/ }),
  121522. /***/ "./node_modules/lodash-es/toJSON.js":
  121523. /*!******************************************!*\
  121524. !*** ./node_modules/lodash-es/toJSON.js ***!
  121525. \******************************************/
  121526. /*! exports provided: default */
  121527. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  121528. "use strict";
  121529. __webpack_require__.r(__webpack_exports__);
  121530. /* harmony import */ var _wrapperValue_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./wrapperValue.js */ "./node_modules/lodash-es/wrapperValue.js");
  121531. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _wrapperValue_js__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  121532. /***/ }),
  121533. /***/ "./node_modules/lodash-es/toLength.js":
  121534. /*!********************************************!*\
  121535. !*** ./node_modules/lodash-es/toLength.js ***!
  121536. \********************************************/
  121537. /*! exports provided: default */
  121538. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  121539. "use strict";
  121540. __webpack_require__.r(__webpack_exports__);
  121541. /* harmony import */ var _baseClamp_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseClamp.js */ "./node_modules/lodash-es/_baseClamp.js");
  121542. /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
  121543. /** Used as references for the maximum length and index of an array. */
  121544. var MAX_ARRAY_LENGTH = 4294967295;
  121545. /**
  121546. * Converts `value` to an integer suitable for use as the length of an
  121547. * array-like object.
  121548. *
  121549. * **Note:** This method is based on
  121550. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  121551. *
  121552. * @static
  121553. * @memberOf _
  121554. * @since 4.0.0
  121555. * @category Lang
  121556. * @param {*} value The value to convert.
  121557. * @returns {number} Returns the converted integer.
  121558. * @example
  121559. *
  121560. * _.toLength(3.2);
  121561. * // => 3
  121562. *
  121563. * _.toLength(Number.MIN_VALUE);
  121564. * // => 0
  121565. *
  121566. * _.toLength(Infinity);
  121567. * // => 4294967295
  121568. *
  121569. * _.toLength('3.2');
  121570. * // => 3
  121571. */
  121572. function toLength(value) {
  121573. return value ? Object(_baseClamp_js__WEBPACK_IMPORTED_MODULE_0__["default"])(Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value), 0, MAX_ARRAY_LENGTH) : 0;
  121574. }
  121575. /* harmony default export */ __webpack_exports__["default"] = (toLength);
  121576. /***/ }),
  121577. /***/ "./node_modules/lodash-es/toLower.js":
  121578. /*!*******************************************!*\
  121579. !*** ./node_modules/lodash-es/toLower.js ***!
  121580. \*******************************************/
  121581. /*! exports provided: default */
  121582. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  121583. "use strict";
  121584. __webpack_require__.r(__webpack_exports__);
  121585. /* harmony import */ var _toString_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./toString.js */ "./node_modules/lodash-es/toString.js");
  121586. /**
  121587. * Converts `string`, as a whole, to lower case just like
  121588. * [String#toLowerCase](https://mdn.io/toLowerCase).
  121589. *
  121590. * @static
  121591. * @memberOf _
  121592. * @since 4.0.0
  121593. * @category String
  121594. * @param {string} [string=''] The string to convert.
  121595. * @returns {string} Returns the lower cased string.
  121596. * @example
  121597. *
  121598. * _.toLower('--Foo-Bar--');
  121599. * // => '--foo-bar--'
  121600. *
  121601. * _.toLower('fooBar');
  121602. * // => 'foobar'
  121603. *
  121604. * _.toLower('__FOO_BAR__');
  121605. * // => '__foo_bar__'
  121606. */
  121607. function toLower(value) {
  121608. return Object(_toString_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value).toLowerCase();
  121609. }
  121610. /* harmony default export */ __webpack_exports__["default"] = (toLower);
  121611. /***/ }),
  121612. /***/ "./node_modules/lodash-es/toNumber.js":
  121613. /*!********************************************!*\
  121614. !*** ./node_modules/lodash-es/toNumber.js ***!
  121615. \********************************************/
  121616. /*! exports provided: default */
  121617. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  121618. "use strict";
  121619. __webpack_require__.r(__webpack_exports__);
  121620. /* harmony import */ var _baseTrim_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseTrim.js */ "./node_modules/lodash-es/_baseTrim.js");
  121621. /* harmony import */ var _isObject_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isObject.js */ "./node_modules/lodash-es/isObject.js");
  121622. /* harmony import */ var _isSymbol_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./isSymbol.js */ "./node_modules/lodash-es/isSymbol.js");
  121623. /** Used as references for various `Number` constants. */
  121624. var NAN = 0 / 0;
  121625. /** Used to detect bad signed hexadecimal string values. */
  121626. var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
  121627. /** Used to detect binary string values. */
  121628. var reIsBinary = /^0b[01]+$/i;
  121629. /** Used to detect octal string values. */
  121630. var reIsOctal = /^0o[0-7]+$/i;
  121631. /** Built-in method references without a dependency on `root`. */
  121632. var freeParseInt = parseInt;
  121633. /**
  121634. * Converts `value` to a number.
  121635. *
  121636. * @static
  121637. * @memberOf _
  121638. * @since 4.0.0
  121639. * @category Lang
  121640. * @param {*} value The value to process.
  121641. * @returns {number} Returns the number.
  121642. * @example
  121643. *
  121644. * _.toNumber(3.2);
  121645. * // => 3.2
  121646. *
  121647. * _.toNumber(Number.MIN_VALUE);
  121648. * // => 5e-324
  121649. *
  121650. * _.toNumber(Infinity);
  121651. * // => Infinity
  121652. *
  121653. * _.toNumber('3.2');
  121654. * // => 3.2
  121655. */
  121656. function toNumber(value) {
  121657. if (typeof value == 'number') {
  121658. return value;
  121659. }
  121660. if (Object(_isSymbol_js__WEBPACK_IMPORTED_MODULE_2__["default"])(value)) {
  121661. return NAN;
  121662. }
  121663. if (Object(_isObject_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value)) {
  121664. var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
  121665. value = Object(_isObject_js__WEBPACK_IMPORTED_MODULE_1__["default"])(other) ? (other + '') : other;
  121666. }
  121667. if (typeof value != 'string') {
  121668. return value === 0 ? value : +value;
  121669. }
  121670. value = Object(_baseTrim_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value);
  121671. var isBinary = reIsBinary.test(value);
  121672. return (isBinary || reIsOctal.test(value))
  121673. ? freeParseInt(value.slice(2), isBinary ? 2 : 8)
  121674. : (reIsBadHex.test(value) ? NAN : +value);
  121675. }
  121676. /* harmony default export */ __webpack_exports__["default"] = (toNumber);
  121677. /***/ }),
  121678. /***/ "./node_modules/lodash-es/toPairs.js":
  121679. /*!*******************************************!*\
  121680. !*** ./node_modules/lodash-es/toPairs.js ***!
  121681. \*******************************************/
  121682. /*! exports provided: default */
  121683. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  121684. "use strict";
  121685. __webpack_require__.r(__webpack_exports__);
  121686. /* harmony import */ var _createToPairs_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createToPairs.js */ "./node_modules/lodash-es/_createToPairs.js");
  121687. /* harmony import */ var _keys_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./keys.js */ "./node_modules/lodash-es/keys.js");
  121688. /**
  121689. * Creates an array of own enumerable string keyed-value pairs for `object`
  121690. * which can be consumed by `_.fromPairs`. If `object` is a map or set, its
  121691. * entries are returned.
  121692. *
  121693. * @static
  121694. * @memberOf _
  121695. * @since 4.0.0
  121696. * @alias entries
  121697. * @category Object
  121698. * @param {Object} object The object to query.
  121699. * @returns {Array} Returns the key-value pairs.
  121700. * @example
  121701. *
  121702. * function Foo() {
  121703. * this.a = 1;
  121704. * this.b = 2;
  121705. * }
  121706. *
  121707. * Foo.prototype.c = 3;
  121708. *
  121709. * _.toPairs(new Foo);
  121710. * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed)
  121711. */
  121712. var toPairs = Object(_createToPairs_js__WEBPACK_IMPORTED_MODULE_0__["default"])(_keys_js__WEBPACK_IMPORTED_MODULE_1__["default"]);
  121713. /* harmony default export */ __webpack_exports__["default"] = (toPairs);
  121714. /***/ }),
  121715. /***/ "./node_modules/lodash-es/toPairsIn.js":
  121716. /*!*********************************************!*\
  121717. !*** ./node_modules/lodash-es/toPairsIn.js ***!
  121718. \*********************************************/
  121719. /*! exports provided: default */
  121720. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  121721. "use strict";
  121722. __webpack_require__.r(__webpack_exports__);
  121723. /* harmony import */ var _createToPairs_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createToPairs.js */ "./node_modules/lodash-es/_createToPairs.js");
  121724. /* harmony import */ var _keysIn_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./keysIn.js */ "./node_modules/lodash-es/keysIn.js");
  121725. /**
  121726. * Creates an array of own and inherited enumerable string keyed-value pairs
  121727. * for `object` which can be consumed by `_.fromPairs`. If `object` is a map
  121728. * or set, its entries are returned.
  121729. *
  121730. * @static
  121731. * @memberOf _
  121732. * @since 4.0.0
  121733. * @alias entriesIn
  121734. * @category Object
  121735. * @param {Object} object The object to query.
  121736. * @returns {Array} Returns the key-value pairs.
  121737. * @example
  121738. *
  121739. * function Foo() {
  121740. * this.a = 1;
  121741. * this.b = 2;
  121742. * }
  121743. *
  121744. * Foo.prototype.c = 3;
  121745. *
  121746. * _.toPairsIn(new Foo);
  121747. * // => [['a', 1], ['b', 2], ['c', 3]] (iteration order is not guaranteed)
  121748. */
  121749. var toPairsIn = Object(_createToPairs_js__WEBPACK_IMPORTED_MODULE_0__["default"])(_keysIn_js__WEBPACK_IMPORTED_MODULE_1__["default"]);
  121750. /* harmony default export */ __webpack_exports__["default"] = (toPairsIn);
  121751. /***/ }),
  121752. /***/ "./node_modules/lodash-es/toPath.js":
  121753. /*!******************************************!*\
  121754. !*** ./node_modules/lodash-es/toPath.js ***!
  121755. \******************************************/
  121756. /*! exports provided: default */
  121757. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  121758. "use strict";
  121759. __webpack_require__.r(__webpack_exports__);
  121760. /* harmony import */ var _arrayMap_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayMap.js */ "./node_modules/lodash-es/_arrayMap.js");
  121761. /* harmony import */ var _copyArray_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_copyArray.js */ "./node_modules/lodash-es/_copyArray.js");
  121762. /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
  121763. /* harmony import */ var _isSymbol_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./isSymbol.js */ "./node_modules/lodash-es/isSymbol.js");
  121764. /* harmony import */ var _stringToPath_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_stringToPath.js */ "./node_modules/lodash-es/_stringToPath.js");
  121765. /* harmony import */ var _toKey_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./_toKey.js */ "./node_modules/lodash-es/_toKey.js");
  121766. /* harmony import */ var _toString_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./toString.js */ "./node_modules/lodash-es/toString.js");
  121767. /**
  121768. * Converts `value` to a property path array.
  121769. *
  121770. * @static
  121771. * @memberOf _
  121772. * @since 4.0.0
  121773. * @category Util
  121774. * @param {*} value The value to convert.
  121775. * @returns {Array} Returns the new property path array.
  121776. * @example
  121777. *
  121778. * _.toPath('a.b.c');
  121779. * // => ['a', 'b', 'c']
  121780. *
  121781. * _.toPath('a[0].b.c');
  121782. * // => ['a', '0', 'b', 'c']
  121783. */
  121784. function toPath(value) {
  121785. if (Object(_isArray_js__WEBPACK_IMPORTED_MODULE_2__["default"])(value)) {
  121786. return Object(_arrayMap_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value, _toKey_js__WEBPACK_IMPORTED_MODULE_5__["default"]);
  121787. }
  121788. 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)));
  121789. }
  121790. /* harmony default export */ __webpack_exports__["default"] = (toPath);
  121791. /***/ }),
  121792. /***/ "./node_modules/lodash-es/toPlainObject.js":
  121793. /*!*************************************************!*\
  121794. !*** ./node_modules/lodash-es/toPlainObject.js ***!
  121795. \*************************************************/
  121796. /*! exports provided: default */
  121797. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  121798. "use strict";
  121799. __webpack_require__.r(__webpack_exports__);
  121800. /* harmony import */ var _copyObject_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_copyObject.js */ "./node_modules/lodash-es/_copyObject.js");
  121801. /* harmony import */ var _keysIn_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./keysIn.js */ "./node_modules/lodash-es/keysIn.js");
  121802. /**
  121803. * Converts `value` to a plain object flattening inherited enumerable string
  121804. * keyed properties of `value` to own properties of the plain object.
  121805. *
  121806. * @static
  121807. * @memberOf _
  121808. * @since 3.0.0
  121809. * @category Lang
  121810. * @param {*} value The value to convert.
  121811. * @returns {Object} Returns the converted plain object.
  121812. * @example
  121813. *
  121814. * function Foo() {
  121815. * this.b = 2;
  121816. * }
  121817. *
  121818. * Foo.prototype.c = 3;
  121819. *
  121820. * _.assign({ 'a': 1 }, new Foo);
  121821. * // => { 'a': 1, 'b': 2 }
  121822. *
  121823. * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));
  121824. * // => { 'a': 1, 'b': 2, 'c': 3 }
  121825. */
  121826. function toPlainObject(value) {
  121827. return Object(_copyObject_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value, Object(_keysIn_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value));
  121828. }
  121829. /* harmony default export */ __webpack_exports__["default"] = (toPlainObject);
  121830. /***/ }),
  121831. /***/ "./node_modules/lodash-es/toSafeInteger.js":
  121832. /*!*************************************************!*\
  121833. !*** ./node_modules/lodash-es/toSafeInteger.js ***!
  121834. \*************************************************/
  121835. /*! exports provided: default */
  121836. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  121837. "use strict";
  121838. __webpack_require__.r(__webpack_exports__);
  121839. /* harmony import */ var _baseClamp_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseClamp.js */ "./node_modules/lodash-es/_baseClamp.js");
  121840. /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
  121841. /** Used as references for various `Number` constants. */
  121842. var MAX_SAFE_INTEGER = 9007199254740991;
  121843. /**
  121844. * Converts `value` to a safe integer. A safe integer can be compared and
  121845. * represented correctly.
  121846. *
  121847. * @static
  121848. * @memberOf _
  121849. * @since 4.0.0
  121850. * @category Lang
  121851. * @param {*} value The value to convert.
  121852. * @returns {number} Returns the converted integer.
  121853. * @example
  121854. *
  121855. * _.toSafeInteger(3.2);
  121856. * // => 3
  121857. *
  121858. * _.toSafeInteger(Number.MIN_VALUE);
  121859. * // => 0
  121860. *
  121861. * _.toSafeInteger(Infinity);
  121862. * // => 9007199254740991
  121863. *
  121864. * _.toSafeInteger('3.2');
  121865. * // => 3
  121866. */
  121867. function toSafeInteger(value) {
  121868. return value
  121869. ? Object(_baseClamp_js__WEBPACK_IMPORTED_MODULE_0__["default"])(Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER)
  121870. : (value === 0 ? value : 0);
  121871. }
  121872. /* harmony default export */ __webpack_exports__["default"] = (toSafeInteger);
  121873. /***/ }),
  121874. /***/ "./node_modules/lodash-es/toString.js":
  121875. /*!********************************************!*\
  121876. !*** ./node_modules/lodash-es/toString.js ***!
  121877. \********************************************/
  121878. /*! exports provided: default */
  121879. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  121880. "use strict";
  121881. __webpack_require__.r(__webpack_exports__);
  121882. /* harmony import */ var _baseToString_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseToString.js */ "./node_modules/lodash-es/_baseToString.js");
  121883. /**
  121884. * Converts `value` to a string. An empty string is returned for `null`
  121885. * and `undefined` values. The sign of `-0` is preserved.
  121886. *
  121887. * @static
  121888. * @memberOf _
  121889. * @since 4.0.0
  121890. * @category Lang
  121891. * @param {*} value The value to convert.
  121892. * @returns {string} Returns the converted string.
  121893. * @example
  121894. *
  121895. * _.toString(null);
  121896. * // => ''
  121897. *
  121898. * _.toString(-0);
  121899. * // => '-0'
  121900. *
  121901. * _.toString([1, 2, 3]);
  121902. * // => '1,2,3'
  121903. */
  121904. function toString(value) {
  121905. return value == null ? '' : Object(_baseToString_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value);
  121906. }
  121907. /* harmony default export */ __webpack_exports__["default"] = (toString);
  121908. /***/ }),
  121909. /***/ "./node_modules/lodash-es/toUpper.js":
  121910. /*!*******************************************!*\
  121911. !*** ./node_modules/lodash-es/toUpper.js ***!
  121912. \*******************************************/
  121913. /*! exports provided: default */
  121914. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  121915. "use strict";
  121916. __webpack_require__.r(__webpack_exports__);
  121917. /* harmony import */ var _toString_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./toString.js */ "./node_modules/lodash-es/toString.js");
  121918. /**
  121919. * Converts `string`, as a whole, to upper case just like
  121920. * [String#toUpperCase](https://mdn.io/toUpperCase).
  121921. *
  121922. * @static
  121923. * @memberOf _
  121924. * @since 4.0.0
  121925. * @category String
  121926. * @param {string} [string=''] The string to convert.
  121927. * @returns {string} Returns the upper cased string.
  121928. * @example
  121929. *
  121930. * _.toUpper('--foo-bar--');
  121931. * // => '--FOO-BAR--'
  121932. *
  121933. * _.toUpper('fooBar');
  121934. * // => 'FOOBAR'
  121935. *
  121936. * _.toUpper('__foo_bar__');
  121937. * // => '__FOO_BAR__'
  121938. */
  121939. function toUpper(value) {
  121940. return Object(_toString_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value).toUpperCase();
  121941. }
  121942. /* harmony default export */ __webpack_exports__["default"] = (toUpper);
  121943. /***/ }),
  121944. /***/ "./node_modules/lodash-es/transform.js":
  121945. /*!*********************************************!*\
  121946. !*** ./node_modules/lodash-es/transform.js ***!
  121947. \*********************************************/
  121948. /*! exports provided: default */
  121949. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  121950. "use strict";
  121951. __webpack_require__.r(__webpack_exports__);
  121952. /* harmony import */ var _arrayEach_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayEach.js */ "./node_modules/lodash-es/_arrayEach.js");
  121953. /* harmony import */ var _baseCreate_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseCreate.js */ "./node_modules/lodash-es/_baseCreate.js");
  121954. /* harmony import */ var _baseForOwn_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseForOwn.js */ "./node_modules/lodash-es/_baseForOwn.js");
  121955. /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
  121956. /* harmony import */ var _getPrototype_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_getPrototype.js */ "./node_modules/lodash-es/_getPrototype.js");
  121957. /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
  121958. /* harmony import */ var _isBuffer_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./isBuffer.js */ "./node_modules/lodash-es/isBuffer.js");
  121959. /* harmony import */ var _isFunction_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./isFunction.js */ "./node_modules/lodash-es/isFunction.js");
  121960. /* harmony import */ var _isObject_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./isObject.js */ "./node_modules/lodash-es/isObject.js");
  121961. /* harmony import */ var _isTypedArray_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./isTypedArray.js */ "./node_modules/lodash-es/isTypedArray.js");
  121962. /**
  121963. * An alternative to `_.reduce`; this method transforms `object` to a new
  121964. * `accumulator` object which is the result of running each of its own
  121965. * enumerable string keyed properties thru `iteratee`, with each invocation
  121966. * potentially mutating the `accumulator` object. If `accumulator` is not
  121967. * provided, a new object with the same `[[Prototype]]` will be used. The
  121968. * iteratee is invoked with four arguments: (accumulator, value, key, object).
  121969. * Iteratee functions may exit iteration early by explicitly returning `false`.
  121970. *
  121971. * @static
  121972. * @memberOf _
  121973. * @since 1.3.0
  121974. * @category Object
  121975. * @param {Object} object The object to iterate over.
  121976. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  121977. * @param {*} [accumulator] The custom accumulator value.
  121978. * @returns {*} Returns the accumulated value.
  121979. * @example
  121980. *
  121981. * _.transform([2, 3, 4], function(result, n) {
  121982. * result.push(n *= n);
  121983. * return n % 2 == 0;
  121984. * }, []);
  121985. * // => [4, 9]
  121986. *
  121987. * _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
  121988. * (result[value] || (result[value] = [])).push(key);
  121989. * }, {});
  121990. * // => { '1': ['a', 'c'], '2': ['b'] }
  121991. */
  121992. function transform(object, iteratee, accumulator) {
  121993. var isArr = Object(_isArray_js__WEBPACK_IMPORTED_MODULE_5__["default"])(object),
  121994. isArrLike = isArr || Object(_isBuffer_js__WEBPACK_IMPORTED_MODULE_6__["default"])(object) || Object(_isTypedArray_js__WEBPACK_IMPORTED_MODULE_9__["default"])(object);
  121995. iteratee = Object(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_3__["default"])(iteratee, 4);
  121996. if (accumulator == null) {
  121997. var Ctor = object && object.constructor;
  121998. if (isArrLike) {
  121999. accumulator = isArr ? new Ctor : [];
  122000. }
  122001. else if (Object(_isObject_js__WEBPACK_IMPORTED_MODULE_8__["default"])(object)) {
  122002. 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)) : {};
  122003. }
  122004. else {
  122005. accumulator = {};
  122006. }
  122007. }
  122008. (isArrLike ? _arrayEach_js__WEBPACK_IMPORTED_MODULE_0__["default"] : _baseForOwn_js__WEBPACK_IMPORTED_MODULE_2__["default"])(object, function(value, index, object) {
  122009. return iteratee(accumulator, value, index, object);
  122010. });
  122011. return accumulator;
  122012. }
  122013. /* harmony default export */ __webpack_exports__["default"] = (transform);
  122014. /***/ }),
  122015. /***/ "./node_modules/lodash-es/trim.js":
  122016. /*!****************************************!*\
  122017. !*** ./node_modules/lodash-es/trim.js ***!
  122018. \****************************************/
  122019. /*! exports provided: default */
  122020. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  122021. "use strict";
  122022. __webpack_require__.r(__webpack_exports__);
  122023. /* harmony import */ var _baseToString_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseToString.js */ "./node_modules/lodash-es/_baseToString.js");
  122024. /* harmony import */ var _baseTrim_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseTrim.js */ "./node_modules/lodash-es/_baseTrim.js");
  122025. /* harmony import */ var _castSlice_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_castSlice.js */ "./node_modules/lodash-es/_castSlice.js");
  122026. /* harmony import */ var _charsEndIndex_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_charsEndIndex.js */ "./node_modules/lodash-es/_charsEndIndex.js");
  122027. /* harmony import */ var _charsStartIndex_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_charsStartIndex.js */ "./node_modules/lodash-es/_charsStartIndex.js");
  122028. /* harmony import */ var _stringToArray_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./_stringToArray.js */ "./node_modules/lodash-es/_stringToArray.js");
  122029. /* harmony import */ var _toString_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./toString.js */ "./node_modules/lodash-es/toString.js");
  122030. /**
  122031. * Removes leading and trailing whitespace or specified characters from `string`.
  122032. *
  122033. * @static
  122034. * @memberOf _
  122035. * @since 3.0.0
  122036. * @category String
  122037. * @param {string} [string=''] The string to trim.
  122038. * @param {string} [chars=whitespace] The characters to trim.
  122039. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  122040. * @returns {string} Returns the trimmed string.
  122041. * @example
  122042. *
  122043. * _.trim(' abc ');
  122044. * // => 'abc'
  122045. *
  122046. * _.trim('-_-abc-_-', '_-');
  122047. * // => 'abc'
  122048. *
  122049. * _.map([' foo ', ' bar '], _.trim);
  122050. * // => ['foo', 'bar']
  122051. */
  122052. function trim(string, chars, guard) {
  122053. string = Object(_toString_js__WEBPACK_IMPORTED_MODULE_6__["default"])(string);
  122054. if (string && (guard || chars === undefined)) {
  122055. return Object(_baseTrim_js__WEBPACK_IMPORTED_MODULE_1__["default"])(string);
  122056. }
  122057. if (!string || !(chars = Object(_baseToString_js__WEBPACK_IMPORTED_MODULE_0__["default"])(chars))) {
  122058. return string;
  122059. }
  122060. var strSymbols = Object(_stringToArray_js__WEBPACK_IMPORTED_MODULE_5__["default"])(string),
  122061. chrSymbols = Object(_stringToArray_js__WEBPACK_IMPORTED_MODULE_5__["default"])(chars),
  122062. start = Object(_charsStartIndex_js__WEBPACK_IMPORTED_MODULE_4__["default"])(strSymbols, chrSymbols),
  122063. end = Object(_charsEndIndex_js__WEBPACK_IMPORTED_MODULE_3__["default"])(strSymbols, chrSymbols) + 1;
  122064. return Object(_castSlice_js__WEBPACK_IMPORTED_MODULE_2__["default"])(strSymbols, start, end).join('');
  122065. }
  122066. /* harmony default export */ __webpack_exports__["default"] = (trim);
  122067. /***/ }),
  122068. /***/ "./node_modules/lodash-es/trimEnd.js":
  122069. /*!*******************************************!*\
  122070. !*** ./node_modules/lodash-es/trimEnd.js ***!
  122071. \*******************************************/
  122072. /*! exports provided: default */
  122073. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  122074. "use strict";
  122075. __webpack_require__.r(__webpack_exports__);
  122076. /* harmony import */ var _baseToString_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseToString.js */ "./node_modules/lodash-es/_baseToString.js");
  122077. /* harmony import */ var _castSlice_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_castSlice.js */ "./node_modules/lodash-es/_castSlice.js");
  122078. /* harmony import */ var _charsEndIndex_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_charsEndIndex.js */ "./node_modules/lodash-es/_charsEndIndex.js");
  122079. /* harmony import */ var _stringToArray_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_stringToArray.js */ "./node_modules/lodash-es/_stringToArray.js");
  122080. /* harmony import */ var _toString_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./toString.js */ "./node_modules/lodash-es/toString.js");
  122081. /* harmony import */ var _trimmedEndIndex_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./_trimmedEndIndex.js */ "./node_modules/lodash-es/_trimmedEndIndex.js");
  122082. /**
  122083. * Removes trailing whitespace or specified characters from `string`.
  122084. *
  122085. * @static
  122086. * @memberOf _
  122087. * @since 4.0.0
  122088. * @category String
  122089. * @param {string} [string=''] The string to trim.
  122090. * @param {string} [chars=whitespace] The characters to trim.
  122091. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  122092. * @returns {string} Returns the trimmed string.
  122093. * @example
  122094. *
  122095. * _.trimEnd(' abc ');
  122096. * // => ' abc'
  122097. *
  122098. * _.trimEnd('-_-abc-_-', '_-');
  122099. * // => '-_-abc'
  122100. */
  122101. function trimEnd(string, chars, guard) {
  122102. string = Object(_toString_js__WEBPACK_IMPORTED_MODULE_4__["default"])(string);
  122103. if (string && (guard || chars === undefined)) {
  122104. return string.slice(0, Object(_trimmedEndIndex_js__WEBPACK_IMPORTED_MODULE_5__["default"])(string) + 1);
  122105. }
  122106. if (!string || !(chars = Object(_baseToString_js__WEBPACK_IMPORTED_MODULE_0__["default"])(chars))) {
  122107. return string;
  122108. }
  122109. var strSymbols = Object(_stringToArray_js__WEBPACK_IMPORTED_MODULE_3__["default"])(string),
  122110. end = Object(_charsEndIndex_js__WEBPACK_IMPORTED_MODULE_2__["default"])(strSymbols, Object(_stringToArray_js__WEBPACK_IMPORTED_MODULE_3__["default"])(chars)) + 1;
  122111. return Object(_castSlice_js__WEBPACK_IMPORTED_MODULE_1__["default"])(strSymbols, 0, end).join('');
  122112. }
  122113. /* harmony default export */ __webpack_exports__["default"] = (trimEnd);
  122114. /***/ }),
  122115. /***/ "./node_modules/lodash-es/trimStart.js":
  122116. /*!*********************************************!*\
  122117. !*** ./node_modules/lodash-es/trimStart.js ***!
  122118. \*********************************************/
  122119. /*! exports provided: default */
  122120. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  122121. "use strict";
  122122. __webpack_require__.r(__webpack_exports__);
  122123. /* harmony import */ var _baseToString_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseToString.js */ "./node_modules/lodash-es/_baseToString.js");
  122124. /* harmony import */ var _castSlice_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_castSlice.js */ "./node_modules/lodash-es/_castSlice.js");
  122125. /* harmony import */ var _charsStartIndex_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_charsStartIndex.js */ "./node_modules/lodash-es/_charsStartIndex.js");
  122126. /* harmony import */ var _stringToArray_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_stringToArray.js */ "./node_modules/lodash-es/_stringToArray.js");
  122127. /* harmony import */ var _toString_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./toString.js */ "./node_modules/lodash-es/toString.js");
  122128. /** Used to match leading whitespace. */
  122129. var reTrimStart = /^\s+/;
  122130. /**
  122131. * Removes leading whitespace or specified characters from `string`.
  122132. *
  122133. * @static
  122134. * @memberOf _
  122135. * @since 4.0.0
  122136. * @category String
  122137. * @param {string} [string=''] The string to trim.
  122138. * @param {string} [chars=whitespace] The characters to trim.
  122139. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  122140. * @returns {string} Returns the trimmed string.
  122141. * @example
  122142. *
  122143. * _.trimStart(' abc ');
  122144. * // => 'abc '
  122145. *
  122146. * _.trimStart('-_-abc-_-', '_-');
  122147. * // => 'abc-_-'
  122148. */
  122149. function trimStart(string, chars, guard) {
  122150. string = Object(_toString_js__WEBPACK_IMPORTED_MODULE_4__["default"])(string);
  122151. if (string && (guard || chars === undefined)) {
  122152. return string.replace(reTrimStart, '');
  122153. }
  122154. if (!string || !(chars = Object(_baseToString_js__WEBPACK_IMPORTED_MODULE_0__["default"])(chars))) {
  122155. return string;
  122156. }
  122157. var strSymbols = Object(_stringToArray_js__WEBPACK_IMPORTED_MODULE_3__["default"])(string),
  122158. start = Object(_charsStartIndex_js__WEBPACK_IMPORTED_MODULE_2__["default"])(strSymbols, Object(_stringToArray_js__WEBPACK_IMPORTED_MODULE_3__["default"])(chars));
  122159. return Object(_castSlice_js__WEBPACK_IMPORTED_MODULE_1__["default"])(strSymbols, start).join('');
  122160. }
  122161. /* harmony default export */ __webpack_exports__["default"] = (trimStart);
  122162. /***/ }),
  122163. /***/ "./node_modules/lodash-es/truncate.js":
  122164. /*!********************************************!*\
  122165. !*** ./node_modules/lodash-es/truncate.js ***!
  122166. \********************************************/
  122167. /*! exports provided: default */
  122168. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  122169. "use strict";
  122170. __webpack_require__.r(__webpack_exports__);
  122171. /* harmony import */ var _baseToString_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseToString.js */ "./node_modules/lodash-es/_baseToString.js");
  122172. /* harmony import */ var _castSlice_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_castSlice.js */ "./node_modules/lodash-es/_castSlice.js");
  122173. /* harmony import */ var _hasUnicode_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_hasUnicode.js */ "./node_modules/lodash-es/_hasUnicode.js");
  122174. /* harmony import */ var _isObject_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./isObject.js */ "./node_modules/lodash-es/isObject.js");
  122175. /* harmony import */ var _isRegExp_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./isRegExp.js */ "./node_modules/lodash-es/isRegExp.js");
  122176. /* harmony import */ var _stringSize_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./_stringSize.js */ "./node_modules/lodash-es/_stringSize.js");
  122177. /* harmony import */ var _stringToArray_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./_stringToArray.js */ "./node_modules/lodash-es/_stringToArray.js");
  122178. /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
  122179. /* harmony import */ var _toString_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./toString.js */ "./node_modules/lodash-es/toString.js");
  122180. /** Used as default options for `_.truncate`. */
  122181. var DEFAULT_TRUNC_LENGTH = 30,
  122182. DEFAULT_TRUNC_OMISSION = '...';
  122183. /** Used to match `RegExp` flags from their coerced string values. */
  122184. var reFlags = /\w*$/;
  122185. /**
  122186. * Truncates `string` if it's longer than the given maximum string length.
  122187. * The last characters of the truncated string are replaced with the omission
  122188. * string which defaults to "...".
  122189. *
  122190. * @static
  122191. * @memberOf _
  122192. * @since 4.0.0
  122193. * @category String
  122194. * @param {string} [string=''] The string to truncate.
  122195. * @param {Object} [options={}] The options object.
  122196. * @param {number} [options.length=30] The maximum string length.
  122197. * @param {string} [options.omission='...'] The string to indicate text is omitted.
  122198. * @param {RegExp|string} [options.separator] The separator pattern to truncate to.
  122199. * @returns {string} Returns the truncated string.
  122200. * @example
  122201. *
  122202. * _.truncate('hi-diddly-ho there, neighborino');
  122203. * // => 'hi-diddly-ho there, neighbo...'
  122204. *
  122205. * _.truncate('hi-diddly-ho there, neighborino', {
  122206. * 'length': 24,
  122207. * 'separator': ' '
  122208. * });
  122209. * // => 'hi-diddly-ho there,...'
  122210. *
  122211. * _.truncate('hi-diddly-ho there, neighborino', {
  122212. * 'length': 24,
  122213. * 'separator': /,? +/
  122214. * });
  122215. * // => 'hi-diddly-ho there...'
  122216. *
  122217. * _.truncate('hi-diddly-ho there, neighborino', {
  122218. * 'omission': ' [...]'
  122219. * });
  122220. * // => 'hi-diddly-ho there, neig [...]'
  122221. */
  122222. function truncate(string, options) {
  122223. var length = DEFAULT_TRUNC_LENGTH,
  122224. omission = DEFAULT_TRUNC_OMISSION;
  122225. if (Object(_isObject_js__WEBPACK_IMPORTED_MODULE_3__["default"])(options)) {
  122226. var separator = 'separator' in options ? options.separator : separator;
  122227. length = 'length' in options ? Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_7__["default"])(options.length) : length;
  122228. omission = 'omission' in options ? Object(_baseToString_js__WEBPACK_IMPORTED_MODULE_0__["default"])(options.omission) : omission;
  122229. }
  122230. string = Object(_toString_js__WEBPACK_IMPORTED_MODULE_8__["default"])(string);
  122231. var strLength = string.length;
  122232. if (Object(_hasUnicode_js__WEBPACK_IMPORTED_MODULE_2__["default"])(string)) {
  122233. var strSymbols = Object(_stringToArray_js__WEBPACK_IMPORTED_MODULE_6__["default"])(string);
  122234. strLength = strSymbols.length;
  122235. }
  122236. if (length >= strLength) {
  122237. return string;
  122238. }
  122239. var end = length - Object(_stringSize_js__WEBPACK_IMPORTED_MODULE_5__["default"])(omission);
  122240. if (end < 1) {
  122241. return omission;
  122242. }
  122243. var result = strSymbols
  122244. ? Object(_castSlice_js__WEBPACK_IMPORTED_MODULE_1__["default"])(strSymbols, 0, end).join('')
  122245. : string.slice(0, end);
  122246. if (separator === undefined) {
  122247. return result + omission;
  122248. }
  122249. if (strSymbols) {
  122250. end += (result.length - end);
  122251. }
  122252. if (Object(_isRegExp_js__WEBPACK_IMPORTED_MODULE_4__["default"])(separator)) {
  122253. if (string.slice(end).search(separator)) {
  122254. var match,
  122255. substring = result;
  122256. if (!separator.global) {
  122257. separator = RegExp(separator.source, Object(_toString_js__WEBPACK_IMPORTED_MODULE_8__["default"])(reFlags.exec(separator)) + 'g');
  122258. }
  122259. separator.lastIndex = 0;
  122260. while ((match = separator.exec(substring))) {
  122261. var newEnd = match.index;
  122262. }
  122263. result = result.slice(0, newEnd === undefined ? end : newEnd);
  122264. }
  122265. } else if (string.indexOf(Object(_baseToString_js__WEBPACK_IMPORTED_MODULE_0__["default"])(separator), end) != end) {
  122266. var index = result.lastIndexOf(separator);
  122267. if (index > -1) {
  122268. result = result.slice(0, index);
  122269. }
  122270. }
  122271. return result + omission;
  122272. }
  122273. /* harmony default export */ __webpack_exports__["default"] = (truncate);
  122274. /***/ }),
  122275. /***/ "./node_modules/lodash-es/unary.js":
  122276. /*!*****************************************!*\
  122277. !*** ./node_modules/lodash-es/unary.js ***!
  122278. \*****************************************/
  122279. /*! exports provided: default */
  122280. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  122281. "use strict";
  122282. __webpack_require__.r(__webpack_exports__);
  122283. /* harmony import */ var _ary_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ary.js */ "./node_modules/lodash-es/ary.js");
  122284. /**
  122285. * Creates a function that accepts up to one argument, ignoring any
  122286. * additional arguments.
  122287. *
  122288. * @static
  122289. * @memberOf _
  122290. * @since 4.0.0
  122291. * @category Function
  122292. * @param {Function} func The function to cap arguments for.
  122293. * @returns {Function} Returns the new capped function.
  122294. * @example
  122295. *
  122296. * _.map(['6', '8', '10'], _.unary(parseInt));
  122297. * // => [6, 8, 10]
  122298. */
  122299. function unary(func) {
  122300. return Object(_ary_js__WEBPACK_IMPORTED_MODULE_0__["default"])(func, 1);
  122301. }
  122302. /* harmony default export */ __webpack_exports__["default"] = (unary);
  122303. /***/ }),
  122304. /***/ "./node_modules/lodash-es/unescape.js":
  122305. /*!********************************************!*\
  122306. !*** ./node_modules/lodash-es/unescape.js ***!
  122307. \********************************************/
  122308. /*! exports provided: default */
  122309. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  122310. "use strict";
  122311. __webpack_require__.r(__webpack_exports__);
  122312. /* harmony import */ var _toString_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./toString.js */ "./node_modules/lodash-es/toString.js");
  122313. /* harmony import */ var _unescapeHtmlChar_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_unescapeHtmlChar.js */ "./node_modules/lodash-es/_unescapeHtmlChar.js");
  122314. /** Used to match HTML entities and HTML characters. */
  122315. var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g,
  122316. reHasEscapedHtml = RegExp(reEscapedHtml.source);
  122317. /**
  122318. * The inverse of `_.escape`; this method converts the HTML entities
  122319. * `&amp;`, `&lt;`, `&gt;`, `&quot;`, and `&#39;` in `string` to
  122320. * their corresponding characters.
  122321. *
  122322. * **Note:** No other HTML entities are unescaped. To unescape additional
  122323. * HTML entities use a third-party library like [_he_](https://mths.be/he).
  122324. *
  122325. * @static
  122326. * @memberOf _
  122327. * @since 0.6.0
  122328. * @category String
  122329. * @param {string} [string=''] The string to unescape.
  122330. * @returns {string} Returns the unescaped string.
  122331. * @example
  122332. *
  122333. * _.unescape('fred, barney, &amp; pebbles');
  122334. * // => 'fred, barney, & pebbles'
  122335. */
  122336. function unescape(string) {
  122337. string = Object(_toString_js__WEBPACK_IMPORTED_MODULE_0__["default"])(string);
  122338. return (string && reHasEscapedHtml.test(string))
  122339. ? string.replace(reEscapedHtml, _unescapeHtmlChar_js__WEBPACK_IMPORTED_MODULE_1__["default"])
  122340. : string;
  122341. }
  122342. /* harmony default export */ __webpack_exports__["default"] = (unescape);
  122343. /***/ }),
  122344. /***/ "./node_modules/lodash-es/union.js":
  122345. /*!*****************************************!*\
  122346. !*** ./node_modules/lodash-es/union.js ***!
  122347. \*****************************************/
  122348. /*! exports provided: default */
  122349. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  122350. "use strict";
  122351. __webpack_require__.r(__webpack_exports__);
  122352. /* harmony import */ var _baseFlatten_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseFlatten.js */ "./node_modules/lodash-es/_baseFlatten.js");
  122353. /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
  122354. /* harmony import */ var _baseUniq_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseUniq.js */ "./node_modules/lodash-es/_baseUniq.js");
  122355. /* harmony import */ var _isArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./isArrayLikeObject.js */ "./node_modules/lodash-es/isArrayLikeObject.js");
  122356. /**
  122357. * Creates an array of unique values, in order, from all given arrays using
  122358. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  122359. * for equality comparisons.
  122360. *
  122361. * @static
  122362. * @memberOf _
  122363. * @since 0.1.0
  122364. * @category Array
  122365. * @param {...Array} [arrays] The arrays to inspect.
  122366. * @returns {Array} Returns the new array of combined values.
  122367. * @example
  122368. *
  122369. * _.union([2], [1, 2]);
  122370. * // => [2, 1]
  122371. */
  122372. var union = Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_1__["default"])(function(arrays) {
  122373. 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));
  122374. });
  122375. /* harmony default export */ __webpack_exports__["default"] = (union);
  122376. /***/ }),
  122377. /***/ "./node_modules/lodash-es/unionBy.js":
  122378. /*!*******************************************!*\
  122379. !*** ./node_modules/lodash-es/unionBy.js ***!
  122380. \*******************************************/
  122381. /*! exports provided: default */
  122382. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  122383. "use strict";
  122384. __webpack_require__.r(__webpack_exports__);
  122385. /* harmony import */ var _baseFlatten_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseFlatten.js */ "./node_modules/lodash-es/_baseFlatten.js");
  122386. /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
  122387. /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
  122388. /* harmony import */ var _baseUniq_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_baseUniq.js */ "./node_modules/lodash-es/_baseUniq.js");
  122389. /* harmony import */ var _isArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./isArrayLikeObject.js */ "./node_modules/lodash-es/isArrayLikeObject.js");
  122390. /* harmony import */ var _last_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./last.js */ "./node_modules/lodash-es/last.js");
  122391. /**
  122392. * This method is like `_.union` except that it accepts `iteratee` which is
  122393. * invoked for each element of each `arrays` to generate the criterion by
  122394. * which uniqueness is computed. Result values are chosen from the first
  122395. * array in which the value occurs. The iteratee is invoked with one argument:
  122396. * (value).
  122397. *
  122398. * @static
  122399. * @memberOf _
  122400. * @since 4.0.0
  122401. * @category Array
  122402. * @param {...Array} [arrays] The arrays to inspect.
  122403. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  122404. * @returns {Array} Returns the new array of combined values.
  122405. * @example
  122406. *
  122407. * _.unionBy([2.1], [1.2, 2.3], Math.floor);
  122408. * // => [2.1, 1.2]
  122409. *
  122410. * // The `_.property` iteratee shorthand.
  122411. * _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  122412. * // => [{ 'x': 1 }, { 'x': 2 }]
  122413. */
  122414. var unionBy = Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_2__["default"])(function(arrays) {
  122415. var iteratee = Object(_last_js__WEBPACK_IMPORTED_MODULE_5__["default"])(arrays);
  122416. if (Object(_isArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_4__["default"])(iteratee)) {
  122417. iteratee = undefined;
  122418. }
  122419. 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));
  122420. });
  122421. /* harmony default export */ __webpack_exports__["default"] = (unionBy);
  122422. /***/ }),
  122423. /***/ "./node_modules/lodash-es/unionWith.js":
  122424. /*!*********************************************!*\
  122425. !*** ./node_modules/lodash-es/unionWith.js ***!
  122426. \*********************************************/
  122427. /*! exports provided: default */
  122428. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  122429. "use strict";
  122430. __webpack_require__.r(__webpack_exports__);
  122431. /* harmony import */ var _baseFlatten_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseFlatten.js */ "./node_modules/lodash-es/_baseFlatten.js");
  122432. /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
  122433. /* harmony import */ var _baseUniq_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseUniq.js */ "./node_modules/lodash-es/_baseUniq.js");
  122434. /* harmony import */ var _isArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./isArrayLikeObject.js */ "./node_modules/lodash-es/isArrayLikeObject.js");
  122435. /* harmony import */ var _last_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./last.js */ "./node_modules/lodash-es/last.js");
  122436. /**
  122437. * This method is like `_.union` except that it accepts `comparator` which
  122438. * is invoked to compare elements of `arrays`. Result values are chosen from
  122439. * the first array in which the value occurs. The comparator is invoked
  122440. * with two arguments: (arrVal, othVal).
  122441. *
  122442. * @static
  122443. * @memberOf _
  122444. * @since 4.0.0
  122445. * @category Array
  122446. * @param {...Array} [arrays] The arrays to inspect.
  122447. * @param {Function} [comparator] The comparator invoked per element.
  122448. * @returns {Array} Returns the new array of combined values.
  122449. * @example
  122450. *
  122451. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  122452. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  122453. *
  122454. * _.unionWith(objects, others, _.isEqual);
  122455. * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
  122456. */
  122457. var unionWith = Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_1__["default"])(function(arrays) {
  122458. var comparator = Object(_last_js__WEBPACK_IMPORTED_MODULE_4__["default"])(arrays);
  122459. comparator = typeof comparator == 'function' ? comparator : undefined;
  122460. 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);
  122461. });
  122462. /* harmony default export */ __webpack_exports__["default"] = (unionWith);
  122463. /***/ }),
  122464. /***/ "./node_modules/lodash-es/uniq.js":
  122465. /*!****************************************!*\
  122466. !*** ./node_modules/lodash-es/uniq.js ***!
  122467. \****************************************/
  122468. /*! exports provided: default */
  122469. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  122470. "use strict";
  122471. __webpack_require__.r(__webpack_exports__);
  122472. /* harmony import */ var _baseUniq_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseUniq.js */ "./node_modules/lodash-es/_baseUniq.js");
  122473. /**
  122474. * Creates a duplicate-free version of an array, using
  122475. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  122476. * for equality comparisons, in which only the first occurrence of each element
  122477. * is kept. The order of result values is determined by the order they occur
  122478. * in the array.
  122479. *
  122480. * @static
  122481. * @memberOf _
  122482. * @since 0.1.0
  122483. * @category Array
  122484. * @param {Array} array The array to inspect.
  122485. * @returns {Array} Returns the new duplicate free array.
  122486. * @example
  122487. *
  122488. * _.uniq([2, 1, 2]);
  122489. * // => [2, 1]
  122490. */
  122491. function uniq(array) {
  122492. return (array && array.length) ? Object(_baseUniq_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array) : [];
  122493. }
  122494. /* harmony default export */ __webpack_exports__["default"] = (uniq);
  122495. /***/ }),
  122496. /***/ "./node_modules/lodash-es/uniqBy.js":
  122497. /*!******************************************!*\
  122498. !*** ./node_modules/lodash-es/uniqBy.js ***!
  122499. \******************************************/
  122500. /*! exports provided: default */
  122501. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  122502. "use strict";
  122503. __webpack_require__.r(__webpack_exports__);
  122504. /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
  122505. /* harmony import */ var _baseUniq_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseUniq.js */ "./node_modules/lodash-es/_baseUniq.js");
  122506. /**
  122507. * This method is like `_.uniq` except that it accepts `iteratee` which is
  122508. * invoked for each element in `array` to generate the criterion by which
  122509. * uniqueness is computed. The order of result values is determined by the
  122510. * order they occur in the array. The iteratee is invoked with one argument:
  122511. * (value).
  122512. *
  122513. * @static
  122514. * @memberOf _
  122515. * @since 4.0.0
  122516. * @category Array
  122517. * @param {Array} array The array to inspect.
  122518. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  122519. * @returns {Array} Returns the new duplicate free array.
  122520. * @example
  122521. *
  122522. * _.uniqBy([2.1, 1.2, 2.3], Math.floor);
  122523. * // => [2.1, 1.2]
  122524. *
  122525. * // The `_.property` iteratee shorthand.
  122526. * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');
  122527. * // => [{ 'x': 1 }, { 'x': 2 }]
  122528. */
  122529. function uniqBy(array, iteratee) {
  122530. return (array && array.length) ? Object(_baseUniq_js__WEBPACK_IMPORTED_MODULE_1__["default"])(array, Object(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_0__["default"])(iteratee, 2)) : [];
  122531. }
  122532. /* harmony default export */ __webpack_exports__["default"] = (uniqBy);
  122533. /***/ }),
  122534. /***/ "./node_modules/lodash-es/uniqWith.js":
  122535. /*!********************************************!*\
  122536. !*** ./node_modules/lodash-es/uniqWith.js ***!
  122537. \********************************************/
  122538. /*! exports provided: default */
  122539. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  122540. "use strict";
  122541. __webpack_require__.r(__webpack_exports__);
  122542. /* harmony import */ var _baseUniq_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseUniq.js */ "./node_modules/lodash-es/_baseUniq.js");
  122543. /**
  122544. * This method is like `_.uniq` except that it accepts `comparator` which
  122545. * is invoked to compare elements of `array`. The order of result values is
  122546. * determined by the order they occur in the array.The comparator is invoked
  122547. * with two arguments: (arrVal, othVal).
  122548. *
  122549. * @static
  122550. * @memberOf _
  122551. * @since 4.0.0
  122552. * @category Array
  122553. * @param {Array} array The array to inspect.
  122554. * @param {Function} [comparator] The comparator invoked per element.
  122555. * @returns {Array} Returns the new duplicate free array.
  122556. * @example
  122557. *
  122558. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }];
  122559. *
  122560. * _.uniqWith(objects, _.isEqual);
  122561. * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]
  122562. */
  122563. function uniqWith(array, comparator) {
  122564. comparator = typeof comparator == 'function' ? comparator : undefined;
  122565. return (array && array.length) ? Object(_baseUniq_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, undefined, comparator) : [];
  122566. }
  122567. /* harmony default export */ __webpack_exports__["default"] = (uniqWith);
  122568. /***/ }),
  122569. /***/ "./node_modules/lodash-es/uniqueId.js":
  122570. /*!********************************************!*\
  122571. !*** ./node_modules/lodash-es/uniqueId.js ***!
  122572. \********************************************/
  122573. /*! exports provided: default */
  122574. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  122575. "use strict";
  122576. __webpack_require__.r(__webpack_exports__);
  122577. /* harmony import */ var _toString_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./toString.js */ "./node_modules/lodash-es/toString.js");
  122578. /** Used to generate unique IDs. */
  122579. var idCounter = 0;
  122580. /**
  122581. * Generates a unique ID. If `prefix` is given, the ID is appended to it.
  122582. *
  122583. * @static
  122584. * @since 0.1.0
  122585. * @memberOf _
  122586. * @category Util
  122587. * @param {string} [prefix=''] The value to prefix the ID with.
  122588. * @returns {string} Returns the unique ID.
  122589. * @example
  122590. *
  122591. * _.uniqueId('contact_');
  122592. * // => 'contact_104'
  122593. *
  122594. * _.uniqueId();
  122595. * // => '105'
  122596. */
  122597. function uniqueId(prefix) {
  122598. var id = ++idCounter;
  122599. return Object(_toString_js__WEBPACK_IMPORTED_MODULE_0__["default"])(prefix) + id;
  122600. }
  122601. /* harmony default export */ __webpack_exports__["default"] = (uniqueId);
  122602. /***/ }),
  122603. /***/ "./node_modules/lodash-es/unset.js":
  122604. /*!*****************************************!*\
  122605. !*** ./node_modules/lodash-es/unset.js ***!
  122606. \*****************************************/
  122607. /*! exports provided: default */
  122608. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  122609. "use strict";
  122610. __webpack_require__.r(__webpack_exports__);
  122611. /* harmony import */ var _baseUnset_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseUnset.js */ "./node_modules/lodash-es/_baseUnset.js");
  122612. /**
  122613. * Removes the property at `path` of `object`.
  122614. *
  122615. * **Note:** This method mutates `object`.
  122616. *
  122617. * @static
  122618. * @memberOf _
  122619. * @since 4.0.0
  122620. * @category Object
  122621. * @param {Object} object The object to modify.
  122622. * @param {Array|string} path The path of the property to unset.
  122623. * @returns {boolean} Returns `true` if the property is deleted, else `false`.
  122624. * @example
  122625. *
  122626. * var object = { 'a': [{ 'b': { 'c': 7 } }] };
  122627. * _.unset(object, 'a[0].b.c');
  122628. * // => true
  122629. *
  122630. * console.log(object);
  122631. * // => { 'a': [{ 'b': {} }] };
  122632. *
  122633. * _.unset(object, ['a', '0', 'b', 'c']);
  122634. * // => true
  122635. *
  122636. * console.log(object);
  122637. * // => { 'a': [{ 'b': {} }] };
  122638. */
  122639. function unset(object, path) {
  122640. return object == null ? true : Object(_baseUnset_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, path);
  122641. }
  122642. /* harmony default export */ __webpack_exports__["default"] = (unset);
  122643. /***/ }),
  122644. /***/ "./node_modules/lodash-es/unzip.js":
  122645. /*!*****************************************!*\
  122646. !*** ./node_modules/lodash-es/unzip.js ***!
  122647. \*****************************************/
  122648. /*! exports provided: default */
  122649. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  122650. "use strict";
  122651. __webpack_require__.r(__webpack_exports__);
  122652. /* harmony import */ var _arrayFilter_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayFilter.js */ "./node_modules/lodash-es/_arrayFilter.js");
  122653. /* harmony import */ var _arrayMap_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_arrayMap.js */ "./node_modules/lodash-es/_arrayMap.js");
  122654. /* harmony import */ var _baseProperty_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseProperty.js */ "./node_modules/lodash-es/_baseProperty.js");
  122655. /* harmony import */ var _baseTimes_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_baseTimes.js */ "./node_modules/lodash-es/_baseTimes.js");
  122656. /* harmony import */ var _isArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./isArrayLikeObject.js */ "./node_modules/lodash-es/isArrayLikeObject.js");
  122657. /* Built-in method references for those with the same name as other `lodash` methods. */
  122658. var nativeMax = Math.max;
  122659. /**
  122660. * This method is like `_.zip` except that it accepts an array of grouped
  122661. * elements and creates an array regrouping the elements to their pre-zip
  122662. * configuration.
  122663. *
  122664. * @static
  122665. * @memberOf _
  122666. * @since 1.2.0
  122667. * @category Array
  122668. * @param {Array} array The array of grouped elements to process.
  122669. * @returns {Array} Returns the new array of regrouped elements.
  122670. * @example
  122671. *
  122672. * var zipped = _.zip(['a', 'b'], [1, 2], [true, false]);
  122673. * // => [['a', 1, true], ['b', 2, false]]
  122674. *
  122675. * _.unzip(zipped);
  122676. * // => [['a', 'b'], [1, 2], [true, false]]
  122677. */
  122678. function unzip(array) {
  122679. if (!(array && array.length)) {
  122680. return [];
  122681. }
  122682. var length = 0;
  122683. array = Object(_arrayFilter_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, function(group) {
  122684. if (Object(_isArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_4__["default"])(group)) {
  122685. length = nativeMax(group.length, length);
  122686. return true;
  122687. }
  122688. });
  122689. return Object(_baseTimes_js__WEBPACK_IMPORTED_MODULE_3__["default"])(length, function(index) {
  122690. return Object(_arrayMap_js__WEBPACK_IMPORTED_MODULE_1__["default"])(array, Object(_baseProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(index));
  122691. });
  122692. }
  122693. /* harmony default export */ __webpack_exports__["default"] = (unzip);
  122694. /***/ }),
  122695. /***/ "./node_modules/lodash-es/unzipWith.js":
  122696. /*!*********************************************!*\
  122697. !*** ./node_modules/lodash-es/unzipWith.js ***!
  122698. \*********************************************/
  122699. /*! exports provided: default */
  122700. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  122701. "use strict";
  122702. __webpack_require__.r(__webpack_exports__);
  122703. /* harmony import */ var _apply_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_apply.js */ "./node_modules/lodash-es/_apply.js");
  122704. /* harmony import */ var _arrayMap_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_arrayMap.js */ "./node_modules/lodash-es/_arrayMap.js");
  122705. /* harmony import */ var _unzip_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./unzip.js */ "./node_modules/lodash-es/unzip.js");
  122706. /**
  122707. * This method is like `_.unzip` except that it accepts `iteratee` to specify
  122708. * how regrouped values should be combined. The iteratee is invoked with the
  122709. * elements of each group: (...group).
  122710. *
  122711. * @static
  122712. * @memberOf _
  122713. * @since 3.8.0
  122714. * @category Array
  122715. * @param {Array} array The array of grouped elements to process.
  122716. * @param {Function} [iteratee=_.identity] The function to combine
  122717. * regrouped values.
  122718. * @returns {Array} Returns the new array of regrouped elements.
  122719. * @example
  122720. *
  122721. * var zipped = _.zip([1, 2], [10, 20], [100, 200]);
  122722. * // => [[1, 10, 100], [2, 20, 200]]
  122723. *
  122724. * _.unzipWith(zipped, _.add);
  122725. * // => [3, 30, 300]
  122726. */
  122727. function unzipWith(array, iteratee) {
  122728. if (!(array && array.length)) {
  122729. return [];
  122730. }
  122731. var result = Object(_unzip_js__WEBPACK_IMPORTED_MODULE_2__["default"])(array);
  122732. if (iteratee == null) {
  122733. return result;
  122734. }
  122735. return Object(_arrayMap_js__WEBPACK_IMPORTED_MODULE_1__["default"])(result, function(group) {
  122736. return Object(_apply_js__WEBPACK_IMPORTED_MODULE_0__["default"])(iteratee, undefined, group);
  122737. });
  122738. }
  122739. /* harmony default export */ __webpack_exports__["default"] = (unzipWith);
  122740. /***/ }),
  122741. /***/ "./node_modules/lodash-es/update.js":
  122742. /*!******************************************!*\
  122743. !*** ./node_modules/lodash-es/update.js ***!
  122744. \******************************************/
  122745. /*! exports provided: default */
  122746. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  122747. "use strict";
  122748. __webpack_require__.r(__webpack_exports__);
  122749. /* harmony import */ var _baseUpdate_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseUpdate.js */ "./node_modules/lodash-es/_baseUpdate.js");
  122750. /* harmony import */ var _castFunction_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_castFunction.js */ "./node_modules/lodash-es/_castFunction.js");
  122751. /**
  122752. * This method is like `_.set` except that accepts `updater` to produce the
  122753. * value to set. Use `_.updateWith` to customize `path` creation. The `updater`
  122754. * is invoked with one argument: (value).
  122755. *
  122756. * **Note:** This method mutates `object`.
  122757. *
  122758. * @static
  122759. * @memberOf _
  122760. * @since 4.6.0
  122761. * @category Object
  122762. * @param {Object} object The object to modify.
  122763. * @param {Array|string} path The path of the property to set.
  122764. * @param {Function} updater The function to produce the updated value.
  122765. * @returns {Object} Returns `object`.
  122766. * @example
  122767. *
  122768. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  122769. *
  122770. * _.update(object, 'a[0].b.c', function(n) { return n * n; });
  122771. * console.log(object.a[0].b.c);
  122772. * // => 9
  122773. *
  122774. * _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; });
  122775. * console.log(object.x[0].y.z);
  122776. * // => 0
  122777. */
  122778. function update(object, path, updater) {
  122779. return object == null ? object : Object(_baseUpdate_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, path, Object(_castFunction_js__WEBPACK_IMPORTED_MODULE_1__["default"])(updater));
  122780. }
  122781. /* harmony default export */ __webpack_exports__["default"] = (update);
  122782. /***/ }),
  122783. /***/ "./node_modules/lodash-es/updateWith.js":
  122784. /*!**********************************************!*\
  122785. !*** ./node_modules/lodash-es/updateWith.js ***!
  122786. \**********************************************/
  122787. /*! exports provided: default */
  122788. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  122789. "use strict";
  122790. __webpack_require__.r(__webpack_exports__);
  122791. /* harmony import */ var _baseUpdate_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseUpdate.js */ "./node_modules/lodash-es/_baseUpdate.js");
  122792. /* harmony import */ var _castFunction_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_castFunction.js */ "./node_modules/lodash-es/_castFunction.js");
  122793. /**
  122794. * This method is like `_.update` except that it accepts `customizer` which is
  122795. * invoked to produce the objects of `path`. If `customizer` returns `undefined`
  122796. * path creation is handled by the method instead. The `customizer` is invoked
  122797. * with three arguments: (nsValue, key, nsObject).
  122798. *
  122799. * **Note:** This method mutates `object`.
  122800. *
  122801. * @static
  122802. * @memberOf _
  122803. * @since 4.6.0
  122804. * @category Object
  122805. * @param {Object} object The object to modify.
  122806. * @param {Array|string} path The path of the property to set.
  122807. * @param {Function} updater The function to produce the updated value.
  122808. * @param {Function} [customizer] The function to customize assigned values.
  122809. * @returns {Object} Returns `object`.
  122810. * @example
  122811. *
  122812. * var object = {};
  122813. *
  122814. * _.updateWith(object, '[0][1]', _.constant('a'), Object);
  122815. * // => { '0': { '1': 'a' } }
  122816. */
  122817. function updateWith(object, path, updater, customizer) {
  122818. customizer = typeof customizer == 'function' ? customizer : undefined;
  122819. return object == null ? object : Object(_baseUpdate_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, path, Object(_castFunction_js__WEBPACK_IMPORTED_MODULE_1__["default"])(updater), customizer);
  122820. }
  122821. /* harmony default export */ __webpack_exports__["default"] = (updateWith);
  122822. /***/ }),
  122823. /***/ "./node_modules/lodash-es/upperCase.js":
  122824. /*!*********************************************!*\
  122825. !*** ./node_modules/lodash-es/upperCase.js ***!
  122826. \*********************************************/
  122827. /*! exports provided: default */
  122828. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  122829. "use strict";
  122830. __webpack_require__.r(__webpack_exports__);
  122831. /* harmony import */ var _createCompounder_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createCompounder.js */ "./node_modules/lodash-es/_createCompounder.js");
  122832. /**
  122833. * Converts `string`, as space separated words, to upper case.
  122834. *
  122835. * @static
  122836. * @memberOf _
  122837. * @since 4.0.0
  122838. * @category String
  122839. * @param {string} [string=''] The string to convert.
  122840. * @returns {string} Returns the upper cased string.
  122841. * @example
  122842. *
  122843. * _.upperCase('--foo-bar');
  122844. * // => 'FOO BAR'
  122845. *
  122846. * _.upperCase('fooBar');
  122847. * // => 'FOO BAR'
  122848. *
  122849. * _.upperCase('__foo_bar__');
  122850. * // => 'FOO BAR'
  122851. */
  122852. var upperCase = Object(_createCompounder_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function(result, word, index) {
  122853. return result + (index ? ' ' : '') + word.toUpperCase();
  122854. });
  122855. /* harmony default export */ __webpack_exports__["default"] = (upperCase);
  122856. /***/ }),
  122857. /***/ "./node_modules/lodash-es/upperFirst.js":
  122858. /*!**********************************************!*\
  122859. !*** ./node_modules/lodash-es/upperFirst.js ***!
  122860. \**********************************************/
  122861. /*! exports provided: default */
  122862. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  122863. "use strict";
  122864. __webpack_require__.r(__webpack_exports__);
  122865. /* harmony import */ var _createCaseFirst_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createCaseFirst.js */ "./node_modules/lodash-es/_createCaseFirst.js");
  122866. /**
  122867. * Converts the first character of `string` to upper case.
  122868. *
  122869. * @static
  122870. * @memberOf _
  122871. * @since 4.0.0
  122872. * @category String
  122873. * @param {string} [string=''] The string to convert.
  122874. * @returns {string} Returns the converted string.
  122875. * @example
  122876. *
  122877. * _.upperFirst('fred');
  122878. * // => 'Fred'
  122879. *
  122880. * _.upperFirst('FRED');
  122881. * // => 'FRED'
  122882. */
  122883. var upperFirst = Object(_createCaseFirst_js__WEBPACK_IMPORTED_MODULE_0__["default"])('toUpperCase');
  122884. /* harmony default export */ __webpack_exports__["default"] = (upperFirst);
  122885. /***/ }),
  122886. /***/ "./node_modules/lodash-es/util.default.js":
  122887. /*!************************************************!*\
  122888. !*** ./node_modules/lodash-es/util.default.js ***!
  122889. \************************************************/
  122890. /*! exports provided: default */
  122891. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  122892. "use strict";
  122893. __webpack_require__.r(__webpack_exports__);
  122894. /* harmony import */ var _attempt_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./attempt.js */ "./node_modules/lodash-es/attempt.js");
  122895. /* harmony import */ var _bindAll_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./bindAll.js */ "./node_modules/lodash-es/bindAll.js");
  122896. /* harmony import */ var _cond_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./cond.js */ "./node_modules/lodash-es/cond.js");
  122897. /* harmony import */ var _conforms_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./conforms.js */ "./node_modules/lodash-es/conforms.js");
  122898. /* harmony import */ var _constant_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./constant.js */ "./node_modules/lodash-es/constant.js");
  122899. /* harmony import */ var _defaultTo_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./defaultTo.js */ "./node_modules/lodash-es/defaultTo.js");
  122900. /* harmony import */ var _flow_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./flow.js */ "./node_modules/lodash-es/flow.js");
  122901. /* harmony import */ var _flowRight_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./flowRight.js */ "./node_modules/lodash-es/flowRight.js");
  122902. /* harmony import */ var _identity_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./identity.js */ "./node_modules/lodash-es/identity.js");
  122903. /* harmony import */ var _iteratee_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./iteratee.js */ "./node_modules/lodash-es/iteratee.js");
  122904. /* harmony import */ var _matches_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./matches.js */ "./node_modules/lodash-es/matches.js");
  122905. /* harmony import */ var _matchesProperty_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./matchesProperty.js */ "./node_modules/lodash-es/matchesProperty.js");
  122906. /* harmony import */ var _method_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./method.js */ "./node_modules/lodash-es/method.js");
  122907. /* harmony import */ var _methodOf_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./methodOf.js */ "./node_modules/lodash-es/methodOf.js");
  122908. /* harmony import */ var _mixin_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./mixin.js */ "./node_modules/lodash-es/mixin.js");
  122909. /* harmony import */ var _noop_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./noop.js */ "./node_modules/lodash-es/noop.js");
  122910. /* harmony import */ var _nthArg_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./nthArg.js */ "./node_modules/lodash-es/nthArg.js");
  122911. /* harmony import */ var _over_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./over.js */ "./node_modules/lodash-es/over.js");
  122912. /* harmony import */ var _overEvery_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./overEvery.js */ "./node_modules/lodash-es/overEvery.js");
  122913. /* harmony import */ var _overSome_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./overSome.js */ "./node_modules/lodash-es/overSome.js");
  122914. /* harmony import */ var _property_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./property.js */ "./node_modules/lodash-es/property.js");
  122915. /* harmony import */ var _propertyOf_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./propertyOf.js */ "./node_modules/lodash-es/propertyOf.js");
  122916. /* harmony import */ var _range_js__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./range.js */ "./node_modules/lodash-es/range.js");
  122917. /* harmony import */ var _rangeRight_js__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./rangeRight.js */ "./node_modules/lodash-es/rangeRight.js");
  122918. /* harmony import */ var _stubArray_js__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./stubArray.js */ "./node_modules/lodash-es/stubArray.js");
  122919. /* harmony import */ var _stubFalse_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./stubFalse.js */ "./node_modules/lodash-es/stubFalse.js");
  122920. /* harmony import */ var _stubObject_js__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./stubObject.js */ "./node_modules/lodash-es/stubObject.js");
  122921. /* harmony import */ var _stubString_js__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./stubString.js */ "./node_modules/lodash-es/stubString.js");
  122922. /* harmony import */ var _stubTrue_js__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./stubTrue.js */ "./node_modules/lodash-es/stubTrue.js");
  122923. /* harmony import */ var _times_js__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./times.js */ "./node_modules/lodash-es/times.js");
  122924. /* harmony import */ var _toPath_js__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./toPath.js */ "./node_modules/lodash-es/toPath.js");
  122925. /* harmony import */ var _uniqueId_js__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ./uniqueId.js */ "./node_modules/lodash-es/uniqueId.js");
  122926. /* harmony default export */ __webpack_exports__["default"] = ({
  122927. 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"],
  122928. 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"],
  122929. 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"],
  122930. 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"],
  122931. 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"],
  122932. 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"],
  122933. toPath: _toPath_js__WEBPACK_IMPORTED_MODULE_30__["default"], uniqueId: _uniqueId_js__WEBPACK_IMPORTED_MODULE_31__["default"]
  122934. });
  122935. /***/ }),
  122936. /***/ "./node_modules/lodash-es/util.js":
  122937. /*!****************************************!*\
  122938. !*** ./node_modules/lodash-es/util.js ***!
  122939. \****************************************/
  122940. /*! 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 */
  122941. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  122942. "use strict";
  122943. __webpack_require__.r(__webpack_exports__);
  122944. /* harmony import */ var _attempt_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./attempt.js */ "./node_modules/lodash-es/attempt.js");
  122945. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "attempt", function() { return _attempt_js__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  122946. /* harmony import */ var _bindAll_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./bindAll.js */ "./node_modules/lodash-es/bindAll.js");
  122947. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "bindAll", function() { return _bindAll_js__WEBPACK_IMPORTED_MODULE_1__["default"]; });
  122948. /* harmony import */ var _cond_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./cond.js */ "./node_modules/lodash-es/cond.js");
  122949. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "cond", function() { return _cond_js__WEBPACK_IMPORTED_MODULE_2__["default"]; });
  122950. /* harmony import */ var _conforms_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./conforms.js */ "./node_modules/lodash-es/conforms.js");
  122951. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "conforms", function() { return _conforms_js__WEBPACK_IMPORTED_MODULE_3__["default"]; });
  122952. /* harmony import */ var _constant_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./constant.js */ "./node_modules/lodash-es/constant.js");
  122953. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "constant", function() { return _constant_js__WEBPACK_IMPORTED_MODULE_4__["default"]; });
  122954. /* harmony import */ var _defaultTo_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./defaultTo.js */ "./node_modules/lodash-es/defaultTo.js");
  122955. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "defaultTo", function() { return _defaultTo_js__WEBPACK_IMPORTED_MODULE_5__["default"]; });
  122956. /* harmony import */ var _flow_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./flow.js */ "./node_modules/lodash-es/flow.js");
  122957. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "flow", function() { return _flow_js__WEBPACK_IMPORTED_MODULE_6__["default"]; });
  122958. /* harmony import */ var _flowRight_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./flowRight.js */ "./node_modules/lodash-es/flowRight.js");
  122959. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "flowRight", function() { return _flowRight_js__WEBPACK_IMPORTED_MODULE_7__["default"]; });
  122960. /* harmony import */ var _identity_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./identity.js */ "./node_modules/lodash-es/identity.js");
  122961. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "identity", function() { return _identity_js__WEBPACK_IMPORTED_MODULE_8__["default"]; });
  122962. /* harmony import */ var _iteratee_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./iteratee.js */ "./node_modules/lodash-es/iteratee.js");
  122963. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "iteratee", function() { return _iteratee_js__WEBPACK_IMPORTED_MODULE_9__["default"]; });
  122964. /* harmony import */ var _matches_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./matches.js */ "./node_modules/lodash-es/matches.js");
  122965. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "matches", function() { return _matches_js__WEBPACK_IMPORTED_MODULE_10__["default"]; });
  122966. /* harmony import */ var _matchesProperty_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./matchesProperty.js */ "./node_modules/lodash-es/matchesProperty.js");
  122967. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "matchesProperty", function() { return _matchesProperty_js__WEBPACK_IMPORTED_MODULE_11__["default"]; });
  122968. /* harmony import */ var _method_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./method.js */ "./node_modules/lodash-es/method.js");
  122969. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "method", function() { return _method_js__WEBPACK_IMPORTED_MODULE_12__["default"]; });
  122970. /* harmony import */ var _methodOf_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./methodOf.js */ "./node_modules/lodash-es/methodOf.js");
  122971. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "methodOf", function() { return _methodOf_js__WEBPACK_IMPORTED_MODULE_13__["default"]; });
  122972. /* harmony import */ var _mixin_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./mixin.js */ "./node_modules/lodash-es/mixin.js");
  122973. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "mixin", function() { return _mixin_js__WEBPACK_IMPORTED_MODULE_14__["default"]; });
  122974. /* harmony import */ var _noop_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./noop.js */ "./node_modules/lodash-es/noop.js");
  122975. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "noop", function() { return _noop_js__WEBPACK_IMPORTED_MODULE_15__["default"]; });
  122976. /* harmony import */ var _nthArg_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./nthArg.js */ "./node_modules/lodash-es/nthArg.js");
  122977. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "nthArg", function() { return _nthArg_js__WEBPACK_IMPORTED_MODULE_16__["default"]; });
  122978. /* harmony import */ var _over_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./over.js */ "./node_modules/lodash-es/over.js");
  122979. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "over", function() { return _over_js__WEBPACK_IMPORTED_MODULE_17__["default"]; });
  122980. /* harmony import */ var _overEvery_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./overEvery.js */ "./node_modules/lodash-es/overEvery.js");
  122981. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "overEvery", function() { return _overEvery_js__WEBPACK_IMPORTED_MODULE_18__["default"]; });
  122982. /* harmony import */ var _overSome_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./overSome.js */ "./node_modules/lodash-es/overSome.js");
  122983. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "overSome", function() { return _overSome_js__WEBPACK_IMPORTED_MODULE_19__["default"]; });
  122984. /* harmony import */ var _property_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./property.js */ "./node_modules/lodash-es/property.js");
  122985. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "property", function() { return _property_js__WEBPACK_IMPORTED_MODULE_20__["default"]; });
  122986. /* harmony import */ var _propertyOf_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./propertyOf.js */ "./node_modules/lodash-es/propertyOf.js");
  122987. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "propertyOf", function() { return _propertyOf_js__WEBPACK_IMPORTED_MODULE_21__["default"]; });
  122988. /* harmony import */ var _range_js__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./range.js */ "./node_modules/lodash-es/range.js");
  122989. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "range", function() { return _range_js__WEBPACK_IMPORTED_MODULE_22__["default"]; });
  122990. /* harmony import */ var _rangeRight_js__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./rangeRight.js */ "./node_modules/lodash-es/rangeRight.js");
  122991. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "rangeRight", function() { return _rangeRight_js__WEBPACK_IMPORTED_MODULE_23__["default"]; });
  122992. /* harmony import */ var _stubArray_js__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./stubArray.js */ "./node_modules/lodash-es/stubArray.js");
  122993. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "stubArray", function() { return _stubArray_js__WEBPACK_IMPORTED_MODULE_24__["default"]; });
  122994. /* harmony import */ var _stubFalse_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./stubFalse.js */ "./node_modules/lodash-es/stubFalse.js");
  122995. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "stubFalse", function() { return _stubFalse_js__WEBPACK_IMPORTED_MODULE_25__["default"]; });
  122996. /* harmony import */ var _stubObject_js__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./stubObject.js */ "./node_modules/lodash-es/stubObject.js");
  122997. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "stubObject", function() { return _stubObject_js__WEBPACK_IMPORTED_MODULE_26__["default"]; });
  122998. /* harmony import */ var _stubString_js__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./stubString.js */ "./node_modules/lodash-es/stubString.js");
  122999. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "stubString", function() { return _stubString_js__WEBPACK_IMPORTED_MODULE_27__["default"]; });
  123000. /* harmony import */ var _stubTrue_js__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./stubTrue.js */ "./node_modules/lodash-es/stubTrue.js");
  123001. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "stubTrue", function() { return _stubTrue_js__WEBPACK_IMPORTED_MODULE_28__["default"]; });
  123002. /* harmony import */ var _times_js__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./times.js */ "./node_modules/lodash-es/times.js");
  123003. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "times", function() { return _times_js__WEBPACK_IMPORTED_MODULE_29__["default"]; });
  123004. /* harmony import */ var _toPath_js__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./toPath.js */ "./node_modules/lodash-es/toPath.js");
  123005. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toPath", function() { return _toPath_js__WEBPACK_IMPORTED_MODULE_30__["default"]; });
  123006. /* harmony import */ var _uniqueId_js__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ./uniqueId.js */ "./node_modules/lodash-es/uniqueId.js");
  123007. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "uniqueId", function() { return _uniqueId_js__WEBPACK_IMPORTED_MODULE_31__["default"]; });
  123008. /* harmony import */ var _util_default_js__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ./util.default.js */ "./node_modules/lodash-es/util.default.js");
  123009. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _util_default_js__WEBPACK_IMPORTED_MODULE_32__["default"]; });
  123010. /***/ }),
  123011. /***/ "./node_modules/lodash-es/value.js":
  123012. /*!*****************************************!*\
  123013. !*** ./node_modules/lodash-es/value.js ***!
  123014. \*****************************************/
  123015. /*! exports provided: default */
  123016. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  123017. "use strict";
  123018. __webpack_require__.r(__webpack_exports__);
  123019. /* harmony import */ var _wrapperValue_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./wrapperValue.js */ "./node_modules/lodash-es/wrapperValue.js");
  123020. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _wrapperValue_js__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  123021. /***/ }),
  123022. /***/ "./node_modules/lodash-es/valueOf.js":
  123023. /*!*******************************************!*\
  123024. !*** ./node_modules/lodash-es/valueOf.js ***!
  123025. \*******************************************/
  123026. /*! exports provided: default */
  123027. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  123028. "use strict";
  123029. __webpack_require__.r(__webpack_exports__);
  123030. /* harmony import */ var _wrapperValue_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./wrapperValue.js */ "./node_modules/lodash-es/wrapperValue.js");
  123031. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _wrapperValue_js__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  123032. /***/ }),
  123033. /***/ "./node_modules/lodash-es/values.js":
  123034. /*!******************************************!*\
  123035. !*** ./node_modules/lodash-es/values.js ***!
  123036. \******************************************/
  123037. /*! exports provided: default */
  123038. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  123039. "use strict";
  123040. __webpack_require__.r(__webpack_exports__);
  123041. /* harmony import */ var _baseValues_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseValues.js */ "./node_modules/lodash-es/_baseValues.js");
  123042. /* harmony import */ var _keys_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./keys.js */ "./node_modules/lodash-es/keys.js");
  123043. /**
  123044. * Creates an array of the own enumerable string keyed property values of `object`.
  123045. *
  123046. * **Note:** Non-object values are coerced to objects.
  123047. *
  123048. * @static
  123049. * @since 0.1.0
  123050. * @memberOf _
  123051. * @category Object
  123052. * @param {Object} object The object to query.
  123053. * @returns {Array} Returns the array of property values.
  123054. * @example
  123055. *
  123056. * function Foo() {
  123057. * this.a = 1;
  123058. * this.b = 2;
  123059. * }
  123060. *
  123061. * Foo.prototype.c = 3;
  123062. *
  123063. * _.values(new Foo);
  123064. * // => [1, 2] (iteration order is not guaranteed)
  123065. *
  123066. * _.values('hi');
  123067. * // => ['h', 'i']
  123068. */
  123069. function values(object) {
  123070. return object == null ? [] : Object(_baseValues_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, Object(_keys_js__WEBPACK_IMPORTED_MODULE_1__["default"])(object));
  123071. }
  123072. /* harmony default export */ __webpack_exports__["default"] = (values);
  123073. /***/ }),
  123074. /***/ "./node_modules/lodash-es/valuesIn.js":
  123075. /*!********************************************!*\
  123076. !*** ./node_modules/lodash-es/valuesIn.js ***!
  123077. \********************************************/
  123078. /*! exports provided: default */
  123079. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  123080. "use strict";
  123081. __webpack_require__.r(__webpack_exports__);
  123082. /* harmony import */ var _baseValues_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseValues.js */ "./node_modules/lodash-es/_baseValues.js");
  123083. /* harmony import */ var _keysIn_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./keysIn.js */ "./node_modules/lodash-es/keysIn.js");
  123084. /**
  123085. * Creates an array of the own and inherited enumerable string keyed property
  123086. * values of `object`.
  123087. *
  123088. * **Note:** Non-object values are coerced to objects.
  123089. *
  123090. * @static
  123091. * @memberOf _
  123092. * @since 3.0.0
  123093. * @category Object
  123094. * @param {Object} object The object to query.
  123095. * @returns {Array} Returns the array of property values.
  123096. * @example
  123097. *
  123098. * function Foo() {
  123099. * this.a = 1;
  123100. * this.b = 2;
  123101. * }
  123102. *
  123103. * Foo.prototype.c = 3;
  123104. *
  123105. * _.valuesIn(new Foo);
  123106. * // => [1, 2, 3] (iteration order is not guaranteed)
  123107. */
  123108. function valuesIn(object) {
  123109. return object == null ? [] : Object(_baseValues_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, Object(_keysIn_js__WEBPACK_IMPORTED_MODULE_1__["default"])(object));
  123110. }
  123111. /* harmony default export */ __webpack_exports__["default"] = (valuesIn);
  123112. /***/ }),
  123113. /***/ "./node_modules/lodash-es/without.js":
  123114. /*!*******************************************!*\
  123115. !*** ./node_modules/lodash-es/without.js ***!
  123116. \*******************************************/
  123117. /*! exports provided: default */
  123118. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  123119. "use strict";
  123120. __webpack_require__.r(__webpack_exports__);
  123121. /* harmony import */ var _baseDifference_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseDifference.js */ "./node_modules/lodash-es/_baseDifference.js");
  123122. /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
  123123. /* harmony import */ var _isArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./isArrayLikeObject.js */ "./node_modules/lodash-es/isArrayLikeObject.js");
  123124. /**
  123125. * Creates an array excluding all given values using
  123126. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  123127. * for equality comparisons.
  123128. *
  123129. * **Note:** Unlike `_.pull`, this method returns a new array.
  123130. *
  123131. * @static
  123132. * @memberOf _
  123133. * @since 0.1.0
  123134. * @category Array
  123135. * @param {Array} array The array to inspect.
  123136. * @param {...*} [values] The values to exclude.
  123137. * @returns {Array} Returns the new array of filtered values.
  123138. * @see _.difference, _.xor
  123139. * @example
  123140. *
  123141. * _.without([2, 1, 2, 3], 1, 2);
  123142. * // => [3]
  123143. */
  123144. var without = Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_1__["default"])(function(array, values) {
  123145. return Object(_isArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_2__["default"])(array)
  123146. ? Object(_baseDifference_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, values)
  123147. : [];
  123148. });
  123149. /* harmony default export */ __webpack_exports__["default"] = (without);
  123150. /***/ }),
  123151. /***/ "./node_modules/lodash-es/words.js":
  123152. /*!*****************************************!*\
  123153. !*** ./node_modules/lodash-es/words.js ***!
  123154. \*****************************************/
  123155. /*! exports provided: default */
  123156. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  123157. "use strict";
  123158. __webpack_require__.r(__webpack_exports__);
  123159. /* harmony import */ var _asciiWords_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_asciiWords.js */ "./node_modules/lodash-es/_asciiWords.js");
  123160. /* harmony import */ var _hasUnicodeWord_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_hasUnicodeWord.js */ "./node_modules/lodash-es/_hasUnicodeWord.js");
  123161. /* harmony import */ var _toString_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./toString.js */ "./node_modules/lodash-es/toString.js");
  123162. /* harmony import */ var _unicodeWords_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_unicodeWords.js */ "./node_modules/lodash-es/_unicodeWords.js");
  123163. /**
  123164. * Splits `string` into an array of its words.
  123165. *
  123166. * @static
  123167. * @memberOf _
  123168. * @since 3.0.0
  123169. * @category String
  123170. * @param {string} [string=''] The string to inspect.
  123171. * @param {RegExp|string} [pattern] The pattern to match words.
  123172. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  123173. * @returns {Array} Returns the words of `string`.
  123174. * @example
  123175. *
  123176. * _.words('fred, barney, & pebbles');
  123177. * // => ['fred', 'barney', 'pebbles']
  123178. *
  123179. * _.words('fred, barney, & pebbles', /[^, ]+/g);
  123180. * // => ['fred', 'barney', '&', 'pebbles']
  123181. */
  123182. function words(string, pattern, guard) {
  123183. string = Object(_toString_js__WEBPACK_IMPORTED_MODULE_2__["default"])(string);
  123184. pattern = guard ? undefined : pattern;
  123185. if (pattern === undefined) {
  123186. 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);
  123187. }
  123188. return string.match(pattern) || [];
  123189. }
  123190. /* harmony default export */ __webpack_exports__["default"] = (words);
  123191. /***/ }),
  123192. /***/ "./node_modules/lodash-es/wrap.js":
  123193. /*!****************************************!*\
  123194. !*** ./node_modules/lodash-es/wrap.js ***!
  123195. \****************************************/
  123196. /*! exports provided: default */
  123197. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  123198. "use strict";
  123199. __webpack_require__.r(__webpack_exports__);
  123200. /* harmony import */ var _castFunction_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_castFunction.js */ "./node_modules/lodash-es/_castFunction.js");
  123201. /* harmony import */ var _partial_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./partial.js */ "./node_modules/lodash-es/partial.js");
  123202. /**
  123203. * Creates a function that provides `value` to `wrapper` as its first
  123204. * argument. Any additional arguments provided to the function are appended
  123205. * to those provided to the `wrapper`. The wrapper is invoked with the `this`
  123206. * binding of the created function.
  123207. *
  123208. * @static
  123209. * @memberOf _
  123210. * @since 0.1.0
  123211. * @category Function
  123212. * @param {*} value The value to wrap.
  123213. * @param {Function} [wrapper=identity] The wrapper function.
  123214. * @returns {Function} Returns the new function.
  123215. * @example
  123216. *
  123217. * var p = _.wrap(_.escape, function(func, text) {
  123218. * return '<p>' + func(text) + '</p>';
  123219. * });
  123220. *
  123221. * p('fred, barney, & pebbles');
  123222. * // => '<p>fred, barney, &amp; pebbles</p>'
  123223. */
  123224. function wrap(value, wrapper) {
  123225. return Object(_partial_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Object(_castFunction_js__WEBPACK_IMPORTED_MODULE_0__["default"])(wrapper), value);
  123226. }
  123227. /* harmony default export */ __webpack_exports__["default"] = (wrap);
  123228. /***/ }),
  123229. /***/ "./node_modules/lodash-es/wrapperAt.js":
  123230. /*!*********************************************!*\
  123231. !*** ./node_modules/lodash-es/wrapperAt.js ***!
  123232. \*********************************************/
  123233. /*! exports provided: default */
  123234. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  123235. "use strict";
  123236. __webpack_require__.r(__webpack_exports__);
  123237. /* harmony import */ var _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_LazyWrapper.js */ "./node_modules/lodash-es/_LazyWrapper.js");
  123238. /* harmony import */ var _LodashWrapper_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_LodashWrapper.js */ "./node_modules/lodash-es/_LodashWrapper.js");
  123239. /* harmony import */ var _baseAt_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseAt.js */ "./node_modules/lodash-es/_baseAt.js");
  123240. /* harmony import */ var _flatRest_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_flatRest.js */ "./node_modules/lodash-es/_flatRest.js");
  123241. /* harmony import */ var _isIndex_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_isIndex.js */ "./node_modules/lodash-es/_isIndex.js");
  123242. /* harmony import */ var _thru_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./thru.js */ "./node_modules/lodash-es/thru.js");
  123243. /**
  123244. * This method is the wrapper version of `_.at`.
  123245. *
  123246. * @name at
  123247. * @memberOf _
  123248. * @since 1.0.0
  123249. * @category Seq
  123250. * @param {...(string|string[])} [paths] The property paths to pick.
  123251. * @returns {Object} Returns the new `lodash` wrapper instance.
  123252. * @example
  123253. *
  123254. * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
  123255. *
  123256. * _(object).at(['a[0].b.c', 'a[1]']).value();
  123257. * // => [3, 4]
  123258. */
  123259. var wrapperAt = Object(_flatRest_js__WEBPACK_IMPORTED_MODULE_3__["default"])(function(paths) {
  123260. var length = paths.length,
  123261. start = length ? paths[0] : 0,
  123262. value = this.__wrapped__,
  123263. interceptor = function(object) { return Object(_baseAt_js__WEBPACK_IMPORTED_MODULE_2__["default"])(object, paths); };
  123264. if (length > 1 || this.__actions__.length ||
  123265. !(value instanceof _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_0__["default"]) || !Object(_isIndex_js__WEBPACK_IMPORTED_MODULE_4__["default"])(start)) {
  123266. return this.thru(interceptor);
  123267. }
  123268. value = value.slice(start, +start + (length ? 1 : 0));
  123269. value.__actions__.push({
  123270. 'func': _thru_js__WEBPACK_IMPORTED_MODULE_5__["default"],
  123271. 'args': [interceptor],
  123272. 'thisArg': undefined
  123273. });
  123274. return new _LodashWrapper_js__WEBPACK_IMPORTED_MODULE_1__["default"](value, this.__chain__).thru(function(array) {
  123275. if (length && !array.length) {
  123276. array.push(undefined);
  123277. }
  123278. return array;
  123279. });
  123280. });
  123281. /* harmony default export */ __webpack_exports__["default"] = (wrapperAt);
  123282. /***/ }),
  123283. /***/ "./node_modules/lodash-es/wrapperChain.js":
  123284. /*!************************************************!*\
  123285. !*** ./node_modules/lodash-es/wrapperChain.js ***!
  123286. \************************************************/
  123287. /*! exports provided: default */
  123288. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  123289. "use strict";
  123290. __webpack_require__.r(__webpack_exports__);
  123291. /* harmony import */ var _chain_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./chain.js */ "./node_modules/lodash-es/chain.js");
  123292. /**
  123293. * Creates a `lodash` wrapper instance with explicit method chain sequences enabled.
  123294. *
  123295. * @name chain
  123296. * @memberOf _
  123297. * @since 0.1.0
  123298. * @category Seq
  123299. * @returns {Object} Returns the new `lodash` wrapper instance.
  123300. * @example
  123301. *
  123302. * var users = [
  123303. * { 'user': 'barney', 'age': 36 },
  123304. * { 'user': 'fred', 'age': 40 }
  123305. * ];
  123306. *
  123307. * // A sequence without explicit chaining.
  123308. * _(users).head();
  123309. * // => { 'user': 'barney', 'age': 36 }
  123310. *
  123311. * // A sequence with explicit chaining.
  123312. * _(users)
  123313. * .chain()
  123314. * .head()
  123315. * .pick('user')
  123316. * .value();
  123317. * // => { 'user': 'barney' }
  123318. */
  123319. function wrapperChain() {
  123320. return Object(_chain_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this);
  123321. }
  123322. /* harmony default export */ __webpack_exports__["default"] = (wrapperChain);
  123323. /***/ }),
  123324. /***/ "./node_modules/lodash-es/wrapperLodash.js":
  123325. /*!*************************************************!*\
  123326. !*** ./node_modules/lodash-es/wrapperLodash.js ***!
  123327. \*************************************************/
  123328. /*! exports provided: default */
  123329. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  123330. "use strict";
  123331. __webpack_require__.r(__webpack_exports__);
  123332. /* harmony import */ var _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_LazyWrapper.js */ "./node_modules/lodash-es/_LazyWrapper.js");
  123333. /* harmony import */ var _LodashWrapper_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_LodashWrapper.js */ "./node_modules/lodash-es/_LodashWrapper.js");
  123334. /* harmony import */ var _baseLodash_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseLodash.js */ "./node_modules/lodash-es/_baseLodash.js");
  123335. /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
  123336. /* harmony import */ var _isObjectLike_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./isObjectLike.js */ "./node_modules/lodash-es/isObjectLike.js");
  123337. /* harmony import */ var _wrapperClone_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./_wrapperClone.js */ "./node_modules/lodash-es/_wrapperClone.js");
  123338. /** Used for built-in method references. */
  123339. var objectProto = Object.prototype;
  123340. /** Used to check objects for own properties. */
  123341. var hasOwnProperty = objectProto.hasOwnProperty;
  123342. /**
  123343. * Creates a `lodash` object which wraps `value` to enable implicit method
  123344. * chain sequences. Methods that operate on and return arrays, collections,
  123345. * and functions can be chained together. Methods that retrieve a single value
  123346. * or may return a primitive value will automatically end the chain sequence
  123347. * and return the unwrapped value. Otherwise, the value must be unwrapped
  123348. * with `_#value`.
  123349. *
  123350. * Explicit chain sequences, which must be unwrapped with `_#value`, may be
  123351. * enabled using `_.chain`.
  123352. *
  123353. * The execution of chained methods is lazy, that is, it's deferred until
  123354. * `_#value` is implicitly or explicitly called.
  123355. *
  123356. * Lazy evaluation allows several methods to support shortcut fusion.
  123357. * Shortcut fusion is an optimization to merge iteratee calls; this avoids
  123358. * the creation of intermediate arrays and can greatly reduce the number of
  123359. * iteratee executions. Sections of a chain sequence qualify for shortcut
  123360. * fusion if the section is applied to an array and iteratees accept only
  123361. * one argument. The heuristic for whether a section qualifies for shortcut
  123362. * fusion is subject to change.
  123363. *
  123364. * Chaining is supported in custom builds as long as the `_#value` method is
  123365. * directly or indirectly included in the build.
  123366. *
  123367. * In addition to lodash methods, wrappers have `Array` and `String` methods.
  123368. *
  123369. * The wrapper `Array` methods are:
  123370. * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift`
  123371. *
  123372. * The wrapper `String` methods are:
  123373. * `replace` and `split`
  123374. *
  123375. * The wrapper methods that support shortcut fusion are:
  123376. * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`,
  123377. * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`,
  123378. * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray`
  123379. *
  123380. * The chainable wrapper methods are:
  123381. * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`,
  123382. * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`,
  123383. * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`,
  123384. * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`,
  123385. * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`,
  123386. * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`,
  123387. * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`,
  123388. * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`,
  123389. * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`,
  123390. * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`,
  123391. * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`,
  123392. * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`,
  123393. * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`,
  123394. * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`,
  123395. * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`,
  123396. * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`,
  123397. * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`,
  123398. * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`,
  123399. * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`,
  123400. * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`,
  123401. * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`,
  123402. * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`,
  123403. * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`,
  123404. * `zipObject`, `zipObjectDeep`, and `zipWith`
  123405. *
  123406. * The wrapper methods that are **not** chainable by default are:
  123407. * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`,
  123408. * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`,
  123409. * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`,
  123410. * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`,
  123411. * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`,
  123412. * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`,
  123413. * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`,
  123414. * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`,
  123415. * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`,
  123416. * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`,
  123417. * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`,
  123418. * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`,
  123419. * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`,
  123420. * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`,
  123421. * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`,
  123422. * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`,
  123423. * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`,
  123424. * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`,
  123425. * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`,
  123426. * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`,
  123427. * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`,
  123428. * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`,
  123429. * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`,
  123430. * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`,
  123431. * `upperFirst`, `value`, and `words`
  123432. *
  123433. * @name _
  123434. * @constructor
  123435. * @category Seq
  123436. * @param {*} value The value to wrap in a `lodash` instance.
  123437. * @returns {Object} Returns the new `lodash` wrapper instance.
  123438. * @example
  123439. *
  123440. * function square(n) {
  123441. * return n * n;
  123442. * }
  123443. *
  123444. * var wrapped = _([1, 2, 3]);
  123445. *
  123446. * // Returns an unwrapped value.
  123447. * wrapped.reduce(_.add);
  123448. * // => 6
  123449. *
  123450. * // Returns a wrapped value.
  123451. * var squares = wrapped.map(square);
  123452. *
  123453. * _.isArray(squares);
  123454. * // => false
  123455. *
  123456. * _.isArray(squares.value());
  123457. * // => true
  123458. */
  123459. function lodash(value) {
  123460. 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"])) {
  123461. if (value instanceof _LodashWrapper_js__WEBPACK_IMPORTED_MODULE_1__["default"]) {
  123462. return value;
  123463. }
  123464. if (hasOwnProperty.call(value, '__wrapped__')) {
  123465. return Object(_wrapperClone_js__WEBPACK_IMPORTED_MODULE_5__["default"])(value);
  123466. }
  123467. }
  123468. return new _LodashWrapper_js__WEBPACK_IMPORTED_MODULE_1__["default"](value);
  123469. }
  123470. // Ensure wrappers are instances of `baseLodash`.
  123471. lodash.prototype = _baseLodash_js__WEBPACK_IMPORTED_MODULE_2__["default"].prototype;
  123472. lodash.prototype.constructor = lodash;
  123473. /* harmony default export */ __webpack_exports__["default"] = (lodash);
  123474. /***/ }),
  123475. /***/ "./node_modules/lodash-es/wrapperReverse.js":
  123476. /*!**************************************************!*\
  123477. !*** ./node_modules/lodash-es/wrapperReverse.js ***!
  123478. \**************************************************/
  123479. /*! exports provided: default */
  123480. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  123481. "use strict";
  123482. __webpack_require__.r(__webpack_exports__);
  123483. /* harmony import */ var _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_LazyWrapper.js */ "./node_modules/lodash-es/_LazyWrapper.js");
  123484. /* harmony import */ var _LodashWrapper_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_LodashWrapper.js */ "./node_modules/lodash-es/_LodashWrapper.js");
  123485. /* harmony import */ var _reverse_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./reverse.js */ "./node_modules/lodash-es/reverse.js");
  123486. /* harmony import */ var _thru_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./thru.js */ "./node_modules/lodash-es/thru.js");
  123487. /**
  123488. * This method is the wrapper version of `_.reverse`.
  123489. *
  123490. * **Note:** This method mutates the wrapped array.
  123491. *
  123492. * @name reverse
  123493. * @memberOf _
  123494. * @since 0.1.0
  123495. * @category Seq
  123496. * @returns {Object} Returns the new `lodash` wrapper instance.
  123497. * @example
  123498. *
  123499. * var array = [1, 2, 3];
  123500. *
  123501. * _(array).reverse().value()
  123502. * // => [3, 2, 1]
  123503. *
  123504. * console.log(array);
  123505. * // => [3, 2, 1]
  123506. */
  123507. function wrapperReverse() {
  123508. var value = this.__wrapped__;
  123509. if (value instanceof _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_0__["default"]) {
  123510. var wrapped = value;
  123511. if (this.__actions__.length) {
  123512. wrapped = new _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_0__["default"](this);
  123513. }
  123514. wrapped = wrapped.reverse();
  123515. wrapped.__actions__.push({
  123516. 'func': _thru_js__WEBPACK_IMPORTED_MODULE_3__["default"],
  123517. 'args': [_reverse_js__WEBPACK_IMPORTED_MODULE_2__["default"]],
  123518. 'thisArg': undefined
  123519. });
  123520. return new _LodashWrapper_js__WEBPACK_IMPORTED_MODULE_1__["default"](wrapped, this.__chain__);
  123521. }
  123522. return this.thru(_reverse_js__WEBPACK_IMPORTED_MODULE_2__["default"]);
  123523. }
  123524. /* harmony default export */ __webpack_exports__["default"] = (wrapperReverse);
  123525. /***/ }),
  123526. /***/ "./node_modules/lodash-es/wrapperValue.js":
  123527. /*!************************************************!*\
  123528. !*** ./node_modules/lodash-es/wrapperValue.js ***!
  123529. \************************************************/
  123530. /*! exports provided: default */
  123531. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  123532. "use strict";
  123533. __webpack_require__.r(__webpack_exports__);
  123534. /* harmony import */ var _baseWrapperValue_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseWrapperValue.js */ "./node_modules/lodash-es/_baseWrapperValue.js");
  123535. /**
  123536. * Executes the chain sequence to resolve the unwrapped value.
  123537. *
  123538. * @name value
  123539. * @memberOf _
  123540. * @since 0.1.0
  123541. * @alias toJSON, valueOf
  123542. * @category Seq
  123543. * @returns {*} Returns the resolved unwrapped value.
  123544. * @example
  123545. *
  123546. * _([1, 2, 3]).value();
  123547. * // => [1, 2, 3]
  123548. */
  123549. function wrapperValue() {
  123550. return Object(_baseWrapperValue_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this.__wrapped__, this.__actions__);
  123551. }
  123552. /* harmony default export */ __webpack_exports__["default"] = (wrapperValue);
  123553. /***/ }),
  123554. /***/ "./node_modules/lodash-es/xor.js":
  123555. /*!***************************************!*\
  123556. !*** ./node_modules/lodash-es/xor.js ***!
  123557. \***************************************/
  123558. /*! exports provided: default */
  123559. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  123560. "use strict";
  123561. __webpack_require__.r(__webpack_exports__);
  123562. /* harmony import */ var _arrayFilter_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayFilter.js */ "./node_modules/lodash-es/_arrayFilter.js");
  123563. /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
  123564. /* harmony import */ var _baseXor_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseXor.js */ "./node_modules/lodash-es/_baseXor.js");
  123565. /* harmony import */ var _isArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./isArrayLikeObject.js */ "./node_modules/lodash-es/isArrayLikeObject.js");
  123566. /**
  123567. * Creates an array of unique values that is the
  123568. * [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference)
  123569. * of the given arrays. The order of result values is determined by the order
  123570. * they occur in the arrays.
  123571. *
  123572. * @static
  123573. * @memberOf _
  123574. * @since 2.4.0
  123575. * @category Array
  123576. * @param {...Array} [arrays] The arrays to inspect.
  123577. * @returns {Array} Returns the new array of filtered values.
  123578. * @see _.difference, _.without
  123579. * @example
  123580. *
  123581. * _.xor([2, 1], [2, 3]);
  123582. * // => [1, 3]
  123583. */
  123584. var xor = Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_1__["default"])(function(arrays) {
  123585. 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"]));
  123586. });
  123587. /* harmony default export */ __webpack_exports__["default"] = (xor);
  123588. /***/ }),
  123589. /***/ "./node_modules/lodash-es/xorBy.js":
  123590. /*!*****************************************!*\
  123591. !*** ./node_modules/lodash-es/xorBy.js ***!
  123592. \*****************************************/
  123593. /*! exports provided: default */
  123594. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  123595. "use strict";
  123596. __webpack_require__.r(__webpack_exports__);
  123597. /* harmony import */ var _arrayFilter_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayFilter.js */ "./node_modules/lodash-es/_arrayFilter.js");
  123598. /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
  123599. /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
  123600. /* harmony import */ var _baseXor_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_baseXor.js */ "./node_modules/lodash-es/_baseXor.js");
  123601. /* harmony import */ var _isArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./isArrayLikeObject.js */ "./node_modules/lodash-es/isArrayLikeObject.js");
  123602. /* harmony import */ var _last_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./last.js */ "./node_modules/lodash-es/last.js");
  123603. /**
  123604. * This method is like `_.xor` except that it accepts `iteratee` which is
  123605. * invoked for each element of each `arrays` to generate the criterion by
  123606. * which by which they're compared. The order of result values is determined
  123607. * by the order they occur in the arrays. The iteratee is invoked with one
  123608. * argument: (value).
  123609. *
  123610. * @static
  123611. * @memberOf _
  123612. * @since 4.0.0
  123613. * @category Array
  123614. * @param {...Array} [arrays] The arrays to inspect.
  123615. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  123616. * @returns {Array} Returns the new array of filtered values.
  123617. * @example
  123618. *
  123619. * _.xorBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  123620. * // => [1.2, 3.4]
  123621. *
  123622. * // The `_.property` iteratee shorthand.
  123623. * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  123624. * // => [{ 'x': 2 }]
  123625. */
  123626. var xorBy = Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_2__["default"])(function(arrays) {
  123627. var iteratee = Object(_last_js__WEBPACK_IMPORTED_MODULE_5__["default"])(arrays);
  123628. if (Object(_isArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_4__["default"])(iteratee)) {
  123629. iteratee = undefined;
  123630. }
  123631. 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));
  123632. });
  123633. /* harmony default export */ __webpack_exports__["default"] = (xorBy);
  123634. /***/ }),
  123635. /***/ "./node_modules/lodash-es/xorWith.js":
  123636. /*!*******************************************!*\
  123637. !*** ./node_modules/lodash-es/xorWith.js ***!
  123638. \*******************************************/
  123639. /*! exports provided: default */
  123640. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  123641. "use strict";
  123642. __webpack_require__.r(__webpack_exports__);
  123643. /* harmony import */ var _arrayFilter_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayFilter.js */ "./node_modules/lodash-es/_arrayFilter.js");
  123644. /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
  123645. /* harmony import */ var _baseXor_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseXor.js */ "./node_modules/lodash-es/_baseXor.js");
  123646. /* harmony import */ var _isArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./isArrayLikeObject.js */ "./node_modules/lodash-es/isArrayLikeObject.js");
  123647. /* harmony import */ var _last_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./last.js */ "./node_modules/lodash-es/last.js");
  123648. /**
  123649. * This method is like `_.xor` except that it accepts `comparator` which is
  123650. * invoked to compare elements of `arrays`. The order of result values is
  123651. * determined by the order they occur in the arrays. The comparator is invoked
  123652. * with two arguments: (arrVal, othVal).
  123653. *
  123654. * @static
  123655. * @memberOf _
  123656. * @since 4.0.0
  123657. * @category Array
  123658. * @param {...Array} [arrays] The arrays to inspect.
  123659. * @param {Function} [comparator] The comparator invoked per element.
  123660. * @returns {Array} Returns the new array of filtered values.
  123661. * @example
  123662. *
  123663. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  123664. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  123665. *
  123666. * _.xorWith(objects, others, _.isEqual);
  123667. * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
  123668. */
  123669. var xorWith = Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_1__["default"])(function(arrays) {
  123670. var comparator = Object(_last_js__WEBPACK_IMPORTED_MODULE_4__["default"])(arrays);
  123671. comparator = typeof comparator == 'function' ? comparator : undefined;
  123672. 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);
  123673. });
  123674. /* harmony default export */ __webpack_exports__["default"] = (xorWith);
  123675. /***/ }),
  123676. /***/ "./node_modules/lodash-es/zip.js":
  123677. /*!***************************************!*\
  123678. !*** ./node_modules/lodash-es/zip.js ***!
  123679. \***************************************/
  123680. /*! exports provided: default */
  123681. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  123682. "use strict";
  123683. __webpack_require__.r(__webpack_exports__);
  123684. /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
  123685. /* harmony import */ var _unzip_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./unzip.js */ "./node_modules/lodash-es/unzip.js");
  123686. /**
  123687. * Creates an array of grouped elements, the first of which contains the
  123688. * first elements of the given arrays, the second of which contains the
  123689. * second elements of the given arrays, and so on.
  123690. *
  123691. * @static
  123692. * @memberOf _
  123693. * @since 0.1.0
  123694. * @category Array
  123695. * @param {...Array} [arrays] The arrays to process.
  123696. * @returns {Array} Returns the new array of grouped elements.
  123697. * @example
  123698. *
  123699. * _.zip(['a', 'b'], [1, 2], [true, false]);
  123700. * // => [['a', 1, true], ['b', 2, false]]
  123701. */
  123702. var zip = Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_0__["default"])(_unzip_js__WEBPACK_IMPORTED_MODULE_1__["default"]);
  123703. /* harmony default export */ __webpack_exports__["default"] = (zip);
  123704. /***/ }),
  123705. /***/ "./node_modules/lodash-es/zipObject.js":
  123706. /*!*********************************************!*\
  123707. !*** ./node_modules/lodash-es/zipObject.js ***!
  123708. \*********************************************/
  123709. /*! exports provided: default */
  123710. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  123711. "use strict";
  123712. __webpack_require__.r(__webpack_exports__);
  123713. /* harmony import */ var _assignValue_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_assignValue.js */ "./node_modules/lodash-es/_assignValue.js");
  123714. /* harmony import */ var _baseZipObject_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseZipObject.js */ "./node_modules/lodash-es/_baseZipObject.js");
  123715. /**
  123716. * This method is like `_.fromPairs` except that it accepts two arrays,
  123717. * one of property identifiers and one of corresponding values.
  123718. *
  123719. * @static
  123720. * @memberOf _
  123721. * @since 0.4.0
  123722. * @category Array
  123723. * @param {Array} [props=[]] The property identifiers.
  123724. * @param {Array} [values=[]] The property values.
  123725. * @returns {Object} Returns the new object.
  123726. * @example
  123727. *
  123728. * _.zipObject(['a', 'b'], [1, 2]);
  123729. * // => { 'a': 1, 'b': 2 }
  123730. */
  123731. function zipObject(props, values) {
  123732. return Object(_baseZipObject_js__WEBPACK_IMPORTED_MODULE_1__["default"])(props || [], values || [], _assignValue_js__WEBPACK_IMPORTED_MODULE_0__["default"]);
  123733. }
  123734. /* harmony default export */ __webpack_exports__["default"] = (zipObject);
  123735. /***/ }),
  123736. /***/ "./node_modules/lodash-es/zipObjectDeep.js":
  123737. /*!*************************************************!*\
  123738. !*** ./node_modules/lodash-es/zipObjectDeep.js ***!
  123739. \*************************************************/
  123740. /*! exports provided: default */
  123741. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  123742. "use strict";
  123743. __webpack_require__.r(__webpack_exports__);
  123744. /* harmony import */ var _baseSet_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseSet.js */ "./node_modules/lodash-es/_baseSet.js");
  123745. /* harmony import */ var _baseZipObject_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseZipObject.js */ "./node_modules/lodash-es/_baseZipObject.js");
  123746. /**
  123747. * This method is like `_.zipObject` except that it supports property paths.
  123748. *
  123749. * @static
  123750. * @memberOf _
  123751. * @since 4.1.0
  123752. * @category Array
  123753. * @param {Array} [props=[]] The property identifiers.
  123754. * @param {Array} [values=[]] The property values.
  123755. * @returns {Object} Returns the new object.
  123756. * @example
  123757. *
  123758. * _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]);
  123759. * // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } }
  123760. */
  123761. function zipObjectDeep(props, values) {
  123762. return Object(_baseZipObject_js__WEBPACK_IMPORTED_MODULE_1__["default"])(props || [], values || [], _baseSet_js__WEBPACK_IMPORTED_MODULE_0__["default"]);
  123763. }
  123764. /* harmony default export */ __webpack_exports__["default"] = (zipObjectDeep);
  123765. /***/ }),
  123766. /***/ "./node_modules/lodash-es/zipWith.js":
  123767. /*!*******************************************!*\
  123768. !*** ./node_modules/lodash-es/zipWith.js ***!
  123769. \*******************************************/
  123770. /*! exports provided: default */
  123771. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  123772. "use strict";
  123773. __webpack_require__.r(__webpack_exports__);
  123774. /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
  123775. /* harmony import */ var _unzipWith_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./unzipWith.js */ "./node_modules/lodash-es/unzipWith.js");
  123776. /**
  123777. * This method is like `_.zip` except that it accepts `iteratee` to specify
  123778. * how grouped values should be combined. The iteratee is invoked with the
  123779. * elements of each group: (...group).
  123780. *
  123781. * @static
  123782. * @memberOf _
  123783. * @since 3.8.0
  123784. * @category Array
  123785. * @param {...Array} [arrays] The arrays to process.
  123786. * @param {Function} [iteratee=_.identity] The function to combine
  123787. * grouped values.
  123788. * @returns {Array} Returns the new array of grouped elements.
  123789. * @example
  123790. *
  123791. * _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) {
  123792. * return a + b + c;
  123793. * });
  123794. * // => [111, 222]
  123795. */
  123796. var zipWith = Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function(arrays) {
  123797. var length = arrays.length,
  123798. iteratee = length > 1 ? arrays[length - 1] : undefined;
  123799. iteratee = typeof iteratee == 'function' ? (arrays.pop(), iteratee) : undefined;
  123800. return Object(_unzipWith_js__WEBPACK_IMPORTED_MODULE_1__["default"])(arrays, iteratee);
  123801. });
  123802. /* harmony default export */ __webpack_exports__["default"] = (zipWith);
  123803. /***/ }),
  123804. /***/ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-block-quote/theme/blockquote.css":
  123805. /*!***********************************************************************************************************************!*\
  123806. !*** ./node_modules/postcss-loader/src??ref--5-1!./node_modules/@ckeditor/ckeditor5-block-quote/theme/blockquote.css ***!
  123807. \***********************************************************************************************************************/
  123808. /*! no static exports found */
  123809. /***/ (function(module, exports) {
  123810. 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}"
  123811. /***/ }),
  123812. /***/ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-clipboard/theme/clipboard.css":
  123813. /*!********************************************************************************************************************!*\
  123814. !*** ./node_modules/postcss-loader/src??ref--5-1!./node_modules/@ckeditor/ckeditor5-clipboard/theme/clipboard.css ***!
  123815. \********************************************************************************************************************/
  123816. /*! no static exports found */
  123817. /***/ (function(module, exports) {
  123818. module.exports = ".ck.ck-editor__editable .ck.ck-clipboard-drop-target-position{display:inline;position:relative;pointer-events:none}.ck.ck-editor__editable .ck.ck-clipboard-drop-target-position span{position:absolute;width:0}.ck.ck-editor__editable .ck-widget:-webkit-drag>.ck-widget__selection-handle,.ck.ck-editor__editable .ck-widget:-webkit-drag>.ck-widget__type-around{display:none}:root{--ck-clipboard-drop-target-dot-width:12px;--ck-clipboard-drop-target-dot-height:8px;--ck-clipboard-drop-target-color:var(--ck-color-focus-border)}.ck.ck-editor__editable .ck.ck-clipboard-drop-target-position span{bottom:calc(var(--ck-clipboard-drop-target-dot-height)*-0.5);top:calc(var(--ck-clipboard-drop-target-dot-height)*-0.5);border:1px solid var(--ck-clipboard-drop-target-color);background:var(--ck-clipboard-drop-target-color);margin-left:-1px}.ck.ck-editor__editable .ck.ck-clipboard-drop-target-position span:after{content:\"\";width:0;height:0;display:block;position:absolute;left:50%;top:calc(var(--ck-clipboard-drop-target-dot-height)*-0.5);transform:translateX(-50%);border-left:calc(var(--ck-clipboard-drop-target-dot-width)*0.5) solid transparent;border-bottom:0 solid transparent;border-right:calc(var(--ck-clipboard-drop-target-dot-width)*0.5) solid transparent;border-top:calc(var(--ck-clipboard-drop-target-dot-height)) solid var(--ck-clipboard-drop-target-color)}.ck.ck-editor__editable .ck-widget.ck-clipboard-drop-target-range{outline:var(--ck-widget-outline-thickness) solid var(--ck-clipboard-drop-target-color)!important}.ck.ck-editor__editable .ck-widget:-webkit-drag{zoom:.6;outline:none!important}"
  123819. /***/ }),
  123820. /***/ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-editor-classic/theme/classiceditor.css":
  123821. /*!*****************************************************************************************************************************!*\
  123822. !*** ./node_modules/postcss-loader/src??ref--5-1!./node_modules/@ckeditor/ckeditor5-editor-classic/theme/classiceditor.css ***!
  123823. \*****************************************************************************************************************************/
  123824. /*! no static exports found */
  123825. /***/ (function(module, exports) {
  123826. 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)}"
  123827. /***/ }),
  123828. /***/ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-engine/theme/placeholder.css":
  123829. /*!*******************************************************************************************************************!*\
  123830. !*** ./node_modules/postcss-loader/src??ref--5-1!./node_modules/@ckeditor/ckeditor5-engine/theme/placeholder.css ***!
  123831. \*******************************************************************************************************************/
  123832. /*! no static exports found */
  123833. /***/ (function(module, exports) {
  123834. module.exports = ".ck.ck-placeholder,.ck .ck-placeholder{position:relative}.ck.ck-placeholder:before,.ck .ck-placeholder:before{position:absolute;left:0;right:0;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)}"
  123835. /***/ }),
  123836. /***/ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-font/theme/fontcolor.css":
  123837. /*!***************************************************************************************************************!*\
  123838. !*** ./node_modules/postcss-loader/src??ref--5-1!./node_modules/@ckeditor/ckeditor5-font/theme/fontcolor.css ***!
  123839. \***************************************************************************************************************/
  123840. /*! no static exports found */
  123841. /***/ (function(module, exports) {
  123842. 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)}"
  123843. /***/ }),
  123844. /***/ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-heading/theme/heading.css":
  123845. /*!****************************************************************************************************************!*\
  123846. !*** ./node_modules/postcss-loader/src??ref--5-1!./node_modules/@ckeditor/ckeditor5-heading/theme/heading.css ***!
  123847. \****************************************************************************************************************/
  123848. /*! no static exports found */
  123849. /***/ (function(module, exports) {
  123850. 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}"
  123851. /***/ }),
  123852. /***/ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-html-embed/theme/htmlembed.css":
  123853. /*!*********************************************************************************************************************!*\
  123854. !*** ./node_modules/postcss-loader/src??ref--5-1!./node_modules/@ckeditor/ckeditor5-html-embed/theme/htmlembed.css ***!
  123855. \*********************************************************************************************************************/
  123856. /*! no static exports found */
  123857. /***/ (function(module, exports) {
  123858. module.exports = ".ck-widget.raw-html-embed{margin:1em auto;position:relative;display:flow-root}.ck-widget.raw-html-embed:before{position:absolute;z-index:1}.ck-widget.raw-html-embed .raw-html-embed__buttons-wrapper{position:absolute;display:flex;flex-direction:column}.ck-widget.raw-html-embed .raw-html-embed__preview{position:relative;overflow:hidden;display:flex}.ck-widget.raw-html-embed .raw-html-embed__preview-content{width:100%;position:relative;margin:auto;display:table;border-collapse:separate;border-spacing:7px}.ck-widget.raw-html-embed .raw-html-embed__preview-placeholder{position:absolute;left:0;top:0;right:0;bottom:0;display:flex;align-items:center;justify-content:center}.ck-content .raw-html-embed{margin:1em auto;min-width:15em;font-style:normal}:root{--ck-html-embed-content-width:calc(100% - var(--ck-icon-size)*1.5);--ck-html-embed-source-height:10em;--ck-html-embed-unfocused-outline-width:1px;--ck-html-embed-content-min-height:calc(var(--ck-icon-size) + var(--ck-spacing-standard));--ck-html-embed-source-disabled-background:var(--ck-color-base-foreground);--ck-html-embed-source-disabled-color:#737373}.ck-widget.raw-html-embed{font-size:var(--ck-font-size-base);background-color:var(--ck-color-base-foreground)}.ck-widget.raw-html-embed:not(.ck-widget_selected):not(:hover){outline:var(--ck-html-embed-unfocused-outline-width) dashed var(--ck-color-widget-blurred-border)}.ck-widget.raw-html-embed[dir=ltr]{text-align:left}.ck-widget.raw-html-embed[dir=rtl]{text-align:right}.ck-widget.raw-html-embed:before{content:attr(data-html-embed-label);top:calc(var(--ck-html-embed-unfocused-outline-width)*-1);left:var(--ck-spacing-standard);background:#999;transition:background var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve);padding:calc(var(--ck-spacing-tiny) + var(--ck-html-embed-unfocused-outline-width)) var(--ck-spacing-small) var(--ck-spacing-tiny);border-radius:0 0 var(--ck-border-radius) var(--ck-border-radius);color:var(--ck-color-base-background);font-size:var(--ck-font-size-tiny);font-family:var(--ck-font-face)}.ck-widget.raw-html-embed[dir=rtl]:before{left:auto;right:var(--ck-spacing-standard)}.ck-widget.raw-html-embed[dir=ltr] .ck-widget__type-around .ck-widget__type-around__button.ck-widget__type-around__button_before{margin-left:50px}.ck.ck-editor__editable.ck-blurred .ck-widget.raw-html-embed.ck-widget_selected:before{top:0;padding:var(--ck-spacing-tiny) var(--ck-spacing-small)}.ck.ck-editor__editable:not(.ck-blurred) .ck-widget.raw-html-embed.ck-widget_selected:before{top:0;padding:var(--ck-spacing-tiny) var(--ck-spacing-small);background:var(--ck-color-focus-border)}.ck.ck-editor__editable .ck-widget.raw-html-embed:not(.ck-widget_selected):hover:before{top:0;padding:var(--ck-spacing-tiny) var(--ck-spacing-small)}.ck-widget.raw-html-embed .raw-html-embed__content-wrapper{padding:var(--ck-spacing-standard)}.ck-widget.raw-html-embed .raw-html-embed__buttons-wrapper{top:var(--ck-spacing-standard);right:var(--ck-spacing-standard)}.ck-widget.raw-html-embed .raw-html-embed__buttons-wrapper .ck-button.raw-html-embed__save-button{color:var(--ck-color-button-save)}.ck-widget.raw-html-embed .raw-html-embed__buttons-wrapper .ck-button.raw-html-embed__cancel-button{color:var(--ck-color-button-cancel)}.ck-widget.raw-html-embed .raw-html-embed__buttons-wrapper .ck-button:not(:first-child){margin-top:var(--ck-spacing-small)}.ck-widget.raw-html-embed[dir=rtl] .raw-html-embed__buttons-wrapper{left:var(--ck-spacing-standard);right:auto}.ck-widget.raw-html-embed .raw-html-embed__source{box-sizing:border-box;height:var(--ck-html-embed-source-height);width:var(--ck-html-embed-content-width);resize:none;min-width:0;padding:var(--ck-spacing-standard);font-family:monospace;tab-size:4;white-space:pre-wrap;font-size:var(--ck-font-size-base);text-align:left;direction:ltr}.ck-widget.raw-html-embed .raw-html-embed__source[disabled]{background:var(--ck-html-embed-source-disabled-background);color:var(--ck-html-embed-source-disabled-color);-webkit-text-fill-color:var(--ck-html-embed-source-disabled-color);opacity:1}.ck-widget.raw-html-embed .raw-html-embed__preview{min-height:var(--ck-html-embed-content-min-height);width:var(--ck-html-embed-content-width)}.ck-editor__editable:not(.ck-read-only) .ck-widget.raw-html-embed .raw-html-embed__preview{pointer-events:none}.ck-widget.raw-html-embed .raw-html-embed__preview-content{box-sizing:border-box;text-align:center;background-color:var(--ck-color-base-foreground)}.ck-widget.raw-html-embed .raw-html-embed__preview-content>*{margin-left:auto;margin-right:auto}.ck-widget.raw-html-embed .raw-html-embed__preview-placeholder{color:var(--ck-html-embed-source-disabled-color)}"
  123859. /***/ }),
  123860. /***/ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-image/theme/image.css":
  123861. /*!************************************************************************************************************!*\
  123862. !*** ./node_modules/postcss-loader/src??ref--5-1!./node_modules/@ckeditor/ckeditor5-image/theme/image.css ***!
  123863. \************************************************************************************************************/
  123864. /*! no static exports found */
  123865. /***/ (function(module, exports) {
  123866. 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}.ck.ck-editor__editable .image>figcaption.ck-placeholder:before{position:static}"
  123867. /***/ }),
  123868. /***/ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-image/theme/imagecaption.css":
  123869. /*!*******************************************************************************************************************!*\
  123870. !*** ./node_modules/postcss-loader/src??ref--5-1!./node_modules/@ckeditor/ckeditor5-image/theme/imagecaption.css ***!
  123871. \*******************************************************************************************************************/
  123872. /*! no static exports found */
  123873. /***/ (function(module, exports) {
  123874. 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}"
  123875. /***/ }),
  123876. /***/ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-image/theme/imageresize.css":
  123877. /*!******************************************************************************************************************!*\
  123878. !*** ./node_modules/postcss-loader/src??ref--5-1!./node_modules/@ckeditor/ckeditor5-image/theme/imageresize.css ***!
  123879. \******************************************************************************************************************/
  123880. /*! no static exports found */
  123881. /***/ (function(module, exports) {
  123882. 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}"
  123883. /***/ }),
  123884. /***/ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-image/theme/imagestyle.css":
  123885. /*!*****************************************************************************************************************!*\
  123886. !*** ./node_modules/postcss-loader/src??ref--5-1!./node_modules/@ckeditor/ckeditor5-image/theme/imagestyle.css ***!
  123887. \*****************************************************************************************************************/
  123888. /*! no static exports found */
  123889. /***/ (function(module, exports) {
  123890. 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)}"
  123891. /***/ }),
  123892. /***/ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-image/theme/imageuploadicon.css":
  123893. /*!**********************************************************************************************************************!*\
  123894. !*** ./node_modules/postcss-loader/src??ref--5-1!./node_modules/@ckeditor/ckeditor5-image/theme/imageuploadicon.css ***!
  123895. \**********************************************************************************************************************/
  123896. /*! no static exports found */
  123897. /***/ (function(module, exports) {
  123898. 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}}"
  123899. /***/ }),
  123900. /***/ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-image/theme/imageuploadloader.css":
  123901. /*!************************************************************************************************************************!*\
  123902. !*** ./node_modules/postcss-loader/src??ref--5-1!./node_modules/@ckeditor/ckeditor5-image/theme/imageuploadloader.css ***!
  123903. \************************************************************************************************************************/
  123904. /*! no static exports found */
  123905. /***/ (function(module, exports) {
  123906. 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)}}"
  123907. /***/ }),
  123908. /***/ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-image/theme/imageuploadprogress.css":
  123909. /*!**************************************************************************************************************************!*\
  123910. !*** ./node_modules/postcss-loader/src??ref--5-1!./node_modules/@ckeditor/ckeditor5-image/theme/imageuploadprogress.css ***!
  123911. \**************************************************************************************************************************/
  123912. /*! no static exports found */
  123913. /***/ (function(module, exports) {
  123914. 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}}"
  123915. /***/ }),
  123916. /***/ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-image/theme/textalternativeform.css":
  123917. /*!**************************************************************************************************************************!*\
  123918. !*** ./node_modules/postcss-loader/src??ref--5-1!./node_modules/@ckeditor/ckeditor5-image/theme/textalternativeform.css ***!
  123919. \**************************************************************************************************************************/
  123920. /*! no static exports found */
  123921. /***/ (function(module, exports) {
  123922. 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%}}"
  123923. /***/ }),
  123924. /***/ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-link/theme/link.css":
  123925. /*!**********************************************************************************************************!*\
  123926. !*** ./node_modules/postcss-loader/src??ref--5-1!./node_modules/@ckeditor/ckeditor5-link/theme/link.css ***!
  123927. \**********************************************************************************************************/
  123928. /*! no static exports found */
  123929. /***/ (function(module, exports) {
  123930. 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)}"
  123931. /***/ }),
  123932. /***/ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-link/theme/linkactions.css":
  123933. /*!*****************************************************************************************************************!*\
  123934. !*** ./node_modules/postcss-loader/src??ref--5-1!./node_modules/@ckeditor/ckeditor5-link/theme/linkactions.css ***!
  123935. \*****************************************************************************************************************/
  123936. /*! no static exports found */
  123937. /***/ (function(module, exports) {
  123938. 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}}"
  123939. /***/ }),
  123940. /***/ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-link/theme/linkform.css":
  123941. /*!**************************************************************************************************************!*\
  123942. !*** ./node_modules/postcss-loader/src??ref--5-1!./node_modules/@ckeditor/ckeditor5-link/theme/linkform.css ***!
  123943. \**************************************************************************************************************/
  123944. /*! no static exports found */
  123945. /***/ (function(module, exports) {
  123946. 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}.ck.ck-link-form_layout-vertical .ck-button.ck-button-cancel,.ck.ck-link-form_layout-vertical .ck-button.ck-button-save{margin-top:var(--ck-spacing-medium)}.ck.ck-link-form_layout-vertical{padding:0;min-width:var(--ck-input-text-width)}.ck.ck-link-form_layout-vertical .ck-labeled-field-view{margin:var(--ck-spacing-large) var(--ck-spacing-large) 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:var(--ck-spacing-standard) var(--ck-spacing-large)}.ck.ck-link-form_layout-vertical .ck.ck-list .ck-button.ck-switchbutton{border:0;padding:0;width:100%}.ck.ck-link-form_layout-vertical .ck.ck-list .ck-button.ck-switchbutton:hover{background:none}"
  123947. /***/ }),
  123948. /***/ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-link/theme/linkimage.css":
  123949. /*!***************************************************************************************************************!*\
  123950. !*** ./node_modules/postcss-loader/src??ref--5-1!./node_modules/@ckeditor/ckeditor5-link/theme/linkimage.css ***!
  123951. \***************************************************************************************************************/
  123952. /*! no static exports found */
  123953. /***/ (function(module, exports) {
  123954. 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)}"
  123955. /***/ }),
  123956. /***/ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-table/theme/inserttable.css":
  123957. /*!******************************************************************************************************************!*\
  123958. !*** ./node_modules/postcss-loader/src??ref--5-1!./node_modules/@ckeditor/ckeditor5-table/theme/inserttable.css ***!
  123959. \******************************************************************************************************************/
  123960. /*! no static exports found */
  123961. /***/ (function(module, exports) {
  123962. 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)}"
  123963. /***/ }),
  123964. /***/ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-table/theme/table.css":
  123965. /*!************************************************************************************************************!*\
  123966. !*** ./node_modules/postcss-loader/src??ref--5-1!./node_modules/@ckeditor/ckeditor5-table/theme/table.css ***!
  123967. \************************************************************************************************************/
  123968. /*! no static exports found */
  123969. /***/ (function(module, exports) {
  123970. 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}"
  123971. /***/ }),
  123972. /***/ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-table/theme/tableediting.css":
  123973. /*!*******************************************************************************************************************!*\
  123974. !*** ./node_modules/postcss-loader/src??ref--5-1!./node_modules/@ckeditor/ckeditor5-table/theme/tableediting.css ***!
  123975. \*******************************************************************************************************************/
  123976. /*! no static exports found */
  123977. /***/ (function(module, exports) {
  123978. 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}"
  123979. /***/ }),
  123980. /***/ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-table/theme/tableselection.css":
  123981. /*!*********************************************************************************************************************!*\
  123982. !*** ./node_modules/postcss-loader/src??ref--5-1!./node_modules/@ckeditor/ckeditor5-table/theme/tableselection.css ***!
  123983. \*********************************************************************************************************************/
  123984. /*! no static exports found */
  123985. /***/ (function(module, exports) {
  123986. 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}"
  123987. /***/ }),
  123988. /***/ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/button/button.css":
  123989. /*!****************************************************************************************************************************!*\
  123990. !*** ./node_modules/postcss-loader/src??ref--5-1!./node_modules/@ckeditor/ckeditor5-ui/theme/components/button/button.css ***!
  123991. \****************************************************************************************************************************/
  123992. /*! no static exports found */
  123993. /***/ (function(module, exports) {
  123994. 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}"
  123995. /***/ }),
  123996. /***/ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/button/switchbutton.css":
  123997. /*!**********************************************************************************************************************************!*\
  123998. !*** ./node_modules/postcss-loader/src??ref--5-1!./node_modules/@ckeditor/ckeditor5-ui/theme/components/button/switchbutton.css ***!
  123999. \**********************************************************************************************************************************/
  124000. /*! no static exports found */
  124001. /***/ (function(module, exports) {
  124002. 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))}"
  124003. /***/ }),
  124004. /***/ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/colorgrid/colorgrid.css":
  124005. /*!**********************************************************************************************************************************!*\
  124006. !*** ./node_modules/postcss-loader/src??ref--5-1!./node_modules/@ckeditor/ckeditor5-ui/theme/components/colorgrid/colorgrid.css ***!
  124007. \**********************************************************************************************************************************/
  124008. /*! no static exports found */
  124009. /***/ (function(module, exports) {
  124010. 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)}"
  124011. /***/ }),
  124012. /***/ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/dropdown/dropdown.css":
  124013. /*!********************************************************************************************************************************!*\
  124014. !*** ./node_modules/postcss-loader/src??ref--5-1!./node_modules/@ckeditor/ckeditor5-ui/theme/components/dropdown/dropdown.css ***!
  124015. \********************************************************************************************************************************/
  124016. /*! no static exports found */
  124017. /***/ (function(module, exports) {
  124018. module.exports = ":root{--ck-dropdown-max-width:75vw}.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);max-width:var(--ck-dropdown-max-width);position:absolute}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel-visible{display:inline-block}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_n,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_ne,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_nme,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_nmw,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_nw{bottom:100%}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_s,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_se,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_sme,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_smw,.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-dropdown .ck-dropdown__panel.ck-dropdown__panel_n,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_s{left:50%;transform:translateX(-50%)}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_nmw,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_smw{left:75%;transform:translateX(-75%)}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_nme,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_sme{left:25%;transform:translateX(-25%)}.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 .ck-button.ck-dropdown__button.ck-off:active,.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-on:active{box-shadow:none}.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-off:active:focus,.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-on:active:focus{box-shadow:var(--ck-focus-outer-shadow),0 0}.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}"
  124019. /***/ }),
  124020. /***/ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/dropdown/listdropdown.css":
  124021. /*!************************************************************************************************************************************!*\
  124022. !*** ./node_modules/postcss-loader/src??ref--5-1!./node_modules/@ckeditor/ckeditor5-ui/theme/components/dropdown/listdropdown.css ***!
  124023. \************************************************************************************************************************************/
  124024. /*! no static exports found */
  124025. /***/ (function(module, exports) {
  124026. 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}"
  124027. /***/ }),
  124028. /***/ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/dropdown/splitbutton.css":
  124029. /*!***********************************************************************************************************************************!*\
  124030. !*** ./node_modules/postcss-loader/src??ref--5-1!./node_modules/@ckeditor/ckeditor5-ui/theme/components/dropdown/splitbutton.css ***!
  124031. \***********************************************************************************************************************************/
  124032. /*! no static exports found */
  124033. /***/ (function(module, exports) {
  124034. 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}"
  124035. /***/ }),
  124036. /***/ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/dropdown/toolbardropdown.css":
  124037. /*!***************************************************************************************************************************************!*\
  124038. !*** ./node_modules/postcss-loader/src??ref--5-1!./node_modules/@ckeditor/ckeditor5-ui/theme/components/dropdown/toolbardropdown.css ***!
  124039. \***************************************************************************************************************************************/
  124040. /*! no static exports found */
  124041. /***/ (function(module, exports) {
  124042. module.exports = ":root{--ck-toolbar-dropdown-max-width:60vw}.ck.ck-toolbar-dropdown>.ck-dropdown__panel{width:max-content;max-width:var(--ck-toolbar-dropdown-max-width)}.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}"
  124043. /***/ }),
  124044. /***/ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/editorui/editorui.css":
  124045. /*!********************************************************************************************************************************!*\
  124046. !*** ./node_modules/postcss-loader/src??ref--5-1!./node_modules/@ckeditor/ckeditor5-ui/theme/components/editorui/editorui.css ***!
  124047. \********************************************************************************************************************************/
  124048. /*! no static exports found */
  124049. /***/ (function(module, exports) {
  124050. 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)}"
  124051. /***/ }),
  124052. /***/ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/formheader/formheader.css":
  124053. /*!************************************************************************************************************************************!*\
  124054. !*** ./node_modules/postcss-loader/src??ref--5-1!./node_modules/@ckeditor/ckeditor5-ui/theme/components/formheader/formheader.css ***!
  124055. \************************************************************************************************************************************/
  124056. /*! no static exports found */
  124057. /***/ (function(module, exports) {
  124058. module.exports = ".ck.ck-form__header{display:flex;flex-direction:row;flex-wrap:nowrap;align-items:center;justify-content:space-between}:root{--ck-form-header-height:38px}.ck.ck-form__header{padding:var(--ck-spacing-small) var(--ck-spacing-large);height:var(--ck-form-header-height);line-height:var(--ck-form-header-height);border-bottom:1px solid var(--ck-color-base-border)}.ck.ck-form__header .ck-form__header__label{font-weight:700}"
  124059. /***/ }),
  124060. /***/ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/icon/icon.css":
  124061. /*!************************************************************************************************************************!*\
  124062. !*** ./node_modules/postcss-loader/src??ref--5-1!./node_modules/@ckeditor/ckeditor5-ui/theme/components/icon/icon.css ***!
  124063. \************************************************************************************************************************/
  124064. /*! no static exports found */
  124065. /***/ (function(module, exports) {
  124066. 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}"
  124067. /***/ }),
  124068. /***/ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/inputtext/inputtext.css":
  124069. /*!**********************************************************************************************************************************!*\
  124070. !*** ./node_modules/postcss-loader/src??ref--5-1!./node_modules/@ckeditor/ckeditor5-ui/theme/components/inputtext/inputtext.css ***!
  124071. \**********************************************************************************************************************************/
  124072. /*! no static exports found */
  124073. /***/ (function(module, exports) {
  124074. 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{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 .1s ease-in-out,border .1s ease-in-out}.ck.ck-input-text:focus{outline:none;border:var(--ck-focus-ring);box-shadow:var(--ck-focus-outer-shadow),0 0}.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),0 0}.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),0 0}@keyframes ck-text-input-shake{20%{transform:translateX(-2px)}40%{transform:translateX(2px)}60%{transform:translateX(-1px)}80%{transform:translateX(1px)}}"
  124075. /***/ }),
  124076. /***/ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/label/label.css":
  124077. /*!**************************************************************************************************************************!*\
  124078. !*** ./node_modules/postcss-loader/src??ref--5-1!./node_modules/@ckeditor/ckeditor5-ui/theme/components/label/label.css ***!
  124079. \**************************************************************************************************************************/
  124080. /*! no static exports found */
  124081. /***/ (function(module, exports) {
  124082. module.exports = ".ck.ck-label{display:block}.ck.ck-voice-label{display:none}.ck.ck-label{font-weight:700}"
  124083. /***/ }),
  124084. /***/ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/labeledfield/labeledfieldview.css":
  124085. /*!********************************************************************************************************************************************!*\
  124086. !*** ./node_modules/postcss-loader/src??ref--5-1!./node_modules/@ckeditor/ckeditor5-ui/theme/components/labeledfield/labeledfieldview.css ***!
  124087. \********************************************************************************************************************************************/
  124088. /*! no static exports found */
  124089. /***/ (function(module, exports) {
  124090. module.exports = ".ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper{display:flex;position:relative}.ck.ck-labeled-field-view .ck.ck-label{display:block;position:absolute}:root{--ck-labeled-field-view-transition:.1s cubic-bezier(0,0,0.24,0.95);--ck-labeled-field-empty-unfocused-max-width:100% - 2 * var(--ck-spacing-medium);--ck-color-labeled-field-label-background:var(--ck-color-base-background)}.ck.ck-labeled-field-view{border-radius:0}.ck-rounded-corners .ck.ck-labeled-field-view,.ck.ck-labeled-field-view.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper{width:100%}.ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{top:0}[dir=ltr] .ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{left:0}[dir=rtl] .ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{right:0}.ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{pointer-events:none;transform-origin:0 0;transform:translate(var(--ck-spacing-medium),-6px) scale(.75);background:var(--ck-color-labeled-field-label-background);padding:0 calc(var(--ck-font-size-tiny)*0.5);line-height:normal;font-weight:400;text-overflow:ellipsis;overflow:hidden;max-width:100%;transition:transform var(--ck-labeled-field-view-transition),padding var(--ck-labeled-field-view-transition),background var(--ck-labeled-field-view-transition)}.ck.ck-labeled-field-view.ck-error .ck-input:not([readonly])+.ck.ck-label,.ck.ck-labeled-field-view.ck-error>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{color:var(--ck-color-base-error)}.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.ck-labeled-field-view__status_error{color:var(--ck-color-base-error)}.ck.ck-labeled-field-view.ck-disabled>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label,.ck.ck-labeled-field-view.ck-labeled-field-view_empty:not(.ck-labeled-field-view_focused)>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{color:var(--ck-color-input-disabled-text)}[dir=ltr] .ck.ck-labeled-field-view.ck-disabled>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label,[dir=ltr] .ck.ck-labeled-field-view.ck-labeled-field-view_empty:not(.ck-labeled-field-view_focused):not(.ck-labeled-field-view_placeholder)>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{transform:translate(var(--ck-spacing-medium),calc(var(--ck-font-size-base)*0.6)) scale(1)}[dir=rtl] .ck.ck-labeled-field-view.ck-disabled>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label,[dir=rtl] .ck.ck-labeled-field-view.ck-labeled-field-view_empty:not(.ck-labeled-field-view_focused):not(.ck-labeled-field-view_placeholder)>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{transform:translate(calc(var(--ck-spacing-medium)*-1),calc(var(--ck-font-size-base)*0.6)) scale(1)}.ck.ck-labeled-field-view.ck-disabled>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label,.ck.ck-labeled-field-view.ck-labeled-field-view_empty:not(.ck-labeled-field-view_focused):not(.ck-labeled-field-view_placeholder)>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{max-width:calc(var(--ck-labeled-field-empty-unfocused-max-width));background:transparent;padding:0}.ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper>.ck-dropdown>.ck.ck-button{background:transparent}.ck.ck-labeled-field-view.ck-labeled-field-view_empty>.ck.ck-labeled-field-view__input-wrapper>.ck-dropdown>.ck-button>.ck-button__label{opacity:0}.ck.ck-labeled-field-view.ck-labeled-field-view_empty:not(.ck-labeled-field-view_focused):not(.ck-labeled-field-view_placeholder)>.ck.ck-labeled-field-view__input-wrapper>.ck-dropdown+.ck-label{max-width:calc(var(--ck-labeled-field-empty-unfocused-max-width) - var(--ck-dropdown-arrow-size) - var(--ck-spacing-standard))}"
  124091. /***/ }),
  124092. /***/ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/list/list.css":
  124093. /*!************************************************************************************************************************!*\
  124094. !*** ./node_modules/postcss-loader/src??ref--5-1!./node_modules/@ckeditor/ckeditor5-ui/theme/components/list/list.css ***!
  124095. \************************************************************************************************************************/
  124096. /*! no static exports found */
  124097. /***/ (function(module, exports) {
  124098. 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)}"
  124099. /***/ }),
  124100. /***/ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/panel/balloonpanel.css":
  124101. /*!*********************************************************************************************************************************!*\
  124102. !*** ./node_modules/postcss-loader/src??ref--5-1!./node_modules/@ckeditor/ckeditor5-ui/theme/components/panel/balloonpanel.css ***!
  124103. \*********************************************************************************************************************************/
  124104. /*! no static exports found */
  124105. /***/ (function(module, exports) {
  124106. 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)}"
  124107. /***/ }),
  124108. /***/ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/panel/balloonrotator.css":
  124109. /*!***********************************************************************************************************************************!*\
  124110. !*** ./node_modules/postcss-loader/src??ref--5-1!./node_modules/@ckeditor/ckeditor5-ui/theme/components/panel/balloonrotator.css ***!
  124111. \***********************************************************************************************************************************/
  124112. /*! no static exports found */
  124113. /***/ (function(module, exports) {
  124114. 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}"
  124115. /***/ }),
  124116. /***/ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/panel/fakepanel.css":
  124117. /*!******************************************************************************************************************************!*\
  124118. !*** ./node_modules/postcss-loader/src??ref--5-1!./node_modules/@ckeditor/ckeditor5-ui/theme/components/panel/fakepanel.css ***!
  124119. \******************************************************************************************************************************/
  124120. /*! no static exports found */
  124121. /***/ (function(module, exports) {
  124122. 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}"
  124123. /***/ }),
  124124. /***/ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/panel/stickypanel.css":
  124125. /*!********************************************************************************************************************************!*\
  124126. !*** ./node_modules/postcss-loader/src??ref--5-1!./node_modules/@ckeditor/ckeditor5-ui/theme/components/panel/stickypanel.css ***!
  124127. \********************************************************************************************************************************/
  124128. /*! no static exports found */
  124129. /***/ (function(module, exports) {
  124130. 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}"
  124131. /***/ }),
  124132. /***/ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/responsive-form/responsiveform.css":
  124133. /*!*********************************************************************************************************************************************!*\
  124134. !*** ./node_modules/postcss-loader/src??ref--5-1!./node_modules/@ckeditor/ckeditor5-ui/theme/components/responsive-form/responsiveform.css ***!
  124135. \*********************************************************************************************************************************************/
  124136. /*! no static exports found */
  124137. /***/ (function(module, exports) {
  124138. 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-large)}.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-large) var(--ck-spacing-large) 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-large);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)}}"
  124139. /***/ }),
  124140. /***/ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/toolbar/blocktoolbar.css":
  124141. /*!***********************************************************************************************************************************!*\
  124142. !*** ./node_modules/postcss-loader/src??ref--5-1!./node_modules/@ckeditor/ckeditor5-ui/theme/components/toolbar/blocktoolbar.css ***!
  124143. \***********************************************************************************************************************************/
  124144. /*! no static exports found */
  124145. /***/ (function(module, exports) {
  124146. module.exports = ".ck.ck-block-toolbar-button{position:absolute;z-index:var(--ck-z-default)}:root{--ck-color-block-toolbar-button:var(--ck-color-text);--ck-block-toolbar-button-size:var(--ck-font-size-normal)}.ck.ck-block-toolbar-button{color:var(--ck-color-block-toolbar-button);font-size:var(--ck-block-toolbar-size)}"
  124147. /***/ }),
  124148. /***/ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/toolbar/toolbar.css":
  124149. /*!******************************************************************************************************************************!*\
  124150. !*** ./node_modules/postcss-loader/src??ref--5-1!./node_modules/@ckeditor/ckeditor5-ui/theme/components/toolbar/toolbar.css ***!
  124151. \******************************************************************************************************************************/
  124152. /*! no static exports found */
  124153. /***/ (function(module, exports) {
  124154. 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__line-break{flex-basis:100%}.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__line-break{height:0}.ck.ck-toolbar>.ck-toolbar__items>:not(.ck-toolbar__line-break){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>:not(.ck-toolbar__line-break),.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)}"
  124155. /***/ }),
  124156. /***/ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/tooltip/tooltip.css":
  124157. /*!******************************************************************************************************************************!*\
  124158. !*** ./node_modules/postcss-loader/src??ref--5-1!./node_modules/@ckeditor/ckeditor5-ui/theme/components/tooltip/tooltip.css ***!
  124159. \******************************************************************************************************************************/
  124160. /*! no static exports found */
  124161. /***/ (function(module, exports) {
  124162. 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_se,.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_se .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_se{left:50%;right:auto}.ck.ck-tooltip.ck-tooltip_se .ck-tooltip__text{right:auto;left:calc(var(--ck-tooltip-arrow-size)*-2)}.ck.ck-tooltip.ck-tooltip_se .ck-tooltip__text:after{right:auto;left:0;transform:translateX(50%)}.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)}.ck.ck-tooltip.ck-tooltip_e{left:calc(100% + var(--ck-tooltip-arrow-size));top:50%}.ck.ck-tooltip.ck-tooltip_e .ck-tooltip__text{left:0;transform:translateY(-50%)}.ck.ck-tooltip.ck-tooltip_e .ck-tooltip__text:after{left:calc(var(--ck-tooltip-arrow-size)*-1);top:calc(50% - var(--ck-tooltip-arrow-size)*1);border-left-color:transparent;border-bottom-color:transparent;border-right-color:var(--ck-color-tooltip-background);border-top-color:transparent;border-left-width:0;border-bottom-width:var(--ck-tooltip-arrow-size);border-right-width:var(--ck-tooltip-arrow-size);border-top-width:var(--ck-tooltip-arrow-size)}.ck.ck-tooltip.ck-tooltip_w{right:calc(100% + var(--ck-tooltip-arrow-size));left:auto;top:50%}.ck.ck-tooltip.ck-tooltip_w .ck-tooltip__text{left:0;transform:translateY(-50%)}.ck.ck-tooltip.ck-tooltip_w .ck-tooltip__text:after{left:100%;top:calc(50% - var(--ck-tooltip-arrow-size)*1);border-left-color:var(--ck-color-tooltip-background);border-bottom-color:transparent;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:0;border-top-width:var(--ck-tooltip-arrow-size)}"
  124163. /***/ }),
  124164. /***/ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/globals/globals.css":
  124165. /*!*******************************************************************************************************************!*\
  124166. !*** ./node_modules/postcss-loader/src??ref--5-1!./node_modules/@ckeditor/ckeditor5-ui/theme/globals/globals.css ***!
  124167. \*******************************************************************************************************************/
  124168. /*! no static exports found */
  124169. /***/ (function(module, exports) {
  124170. 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-transitions-disabled,.ck-transitions-disabled *{transition:none!important}:root{--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:#757575;--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)}"
  124171. /***/ }),
  124172. /***/ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-widget/theme/widget.css":
  124173. /*!**************************************************************************************************************!*\
  124174. !*** ./node_modules/postcss-loader/src??ref--5-1!./node_modules/@ckeditor/ckeditor5-widget/theme/widget.css ***!
  124175. \**************************************************************************************************************/
  124176. /*! no static exports found */
  124177. /***/ (function(module, exports) {
  124178. module.exports = ":root{--ck-color-resizer:var(--ck-color-focus-border);--ck-color-resizer-tooltip-background:#262626;--ck-color-resizer-tooltip-text:#f2f2f2;--ck-resizer-border-radius:var(--ck-border-radius);--ck-resizer-tooltip-offset:10px}.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));top:0}.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:hover>.ck-widget__selection-handle,.ck .ck-widget.ck-widget_with-selection-handle.ck-widget_selected>.ck-widget__selection-handle{opacity:1;background-color:var(--ck-color-focus-border)}.ck .ck-widget.ck-widget_with-selection-handle.ck-widget_selected:hover>.ck-widget__selection-handle .ck-icon .ck-icon__selected-indicator,.ck .ck-widget.ck-widget_with-selection-handle.ck-widget_selected>.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))}"
  124179. /***/ }),
  124180. /***/ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-widget/theme/widgetresize.css":
  124181. /*!********************************************************************************************************************!*\
  124182. !*** ./node_modules/postcss-loader/src??ref--5-1!./node_modules/@ckeditor/ckeditor5-widget/theme/widgetresize.css ***!
  124183. \********************************************************************************************************************/
  124184. /*! no static exports found */
  124185. /***/ (function(module, exports) {
  124186. module.exports = ".ck .ck-widget_with-resizer{position:relative}.ck .ck-widget__resizer{display:none;position:absolute;pointer-events:none;left:0;top:0}.ck-focused .ck-widget_with-resizer.ck-widget_selected>.ck-widget__resizer{display:block}.ck .ck-widget__resizer__handle{position:absolute;pointer-events:all}.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-bottom-right,.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-top-left{cursor:nwse-resize}.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-bottom-left,.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-top-right{cursor:nesw-resize}:root{--ck-resizer-size:10px;--ck-resizer-offset:calc(var(--ck-resizer-size)/-2 - 2px);--ck-resizer-border-width:1px}.ck .ck-widget__resizer{outline:1px solid var(--ck-color-resizer)}.ck .ck-widget__resizer__handle{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)}.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-top-right{top:var(--ck-resizer-offset);right:var(--ck-resizer-offset)}.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-bottom-right{bottom:var(--ck-resizer-offset);right:var(--ck-resizer-offset)}.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-bottom-left{bottom:var(--ck-resizer-offset);left:var(--ck-resizer-offset)}"
  124187. /***/ }),
  124188. /***/ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-widget/theme/widgettypearound.css":
  124189. /*!************************************************************************************************************************!*\
  124190. !*** ./node_modules/postcss-loader/src??ref--5-1!./node_modules/@ckeditor/ckeditor5-widget/theme/widgettypearound.css ***!
  124191. \************************************************************************************************************************/
  124192. /*! no static exports found */
  124193. /***/ (function(module, exports) {
  124194. 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[dir=rtl] .ck-widget.ck-widget_with-selection-handle .ck-widget__type-around>.ck-widget__type-around__button_before{margin-left:0;margin-right:20px}.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}}"
  124195. /***/ }),
  124196. /***/ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js":
  124197. /*!****************************************************************************!*\
  124198. !*** ./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js ***!
  124199. \****************************************************************************/
  124200. /*! no static exports found */
  124201. /***/ (function(module, exports, __webpack_require__) {
  124202. "use strict";
  124203. var isOldIE = function isOldIE() {
  124204. var memo;
  124205. return function memorize() {
  124206. if (typeof memo === 'undefined') {
  124207. // Test for IE <= 9 as proposed by Browserhacks
  124208. // @see http://browserhacks.com/#hack-e71d8692f65334173fee715c222cb805
  124209. // Tests for existence of standard globals is to allow style-loader
  124210. // to operate correctly into non-standard environments
  124211. // @see https://github.com/webpack-contrib/style-loader/issues/177
  124212. memo = Boolean(window && document && document.all && !window.atob);
  124213. }
  124214. return memo;
  124215. };
  124216. }();
  124217. var getTarget = function getTarget() {
  124218. var memo = {};
  124219. return function memorize(target) {
  124220. if (typeof memo[target] === 'undefined') {
  124221. var styleTarget = document.querySelector(target); // Special case to return head of iframe instead of iframe itself
  124222. if (window.HTMLIFrameElement && styleTarget instanceof window.HTMLIFrameElement) {
  124223. try {
  124224. // This will throw an exception if access to iframe is blocked
  124225. // due to cross-origin restrictions
  124226. styleTarget = styleTarget.contentDocument.head;
  124227. } catch (e) {
  124228. // istanbul ignore next
  124229. styleTarget = null;
  124230. }
  124231. }
  124232. memo[target] = styleTarget;
  124233. }
  124234. return memo[target];
  124235. };
  124236. }();
  124237. var stylesInDom = [];
  124238. function getIndexByIdentifier(identifier) {
  124239. var result = -1;
  124240. for (var i = 0; i < stylesInDom.length; i++) {
  124241. if (stylesInDom[i].identifier === identifier) {
  124242. result = i;
  124243. break;
  124244. }
  124245. }
  124246. return result;
  124247. }
  124248. function modulesToDom(list, options) {
  124249. var idCountMap = {};
  124250. var identifiers = [];
  124251. for (var i = 0; i < list.length; i++) {
  124252. var item = list[i];
  124253. var id = options.base ? item[0] + options.base : item[0];
  124254. var count = idCountMap[id] || 0;
  124255. var identifier = "".concat(id, " ").concat(count);
  124256. idCountMap[id] = count + 1;
  124257. var index = getIndexByIdentifier(identifier);
  124258. var obj = {
  124259. css: item[1],
  124260. media: item[2],
  124261. sourceMap: item[3]
  124262. };
  124263. if (index !== -1) {
  124264. stylesInDom[index].references++;
  124265. stylesInDom[index].updater(obj);
  124266. } else {
  124267. stylesInDom.push({
  124268. identifier: identifier,
  124269. updater: addStyle(obj, options),
  124270. references: 1
  124271. });
  124272. }
  124273. identifiers.push(identifier);
  124274. }
  124275. return identifiers;
  124276. }
  124277. function insertStyleElement(options) {
  124278. var style = document.createElement('style');
  124279. var attributes = options.attributes || {};
  124280. if (typeof attributes.nonce === 'undefined') {
  124281. var nonce = true ? __webpack_require__.nc : undefined;
  124282. if (nonce) {
  124283. attributes.nonce = nonce;
  124284. }
  124285. }
  124286. Object.keys(attributes).forEach(function (key) {
  124287. style.setAttribute(key, attributes[key]);
  124288. });
  124289. if (typeof options.insert === 'function') {
  124290. options.insert(style);
  124291. } else {
  124292. var target = getTarget(options.insert || 'head');
  124293. if (!target) {
  124294. throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");
  124295. }
  124296. target.appendChild(style);
  124297. }
  124298. return style;
  124299. }
  124300. function removeStyleElement(style) {
  124301. // istanbul ignore if
  124302. if (style.parentNode === null) {
  124303. return false;
  124304. }
  124305. style.parentNode.removeChild(style);
  124306. }
  124307. /* istanbul ignore next */
  124308. var replaceText = function replaceText() {
  124309. var textStore = [];
  124310. return function replace(index, replacement) {
  124311. textStore[index] = replacement;
  124312. return textStore.filter(Boolean).join('\n');
  124313. };
  124314. }();
  124315. function applyToSingletonTag(style, index, remove, obj) {
  124316. var css = remove ? '' : obj.media ? "@media ".concat(obj.media, " {").concat(obj.css, "}") : obj.css; // For old IE
  124317. /* istanbul ignore if */
  124318. if (style.styleSheet) {
  124319. style.styleSheet.cssText = replaceText(index, css);
  124320. } else {
  124321. var cssNode = document.createTextNode(css);
  124322. var childNodes = style.childNodes;
  124323. if (childNodes[index]) {
  124324. style.removeChild(childNodes[index]);
  124325. }
  124326. if (childNodes.length) {
  124327. style.insertBefore(cssNode, childNodes[index]);
  124328. } else {
  124329. style.appendChild(cssNode);
  124330. }
  124331. }
  124332. }
  124333. function applyToTag(style, options, obj) {
  124334. var css = obj.css;
  124335. var media = obj.media;
  124336. var sourceMap = obj.sourceMap;
  124337. if (media) {
  124338. style.setAttribute('media', media);
  124339. } else {
  124340. style.removeAttribute('media');
  124341. }
  124342. if (sourceMap && typeof btoa !== 'undefined') {
  124343. css += "\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))), " */");
  124344. } // For old IE
  124345. /* istanbul ignore if */
  124346. if (style.styleSheet) {
  124347. style.styleSheet.cssText = css;
  124348. } else {
  124349. while (style.firstChild) {
  124350. style.removeChild(style.firstChild);
  124351. }
  124352. style.appendChild(document.createTextNode(css));
  124353. }
  124354. }
  124355. var singleton = null;
  124356. var singletonCounter = 0;
  124357. function addStyle(obj, options) {
  124358. var style;
  124359. var update;
  124360. var remove;
  124361. if (options.singleton) {
  124362. var styleIndex = singletonCounter++;
  124363. style = singleton || (singleton = insertStyleElement(options));
  124364. update = applyToSingletonTag.bind(null, style, styleIndex, false);
  124365. remove = applyToSingletonTag.bind(null, style, styleIndex, true);
  124366. } else {
  124367. style = insertStyleElement(options);
  124368. update = applyToTag.bind(null, style, options);
  124369. remove = function remove() {
  124370. removeStyleElement(style);
  124371. };
  124372. }
  124373. update(obj);
  124374. return function updateStyle(newObj) {
  124375. if (newObj) {
  124376. if (newObj.css === obj.css && newObj.media === obj.media && newObj.sourceMap === obj.sourceMap) {
  124377. return;
  124378. }
  124379. update(obj = newObj);
  124380. } else {
  124381. remove();
  124382. }
  124383. };
  124384. }
  124385. module.exports = function (list, options) {
  124386. options = options || {}; // Force single-tag solution on IE6-9, which has a hard limit on the # of <style>
  124387. // tags it will allow on a page
  124388. if (!options.singleton && typeof options.singleton !== 'boolean') {
  124389. options.singleton = isOldIE();
  124390. }
  124391. list = list || [];
  124392. var lastIdentifiers = modulesToDom(list, options);
  124393. return function update(newList) {
  124394. newList = newList || [];
  124395. if (Object.prototype.toString.call(newList) !== '[object Array]') {
  124396. return;
  124397. }
  124398. for (var i = 0; i < lastIdentifiers.length; i++) {
  124399. var identifier = lastIdentifiers[i];
  124400. var index = getIndexByIdentifier(identifier);
  124401. stylesInDom[index].references--;
  124402. }
  124403. var newLastIdentifiers = modulesToDom(newList, options);
  124404. for (var _i = 0; _i < lastIdentifiers.length; _i++) {
  124405. var _identifier = lastIdentifiers[_i];
  124406. var _index = getIndexByIdentifier(_identifier);
  124407. if (stylesInDom[_index].references === 0) {
  124408. stylesInDom[_index].updater();
  124409. stylesInDom.splice(_index, 1);
  124410. }
  124411. }
  124412. lastIdentifiers = newLastIdentifiers;
  124413. };
  124414. };
  124415. /***/ }),
  124416. /***/ "./node_modules/webpack/buildin/global.js":
  124417. /*!***********************************!*\
  124418. !*** (webpack)/buildin/global.js ***!
  124419. \***********************************/
  124420. /*! no static exports found */
  124421. /***/ (function(module, exports) {
  124422. var g;
  124423. // This works in non-strict mode
  124424. g = (function() {
  124425. return this;
  124426. })();
  124427. try {
  124428. // This works if eval is allowed (see CSP)
  124429. g = g || new Function("return this")();
  124430. } catch (e) {
  124431. // This works if the window reference is available
  124432. if (typeof window === "object") g = window;
  124433. }
  124434. // g can still be undefined, but nothing to do about it...
  124435. // We return undefined, instead of nothing here, so it's
  124436. // easier to handle this case. if(!global) { ...}
  124437. module.exports = g;
  124438. /***/ }),
  124439. /***/ "./node_modules/webpack/buildin/harmony-module.js":
  124440. /*!*******************************************!*\
  124441. !*** (webpack)/buildin/harmony-module.js ***!
  124442. \*******************************************/
  124443. /*! no static exports found */
  124444. /***/ (function(module, exports) {
  124445. module.exports = function(originalModule) {
  124446. if (!originalModule.webpackPolyfill) {
  124447. var module = Object.create(originalModule);
  124448. // module.parent = undefined by default
  124449. if (!module.children) module.children = [];
  124450. Object.defineProperty(module, "loaded", {
  124451. enumerable: true,
  124452. get: function() {
  124453. return module.l;
  124454. }
  124455. });
  124456. Object.defineProperty(module, "id", {
  124457. enumerable: true,
  124458. get: function() {
  124459. return module.i;
  124460. }
  124461. });
  124462. Object.defineProperty(module, "exports", {
  124463. enumerable: true
  124464. });
  124465. module.webpackPolyfill = 1;
  124466. }
  124467. return module;
  124468. };
  124469. /***/ }),
  124470. /***/ "./src/ckeditor.js":
  124471. /*!*************************!*\
  124472. !*** ./src/ckeditor.js ***!
  124473. \*************************/
  124474. /*! exports provided: default */
  124475. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  124476. "use strict";
  124477. __webpack_require__.r(__webpack_exports__);
  124478. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ClassicEditor; });
  124479. /* 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");
  124480. /* 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");
  124481. /* 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");
  124482. /* 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");
  124483. /* 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");
  124484. /* 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");
  124485. /* 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");
  124486. /* 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");
  124487. /* 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");
  124488. /* 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");
  124489. /* harmony import */ var _ckeditor_ckeditor5_html_embed_src_htmlembed__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @ckeditor/ckeditor5-html-embed/src/htmlembed */ "./node_modules/@ckeditor/ckeditor5-html-embed/src/htmlembed.js");
  124490. /* harmony import */ var _ckeditor_ckeditor5_image_src_image__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @ckeditor/ckeditor5-image/src/image */ "./node_modules/@ckeditor/ckeditor5-image/src/image.js");
  124491. /* harmony import */ var _ckeditor_ckeditor5_image_src_imagecaption__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @ckeditor/ckeditor5-image/src/imagecaption */ "./node_modules/@ckeditor/ckeditor5-image/src/imagecaption.js");
  124492. /* harmony import */ var _ckeditor_ckeditor5_image_src_imagestyle__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @ckeditor/ckeditor5-image/src/imagestyle */ "./node_modules/@ckeditor/ckeditor5-image/src/imagestyle.js");
  124493. /* harmony import */ var _ckeditor_ckeditor5_image_src_imagetoolbar__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @ckeditor/ckeditor5-image/src/imagetoolbar */ "./node_modules/@ckeditor/ckeditor5-image/src/imagetoolbar.js");
  124494. /* harmony import */ var _ckeditor_ckeditor5_image_src_imageupload__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @ckeditor/ckeditor5-image/src/imageupload */ "./node_modules/@ckeditor/ckeditor5-image/src/imageupload.js");
  124495. /* harmony import */ var _ckeditor_ckeditor5_image_src_imageresize__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! @ckeditor/ckeditor5-image/src/imageresize */ "./node_modules/@ckeditor/ckeditor5-image/src/imageresize.js");
  124496. /* harmony import */ var _ckeditor_ckeditor5_link_src_linkimage__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! @ckeditor/ckeditor5-link/src/linkimage */ "./node_modules/@ckeditor/ckeditor5-link/src/linkimage.js");
  124497. /* harmony import */ var _ckeditor_ckeditor5_indent_src_indent__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! @ckeditor/ckeditor5-indent/src/indent */ "./node_modules/@ckeditor/ckeditor5-indent/src/indent.js");
  124498. /* harmony import */ var _ckeditor_ckeditor5_link_src_link__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! @ckeditor/ckeditor5-link/src/link */ "./node_modules/@ckeditor/ckeditor5-link/src/link.js");
  124499. /* harmony import */ var _ckeditor_ckeditor5_list_src_list__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! @ckeditor/ckeditor5-list/src/list */ "./node_modules/@ckeditor/ckeditor5-list/src/list.js");
  124500. /* harmony import */ var _ckeditor_ckeditor5_paragraph_src_paragraph__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! @ckeditor/ckeditor5-paragraph/src/paragraph */ "./node_modules/@ckeditor/ckeditor5-paragraph/src/paragraph.js");
  124501. /* harmony import */ var _ckeditor_ckeditor5_paste_from_office_src_pastefromoffice__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! @ckeditor/ckeditor5-paste-from-office/src/pastefromoffice */ "./node_modules/@ckeditor/ckeditor5-paste-from-office/src/pastefromoffice.js");
  124502. /* harmony import */ var _ckeditor_ckeditor5_remove_format_src_removeformat__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! @ckeditor/ckeditor5-remove-format/src/removeformat */ "./node_modules/@ckeditor/ckeditor5-remove-format/src/removeformat.js");
  124503. /* harmony import */ var _ckeditor_ckeditor5_table_src_table__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! @ckeditor/ckeditor5-table/src/table */ "./node_modules/@ckeditor/ckeditor5-table/src/table.js");
  124504. /* harmony import */ var _ckeditor_ckeditor5_table_src_tabletoolbar__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! @ckeditor/ckeditor5-table/src/tabletoolbar */ "./node_modules/@ckeditor/ckeditor5-table/src/tabletoolbar.js");
  124505. /* harmony import */ var _ckeditor_ckeditor5_typing_src_texttransformation__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! @ckeditor/ckeditor5-typing/src/texttransformation */ "./node_modules/@ckeditor/ckeditor5-typing/src/texttransformation.js");
  124506. /* harmony import */ var _ckeditor_ckeditor5_basic_styles_src_superscript__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! @ckeditor/ckeditor5-basic-styles/src/superscript */ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/superscript.js");
  124507. /* harmony import */ var _ckeditor_ckeditor5_basic_styles_src_subscript__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! @ckeditor/ckeditor5-basic-styles/src/subscript */ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/subscript.js");
  124508. /* harmony import */ var _ckeditor_ckeditor5_basic_styles_src_strikethrough__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! @ckeditor/ckeditor5-basic-styles/src/strikethrough */ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/strikethrough.js");
  124509. /* harmony import */ var _ckeditor_ckeditor5_basic_styles_src_underline__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! @ckeditor/ckeditor5-basic-styles/src/underline */ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/underline.js");
  124510. /* harmony import */ var _ckeditor_ckeditor5_font_src_fontcolor__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! @ckeditor/ckeditor5-font/src/fontcolor */ "./node_modules/@ckeditor/ckeditor5-font/src/fontcolor.js");
  124511. /* harmony import */ var _ckeditor_ckeditor5_font_src_fontbackgroundcolor__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! @ckeditor/ckeditor5-font/src/fontbackgroundcolor */ "./node_modules/@ckeditor/ckeditor5-font/src/fontbackgroundcolor.js");
  124512. /* harmony import */ var _ckeditor_ckeditor5_alignment_src_alignment__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! @ckeditor/ckeditor5-alignment/src/alignment */ "./node_modules/@ckeditor/ckeditor5-alignment/src/alignment.js");
  124513. // import MediaEmbed from '@ckeditor/ckeditor5-media-embed/src/mediaembed';
  124514. class ClassicEditor extends _ckeditor_ckeditor5_editor_classic_src_classiceditor__WEBPACK_IMPORTED_MODULE_0__["default"] {
  124515. }
  124516. // Plugins to include in the build.
  124517. ClassicEditor.builtinPlugins = [
  124518. _ckeditor_ckeditor5_essentials_src_essentials__WEBPACK_IMPORTED_MODULE_1__["default"],
  124519. _ckeditor_ckeditor5_adapter_ckfinder_src_uploadadapter__WEBPACK_IMPORTED_MODULE_2__["default"],
  124520. _ckeditor_ckeditor5_autoformat_src_autoformat__WEBPACK_IMPORTED_MODULE_3__["default"],
  124521. _ckeditor_ckeditor5_basic_styles_src_bold__WEBPACK_IMPORTED_MODULE_4__["default"],
  124522. _ckeditor_ckeditor5_basic_styles_src_italic__WEBPACK_IMPORTED_MODULE_5__["default"],
  124523. _ckeditor_ckeditor5_basic_styles_src_underline__WEBPACK_IMPORTED_MODULE_30__["default"],
  124524. _ckeditor_ckeditor5_basic_styles_src_strikethrough__WEBPACK_IMPORTED_MODULE_29__["default"],
  124525. _ckeditor_ckeditor5_basic_styles_src_subscript__WEBPACK_IMPORTED_MODULE_28__["default"],
  124526. _ckeditor_ckeditor5_basic_styles_src_superscript__WEBPACK_IMPORTED_MODULE_27__["default"],
  124527. _ckeditor_ckeditor5_block_quote_src_blockquote__WEBPACK_IMPORTED_MODULE_6__["default"],
  124528. _ckeditor_ckeditor5_ckfinder_src_ckfinder__WEBPACK_IMPORTED_MODULE_7__["default"],
  124529. // EasyImage,
  124530. _ckeditor_ckeditor5_heading_src_heading__WEBPACK_IMPORTED_MODULE_9__["default"],
  124531. _ckeditor_ckeditor5_html_embed_src_htmlembed__WEBPACK_IMPORTED_MODULE_10__["default"],
  124532. _ckeditor_ckeditor5_image_src_image__WEBPACK_IMPORTED_MODULE_11__["default"],
  124533. _ckeditor_ckeditor5_image_src_imagecaption__WEBPACK_IMPORTED_MODULE_12__["default"],
  124534. _ckeditor_ckeditor5_image_src_imagestyle__WEBPACK_IMPORTED_MODULE_13__["default"],
  124535. _ckeditor_ckeditor5_image_src_imagetoolbar__WEBPACK_IMPORTED_MODULE_14__["default"],
  124536. _ckeditor_ckeditor5_image_src_imageupload__WEBPACK_IMPORTED_MODULE_15__["default"],
  124537. _ckeditor_ckeditor5_image_src_imageresize__WEBPACK_IMPORTED_MODULE_16__["default"],
  124538. _ckeditor_ckeditor5_link_src_linkimage__WEBPACK_IMPORTED_MODULE_17__["default"],
  124539. _ckeditor_ckeditor5_indent_src_indent__WEBPACK_IMPORTED_MODULE_18__["default"],
  124540. _ckeditor_ckeditor5_link_src_link__WEBPACK_IMPORTED_MODULE_19__["default"],
  124541. _ckeditor_ckeditor5_list_src_list__WEBPACK_IMPORTED_MODULE_20__["default"],
  124542. // MediaEmbed,
  124543. _ckeditor_ckeditor5_paragraph_src_paragraph__WEBPACK_IMPORTED_MODULE_21__["default"],
  124544. _ckeditor_ckeditor5_paste_from_office_src_pastefromoffice__WEBPACK_IMPORTED_MODULE_22__["default"],
  124545. _ckeditor_ckeditor5_remove_format_src_removeformat__WEBPACK_IMPORTED_MODULE_23__["default"],
  124546. _ckeditor_ckeditor5_table_src_table__WEBPACK_IMPORTED_MODULE_24__["default"],
  124547. _ckeditor_ckeditor5_table_src_tabletoolbar__WEBPACK_IMPORTED_MODULE_25__["default"],
  124548. _ckeditor_ckeditor5_typing_src_texttransformation__WEBPACK_IMPORTED_MODULE_26__["default"],
  124549. _ckeditor_ckeditor5_font_src_fontcolor__WEBPACK_IMPORTED_MODULE_31__["default"],
  124550. _ckeditor_ckeditor5_font_src_fontbackgroundcolor__WEBPACK_IMPORTED_MODULE_32__["default"],
  124551. _ckeditor_ckeditor5_alignment_src_alignment__WEBPACK_IMPORTED_MODULE_33__["default"]
  124552. ];
  124553. // Editor configuration.
  124554. ClassicEditor.defaultConfig = {
  124555. alignment: {
  124556. options: ['left', 'center', 'right', 'justify']
  124557. },
  124558. toolbar: {
  124559. items: [
  124560. 'heading',
  124561. '|',
  124562. 'bold', 'italic', 'underline', 'strikethrough', 'subscript', 'superscript',
  124563. 'link', 'bulletedList', 'numberedList',
  124564. '|',
  124565. 'fontColor', 'fontBackgroundColor',
  124566. '|',
  124567. 'alignment',
  124568. '|',
  124569. 'indent', 'outdent',
  124570. '|',
  124571. 'imageUpload', 'blockQuote', 'insertTable',
  124572. // 'mediaEmbed',
  124573. 'undo', 'redo'
  124574. ]
  124575. },
  124576. image: {
  124577. styles: [
  124578. 'alignLeft', 'alignCenter', 'alignRight'
  124579. ],
  124580. toolbar: [
  124581. 'imageStyle:full',
  124582. 'imageStyle:side',
  124583. 'imageStyle:alignLeft',
  124584. 'imageStyle:alignRight',
  124585. 'imageStyle:alignCenter',
  124586. 'imageStyle:alignBlockLeft',
  124587. 'imageStyle:alignBlockRight',
  124588. '|',
  124589. 'imageResize',
  124590. '|',
  124591. 'imageTextAlternative',
  124592. ]
  124593. },
  124594. table: {
  124595. contentToolbar: [
  124596. 'tableColumn',
  124597. 'tableRow',
  124598. 'mergeTableCells'
  124599. ]
  124600. },
  124601. // This value must be kept in sync with the language defined in webpack.config.js.
  124602. language: 'en'
  124603. };
  124604. /***/ })
  124605. /******/ })["default"];
  124606. });
  124607. //# sourceMappingURL=ckeditor.js.map